Merged the recent fixes from 2.4 branch

pull/2/head
Andrey Kamaev 13 years ago
parent 4128d5782f
commit 51f6127e0a
  1. 1
      android/package/CMakeLists.txt
  2. BIN
      android/package/res/drawable/icon.png
  3. 2
      android/package/res/values/strings.xml
  4. 26
      android/service/doc/AsyncServiceHelper.rst
  5. 54
      android/service/doc/IOpenCVEngine.rst
  6. 3
      android/service/doc/Intro.rst
  7. 4
      android/service/doc/JavaHelper.rst
  8. 5
      android/service/doc/NativeHelper.rst
  9. 57
      android/service/doc/OpenCVEngineInterface.rst
  10. 24
      android/service/doc/StaticHelper.rst
  11. 3
      android/service/doc/index.rst
  12. 7
      android/service/engine/AndroidManifest.xml
  13. BIN
      android/service/engine/res/drawable/icon.png
  14. 10
      android/service/engine/res/layout/main.xml
  15. 88451
      doc/opencv2refman.pdf
  16. BIN
      doc/opencv_tutorials.pdf
  17. BIN
      doc/opencv_user.pdf
  18. 152
      doc/tutorials/introduction/android_binary_package/android_binary_package.rst
  19. 62
      doc/tutorials/introduction/android_binary_package/android_binary_package_using_with_NDK.rst
  20. BIN
      doc/tutorials/introduction/android_binary_package/images/android_package_7zip.png
  21. BIN
      doc/tutorials/introduction/android_binary_package/images/eclipse_10_crystal_clean.png
  22. BIN
      doc/tutorials/introduction/android_binary_package/images/eclipse_7_select_projects.png
  23. BIN
      doc/tutorials/introduction/android_binary_package/images/eclipse_8_false_alarm.png
  24. BIN
      doc/tutorials/introduction/android_binary_package/images/eclipse_8a_target.png
  25. BIN
      doc/tutorials/introduction/android_binary_package/images/eclipse_9_errors_dissapearing.png
  26. 4
      modules/contrib/doc/facerec/facerec_tutorial.rst
  27. 32
      modules/contrib/doc/facerec/tutorial/facerec_gender_classification.rst
  28. 2
      modules/java/android_lib/.project
  29. 26
      modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
  30. 8
      modules/java/android_test/src/org/opencv/test/OpenCVTestRunner.java
  31. 19
      modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java
  32. 11
      modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java
  33. 16
      modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java
  34. 17
      modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java
  35. 31
      modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java
  36. 18
      modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java
  37. 2
      modules/java/generator/src/java/android+AsyncServiceHelper.java
  38. 9
      modules/java/generator/src/java/android+OpenCVLoader.java
  39. 3
      samples/android/15-puzzle/src/org/opencv/samples/puzzle15/puzzle15Activity.java
  40. 28
      samples/android/color-blob-detection/src/org/opencv/samples/colorblobdetect/ColorBlobDetectionActivity.java
  41. 3
      samples/android/face-detection/.cproject
  42. 3
      samples/android/face-detection/src/org/opencv/samples/fd/FdActivity.java
  43. 5
      samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsActivity.java
  44. 4
      samples/android/tutorial-0-androidcamera/src/org/opencv/samples/tutorial0/Sample0Base.java
  45. 7
      samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1Java.java
  46. 5
      samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2NativeCamera.java
  47. 3
      samples/android/tutorial-3-native/.cproject
  48. 7
      samples/android/tutorial-3-native/src/org/opencv/samples/tutorial3/Sample3Native.java
  49. 7
      samples/android/tutorial-4-mixed/.cproject
  50. 3
      samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4Mixed.java

@ -89,5 +89,6 @@ add_custom_command(
DEPENDS "${OpenCV_BINARY_DIR}/bin/.classes.jar.dephelper" "${PACKAGE_DIR}/res/values/strings.xml" "${PACKAGE_DIR}/res/drawable/icon.png" ${camera_wrappers} opencv_java
)
install(FILES "${APK_NAME}" DESTINATION "apk/" COMPONENT main)
add_custom_target(android_package ALL SOURCES "${APK_NAME}" )
add_dependencies(android_package opencv_java)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">OCV @OPENCV_VERSION_MAJOR@.@OPENCV_VERSION_MINOR@ binary pack for @ANDROID_PACKAGE_PLATFORM_NAME@</string>
<string name="app_name">OCV @OPENCV_VERSION_MAJOR@.@OPENCV_VERSION_MINOR@ pack @ANDROID_PACKAGE_PLATFORM_NAME@</string>
</resources>

@ -1,26 +0,0 @@
*******************************************
Java Asynchronious OpenCV Helper (internal)
*******************************************
.. highlight:: java
.. module:: org.opencv.android
:platform: Android
:synopsis: Implements Android dependent Java classes
.. Class:: AsyncServiceHelper
Helper class provides implementation of asynchronious OpenCV initialization with Android OpenCV Engine Service.
.. note:: This is imternal class. Does not use it directly. Use OpenCVLoader.initAsync() instead!
int initOpenCV()
----------------
.. method:: int initOpenCV(String Version, Context AppContext, LoaderCallbackInterface Callback)
Tries to init OpenCV library using OpenCV Engine Service. Callback method will be called, when initialisation finishes
:param Version: Version of OpenCV
:param AppContext: Application context for service connection
:param CallBack: Object that implements LoaderCallbackInterface. See Helper callback interface
:rtype: boolean
:return: Return true if initialization starts successfully

@ -1,54 +0,0 @@
***************************************
Native OpenCV Manager service interface
***************************************
.. highlight:: cpp
.. module:: IOpenCVEngine.h
:platform: Android
:synopsis: Defines OpenCV Manager interface for Android Binder component
.. Class:: OpenCVEngine
OpenCVEngine class provides Binder interface to OpenCV Manager Service
int getEngineVersion()
----------------------
.. method:: int GetEngineVersion()
Gets OpenCV Manager version
:rtype: int
:return: Returns OpenCV Manager version
android::String16 getLibPathByVersion()
---------------------------------------
.. method:: android::String16 GetLibPathByVersion(android::String16 version)
Gets path to native OpenCV libraries
:param version: OpenCV Library version
:rtype: String;
:return: Returns path to OpenCV native libs or empty string if OpenCV was not found
android::String16 getLibraryList()
----------------------------------
.. method:: android::String16 GetLibraryList(android::String16 version)
Gets list of OpenCV native libraries in loading order
:param version: OpenCV Library version
:rtype: String;
:return: Returns OpenCV libraries names separated by semicolon symbol in loading order
boolean installVersion()
------------------------
.. method:: boolean InstallVersion(android::String16 version)
Trys to install defined version of OpenCV
:param version: OpenCV Library version
:rtype: String
:return: Returns true if installation successful or package has been already installed

@ -1,3 +1,6 @@
.. _Android_OpenCV_Manager_Intro:
************
Introduction
************

@ -38,10 +38,6 @@ boolean initAsync()
OpenCV version constants
-------------------------
.. data:: OPENCV_VERSION_2_4_0
OpenCV Library version 2.4.0
.. data:: OPENCV_VERSION_2_4_2
OpenCV Library version 2.4.2

@ -1,5 +0,0 @@
********************
Native OpenCV Helper
********************
.. highlight:: cpp

