Thursday, July 22, 2010

Working on lens correction

I've been working on lens correction recently. More speicifically correcting distortion.

One of my cheap lenses has a strong mustache distortion at the wide end. Just like this:


So, I tried PTLens, an inexpensive and popular lens correction tool. It did an OK job. Though I could still see mustache distortion after PTLens treatment. Of course, I wasn't happy.

Then I decided to use Hugin to solve this problem. When you create a panorama using Hugin, often times you get a lens profile as a by-product along with a beautifully stitched panoramic image, if you used Hugin's optimizer. Since I had not used this cheap wide angle lens for panorama, I didn't have its lens profile yet.

So, naturally I carefully determined the non-parallax point of the lens at its wide end of focal length. Shot a 360 panorama with the lens. I chose my living room for this little photo shoot where there are a lot of straight vertical lines. The aperture was set f/11 and I focused at hyperfocal distance.

Loaded images into Hugin. Manually created vertical control points. Ran control point detector. Then the rest is just same as a usual stitching process. In the end, I got a decent lens profile that's tailored for my own copy of the lens.

Move your mouse pointer over the image to see 'corrected' image.



The next step will be iterating this process with different focal lengths of the lens.

No comments:

Post a Comment