__header__
Description
Radial distortion
This fit an distortion of type barrel or pin cushion and is of the form
pixel undistorted = pixel distorted(k0 + k1*r + k2*r*r + k3*r*r*r + k4*r*r*r*r)
the model can be made to work on any lines present in and image
although the current tool uses a presented grid pattern
We are only considering radial not tangential - as the later is said to be neglegable
Best result at typically found by having the software calculate the even terms k2 amd k4
and this line up with Optical theory which shows that this polynomial should
only feature even powers. However many graphic packages seem to use k1 and k3 (adobe? and image magick)
k0 typical is set to 1-k1-k2-k3-k4 (in normalized coordiantes this preserves size)
Based on the papers
Straight Lines Have to Be Straight
Automatic Calibration and Removal of Distortion from Scenes of Structured Environments
Frederic Devernay, Olivier Faugeras
Correcting Lens Distortions in Digital Photographs
Wolfgang Hugemann
the system works in normalized coordinates
so determine the centre and skew factor as well as the radial k1 and k2....;
x_undistorted = S * x_Distorted + Center_x
y_undistorted = y_Distorted + Center_y
These are reported.
NOTE the revert (inverse) has two option
- Cardano: currently only uses the second order term (k2)
- distorted = pixel undistorted / (k0 + k1*r + k2*r*r + k3*r*r*r + k4*r*r*r*r)
Inputs
CIFViewer
NOt used
CalibrationCollection
PointsImage
Points of a grid (straght lines ust be straight)
Parameters
Name
GridSizeX
GridSizeY
for a polynomial distortion fit is the distance between the points
effectively this does distortion and spacial calibration.
for a radial distortion the point a assumed to be sorted into a grid.
Strictly this should not be necessary.
MaxErrorPre
SDErrorPre
error pre fit
MaxErrorPost
SDErrorPost
error post fit
Calibration
RadialImageWidth
RadialImageHeight
Image size - only the smaller is used
RadialOptions
Radial|Radial And Center|Radial And Center And Aspect
Aspect/Skew is questionaable??
RadialK1
RadialK2
RadialK3
RadialK4
Which radial k terms to evaluate. Recommend k2 and k4
__footer__