title: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF. when using glob from opencv
body: <p>I wonder what is wrong here?</p>
  
  <pre><code>String path = "Z:\\Cs585\\HW2\\draft\\hw2-kim\\hw2-kim\\assets\\*.jpg";
  //String path = "assets\\*.jpg";
  vector&lt;String&gt; fn;
  glob(path, fn, false);
  vector&lt;Mat&gt; handTemplates;
  for (auto filename : fn){
      Mat temp_hand = imread(filename);
      handTemplates.push_back(temp_hand);
  }
  </code></pre>
  
  <p>It crashes and gives access violation at <code>vector&lt;Mat&gt; handTemplates;</code> line. </p>
  
  <p>basically, <code>main.cpp</code> is in <code>Z:\Cs585\HW2\draft\hw2-kim\hw2-kim</code> directory and images which I want to open using imread in batch fashion are in the folder inside it named <code>assets</code>. </p>
  
  <p>Any thoughts?
  <a href="https://i.stack.imgur.com/SbEJk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SbEJk.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/2pBFl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2pBFl.png" alt="enter image description here"></a></p>
  
  <p>Update: 
  However, accessing images one by one works:</p>
  
  <pre><code>vector&lt;Mat&gt; 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);
  </code></pre>