ori  
 example  

[按此下載可執行程式] (請先安裝OpenCV 2.x以上)

 

SIFT = Scale Invariant Feature Transform

這是一個在閃電霹靂車界小有名氣的函式,用途是找影像特徵點。

sift  

 使用說明:

下載完壓縮檔後
把你的JPG格式圖檔
檔名改成 example.jpg
放在同一個資料夾,就能找到你圖像的特徵點囉

 

程式碼

IplImage *frame = cvLoadImage("圖檔位置");
cv::SiftFeatureDetector detector;

std::vector<cv::KeyPoint> keypoints;
cvCvtColor(frame,out,CV_BGR2GRAY);
IplImage* out = cvCreateImage( cvGetSize(frame), IPL_DEPTH_8U, 1 );
detector.detect(out, keypoints);

cv::Mat output;
cv::drawKeypoints(out, keypoints, output);

 


arrow
arrow
    全站熱搜

    finalfrank 發表在 痞客邦 留言(0) 人氣()