Description Usage Arguments Value Note Examples
View source: R/lensCorrection.R
Corrects lens distortion using the formula R = r (ar^3 + br^2 + cr + d ), where r is the distance to the image center and R is the equivalent radius for the corrected image.
1 | lensCorrection(m, imWidth, imHeight, a = 0, b = 0, c = 0)
|
m |
a matrix with X,Y-coordinate data labelled 'X' and 'Y'. |
imWidth, imHeight |
the width and height of the original image. |
a, b, c |
parameters used to correct lens distortion. |
The inputted matrix with corrected X,Y-coordinates.
Ready-made undistortion parameters for particular cameras can be found online (e.g. http://sourceforge.net/projects/hugin/files/PTLens%20Database). Parameters can be estimated manually using a checkerboard calibration image and the undistortion feature in image manipulation programs such as ImageMagick (http://imagemagick.org), or automatically using Hugin's lens calibration tool (http://wiki.panotools.org/Calibrate_lens_gui). See http://www.imagemagick.org/Usage/lens/ for more information on lens correction.
1 2 3 | data(tenebrio_basic)
tenebrio_basic <- lensCorrection(tenebrio_basic, 640, 480, b = -0.022)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.