2 & 3 point perspective matching

Old SketchUp forum thread that pre-dates Match Photo.

michael young

12/8/04

Okay -- here's everything all in one package, including Ron Kempke's 3-point construction.

I've made a couple little changes to make things clearer.

If you follow the attached files in order, you will get a system for dropping your models into existing photographs, whether in 2-point or 3-point perspective.

Many thanks for the feedback and help I've gotten putting this together.

--Michael

Archive.zip

Ben

12/9/04

Mike,

Haven't even looked at it yet, but want to thank you for your contribution.

Ben

Jackson Barkess

12/10/04

Thanks for all your work Michael, although I must admit I'm on attempt number three and I still can't get it to work. Dang, that's a lot of geometry to keep track of!

Jackson

Francois

12/10/04

Michael,

Thank you very much for sharing your excellent package + the time and the work needed to put all this together. This will be very helpful.

I have 2 questions relative to the 2 point procedure :

- the base of the reconstructed building is on the floor. Can this floor be used as well as a floor plan for other buildings modeled outside of the limits of the reconstructed building ?

- if something is modeled outside the "limits of the building" that was reconstructed, will the perspective be correct and matching the one in the photo

- once you have reconstructed the "limits of the building" and turned it into a 3D model usable with SU and if you know one of the dimensions of the building, can you scale the entire model (including the picture) and keep everything into the previously defined perspective ?

Francois

michael young

12/10/04

Hi Jackson,

Yes, it's awful for a while, until the construction starts to make sense. Then suddenly BOINK and you can do the whole thing in 15 or 20 minutes, and of course that sets you up for that photograph for as long as you use it.

But the fiddly part in the beginning... *ALL* of that could be coded! The user would pick the three vanishing points, and that is all: The program would return the line of sight. That's it. And you'd be set up to model within the photograph. I think that's a very direct, simple interface.

Trouble is, it's been 20 years since I coded *anything* and I'm not, frankly, up to speed (at all). If someone were in code mode and put this into SU, or maybe a Ruby script, it's just simple high-school trig.

So I apologize for the geometric intricacies. The daunting feeling does subside, and it becomes craft.

Take a close look at Ron Kempke's construction; that is at the base of it all, and if you have a feeling for that construction, the thing becomes much less fiddly.

--Michael

Todd Burch

12/10/04

I'm sure I can write this in Ruby... it's just a time thing right now. Other priorities keep bubbling to the top.

Michael, did you ever get my private email a week or two ago about the technique I proposed, using a section cut, for toggling an image on and off while working out the points?

Michael Young

12/10/04

Hello Francois,

If I understand your questions correctly:

Yes, once you have established the 'floor plan' of the model, you can expand or otherwise modify it, including go as far outside its boundaries as you require. Everything will remain in scale.

At some point, if you exceed the borders of the actual photograph, the perspective can become too distorted to be usable, but even so, everything will still be in scale.

When you set up the two-point solution, the 'leading edge' determines the scale. So, before you construct all the geometry, scale your photograph so that the 'leading edge' is at its true size in SketchUp.

--M

[%sig%]

Michael Doherty

12/10/04

Todd,

No, sorry, I did not get the email you sent me about section cuts.

I don't know why...I may have deleted it by mistake.

I look forward to seeing that!

--M

Ron Kempke

12/10/04

Very nice presentation, Michael. I'm glad you've grasped my cryptic solution to the 3-pt. registration problem.

If I may, I'd like to explain why many perspectives (and photos) appear distorted. I've read all sorts of explanations for this phenomenon but few address the actual cause. We humans like to view photos nearly perpendicular to their plane surface and we'll increase the distance between us and the image in order to see it that way. If our viewing location (relative to the plane of the photo) doesn't exactly match the camera's location (relative to the plane of the photo) when it recorded the image, the photo will exhibit some distortion, particularly at its edges. Photos appear undistorted throughout the entire image only when our viewing location exactly matches the camera's.

The trick is to photograph the image from a location that will match the viewer's preferred viewing location. This is successfully accomplished by restricting the cone of vision (narrowing the field of view or increasing focal length) to an included angle of about 35 degrees. 35 degrees divided by 2 equals 17.5 degrees from true perpendicular. 17.5 degrees off true perpendicular seems to be about the limit we humans will tolerate for the edges of images we view. More than that causes us to increase the distance between us and the plane of the image.

This phenomenon is the reason most perspective drawing instruction warns of placing vanishing points too close together or using too great an angle of view for the plan view's cone of vision. Once understood, distortion can be always be avoided by restricting the cone of vision. If the model doesn't fit within the cone, back the camera away from the model rather than shortening the focal length (widening the field of view). Enlarge the final image so that holding it at arm's length reproduces the intended cone of vision. The same holds true for posters or wall-sized images; viewer's will subconsciously back away from them until the preferred cone of vision is reached.

Thanks.

Ron

michael young

12/10/04

Francois,

In the file called "B) 2pt matching.skp", you can take it as far as page 7; then, if you know one of the dimensions of the floor plan, you can scale the entire construction to that.

