How to remove radial distortions from images using OpenCV?

user1077213 picture user1077213 · Dec 2, 2011 · Viewed 20.3k times · Source

I think I should be using cv::remap to remove the distortion but can't figure out what the the maps const Mat& map1, const Mat& map2 to should be to achieve this.

Should I be using the cv::initUndistortRectifyMap to find out the values? If so, I'd really appreciate an example. I do not have the intrinsic camera parameters or don't know how to calculate them. Thanks.

Answer

karlphillip picture karlphillip · Dec 2, 2011

If you are looking to remove the distortion caused by the camera lens you should take a look at this answer I wrote some time ago, which has intructions and references on how to do proper camera calibration.

I also suggest this post, which has good info on the procedure as well and uses the C++ interface of OpenCV.