opencv fast corner detector 角点检测

#include 
#include 

#include 

using namespace std;
using namespace cv;

int main(int argc, char** argv)
{
    if (argc < 2)
    {
        cout << "usage: ./demo input_image" << endl;
        return -1;
    }

    Mat img = imread(argv[1]);

    if (img.empty())
    {
        cout << "error: image is empty" << endl;
    }

    Ptr fastDetector = FastFeatureDetector::create();

    vector keyPoints;

    fastDetector->detect(img, keyPoints);

    Mat imgWithCorner;

    drawKeypoints(img, keyPoints, imgWithCorner);

    imshow("image with fast corners", imgWithCorner);
    waitKey(0);

    return 0;
}

你可能感兴趣的:(opencv fast corner detector 角点检测)