Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The import org.opencv.highgui cannot be resolved

Tags:

java

opencv

I installed OpenCV (opencv-3.0.0-alpha) and it works proberly but I can't use that 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?

like image 421
n1amr Avatar asked Sep 17 '14 12:09

n1amr


1 Answers

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

the functionality was split up into new videoio and imgcodecs (that's where you will find imread) modules.

since there is no gui available from java, - no need to have a highgui module anymore.

import org.opencv.core.*;
import org.opencv.imgcodecs; // imread, imwrite, etc
import org.opencv.videoio;   // VideoCapture
like image 133
berak Avatar answered Oct 03 '22 13:10

berak