0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF. when using glob from opencv

0

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.

Any thoughts? enter image description here

enter image description here

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);
c++
visual-studio
opencv
glob
access-violation
asked on Stack Overflow Sep 20, 2017 by Mona Jalal • edited Sep 20, 2017 by Mona Jalal

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0