2013-01-16 2 views
4

OpenCV 2.4에는 검출기와 설명자가 있습니다. 나는 많은 이미지에 대해 키포인트를 만들고 있는데 문제는 탐지기가 키포인트를 얻지 만 기술자가 때때로 그들을 모두 제거한다는 것입니다.OpenCV 기술자가 키포인트를 제거합니다.

  • 어떻게 설명자를 제거하지 못하게합니까?
  • 키 포인트를 향상시켜 키가 제거되지 않는 방법이 있습니까?

답변

0

당신이 몇 가지 코드를 게시 할 수 (... 등 SIFT, SURF, 간단한,) 내가 설명을 많이 시도 것을 알고? CPU 구현은 matcher_simple.cpp라는 samples/cpp 폴더에서 찾을 수 있습니다. 네가 할 수 있니? OpenCV에서 SURF의 GPU 버전을 아무런 문제없이 실행했습니다 :

SURF_GPU surf(1000, 4, 2, false, 0.5); 

// detecting keypoints & computing descriptors 
GpuMat keypoints1GPU, keypoints2GPU; 
GpuMat descriptors1GPU, descriptors2GPU; 
surf(img1, GpuMat(), keypoints1GPU, descriptors1GPU); 
surf(img2, GpuMat(), keypoints2GPU, descriptors2GPU); 

cout << "FOUND " << keypoints1GPU.cols << " keypoints on first image" << endl; 
cout << "FOUND " << keypoints2GPU.cols << " keypoints on second image" << endl; 

// matching descriptors 
BruteForceMatcher_GPU< L2<float> > matcher; 
GpuMat trainIdx, distance; 
matcher.matchSingle(descriptors1GPU, descriptors2GPU, trainIdx, distance); 

// downloading results 
vector<KeyPoint> keypoints1, keypoints2; 
vector<float> descriptors1, descriptors2; 
vector<DMatch> matches; 
surf.downloadKeypoints(keypoints1GPU, keypoints1); 
surf.downloadKeypoints(keypoints2GPU, keypoints2); 
surf.downloadDescriptors(descriptors1GPU, descriptors1); 
surf.downloadDescriptors(descriptors2GPU, descriptors2); 
BruteForceMatcher_GPU< L2<float> >::matchDownload(trainIdx, distance, matches); 

// drawing the results 
Mat img_matches, image1, image2; 
img1.download(image1); 
img2.download(image2); 
drawMatches(image1, keypoints1, image2, keypoints2, matches, img_matches); 
관련 문제