/** * OpenCV undistortion demonstration. * * Based on CvBase, see which. * * @author vona **/ #include "cvbase.hpp" #include #include using namespace std; /** * Extends base class to undistort given camera calibration in YAML format, as * written by the OpenCV sample calibration program. **/ class CvUndistort : public CvBase { protected: /** Camera intrinsic parameters. **/ CvMat *intrinsics; /** Camera distortion parameters. **/ CvMat *distortions; /** Undistort map. **/ IplImage *mapx, *mapy; /** Whether to undistort. **/ bool undistort; /** The undistorted image. **/ IplImage *undistortImage; /** Camera index is not optional on the command line. **/ virtual bool camIndexOptional() { return false; } /** Adds command line help. **/ virtual void cmdHelpExt() { cout<<" where C is the YAML calibration file path"<