@ -1,57 +0,0 @@
*********************************
Java OpenCV OpenCVEngineInterface
*********************************
.. highlight:: java
.. module:: org.opencv.engine
:platform: Android
:synopsis: Defines OpenCV Manager interface for Android.
.. Class:: OpenCVEngineInterface
OpenCVEngineInterface class provides Java interface to OpenCV Manager Service. Is synchronous with native OpenCVEngine class
.. note:: Do not use this class directly. Use OpenCVLoader instead!
int getEngineVersion()
----------------------
.. method:: int GetEngineVersion()
Get OpenCV Manager version
:rtype: int
:return: Return OpenCV Manager version
String getLibPathByVersion()
----------------------------
.. method:: String GetLibPathByVersion(String version)
Find already installed OpenCV library
:param version: OpenCV library version
:rtype: String
:return: Return path to OpenCV native libs or empty string if OpenCV was not found
String getLibraryList()
-----------------------
.. method:: String GetLibraryList(String version)
Get list of OpenCV native libraries in loading order separated by ";" symbol
:param version: OpenCV library version
:rtype: String
:return: Return OpenCV libraries names separated by symbol ";" in loading order
boolean installVersion()
------------------------
.. method:: boolean InstallVersion(String version)
Try to install defined version of OpenCV from Google Play (Android Market).
:param version: OpenCV library version
:rtype: String
:return: Return true if installation was successful or OpenCV package has been already installed

@ -1,24 +0,0 @@
************************************
Java Static OpenCV Helper (internal)
************************************
.. highlight:: java
.. module:: org.opencv.android
:platform: Android
:synopsis: Implements Android dependent Java classes
.. Class:: StaticHelper
Helper class provides implementation of static OpenCV initialization. All OpenCV libraries must be included to application package.
.. note:: This is internal class. Does not use it directly. Use OpenCVLoader.initDebug() instead!
int initOpenCV()
----------------
.. method:: int initOpenCV()
Tries to init OpenCV library using libraries from application package. Method uses libopencv_info.so library for getting
list of libraries in loading order. Method loads libopencv_java.so, if info library is not present.
:rtype: boolean
:return: Return true if initialization was successful

@ -1,3 +1,6 @@
.. _Android_OpenCV_Manager:
***********************
Android OpenCV Manager
***********************

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.opencv.engine"
android:versionCode="1"
android:versionName="1.0" >
android:versionCode="11"
android:versionName="1.1" >
<uses-sdk android:minSdkVersion="8" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
<application
android:icon="@drawable/icon"
@ -21,7 +22,7 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</activity>
</application>
</manifest>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -8,14 +8,14 @@
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="About:"
android:text="About"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This application allows you to manage OpenCV library on your device."
android:text="OpenCV library (www.opencv.org) is used by other applications for image enhancement, panorama stitching, object detection, recognition and tracking and so on. OpenCV Manager provides the best version of the OpenCV for your hardware."
android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout
@ -47,7 +47,7 @@
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Device information:"
android:text="Device information"
android:textAppearance="?android:attr/textAppearanceLarge" android:layout_marginTop="20dp"/>
<LinearLayout
@ -101,7 +101,7 @@
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Installed packages:"
android:text="Installed packages"
android:textAppearance="?android:attr/textAppearanceLarge" android:layout_marginTop="15dp"/>
<ListView
@ -114,6 +114,6 @@
android:id="@+id/CheckEngineUpdate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Check Manager update" />
android:text="Check for update" />
</LinearLayout>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

