I\'ve been trying to get opencv working inside of our raspberry pi, but I have not been able to get it working at all. I made a new eclipse project, added in the OpenCV libr
You can load the library like this: first of all call this method
public static void loadOpenCV_Lib() throws Exception {
// get the model
String model = System.getProperty("sun.arch.data.model");
// the path the .dll lib location
String libraryPath = "C:/opencv/build/java/x86/";
// check for if system is 64 or 32
if(model.equals("64")) {
libraryPath = "C:/opencv/build/java/x64/";
}
// set the path
System.setProperty("java.library.path", libraryPath);
Field sysPath = ClassLoader.class.getDeclaredField("sys_paths");
sysPath.setAccessible(true);
sysPath.set(null, null);
// load the lib
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
}
Note: In code above the OpenCV has extracted in C drive root folder.
Edit: In Eclipse you are also can do it like this: Right click on the project -> Build Path -> Configure Build Path -> Libraries (Tab) -> Expend the OpenCV jar -> Native library location: -> Eidt -> Put this; C:/opencv/build/java/x64/
-> OK -> Apply...