OpenCV 3中SIFT的示例代码?

OpenCV 3中SIFT的示例代码?,opencv,computer-vision,sift,Opencv,Computer Vision,Sift,我是OpenCV新手,我尝试使用SIFT从灰度图像中提取关键点。但未能成功编译代码。互联网上似乎没有明确的帮助来使用SIFT。请帮忙。谢谢 while(true) { Mat myFrame; Mat grayFrame; capture.read(myFrame); cvtColor(myFrame, grayFrame, CV_BGR2GRAY); vector<Vec2f> outputArray; vector<KeyP

我是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);
while(true)
{
Mat-myFrame;
垫灰框;
捕获读取(myFrame);
CVT颜色(myFrame、grayFrame、CV_BGR2GRAY);
矢量输出阵列;
向量关键点;
特征2D提取器;
Mat描述符;
提取器。检测和计算(灰度帧、输出阵列、关键点、描述符);
}
矢量键矢量;
Mat输出描述器;
Ptr检测器=SIFT::create();
检测器->检测(灰度帧、关键向量);
//此处grayFrame是原始帧/图像的灰度
如果要获取关键点的描述符,请使用
检测器->计算(灰度帧、关键向量)
    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)