@ -7,7 +7,7 @@ Using Android binary package with Eclipse
This tutorial was tested using Ubuntu 10.04 and Windows 7 SP1 operating systems.
Nevertheless, it should also work on any other **OS**\ es supported by Android SDK (including Mac OS X).
If you encounter errors after following the steps described here, feel free to contact us via `android-opencv <https://groups.google.com/group/android-opencv/>`_ discussion group and we will try to help you.
If you encounter errors after following the steps described here, feel free to contact us via `OpenCV4Android <https://groups.google.com/group/android-opencv/>`_ discussion group or OpenCV `Q&A forum <http://answers.opencv.org>`_ and we will try to help you.
Quick environment setup for Android development
===============================================
@ -17,7 +17,7 @@ If you are making a clean environment installation then you can try `Tegra Andro
It will cover all of the environment set up automatically and you can go to the next step :ref:`Get_the_OpenCV_package_for_Android_development` right after automatic setup.
If you are a beginner in Android development then we recommentd you to start with TADP.
If you are a beginner in Android development then we recommend you to start with TADP.
.. note:: *NVIDIA*\ 's Tegra Android Development Pack includes some special features for |Nvidia_Tegra_Platform|_ but it is not just for *Tegra* devices
@ -138,7 +138,7 @@ Get the OpenCV package for Android development
#. Go to the `OpenCV dowload page on SourceForge <http://sourceforge.net/projects/opencvlibrary/files/opencv-android/>`_ and download the latest available version. Currently it is |opencv_android_bin_pack_url|_
#. Create new folder for Android+OpenCV development.
#. Create new folder for Android+OpenCV development. For this tutorial I have unpacked OpenCV to the :file:`C:\\Work\\android-opencv\\` directory.
.. note:: Better to use a path without spaces in it. Otherwise you will probably have problems with :command:`ndk-build`.
@ -150,16 +150,14 @@ Get the OpenCV package for Android development
:alt: Exploring OpenCV package with 7-Zip
:align: center
On Unix you can also use the following command:
On Unix you can use the following command:
.. code-block:: bash
tar -jxvf ~/Downloads/OpenCV-2.4.2-android-sdk.tar.bz2
unzip ~/Downloads/OpenCV-2.4.2-android-sdk.zip
For this tutorial I have unpacked OpenCV to the :file:`C:\\Work\\android-opencv\\` directory.
.. |opencv_android_bin_pack| replace:: OpenCV-2.4.2-android-sdk.tar.bz2
.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.2/OpenCV-2.4.2-android-sdk.tar.bz2/download
.. |opencv_android_bin_pack| replace:: OpenCV-2.4.2-android-sdk.zip
.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.2/OpenCV-2.4.2-android-sdk.zip/download
.. |opencv_android_bin_pack_url| replace:: |opencv_android_bin_pack|
.. |seven_zip| replace:: 7-Zip
.. _seven_zip: http://www.7-zip.org/
@ -220,8 +218,8 @@ Open OpenCV library and samples in Eclipse
OpenCV library is packed as a ready-for-use `Android Library Project
<http://developer.android.com/guide/developing/projects/index.html#LibraryProjects>`_. You can simply reference it in your projects.
Each sample included into |opencv_android_bin_pack| is a regular Android project that already references OpenCV library.
Follow next steps to import OpenCV and samples into workspace:
Each sample included into the |opencv_android_bin_pack| is a regular Android project that already references OpenCV library.
Follow the steps below to import OpenCV and samples into the workspace:
* Right click on the :guilabel:`Package Explorer` window and choose :guilabel:`Import...` option from the context menu:
@ -252,6 +250,8 @@ Open OpenCV library and samples in Eclipse
However **all these errors are only false-alarms**!
To help Eclipse to understand that there are no any errors choose OpenCV library in :guilabel:`Package Explorer` (left mouse click) and press :kbd:`F5` button on your keyboard. Then choose any sample (except first samples in *Tutorial Base* and *Tutorial Advanced*) and also press :kbd:`F5`.
In some cases these errors disappear after :menuselection:`Project --> Clean... --> Clean all --> OK`.
Sometimes more advanced manipulations are needed:
@ -261,12 +261,6 @@ Open OpenCV library and samples in Eclipse
:alt: Updating target
:align: center
* Sometimes a project needs fixing its project properties. After right click on any project select :guilabel:`Android Tools` and then :guilabel:`Fix Project Properties` in sub-menu:
.. image:: images/eclipse_8b_fix_props.png
:alt: Fixing project properties
:align: center
After this manipulation Eclipse will rebuild your workspace and error icons will disappear one after another:
.. image:: images/eclipse_9_errors_dissapearing.png
@ -282,9 +276,9 @@ Open OpenCV library and samples in Eclipse
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, see the next tutorial :ref:`Android_Binary_Package_with_NDK` to learn how to compile them).
At this point you should be able to build and run all samples except the last two (Tutorial 3 and 4). These samples include native code and require Android NDK to build working applications, see the next tutorial :ref:`Android_Binary_Package_with_NDK` to learn how to compile them.
Also I want to note that only ``Tutorial 0 - Android Camera`` and ``Tutorial 1 - Add OpenCV`` samples are able to run on Emulator from Android SDK. Other samples are using OpenCV Native Camera which does not work with emulator.
Also I want to note that only ``Tutorial 0 - Android Camera`` and ``Tutorial 1 - Add OpenCV`` samples are able to run on Emulator from the Android SDK. Other samples are using OpenCV Native Camera which does not work with emulator.
.. note:: Latest *Android SDK tools, revision 19* can run ARM v7a OS images but *Google* provides such image for Android 4.x only.
@ -298,11 +292,11 @@ Well, running samples from Eclipse is very simple:
<http://developer.android.com/guide/developing/device.html>`_ for help with real devices (not emulators).
* Select project you want to start in :guilabel:`Package Explorer:guilabel:` and just press :kbd:`Ctrl + F11` or select option :menuselection:`Run --> Run` from main menu, or click :guilabel:`Run` button on the toolbar.
* Select project you want to start in :guilabel:`Package Explorer` and just press :kbd:`Ctrl + F11` or select option :menuselection:`Run --> Run` from the main menu, or click :guilabel:`Run` button on the toolbar.
.. note:: Android Emulator can take several minutes to start. So, please, be patient.
* On the first run Eclipse will ask you how to run your application:
* On the first run Eclipse will ask you about the running mode for your application:
.. image:: images/eclipse_11_run_as.png
:alt: Run sample as Android Application
@ -320,22 +314,24 @@ Well, running samples from Eclipse is very simple:
How to use OpenCV library project in your application
=====================================================
In this section we will explain how to make some existing application to use OpenCV. Starting from 2.4.2 release on Android so-called "OpenCV Manager" is used for providing applications with the best version of OpenCV. You can get more information here: :ref:`Android_OpenCV_Manager`.
Application development with async initialization
-------------------------------------------------
Using async initialization is a preferred way for application Development. It uses OpenCV Manager service to get OpenCV libraries.
Using async initialization is a preferred way for application development. It uses OpenCV Manager Android service to get OpenCV libraries.
#. Add OpenCV library project to your workspace. Go to :guilabel:`File –> Import –> Existing project in your workspace`, push Browse button and select OpenCV SDK path.
.. image:: images/eclipse_opencv_dependency0.png
:alt: Add dependency from OpenCV library
:align: center
.. image:: images/eclipse_opencv_dependency0.png
:alt: Add dependency from OpenCV library
:align: center
#. In application project add reference to OpenCV Java SDK in :guilabel:`Project –> Properties –> Android –> Library –> Add` select OpenCV-2.4.2;
#. In application project add reference to OpenCV Java SDK in :guilabel:`Project –> Properties –> Android –> Library –> Add` select ``OpenCV Library - 2.4.2``;
.. image:: images/eclipse_opencv_dependency1.png
:alt: Add dependency from OpenCV library
:align: center
.. image:: images/eclipse_opencv_dependency1.png
:alt: Add dependency from OpenCV library
:align: center
If you want to use OpenCV Manager-based approach you need to install packages with the Service and OpenCV package for you platform. You can do it using Google Play service or manually with adb tool:
@ -345,74 +341,74 @@ If you want to use OpenCV Manager-based approach you need to install packages wi
adb install ./org.opencv.engine.apk
adb install ./org.opencv.lib_v24_<hardware version>.apk
There is a very base code snippet for Async init. It shows only basis principles of library Initiation. See 15-puzzle example for details.
There is a very base code snippet for Async init. It shows only basis principles of library Initiation. See the "15-puzzle" OpenCV sample for details.
.. code-block:: java
:linenos:
public class MyActivity extends Activity implements HelperCallbackInterface
{
private BaseLoaderCallback mOpenCVCallBack = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
{
Log.i(TAG, "OpenCV loaded successfully");
// Create and set View
mView = new puzzle15View(mAppContext);
setContentView(mView);
} break;
default:
{
super.onManagerConnected(status);
} break;
}
}
};
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
Log.i(TAG, "onCreate");
super.onCreate(savedInstanceState);
Log.i(TAG, "Trying to load OpenCV library");
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_0, this, mOpenCVCallBack))
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
private BaseLoaderCallback mOpenCVCallBack = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
{
Log.i(TAG, "OpenCV loaded successfully");
// Create and set View
mView = new puzzle15View(mAppContext);
setContentView(mView);
} break;
default:
{
super.onManagerConnected(status);
} break;
}
}
}
};
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
Log.i(TAG, "onCreate");
super.onCreate(savedInstanceState);
Log.i(TAG, "Trying to load OpenCV library");
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
}
}
// ...
// ...
}
It this case application works with OpenCV Manager in asynchronous fashion. OnManagerConnected callback will be called in UI thread, when initialization finishes.
Attention, It is not allowed to use CV calls or load OpenCV-dependent native libs before invoking this callback. Load your own native libraries after OpenCV initialization.
It this case application works with OpenCV Manager in asynchronous fashion. ``OnManagerConnected`` callback will be called in UI thread, when initialization finishes.
Please note, that it is not allowed to use OpenCV calls or load OpenCV-dependent native libs before invoking this callback. Load your own native libraries after OpenCV initialization.
Application development with static initialization
--------------------------------------------------
In this way of using OpenCV all OpenCV binaries a linked and put to your application package. It is designed for experimental and local development purposes only.
This way is depricated for production code. If you want to publish your app use approach with async initialization.
According to this approach all OpenCV binaries are linked and put to your application package. It is designed mostly for development purposes.
This way is deprecated for the production code, release package should communicate with OpenCV Manager, use the async initialization described above.
#. Add OpenCV library project to your workspace. Go to :guilabel:`File –> Import –> Existing project in your workspace`, push Browse button and select OpenCV SDK path.
#. Add OpenCV library project to your workspace. Go to :guilabel:`File –> Import –> Existing project in your workspace`, push :guilabel:`Browse` button and select OpenCV SDK path.
.. image:: images/eclipse_opencv_dependency0.png
:alt: Add dependency from OpenCV library
:align: center
.. image:: images/eclipse_opencv_dependency0.png
:alt: Add dependency from OpenCV library
:align: center
#. In application project add reference to OpenCV Java SDK in :guilabel:`Project –> Properties –> Android –> Library –> Add` select OpenCV-2.4.2;
#. In application project add reference to OpenCV Java SDK in :guilabel:`Project –> Properties –> Android –> Library –> Add` select ``OpenCV Library - 2.4.2``;
.. image:: images/eclipse_opencv_dependency1.png
:alt: Add dependency from OpenCV library
:align: center
.. image:: images/eclipse_opencv_dependency1.png
:alt: Add dependency from OpenCV library
:align: center
#. Copy native libs to your project directory to folder libs/trget_arch/
#. Copy native libs to your project directory to folder :file:`libs/target_arch/`.
After adding depedency from OpenCV library project Android toolchain add all needed libraries to Application package.
To use OpenCV functionality you need to add OpenCV library initialization before using any OpenCV specific code, for example, in static section of Activity class.
After adding depedency from OpenCV library project, Eclipse will automatically copy all needed libraries to the application package.
To use OpenCV functionality you need to add OpenCV library initialization code before using any OpenCV specific code, for example, to the static section of ``Activity`` class.
.. code-block:: java
:linenos:
@ -440,4 +436,4 @@ If you application includes other OpenCV-dependent native libraries you need to
Whats next?
===========
Read the :ref:`Android_Binary_Package_with_NDK` tutorial to learn how add native OpenCV code to your Android project.
Read the :ref:`Android_Binary_Package_with_NDK` tutorial to learn how to add native OpenCV code to your Android project.

