Demo entry 6658254

1

   

Submitted by anonymous on Nov 06, 2017 at 16:21
Language: C++. Code size: 724 Bytes.

#include <opencv2/opencv.hpp>
#include<iostream> 
using namespace std;
using namespace cv;
int main()
{
	Mat image1;//无初始化矩阵
	Mat image2(6, 6, CV_8UC1);//6行6列8位单通道矩阵
	Mat image3(Size(7, 7), CV_8UC3);//大小为7*7类型为8位3通道矩阵
	Mat image6;
	image2.copyTo(image6);
	cout << "image1 = " << endl << image1 << endl << endl;
	cout << "image2 = " << endl << image2 << endl << endl;
	cout << "image3 = " << endl << image3 << endl << endl;
	Mat image4(8, 8, CV_32FC2, Scalar(1, 3));//用1+3j填充的8*8复数矩阵  
	cout << "image4 = " << endl << image4 << endl << endl;
	image4.create(8, 8, CV_32FC2);
	cout << "image5 = " << endl << image4 << endl << endl;
	cout << "image6 = " << endl << image6 << endl << endl;
	system("pause");
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).