opencv3_java 图像Mat画图 Mat

图像Mat画图 Mat


package opencv_java_demo;

import org.opencv.core.*;
import org.opencv.imgcodecs.Imgcodecs;

public class CreateImage {

	public static void main(String[] args) {
		System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
		Mat redImage = new Mat(100,200,CvType.CV_8UC3,new Scalar(0,0,255));
		//创建矩阵显示图片,矩阵类型为CvType.CV_8UC3,RGB颜色为全红色
		Imgcodecs.imwrite("./images/red.jpg",redImage);
		//读取图片并显示
	}

}




你可能感兴趣的:(java,opencv3)