adding setup for some sample applications that use OpenCV on the android platform - nothing concrete yet - but soon.

This commit is contained in:
Ethan Rublee 2010-09-23 13:48:12 +00:00
parent 8462deed30
commit 9d9453906b
4 changed files with 15 additions and 11 deletions

View File

@ -17,7 +17,8 @@ here:
to include in an android project - to include in an android project -
just include the generated android-opencv.mk in you android ndk project just include the generated android-opencv.mk in you android ndk project
(in an Android.mk file)
with: with:
include android-opencv.mk include android-opencv.mk

View File

@ -1,18 +1,23 @@
android-opencv android-jni
this is an example of an android library project that has some reusable this is an example of an android library project that has some reusable
code that exposes part of OpenCV to android. In particular this provides a code that exposes part of OpenCV to android. In particular this provides a
native camera interface for loading live video frames from the android camera native camera interface for loading live video frames from the android camera
into native opencv functions(as cv::Mat's) into native opencv functions(as cv::Mat's)
to build make sure you have swig and the crystax ndk in your path pre-reqs:
* build the opencv/android libraries - up one directory
* you need swig in you path for android-jni
on ubuntu - sudo apt-get install swig
others: http://www.swig.org/
to build:
make make
that should work... If it doesn't make sure to edit the generated local.env.mk that should work... If it doesn't make sure to edit the generated local.env.mk
the key variable to reflect your machine's setup
more later on how to build actual project for android see the sample for how to use this in your own projects
- see the code.google.com/p/android-opencv for details on this

View File

@ -91,7 +91,7 @@ private class CalibrationTask extends AsyncTask<Object, Object, Object> {
} }
@Override //@Override
public void process(int idx, image_pool pool, long timestamp, public void process(int idx, image_pool pool, long timestamp,
NativeProcessor nativeProcessor) { NativeProcessor nativeProcessor) {
if(lock.tryLock()){ if(lock.tryLock()){

View File

@ -25,10 +25,8 @@ OPENCV_LIB_DIRS := -L$(OPENCV_BUILD_ROOT)/obj/$(ARMOBJS_V7A) \
-L$(OPENCV_BUILD_ROOT)/obj/$(ARMOBJS) -L$(OPENCV_BUILD_ROOT)/bin/ndk/$(ARMOBJS) \ -L$(OPENCV_BUILD_ROOT)/obj/$(ARMOBJS) -L$(OPENCV_BUILD_ROOT)/bin/ndk/$(ARMOBJS) \
-L$(OPENCV_BUILD_ROOT)/bin/ndk/$(ARMOBJS_V7A) -L$(OPENCV_BUILD_ROOT)/bin/ndk/$(ARMOBJS_V7A)
ANDROID_OPENCV_LIB_DIRS := -L$(OPENCV_ROOT)/android/android-jni/obj/$(ARMOBJS_V7A) \ ANDROID_OPENCV_LIB_DIRS := -L$(OPENCV_ROOT)/android/android-jni/libs/armeabi-v7a \
-L$(OPENCV_ROOT)/android/android-jni/obj/$(ARMOBJS) \ -L$(OPENCV_ROOT)/android/android-jni/libs/armeabi
-L$(OPENCV_ROOT)/android/android-jni/bin/ndk/$(ARMOBJS_V7A) \
-L$(OPENCV_ROOT)/android/android-jni/bin/ndk/$(ARMOBJS)
#order of linking very important ---- may have stuff out of order here, but #order of linking very important ---- may have stuff out of order here, but
#important that modules that are more dependent come first... #important that modules that are more dependent come first...