Sunday, February 20, 2011

Distortion and Perspective – tilting buildings

Especially when using a wide-angle lens, or wide-angle setting, photographing tall buildings, trees, or other structures, causes the resulting photos to show the structures “falling in on themselves”. What causes that distortion, can it be avoided, and can it be fixed?
BuckheadThe situation is illustrated here in an exaggerated manner to show the problem. This is not distortion, although we may commonly call it “perspective distortion”. This is really how the world – optics, physics, and geometry – really work. When we look at the scene we seem not to see this distortion. Our brains take care of what comes through our eyes, instantly process the view, and present us with an “internal model of the world”. We know the buildings are vertical, and that is what we think we see.
BuckheadHere is a view looking up at a building. Again there is much perspective distortion, but in this view it does not seem to bother us. When we look up, this is what we see also, and we accept this perspective as natural.
Why the difference? In the wide-angle view we think we are farther away then was actually the case. The camera covered a wider field of view than we would see. From an actual distance where we could take in that view with our eyes, we would not see the same perspective. So the image does not jive with our normal experience. Can that problem be avoided or corrected?
Yes, the perspective distortion can be avoided: Do not tilt the camera upwards. It is as simple as that. When the camera is horizontal, more specifically when the sensor plane is parallel with the vertical surfaces, the resulting photo will show all the vertical lines indeed parallel and vertical. That comes from the optics and geometry, but let’s not get into the science.
But, you say, I can’t get all of the building into the picture, and besides, that gets a lot of uninteresting foreground into the photo. So my first suggestion is rotate the camera to take vertical pictures. Now you can’t get in all that you want to show. So take several pictures. Here are a series of photos that were taken with the camera pretty much horizontal and rotated for vertical pictures.
BuckheadBuckheadBuckheadBuckheadBuckhead
Note that I took a series of photos that overlap the scene. The reason is so LJK_1964-8-PGpan-raw-400that I can let Windows Live Photo Gallery combine the photos into a panorama. Here it is. Now I have a wide-angle photo of this streetscape in Buckhead, Atlanta, Georgia, that looks pretty good. With some cropping and less of the monotonous foreground I get a nice photo.
LJK_1964-8-PGpan-cropped-600
Can Photo Gallery do such a nice stitching job with photos if I tilt the camera up a bit as I take the shots so that more of the buildings shows?
You may have seen claims that you can do that (see my post “Distortion and Perspective”). Unfortunately when you ask Photo Gallery to stich such a set it works out differently.
Here again is a set of five shots, this time with the camera tilted up to eliminate the foreground pavement.
BuckheadBuckheadBuckheadBuckheadBuckhead
LJK_1979-84-PGpan-400Now hand them to the Panorama tool in Photo Gallery. Does it correct the perspective distortion? Take a look. The simple Panorama tool in Windows Live Photo Gallery does a fine job when you hold the camera to shoot horizontally. With photos that were taken aiming up, or down, the resulting stich will be more like part of a circular fish-eye image.
But there is a solution even for this set of photos. Photo Gallery, under the Create > More Tools command offers Create Image Composite… – if you imagehave Microsoft Image Composite Editor imageinstalled. (It is a free download, you can get it here).
ICE, as I like to call it, is a very powerful and versatile stitching and perspective control program. It permits control over the projection of the resulting image – in this case I set it to Cylinder (Horizontal) because that matches the situation. The resulting image can be controlled in real time – you see exactly what you get as you drag the image with pointer. You can also crop the image right in ICE.
Here is a resulting picture from ICE with a horizontal view of over 100 degrees.
LJK_1979-84-ICE-crop-600
Notice that I have not completely eliminated the “tilting” – note the tall building at the left – it looks more natural this way.
So you see, perspective distortion is readily overcome. A bit of planning ahead and you can get the pictures you envision.
Good shooting to you!
For another post on perspective correction using ICE, see Perspective Correction using Image Composite Editor.


Please also visit my blog on computer tips: This ‘n That

Sunday, February 6, 2011

Distortion and Perspective

A while back a colleague posted:
Eliminate wide angle distortion with Panoramic photosHave you ever wished that you could capture a whole scene in one frame without having the trees/light poles/buildings slant towards the center?  You can!  
And then, unthinkingly, proceeded to confuse perspective and distortion as well as the readers.
In this post I would like to take up the first part: distortion.
Most of tzoom lenses on popular cameras present some barrel distortion on the low end of the focal length range. What is barrel distortion? Here is a photo taken with the lens covering about 76 degrees, the equivalent of a 28mm lens on a 35mm camera.
LJK_1894-600
LJK_1894-PSP-600This is the inside of the famous Grill in Athens, Georgia. There was no way to step back far enough so I used the shortest focal length setting – 18mm. Note the curved ceiling. This is distortion. Here an exaggerated version with more barrel distortion to illustrate the effect.
The lens barrel distortion is pretty well gone at longer focal length settings. So I took several overlapping exposures of the same wall and stitched them into a panorama with Windows Live Photo Gallery. To show the stitching I did no cropping:
LJK_1895-Grill-WLPGst-600
ICEWell the barrel distortion is well reduced but now there is obvious perspective distortion. Live Photo Gallery does not provide any controls for the stitching process, but Microsoft Image Composite Editor, “ICE”, does. ICE allows shifting the combined image to achieve perspective control. I will have more on this in another post. For now here is the resulting image, again without cropping from ICE:
LJK_1895-Grill-ICEst-600
So it is possible to reduce wide-angle lens barrel distortion by using tiled exposures obtained at focal length settings that do not show the distortion.
The slanting tress/light poles/buildings is, however, a perspective problem. More on that in another post.
Grill-ICE-2 (600x196)