Hi i have being able to write a Mat object in to a text file. As follows,
std::fstream outputFile; outputFile.open( \"myFile.txt\", std::ios::out ) ;
it's probably far easier, to use the opencv FileStorage:
// write: Mat m; FileStorage fs("myfile.txt",FileStorage::WRITE); fs << "mat1" << m; // read: FileStorage fs("myfile.txt",FileStorage::READ); fs["mat1"] >> m;