【问题标题】:Example code for SIFT in OpenCV 3?OpenCV 3 中 SIFT 的示例代码?
【发布时间】:2016-03-04 07:08:29
【问题描述】:

我是 OpenCV 的新手,我正在尝试使用 SIFT 从灰度图像中提取关键点。但未能成功编译代码。互联网上似乎没有关于 SIFT 使用的明确帮助。请帮忙。谢谢。

while(true)
{
    Mat myFrame;
    Mat grayFrame;
    capture.read(myFrame);
    cvtColor(myFrame, grayFrame, CV_BGR2GRAY);

    vector<Vec2f> outputArray;
    vector<KeyPoint> keypoint;
    Feature2D EXTRACTOR;
    Mat descriptors;
    EXTRACTOR.detectAndCompute(grayFrame, outputArray, keypoint, descriptors);

}

【问题讨论】:

标签: opencv computer-vision sift


【解决方案1】:
    vector<KeyPoint> keyVector;
    Mat outputDiscriptor;
    Ptr<SIFT> detector = SIFT::create();
    detector->detect(grayFrame, keyVector);
    //here grayFrame is the gray scale of the original frame/image

    if you want to get the descriptors of the key points use the 
    detector->compute(grayFrame, keyVector)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-02-07
    • 2013-01-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-16
    • 2017-12-27
    相关资源
    最近更新 更多