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?