Dear friends... Here i am trying to use openCV in java using NETBEANS(windows XP).., For that i did the following ..
[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]
[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.;
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
[CODE]
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'cxcore': The specified module could not 开发者_运维知识库be found.
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
[/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...
Anyway thanks in advance ..... Happynew year
You will need compiled *.DLL (for 32 or AMD 64 windows platform or *.SO for e.g. linux) files like:
-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.:
java -Djna.library.path=c:\path\to\your\dlls\directory -cp=. Test
精彩评论