#include <opencv2/opencv.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
Mat M(2,2,CV_8UC3,Scalar(0,0,255));//两行两列
cout << "M= "<< " " << M << endl << endl;
cout << "*******************************" << endl;
int sz[] = {3,3};//定义维数
Mat L(2,sz,CV_8UC3,Scalar::all(10));
cout << "L= " << " " << format(L,Formatter::FMT_PYTHON)<< endl << endl;//以PYTHON格式输出
return 0;
}
2.2OpenCV格式化输出矩阵
最新推荐文章于 2022-07-06 10:44:21 发布