Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hey FooBar!

I figured out, that changing the line:

initUndistortRectifyMap(camm, dist, Mat(), newCamMatrix, Size(img.cols,img.rows),CV_32FC1,map1,map2);

to

initUndistortRectifyMap(camm, dist, Mat(), camm, Size(img.cols,img.rows), CV_32FC1, map1, map2);

should solve your problem.

The funciton

initUndistortRectifyMap

offers you to apply a transformation. The translation is given by the c_x and c_y values of your camera matrix.