Merge remote-tracking branch 'origin/2.4' into merge-2.4

Conflicts:
	modules/core/include/opencv2/core/version.hpp
	modules/core/src/out.cpp
	modules/cudaimgproc/test/test_hough.cpp
	modules/gpu/doc/introduction.rst
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/src/generalized_hough.cpp
	modules/nonfree/perf/perf_main.cpp
pull/2580/head
Roman Donchenko 11 years ago
commit 4f2b126b7b
  1. 14
      doc/tutorials/introduction/android_binary_package/O4A_SDK.rst
  2. 14
      doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst
  3. 2
      doc/tutorials/tutorials.rst
  4. 2
      doc/tutorials/video/table_of_content_video/table_of_content_video.rst
  5. 2
      modules/contrib/doc/facerec/facerec_api.rst
  6. 2
      modules/contrib/doc/facerec/tutorial/facerec_gender_classification.rst
  7. 10
      modules/core/src/out.cpp
  8. 2
      modules/cuda/doc/introduction.rst
  9. 2
      modules/cudabgsegm/test/test_bgsegm.cpp
  10. 5
      modules/java/generator/src/java/android+OpenCVLoader.java
  11. 4
      modules/legacy/src/blobtrackanalysishist.cpp
  12. 2
      modules/legacy/src/levmar.cpp
  13. 4
      platforms/android/service/engine/AndroidManifest.xml
  14. 2
      platforms/android/service/engine/jni/BinderComponent/OpenCVEngine.cpp
  15. 2
      platforms/android/service/engine/src/org/opencv/engine/manager/ManagerActivity.java
  16. 12
      platforms/android/service/readme.txt

@ -48,10 +48,10 @@ The structure of package contents looks as follows:
:: ::
OpenCV-2.4.8-android-sdk OpenCV-2.4.9-android-sdk
|_ apk |_ apk
| |_ OpenCV_2.4.8_binary_pack_armv7a.apk | |_ OpenCV_2.4.9_binary_pack_armv7a.apk
| |_ OpenCV_2.4.8_Manager_2.16_XXX.apk | |_ OpenCV_2.4.9_Manager_2.18_XXX.apk
| |
|_ doc |_ doc
|_ samples |_ samples
@ -157,10 +157,10 @@ Get the OpenCV4Android SDK
.. code-block:: bash .. code-block:: bash
unzip ~/Downloads/OpenCV-2.4.8-android-sdk.zip unzip ~/Downloads/OpenCV-2.4.9-android-sdk.zip
.. |opencv_android_bin_pack| replace:: :file:`OpenCV-2.4.8-android-sdk.zip` .. |opencv_android_bin_pack| replace:: :file:`OpenCV-2.4.9-android-sdk.zip`
.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.8/OpenCV-2.4.8-android-sdk.zip/download .. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.9/OpenCV-2.4.9-android-sdk.zip/download
.. |opencv_android_bin_pack_url| replace:: |opencv_android_bin_pack| .. |opencv_android_bin_pack_url| replace:: |opencv_android_bin_pack|
.. |seven_zip| replace:: 7-Zip .. |seven_zip| replace:: 7-Zip
.. _seven_zip: http://www.7-zip.org/ .. _seven_zip: http://www.7-zip.org/
@ -295,7 +295,7 @@ Well, running samples from Eclipse is very simple:
.. code-block:: sh .. code-block:: sh
:linenos: :linenos:
<Android SDK path>/platform-tools/adb install <OpenCV4Android SDK path>/apk/OpenCV_2.4.8_Manager_2.16_armv7a-neon.apk <Android SDK path>/platform-tools/adb install <OpenCV4Android SDK path>/apk/OpenCV_2.4.9_Manager_2.18_armv7a-neon.apk
.. note:: ``armeabi``, ``armv7a-neon``, ``arm7a-neon-android8``, ``mips`` and ``x86`` stand for .. note:: ``armeabi``, ``armv7a-neon``, ``arm7a-neon-android8``, ``mips`` and ``x86`` stand for
platform targets: platform targets:

