Introduction About Site Map

RSS 2 Feed RSS 2 Feed

Main Page | Blog Index

Sunday, May 13th, 2012, 6:48 am

OpenCV for Android in Eclipse on GNU/Linux

For the uninitiated, I’ve started working with Android for computer vision research. According to Wikipedia, “OpenCV (Open Source Computer Vision Library) is a library of programming functions mainly aimed at real time computer vision, developed by Intel and now supported by Willow Garage. It is free for use under the open source BSD license. [...] The library was originally written in C[2] and this C interface makes OpenCV portable to some specific platforms such as digital signal processors. Wrappers for languages such as C#, Python,[3] Ruby and Java (using JavaCV[4]) have been developed to encourage adoption by a wider audience.”

The library can be fetched from here (OpenCV-2.4.0-android-bin.tar.bz2) and it is a very large library that requires cmake to compile:


roy@roy:~$ cmake
cmake version 2.8.0

Also see android-cmake.

For use under Linux and Android (device side), download the Android NDK for Linux:


roy@roy:~$ uname -a
Linux roy 2.6.32-33-generic #70-Ubuntu SMP Thu Jul 7 21:09:46 UTC 2011 i686 GNU/Linux


sudo apt-get install swig

Here is what I got (as shown by tabbing):

roy@roy:~$ swig
swig      swig-1.3  

JDK 5 or JDK 6 can be downloaded from the Oracle Java SE Downloads page. Here is where the Linux version can be obtained. Also download the Android SDK and install Ant:


sudo apt-get install ant

Then, set the path as follows (in my case a temporary location):

export ANDROID_NDK=/home/roy/Desktop/Text_Workspace/images/opencv/android-sdk-linux

The four main components are OpenCV, the SDK, NDK, and JDK. Here’s how it looks on my desktop:

Some instructions suggest a route for Eclipse users, in which case the following may be in order:


apt-get install eclipse

Tegra Android Developer Pack, which can be found under Tegra Resources at the NVidia Web site, simplifies much of the process above and integrates all the pertinent bits.

Other resources of interest:

One Response to “OpenCV for Android in Eclipse on GNU/Linux”

  1. Xgamecoin Fiberchange Says:

    Why users still use to read news papers when in this technological world all is existing on web?

Technical Notes About Comments

Comments may include corrections, additions, citations, expressions of consent or even disagreements. They should preferably remain on topic.

Moderation: All genuine comments will be added. If your comment does not appear immediately (a rarity), it awaits moderation as it contained a sensitive word or a URI.

Trackbacks: The URI to TrackBack this entry is:

Syndication: RSS feed for comments on this post RSS 2

    See also: What are feeds?, Local Feeds

Comments format: Line and paragraph breaks are automatic, E-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Back to top

Retrieval statistics: 21 queries taking a total of 0.117 seconds • Please report low bandwidth using the feedback form
Original styles created by Ian Main (all acknowledgements) • PHP scripts and styles later modified by Roy Schestowitz • Help yourself to a GPL'd copy
|— Proudly powered by W o r d P r e s s — based on a heavily-hacked version 1.2.1 (Mingus) installation —|