The useful part, up front

What you’ll take away

  • Keep lens mapping, camera viewpoint and the chosen output geometry separate.
  • A point can move toward the centre while an offset line bows outward relative to its endpoint chord.
  • A centre-crossing line can stay straight under nonzero radial distortion, so that observation alone does not identify the coefficient.
  • Correcting an observed point uses the inverse map; rendering an ideal output can use the forward map to find source samples.
  • Coefficients need a model, normalization and domain; interpolation and output coverage are separate choices.
01

A curved edge and a changed viewpoint are different questions

A doorframe looks bowed near the edge of a photograph. Applying lens correction makes it straighter, yet the camera has not moved and the scene has not been photographed again. The correction changes the mapping between image positions. Camera models distinguish that lens-distortion mapping from the camera's position and orientation in the scene. [1][2] Keeping those jobs separate helps explain why straightening a curve need not remove every effect of where the photograph was taken.

We will use an original radial model with a fixed camera and a few invented coordinates. Its coefficients, dimensions and sample values are teaching inputs, not measurements of a lens or results from image-editing software. The model will explain a surprising combination: individual points move toward the image's reference centre, while a line through those points bows outward. We will then distinguish correcting an observed point from filling the pixels of a corrected image. Those two operations follow the same relationship in different directions, which is why the word correction alone leaves important details unstated.

Three different changes can affect the visible geometry. These distinctions identify what changed. A straighter line alone does not establish a new physical viewpoint or a complete validation.
These distinctions identify what changed. A straighter line alone does not establish a new physical viewpoint or a complete validation. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
02

Give the coordinates a centre and a scale

The radial calculation uses distances from a reference point called the principal point. It also uses a focal scale measured in pixels. MathWorks describes converting image coordinates into normalized coordinates by subtracting that point and dividing by the focal scale; the resulting numbers have no physical length unit. [2] This matters because inserting a raw pixel count into a formula written for normalized distances changes the meaning of the coefficient.

For our model, choose the principal point at pixel coordinates (800, 600) and use a focal scale of 1,000 pixels in both directions. An ideal point at (1,300, 600) is 500 pixels to the right, so its normalized coordinates are (0.5, 0). A point at (1,300, 1,100) becomes (0.5, 0.5). The reference extent is 1,600 by 1,200 in continuous image coordinates. These choices put the principal point at its centre for this example; that equality is an assumption of the fixture. The scale of 1,000 pixels is not a 1,000-millimetre lens.

03

A radius-dependent scale moves points by different amounts

In the polynomial radial model documented by OpenCV, each coordinate is multiplied by a scale that depends on distance from the centre. [1] We choose a simple case: the scale is one minus one-fifth of the squared radius. Both coordinates receive the same scale, so each point moves along its own line toward the centre. The scale varies with radius; it is not one uniform shrinking operation applied to the entire picture.

At normalized radius 0.5, the squared radius is 0.25 and the scale is 0.95. The point therefore ends up at radius 0.475. At radius 1, the scale is 0.8 and the new radius is 0.8. The centre remains fixed. In this example, a point farther out moves inward by a greater distance. A negative coefficient has this effect in our stated forward mapping. Its sign should not be copied into an unrelated correction control without checking which model and mapping direction that control describes.

04

Inward-moving points can still make a line bow outward

Take three ideal points on the vertical line x=0.5: their y coordinates are −0.5, 0 and 0.5. The two end points have squared radius 0.5, so their scale is 0.9. They move to (0.45, −0.45) and (0.45, 0.45). The middle point has squared radius 0.25 and moves to (0.475, 0). All three have moved toward the reference centre, but the middle point now lies farther right than the line joining the two ends.

Using our pixel scale, the end points are at (1,250, 150) and (1,250, 1,050), while the middle is at (1,275, 600). It sits 25 pixels outward from the vertical chord through the ends. There is no contradiction: inward displacement compares each point with its original location; outward bow compares the shape with the chord. Adobe describes barrel distortion through this bowed-line appearance. [6] Our calculation explains how that appearance can arise even while each selected point moves inward under the declared radial map.

Inward point motion can produce an outward bow. Original D(x,y) = (x,y)(1 − r²/5); pixel scales 1,000 and principal point (800,600). The midpoint is 25 px beyond the endpoint chord.
Original D(x,y) = (x,y)(1 − r²/5); pixel scales 1,000 and principal point (800,600). The midpoint is 25 px beyond the endpoint chord. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
05