@ -55,14 +55,14 @@ Manager to access OpenCV libraries externally installed in the target system.
:guilabel:`File -> Import -> Existing project in your workspace`. :guilabel:`File -> Import -> Existing project in your workspace`.
Press :guilabel:`Browse` button and locate OpenCV4Android SDK Press :guilabel:`Browse` button and locate OpenCV4Android SDK
(:file:`OpenCV-2.4.8-android-sdk/sdk`). (:file:`OpenCV-2.4.9-android-sdk/sdk`).
.. image:: images/eclipse_opencv_dependency0.png .. image:: images/eclipse_opencv_dependency0.png
:alt: Add dependency from OpenCV library :alt: Add dependency from OpenCV library
:align: center :align: center
#. In application project add a reference to the OpenCV Java SDK in #. In application project add a reference to the OpenCV Java SDK in
:guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.8``. :guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.9``.
.. image:: images/eclipse_opencv_dependency1.png .. image:: images/eclipse_opencv_dependency1.png
:alt: Add dependency from OpenCV library :alt: Add dependency from OpenCV library
@ -128,27 +128,27 @@ described above.
#. Add the OpenCV library project to your workspace the same way as for the async initialization #. Add the OpenCV library project to your workspace the same way as for the async initialization
above. Use menu :guilabel:`File -> Import -> Existing project in your workspace`, above. Use menu :guilabel:`File -> Import -> Existing project in your workspace`,
press :guilabel:`Browse` button and select OpenCV SDK path press :guilabel:`Browse` button and select OpenCV SDK path
(:file:`OpenCV-2.4.8-android-sdk/sdk`). (:file:`OpenCV-2.4.9-android-sdk/sdk`).
.. image:: images/eclipse_opencv_dependency0.png .. image:: images/eclipse_opencv_dependency0.png
:alt: Add dependency from OpenCV library :alt: Add dependency from OpenCV library
:align: center :align: center
#. In the application project add a reference to the OpenCV4Android SDK in #. In the application project add a reference to the OpenCV4Android SDK in
:guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.8``; :guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.9``;
.. image:: images/eclipse_opencv_dependency1.png .. image:: images/eclipse_opencv_dependency1.png
:alt: Add dependency from OpenCV library :alt: Add dependency from OpenCV library
:align: center :align: center
#. If your application project **doesn't have a JNI part**, just copy the corresponding OpenCV #. If your application project **doesn't have a JNI part**, just copy the corresponding OpenCV
native libs from :file:`<OpenCV-2.4.8-android-sdk>/sdk/native/libs/<target_arch>` to your native libs from :file:`<OpenCV-2.4.9-android-sdk>/sdk/native/libs/<target_arch>` to your
project directory to folder :file:`libs/<target_arch>`. project directory to folder :file:`libs/<target_arch>`.
In case of the application project **with a JNI part**, instead of manual libraries copying you In case of the application project **with a JNI part**, instead of manual libraries copying you
need to modify your ``Android.mk`` file: need to modify your ``Android.mk`` file:
add the following two code lines after the ``"include $(CLEAR_VARS)"`` and before add the following two code lines after the ``"include $(CLEAR_VARS)"`` and before
``"include path_to_OpenCV-2.4.8-android-sdk/sdk/native/jni/OpenCV.mk"`` ``"include path_to_OpenCV-2.4.9-android-sdk/sdk/native/jni/OpenCV.mk"``
.. code-block:: make .. code-block:: make
:linenos: :linenos:
@ -221,7 +221,7 @@ taken:
.. code-block:: make .. code-block:: make
include C:\Work\OpenCV4Android\OpenCV-2.4.8-android-sdk\sdk\native\jni\OpenCV.mk include C:\Work\OpenCV4Android\OpenCV-2.4.9-android-sdk\sdk\native\jni\OpenCV.mk
Should be inserted into the :file:`jni/Android.mk` file **after** this line: Should be inserted into the :file:`jni/Android.mk` file **after** this line:

@ -102,7 +102,7 @@ As always, we would be happy to hear your comments and receive your contribution
.. cssclass:: toctableopencv .. cssclass:: toctableopencv
=========== ======================================================= =========== =======================================================
|Video| Look here in order to find use on your video stream algoritms like: motion extraction, feature tracking and foreground extractions. |Video| Look here in order to find use on your video stream algorithms like: motion extraction, feature tracking and foreground extractions.
=========== ======================================================= =========== =======================================================

@ -3,7 +3,7 @@
*video* module. Video analysis *video* module. Video analysis
----------------------------------------------------------- -----------------------------------------------------------
Look here in order to find use on your video stream algoritms like: motion extraction, feature tracking and foreground extractions. Look here in order to find use on your video stream algorithms like: motion extraction, feature tracking and foreground extractions.
.. include:: ../../definitions/tocDefinitions.rst .. include:: ../../definitions/tocDefinitions.rst

