线程"main"中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有opencv_java2410 [英] Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java2410 in java.library.path

查看:137
本文介绍了线程"main"中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有opencv_java2410的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用opencv 2410版捕获相机,但是出现此异常 出现,尽管路径正确
iam尝试打开相机并从相机捕获视频,但出现此异常
iam在许多站点中搜索,但没有相同的词

i am trying to capture camera with opencv version 2410 but this exception appear although path is right
iam try to open camera and capture video from camera but this exception appear
iam searched in many sites but nothing same words

netbeans 8.0.2

netbeans 8.0.2

我该如何解决?

output
Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java2410 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1119)
at videocap.VideoCap.main(VideoCap.java:20)
Java Result: 1

在这里编码

VideoCap.java
package videocap;
import org.opencv.core.*;
import org.opencv.highgui.Highgui;        
import org.opencv.highgui.VideoCapture;     

 public class VideoCap {


 public static void main (String args[]){
    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
    VideoCapture camera = new VideoCapture(0);

    if(!camera.isOpened()){
        System.out.println("Error");
    }
    else {
        Mat frame = new Mat();
        while(true){
            if (camera.read(frame)){
                System.out.println("Frame Obtained");
                System.out.println("Captured Frame Width " + frame.width() + " Height " + frame.height());
                Highgui.imwrite("camera.jpg", frame);
                System.out.println("OK");
                break;
            }
        }   
    }
    camera.release();
}

}

推荐答案

要包含本机库,我们需要在netbeans中添加以下步骤

In order to include native library we need to add following steps in netbeans

 ==>Right click on the Project
 ==>Properties
 ==>Click on RUN
 ==>VM Options : -Djava.library.path="C:\Your Directory where Dll is present"
 ==>Ok

这篇关于线程"main"中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有opencv_java2410的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