openCV中Mat矩阵本地保存和读取——xml
1、保存
Mat mat; //要保存的Mat
string path = "D:\B\fileName.xml"; //地址
FileStorage fs(path, FileStorage::WRITE);
fs << "fileName"<< mat;
fs.release();
2、读取
Mat mat;
string path = "D:\B\fileName.xml";
FileStorage fs(path, FileStorage::READ);
fs["fileName"] >> mat;