-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDisplayImage.java
44 lines (24 loc) · 1.03 KB
/
DisplayImage.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// ********************************************************
// Example : displaying an image from file
// Author : Toby Breckon, toby.breckon@durham.ac.uk
// Copyright (c) 2015 Durham University
// License : LGPL - http://www.gnu.org/licenses/lgpl.html
// ********************************************************
// import required OpenCV components
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.highgui.Highgui;
// ********************************************************
public class DisplayImage {
public static void main(String[] args) {
// load the Core OpenCV library by name
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
// load an image from file (read and decode JPEG file)
Mat inputImage = Highgui.imread("files/lena.jpg");
// create a display window using an Imshow object
Imshow ims1 = new Imshow("My Image");
// display image
ims1.showImage(inputImage);
}
}
// ********************************************************