I'm trying to do some operations with a Matrix in Java using opencv. I'm using Eclipse Kepler IDE.
The problem happens when I try to declare a new matrix with the constructor, then I get the following error in the console:
Exception in thread "main" java.lang.UnsatisfiedLinkError:
org.opencv.core.Mat.n_Mat(III)J
at org.opencv.core.Mat.n_Mat(Native Method)
at org.opencv.core.Mat.<init>(Mat.java:477)
I'm using OpenCV 2.4.8 for OSX, OSX 10.9.1 and Eclipse Kepler.
Here is my Code:
import java.util.ArrayList;
import java.util.List;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.Size;
public class FisherFaces {
public static void main(String[] args) {
Size s = new Size(new double[] {3,3});
Mat g= new Mat(3,3,CvType.CV_8UC1);
}
Is there anything I am doing wrong to cause this error?
I found the problem, I wasn't loading the native libraries, adding the line below fixes it.
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With