安装javaCV [英] Installation of javaCV

查看:244
本文介绍了安装javaCV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照以下说明从此处安装javaCV: https://code.google .com/p/javacv/.我已经建立了opencv.实际上,我在opencv文件夹中找到带有.jar文件和.dll的java文件夹,并将它们添加到项目的路径中.当我尝试运行SimpleSample.java时,我收到错误消息:无法找到或加载主类FaceRecognition.为了安装javaCV,我还有其他需要遵循的内容吗?我的简单代码

I am trying to follow the instructions for installing javaCV from here: https://code.google.com/p/javacv/. I ve already built opencv. Actually I locate the java folder with .jar file and .dll in opencv folder and I add them in the path of my project. When I am trying to run the SimpleSample.java I am receiving Error: Could not find or load main class FaceRecognition. Is there something else I ve got to follow in order to install javaCV? My simple Code

 package simplesample;

 /**
 *
 * @author snake
 */

 import static com.googlecode.javacv.cpp.opencv_core.*;
 import static com.googlecode.javacv.cpp.opencv_imgproc.*;
 import static com.googlecode.javacv.cpp.opencv_highgui.*;

 public class SimpleSample{

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    // TODO code application logic here

   }
}

我添加了一些jar文件(javacv-windows-x86.jar,javacpp.jar,javacv.jar),终于使它运行了.但是,当我尝试读取一个简单的jpg图片时:

I add some jar files (javacv-windows-x86.jar, javacpp.jar, javacv.jar) and I finally got it running. But when I am trying to read a simple jpg image:

 public static void main(String[] args) {
    // TODO code application logic here
    System.out.println("soul makosa");

    IplImage image = cvLoadImage("ef.jpg");
    if (image != null) {
        cvSmooth(image, image, CV_GAUSSIAN, 3);
        cvSaveImage("ef1.jpg", image);
        cvReleaseImage(image);
    }

}

我收到以下错误:

    Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_highgui in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:711)
at com.googlecode.javacpp.Loader.load(Loader.java:586)
at com.googlecode.javacpp.Loader.load(Loader.java:540)
at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:79)
at projectcv.ProjectCV.main(ProjectCV.java:28)
    Caused by: java.lang.UnsatisfiedLinkError: C:\Documents and Settings\chrathan\Local         Settings\Temp\javacpp101399456657827\jniopencv_highgui.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1062)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:700)
... 4 more
   Java Result: 1

我还按照此处的指示在属性->运行-> VM优化中添加.dll文件.但是,我仍然收到上述消息.

I also add .dll file in properties->run->VM optimize as instructed here giving 'java.library.path' in netbeans for .dll/.so files. However I am still receiving the above message.

推荐答案

已解决:好,我的问题是由于必须安装特定版本的javaCV而导致的.因此,对于2.4.6.1版的openCV,我已经安装了0.6 java_CV,现在可以正常运行了.

SOLVED:Ok my problems was due to the fact that I had to install specific version of javaCV. So for openCV version 2.4.6.1 I ve installed 0.6 java_CV and now works like a charm.

这篇关于安装javaCV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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