@ -6,36 +6,34 @@
Using C++ OpenCV code with Android binary package
*************************************************
The Android way is writing all your code in Java. But somethimes it is not enough and you need to go to a native level and write part of your application in C/C++.
This is important when you already have some computer vision functionality which is written in C++ and uses OpenCV, and you want to use it in your Android application,
The Android way is writing all your code in Java. But sometimes it is not enough and you need to go to the native level and write some parts of your application in C/C++.
This is especially important when you already have some computer vision code which is written in C++ and uses OpenCV, and you want to reuse it in your Android application,
but do not want to rewrite the C++ code to Java.
In this case the only way is to use JNI mechanism.
It means, that you should add a class with native methods wrapping your C++ functionality into the Java part of your Android application.
In this case the only way is to use JNI - a Java framework for interaction with native code.
It means, that you should add a Java class with native methods exposing your C++ functionality to the Java part of your Android application.
This tutorial describes a fast way how to create and build Android applications containing OpenCV code written in C++. It shows how to build an application which uses OpenCV inside its JNI calls.
This tutorial describes a fast way to create and build Android applications containing OpenCV code written in C++. It shows how to build an application which uses OpenCV inside its JNI calls. Tutorial 3 and 4 from the OpenCV for Android SDK can be used as examples. OpenCV Sample "face-detect" also contain a call to C++ class.
Please note that before starting this tutorial you should fulfill all the steps, described in the tutorial :ref:`Android_Binary_Package`.
This tutorial was tested using Ubuntu 10.04 and Windows 7 SP1 operating systems.
Nevertheless, it should also work on Mac OS X. If you encounter errors after following the steps described here, feel free to contact us via
`android-opencv <https://groups.google.com/group/android-opencv/>`_ discussion group and we will try to help you.
Nevertheless, it should also work on Mac OS X.
If you encounter errors after following the steps described here, feel free to contact us via
`OpenCV4Android <https://groups.google.com/group/android-opencv/>`_ discussion group or
OpenCV `Q&A forum <http://answers.opencv.org>`_ and we will try to help you.
Prerequisites: Setup NDK
========================
Prerequisites: Setup Android NDK
================================
To compile C++ code for Android platform you need ``Android Native Development Kit`` (*NDK*).
You can get the latest version of NDK from the `download page <http://developer.android.com/sdk/ndk/index.html>`_.
To install Android NDK just extract the archive to some folder on your computer. (Here is `installation instructions <http://developer.android.com/sdk/ndk/index.html#installing>`_ on the NDK home page.)
You can get the latest version of NDK from the `download page <http://developer.android.com/sdk/ndk/index.html>`_. To install Android NDK just extract the archive to some folder on your computer. Here are `installation instructions <http://developer.android.com/sdk/ndk/index.html#installing>`_.
.. note:: Before start you can read official Android NDK documentation which is in the Android NDK archive, in the folder :file:`docs/`.
The main article about using Android NDK build system you can read in the file :file:`ANDROID-MK.html`.
The main article about using Android NDK build system is in the :file:`ANDROID-MK.html` file.
Also some additional useful information you can read in the files
:file:`APPLICATION-MK.html`, :file:`NDK-BUILD.html`, and in the files :file:`CPU-ARM-NEON.html`, :file:`CPLUSPLUS-SUPPORT.html`, :file:`PREBUILTS.html`.
Some additional information you can find in the :file:`APPLICATION-MK.html`, :file:`NDK-BUILD.html` files, and :file:`CPU-ARM-NEON.html`, :file:`CPLUSPLUS-SUPPORT.html`, :file:`PREBUILTS.html`.
Theory: Android application structure
=====================================
@ -66,29 +64,29 @@ where
+ the :file:`libs` folder will contain native libraries after successful build,
+ and the :file:`jni` folder contains C/C++ application source code and NDK's build scripts :file:`Android.mk` and :file:`Application.mk`.
+ and the :file:`jni` folder contains C/C++ application source code and NDK's build scripts :file:`Android.mk` and :file:`Application.mk`.
These scripts control the C++ build process (they are written in Makefile language).
Also the root folder should contain the following files
Also the root folder should contain the following files:
* :file:`AndroidManifest.xml` file presents essential information about application to the Android system
(name of the Application, name of main application's package, components of the application, required permissions, etc)
(name of the Application, name of main application's package, components of the application, required permissions, etc).
It can be created using Eclipse wizard or :command:`android` tool from Android SDK
It can be created using Eclipse wizard or :command:`android` tool from Android SDK.
* :file:`project.properties` is a text file containing information about target Android platform and other build details.
This file is generated by Eclipse or can be created with :command:`android` tool from Android SDK
This file is generated by Eclipse or can be created with :command:`android` tool from Android SDK.
.. note:: Both files (:file:`AndroidManifest.xml` and :file:`project.properties`) are required to compile the C++ part of the application (NDK build system uses information from these files). If any of these files does not exist, compile the Java part of the project before the C++ part.
.. _NDK_build_cli:
Theory: How to build Android application having C++ native part (from command line)
===================================================================================
Theory: Building application with C++ native part from command line
===================================================================
Here is the standard way to compile C++ part of an Android application:
@ -98,7 +96,7 @@ Here is the standard way to compile C++ part of an Android application:
cd <root folder of the project>/
.. note:: Alternatively you can go to the folder :file:`jni` of Android project but samples from OpenCV binary package are configured for building from project root level (because of relative path to the OpenCV library).
.. note:: Alternatively you can go to the :file:`jni` folder of Android project. But samples from OpenCV binary package are configured for building from the project root level (because of relative path to the OpenCV library).
#. Run the following command
@ -106,7 +104,7 @@ Here is the standard way to compile C++ part of an Android application:
<path_where_NDK_is_placed>/ndk-build
.. note:: On Windows we recomend use of ``ndk-build.cmd`` in standard Windows console (``cmd.exe``) rather than the similar ``bash`` script in ``Cygwin`` shell.
.. note:: On Windows we recommend to use ``ndk-build.cmd`` in standard Windows console (``cmd.exe``) rather than the similar ``bash`` script in ``Cygwin`` shell.
.. image:: images/ndk_build.png
:alt: NDK build
@ -134,20 +132,20 @@ After that the Java part of the application can be (re)compiled (using either *E
.. _Android_NDK_integration_with_Eclipse:
Theory: How to build Android application having C++ native part (from *Eclipse*)
================================================================================
Theory: Building application with C++ native part from *Eclipse*
================================================================
There are several possible ways to integrate compilation of C++ code by Android NDK into Eclipse compilation process.
We recommend the approach based on Eclipse :abbr:`CDT(C/C++ Development Tooling)` Builder.
.. important:: Make sure your Eclipse IDE has the :abbr:`CDT(C/C++ Development Tooling)` plugin installed. (Menu ``Help`` -> ``About Eclipse SDK`` -> ``Installation Details``)
.. important:: Make sure your Eclipse IDE has the :abbr:`CDT(C/C++ Development Tooling)` plugin installed. Menu :guilabel:`Help -> About Eclipse SDK` and push :guilabel:`Installation Details` button.
.. image:: images/eclipse_inst_details.png
:alt: Configure builders
:align: center
To install the `CDT plugin <http://eclipse.org/cdt/>`_ use menu ``Help`` -> ``Install New Software...``,
then paste the CDT 8.0 repository URL http://download.eclipse.org/tools/cdt/releases/indigo as shown on the picture below and click :guilabel:`Add...`, name it *CDT* and click :guilabel:`OK`.
To install the `CDT plugin <http://eclipse.org/cdt/>`_ use menu :guilabel:`Help -> Install New Software...`,
then paste the CDT 8.0 repository URL http://download.eclipse.org/tools/cdt/releases/indigo as shown in the picture below and click :guilabel:`Add...`, name it *CDT* and click :guilabel:`OK`.
.. image:: images/eclipse_inst_cdt.png
:alt: Configure builders
@ -160,9 +158,9 @@ then paste the CDT 8.0 repository URL http://download.eclipse.org/tools/cdt/rele
:align: center
.. important:: OpenCV 2.4.2 for Android package contains samples projects pre-configured to use CDT Builder for JNI part build via ``ndk-build``.
.. important:: OpenCV for Android 2.4.2 package contains sample projects pre-configured to use CDT Builder. It automatically builds JNI part via ``ndk-build``.
#. Define the ``NDKROOT`` environment variable containing the path to Android NDK in your system (e.g. **"X:\\Apps\\android-ndk-r8"** or **"/opt/android-ndk-r8"**)
#. Define the ``NDKROOT`` environment variable containing the path to Android NDK in your system (e.g. **"X:\\Apps\\android-ndk-r8"** or **"/opt/android-ndk-r8"**).
#. CDT Builder is configured for Windows hosts, on Linux or MacOS open `Project Properties` of the projects having JNI part (`face-detection`, `Tutorial 3` and `Tutorial 4`), select :guilabel:`C/C++ Build` in the left pane, remove **".cmd"** and leave ``"${NDKROOT}/ndk-build"`` in the :guilabel:`Build command` edit box and click :guilabel:`OK`.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 63 KiB

@ -122,7 +122,7 @@ Then simply call create_csv.py with the path to the folder, just like this and y
at/s17/3.pgm;1
[...]
Please see the :ref:`appendix` for additional informations.
Please see the :ref:`appendixft` for additional informations.
Eigenfaces
==========
@ -516,7 +516,7 @@ Literature
.. [Zhao03] Zhao, W., Chellappa, R., Phillips, P., and Rosenfeld, A. Face recognition: A literature survey. ACM Computing Surveys (CSUR) 35, 4 (2003), 399–458.
.. _appendix:
.. _appendixft:
Appendix
========

@ -1,4 +1,4 @@
Gender Classification with OpenCV
Gender Classification with OpenCV
=================================
.. contents:: Table of Contents
@ -8,7 +8,7 @@ Introduction
------------
A lot of people interested in face recognition, also want to know how to perform image classification tasks like:
* Gender Classification (Gender Detection)
* Emotion Classification (Emotion Detection)
* Glasses Classification (Glasses Detection)
@ -35,12 +35,12 @@ For gender classification of faces, you'll need some images of male and female f
* Patrick Stewart
* Tom Cruise
Once you have acquired some images, you'll need to read them. In the demo I have decided to read the images from a very simple CSV file. Why? Because it's the simplest platform-independent approach I can think of. However, if you know a simpler solution please ping me about it. Basically all the CSV file needs to contain are lines composed of a ``filename`` followed by a ``;`` followed by the ``label`` (as *integer number*), making up a line like this:
Once you have acquired some images, you'll need to read them. In the demo I have decided to read the images from a very simple CSV file. Why? Because it's the simplest platform-independent approach I can think of. However, if you know a simpler solution please ping me about it. Basically all the CSV file needs to contain are lines composed of a ``filename`` followed by a ``;`` followed by the ``label`` (as *integer number*), making up a line like this:
.. code-block:: none
/path/to/image.ext;0
Let's dissect the line. ``/path/to/image.ext`` is the path to an image, probably something like this if you are in Windows: ``C:/faces/person0/image0.jpg``. Then there is the separator ``;`` and finally we assign a label ``0`` to the image. Think of the label as the subject (the person, the gender or whatever comes to your mind). In the gender classification scenario, the label is the gender the person has. I'll give the label ``0`` to *male* persons and the label ``1`` is for *female* subjects. So my CSV file looks like this:
.. code-block:: none
@ -66,14 +66,14 @@ All images for this example were chosen to have a frontal face perspective. They
.. image:: ../img/tutorial/gender_classification/clooney_set.png
:align: center
You really don't want to create the CSV file by hand. And you really don't want scale, rotate & translate the images manually. I have prepared you two Python scripts ``create_csv.py`` and ``crop_face.py``, you can find them in the ``src`` folder coming with this documentation. You'll see how to use them in the :ref:`appendix`.
You really don't want to create the CSV file by hand. And you really don't want scale, rotate & translate the images manually. I have prepared you two Python scripts ``create_csv.py`` and ``crop_face.py``, you can find them in the ``src`` folder coming with this documentation. You'll see how to use them in the :ref:`appendixfgc`.
Fisherfaces for Gender Classification
--------------------------------------
If you want to decide wether a person is *male* or *female*, you have to learn the discriminative features of both classes. The Eigenfaces method is based on the Principal Component Analysis, which is an unsupervised statistical model and not suitable for this task. Please see the Face Recognition tutorial for insights into the algorithms. The Fisherfaces instead yields a class-specific linear projection, so it is much better suited for the gender classification task. `http://www.bytefish.de/blog/gender_classification <http://www.bytefish.de/blog/gender_classification>`_ shows the recongition rate of the Fisherfaces method for gender classification.
The Fisherfaces method achieves a 98% recognition rate in a subject-independent cross-validation. A subject-independent cross-validation means *images of the person under test are never used for learning the model*. And could you believe it: you can simply use the facerec_fisherfaces demo, that's inlcuded in OpenCV.
The Fisherfaces method achieves a 98% recognition rate in a subject-independent cross-validation. A subject-independent cross-validation means *images of the person under test are never used for learning the model*. And could you believe it: you can simply use the facerec_fisherfaces demo, that's inlcuded in OpenCV.
Fisherfaces in OpenCV
---------------------
@ -92,7 +92,7 @@ If you are in Windows, then simply start the demo by running (from command line)
.. code-block:: none
facerec_fisherfaces.exe C:/path/to/your/csv.ext
If you are in Linux, then simply start the demo by running:
.. code-block:: none
@ -137,10 +137,10 @@ And for advanced users I have also shown the Eigenvalue for the Fisherface:
And the Fisherfaces reconstruction:
.. image:: ../img/tutorial/gender_classification/fisherface_reconstruction_0.png
I hope this gives you an idea how to approach gender classification and the other image classification tasks.
.. _appendix:
I hope this gives you an idea how to approach gender classification and the other image classification tasks.
.. _appendixfgc:
Appendix
--------
@ -167,8 +167,8 @@ You don't really want to create the CSV file by hand. I have prepared you a litt
| |-- 1.pgm
| |-- ...
| |-- 10.pgm
Then simply call ``create_csv.py`` with the path to the folder, just like this and you could save the output:
.. code-block:: none
@ -197,7 +197,7 @@ Here is the script, if you can't find it:
.. literalinclude:: ../src/create_csv.py
:language: python
:linenos:
Aligning Face Images
++++++++++++++++++++
@ -214,9 +214,9 @@ If you are using the same *offset_pct* and *dest_sz* for your images, they are a
:language: python
:linenos:
Imagine we are given `this photo of Arnold Schwarzenegger <http://en.wikipedia.org/wiki/File:Arnold_Schwarzenegger_edit%28ws%29.jpg>`_, which is under a Public Domain license. The (x,y)-position of the eyes is approximately *(252,364)* for the left and *(420,366)* for the right eye. Now you only need to define the horizontal offset, vertical offset and the size your scaled, rotated & cropped face should have.
Imagine we are given `this photo of Arnold Schwarzenegger <http://en.wikipedia.org/wiki/File:Arnold_Schwarzenegger_edit%28ws%29.jpg>`_, which is under a Public Domain license. The (x,y)-position of the eyes is approximately *(252,364)* for the left and *(420,366)* for the right eye. Now you only need to define the horizontal offset, vertical offset and the size your scaled, rotated & cropped face should have.
Here are some examples:
Here are some examples:
+---------------------------------+----------------------------------------------------------------------------+
| Configuration | Cropped, Scaled, Rotated Face |
@ -230,4 +230,4 @@ Here are some examples:
| 0.2 (20%), 0.2 (20%), (70,70) | .. image:: ../img/tutorial/gender_classification/arnie_20_20_70_70.jpg |
+---------------------------------+----------------------------------------------------------------------------+

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>OpenCV Library-2.4.2</name>
<name>OpenCV Library - 2.4.2</name>
<comment></comment>
<projects>
</projects>

@ -25,10 +25,10 @@ import org.opencv.highgui.Highgui;
public class OpenCVTestCase extends TestCase {
//change to 'true' to unblock fail on fail("Not yet implemented")
public static final boolean passNYI = true;
protected static final int matSize = 10;
//change to 'true' to unblock fail on fail("Not yet implemented")
public static final boolean passNYI = true;
protected static final int matSize = 10;
protected static final double EPS = 0.001;
protected static final double weakEPS = 0.5;
@ -185,11 +185,11 @@ public class OpenCVTestCase extends TestCase {
}
public static void fail(String msg) {
if(msg == "Not yet implemented" && passNYI)
return;
TestCase.fail(msg);
if(msg == "Not yet implemented" && passNYI)
return;
TestCase.fail(msg);
}
public static <E extends Number> void assertListEquals(List<E> list1, List<E> list2) {
if (list1.size() != list2.size()) {
throw new UnsupportedOperationException();
@ -220,7 +220,7 @@ public class OpenCVTestCase extends TestCase {
}
for (int i = 0; i < ar1.length; i++)
assertEquals(ar1[i].doubleValue(), ar2[i].doubleValue(), epsilon);
assertEquals(ar1[i].doubleValue(), ar2[i].doubleValue(), epsilon);
//assertTrue(Math.abs(ar1[i].doubleValue() - ar2[i].doubleValue()) <= epsilon);
}
@ -230,7 +230,7 @@ public class OpenCVTestCase extends TestCase {
}
for (int i = 0; i < ar1.length; i++)
assertEquals(ar1[i], ar2[i], epsilon);
assertEquals(ar1[i], ar2[i], epsilon);
//assertTrue(Math.abs(ar1[i].doubleValue() - ar2[i].doubleValue()) <= epsilon);
}
@ -341,9 +341,9 @@ public class OpenCVTestCase extends TestCase {
}
public static void assertListDMatchEquals(List<DMatch> expected, List<DMatch> actual, double epsilon) {
DMatch expectedArray[] = expected.toArray(new DMatch[0]);
DMatch actualArray[] = actual.toArray(new DMatch[0]);
assertArrayDMatchEquals(expectedArray, actualArray, epsilon);
DMatch expectedArray[] = expected.toArray(new DMatch[0]);
DMatch actualArray[] = actual.toArray(new DMatch[0]);
assertArrayDMatchEquals(expectedArray, actualArray, epsilon);
}
public static void assertPointEquals(Point expected, Point actual, double eps) {

@ -17,15 +17,15 @@ import android.util.Log;
/**
* This only class is Android specific.
*
*
* @see <a href="http://opencv.itseez.com">OpenCV</a>
*/
public class OpenCVTestRunner extends InstrumentationTestRunner {
static { System.loadLibrary("opencv_java"); }
public static String LENA_PATH;
static { System.loadLibrary("opencv_java"); }
public static String LENA_PATH;
public static String CHESS_PATH;
public static String LBPCASCADE_FRONTALFACE_PATH;
public static Context context;

@ -84,11 +84,11 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
matSize = 100;
truth = new DMatch[] {
new DMatch(0, 0, 0, 1.049694f),
new DMatch(1, 0, 0, 1.098605f),
new DMatch(2, 1, 0, 0.494587f),
new DMatch(3, 1, 0, 0.484352f),
new DMatch(4, 0, 0, 1.083795f)
new DMatch(0, 0, 0, 1.049694f),
new DMatch(1, 0, 0, 1.066820f),
new DMatch(2, 1, 0, 0.494587f),
new DMatch(3, 0, 0, 1.141826f),
new DMatch(4, 0, 0, 1.084099f)
};
super.setUp();
@ -166,7 +166,7 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
}
public void testKnnMatchMatMatListOfListOfDMatchInt() {
final int k = 3;
final int k = 3;
Mat train = getTrainDescriptors();
Mat query = getQueryDescriptors();
List<MatOfDMatch> matches = new ArrayList<MatOfDMatch>();
@ -181,12 +181,12 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
assertEquals(query.rows(), matches.size());
for(int i = 0; i<matches.size(); i++)
{
MatOfDMatch vdm = matches.get(i);
//Log.d("knn", "vdm["+i+"]="+vdm.dump());
MatOfDMatch vdm = matches.get(i);
//Log.d("knn", "vdm["+i+"]="+vdm.dump());
assertTrue(Math.min(k, train.rows()) >= vdm.total());
for(DMatch dm : vdm.toArray())
{
assertEquals(dm.queryIdx, i);
assertEquals(dm.queryIdx, i);
}
}
}
@ -206,7 +206,6 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
matcher.add(Arrays.asList(train));
matcher.match(query, matches);
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
}

@ -84,11 +84,11 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase {
matSize = 100;
truth = new DMatch[] {
new DMatch(0, 1, 0, 6.9202342f),
new DMatch(1, 1, 0, 6.1675916f),
new DMatch(2, 1, 0, 2.6798589f),
new DMatch(3, 1, 0, 2.6545324f),
new DMatch(4, 0, 0, 6.1294847f)
new DMatch(0, 1, 0, 6.9202332f),
new DMatch(1, 0, 0, 6.0567350f),
new DMatch(2, 1, 0, 2.6798587f),
new DMatch(3, 0, 0, 5.8991642f),
new DMatch(4, 0, 0, 6.1321812f)
};
super.setUp();
}
@ -183,7 +183,6 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase {
matcher.add(Arrays.asList(train));
matcher.match(query, matches);
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
}

@ -31,7 +31,7 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase {
}
};
}
/*
private float sqr(float val){
return val * val;
@ -89,11 +89,11 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase {
matSize = 100;
truth = new DMatch[] {
new DMatch(0, 0, 0, 1.1018577f),
new DMatch(1, 0, 0, 1.2069331f),
new DMatch(2, 1, 0, 0.2446168f),
new DMatch(3, 1, 0, 0.2345972f),
new DMatch(4, 0, 0, 1.1746116f)
new DMatch(0, 0, 0, 1.1018578f),
new DMatch(1, 0, 0, 1.1381058f),
new DMatch(2, 1, 0, 0.2446168f),
new DMatch(3, 0, 0, 1.3037685f),
new DMatch(4, 0, 0, 1.1752719f)
};
super.setUp();
@ -189,7 +189,9 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase {
matcher.add(Arrays.asList(train));
matcher.match(query, matches);
OpenCVTestRunner.Log(matches);
OpenCVTestRunner.Log(matches);
OpenCVTestRunner.Log(matches);
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
}

@ -158,11 +158,11 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase {
matSize = 100;
truth = new DMatch[] {
new DMatch(0, 0, 0, 1.049694f),
new DMatch(1, 0, 0, 1.098605f),
new DMatch(2, 1, 0, 0.494587f),
new DMatch(3, 1, 0, 0.484352f),
new DMatch(4, 0, 0, 1.083795f)
new DMatch(0, 0, 0, 1.049694f),
new DMatch(1, 0, 0, 1.066820f),
new DMatch(2, 1, 0, 0.494587f),
new DMatch(3, 0, 0, 1.141826f),
new DMatch(4, 0, 0, 1.084099f)
};
super.setUp();
@ -283,9 +283,8 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase {
assertArrayDMatchEquals(truth, matches.toArray(), EPS);
// OpenCVTestRunner.Log("matches found: " + matches.size());
// for (DMatch m : matches)
// OpenCVTestRunner.Log(m.toString());
// OpenCVTestRunner.Log(matches.toString());
// OpenCVTestRunner.Log(matches);
}
public void testMatchMatMatListOfDMatchMat() {
@ -330,7 +329,7 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase {
matcher.read(filenameR);
matcher.write(filenameW);
assertEquals(ymlParamsModified, readFile(filenameW));
}

@ -47,25 +47,18 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase {
Mat truth = new Mat(1, 128, CvType.CV_32FC1) {
{
put(0, 0,
/*
0, 0, 0, 0, 0.011540107, 0.0029440077, 0.095483348, 0.018144149, 0.00014820647, 0, 0.00014820647, 0, 0, 0, 0, 0, 0, -0.00014820647,
0, 0.00014820647, 0.10196275, 0.0099145742, 0.57075155, 0.047922116, 0, 0, 0, 0, 0, 0, 0, 0, 0.0029440068, -0.011540107, 0.018144149,
0.095483348, 0.085385554, -0.054076977, 0.34105155, 0.47911066, 0.023395451, -0.11012388, 0.088196531, 0.50863767, 0.0031790689,
-0.019882837, 0.0089476965, 0.054817006, -0.0033560959, -0.0011770058, 0.0033560959, 0.0011770058, 0.019882834, 0.0031790687,
0.054817006, 0.0089476984, 0, 0, 0, 0, -0.0011770058, 0.0033560959, 0.0011770058, 0.0033560959
*/
0, 0, 0, 0, 0, 0, 0, 0, 0.045382127, 0.075976953, -0.031969212, 0.035002094, 0.012224297, 0.012286193,
-0.0088025155, 0.0088025155, 0.00017225844, 0.00017225844, 0, 0, 8.2743405e-05, 8.2743405e-05, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 8.2743405e-05, 8.2743405e-05, -0.00017225844, 0.00017225844, 0, 0, 0.31723264,
0.42715758, -0.19872268, 0.23621935, 0.033304065, 0.033918764, -0.021780485, 0.021780485, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0088025145, 0.0088025145, 0.012224296, 0.012286192, -0.045382123,
0.075976953, 0.031969212, 0.035002094, 0.10047197, 0.21463872, -0.0012294546, 0.18176091, -0.075555265,
0.35627601, 0.01270232, 0.20058797, -0.037658721, 0.037658721, 0.064850949, 0.064850949, -0.27688536,
0.44229308, 0.14888979, 0.14888979, -0.0031531656, 0.0031531656, 0.0068481555, 0.0072466261, -0.034193151,
0.040314503, 0.01108359, 0.023398584, -0.00071876607, 0.00071876607, -0.0031819802, 0.0031819802, 0, 0,
-0.0013680183, 0.0013680183, 0.034193147, 0.040314503, -0.01108359, 0.023398584, 0.006848156, 0.0072466265,
-0.0031531656, 0.0031531656, 0, 0, 0, 0, 0, 0, 0, 0, -0.0013680183, 0.0013680183, 0, 0, 0.00071876607,
0.00071876607, 0.0031819802, 0.0031819802
-0.0041138371, 0.0041138371, 0, 0, 0, 0, 0.0014427509, 0.0014427509, -0.0081971241, 0.034624498, 0.032569118,
0.032569118, -0.007222258, 0.0076424959, 0.0033254174, 0.0033254174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.10815519, 0.38033518, 0.24314292, 0.24314292, -0.068393648, 0.068393648,
0.039715949, 0.039715949, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8.7263528e-05, 8.7263528e-05, -6.0081031e-05,
6.0081031e-05, -0.00012158759, 0.00012158759, 0.0033254174, 0.0033254174, -0.007222258, 0.0076424964,
0.0081971241, 0.034624498, -0.032569118, 0.032569118, -0.077379324, 0.27552885, 0.14366581, 0.31175563,
-0.013609707, 0.24329227, -0.091054246, 0.17476201, 0.022970313, 0.022970313, -0.035123408, 0.035771687,
0.1907353, 0.3838968, -0.31571922, 0.31571922, 0.0092833797, 0.0092833797, -0.012892088, 0.012957365,
0.029558292, 0.073337689, -0.043703932, 0.043703932, 0.0014427509, 0.0014427509, 0, 0, 0.0041138371,
0.0041138371, 0, 0, -0.02955829, 0.073337704, 0.043703932, 0.043703932, -0.012892087, 0.012957364,
0.0092833797,0.0092833797, 6.0081031e-05, 6.0081031e-05, 0.00012158759, 0.00012158759, -8.7263528e-05,
8.7263528e-05, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
);
}
};

