Commit 51f6127e authored by Andrey Kamaev's avatar Andrey Kamaev

Merged the recent fixes from 2.4 branch

parent 4128d578
......@@ -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)
\ No newline at end of file
android/package/res/drawable/icon.png

5.63 KB | W: | H:

android/package/res/drawable/icon.png

1.95 KB | W: | H:

android/package/res/drawable/icon.png
android/package/res/drawable/icon.png
android/package/res/drawable/icon.png
android/package/res/drawable/icon.png
  • 2-up
  • Swipe
  • Onion skin
<?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>
\ No newline at end of file
*******************************************
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
\ No newline at end of file
***************************************
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
.. _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
......
********************
Native OpenCV Helper
********************
.. highlight:: cpp
\ No newline at end of file
*********************************
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
\ No newline at end of file
************************************
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
\ No newline at end of file
.. _Android_OpenCV_Manager:
***********************
Android OpenCV Manager
***********************
......
<?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>
\ No newline at end of file
......@@ -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>
\ No newline at end of file
This diff is collapsed.
No preview for this file type
No preview for this file type
......@@ -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
========
......
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 |
+---------------------------------+----------------------------------------------------------------------------+
<?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();
}
}
}
\ No newline at end of file
......@@ -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();
}
}
......
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