相机标定程序详解<2>
#ifndef _CAMERACALIBRATE_H_ #define _CAMERACALIBRATE_H_ #include <opencv2/calib3d/calib3d.hpp> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/opencv.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <iostream> using namespace cv; using namespace std; class CameraCalibrate { private: vector<vector<Point3f>> objectPoints; // 角点的世界坐标系坐标 vector<vector<Point2f>> imagePoints; // 角点的像素坐标系坐标 Mat cameraMatrix; // 内参矩阵 Mat distCoeffs; // 畸变矩阵 vector<Mat> rvecs, tvecs; // 旋转矩阵队列和平移矩阵队列,每一幅标定图像都有对应的一个旋转矩阵和平移矩阵 vector<double> calibrateErrs; // 保存矫正偏差 int flag;