From 9d9453906b3b819e92cfb9e8d0b6653787dbbb6e Mon Sep 17 00:00:00 2001 From: Ethan Rublee Date: Thu, 23 Sep 2010 13:48:12 +0000 Subject: [PATCH] adding setup for some sample applications that use OpenCV on the android platform - nothing concrete yet - but soon. --- android/README.android.txt | 3 ++- android/android-jni/README.txt | 15 ++++++++++----- .../src/com/opencv/calibration/Calibrator.java | 2 +- android/android-opencv.mk.in | 6 ++---- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/android/README.android.txt b/android/README.android.txt index c4d54ab..dec230c 100644 --- a/android/README.android.txt +++ b/android/README.android.txt @@ -17,7 +17,8 @@ here: 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: include android-opencv.mk diff --git a/android/android-jni/README.txt b/android/android-jni/README.txt index 3f7862f..bc19065 100644 --- a/android/android-jni/README.txt +++ b/android/android-jni/README.txt @@ -1,18 +1,23 @@ -android-opencv +android-jni 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 native camera interface for loading live video frames from the android camera 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 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 code.google.com/p/android-opencv for details on this +see the sample for how to use this in your own projects diff --git a/android/android-jni/src/com/opencv/calibration/Calibrator.java b/android/android-jni/src/com/opencv/calibration/Calibrator.java index 42ea11c..699a196 100644 --- a/android/android-jni/src/com/opencv/calibration/Calibrator.java +++ b/android/android-jni/src/com/opencv/calibration/Calibrator.java @@ -91,7 +91,7 @@ private class CalibrationTask extends AsyncTask { } - @Override + //@Override public void process(int idx, image_pool pool, long timestamp, NativeProcessor nativeProcessor) { if(lock.tryLock()){ diff --git a/android/android-opencv.mk.in b/android/android-opencv.mk.in index c57510e..44f6866 100644 --- a/android/android-opencv.mk.in +++ b/android/android-opencv.mk.in @@ -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)/bin/ndk/$(ARMOBJS_V7A) -ANDROID_OPENCV_LIB_DIRS := -L$(OPENCV_ROOT)/android/android-jni/obj/$(ARMOBJS_V7A) \ - -L$(OPENCV_ROOT)/android/android-jni/obj/$(ARMOBJS) \ - -L$(OPENCV_ROOT)/android/android-jni/bin/ndk/$(ARMOBJS_V7A) \ - -L$(OPENCV_ROOT)/android/android-jni/bin/ndk/$(ARMOBJS) +ANDROID_OPENCV_LIB_DIRS := -L$(OPENCV_ROOT)/android/android-jni/libs/armeabi-v7a \ + -L$(OPENCV_ROOT)/android/android-jni/libs/armeabi #order of linking very important ---- may have stuff out of order here, but #important that modules that are more dependent come first... -- 2.7.4