2

Im new to OpenCV, Im trying to use SIFT to extract key points from a grayscale image. But failing to successfully compile the code. There seems to be no clear help on the internet for usage of SIFT. Pls help. Thanks.

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);

}

Vino
  • 167
  • 2
  • 14
  • Possible duplicate of [Nonfree module is missing in OpenCV 3.0](http://stackoverflow.com/questions/27418668/nonfree-module-is-missing-in-opencv-3-0) – Miki Mar 04 '16 at 08:36

1 Answers1

0
    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)
Vino
  • 167
  • 2
  • 14