Correcting Barrel Distortion
Roof tiles
A local rooftop offers some interesting textures. But taking some shots with our new Fuji 4800Z digital camera revealed a problem: the camera (more accurately, the lens) has pronounced barrel distortion on some zoom settings, most noticeably with wide-angle pictures. That's what causes the 'bulging' effect. At focal lengths of less than about 50mm -- the camera offers 36-108mm -- this is quite annoying, though it only becomes really noticeable when you've got straight lines in the shots. Unfortunately the camera powers up at 44mm, which means most images suffer slightly.
Barrel distortion is inevitable with wide-angle lenses -- and can be used deliberately for dramatic effects -- but if necessary it can be corrected to some extent in Photodesk. Here's how.
- To gauge the problem, set up a test sheet (a piece of graph paper will do, or you can download this draw file) and take a few shots at various zoom settings and distances. Keep the camera's imaging plane parallel to the test sheet. Incidentally, this is where digital cameras really score -- no hanging around until you've used the film up and got it developed!
- The effect is most pronounced when using wide-angle settings at close distance, as in the shot below -- it's slightly out of focus as I wanted to fill the field with the grid and had to get fairly close in. Notice too the slight vignetting visible (dimming at the corners -- see Correcting Camera Vignetting).
A basic grid showing barrel distortion
- Get your image into Photodesk. I suggest that you reduce the size if you've used a high resolution mode, as it makes experimenting much quicker and doesn't affect the results much -- try Image>Resize:Scale:By 1/2.
- Click on the toolbar Fx icon, then select Map>Lens from the pull-down menu.
- Start with the 'neutral' settings for this filter: Distortion=0% and Magnification=100%. If you Apply these settings the image shouldn't change at all.
- Start with the Distortion setting at about 5%. Click on Apply and look at the result. Unfortunately the Preview facility isn't much use here as the picture's too small.
- Press Undo (F8), and try other Distortion settings; values between 5 and 8 will probably give the best result. The exact value you'll need depends on your camera, the lens and the particular image, but experimenting will give you an idea of what kind of values to use on 'real' images. Here's the grid again, with a Distortion of 6:
Applying the Lens Simulation with distortion=6, magnification=100
- This is a great improvement, but it isn't perfect. Unfortunately Photodesk won't accept non-integer values for Distortion, so you can't get finer control.
- Also there's still some distortion left -- it appears to be non-symmetrical in the vertical and horizontal planes, so you can get either verticals or horizontals straight, but not both at the same time. If this is important, a fix is to stretch the image appropriately before applying the lens transformation, then shrink it back. In this case, extending the original image's width from 1600 pixels to 1800 (remember to make sure Maintain current aspect ration is not ticked), applying the filter, then shrinking it back to 1600 gave a somewhat better result (not shown here).
- It would be a very useful addition to this already capable filter if the distortion could be limited to the vertical or horizontal directions, giving 'cylindrical' effects.
- Note too that you'll lose part of the outer edges of the image. Simple remedy: extend the canvas. Click on the Scissors, then Crop/Extend (two rectangles, small one sheared). Select Extend and either drag the box corners around or type 50 (or whatever) into each writeable icon. Click on the Tick and fix.
- Here's the result of applying the correction to our roof tiles:
Victory at the Battle of the Bulge