@ -57,17 +57,11 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase {
matSize = 100;
truth = new KeyPoint[] {
/*
new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1),
new KeyPoint(44.224422454833984f, 44.224422454833984f, 16, 99.75463f, 8617.863f, 1, -1),
new KeyPoint(44.224422454833984f, 55.775577545166016f, 16, 189.7546f, 8617.863f, 1, -1),
new KeyPoint(55.775577545166016f, 55.775577545166016f, 16, 279.75464f, 8617.863f, 1, -1)
*/
new KeyPoint(55.7755f, 44.2244f, 16, 9.754f, 8617.863f, 0, -1),
new KeyPoint(44.2244f, 44.2244f, 16, 99.754f, 8617.863f, 0, -1),
new KeyPoint(44.2244f, 55.7755f, 16, 189.754f, 8617.863f, 0, -1),
new KeyPoint(55.7755f, 55.7755f, 16, 279.754f, 8617.863f, 0, -1)
};
new KeyPoint(55.775578f, 55.775578f, 16, 80.245735f, 8617.8633f, 0, -1),
new KeyPoint(44.224422f, 55.775578f, 16, 170.24574f, 8617.8633f, 0, -1),
new KeyPoint(44.224422f, 44.224422f, 16, 260.24573f, 8617.8633f, 0, -1),
new KeyPoint(55.775578f, 44.224422f, 16, 350.24573f, 8617.8633f, 0, -1)
};
super.setUp();
}
@ -93,7 +87,7 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase {
assertEquals(3, keypoints.size());
for (MatOfKeyPoint mkp : keypoints) {
List<KeyPoint> lkp = mkp.toList();
List<KeyPoint> lkp = mkp.toList();
order(lkp);
assertListKeyPointEquals(Arrays.asList(truth), lkp, EPS);
}

@ -56,7 +56,7 @@ class AsyncServiceHelper
private LoaderCallbackInterface mUserAppCallback = Callback;
public String getPackageName()
{
return "OpenCV Manager Service";
return "OpenCV Manager";
}
public void install() {
Log.d(TAG, "Trying to install OpenCV Manager via Google Play");

@ -8,14 +8,9 @@ import android.content.Context;
public class OpenCVLoader
{
/**
* OpenCV Library version 2.4.0
* OpenCV Library version 2.4.2
*/
public static final String OPEN_CV_VERSION_2_4_0 = "2.4.0";
/**
* OpenCV Library version 2.4.0
*/
public static final String OPEN_CV_VERSION_2_4_2 = "2.4.2";
public static final String OPENCV_VERSION_2_4_2 = "2.4.2";
/**
* Load and initialize OpenCV library from current application package. Roughly it is analog of system.loadLibrary("opencv_java")

@ -94,10 +94,9 @@ public class puzzle15Activity extends Activity
requestWindowFeature(Window.FEATURE_NO_TITLE);
Log.i(TAG, "Trying to load OpenCV library");
if (!OpenCVLoader.initAsync(OpenCVLoader.OPEN_CV_VERSION_2_4_0, this, mOpenCVCallBack))
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
finish();
}
}

@ -52,7 +52,7 @@ public class ColorBlobDetectionActivity extends Activity {
{
Log.i(TAG, "Instantiated new " + this.getClass());
}
@Override
protected void onPause() {
Log.i(TAG, "onPause");
@ -66,32 +66,30 @@ public class ColorBlobDetectionActivity extends Activity {
Log.i(TAG, "onResume");
super.onResume();
if( (null != mView) && !mView.openCamera() ) {
AlertDialog ad = new AlertDialog.Builder(this).create();
ad.setCancelable(false); // This blocks the 'BACK' button
ad.setMessage("Fatal error: can't open camera!");
ad.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
}
});
AlertDialog ad = new AlertDialog.Builder(this).create();
ad.setCancelable(false); // This blocks the 'BACK' button
ad.setMessage("Fatal error: can't open camera!");
ad.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
}
});
ad.show();
}
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
public void onCreate(Bundle savedInstanceState) {
Log.i(TAG, "onCreate");
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
Log.i(TAG, "Trying to load OpenCV library");
if (!OpenCVLoader.initAsync(OpenCVLoader.OPEN_CV_VERSION_2_4_0, this, mOpenCVCallBack))
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
finish();
}
}
}

@ -25,7 +25,6 @@
<tool id="org.eclipse.cdt.build.core.settings.holder.1894181736" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1575527821" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/platforms/android-9/arch-arm/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../../sdk/native/jni/include&quot;"/>
</option>
@ -37,7 +36,6 @@
<tool id="org.eclipse.cdt.build.core.settings.holder.303359177" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.373249505" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/platforms/android-9/arch-arm/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../../sdk/native/jni/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include&quot;"/>
</option>
@ -49,7 +47,6 @@
<tool id="org.eclipse.cdt.build.core.settings.holder.1156172258" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.149918263" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/platforms/android-9/arch-arm/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../../sdk/native/jni/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include&quot;"/>
</option>

@ -107,10 +107,9 @@ public class FdActivity extends Activity {
requestWindowFeature(Window.FEATURE_NO_TITLE);
Log.i(TAG, "Trying to load OpenCV library");
if (!OpenCVLoader.initAsync(OpenCVLoader.OPEN_CV_VERSION_2_4_0, this, mOpenCVCallBack))
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
finish();
}
}

@ -107,12 +107,11 @@ public class ImageManipulationsActivity extends Activity {
Log.i(TAG, "onCreate");
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
Log.i(TAG, "Trying to load OpenCV library");
if (!OpenCVLoader.initAsync(OpenCVLoader.OPEN_CV_VERSION_2_4_0, this, mOpenCVCallBack))
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
finish();
}
}

@ -38,8 +38,8 @@ public class Sample0Base extends Activity {
ad.setMessage("Fatal error: can't open camera!");
ad.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
dialog.dismiss();
finish();
}
});
ad.show();

@ -75,8 +75,8 @@ public class Sample1Java extends Activity {
ad.setMessage("Fatal error: can't open camera!");
ad.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
dialog.dismiss();
finish();
}
});
ad.show();
@ -91,10 +91,9 @@ public class Sample1Java extends Activity {
requestWindowFeature(Window.FEATURE_NO_TITLE);
Log.i(TAG, "Trying to load OpenCV library");
if (!OpenCVLoader.initAsync(OpenCVLoader.OPEN_CV_VERSION_2_4_0, this, mOpenCVCallBack))
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
finish();
}
}

@ -82,7 +82,7 @@ public class Sample2NativeCamera extends Activity {
ad.setMessage("Fatal error: can't open camera!");
ad.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
dialog.dismiss();
finish();
}
});
@ -97,10 +97,9 @@ public class Sample2NativeCamera extends Activity {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
Log.i(TAG, "Trying to load OpenCV library");
if (!OpenCVLoader.initAsync(OpenCVLoader.OPEN_CV_VERSION_2_4_0, this, mOpenCVCallBack))
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
finish();
}
}

@ -25,7 +25,6 @@
<tool id="org.eclipse.cdt.build.core.settings.holder.1350943194" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1884803530" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/platforms/android-9/arch-arm/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../../sdk/native/jni/include&quot;"/>
</option>
@ -37,7 +36,6 @@
<tool id="org.eclipse.cdt.build.core.settings.holder.982773030" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.332905639" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/platforms/android-9/arch-arm/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../../sdk/native/jni/include&quot;"/>
</option>
@ -49,7 +47,6 @@
<tool id="org.eclipse.cdt.build.core.settings.holder.472513352" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1490236166" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/platforms/android-9/arch-arm/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../../sdk/native/jni/include&quot;"/>
</option>

@ -73,8 +73,8 @@ public class Sample3Native extends Activity {
ad.setMessage("Fatal error: can't open camera!");
ad.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
dialog.dismiss();
finish();
}
});
ad.show();
@ -88,10 +88,9 @@ public class Sample3Native extends Activity {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
if (!OpenCVLoader.initAsync(OpenCVLoader.OPEN_CV_VERSION_2_4_0, this, mOpenCVCallBack))
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
finish();
}
}
}

@ -28,9 +28,8 @@
</option>
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1028672579" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/platforms/android-9/arch-arm/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../../sdk/native\jni\include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../../sdk/native/jni/include&quot;"/>
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1470189286" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
@ -40,7 +39,6 @@
</option>
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1772035264" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/platforms/android-9/arch-arm/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../../sdk/native/jni/include&quot;"/>
</option>
@ -52,9 +50,8 @@
</option>
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1841493632" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/platforms/android-9/arch-arm/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../../sdk/native\jni\include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/../../sdk/native/jni/include&quot;"/>
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.608739504" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>

@ -98,10 +98,9 @@ public class Sample4Mixed extends Activity {
requestWindowFeature(Window.FEATURE_NO_TITLE);
Log.i(TAG, "Trying to load OpenCV library");
if (!OpenCVLoader.initAsync(OpenCVLoader.OPEN_CV_VERSION_2_4_0, this, mOpenCVCallBack))
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
finish();
}
}

Loading…
Cancel
Save