Algorithm Search⌘K

Modelcore

Brown-Conrady distortion model

Also called radial and tangential distortion, plumb bob model.

Lens distortion as even polynomials in the radius (radial terms k1, k2, k3) plus decentering terms p1, p2, applied to normalized image coordinates before K.

The Brown-Conrady model describes how a real lens moves the image of a point away from where a pinhole camera would put it. It has two parts: a radial part, a polynomial in the squared distance from the optical axis, and a tangential or decentering part, which comes from lens elements that are not exactly centered. Lens distortion acts on normalized coordinates: project, distort, then apply KK. In this form, with the parameters (k1,k2,p1,p2,k3)(k_1, k_2, p_1, p_2, k_3), it is the default model of OpenCV and of most calibration tools, and it is what Zhang's method and the camera calibration problem usually estimate. It suits normal and moderately wide lenses; fisheye lenses need the Kannala-Brandt model or the unified model, and the division model is a one parameter alternative that is easier to invert.

The machine

Input. A point XwX_w of the world, the pose (R,t)(R, t), the intrinsic matrix KK, and the distortion parameters.

Step 1: project. Xc=RXw+t=(X,Y,Z)X_c = R X_w + t = (X, Y, Z) with Z>0Z > 0, and the normalized coordinates are x=X/Zx = X / Z, y=Y/Zy = Y / Z. Let r2=x2+y2r^2 = x^2 + y^2.

Step 2: distort.

xd=x (1+k1r2+k2r4+k3r6)+2p1xy+p2(r2+2x2),x_d = x \, (1 + k_1 r^2 + k_2 r^4 + k_3 r^6) + 2 p_1 x y + p_2 (r^2 + 2 x^2),
yd=y (1+k1r2+k2r4+k3r6)+p1(r2+2y2)+2p2xy.y_d = y \, (1 + k_1 r^2 + k_2 r^4 + k_3 r^6) + p_1 (r^2 + 2 y^2) + 2 p_2 x y.

The factor in parentheses is the radial part. It scales the point along the ray from the principal point. The terms with p1p_1 and p2p_2 are the decentering part; they also move the point at right angles to that ray.

Step 3: apply K. u=fxxd+s yd+cxu = f_x x_d + s \, y_d + c_x and v=fyyd+cyv = f_y y_d + c_y.

Parameters.

  • k1,k2,k3k_1, k_2, k_3: radial coefficients. With k1<0k_1 < 0 the image of a square bulges outward in the middle (barrel distortion, typical for wide lenses); with k1>0k_1 > 0 the corners stretch (pincushion, typical for telephoto lenses).
  • p1,p2p_1, p_2: decentering coefficients, usually small, of order 10−310^{-3}.
  • Extensions in OpenCV: the rational model multiplies by (1+k1r2+k2r4+k3r6)/(1+k4r2+k5r4+k6r6)(1 + k_1 r^2 + k_2 r^4 + k_3 r^6) / (1 + k_4 r^2 + k_5 r^4 + k_6 r^6), and the thin prism model adds s1r2+s2r4s_1 r^2 + s_2 r^4 to xdx_d and s3r2+s4r4s_3 r^2 + s_4 r^4 to ydy_d. Tools differ in the order and the sign of p1p_1 and p2p_2, so check the convention before you copy values between tools.

Domain. The model is used where the radial map r↦r(1+k1r2+k2r4+k3r6)r \mapsto r (1 + k_1 r^2 + k_2 r^4 + k_3 r^6) is increasing. Outside this range two rays map to the same pixel, and the fit has no meaning there. Since r=tan⁡θr = \tan\theta for a ray at angle θ\theta to the optical axis, the model can never reach θ=90\theta = 90 degrees.

Inverse. Undistortion maps a distorted point (xd,yd)(x_d, y_d), from K−1(u,v,1)K^{-1} (u, v, 1), back to (x,y)(x, y). It has no closed form in general. Two methods are common:

  • Fixed point iteration, as in OpenCV: start at (x,y)=(xd,yd)(x, y) = (x_d, y_d) and repeat x←(xd−δx(x,y))/ρ(x,y)x \leftarrow (x_d - \delta_x(x, y)) / \rho(x, y) and y←(yd−δy(x,y))/ρ(x,y)y \leftarrow (y_d - \delta_y(x, y)) / \rho(x, y), where ρ\rho is the radial factor and δ\delta the decentering terms. This is fixed point iteration. It converges when the distortion is mild, and it can fail near the edge of a strong wide lens.
  • Newton's method on the 2×22 \times 2 system, with the Jacobian of Step 2. It converges quadratically from a good start.

An undistorted image is made by the inverse warp: for each output pixel, apply the forward model to find where to read in the input, and interpolate (see image warping). So making an undistorted image needs only the forward model.

What it counts

The model predicts the pixel of each 3D point. Calibration chooses the parameters that minimize the sum of squared reprojection errors over many points with known structure, usually by Levenberg-Marquardt. The quantities to report are the RMS reprojection error in pixels and the spread of the parameters. The model is an empirical fit, not a law of optics: the polynomial has no physical meaning beyond the range of radii covered by the data, and higher terms can make it go wild outside that range. Brown (1971) also used the plumb line test: images of straight lines must be straight after undistortion, which needs no 3D target at all.