@ -75,7 +75,7 @@ Moreover every :ocv:class:`FaceRecognizer` supports the:
Setting the Thresholds Setting the Thresholds
+++++++++++++++++++++++ +++++++++++++++++++++++
Sometimes you run into the situation, when you want to apply a threshold on the prediction. A common scenario in face recognition is to tell, wether a face belongs to the training dataset or if it is unknown. You might wonder, why there's no public API in :ocv:class:`FaceRecognizer` to set the threshold for the prediction, but rest assured: It's supported. It just means there's no generic way in an abstract class to provide an interface for setting/getting the thresholds of *every possible* :ocv:class:`FaceRecognizer` algorithm. The appropriate place to set the thresholds is in the constructor of the specific :ocv:class:`FaceRecognizer` and since every :ocv:class:`FaceRecognizer` is a :ocv:class:`Algorithm` (see above), you can get/set the thresholds at runtime! Sometimes you run into the situation, when you want to apply a threshold on the prediction. A common scenario in face recognition is to tell, whether a face belongs to the training dataset or if it is unknown. You might wonder, why there's no public API in :ocv:class:`FaceRecognizer` to set the threshold for the prediction, but rest assured: It's supported. It just means there's no generic way in an abstract class to provide an interface for setting/getting the thresholds of *every possible* :ocv:class:`FaceRecognizer` algorithm. The appropriate place to set the thresholds is in the constructor of the specific :ocv:class:`FaceRecognizer` and since every :ocv:class:`FaceRecognizer` is a :ocv:class:`Algorithm` (see above), you can get/set the thresholds at runtime!
Here is an example of setting a threshold for the Eigenfaces method, when creating the model: Here is an example of setting a threshold for the Eigenfaces method, when creating the model:

@ -71,7 +71,7 @@ You really don't want to create the CSV file by hand. And you really don't want
Fisherfaces for Gender Classification 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 recognition rate of the Fisherfaces method for gender classification. If you want to decide whether 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 recognition 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.

@ -257,7 +257,7 @@ namespace
{ {
char braces[5] = {'\0', '\0', ';', '\0', '\0'}; char braces[5] = {'\0', '\0', ';', '\0', '\0'};
return cv::makePtr<FormattedImpl>("[", "]", mtx, &*braces, return cv::makePtr<FormattedImpl>("[", "]", mtx, &*braces,
mtx.cols == 1 || !multiline, mtx.depth() == CV_64F ? prec64f : prec32f ); mtx.rows == 1 || !multiline, mtx.depth() == CV_64F ? prec64f : prec32f );
} }
}; };
@ -271,7 +271,7 @@ namespace
if (mtx.cols == 1) if (mtx.cols == 1)
braces[0] = braces[1] = '\0'; braces[0] = braces[1] = '\0';
return cv::makePtr<FormattedImpl>("[", "]", mtx, &*braces, return cv::makePtr<FormattedImpl>("[", "]", mtx, &*braces,
mtx.cols*mtx.channels() == 1 || !multiline, mtx.depth() == CV_64F ? prec64f : prec32f ); mtx.rows*mtx.channels() == 1 || !multiline, mtx.depth() == CV_64F ? prec64f : prec32f );
} }
}; };
@ -290,7 +290,7 @@ namespace
braces[0] = braces[1] = '\0'; braces[0] = braces[1] = '\0';
return cv::makePtr<FormattedImpl>("array([", return cv::makePtr<FormattedImpl>("array([",
cv::format("], type='%s')", numpyTypes[mtx.depth()]), mtx, &*braces, cv::format("], type='%s')", numpyTypes[mtx.depth()]), mtx, &*braces,
mtx.cols*mtx.channels() == 1 || !multiline, mtx.depth() == CV_64F ? prec64f : prec32f ); mtx.rows*mtx.channels() == 1 || !multiline, mtx.depth() == CV_64F ? prec64f : prec32f );
} }
}; };
@ -303,7 +303,7 @@ namespace
char braces[5] = {'\0', '\0', '\0', '\0', '\0'}; char braces[5] = {'\0', '\0', '\0', '\0', '\0'};
return cv::makePtr<FormattedImpl>(cv::String(), return cv::makePtr<FormattedImpl>(cv::String(),
mtx.rows > 1 ? cv::String("\n") : cv::String(), mtx, &*braces, mtx.rows > 1 ? cv::String("\n") : cv::String(), mtx, &*braces,
mtx.cols*mtx.channels() == 1 || !multiline, mtx.depth() == CV_64F ? prec64f : prec32f ); mtx.rows*mtx.channels() == 1 || !multiline, mtx.depth() == CV_64F ? prec64f : prec32f );
} }
}; };
@ -315,7 +315,7 @@ namespace
{ {
char braces[5] = {'\0', '\0', ',', '\0', '\0'}; char braces[5] = {'\0', '\0', ',', '\0', '\0'};
return cv::makePtr<FormattedImpl>("{", "}", mtx, &*braces, return cv::makePtr<FormattedImpl>("{", "}", mtx, &*braces,
mtx.cols == 1 || !multiline, mtx.depth() == CV_64F ? prec64f : prec32f ); mtx.rows == 1 || !multiline, mtx.depth() == CV_64F ? prec64f : prec32f );
} }
}; };

