FUNCTION REFERENCE

undistortPoints

Correct lens distortion of image points.

Correct lens distortion of image points.

Syntax

undistortedPoints = undistortPoints(points, intrinsics)

Syntax

[undistortedPoints, reprojectionErrors] = undistortPoints(points, intrinsics)

points is an M-by-2 matrix of [x y] pixel coordinates; intrinsics is a cameraIntrinsics or cameraParameters object. Each point is normalized with K, the distortion is inverted by Newton's method (at most 50 steps, to a normalized residual below 1e-10) and the result is mapped back with K. reprojectionErrors (M-by-1, pixels) is the distance from each input point to its undistorted point distorted again. Outputs are double for double points, otherwise single.

Example

c = cameraIntrinsics([800 790], [322 238], [480 640], 'RadialDistortion', [-0.12 0.05]); p = worldToImage(c, eye(3), [0 0 1], [0.3 0.2 0], 'ApplyDistortion', true); undistortPoints(p, c)   % [562 396]

Differences from MATLAB: fisheye (cameraIntrinsicsKB) cameras and point objects (cornerPoints, ...) are not supported.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.