cv.undistortPoints - MATLAB File Help
cv.undistortPoints

Computes the ideal point coordinates from the observed point coordinates

dst = cv.undistortPoints(src, cameraMatrix, distCoeffs)
dst = cv.undistortPoints(..., 'OptionName', optionValue, ...)

Input

Output

Options

The function is similar to cv.undistort and cv.initUndistortRectifyMap but it operates on a sparse set of points instead of a raster image. Also the function performs a reverse transformation to cv.projectPoints. In case of a 3D object, it does not reconstruct its 3D coordinates, but for a planar object, it does, up to a translation vector, if the proper R is specified.

For each observed point coordinate (u,v) the function computes:

% (u,v) is the input point, (up, vp) is the output point
xpp = (u - cx)/fx
ypp = (v - cy)/fy
(xp,yp) = undistort(xpp, ypp, distCoeffs)
[X,Y,W]' = R*[xp yp 1]'
x = X/W
y = Y/W
% only performed if P is specified:
up = x*fxp + cxp
vp = y*fyp + cyp

where undistort is an approximate iterative algorithm that estimates the normalized original point coordinates out of the normalized distorted point coordinates ("normalized" means that the coordinates do not depend on the camera matrix).

The function can be used for both a stereo camera head or a monocular camera (when R is empty).

See also