python - OpenCV evaluateFeatureDetector for Python?

标签 python opencv feature-detection sift

我正在使用 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 );

srcPointsrefPoints是特征匹配后得到的。

repeatability 和 correspCount 是函数的输出。

关于python - OpenCV evaluateFeatureDetector for Python?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35289542/

相关文章:

c++ - cv::Mat_<Type> 分配错误

opencv - 使用 KLT 和均值漂移进行人体跟踪

c++ - 从一堆对象中提取一个对象并检测边缘

python - 使用 %matplotlib 内联时,Jupyter 笔记本 Canvas 无法交互

python - 为什么这是错误的? `SomeClass.method is SomeClass.method`

python - 使用 Python winreg 更改注册表项未生效,但不会抛出错误

ios - 适用于 iOS 的基于 GPU 的 SIFT 特征提取器?

python - 如何从 Perl 调用 python 脚本?

android - Opencv/C++ - 将 NV21 转换为 RGB 并在 android 应用程序中生成位图

c - For 循环中的段错误