OpenCV功能FAST未在源代码中实现

时间:2016-02-07 16:43:48

标签: c++ opencv

我正在尝试使用C ++中的OpenCV 3.1实现FAST特征检测/描述计算。

我的代码:

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吗?

2 个答案:

答案 0 :(得分:4)

您还可以在openCV中创建一个特征检测器通用指针并使用它。

cv::Ptr<cv::FeatureDetector> detectorPFast= FeatureDetector::create("PyramidFAST"); 
    std::vector<KeyPoint> keypointsPFast1;
    detectorPFast->detect( src, keypointsPFast1 );

答案 1 :(得分:3)

FAST只是一个功能探测器,没有要计算的描述符。所以,你只需要打电话:

fast->detect(img1, keypoints1);