1 | initial version |
Here are the three main steps you should follow after you've saved the intr./extr. params in xml files (I'm using C routines):
Parameters should be loaded back in a matrix.
CvMat intrinsic = (CvMat)cvLoad(“Intrinsics.xml”);
CvMat distortion = (CvMat)cvLoad(“Distortion.xml”);
Build the undistort map that will be used for all subsequent frames.
IplImage* mapx = cvCreateImage( cvGetSize(image), IPL_DEPTH_32F, 1 );
IplImage* mapy = cvCreateImage( cvGetSize(image), IPL_DEPTH_32F, 1 );
cvInitUndistortMap(intrinsic, distortion, mapx, mapy);
Undistort the initial image (say imin
).
cvRemap( imin, imundist mapx, mapy );