iOS에서 OpenCV를 사용하여 개체를 검색하려고합니다. 나는 this code sample from the documentation을 사용하고 있습니다.OpenCV DescriptorExtractor가 공백을 반환합니다.
Mat src = imread("src.jpg");
Mat templ = imread("logo.jpg");
Mat src_gray;
cvtColor(src, src_gray, CV_BGR2GRAY);
Mat templ_gray;
cvtColor(templ, templ_gray, CV_BGR2GRAY);
int minHessian = 500;
OrbFeatureDetector detector(minHessian);
std::vector<KeyPoint> keypoints_1, keypoints_2;
detector.detect(src_gray, keypoints_1);
detector.detect(templ_gray, keypoints_2);
OrbDescriptorExtractor extractor;
Mat descriptors_1, descriptors_2;
extractor.compute(src_gray, keypoints_1, descriptors_1);
extractor.compute(templ_gray, keypoints_2, descriptors_2);
문제는 descriptors_1
항상 빈 잎 라인 extractor.compute(src_gray, keypoints_1, descriptors_1);
에 :
여기 내 코드입니다.
src
및 templ
은 비어 있지 않습니다.
의견이 있으십니까?
감사
난 당신이 기능 탐지기와 기술자를 사용하려는 경우 당신은 그들이 작동하는 방법으로 자신을 알려야한다고 생각 모두의
keypoints_1이 비어 있습니까? – Dennis
예,'keypoints_1'은 비어 있습니다. – Eric
그러면 설명자를 계산할 수 없으므로 descriptors_1이 비어 있습니다. – Dennis