Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Load many images in vector<mat>

I'm trying to store multiple images in a folder on a vector <mat> for calculate SIFT and SURF features about it. I want to save image files in a vector<mat>, like this:

vector<mat> images; //Count is defined before for (int a=0; a<count ;a++)="" <br=""> { string name =format("C:\Users\Azu\Documents\Visual Studio 2010\Projects\SIFT2\SIFT2\BBDDFaces\%d.pgm", a); images.push_back(imread(name)); }

But later, I can’t access to the vector images: Imshow (“1”,images[0]); //it works Imshow(“2”,images[1]); //it fails!!

I'd appreciate, if anyone can help me fix it!

Load many images in vector<mat>

I'm trying to store multiple images in a folder on a vector <mat> for calculate SIFT and SURF features about it. I want to save image files in a vector<mat>, like this:

vector<mat> images; //Count is defined before defined before

for (int a=0; a<count ;a++)="" <br="">
  {      a<Count ;a++)
{
    string name
  =format("C:\Users\Azu\Documents\Visual
  Studio
  2010\Projects\SIFT2\SIFT2\BBDDFaces\%d.pgm",
  a);   name=format("C:\\Users\\Azu\\Documents\\Visual Studio 2010\\Projects\\SIFT2\\SIFT2\\BBDDFaces\\%d.pgm", a);
    images.push_back(imread(name));
  }

}

But later, I can’t access to the vector images: images:

Imshow (“1”,images[0]);     //it works
Imshow(“2”,images[1]);      //it fails!!

fails!!

I'd appreciate, if anyone can help me fix it!