Difference between revisions of "Barrel Distortion Correction"

From MIPAV
Jump to: navigation, search
m
m
Line 28: Line 28:
 
Using positive values for a, b, and c shifts distant points towards the center. This counteracts pincushion distortion which is opposite to barrel distortion. See Figure 2.
 
Using positive values for a, b, and c shifts distant points towards the center. This counteracts pincushion distortion which is opposite to barrel distortion. See Figure 2.
  
Using d=1, and a=b=c=0 leaves the image as it is. Choosing other d values scales the image by that amount. See [[http://mipav.cit.nih.gov/documentation/HTML%20Algorithms/BarrelDistortionCorrection.html Figure 2].
+
Using d=1, and a=b=c=0 leaves the image as it is. Choosing other d values scales the image by that amount. See [http://mipav.cit.nih.gov/documentation/HTML%20Algorithms/BarrelDistortionCorrection.html Figure 2].
  
 
==== Correcting pincushion and/or barrel distortion ====
 
==== Correcting pincushion and/or barrel distortion ====

Revision as of 20:54, 21 September 2012

This page is a stub.

Background

Barrel distortion occurs when the magnification at the center of the lens is greater than at the edges. Fish eye lenses, which take hemispherical views, produce this type of distortion as a result of a hemispherical scene being projected onto a flat surface. A higher quality lens can be used to correct for distortion; however, this will greatly rise the cost of the image capture system. A cost effective alternative to an expensive lens system is to algorithmically correct for barrel distortion using the presented method.

Barrel distortion is primarily radial in nature, therefore it can be corrected using a relatively simple model compensating for the most of the distortion.

The correcting function M(a,b,c,d,r_corr) is a third order polynomial. It relates the distance of a pixel from the center of the source image (r_src) to the corresponding distance in the corrected image (r_corr):

Equation 1

M = a *r3_corr + b * r2_corr + c * r_corr + d

and

r_src = (a * r3_corr + b * r2_corr + c * r_corr + d) * r_corr

Where r_src and r_corr are specified in units of the min((xDim-1)/2, (yDim-1)/2).

Parameters in equation 1 are as follows:

  • a, b and c describe distortion of the image
  • d describes the linear scaling of the image

Correcting using a affects only the outermost pixels of the image, while b correction is more uniform. Using negative values for a, b, and c shifts distant points away from the center. This counteracts barrel distortion, and forms the basis for the above corrections.

Using positive values for a, b, and c shifts distant points towards the center. This counteracts pincushion distortion which is opposite to barrel distortion. See Figure 2.

Using d=1, and a=b=c=0 leaves the image as it is. Choosing other d values scales the image by that amount. See Figure 2.

Correcting pincushion and/or barrel distortion

Finally, you may correct pincushion and barrel distortions simultaneously in the same image: if the outer regions exhibit barrel distortion, and the inner parts pincushion, you should use negative a and positive b values. If you do not want to scale the image, you should set d so that a +b + c + d = 1.

Read more: the MIPAV HTML help - Barrel Distortion Correction page.