由于是在ch7中的pose_estimation_3d2d遇到的问题,因此我直接在pose_estimation_3d2d文件中添加测试代码,测试代码可以放在最后应该也可以,就是图个方便…
/*************test*************/
cout << "test_start:" << endl ;
Mat my_img1=img_1.clone();
Mat my_img2=img_2.clone();
int img1_x = keypoints_1[matches[1].queryIdx].pt.x ;
int img1_y = keypoints_1[matches[1].queryIdx].pt.y ;
//int img2_x = keypoints_2[matches[1].trainIdx].pt.x ;
//aaint img2_y = keypoints_2[matches[1].trainIdx].pt.y ;
int img2_x = keypoints_2[matches[1].queryIdx].pt.x ;
int img2_y = keypoints_2[matches[1].queryIdx].pt.y ;
circle(my_img1, Point(img1_x,img1_y), 5, Scalar(0, 0, 255));
circle(my_img2, Point(img2_x,img2_y), 5, Scalar(0, 0, 255));
cout << "matches[1].queryIdx = " << matches[1].queryIdx <<endl ;
cout << "matches[1].trainIdx = " << matches[1].trainIdx <<end