2013-07-23 32 views
0

我想在Mac上使用C++使用的OpenCV的SIFT特徵檢測器,我不斷收到以下錯誤的成員:「SIFT」不是「CV」

siftTest.cpp: In function ‘int main(int, char**)’: 
siftTest.cpp:7: error: ‘SIFT’ is not a member of ‘cv’ 
siftTest.cpp:7: error: expected `;' before ‘detector’ 

我的代碼是:

#include <opencv2/opencv.hpp> 
#include <iostream> 

int main (int arg, char *argv[]) { 
    cv::Mat image = cv::imread("fox.jpg", 1); 

    cv::SIFT detector(0, 3, 0.04, 0, 1.6); 
    cv::vector<cv::KeyPoint> keypoints; 

    cv::namedWindow("=^..^= FOX =^..^="); 
    cv::imshow("=^..^= FOX =^..^=", image); 
    cv::waitKey(); 
    return 0; 
} 

我可能只是沒有導入任何東西,但我找不到合適的東西/正確的組合來讓它起作用。

感謝

回答

4

SIFTSURF被轉移到nonfree模塊。您需要添加

#include <opencv2/nonfree/nonfree.hpp> 

標題和鏈接opencv_nonfree庫。