Skip to content

Instantly share code, notes, and snippets.

@zhou-chao
Created September 15, 2015 14:45
Show Gist options
  • Save zhou-chao/7a7de79de47c652196f1 to your computer and use it in GitHub Desktop.
Save zhou-chao/7a7de79de47c652196f1 to your computer and use it in GitHub Desktop.
Save OpenCV mat as CSV format
#include <fstream>
void writeCSV(string filename, Mat m)
{
ofstream myfile;
myfile.open(filename.c_str());
myfile<< cv::format(m, cv::Formatter::FMT_CSV) << std::endl;
myfile.close();
}
@stephan735
Copy link

Great! Simple and efficient. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment