Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Save a vector<mat> to a file and read it back in c++

Hello, i am developing a face recognition application and i want to store a vector<mat> with faces to a file. Then, when the application starts, i want to read it back and fill the vector with the faces. I am doing this way because the FaceRecognizer model, does not support update (only the FaceRecognizer.LBPH supports it) and i am working with Eigenfaces and Fisherfaces. I tried to store it in a txt std::ofstream output_file("./ppFaces.txt"); std::ostream_iterator<Mat> output_iterator(output_file, "\n"); std::copy(preprocessedFaces.begin(), preprocessedFaces.end(), output_iterator); but when i read it back, the vector does not filled correct. Any ideas?

Save a vector<mat> to a file and read it back in c++

Hello, i am developing a face recognition application and i want to store a vector<mat> with faces to a file. Then, when the application starts, i want to read it back and fill the vector with the faces. I am doing this way because the FaceRecognizer model, does not support update (only the FaceRecognizer.LBPH supports it) and i am working with Eigenfaces and Fisherfaces. I tried to store it in a txt std::ofstream output_file("./ppFaces.txt"); std::ostream_iterator<Mat> std::ostream_iterator<mat> output_iterator(output_file, "\n"); std::copy(preprocessedFaces.begin(), preprocessedFaces.end(), output_iterator);output_iterator); but when i read it back, the vector does not filled correct. Any ideas?

click to hide/show revision 3
No.3 Revision

updated 2013-05-28 14:42:32 -0600

berak gravatar image

Save a vector<mat> to a file and read it back in c++

Hello, i am developing a face recognition application and i want to store a vector<mat> with faces to a file. Then, when the application starts, i want to read it back and fill the vector with the faces. I am doing this way because the FaceRecognizer model, does not support update (only the FaceRecognizer.LBPH supports it) and i am working with Eigenfaces and Fisherfaces. I tried to store it in a txt

std::ofstream output_file("./ppFaces.txt");
std::ostream_iterator<mat> std::ostream_iterator<Mat> output_iterator(output_file, "\n");
std::copy(preprocessedFaces.begin(), preprocessedFaces.end(), output_iterator);

but when i read it back, the vector does not filled correct. Any ideas?

click to hide/show revision 4
No.4 Revision

updated 2013-05-28 16:06:47 -0600

berak gravatar image

Save a vector<mat> to a file and read it back in c++

Hello, i am developing a face recognition application and i want to store a vector<mat> with faces to a file. Then, when the application starts, i want to read it back and fill the vector with the faces. I am doing this way because the FaceRecognizer model, does not support update (only the FaceRecognizer.LBPH supports it) and i am working with Eigenfaces and Fisherfaces. I tried to store it in a txt

std::ofstream output_file("./ppFaces.txt");
std::ostream_iterator<Mat> output_iterator(output_file, "\n");
std::copy(preprocessedFaces.begin(), preprocessedFaces.end(), output_iterator);

but when i read it back, the vector does not filled correct. Any ideas?

click to hide/show revision 5
you'll need some bait to get bytefish to bite ! ;)

updated 2013-05-28 16:12:21 -0600

berak gravatar image

Save a vector<mat> to a file and read it back in c++

Hello, i am developing a face recognition application and i want to store a vector<mat> with faces to a file. Then, when the application starts, i want to read it back and fill the vector with the faces. I am doing this way because the FaceRecognizer model, does not support update (only the FaceRecognizer.LBPH supports it) and i am working with Eigenfaces and Fisherfaces. I tried to store it in a txt

std::ofstream output_file("./ppFaces.txt");
std::ostream_iterator<Mat> output_iterator(output_file, "\n");
std::copy(preprocessedFaces.begin(), preprocessedFaces.end(), output_iterator);

but when i read it back, the vector does not filled correct. Any ideas?