Using OpenCV in Android. This tutorial is tested under Ubuntu 10.04 + Android SDKr07 + Android NDKr4b.
Preparing the development environment
- Download and install Android SDK. Details can be found here
- Download eclipse and install the ADT plugin. Details can be found here
- Download Androdi NDK. This tool is used to cross compile OpenCV source code to Android. Currently (NDK r4) only C is fully supported, so I can only use OpenCV 1.1 under Android. The laterst version of OpenCV uses lots of STL functions.
Create the test project
Run the program
- Press the menu button to select your camera to capture an image. The down-sampled image is saved in your gallery. Press the menu button again to select it from your gallery and features are automatically extracted.
- Notice: if you select a large image in the gallery, the program may crash due to limited memory.
- On my DROID phone, it usually takes 4 seconds to extract features from one image.