windowsXP平台上的NETBEANS中的javaCV

时间:2021-01-14 22:40:45

Dear friends... Here i am trying to use openCV in java using NETBEANS(windows XP).., For that i did the following ..

亲爱的朋友们...我在这里尝试使用NETBEANS(Windows XP)在java中使用openCV ..为此,我做了以下...

[B]1-Install OpenCV-2.2.0-win32-vs2010.exe in C:\openCV 2-Then i put the javaCV and JNA in the library (System path.) 3-The i use thae following code in the netbeans[/B]

[B] 1 - 在C:\ openCV中安装OpenCV-2.2.0-win32-vs2010.exe 2 - 然后我将javaCV和JNA放在库中(系统路径。)3 - 我在netbeans中使用以下代码[/ B]

[CODE]

package samplejavacv;

import java.io.; import static com.googlecode.javacv.jna.cxcore.; import static com.googlecode.javacv.jna.cv.; import static com.googlecode.javacv.jna.highgui.;

import java.io。; import static com.googlecode.javacv.jna.cxcore。; import static com.googlecode.javacv.jna.cv。; import static com.googlecode.javacv.jna.highgui。;

public class sample {

公共课样本{

public static void main(String[] args)throws Exception {
    try {

        IplImage Iimg=cvLoadImage("C:\\Documents and Settings\\All                                                               Users\\Documents\\My Pictures\\Sample Pictures\\Sunset.jpg");

    }
    catch(Exception f) {

        System.out.print(f.getMessage());
    }

}

}

[/CODE]

4- But i got the following exception

4-但我得到以下例外

[CODE]

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'cxcore': The specified module could not be found.

线程“main”中的异常java.lang.UnsatisfiedLinkError:无法加载库'cxcore':找不到指定的模块。

    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:163)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:236)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:199)
    at com.googlecode.javacv.jna.Loader.load(Loader.java:44)
    at com.googlecode.javacv.jna.cxcore.<clinit>(cxcore.java:113)
    at com.googlecode.javacv.jna.highgui.<clinit>(highgui.java:73)
    at samplejavacv.sample.main(sample.java:49)

Java Result: 1

Java结果:1

[/CODE]

5-Then what should i do ....please help 6- Remember some site mention that it need to build the openCV , if it need how can i do that please help...

5 - 然后该怎么办....请帮助6-记住一些网站提到它需要建立openCV,如果它需要我怎么能这样做请帮助...

Anyway thanks in advance ..... Happynew year

无论如何,提前谢谢.....新年快乐

1 个解决方案

#1


0  

You will need compiled *.DLL (for 32 or AMD 64 windows platform or *.SO for e.g. linux) files like:

你需要编译* .DLL(用于32或AMD 64 windows平台或* .SO用于例如linux)文件,例如:

-cv.dll
-cvaux.dll
-cvauxd.dll
-cvd.dll
-cxcore.dll
-cxcored.dll
-cxts.dll
-cxtsd.dll
-highgui.dll
-highguid.dll
-md.dll
-ml.dll

than run your JAVA VM with -Djna.library.path=c:\path\to\your\dlls\directory. E.g.:

而不是使用-Djna.library.path = c:\ path \运行您的JAVA VM到\ your \ dlls \目录。例如。:

 java -Djna.library.path=c:\path\to\your\dlls\directory -cp=. Test

#1


0  

You will need compiled *.DLL (for 32 or AMD 64 windows platform or *.SO for e.g. linux) files like:

你需要编译* .DLL(用于32或AMD 64 windows平台或* .SO用于例如linux)文件,例如:

-cv.dll
-cvaux.dll
-cvauxd.dll
-cvd.dll
-cxcore.dll
-cxcored.dll
-cxts.dll
-cxtsd.dll
-highgui.dll
-highguid.dll
-md.dll
-ml.dll

than run your JAVA VM with -Djna.library.path=c:\path\to\your\dlls\directory. E.g.:

而不是使用-Djna.library.path = c:\ path \运行您的JAVA VM到\ your \ dlls \目录。例如。:

 java -Djna.library.path=c:\path\to\your\dlls\directory -cp=. Test