slam十四讲ch7中,DMatch类中的queryIdx和trainIdx

由于是在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
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值