1. 传统使用张正友相机标定,角点检测
//张正友相机标定,角点检测
for(int i=1;i<=images_number;i++){Mat image=imread(images_path+to_string(i)+String("/color.jpg"));Mat output=image.clone();image_size.width=image.cols;image_size.height=image.rows;if(0==findChessboardCorners(image,board_size,image_points_buf)){cout<<i<<" can not find chessboard"<<endl;exit(1);}else{Mat view_gray;cvtColor(image,view_gray,COLOR_BGR2GRAY);find4QuadCornerSubpix(view_gray,image_points_buf,Size(5,5));image_points_seq.push_back(image_points_buf);drawChessboardCorners(output,board_size,image_points_buf,false);}}Size square_size = Size(25, 25); vector<vector<Point3f>> object_points;Mat cameraMatrix = Mat(3, 3, CV_64FC1);vector<int> point_count