opencv undistortPoints() 函数使用

转载地址:

https://blog.csdn.net/qq_15505637/article/details/76197820?locationNum=5&fps=1
https://stackoverflow.com/questions/8499984/how-to-undistort-points-in-camera-shot-coordinates-and-obtain-corresponding-undi


调用方法
std::vector inputDistortedPoints = ...
std::vector outputUndistortedPoints;
cv::Mat cameraMatrix = ...
cv::Mat distCoeffs = ...


cv::undistortPoints(inputDistortedPoints, outputUndistortedPoints, cameraMatrix, distCoeffs, cv::noArray(), cameraMatrix);
不要像下面这样调用,输出的点不正确
cv::undistortPoints(inputDistortedPoints, outputUndistortedPoints, cameraMatrix, distCoeffs)



UPDATE:
Following C++ function call should work as well:

std::vector inputDistortedPoints = ...
std::vector outputUndistortedPoints;
cv::Mat cameraMatrix = ...
cv::Mat distCoeffs = ...

cv::undistortPoints(inputDistortedPoints, outputUndistortedPoints, cameraMatrix, distCoeffs, cv::noArray(), cameraMatrix);

你可能感兴趣的:(OPENCV)