1

我最近下载了 OpenCv 库,我正在尝试使用它的功能,但不幸的是我无法这样做。这是我编写的类

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Opencv;

import hypermedia.video.*;

/**
 *
 * @author 

 */
public class LoadImage
{
    public LoadImage()
    {


        OpenCV opencv = new OpenCV( );
        opencv.loadImage( "one.png", 200, 100);
        image( opencv.image(), 0, 0 );
      //  image( opencv.loadImage("one.png.jpg"), 0, 0);


    }


    public static void main(String[] args)
    {
               LoadImage im=new LoadImage();
    }
}

我正在使用 netbeans IDE,它没有显示语法错误。但是在运行它之后,我得到了以下错误。

!!! required library not found : C:\Program Files\Java\jdk1.6.0_21\bin\OpenCV.dll: Can't find dependent libraries
Verify that the java.library.path property is correctly set and the '\path\to\OpenCV\bin' exists in your system PATH

Exception in thread "main" java.lang.UnsatisfiedLinkError: hypermedia.video.OpenCV.loadImage(Ljava/lang/String;II)V
    at hypermedia.video.OpenCV.loadImage(Native Method)
    at Opencv.LoadImage.<init>(LoadImage.java:20)
    at Opencv.LoadImage.main(LoadImage.java:30)
Java Result: 1
BUILD SUCCESSFUL (total time: 6 seconds)

但是我已经完成了所有操作,就像我导入了库一样,几乎将 OpenCv.dll 文件放置在任何地方。但我不断收到此错误。帮助

4

1 回答 1

1

似乎 java 找不到合适的 DLL - openCV 是通过 JNI 调用的。这是有用的答案: OpenCV to JNI how to make it work?

于 2012-10-12T14:34:14.877 回答