opencv mat矩陣輸出方式
阿新 • • 發佈:2019-01-10
#include<iostream>
#include<opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat array(10, 3, CV_8UC3);
randu(array, Scalar::all(0), Scalar::all(255));
cout << "【預設風格】" << endl << array << endl << endl;
cout << "【Python風格】" << endl << format(array, "python") << endl << endl;
cout << "【逗號分隔風格】" << endl << format(array, "csv") << endl << endl;
cout << "【Numpy風格】" << endl << format(array, "numpy") << endl << endl;
cout << "【C語言風格】" << endl << format(array, "C") << endl << endl;
return 0;
}