OpenCV on Android using Eclipse

I have damn time importing OpenCV into my Android project. I already tried this tutorial:

http://opencv.itseez.com/doc/tutorials/introduction/android_binary_package/android_binary_package.html

and this did not work, because Eclipse does not recognize existing projects in the directory. Therefore, after a long search, I came across this trunk:

https://code.ros.org/svn/opencv/trunk/opencv/

and was able to import it into my workspace in Eclipse. Eclipse now recognizes sample projects, but now the problem is that the OpenCV library files are missing. Thus, all calls to import different classes lead to errors. Shouldn't there be opencv.jar somewhere? I have seen various posts that mention the need to create a library, but unfortunately I have no idea how to do this. I need something with step by step instructions. I am using the 64-bit version of Windows 7.

Thanks!

+4
android eclipse windows-7 opencv
source share
6 answers

You must download the latest version of Android OpenCV 4 here:

http://opencv.org/downloads.html

And read these guides to get started (roughly in this order):

Android development introduction

OpenCV4Android SDK

Android development with OpenCV

Link OpenCV4Android

+3
source share

You might want to take a look at this project: https://github.com/billmccord/OpenCV-Android

I managed to run opencv applications on my Android phone using this port.

+1
source share

Is Win-superpack installed? I recommend getting the latest .tar, extract and use it. Worked for me.

+1
source share

If you want to use OPEN CV in your Android applications, for example, if you need to read some lines from an image in your android, and you are new to using OPEN CV. Then download the pre-created OpenCV library for Android from here:
http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.3/

After loading, import OpenCV-2.3.1 into Eclipse using File -> Import ...--> General -> An existing project in the workspace.

In your project properties, in Android, add the OpenCV2.3.1 library (click "Add" on the right and select OpenCV2.3.1).

Good luck! 
+1
source share

I installed opencv on four computers using these steps and it works like a charm. These are instructions for windows. Check out this link for complete instructions on windows, linux, and mac.

Estimated time to complete this tutorial: 1.5 hours

Part I: Installing OpenCV for Android

Parts of this tutorial borrow explanations from the OpenCV website ( http://opencv.org/platforms/android.html ).

Download and install Android NDK

Android NDK allows us to compile and run native C / C ++ code on Android.

Update Tools in Android SDK

The inclusion of some additional tools in the Android SDK will simplify the development of native applications later.

  • In Eclipse, click Help> Install New Software. Then click "Add."

  • In the Add Repository dialog box, enter โ€œADT Pluginโ€ for the name and the following URL for the location and click โ€œOKโ€: https://dl-ssl.google.com/android/eclipse/

  • In the Available Software dialog box, select all of the listed components. Click Next. Accept all license agreements. Click Finish.

  • Reboot Eclipse after all the tools have been downloaded and installed.

Download and install OpenCV SDK

Now we are ready to download and install the OpenCV SDK.

  • Download version 2.4.4 (or higher) of the SDK from this website: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/

  • Unzip the downloaded file to a place without spaces in the path, for example: C: \ OpenCV4Android \ OpenCV-2.4.4-android-sdk

  • In Eclipse, choose File> Switch Workspace> Other. Specify the location associated with OpenCV projects, for example: C: \ OpenCV4Android

  • Right-click in the Package Explorer pane and select Import> General> Existing Projects in Workspace. Select "Specify the root directory" and enter the location where the contents of the SDK were unpacked, for example: C: \ OpenCV4Android \ OpenCV-2.4.4-android-sdk

  • After viewing the OpenCV library and sample projects in the Projects window, click Finish. All downloaded and initialized projects may take a minute. After that, you have the projects imported into the workspace, as shown in Figure 2.

+1
source share

I posted about this on a recurring question . Make sure you have Android NDK installed! Or consider using JavaCV instead. It is much easier to install.

0
source share

All Articles