Search code examples
javaopencvexceptionmat

Mat initialization exception in java


I am using OpenCv in Java.

import org.opencv.core.Mat;

Now i'm trying to initialize a new Mat like this:

Mat points = new Mat();

What i recieve is the following exception: Exception in thread "main" java.lang.UnsatisfiedLinkError:

org.opencv.core.Mat.n_Mat()J
    at org.opencv.core.Mat.n_Mat(Native Method)
    at org.opencv.core.Mat.<init>(Mat.java:15)

I have no idea what this exception is about. Also no idea what i could have done wrong. Do you?


Solution

  • Now i found it out.
    following line is missing:

    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);