-1
개체 검색을 위해 this tutorial을 따르려고하지만 시작 부분에 멈추었습니다.OpenCV : 추출기 -> descriptorSize() - Segfault
는 지금까지 내 코드는 다음과 같습니다
#include <stdio.h>
#include <stdlib.h>
#include <opencv2/opencv.hpp>
#include <fstream>
#include <iostream>
#include <string>
#include <dirent.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
using namespace cv;
using namespace std;
int main() {
Ptr<DescriptorExtractor> extractor = DescriptorExtractor::create("SURF");
//Mat training_descriptors(1, extractor->descriptorSize(), extractor->descriptorType());
extractor->descriptorSize();
return 0;
}
다음 줄 extractor->descriptorSize();
는 분할 오류 (코어 덤프)를 제공하고 그 이유를 모른다. 아이디어가 있습니까?
1.'extractor.empty();'(인스턴스가 생성되지 않았을 수 있습니다.) 2. 호출하기 전에'initModule_nonfree();'라인을 추가해보십시오. (opencv2 .4) 3. opencv_nonfree.so가 있는지 확인하십시오. (일부 패키지 관리자는 배포하지 않습니다.) – berak
extractor.empty()는 1을 반환합니다. initModule_nonfree()를 추가하면; 컴파일 할 수 없습니다 ('initModule_nonfree'는이 범위에서 선언되지 않았습니다). – definera
방금 nonfree 모듈이 설치되지 않았 음을 알았습니다. 지금 설치 중이며 어떤 일이 일어날 지 알게 될 것입니다. – definera