Search code examples
javajavacv

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_highgui in java.library.path


just installed javaCV. I imported all the jars in the project but when i eun this code i get that error:

import static com.googlecode.javacv.cpp.opencv_core.cvReleaseImage;
import static com.googlecode.javacv.cpp.opencv_highgui.cvLoadImage;
import static com.googlecode.javacv.cpp.opencv_highgui.cvShowImage;
import static com.googlecode.javacv.cpp.opencv_highgui.cvWaitKey;
import static com.googlecode.javacv.cpp.opencv_imgproc.CV_GAUSSIAN;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvSmooth;

IplImage img = cvLoadImage("HelloWorld.jpg");
cvShowImage("Hello-World", img);
cvSmooth(img, img, CV_GAUSSIAN, 13);
cvShowImage("Blur-Image", img);
cvWaitKey();
cvReleaseImage(img);

from what is it caused?


Solution

  • Added

    static {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
    }
    

    In the main file and it works.. Just need this line of code