The same logic applies to the 3-point construction: In the file called "D) 3pt construction.skp", you could take it to page 4. At this point, if you know one of the floor plan dimensions, you can scale everything to that.

If you did *not* know one of the floor plan dimensions, but instead you knew the height of the building, you could go as far as page 5. The length of the line K'C is the height of the building; scale the whole constructiont to this (if you know the height of the building).

--Michael

Michael Young

12/10/04

Ron,

Really good explanation. It should serve as a guide to perspective rendering, I think. Many of the renderings I see (and I do this, too, I admit!) use completely unrealisitic fields of view to dramatize the rendering or to make an ordinary-looking building seem intriguing. Alas, the beholder of the rendering then cannot really tell what the thing will actually look like, even though the geometry is correct. In cities where you can only get a closeup view and need to show the whole structure, you're pretty much guaranteed to make an overly dramatic presentation.

I notice that when I am within an interior space, my *perceived" field of view seems to be wider than my *actual* visual field. So renderings with wide angles of view sometimes seem 'right' in an interior, when they same angle of view will look weird on an exterior.

I think this is because the lines of convergence in an interior view start overhead and underfoot, while outside they start at the edges of the object and recede.

Do you have the same hit on this? --M

Francois

2/10/04

Hello Michael,

Yes, you understood my questions. I think I understand now.

Thanks a lot again for your explanations.

Francois

Michael Doherty

12/108/04

Hello Michael,

It seems to me that we have to deal with these kind of long actions/procedures just because, in SU, we can't :

- rotate freely a picture (in a background) independantly of the model being constructed

- or because we can't freely readjust the axis to the actual axis that are being used in the picture

If we have the latest, it seems to me that building a 3D model having the actual picture perspective would be a snap.

Do you mind commenting on this ?

Jim@last, is there anything you can tell us on this ? Why can't we do this ? Any chance to get these features soon ?

I am not the first one to request such functions (to easily integrate SU models into photos), hence my request here above and again.

Francois

michael young

12/10/04

Hi Francois,

I've had the same requests, because I also believe if we could have a static background image (which was scalable but otherwise immovable), we could simply jockey the model into position for the photo, save the page, and be done with it. It would not be mathematically precise, true — but in fact this method of Ron's and mine depends on the user's judgment setting it up, so it is only as precise as our judgment.

My hit on why @Last has not implemented the static background is that it may not be consistent with the SketchUp 'way', which is a deeply considered thing and one of the reasons we all love the app so much: It is deeply, internally consistent and all of the tools and functions are carefully inter-related. There is not much a new user can do to spoil this accidentally.

For instance, I and some others have wanted a way to partially suppress inference under special conditions. But the problem with that is that an unsuspecting new user could become frustrated with iinference before he understands it, suppress it, and never understand one of the basic tenets of the program which gives it so much power.

The third possible reason is that this perspective method may not be the most elegant one, and the developers would probably rather leave something out than push something into the program that is not as clever and deep as the rest of it. I suspect this is what is up, and I support it, actually. I really like how they've done this so far. Every single time I've wanted a feature it's come out a bit later than I wanted, but it's been five times better in its execution than I could ever have dreamt up and fully integrated into the feel and fit of the program.

So, this is perhaps a stop-gap. Yeah, we definitely need perspective matching. But it isn't a trivial thing, and there may be a much more elegant way. Until then, we have this, and Todd Burch may be able to code it, so it will be far easier to use.

That's the best hit on it I have. Hope that makes sense... best --Michael

[%sig%]

Francois

12/11/04

Michael,

Thanks for your views on this.

Yes, I understand and that make sense.

Let's hope @Last will hear these and bring some good news with later releases.

Francois

Gordon

12/11/04

"cone of vision"

OooooKaaaa,