@ -45,7 +45,7 @@ Utilizing Multiple GPUs
----------------------- -----------------------
In the current version, each of the OpenCV CUDA algorithms can use only a single GPU. So, to utilize multiple GPUs, you have to manually distribute the work between GPUs. In the current version, each of the OpenCV CUDA algorithms can use only a single GPU. So, to utilize multiple GPUs, you have to manually distribute the work between GPUs.
Switching active devie can be done using :ocv:func:`cuda::setDevice()` function. For more details please read Cuda C Programing Guide. Switching active devie can be done using :ocv:func:`cuda::setDevice()` function. For more details please read Cuda C Programming Guide.
While developing algorithms for multiple GPUs, note a data passing overhead. For primitive functions and small images, it can be significant, which may eliminate all the advantages of having multiple GPUs. But for high-level algorithms, consider using multi-GPU acceleration. For example, the Stereo Block Matching algorithm has been successfully parallelized using the following algorithm: While developing algorithms for multiple GPUs, note a data passing overhead. For primitive functions and small images, it can be significant, which may eliminate all the advantages of having multiple GPUs. But for high-level algorithms, consider using multi-GPU acceleration. For example, the Stereo Block Matching algorithm has been successfully parallelized using the following algorithm:

@ -323,7 +323,7 @@ CUDA_TEST_P(MOG2, getBackgroundImage)
cv::Mat background_gold; cv::Mat background_gold;
mog2_gold->getBackgroundImage(background_gold); mog2_gold->getBackgroundImage(background_gold);
ASSERT_MAT_NEAR(background_gold, background, 0); ASSERT_MAT_NEAR(background_gold, background, 1);
} }
INSTANTIATE_TEST_CASE_P(CUDA_BgSegm, MOG2, testing::Combine( INSTANTIATE_TEST_CASE_P(CUDA_BgSegm, MOG2, testing::Combine(

@ -42,6 +42,11 @@ public class OpenCVLoader
*/ */
public static final String OPENCV_VERSION_2_4_8 = "2.4.8"; public static final String OPENCV_VERSION_2_4_8 = "2.4.8";
/**
* OpenCV Library version 2.4.9.
*/
public static final String OPENCV_VERSION_2_4_9 = "2.4.9";
/** /**
* Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java"). * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java").
* @return Returns true is initialization of OpenCV was successful. * @return Returns true is initialization of OpenCV was successful.

@ -730,12 +730,12 @@ private:
m_pFViVarRes = (int*)cvAlloc(sizeof(int)*m_Dim); m_pFViVarRes = (int*)cvAlloc(sizeof(int)*m_Dim);
m_Sizes = (int*)cvAlloc(sizeof(int)*m_Dim); m_Sizes = (int*)cvAlloc(sizeof(int)*m_Dim);
{ /* Create init sparce matrix: */ { /* Create init sparse matrix: */
int i; int i;
for(i=0;i<m_Dim;++i)m_Sizes[i] = m_BinNum; for(i=0;i<m_Dim;++i)m_Sizes[i] = m_BinNum;
m_HistMat.Realloc(m_Dim,m_Sizes,SPARSE); m_HistMat.Realloc(m_Dim,m_Sizes,SPARSE);
m_HistVolumeSaved = 0; m_HistVolumeSaved = 0;
} /* Create init sparce matrix. */ } /* Create init sparse matrix. */
} /* AllocData. */ } /* AllocData. */
void FreeData() void FreeData()

@ -58,7 +58,7 @@ void cvLevenbergMarquardtOptimization(pointer_LMJac JacobianFunction,
CvMat *X0,CvMat *observRes,CvMat *resultX, CvMat *X0,CvMat *observRes,CvMat *resultX,
int maxIter,double epsilon) int maxIter,double epsilon)
{ {
/* This is not sparce method */ /* This is not sparse method */
/* Make optimization using */ /* Make optimization using */
/* func - function to compute */ /* func - function to compute */
/* uses function to compute jacobian */ /* uses function to compute jacobian */

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.opencv.engine" package="org.opencv.engine"
android:versionCode="216@ANDROID_PLATFORM_VERSION_CODE@" android:versionCode="218@ANDROID_PLATFORM_VERSION_CODE@"
android:versionName="2.16" > android:versionName="2.18" >
<uses-sdk android:minSdkVersion="@ANDROID_NATIVE_API_LEVEL@" /> <uses-sdk android:minSdkVersion="@ANDROID_NATIVE_API_LEVEL@" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/> <uses-feature android:name="android.hardware.touchscreen" android:required="false"/>

@ -15,7 +15,7 @@ using namespace android;
const int OpenCVEngine::Platform = DetectKnownPlatforms(); const int OpenCVEngine::Platform = DetectKnownPlatforms();
const int OpenCVEngine::CpuID = GetCpuID(); const int OpenCVEngine::CpuID = GetCpuID();
const int OpenCVEngine::KnownVersions[] = {2040000, 2040100, 2040200, 2040300, 2040301, 2040302, 2040400, 2040500, 2040600, 2040700, 2040701, 2040800}; const int OpenCVEngine::KnownVersions[] = {2040000, 2040100, 2040200, 2040300, 2040301, 2040302, 2040400, 2040500, 2040600, 2040700, 2040701, 2040800, 2040900};
bool OpenCVEngine::ValidateVersion(int version) bool OpenCVEngine::ValidateVersion(int version)
{ {

@ -117,7 +117,7 @@ public class ManagerActivity extends Activity
} }
else else
{ {
HardwarePlatformView.setText("Tegra 5"); HardwarePlatformView.setText("Tegra K1");
} }
} }
else else

