parent
e750ea39dc
commit
643f9400b9
@ -1,22 +0,0 @@
|
||||
package com.yuxue.controller;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
|
||||
|
||||
/**
|
||||
* opencv 官方demo
|
||||
* @author yuxue
|
||||
* @date 2020-04-22 14:04
|
||||
*/
|
||||
public class OpenvpDemo {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Welcome to OpenCV " + Core.VERSION);
|
||||
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
|
||||
Mat m = Mat.eye(3, 3, CvType.CV_8UC1);
|
||||
System.out.println("m = " + m.dump());
|
||||
}
|
||||
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
package com.yuxue.controller;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Scalar;
|
||||
|
||||
|
||||
/**
|
||||
* 官方demo
|
||||
* @author yuxue
|
||||
* @date 2020-04-24 15:34
|
||||
*/
|
||||
public class SimpleSample {
|
||||
|
||||
static {
|
||||
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Welcome to OpenCV " + Core.VERSION);
|
||||
Mat m = new Mat(5, 10, CvType.CV_8UC1, new Scalar(0));
|
||||
System.out.println("OpenCV Mat: " + m);
|
||||
Mat mr1 = m.row(1);
|
||||
mr1.setTo(new Scalar(1));
|
||||
Mat mc5 = m.col(5);
|
||||
mc5.setTo(new Scalar(5));
|
||||
System.out.println("OpenCV Mat data:\n" + m.dump());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue