Ask Your Question

Revision history [back]

click to hide/show revision 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):

  1. Parameters should be loaded back in a matrix.

    CvMat intrinsic = (CvMat)cvLoad(“Intrinsics.xml”);

    CvMat distortion = (CvMat)cvLoad(“Distortion.xml”);

  2. 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);

  3. Undistort the initial image (say imin).

    cvRemap( imin, imundist mapx, mapy );