Reputation:
I installed OpenCV (opencv-3.0.0-alpha) and it works properly but I can't use that import:
import org.opencv.core.*;
import org.opencv.imgcodecs.Imgcodecs;
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.imgcodecs.Imgcodecs cannot be resolved
How can I solve this?
Upvotes: 7
Views: 9338
Reputation: 376
OpenCV 3.0.0 is using the import:
import org.opencv.imgcodecs.Imgcodecs;
However the library you are using (OpenCV 2.4.1) is using different import for the same functionalites:
import org.opencv.highgui.Highgui;
Basically you are trying to import something that doesn't exist in the version you are using.
Now you can either use Highgui or get the jar for OpenCV 3.1.x
Upvotes: 10