Prebuilt OpenCV 2.3.1 Package

You can use this package for development on every major OS: Windows, Linux, MacOS.

Here is a detailed tutorial for Using Android binary package with Eclipse, and here is wiki page about samples.

How to import OpenCV library project and samples

If you want to understand how to use OpenCV in your Android application, do the following:

  1. Download the prebuilt package from http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.3.

  2. Create a new folder (i.e. OpenCV_Package_2.3.1) and unpack the package there. Warning: better to avoid spaces in the package path, otherwise you will probably have problems with ndk-build. On Windows you can use 7zip fro unpacking. You will see OpenCV-2.3.1 and samples folders. First folder is an Eclipse library project, which provides OpenCV Java API. The second folder contains a set of samples, including tutorial and advanced samples.

  3. Opening in Eclipse:
    • Run the Eclipse and choose OpenCV_Package_2.3.1 as a workspace (Eclipse menu File -> Switch workspace -> Other)

    • Set-up Android SDK path (Eclipse menu Window -> Preferences -> Android -> SDK Location)

    • Import OpenCV project with samples (Eclipse menu File -> Import -> General -> Existing Projects into Workspace) and choose OpenCV_Package_2.3.1 directory again. You will see a list of OpenCV samples. Press Finish.

    • Then you have to click F5 several times to refresh the projects. Eclipse will take some time to come into proper state, please ignore all the warnings. Click F5 until you don't have all the projects free from warning messages.
  4. You're done! Now connect your device to the computer and run any sample (Right mouse click on the project in Package Explorer view, Run as -> Android Application).

How to use OpenCV library project in your application

You can build your application on top of these samples. If you already have an Android application, you can add a reference to OpenCV and import all its functionality.

  1. First of all you need to have both projects (your app and OpenCV) in a single workspace. So, open any workspace and import the second project there. We recommend to import your application into OpenCV_Package_2.3.1 workspace.

  2. Add a reference. Do the right mouse click on your app in Package Explorer, go to Properties -> Android -> Library -> Add and choose the OpenCV library project.

OpenCVWiki: AndroidPrebuiltOpenCV231 (last edited 2011-08-03 15:37:45 by Kirill Kornyakov)