A straight line through the centre can stay straight

Now place the ideal line through the reference centre instead. For the horizontal line y=0, multiplying both coordinates by our positive radial scale leaves y at zero. Its points change their spacing, but they remain on the same horizontal line. The same reasoning applies to another line through the centre: all its points keep their original direction from that centre. Our model can therefore distort the image while leaving these particular lines straight.

This gives a useful limit on a visual check. Seeing one straight edge that crosses the centre does not prove the radial coefficient is zero. In our fixture, that observation fits both the zero-coefficient model and the model with coefficient −0.2. An offset edge provides different evidence because its points sit at different directions and radii, as the previous example showed. The point is to ask what a chosen observation can distinguish, rather than use any tidy-looking line as proof that every part of the image geometry is correct.

06

The declared radius range is part of the model

Our example is restricted to normalized radii from zero to one. Within that region, the scale stays between 0.8 and 1, and increasing an input radius always increases the resulting radius. The mapping keeps the ordering of points along a ray, so one observed radius in its output range corresponds to one original radius. That property is useful when we ask to undo the mapping.

Extending the same polynomial indefinitely would change the situation. At input radius 1 it gives output radius 0.8, but at input radius 2 it gives only 0.4. The larger input has folded back toward the centre. Radius 2 lies outside our declared domain, and the example supplies no evidence that a real lens follows that extrapolation. A formula needs an applicable region as well as coefficients. Keeping that region visible prevents an apparently simple correction rule from becoming an unsupported claim about every corner or every possible field of view.

07

Undoing the point map requires its inverse

Suppose a measured point lies on the horizontal axis at normalized coordinate 0.475. Which ideal coordinate produced it? In our model, 0.5 is the answer because 0.5 multiplied by 0.95 equals 0.475. We are now going from the distorted observation back to the ideal point, reversing the relationship we used earlier. Simply changing the coefficient's sign is a tempting shortcut, but it asks a different mathematical question.

Try that shortcut explicitly: multiply 0.475 by one plus one-fifth of 0.475 squared. The result is 0.496434375, short of 0.5 by 0.003565625. At our scale, that difference is 3.565625 pixels. The shortcut used the observed radius inside the scale, whereas the original forward mapping used the ideal radius. Correct inversion must account for that dependency. This example does not rate any software's accuracy; it demonstrates why an opposite sign, without the inverse relationship, is insufficient even for a simple one-coefficient model.

Point inversion and image lookup use different directions. Original on-axis example. The forward point map sends 0.5 to 0.475. Output-to-input image lookup can use that same forward map.
Original on-axis example. The forward point map sends 0.5 to 0.475. Output-to-input image lookup can use that same forward map. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
08

An undistorted output can use the forward distortion formula

Producing an entire corrected image asks a different question from correcting one observed point. Start with a position in the desired output and ask where to obtain its value from the recorded image. OpenCV's geometric-transformation documentation describes this destination-to-source lookup. [3] For our correction, the output position represents an ideal coordinate, so the forward distortion rule tells us where that ideal point appeared in the distorted source.

For example, output pixel coordinate (1,300, 600) represents ideal point (0.5, 0). Our forward map sends it to (0.475, 0), corresponding to source coordinate (1,275, 600). The output can obtain its sample there. We have used the forward point-distortion formula as a backward lookup through the image. Both descriptions are correct because they name different directions: ideal-to-distorted coordinates and output-to-input sampling. Keep the output and source labels beside the arrows, and the apparent contradiction disappears.

09

A coordinate lookup still needs a sampling rule

The source location need not land on an integer pixel position. Choose ideal output coordinates (0.3, 0.2). Their squared radius is 0.13, making our scale 0.974. The distorted coordinates become (0.2922, 0.1948), or source position (1,092.2, 794.8) in pixels. OpenCV separates this fractional-coordinate problem from finding the coordinate itself, and provides interpolation methods for estimating a value there. [3] A geometrically specified lookup has not yet selected that estimate.

