0
아래 코드는 SIFT에서 기능 감지를 보는 것입니다. 문제는 그것을 실행할 때 깨지는 것입니다.SIFT 기능 감지기가 처리되지 않은 예외를 생성합니다.
#include <features2d.hpp>
#include <stdafx.h>
#include <stdlib.h>
#include <cv.hpp>
#include <cxcore.hpp>
#include <highgui.h>
#include <iostream>
using namespace cv;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
Mat img = imread("c:\\chappal.jpg", 0);
Ptr<FeatureDetector> feature_detector = FeatureDetector::create("SIFT");
vector<KeyPoint> keypoints;
feature_detector->detect(img, keypoints);
Mat output;
drawKeypoints(img, keypoints, output, Scalar(255, 0, 0));
namedWindow("meh", CV_WINDOW_AUTOSIZE);
imshow("meh", output);
waitKey(0);
return 0;
}
때 단계별로 디버깅 단계이 행에서 프로그램 나누기 : 나는 다시 확인하고 다시 문제가 발생할 수 있습니다 무엇인지 잘 모릅니다있다 feature_detector->detect(img, keypoints);
.
P. 먼저 대신 SiftFeatureDetector
을 시도했지만 오류가 발생하여 라이브러리 파일에서 SiftFeatureDetector
을 찾을 수 없습니다. 이 포럼의 게시물에서 두 코드 샘플에 대해 배웠습니다.
''SiftFeatureDetector''가 비 자유 폴더에있는 별도의 라이브러리에 보관된다는 것을 알았습니다. 그렇다면 왜 non-free 라이브러리가 2.4 튜토리얼에서 사용되지 않는지 : http://docs.opencv.org/doc/tutorials/features2d/feature_detection/feature_detection.html? – StuckInPhD