So let me see if I got this in my head correct (I think I'm totally out of my league, but). Ron, you're saying that (and let me pump this out in my own words...ohh boy!) that when we 'humans' view something we like to see it (the subject) in a cone of vision that is no greater than 35 degrees. And if it doesn't fit...then we will either back away until it does fit (or...of course, we would then have to move our eyes, or head and unknowingly refocus in our mind). Now in a picture that is not possible (to move our eyes or head) so that, then...when the cone is 'violated' we subconciously...object to the view/picture!?!?

Oddly, I just came from a vision test and the optomatrist mentioned that when we look straight forward when begin to use our perliferal vision at about 18 degrees from the perpendicular (both left and right). And that's a total of 36 degrees just one degree over what you mentioned for the cone of vision (at 35 degrees).

So then, when I take a photograph of a subject (say a building) then I should have that subject in my cone of vision BEFORE I take up my camera to view the subject and then be sure that I get it all in the viewer (within reason) when I take the shot. Now if I can not then IF I construct the subject 'building' using SU I should tweak it a bit to get that cone the right size? And that info ZIP file will help us accomplish this?

Am I making more out of this than is required (or am I truely out of my league)?

Ron Kempke

12/12/04

Gordon,

Locate the vanishing points in your photograph, then determine the distance between the plane of the photo and the camera by using the geometry that Michael has illustrated. The camera's location becomes the apex of the cone of vision. The distance between camera and photo is measured along a perpendicular to the photo that also contains the cone's apex. This perpendicular is the axis of the cone and the cone intersects the plane of the photo in a circle. (The farther the camera is from the photo, the larger will be the circle's diameter.) The image of your subject, whether it be in a viewfinder or in an SU viewport, should lie within the circle. Parts of the subject that lie outside the circle will begin to appear distorted whenever the image isn't viewed from the camera's location, which is most of the time. If the geometric relationships are still unclear, I'll attempt to illustrate them.

Ron

Bernard Hagan

12/12/04

G'day

This is a great discussion on a topic I thought beyond me - probably still is. I've learnt so much from this group.

I've build a model using a photograph and it works just fine - expept that the rectangularity of the model is not aligned to the red-green axes. When I rotate everything - the model, the photograph and the line of sight all together - so that the rectangles align to the red-green axes and then try to position the camera, the resultant view isn't at right angles to the pictue's plane.

I can't understand why. It's obvious I don't comprehend this process as well as I thought I did.

Has something pretty basic passed me by?

Bernard

Michael Doherty

12/12/04

Oops

Sorry mate, I didn't think it through. I used the wrong sight distance to position the camera - the distance from camera to the image [which I didn't hide] instead of the distance from the camera to the model. Great forum Bernard

michael young

12/12/04

Bernard,

Congratulations!

There are many ways of coming adrift while constructing all of this, and I make mistakes that are similar. When I find the line of sight, I like to save it on its own layer and make it a striking color so I always know what the thing is.

thanks for your feedback --M

pault

10/5/05

sorry guys I disagree!!! if SU allowed a photo backround to be switched on or off it would make my life so much easier. I find myself jumping between SU and photoshop to achieve a result that is automatic in MAX

Bruce Walker

10/5/05

How much does Max cost, just out of interest.

Phil Meadows

10/5/05

very nice... I did a similar thing last year:

<Software for presentation page layout/publishing>

rkempke

10/6/05

I'm finalizing a simpler, faster process for finding the exact camera location for compositing a model with a photo. The process uses the camera_parameters.rb script, measurements made directly from the photo, and simple trig calculations. It omits most of the geometric construction suggested by myself and Michael Young. Would anyone be interested?

Jon

10/6/05

sure would be...im still looking for an even SEMI easy way to line up models with photos...

rkempke

10/6/05

I'll put together a step-by-step tutorial and post it sometime next week.

Michael Young

10/6/05

rkempke wrote: I'm finalizing a simpler, faster process for finding the exact camera location for compositing a model with a photo. The process uses the camera_parameters.rb script, measurements made directly from the photo

Well *yeah*, that's brillant! That's the actual, real solution to all of this. This is something people can actually USE. wonderful idea. —M

Jackson Barkess

10/7/05

RKempke- I would be VERY interested!

Jackson

Peter

10/7/05

I know need to understand this, I downloaded the tutorial...but it's still going to take some time for my mind to absorb.

Well done for producing this, producing 3d models from photos is a great shortcut.

Peter

rkempke

10/14/05

I said I'd post a tutorial this week and I apologize for not being ready. I haven't been able to devote much time to it this week. I do have solutions for every conceivable situation you may encounter in a 1-pt., 2-pt., or 3-pt. perspective, but each situation requires its own tutorial with a unique set of instructions and calculations. If you can tell me which perspective case (1, 2, or 3 pt.) you need, I can work on those tutorials first. The entire set will be a complete reference for matching any perspective you may encounter.

Ron

Francois

11/2/05

Hello Ron,

Without putting any kind of pressure on you, is it possible to have an idea of when you could have a 2pt or 3 pt tutorial ready to share with us ?

Thank you very much in advance.

François

[%sig%]

Michael Doherty

11/3/05

Reading this thread I though some of you may be interested in this solution to doing photomontage in sketchup I worked on a couple of years ago.

It's based on making virtual cameras with a foreground and background version of the same image.

There may be something in there someone could find useful.

The negative was you had to know here the photo was taken from in relation to the model but maybe not given some of the detail above.

http://www.sketch3d.com/forum/read.php?f=4&i=6115&t=6026#reply_6115 [dead link]

jayco1999

10/5/06

I see this thread has been dormant for a while, but I have a question that is relevant to the topic:

My situation is basically the reverse of the method described here - I have a perspective view saved as a "Page", and I would like to determine what the "station point" (i.e. camera position) is for that view on the ground plane, so that I can go out and photograph the context and then insert the SketchUp model into it. Does anyone know if there's a way to locate that point on the ground plane in the SketchUp model?

Thanks!

Chris Fullmer

10/5/06

There is a script that costs $4.00 at smustard that does this. Its called NoteCameraPoint.rb:

http://www.smustard.com/script/NoteCameraPoint

Hope that helps,

Chris Fullmer