我正在使用 Python 和 OpenCV 3.0,我正在尝试评估两个图像的 SIFT 描述符。更具体地说,我对重复率感兴趣。在 C++ 中,有一个用于执行评估的函数:
cv::evaluateFeatureDetector(img_1c, img_2c, h12, &key_points_1, &key_points_2, repeatability, corrCounter);
但是,我还没有在 Python 中找到任何实现,而且我真的不明白我如何(以及是否)可以使用这个函数。有没有其他方法可以在 python 中计算重复率?
最佳答案
这是语法:
void cv::evaluateFeatureDetector ( const Mat & img1,
const Mat & img2,
const Mat & H1to2,
std::vector< KeyPoint > * keypoints1,
std::vector< KeyPoint > * keypoints2,
float & repeatability,
int & correspCount,
const Ptr< FeatureDetector > & fdetector = Ptr< FeatureDetector >()
)
img1 和 img2 是你要匹配的两个图像,H1to2 是单应矩阵,可以这样计算:
H1to2 = cv::findHomography( std::vector<cv::Point2f> srcPoints , std::vector<cv::Point2f> refPoints, CV_RANSAC, 1 );
srcPoints
和refPoints
是特征匹配后得到的。
repeatability 和 correspCount 是函数的输出。
关于python - OpenCV evaluateFeatureDetector for Python?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35289542/