Worked example. Let fx=fy=800f_x = f_y = 800, s=0s = 0, (cx,cy)=(320,240)(c_x, c_y) = (320, 240), and k1=−0.2k_1 = -0.2, k2=0.05k_2 = 0.05, k3=0k_3 = 0, p1=0.001p_1 = 0.001, p2=−0.0005p_2 = -0.0005. Take the normalized point (x,y)=(0.4,0.3)(x, y) = (0.4, 0.3), so r2=0.25r^2 = 0.25.

  • Radial factor: 1−0.2⋅0.25+0.05⋅0.0625=0.9531251 - 0.2 \cdot 0.25 + 0.05 \cdot 0.0625 = 0.953125.
  • Decentering: δx=2⋅0.001⋅0.12−0.0005⋅(0.25+0.32)=−0.000045\delta_x = 2 \cdot 0.001 \cdot 0.12 - 0.0005 \cdot (0.25 + 0.32) = -0.000045 and δy=0.001⋅(0.25+0.18)−2⋅0.0005⋅0.12=0.00031\delta_y = 0.001 \cdot (0.25 + 0.18) - 2 \cdot 0.0005 \cdot 0.12 = 0.00031.
  • Distorted: xd=0.4⋅0.953125−0.000045=0.381205x_d = 0.4 \cdot 0.953125 - 0.000045 = 0.381205 and yd=0.3⋅0.953125+0.00031=0.2862475y_d = 0.3 \cdot 0.953125 + 0.00031 = 0.2862475.
  • Pixels: the ideal pixel is (640,480)(640, 480), and the distorted pixel is (624.964,468.998)(624.964, 468.998), about 18.8 pixels closer to the principal point. This is barrel distortion.

Undistortion of (0.381205,0.2862475)(0.381205, 0.2862475) by fixed point iteration gave errors (distance to (0.4,0.3)(0.4, 0.3)) of 2.1⋅10−32.1 \cdot 10^{-3}, 1.9⋅10−41.9 \cdot 10^{-4}, 1.7⋅10−51.7 \cdot 10^{-5}, 1.6⋅10−61.6 \cdot 10^{-6} after 1 to 4 steps, a linear rate with a factor of about 0.09. Newton's method gave 1.4⋅10−41.4 \cdot 10^{-4}, 5.7⋅10−95.7 \cdot 10^{-9} and below 10−1610^{-16} after 1 to 3 steps. A script computed these values.

Relation to other models

  • Pinhole. All parameters zero. The pinhole model and the camera projection matrix P=K[R∣t]P = K [R \mid t] describe Steps 1 and 3 only.
  • Tsai's model. Tsai's method uses only the radial part, often only k1k_1, and the radial alignment constraint relies on this: radial distortion does not change the direction from the principal point.
  • Division model. The division model writes the undistorted point as the distorted one divided by 1+λrd21 + \lambda r_d^2. It goes in the other direction, from distorted to undistorted, and with one parameter both directions have a closed form. With one parameter each, the two models agree to first order in r2r^2 with λ≈−k1\lambda \approx -k_1, and they differ for wide lenses.
  • Fisheye models. The Kannala-Brandt model writes the image radius as an odd polynomial in the angle θ\theta, not in tan⁡θ\tan\theta, so it can handle fields of view up to and beyond 180 degrees. The unified model projects onto a sphere first. Mei and Rives add Brown-Conrady terms to the unified model.
  • Distortion in robotics and graphics. The same polynomial is used to simulate lens effects in rendering, and as the default camera model of many SLAM systems for normal lenses.

Known results in the model

  • Fold over. With only k1<0k_1 < 0, the radial map r↦r+k1r3r \mapsto r + k_1 r^3 has its maximum at r∗=1/−3k1r^\ast = 1 / \sqrt{-3 k_1}, with value 23r∗\tfrac{2}{3} r^\ast. For k1=−0.3k_1 = -0.3, r∗≈1.0541r^\ast \approx 1.0541 (a ray at about 46.5 degrees from the axis) and the largest distorted radius is about 0.70270.7027. A distorted radius of 0.60.6 then has two preimages, 0.70520.7052 and 1.36801.3680. Undistortion must pick the one below r∗r^\ast, and a calibration with k1=−0.3k_1 = -0.3 must not be used for rays beyond 46.5 degrees.
  • Degree of the inverse. With radial terms only, undistortion is the root of a polynomial in rr: degree 3 with k1k_1 alone (solvable by Cardano's formula), degree 5 with k2k_2, and degree 7 with k3k_3. With decentering terms, it is a 2×22 \times 2 nonlinear system. In practice it is solved by iteration, not by a formula.
  • Straight lines. A line through the principal point stays straight under the radial part, because radial distortion only moves points along rays from the principal point. Every other line bends. This is the basis of the plumb line method of Brown (1971).
  • Coupling with K. The principal point and the decentering terms are strongly correlated in a fit: a small shift of (cx,cy)(c_x, c_y) looks like decentering distortion. So p1p_1 and p2p_2 are often fixed at 0 for good lenses.
  • Small distortion. If the distortion is small, the inverse is close to the forward model with the opposite signs of k1k_1 and pip_i, which is a common approximation for a first guess. This is an approximation, valid to first order only.

References

  1. A. E. Conrady, Decentred lens-systems, Monthly Notices of the Royal Astronomical Society 79(5), 1919, 384-390, the effect of a decentred lens element on the image, the origin of the tangential terms
  2. Duane C. Brown, Decentering distortion of lenses, Photogrammetric Engineering 32(3), 1966, 444-462, the radial polynomial and the decentering terms of the model, derived from the Conrady analysis
  3. Duane C. Brown, Close-range camera calibration, Photogrammetric Engineering 37(8), 1971, 855-866, the calibration of the distortion terms, including the plumb line method
  4. Richard Hartley and Andrew Zisserman, Multiple View Geometry in Computer Vision, second edition, Cambridge University Press, 2004, Section 7.4, Radial distortion (the radial model on normalized coordinates, its estimation, and correction by straight lines)
  5. Richard Szeliski, Computer Vision, Algorithms and Applications, second edition, Springer, 2022, Chapter 2, Image formation (the part on lens distortions)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/TS280K/text.yaml