Lens undistortion
Invert a calibrated lens model to map distorted observations onto an idealized camera image.
Straight scene lines appear curved under radial lens distortion.
The distortion centre and radial terms define the correction map.
For each corrected pixel, look up where its value came from in the distorted image.
Sampling through the inverse map straightens the grid. Border coverage depends on the chosen output camera.
Remap the image, or directly correct selected point coordinates.
Illustrative example. The stages explain the method; they are not a live OpenCV execution.
Try it on an image
Experiment at pixel level
Apply a known radial distortion model. Values are assumed calibration parameters, not estimates from this image.
The engine loads on your first run. Your images stay in this browser.
Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.
Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Select a pixel
Select a pixel
When to use it
Straighten lens curvature and prepare measurements for geometric estimation.
How it works
- 01Use camera intrinsics and distortion coefficients.
- 02Build an inverse sampling map for the desired output camera.
- 03Remap the image, or directly correct selected point coordinates.
distorted pixels → calibrated inverse model → ideal coordinates
What to tune
Choose the new camera matrix to control crop and field of view. Cache maps for repeated frames of the same geometry.
Where it breaks down
The output may have uncovered borders or a changed field of view. Point APIs can return normalized coordinates unless a projection matrix is supplied.
TypeScript API
Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.
All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.
Related methods
Camera calibration
Estimate a camera’s intrinsic parameters and lens distortion from known target geometry.
Perspective-n-point pose
Estimate a camera-relative object pose from known 3D points and their 2D image observations.
Fundamental and essential matrices
Constrain where a point from one camera view can appear in another.
Stereo block matching
Find horizontal correspondences between rectified stereo images using local block similarity.