Why correction needs more than a formula
A pinhole camera sends a straight scene line to a straight image line, or to a single point in the degenerate case of a line through its center, provided that the relevant points have nonzero depth. Real optics can bend its image, particularly near the edge of the sensor. If the resulting coordinates are fed unchanged to a homography or epipolar-line estimator, the residual is not necessarily random mismatch: the geometric model itself may be wrong. Correction is therefore a step between measurement and those ideal geometric calculations, not a cosmetic straightening filter.
We work with a deliberately restricted radial model. Its center, intrinsics and parameters must be estimated from calibration data; a single radial coefficient is not a universal lens description. The ideal coordinate is an unobservable pinhole ray coordinate unless a calibration target and pose or other independent constraints supply it. We assume a stationary camera, fixed focus and resolution, a global shutter, and that the model is valid on a specified disk. Chromatic, tangential and time-dependent effects are excluded. A good fit within one disk does not guarantee a good fit beyond it.
Normalized coordinates and the forward map
Definition 1.34.1
(One-coefficient radial distortion on a disk)
Let be ideal normalized camera coordinates relative to the distortion center, and put . For a real coefficient , define the distorted coordinate by
When the scale is positive on the disk, the polar direction is preserved and the distorted radius is
Coordinates here are dimensionless. With center and known positive focal scales , one possible zero-skew pixel convention is , . If the actual distortion center differs from the principal point, use the appropriate calibrated transformations instead of silently identifying them. Pixel distances in the two directions need not correspond to equal normalized distances when .
Theorem 1.34.2
(A sufficient condition for an invertible radial field)
If and for every , the forward map is one-to-one on the closed disk of radius . It maps that disk onto the disk of radius , and the inverse is continuous. For a nonzero distorted point, recover its unique radius from and keep its direction; the center maps to itself.
Proof
(Monotone radius gives an invertible field)
The derivative is . Under the hypotheses it is positive throughout the interval, so is strictly increasing from zero to and has a unique continuous inverse there. Positive scale preserves direction; equal nonzero outputs must therefore have equal directions and, by strict monotonicity, equal radii. The only output at radius zero comes from the center. Every radius between zero and occurs by continuity, giving the stated image disk. These are sufficient conditions, not a claim that every invertible radial map must have strictly positive derivative at every point.
Proof X-ray
Separate radius from direction
A scalar equation for radius is useful only after establishing that the scale is positive. A negative scale reverses the direction, and replacing it by its absolute value in a radius equation can hide a second preimage. Both the domain and the sign convention are part of the inverse problem.
Estimating one coefficient
Proposition 1.34.3
(Least-squares radial coefficient from two-dimensional pairs)
Suppose independent calibration has supplied paired ideal and measured normalized points and , and the center and intrinsics are fixed. Write . The model is . Minimizing the sum of squared two-dimensional residuals over real gives
Proof
(Expanding the quadratic)
Expand the quadratic and set its derivative to zero, which gives the displayed value. Its second derivative is , so the minimizer is unique.
Center points alone give zero denominator and no information about . This fit treats ideal points as fixed and uses equal isotropic coordinate weights. If their uncertainty or the pixel noise covariance matters, that objective is not generally the maximum-likelihood fit. In practice poses, intrinsics and distortion may be refined jointly by nonlinear reprojection error; held-out board views and field coverage matter because a small training residual alone does not establish calibration accuracy.
If only radii are retained, let be the ideal radius and the measured distorted radius. Minimizing gives whenever some ; for and it returns . Reducing a measurement to its length discards its direction, so with non-radial residuals or noise this estimate generally differs from the two-dimensional one. Neither certifies the model.
Worked example 1.34.4
(One point, a specified field, and correction)
Take , , and . Then , so and with distorted radius . If these ideal and measured points are known exactly, the least-squares formula returns . On the whole unit disk the scale is at least and is at least , so the theorem applies. To correct the observed point, solve on ; gives the unique solution , and the direction recovers .
Worked example 1.34.5
(Inverting a boundary point, and the other roots)
With and , the ideal point has scale , so its distorted point is at the edge of the image disk. To invert, solve , that is . The root is the unique root in , because is strictly increasing there. The other roots, and , lie outside the calibrated field: an unconstrained polynomial root finder may return them, and they do not correspond to ideal points of the model.
Worked example 1.34.6
(Rendering one output pixel, and a masked one)
Take , , and center . The ideal output pixel with normalized coordinate is distorted to , so the raw lookup is , . The ideal pixel has radius greater than , so it is masked. Its formula would give scale and a lookup at , which may lie on the sensor, but the model is not calibrated at that radius.
Rendering a corrected image
Concept lensAlgorithmic
Inverting a point versus sampling an image
There are two inverse-looking operations that should not be confused. To correct an observed point, solve the scalar equation for its ideal radius. To render an ideal output image without scatter holes, visit each ideal output pixel, map its normalized coordinate forward through the distortion model, transform to the raw sensor pixel, and interpolate the raw image there. This is inverse image warping: the lookup is output-to-input, although it evaluates the forward geometric distortion.
Mask an ideal output position outside the calibrated disk even if its predicted source position falls on the sensor. Also mask lookups outside the measured sensor; neither kind of invalid pixel is a newly measured black pixel.
Bilinear interpolation is a local approximation, not recovery of unrecorded information. When an output pixel covers a large or anisotropic footprint in the source, suitable prefiltering is required to control aliasing. The forward map may have regions poorly conditioned for point correction even before it ceases to be one-to-one: where is small, a small radius measurement error can lead to a large ideal-radius error. Bisection on the known monotone interval gives a bracketed numerical inverse; an unconstrained polynomial root finder can return a different branch outside the calibrated field.
Counterexample mode
An algebraic formula is not a global inverse
For , extending the formula beyond its stated unit disk makes at and subsequently decreases. Indeed both and map to the center. Thus the formula on the entire plane is not one-to-one. The second radius also has zero scale, so direction is lost there. This counterexample does not invalidate the inverse on the unit disk; it shows why the field must be stated.
Residuals and model limits
After fitting, plot observed minus predicted positions over the image on held-out target views. A coherent outward or inward pattern can suggest a radial model mismatch; a decentering pattern, board deformation, inaccurate pose, rolling shutter or imperfect feature localization can also produce structured residuals. Residual direction alone does not identify the cause. Include views across the field and at varying board orientations, inspect magnitudes in pixels as well as normalized units, and compare the fitted model against a simpler one on held-out measurements. More parameters can lower training error while worsening extrapolation.
Common mistake
(A zero training residual does not identify the coefficient)
With a single correspondence at the center, for every , so the residual is zero for every while the coefficient is completely undetermined. Even with off-center points, collect data across the field and at several board orientations, and check against independent views rather than reporting only the fitting error.
Common mistake
(Taking one straightened line as a complete calibration)
A straightened target line is a useful diagnostic, but not a complete calibration proof: a wrong center, focal scale or three-dimensional pose may remain, and a method tuned on the same line can overfit it.
Conversely, a correct geometric mapping does not restore focus, remove sensor noise or undo motion blur. The appropriate claim is that the specified model predicts measured target positions within stated accuracy over a tested field.
Practice with solutions
Quick check
(For , find the maximum distorted radius on the unit disk and justify uniqueness of its inverse there.)
Solution · Answer
. On , and the scale is positive, so every radius in has exactly one preimage radius in , and every output point has exactly one preimage point in the unit disk.
Quick check
(A single ideal normalized point is and its measured point is . Compute the unconstrained one-parameter estimate and the residual. Does the model explain both components exactly?)
Solution · Answer
, so . The prediction is and observed minus predicted is . A radial-only correction cannot explain that perpendicular residual for this point.
Quick check
(The forward radial derivative at a point is . Approximately how much can a small radial measurement error of change the recovered radius to first order? State the limitation of this approximation.)
Solution · Answer
Linearizing gives . This is local: curvature of , noise size and domain boundaries can make the finite error differ substantially, especially near a fold.
Quick check
(Why is sending every raw pixel forward to a corrected position not equivalent in implementation to looking up a raw coordinate for each output pixel?)
Solution · Answer
Forward scattering may leave holes or place several samples at one output location. Output-to-input lookup assigns a value when the source coordinate is valid and a reconstruction rule is chosen; it still needs interpolation, masking and, where appropriate, antialiasing.
Quick check
(Two ideal radii equal and the measured radii are and . Find the radius-only least-squares estimate and the residuals.)
Solution · Answer
The numerator is and the denominator is , so . Both predicted radii are , leaving residuals and : the two measurements are not both fitted exactly.
Quick check
(Someone claims that correcting an image requires solving a cubic equation for every output pixel. Is that right?)
Solution · Answer
No. With the ideal grid as output, evaluating the forward map at each output pixel gives the distorted input position, which is then interpolated. The cubic must be solved only when an ideal point is to be recovered from a measured distorted point.