opencv mat矩阵输出方式

转自:

https://blog.csdn.net/qq_23880193/article/details/47903367

#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;
}

猜你喜欢

转载自blog.csdn.net/zyckhuntoria/article/details/81332335