2013-06-13 2 views
0

OpenCV 2.4.0을 사용하여 일련의 회색조 이미지에서 특징 지점 집합을 추적하려고합니다.기능 지점 추적

이미 특징 점수를 감지하고 초기에 설명자를 계산하기 위해 SIFT 또는 SURF를 구현하는 방법을 알고 있습니다. 그러나, 나는 위치 (u, v)가 나에게만 알려져있는 특징 점의 SIFT 서술자를 계산할 때 도움이 필요하다. SIFT에 대한 작업 예제 코드는 아래와 같습니다. 내가 좋아하는 dv_scenePoints_t에서 기능을 감지하는 하리스 코너 검출기를 사용하는 경우

예를 들어, : 이러한 경우에 다음

cvGoodFeaturesToTrack (source2, eig_img, temp_img, dv_scenePoints_t, &corner_count, 0.3, 3.0, mask, 7, 1); 

, 어떻게 dv_scenePoints_t에서 점의 SIFT 기술자를 계산한다.

또한 입자 필터로 특징점을 추적해야하는 경우. 그렇다면 각 입자의 무게를 계산하기 위해 SIFT 기술자를 사용하는 방법 (특징점 가설). 감사합니다. . http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_feature_detectors.html?#KeyPoint

당신은 입자의 상대적 가중치를 결정하기 위해 이러한 기능을 사용할 수 있습니다

#include "stdafx.h" 
#include <stdio.h> 
#include "opencv2/core/core.hpp" 
#include "opencv2/features2d/features2d.hpp" 
#include "opencv2/highgui/highgui.hpp" 
#include "opencv2/nonfree/nonfree.hpp" 
#include <opencv2/nonfree/features2d.hpp> 
#include "opencv2/objdetect/objdetect.hpp" 
#include "opencv2/legacy/legacy.hpp" 
#include "opencv2/legacy/compat.hpp" 
#include <opencv/cv.h> 
#include <opencv/highgui.h> 
#include <string.h> 
#include <iostream> 

using namespace cv; 
using namespace std; 

int main(int argc, char *argv[]) 
{   
    Mat source1 = imread("KITTI_train.png",CV_LOAD_IMAGE_GRAYSCALE); 
    Mat source2 = imread("KITTI_trainRotate90.png",CV_LOAD_IMAGE_GRAYSCALE); 

    vector<KeyPoint> dv_sceneKeypoints_t, dv_objectKeypoints_t; 
    vector<DMatch> matches; 

    SiftFeatureDetector detector(400,5,0.03); 

    detector.detect(source1, dv_objectKeypoints_t); 
    detector.detect(source2, dv_sceneKeypoints_t); 
    SiftDescriptorExtractor extractor; 

    Mat descriptors1,descriptors2; 
    extractor.compute(source1,dv_objectKeypoints_t,descriptors1); 
    extractor.compute(source2,dv_sceneKeypoints_t,descriptors2); 

    FlannBasedMatcher matcher; 
    matcher.match(descriptors1,descriptors2, matches); 
    Mat target; 
    drawMatches(source1,dv_objectKeypoints_t,source2,dv_sceneKeypoints_t,matches,target); 
    imshow("Matches", target); 
    waitKey(0); 
    return 0; 

} 

답변

1

Keypoint 구조는 크기와 응답으로 일부 구성원이 포함되어 있습니다.