나는 무엇이 잘못되었는지 궁금합니다.0xC0000005 : 0xFFFFFFFFFFFFFFFF 위치를 읽는 액세스 위반. opencv에서 glob를 사용할 때
String path = "Z:\\Cs585\\HW2\\draft\\hw2-kim\\hw2-kim\\assets\\*.jpg";
//String path = "assets\\*.jpg";
vector<String> fn;
glob(path, fn, false);
vector<Mat> handTemplates;
for (auto filename : fn){
Mat temp_hand = imread(filename);
handTemplates.push_back(temp_hand);
}
이것은 충돌하고 액세스 위반은 vector<Mat> handTemplates;
라인에 있습니다.
기본적으로 main.cpp
은 Z:\Cs585\HW2\draft\hw2-kim\hw2-kim
디렉토리에 있으며 imread를 일괄 적으로 사용하여 열려고하는 이미지는 assets
이라는 폴더 안에 있습니다.
업데이트 : 그러나, 접근 이미지를 하나 개의 작품 하나 :
vector<Mat> handTemplates;
Mat fist_hand = imread("assets\\fist.jpg");
handTemplates.push_back(fist_hand);
Mat full_hand = imread("assets\\full_hand.jpg");
handTemplates.push_back(full_hand);
Mat thumbs_up_hand = imread("assets\\thumbs_up.jpg");
handTemplates.push_back(thumbs_up_hand);
Mat victory_hand = imread("assets\\victory.jpg");
handTemplates.push_back(victory_hand);
Windows를 사용하고 있습니까? 그렇다면 [std :: string] (https://stackoverflow.com/a/26536198/501196) 또는 [cv :: String] (http : //) 대신 ATL/MFC String 클래스를 사용한다고 생각합니다. /docs.opencv.org/trunk/d1/d8f/classcv_1_1String.html) – yms
그래서 무엇이 정확합니까? 한 줄로 수정할 수 있습니까? –
'경로 '가 맞습니까? 파일 이름 와일드 카드 앞에 백 슬래시가 하나만 있습니다. – 1201ProgramAlarm