# Revision history [back]

### 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?

 3 No.3 Revision berak 28252 ●4 ●75 ●285

### 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?

 4 No.4 Revision berak 28252 ●4 ●75 ●285

### 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?

 5 you'll need some bait to get bytefish to bite ! ;) berak 28252 ●4 ●75 ●285

### 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?