在opencv中,特征检测、描述、匹配都有集成的函数。vector<DMatch> bestMatches;用来存储得到的匹配点对。那么如何提取出其中的坐标呢?
int index1, index2;for (int i = 0; i < bestMatches.size(); i++)//将匹配的特征点坐标赋给point{index1 = bestMatches.at(i).queryIdx;index2 = bestMatches.at(i).trainIdx;cout << keyImg1.at(index1).pt.x << " "<< keyImg1.at(index1).pt.y << " "<< keyImg2.at(index2).pt.x << " "<< keyImg2.at(index2).pt.y << endl;}