@ -14,20 +14,20 @@ manually using adb tool:
.. code-block:: sh .. code-block:: sh
adb install OpenCV-2.4.8-android-sdk/apk/OpenCV_2.4.8_Manager_2.16_<platform>.apk adb install OpenCV-2.4.9-android-sdk/apk/OpenCV_2.4.9_Manager_2.18_<platform>.apk
Use the table below to determine proper OpenCV Manager package for your device: Use the table below to determine proper OpenCV Manager package for your device:
+------------------------------+--------------+----------------------------------------------------+ +------------------------------+--------------+----------------------------------------------------+
| Hardware Platform | Android ver. | Package name | | Hardware Platform | Android ver. | Package name |
+==============================+==============+====================================================+ +==============================+==============+====================================================+
| armeabi-v7a (ARMv7-A + NEON) | >= 2.3 | OpenCV_2.4.8_Manager_2.16_armv7a-neon.apk | | armeabi-v7a (ARMv7-A + NEON) | >= 2.3 | OpenCV_2.4.9_Manager_2.18_armv7a-neon.apk |
+------------------------------+--------------+----------------------------------------------------+ +------------------------------+--------------+----------------------------------------------------+
| armeabi-v7a (ARMv7-A + NEON) | = 2.2 | OpenCV_2.4.8_Manager_2.16_armv7a-neon-android8.apk | | armeabi-v7a (ARMv7-A + NEON) | = 2.2 | OpenCV_2.4.9_Manager_2.18_armv7a-neon-android8.apk |
+------------------------------+--------------+----------------------------------------------------+ +------------------------------+--------------+----------------------------------------------------+
| armeabi (ARMv5, ARMv6) | >= 2.3 | OpenCV_2.4.8_Manager_2.16_armeabi.apk | | armeabi (ARMv5, ARMv6) | >= 2.3 | OpenCV_2.4.9_Manager_2.18_armeabi.apk |
+------------------------------+--------------+----------------------------------------------------+ +------------------------------+--------------+----------------------------------------------------+
| Intel x86 | >= 2.3 | OpenCV_2.4.8_Manager_2.16_x86.apk | | Intel x86 | >= 2.3 | OpenCV_2.4.9_Manager_2.18_x86.apk |
+------------------------------+--------------+----------------------------------------------------+ +------------------------------+--------------+----------------------------------------------------+
| MIPS | >= 2.3 | OpenCV_2.4.8_Manager_2.16_mips.apk | | MIPS | >= 2.3 | OpenCV_2.4.9_Manager_2.18_mips.apk |
+------------------------------+--------------+----------------------------------------------------+ +------------------------------+--------------+----------------------------------------------------+

Loading…
Cancel
Save