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)


Thursday, December 2, 2010

Happy Holidays! Word 2010 as my Art Studio

HappyHolidays

Wishing you all the best for the Holiday season and the Coming Year!

This card has been in the works for well over a year. Last December I prepared decorations as I remember them from way back in Europe some seven decades ago: Home-made cookies and candy and real candles, of course. 2009-12-23 ChristmasTree-DS 018 - Copy

Then came the photo session. The shot I finally settled on was this: You can see some of my set and how the lights were set up. File conversion, touch-up and cropping was done in Windows Live Photo Gallery. For the final picture editing and manipulation, I used Microsoft Office Word 2010 and the marvelous Picture Tools it provides. The image was converted HappyHolidays-W2010using Artistic effectsCutout, set to 6 shades. I added three shapes – a black box to define the background, a gradient for the glow around the candle and a four-point star for the light spikes. It is nice how images can be stacked with specific colors picked as the transparent layer. Cropping and the greeting text, with Text effects applied, finished it to my satisfaction. 

Sure, I have image editing programs that can do all that, and better. But I enjoyed using the simple tools in Word, Windows Live Photo Gallery, and Paint, to create just what I wanted to share with you. We all enjoy making and receiving home-made gifts. This one I made for you!

 

Wednesday, November 17, 2010

Noise reduction in photos

In another post I showed how to lighten shadow detail in photos with strong lighting contrasts (Coping with harsh sunlight). The price one pays for lightening dark areas is making noise much more noticeable. Although there is no free lunch, it is possible to reduce the price. “Noise Reduction” to the rescue.

Here is an example photo, one that was taken in direct sunlight, with deep shadows in the subjects face. The strip shows a section of the original with the same section from heavily post-processed versions.

The left-most image is a crop from the original – clearly too dark to even recognize the child. Processing was done using Windows Live Photo Gallery 2011. In the second image the Adjust ExposureShadows slider was set full right, the edit mode closed to save the file and the process repeated. This just about eliminated the shadows. You can see the effect better by clicking on the image strip for a larger view. Noise became very prominent in the areas that had been dark.

Next I aggressively reduced noise, see third image. You can see that the image histogramis “smoother” but has some ugly artifacts. In the “lighten shadows” operation the dark area was lightened by a factor of about six. See the histogram of a small area (original on top). The noise was also increased by this factor and was too high to be effectively eliminated by the noise reduction step.

How about doing the noise reduction first then the lighten shadows operation? The result is shown in the fourth image. Smoother, but notice how small detail (hair in front of hat) has been blurred.

The fifth, right-most, image was produced by reducing noise, but less aggressively, then lightening the shadows, followed by another noise reduction step. This last procedure produced the most acceptable result.

Still no free lunch, but using all the editing tools available in Photo Gallery can go a long way to getting results you can share with pride.

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

 

Saturday, October 23, 2010

Coping with harsh sunlight

Since time immemorial photographers have been admonished to avoid the noonday sun. Yet morning and evening sunlight, though nicer in direction andLJK_1744-DEMO3-A3 (640x640) color, can also produce inky-black shadows in pictures, that make them almost worthless.

There are ways around this dilemma.

SunPick a setting where lots of light is reflected into the shadows. Think white-washed walls on Greek islands, sugar-white sand on Gulf coast beaches, fresh-fallen snow. Maybe those are not always practical.

SunUse one or more reflectors to lighten up the shade. I like white umbrellas, they are more compact than most professional equipment and lot less expensive. Watch the umbrella display on your next visit to the drug store.

SunTurn on the flash on the camera for fill-in light. Most digital cameras even have a setting for this.

Light bulbIf none of the above are workable solution for a situation, there is post-processing! You guessed the reason I chose a fast-moving kid in bright evening sunlight with the surroundings in deep shade, so the shadows would be dark!

Getting the shadows lighter is easy. Here views of Picasa and Windows Live Photo Gallery in action. Note the red pointers.

fix-shadows

In Picasa (on the left) the control is called “Fill Light” – the default setting is with the slider at the left. Moving the slider right lightens the shadows and you can see immediately the effect. In Photo Gallery the control is under “Adjust exposure” and is called “Shadows” (click Fine tune to get to the controls). This control goes both ways, to the left to darken shadows, to the right to lighten them.

Ah, but even here at Café Ludwig there is no free lunch. There is a price to pay when doing this. Let’s take a look at exactly what happens when you “lighten the shadows”. The image consists of individual pixels, each with its own level (really in each color – red, green, and blue). The lower level pixels are changed – amplified – to a higher level. The lowest level pixels, nearly black, are also at the lowest electrical level. There is always some electrical noise in processing signals, the lowest pixels are affected the most.

If the noise is just one bit up or down, that is 1 in 256 for normal 8-bit JPG images, then the bits at level 1 maybe recoded as o, 1, or 2 – a huge percentage. The noise problem gets less for higher pixel values. A pixel at level 10 with this noise would be 9, 10, or 11. Just a ten percent change. LJK_1751-DEMO3-A2

When these pixels are increased in value, so is the noise. Double that level 10 pixel, and the noise is now twice as large. Here is a close-up section of a photo showing the face our athlete. The left side was in deep shadow, the right in full sun. Bringing up the low-end pixels to “lighten the shadows” also brought up the noise. You can readily see that in the illustration.

So there are limits to post-processing “fill light”. Is there help for this? Of course, why else would I ask the question?

