Commit 93a0237b authored by Leonid Beynenson's avatar Leonid Beynenson

Added the tutorial "Using OpenCV Android binary package to compile applications,…

Added the tutorial "Using OpenCV Android binary package to compile applications, which use OpenCV from native level".
parent 8ceda837
.. |Author_AnaH| unicode:: Ana U+0020 Huam U+00E1 n .. |Author_AnaH| unicode:: Ana U+0020 Huam U+00E1 n
.. |Author_BernatG| unicode:: Bern U+00E1 t U+0020 G U+00E1 bor .. |Author_BernatG| unicode:: Bern U+00E1 t U+0020 G U+00E1 bor
.. |Author_AndreyK| unicode:: Andrey U+0020 Kamaev .. |Author_AndreyK| unicode:: Andrey U+0020 Kamaev
.. |Author_LeonidBLB| unicode:: Leonid U+0020 Beynenson
.. |Author_VictorE| unicode:: Victor U+0020 Eruhimov .. |Author_VictorE| unicode:: Victor U+0020 Eruhimov
.. |Author_FernandoI| unicode:: Fernando U+0020 Iglesias U+0020 Garc U+00ED a .. |Author_FernandoI| unicode:: Fernando U+0020 Iglesias U+0020 Garc U+00ED a
......
.. _Android_Binary_Package: .. _Android_Binary_Package:
Using Android binary package with Eclipse Using Android binary package with Eclipse
***************************************** *****************************************
...@@ -16,9 +18,17 @@ You need the following tools to be installed: ...@@ -16,9 +18,17 @@ You need the following tools to be installed:
Visit http://www.oracle.com/technetwork/java/javase/downloads/index.html and download installer for your OS. Visit http://www.oracle.com/technetwork/java/javase/downloads/index.html and download installer for your OS.
Here is a detailed JDK installation guide for Ubuntu and Mac OS: http://source.android.com/source/initializing.html (only JDK sections are applicable for OpenCV) Here is a detailed JDK installation guide for Ubuntu and Mac OS: http://source.android.com/source/initializing.html#installing-the-jdk (only JDK sections are applicable for OpenCV)
.. note:: OpenJDK is not usable for Android development because Android SDK supports only Sun JDK. .. note:: OpenJDK is not usable for Android development because Android SDK supports only Sun JDK.
If you use Ubuntu, after installation of Sun JDK you should run the following command to set Sun java environment:
.. code-block:: bash
sudo update-java-alternatives --set java-6-sun
#. **Android SDK** #. **Android SDK**
...@@ -222,7 +232,7 @@ Open OpenCV library and samples in Eclipse ...@@ -222,7 +232,7 @@ Open OpenCV library and samples in Eclipse
Running OpenCV Samples Running OpenCV Samples
====================== ======================
At this point you should be able to build and run all samples except two from Advanced tutorial (these samples require Android NDK to build working applications). At this point you should be able to build and run all samples except two from Advanced tutorial (these samples require Android NDK to build working applications, see the document :ref:`Android_Binary_Package_with_NDK`).
Also I want to note that only ``Tutorial 1 Basic - 0. Android Camera`` and ``Tutorial 1 Basic - 1. Add OpenCV`` samples are able to run on Emulator from Android SDK. Other samples are using OpenCV Native Camera which is supported only for ARM v7 CPUs. Also I want to note that only ``Tutorial 1 Basic - 0. Android Camera`` and ``Tutorial 1 Basic - 1. Add OpenCV`` samples are able to run on Emulator from Android SDK. Other samples are using OpenCV Native Camera which is supported only for ARM v7 CPUs.
...@@ -254,3 +264,19 @@ Well, running samples from Eclipse is very simple: ...@@ -254,3 +264,19 @@ Well, running samples from Eclipse is very simple:
:height: 600px :height: 600px
:alt: Tutorial 1 Basic - 1. Add OpenCV - running Canny :alt: Tutorial 1 Basic - 1. Add OpenCV - running Canny
:align: center :align: center
How to use OpenCV library project in your application
=====================================================
If you already have an Android application, you can add a reference to OpenCV and import all its functionality.
#. First of all you need to have both projects (your app and OpenCV) in a single workspace.
So, open workspace with your application and import the OpenCV project into your workspace as stated above.
#. Add a reference to OpenCV project.
Do the right mouse click on your app in Package Explorer, go to **Properties > Android > Library > Add**
and choose the OpenCV library project.
...@@ -121,6 +121,24 @@ Here you can read tutorials about how to set up your computer to work with the O ...@@ -121,6 +121,24 @@ Here you can read tutorials about how to set up your computer to work with the O
:height: 90pt :height: 90pt
:width: 90pt :width: 90pt
.. tabularcolumns:: m{100pt} m{300pt}
.. cssclass:: toctableopencv
================ ======================================================
|AndroidNDKPack| **Title:** :ref:`Android_Binary_Package_with_NDK`
*Compatibility:* > OpenCV 2.3.1
*Author:* |Author_LeonidBLB|
You will learn how to work with C++ OpenCV code for Android platform
================ ======================================================
.. |AndroidNDKPack| image:: images/android_logo.png
:height: 90pt
:width: 90pt
* **From where to start?** * **From where to start?**
.. tabularcolumns:: m{100pt} m{300pt} .. tabularcolumns:: m{100pt} m{300pt}
...@@ -173,5 +191,6 @@ Here you can read tutorials about how to set up your computer to work with the O ...@@ -173,5 +191,6 @@ Here you can read tutorials about how to set up your computer to work with the O
../windows_install/windows_install ../windows_install/windows_install
../windows_visual_studio_Opencv/windows_visual_studio_Opencv ../windows_visual_studio_Opencv/windows_visual_studio_Opencv
../android_binary_package/android_binary_package ../android_binary_package/android_binary_package
../android_binary_package/android_binary_package_using_with_NDK
../display_image/display_image ../display_image/display_image
../load_save_image/load_save_image ../load_save_image/load_save_image
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment