Using the NDK, OpenCV may be built for the android platform.
The opencv port is in svn/trunk/opencv. It is essentially a snapshot of the opencv trunk - rev 3096. In the future this will be made compatible with trunk, but for
simplicity we are freezing opencv until this works consistantly.
= pre-req =
use crystax ndk 4 - http://crystax.net/android/ndk.php
the crystax ndk supports the STL, expections, RTTI. opencv will not build with the standard android ndk!
= The way =
Using {{{r4}}} of the ndk, cd to the top level of opencv, and run
{{{ndk-build NDK_APPLICATION_MK=Application.mk}}}
or build using the build.sh, which is just that line above...
Assuming the ndk directory is in your path of course.
this has advantages because it stores the library locally in the opencv folder. This is now the preferred method for building opencv. The libraries will all be build as static libs which may be linked to from an external ndk project(see samples).
== Using opencv in your applications ==
See the samples directory.
Two convenience makefiles have been created, one for the libraries and one for includes. They expect OPENCV_ROOT and OPENCV_LIBS_DIR
to be defined before including them.
A sample Android.mk file for CVCamera follows, that requires opencv
The LOCAL_LDLIBS are very picky. {{{-L$(NDK_APP_OUT)/opencv/armeabi}}} is where the ndk builds opencv, usually in {{{<ndk>/out/apps/opencv/armeabi}}}. You can navigate there and see the static libraries that were built.