写在文本文件OpenCV visual studio中

时间:2013-06-27 17:30:49

标签: opencv file-io

如何在OpenCV visual studio中将数组中的元素写入文本文件?

1 个答案:

答案 0 :(得分:0)

std::ofstream f("C:/file_to_write_to.txt");

// writing element my_matrix[10, 10] to file.  assuming it's a float.
f << my_matrix.at<float>(10, 10) << std::endl;
f.close();