Is the source to opencv_java.so available?

438 views
Skip to first unread message

RyanfaeScotland

unread,
May 25, 2012, 11:57:30 AM5/25/12
to android...@googlegroups.com
Hey guys,

I'll skip the praise / sucking up and all the 'OpenCV is so awesome' part cause I'm sure you get enough of that and already know it rocks.

What I'm wondering is, as the title suggests, if the source to opencv_java.so is available.

For the curious: I'm working on a project that is to run on android mobiles and Windows PCs. Our main development is in Java with access to OpenCV through JNI. So far we've been writing all our wrappers ourself which is a pretty slow and tedious process (and error prone since we are really Java guys). To make life easier, and save reinventing the wheel, I was hoping to use the wrappers you guys have created on both our Windows version and our Android version where possible and create branches ourselves where needed. Obviously the library being a .so file means this isn't possible. If I had the source to the library however I could of course recompile it myself and continue on from there.

So am I being daft and just not seeing it or is it not available?

Cheers guys,

Ryan

(PS OpenCV Rocks!)

Rui Marques

unread,
May 25, 2012, 12:08:12 PM5/25/12
to android...@googlegroups.com
Here you go, i'm not sure if it is all of it, but just browse :P

http://code.opencv.org/projects/opencv/repository/show/branches/2.4/opencv/modules/java/src/java

RyanfaeScotland

unread,
May 27, 2012, 6:41:45 PM5/27/12
to android...@googlegroups.com
Thanks for the quick reply. I'm pretty certain I saw this and it isn't the part I'm looking for. I'm looking for the C side (shouldn't be too hard to find since I live on the coast ba-doom-doom-tish). So these files have all the native methods declared such as  private static native long n_VideoCapture(); and what I am looking for is the files where these methods are implemented.

I'm off on holiday for a week so may not get back to replies before the weekend, all help is appreciated though!

Rui Marques

unread,
May 27, 2012, 7:17:27 PM5/27/12
to android...@googlegroups.com
I am not sure if you are looking for the C++ source code or how opencv does the java wrapping.

The root of the source is this, you will find the sources by browsing to "module_name/src" :


If you are wondering how the wrappers are created, AFAIK is with python scripts like this one:



Andrey Pavlenko

unread,
May 28, 2012, 3:54:30 AM5/28/12
to android...@googlegroups.com
Most of Java wrappers for OpenCV C++ functions and classes are automatically generated from C++ headers with a Python script.
Currently Java wrappers are generated on Android build only, they are located in 'src' and 'jni' folders under 'build' folder.

RyanfaeScotland

unread,
Jun 14, 2012, 9:12:33 AM6/14/12
to android...@googlegroups.com
I don't appear to have these folders in the build folder.

Andrey Pavlenko

unread,
Jun 18, 2012, 8:52:07 AM6/18/12
to android...@googlegroups.com
Again: the .java and .cpp files of JNI wrappers to OpenCV library are generated at build time.
The .java files are included to the public binary package for Android (e.g. see OpenCV-2.4.1\src).
The .cpp part presents in binary form as a part of libopencv_java.so, the sources are in build folder (e.g. opencv\android\build\modules\java\core.cpp, imgproc.cpp, features2d.cpp)

RyanfaeScotland

unread,
Jun 18, 2012, 10:07:30 AM6/18/12
to android...@googlegroups.com
Sorry Andrey, didn't mean to make you repeat yourself.

My  opencv\android\build\modules\java folder only contains the folder .java with the Cmake files so I've either not built this version properly or, well, goodness knows. I'll download the latest version and have a look around.

Cheers for the response again.
Reply all
Reply to author
Forward
0 new messages