我正在尝试使用 C++ 中的 OpenCV 3.1 实现快速特征检测/描述计算。
我的代码:
Ptr<cv::FastFeatureDetector> fast = cv::FastFeatureDetector::create();
fast->detectAndCompute(img1, Mat(), keypoints1, desc);
但是当我应用 detectAndCompute 时,出现错误。调试后,我看到在源文件(features2d.cpp)中一定会抛出错误:
//[In source file features2d.cpp]
/* Detects keypoints and computes the descriptors */
void Feature2D::detectAndCompute( InputArray, InputArray,
std::vector<KeyPoint>&,
OutputArray,
bool )
{
CV_Error(Error::StsNotImplemented, "");
}
为什么没有实现?还有其他方法可以让我使用 FAST 吗?
最佳答案
您还可以在 openCV 中创建一个特征检测器通用指针并使用它。
cv::Ptr<cv::FeatureDetector> detectorPFast= FeatureDetector::create("PyramidFAST");
std::vector<KeyPoint> keypointsPFast1;
detectorPFast->detect( src, keypointsPFast1 );
关于c++ - OpenCV 功能 FAST 未在源代码中实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35256174/