I wonder what is wrong here?
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);
}
It crashes and gives access violation at vector<Mat> handTemplates;
line.
basically, main.cpp
is in Z:\Cs585\HW2\draft\hw2-kim\hw2-kim
directory and images which I want to open using imread in batch fashion are in the folder inside it named assets
.
Update: However, accessing images one by one works:
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);