我想比较OpenCV创建的矩阵和Matlab中的矩阵.如果矩阵是uint8,将它们保存为pgm图像就可以了.但我的矩阵是CV_64FC1(双),不能保存为图像.有没有简单的方法来保存我的双矩阵在Matlab中阅读?
从OpenCV样本中尝试这个.
Mat r
std::stringstream ss;
ss << format(r,"csv") << endl << endl;
myFile << ss.str();
// or even this
myFile << format(r,"csv") << endl << endl;
Run Code Online (Sandbox Code Playgroud)