title: Load many images in vector<Mat> Opencv
body: <p>I'm trying to store multiple images in a folder on a vector  for later processing. The problem is that I get the error:</p>
  
  <pre><code>*Debug Assertion Failed!
  
  Expression: vector subscript out of range.*
  </code></pre>
  
  <p>The code that I'm testing is as follows.</p>
  
  <pre><code>stringstream Nombre2;
  vector&lt;Mat&gt; Imagen2;
  for (int a=0; a&lt;=Count;a++) 
  {
      Nombre2.clear();
      Nombre2 &lt;&lt; "C:\\Users\\Azu\\Documents\\Visual Studio 2010\\Projects\\SIFT2\\SIFT2\\BBDDFaces\\"&lt;&lt; a+1 &lt;&lt; ".pgm";
      imread(Nombre2.str()).copyTo(Imagen2[a]);
  }
  </code></pre>
  
  <p>The images names are numerical: 1.pgm, 2.pgm, so on.. </p>
  
  <p>I'd appreciate, if anyone can help me fix it!</p>