When using Windows Live Photo Gallery, Picasa, and other common application the photos are processed in 8-bit JPG format. That means there are 2-to-the-8th, or 256 levels. Most cameras can do better than that, “raw” format is usually 12 or 14 bits deep. That means there are many more levels before the noise is reached. Astonishing improvements can be achieved when using dedicated image-editing applications like Photoshop, Paint Shop Pro, or others of this type, that can take full advantage of what the camera delivered.

For me, well, I will keep my white umbrella handy.

 

Friday, September 17, 2010

Goodbye Kodachrome

It has been many years since my last roll of Kodachrome. Like most of the rest of the world, I “went digital” a long time ago. So the time for Kodachrome has passed and it is departing into its rightful place in history. 

I started using Kodachrome as a college student more than half a century ago. Kodachrome was not just a color film, one of many tools for my photography passion, to me, and many others, Kodachrome was a potent teacher.

With Kodachrome the exposure had to be spot on. The slightest bit of over-exposure and the highlights became a chalky mess, a bit of under-exposure and the shadows became inky black. You learned to us your exposure meter. Reading the grey card, the bright areas, the dark parts – it was a bit of a production to take pictures with Kodachrome. You could not see the results for a couple of weeks while the film was at the lab. If you did not get it right, that exercise was a learning experience and history.

K01-frame

Since Kodachrome yielded slides, mounted slides, there was nothing you could to about the framing after the shutter was released. So you learned to see the final picture, all of it. Viewfinders had sophisticated parallax correction to help the photographer get it right. You physically moved in and out or - more rarely - changed to another lens. Zoom lenses were still a distant dream.

When I first started using Kodachrome, the daylight film had a speed – sensitivity rating – of ASA 12 (that measure, “American Standards Association” has now give way to ISO numbers of equivalent value). That slow speed required very careful management of the camera settings. If you wanted any measure of depth of field and wanted to use the aperture at f/11 that K02-framemeant 1/30 second for daylight scenes. Long shutter speeds demand very careful shooting. Kodachrome taught to spread your feet, to press the elbows into your sides, and how to breathe.  For action photos like sports, to use short exposure times, like 1/500 second, meant shooting with the aperture wide open. This yields a shallow depth of field and demands perfect focus.

Yes, to use Kodachrome successfully meant knowing your camera, your subject, and applying that knowledge with care.

There was for me another very important lesson. Kodachrome was expensive, more expensive that other color films. As a poor college student I had to be very frugal. That meant making K03-frameevery exposure count.  It also meant that you had to press the release at just the right moment. Cartier-Bresson made Cardinal de Retz’ “decisive moment” his trademark and book title.

 

Today there is nothing to teach these lessons to aspiring photographers. Technology in modern cameras takes care of all these matters. Exposure is evaluated by hundreds of sensors and the computer determines the appropriate settings. If it still is not completely right post-processing can make the corrections.

Today zoom lenses are ubiquitous. Getting the framing right is just a twist of a control. Cropping in post-processing is standard operating procedure.

Holding the camera steady has long ago been made obsolete by image stabilization.

The primary controls on modern cameras are not shutter speed and aperture – no, you select “scene mode”, like: Portrait, Landscape, Close-up, Sports, Night Portrait, Night Landscape, Party / Indoor, Beach / Snow, Child, Sunset Dusk / Dawn, Pet Portrait, Candlelight, Blossom, Autumn Colors, Food, Silhouette, High Key, Low Key (these from the just introduced Nikon D7000). The computer inside then judges the correct settings. No worry about depth of field or a blurred subject because it moved too fast.

“The decisive moment” – history – today some cameras capture images even before the shutter is pressed. Just select the best one.

Us old-timers can only shake our heads and wonder about todays youth. How will they ever learn? We had it easy: When you mastered Kodachrome, you mastered photography.

So a fond goodbye to Kodachrome, that stern taskmaster, and brilliant teacher.

 

P.S. The illustrations here are faked: The photos were flipped in post-processing for esthetic reasons, modern technology rolls on. Click on any one to take you to a slide show of old Kodachrome photos of mine – nothing special – all from my learning days.

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

Sunday, September 5, 2010

Sunscreen for my Camera

On a bright, sunny day the sun can heat up dark objects in no time at all. My camera is black, carried on a neck strap, it becomes uncomfortably hot to the touch.  That kind of temperature cannot be good for the insides of the camera either. My solution is to dress the camera in white. Take a look at the picture.

Well-dressed-camera

A child’s t-shirt is just the perfect way to protect the camera from the unrelenting sun. My quick-connect neck strap goes through the sleeves. The t-shirt can stay in place to take a picture, with the bottom of the shirt pushed up over the lens, the viewfinder is accessible through the top of the shirt.

For better control of the camera, the t-shirt can be easily slipped up on the straps, it then stays out of the way amazingly well.

I have not drawn any unusual attention from any passersby, but I did have quite an experience acquiring the t-shirt. As an older person walking into a baby goods store immediately got me marked by the sales Well-dressed-cameraclerks as someone shopping for a grand child. Grand parents have a reputation of sparing no expense when it comes to buying a present for a grand child. So I was shown all kinds of fancy little shirts in all colors of the rainbow – except, of course, white. There was gorgeous lace trim, beautiful embroidery, thematic designs from baseballs to spacecraft. No plain white. When the clerk finally asked “are shopping for a boy or a girl?” my reply “neither, I want a t-shirt for my camera” really got me strange looks. I wasn’t sure whether they were trying to decide between calling security or for an ambulance. Trust me, delegate the shopping of a baby-size t-shirt to a young mother!

My camera stays cool, even if this is not the coolest in fashion statements. Should you see me with my well-dressed camera in a park or town, just give me a wave!

Please also visit my blog on “things computerese”: This ‘n That