Import org.opencv.highgui is not possible.

I installed OpenCV (opencv-3.0.0-alpha) and it works proberly, but I cannot use this import

import org.opencv.core.*; import org.opencv.highgui.Highgui; public class Main { public static void main(String[] args) { // System.loadLibrary("opencv_java244"); // Mat m = Highgui.imread("C:/Users/raj/Desktop/sa1.png", // Highgui.CV_LOAD_IMAGE_COLOR); // new LoadImage("C:/Users/raj/Desktop/dst1.jpg", m); } } 

I get this error

 The import org.opencv.highgui cannot be resolved 

How can i solve this?

+6
source share
2 answers

in opencv3.0, in java there is no highgui module.

functionality has been split into new video images and imgcodecs (where you find imread) modules.

since there is no gui from java, you no longer need to have a highgui module.

 import org.opencv.core.*; import org.opencv.imgcodecs; // imread, imwrite, etc import org.opencv.videoio; // VideoCapture 
+15
source
 import org.opencv.imgcodecs.Imgcodecs; // imread, imwrite 

Not: org.opencv.imgcodecs;

Core.line , Core.Rectangle , Core.imread , Core.imwrite are deprecated.

Use Imgcodecs.imread , Imgcodecs.imwrite etc.

0
source

Source: https://habr.com/ru/post/975421/


All Articles