公告

我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息







Barrel Distortion Correction
boungy 发表于 2006-5-11 上午 10:45:00


Learn : Image Techniques : Barrel Distortion Correction

Barrel Distortion Correction
By Vincent Bockaert
 

..and Pincushion Correction

Typically, wide angle lenses tend to suffer from barrel distortion and tele lenses from pincushion distortion. Both effects tend to be stronger at the extreme ends of zoom lenses, especially on compact cameras.

 
 

The good news is that for digital cameras, these problems can be rectified very easily. Here's how.

Installing Panorama Tools

Panorama Tools (download here for PC or here for Mac) is an excellent freeware plug-in for Adobe Photoshop Elements 1.0 and higher, and Photoshop 5.0 and higher. The plug-in allows for amazing barrel and pincushion distortion corrections.

The Readme file of the plug-ins explain all the parameters. For those of you with limited time and only interested in barrel and pincushion distortion, simply install as follows for Photoshop in Windows 95/98/Me/2000/XP (for Mac and/or other software please refer to the Readme file):

  • Place the file pano12.dll into the same directory as Photoshop.
  • Place the files adjust.8bf, correct.8bf, perspect.8bf, and remap.8bf into the Plug-ins folder for 'Filters'.
  • For the scope of this tutorial, these are the only files you will need. So don't worry about the other files in PanoTools.zip.
  • Restart Photoshop. You should find Panorama Tools in the Filters submenu.

For barrel and pincushion distortion compensation, go to "Filter-> Panorama Tools-> Correct". Highlight "Radial Shift", click on "Options", set 'a' and 'c' to zero for all colors, choose a value for 'b' and choose 'd' so that d + b = 1. For barrel distortion compensation 'b' must be negative, for pincushion distortion compensation, 'b' must be positive. Start with b = -0.015 or 0.015 (1.5%) respectively and increase or decrease until the picture is straight. The Readme file also explains 'a' and 'c', but you probably will not need those parameters.

The sample pictures below are downsampled, but be assured that there is virtually no visible loss of quality or sharpness between the original before and after pictures, provided the Photoshop's default bicubic interpolation is used. The perfectionists among you may notice small differences when viewing the image at 400% or more. These differences are irrelevant to image quality and are definitely a bargain price to pay for the very relevant and obvious elimination of the distortion.

Barrel Distortion Correction

Notice the very curved horizon and right building in this wide angle shot. Settings: a=0, b=-0.016, c=0, and d=1.016 results in straight horizon and building.

Another example of barrel distortion with wide angle lens. Settings: a=0, b=-0.018, c=0, and d=1.018 results in a straight window.

Pincushion Distortion Correction

Example of pincushion distortion with a tele lens. Settings: a=0, b=0.013, c=0, and d=0.987 straighten the building.

After pincushion distortion correction you will have to crop the image about 25 pixels on top, bottom, left and right to remove the black pixels in the corners and around the edges resulting from the transformation.

Conclusion

Barrel and pincushion distortion can easily be eliminated without visible loss in quality.

 

This article is based on content of The 123 of digital imaging Interactive e-book, which explains barrel and pincushion distortion correction in more detail.

 
 

Article ©1998-2006 Vincent Bockaert and dpreview.com, with permission.


Learn : Image Techniques : Barrel Distortion Correction

 

Super wide-angle and distortion
written by Fred Miranda

NOTE: The image samples are 100% crops of full images. They were shot with a 1D using the standard curves settings, Matrix 4 (AdobeRGB) and default sharpening setting. The images were brought into Photoshop and assigned to AdobeRGB. I then corrected for barrel distortion/perspective, resized, and converted to sRGB before posting.

A few months ago, I had an opportunity to review the new Canon 16-35L super wide-angle zoom lens and make a few comparisons with the 17-35L.
I have received many emails asking me how well the new 16-35L compares to the 17-35L in regards to barrel distortion.

I tested the older 17-35L and from my analysis, I found severe distortion at about 5.5-6 % at its widest focal length (17mm). I decided to test the new 16-35L for distortion as well, at the following focal lengths: 16mm, 20mm, 24mm, and 35mm

I used my new Canon 1D to shoot a grid target.
Then I used an excellent Photoshop plug-in from Helmut Dersch, called Panorama Tools, to calculate the amount of distortion compensation required.

Here are the results of my tests:

16-35L at 16mm: (distortion of ~2.1%)

16-35L at 20mm: (distortion of ~1.3%)

16-35L at 24mm: (distortion of ~0.7%)

16-35L at 35mm: (insignificant)

These results were acquired by taking a picture of a target at the selected focal lengths and guessing the distortion levels until the target lines became straight (free of barrel distortion).

 

Example 1 (before and after barrel distortion correction) - 1D, f/8, 1/200s, 16-35L at 16mm

 

Example 2 (before and after barrel distortion correction) - 1D, f/3.2, 8 seconds, 16-35L at 16mm

 


How to use the free Panorama Tools Plugin:

- Download PanoTools: PC | Mac
- Place the file pano12.dll into the same directory as Photoshop.
- Place the file correct.8bf into the Plug-ins folder for 'Filters'.
- Restart Photoshop. You should find the Tools in the Filters submenu.

Here is a screenshot of the Filters submenu:

 

Next, check "Radial shift" and make sure the other options are unchecked. Click on Options.

 

Set 'a' and 'c' to zero for all colors, choose a value for 'b' and choose 'd' so that d + b = 1. For barrel distortion compensation 'b' must be negative. For the 16-35L at 16mm, use "a = 0", "b = -0.021", "c = 0", and "d = 0.021" (2.1%) for all colors (red, green and blue).

 

Finally, choose your interpolation method. I recommend Spline 36Pixels for great quality and performance. If you have time and your files are not too large you could choose Sinc 256Pixels for the best image quality.

 

Keep in mind that the above settings are custom made for the 16-35L. If you want to use the above technique for your own lens, you'll need to calculate and customize your settings based on your target grid. When tilting your lens upwards or downwards, you may have to correct the perspective as well. You can do that easily using Photoshop.

Here is how:

Open you image. Select all (Ctrl-A). Edit/Transform/Skew

Then move your points until lines that should be parallel get parallel.

Here is an extreme example corrected for barrel distortion (panorama tools) and perspective (transform/skew):

 

 

Update (April 6th, 2002):

Photographer Dale Kaechler, tested his Sigma 15-30mm f/3.5-4.5 EX Aspherical DG DF zoom lens and calculated the following distortion settings using the above method.

Here are his findings:

15-30mm Sigma at 15mm: distortion of 1.8%
15-30mm Sigma at 20mm: distortion of 0.9%
15-30mm Sigma at 24mm: distorition of 0.3%
15-30mm Sigma at 30mm: insignificant

Example (before and after barrel distortion correction) Sigma 15-30mm f/3.5-4.5 @ 15mm

image by Jerry Eakes

 

Update (November 1st, 2002):

Jakob V Christensen tested the D60 with Sigma 17-35 EX for barrel distortion using PanoTools and found the following:

b/d value to correct at x mm

mm. b d
17mm -0,008 1,008
18mm -0,007 1,007
19mm -0,006 1,006
...
...
24mm -0,001 1,001

(0,001 step down per mm step up)


阅读全文 | 回复(0) | 引用通告 | 编辑
 


发表评论:

    大名:
    密码: (游客无须输入密码)
    主页:
    标题:


Powered by Oblog.