For an original single-channel example, assign values 20 and 60 to the two neighbouring pixels on row 794, at columns 1,092 and 1,093. Assign 100 and 140 directly below them on row 795. Ideal bilinear interpolation uses the fractional offsets 0.2 across and 0.8 down, giving weights 0.16, 0.04, 0.64 and 0.16. The weighted value is 92. This is declared scalar arithmetic, not a measured colour result or a promise about an implementation's rounding. The interpolation estimates an output value from supplied samples; it does not make another observation of the scene.

A fractional lookup needs an interpolation rule. Original scalar patch at source u = 1,092.2 and v = 794.8. Ideal bilinear weights sum to 1 and produce value 92; no library output is claimed.
Original scalar patch at source u = 1,092.2 and v = 794.8. Ideal bilinear weights sum to 1 and produce value 92; no library output is claimed. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
10

Output size and border policy are additional choices

A correction also needs a decision about the output's extent. MathWorks documents separate same, full and valid output-view options: matching the input dimensions, accommodating the input image, or retaining a valid cropped region. It also provides fill values when a mapped source location lies outside the input. [4] Those choices explain why two corrected outputs can have different boundaries even when they use the same underlying lens model.

Matching dimensions does not prove that each output position shows the same part of the source as before. Equally, a full view is not a promise that every output sample equals an original sample without interpolation. The useful comparison names the model, output geometry and sampling policy. Our numerical fixture kept the same scale and centre to isolate the radial effect; other choices must be stated separately. Adjusting a canvas or excluding an unsupported border changes presentation, but it does not physically move the camera or supply a new view behind an object.

11

A profile has to describe the image and the intended correction

A real editing application needs evidence for its chosen model. Adobe describes lens profiles identified using camera and lens metadata, with manual selection when a suitable match is not found automatically. It also notes that available profiles depend on whether the file is RAW or non-RAW. [6] Those are reasons to keep the camera, lens and input representation attached to the correction, instead of judging a profile only by whether its name looks familiar.

The same documentation discusses lens behaviour at different focal lengths, apertures and focus distances. [6] Our single coefficient cannot stand in for all of those conditions. For the invented example, we can verify the algebra exactly because we declared the model and inputs. For a photograph, the chosen model's applicability needs its own evidence. A useful comparison records which profile or parameters were applied, which geometry was requested, and which features were checked. That record separates a plausible visual improvement from a claim that every position or every later measurement has been validated.

12

Zero coefficients still need a model name

Finally, a coefficient has meaning inside a particular model. OpenCV's documented fisheye model begins with an angle obtained from the ideal radius, then applies its polynomial to that angle. [5] Our earlier ordinary radial polynomial begins with the radius itself. The two models can therefore use similar coefficient names while describing different baseline projections. Setting their coefficients to zero does not make their outputs automatically interchangeable.

At ideal normalized radius 1, the ordinary radial polynomial with zero coefficients returns radius 1. The named OpenCV fisheye model with all four coefficients zero returns an angle of π/4 radians, producing normalized output radius about 0.7854 when skew is zero. This separate comparison explains why zero is not a universal 'same geometry' setting. To interpret a lens correction, keep four things together: the coordinates, the model, the direction of the operation and the output sampling choices. Straightening a line is then a specific geometric result, with its viewpoint and remaining assumptions still visible.

Zero coefficients do not identify the same projection. A separate analytical comparison at ideal normalized radius r = 1, with zero skew. The fisheye column is the named OpenCV 4.12.0 model.
A separate analytical comparison at ideal normalized radius r = 1, with zero skew. The fisheye column is the named OpenCV 4.12.0 model. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
Follow the evidence

Sources & further reading

Explore the references behind this guide. External pages may change after our review.

  1. OpenCV: Camera Calibration
    OpenCV · Accessed 7 Nov 2026
  2. What Is Camera Calibration? - MATLAB & Simulink
    MathWorks · Accessed 7 Nov 2026
  3. OpenCV: Geometric Image Transformations
    OpenCV · Accessed 7 Nov 2026
  4. undistortImage - Correct image for lens distortion - MATLAB
    MathWorks · Accessed 7 Nov 2026
  5. OpenCV: Fisheye camera model
    OpenCV · Accessed 7 Nov 2026
  6. Correct lens distortions in Adobe Camera Raw | Camera Raw
    Adobe · Accessed 7 Nov 2026

Article updated 7 Nov 2026.

Found something we should revisit?

Good explanations get better with thoughtful feedback.

Suggest a correction