#include #include #ifndef CALIB_CAM_H #define CALIB_CAM_H class CalibCam { public: CalibCam(); ~CalibCam(); void initialize(int numImgs, int numPointsPerImg, int *fileN); void getImageSize(int *fn); void directCalibration(void); void printCameraParams(void); //get the extrinsic rotation/translation parameters // input: imageNum---the (Inner image) number void getExtrinsicParams(int imageNum); CvPoint2D64d world2pixel(const CvPoint3D64d &wp); // input: whichOne---input image number (external) void world2pixelOneImage(int whichOne); // input: whichOne---input image number (external) void accuracyE(int whichOne); void projectionE(int whichOne); //display the error in image (external image number) void displayErrorInImage(int whichOne); static int totalNumImages; static int errorImageNum; IplImage *sourceI; IplImage *errorI; //private: //use for cvCalibrateCamera_64d int numImages; //number of images int *imageNums; //the image number int *numPoints; //(array) number of points/image CvSize imageSize; CvPoint2D64d *imagePoints; //pointer to image vertices CvPoint3D64d *objectPoints; //pointer to object vertices CvPoint2D64d *totalImagePts; //pointer to all image vertices CvPoint3D64d *totalObjectPts; //pointer to all object vertices CvPoint2D64d *computedImgPts; CvVect64d distortion; CvMatr64d cameraMatrix; CvVect64d transVects; CvMatr64d rotMatrs; int useIntrinsicGuess; CvMat inMat; //intrinsic camera matrix---A/opencv CvMat exRot; //extrinsic camera matrix---R/opencv CvMat exTrs; //extrinsic camera matrix---t/opencv CvMat tempM1; CvMat tempM2; //for method2--camera parameters through projection matrix // --- please pay attention to the place of the //----intialization!!!!!!!!!!!!!!!!!!!!!!!!!! CvMat AMat; CvMat projMat; CvMat m2InMat; CvMat m2ExRot; CvMat m2ExTrs; void projMatInit(void); void projMatCalibration(void); }; #endif