Commit 14ac55d0 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #7289 from alalek:android24

parents 1f6cf50b 2d103366
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
#### Resources #### Resources
* Homepage: <http://opencv.org> * Homepage: <http://opencv.org>
* Docs: <http://docs.opencv.org> * Docs: <http://docs.opencv.org/2.4/>
* Q&A forum: <http://answers.opencv.org> * Q&A forum: <http://answers.opencv.org>
* Issue tracking: <http://code.opencv.org> * Issue tracking: <https://github.com/opencv/opencv/issues>
#### Contributing #### Contributing
Please read before starting work on a pull request: <http://code.opencv.org/projects/opencv/wiki/How_to_contribute> Please read before starting work on a pull request: <https://github.com/opencv/opencv/wiki/How_to_contribute>
Summary of guidelines: Summary of guidelines:
......
...@@ -274,6 +274,17 @@ macro(add_android_project target path) ...@@ -274,6 +274,17 @@ macro(add_android_project target path)
file(GLOB_RECURSE android_proj_jni_files "${path}/jni/*.c" "${path}/jni/*.h" "${path}/jni/*.cpp" "${path}/jni/*.hpp") file(GLOB_RECURSE android_proj_jni_files "${path}/jni/*.c" "${path}/jni/*.h" "${path}/jni/*.cpp" "${path}/jni/*.hpp")
ocv_list_filterout(android_proj_jni_files "\\\\.svn") ocv_list_filterout(android_proj_jni_files "\\\\.svn")
foreach(lib "opencv_java")
get_property(f TARGET ${lib} PROPERTY LOCATION)
get_filename_component(f_name ${f} NAME)
add_custom_command(
OUTPUT "${android_proj_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}/${f_name}"
COMMAND ${CMAKE_COMMAND} -E copy "${f}" "${android_proj_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}/${f_name}"
DEPENDS "${lib}" VERBATIM
COMMENT "Embedding ${f}")
list(APPEND android_proj_file_deps "${android_proj_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}/${f_name}")
endforeach()
if(android_proj_jni_files AND EXISTS ${path}/jni/Android.mk AND NOT DEFINED JNI_LIB_NAME) if(android_proj_jni_files AND EXISTS ${path}/jni/Android.mk AND NOT DEFINED JNI_LIB_NAME)
# find local module name in Android.mk file to build native lib # find local module name in Android.mk file to build native lib
file(STRINGS "${path}/jni/Android.mk" JNI_LIB_NAME REGEX "LOCAL_MODULE[ ]*:=[ ]*.*" ) file(STRINGS "${path}/jni/Android.mk" JNI_LIB_NAME REGEX "LOCAL_MODULE[ ]*:=[ ]*.*" )
...@@ -307,6 +318,7 @@ macro(add_android_project target path) ...@@ -307,6 +318,7 @@ macro(add_android_project target path)
# copy opencv_java, tbb if it is shared and dynamicuda if present if FORCE_EMBED_OPENCV flag is set # copy opencv_java, tbb if it is shared and dynamicuda if present if FORCE_EMBED_OPENCV flag is set
if(android_proj_FORCE_EMBED_OPENCV) if(android_proj_FORCE_EMBED_OPENCV)
set(native_deps ${android_proj_NATIVE_DEPS}) set(native_deps ${android_proj_NATIVE_DEPS})
list(REMOVE_ITEM native_deps "opencv_java")
# filter out gpu module as it is always static library on Android # filter out gpu module as it is always static library on Android
list(REMOVE_ITEM native_deps "opencv_gpu") list(REMOVE_ITEM native_deps "opencv_gpu")
if(ENABLE_DYNAMIC_CUDA) if(ENABLE_DYNAMIC_CUDA)
......
...@@ -123,10 +123,11 @@ if(PYTHON_EXECUTABLE) ...@@ -123,10 +123,11 @@ if(PYTHON_EXECUTABLE)
find_host_program(SPHINX_BUILD sphinx-build) find_host_program(SPHINX_BUILD sphinx-build)
if(SPHINX_BUILD) if(SPHINX_BUILD)
execute_process(COMMAND "${SPHINX_BUILD}" execute_process(COMMAND "${SPHINX_BUILD}"
OUTPUT_QUIET ERROR_VARIABLE SPHINX_STDERR
ERROR_VARIABLE SPHINX_OUTPUT OUTPUT_VARIABLE SPHINX_STDOUT
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
if(SPHINX_OUTPUT MATCHES "Sphinx v([0-9][^ \n]*)") if(SPHINX_STDERR MATCHES "Sphinx v([0-9][^ \n]*)"
OR SPHINX_STDOUT MATCHES "Sphinx v([0-9][^ \n]*)")
set(SPHINX_VERSION "${CMAKE_MATCH_1}") set(SPHINX_VERSION "${CMAKE_MATCH_1}")
set(HAVE_SPHINX 1) set(HAVE_SPHINX 1)
message(STATUS "Found Sphinx ${SPHINX_VERSION}: ${SPHINX_BUILD}") message(STATUS "Found Sphinx ${SPHINX_VERSION}: ${SPHINX_BUILD}")
......
...@@ -110,6 +110,10 @@ else ...@@ -110,6 +110,10 @@ else
OPENCV_INSTALL_MODULES:=on OPENCV_INSTALL_MODULES:=on
endif endif
ifeq ($(OPENCV_INSTALL_MODULES),)
OPENCV_INSTALL_MODULES:=on
endif
define add_opencv_module define add_opencv_module
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE:=opencv_$1 LOCAL_MODULE:=opencv_$1
......
...@@ -40,9 +40,7 @@ endif(HAVE_DOC_GENERATOR) ...@@ -40,9 +40,7 @@ endif(HAVE_DOC_GENERATOR)
# ========= Sphinx docs ========= # ========= Sphinx docs =========
if(BUILD_DOCS AND HAVE_SPHINX) if(BUILD_DOCS AND HAVE_SPHINX)
if(NOT INSTALL_CREATE_DISTRIB) list(APPEND DOC_LIST "${OpenCV_SOURCE_DIR}/doc/haartraining.htm")
list(APPEND DOC_LIST "${OpenCV_SOURCE_DIR}/doc/haartraining.htm")
endif()
# build lists of documentation files and generate table of contents for reference manual # build lists of documentation files and generate table of contents for reference manual
set(DOC_FAKE_ROOT "${CMAKE_CURRENT_BINARY_DIR}/fake-root") set(DOC_FAKE_ROOT "${CMAKE_CURRENT_BINARY_DIR}/fake-root")
......
...@@ -315,7 +315,7 @@ extlinks = { ...@@ -315,7 +315,7 @@ extlinks = {
# 'opencv_group' : ('http://answers.opencv.org/%s', None), # 'opencv_group' : ('http://answers.opencv.org/%s', None),
'opencv_qa' : ('http://answers.opencv.org/%s', None), 'opencv_qa' : ('http://answers.opencv.org/%s', None),
'how_to_contribute' : ('http://code.opencv.org/projects/opencv/wiki/How_to_contribute/%s', None), 'how_to_contribute' : ('https://github.com/opencv/opencv/wiki/How_to_contribute/%s', None),
'cvt_color' : ('http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html?highlight=cvtcolor#cvtcolor%s', None), 'cvt_color' : ('http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html?highlight=cvtcolor#cvtcolor%s', None),
'imread' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=imread#imread%s', None), 'imread' : ('http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=imread#imread%s', None),
......
...@@ -22,7 +22,7 @@ Code ...@@ -22,7 +22,7 @@ Code
* In this tutorial, we intend to use *random* values for the drawing parameters. Also, we intend to populate our image with a big number of geometric figures. Since we will be initializing them in a random fashion, this process will be automatic and made by using *loops* . * In this tutorial, we intend to use *random* values for the drawing parameters. Also, we intend to populate our image with a big number of geometric figures. Since we will be initializing them in a random fashion, this process will be automatic and made by using *loops* .
* This code is in your OpenCV sample folder. Otherwise you can grab it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/core/Matrix/Drawing_2.cpp>`_ . * This code is in your OpenCV sample folder. Otherwise you can grab it from `here <https://github.com/opencv/opencv/blob/2.4/samples/cpp/tutorial_code/core/Matrix/Drawing_2.cpp>`_ .
Explanation Explanation
============ ============
......
...@@ -22,7 +22,7 @@ Theory ...@@ -22,7 +22,7 @@ Theory
Code Code
==== ====
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/features2D/SURF_detector.cpp>`_ This tutorial code's is shown lines below. You can also download it from `here <https://github.com/opencv/opencv/blob/2.4/samples/cpp/tutorial_code/features2D/SURF_detector.cpp>`_
.. code-block:: cpp .. code-block:: cpp
......
...@@ -20,7 +20,7 @@ Theory ...@@ -20,7 +20,7 @@ Theory
Code Code
==== ====
This tutorial code's is shown lines below. You can also download it from `here <http://code.opencv.org/projects/opencv/repository/revisions/master/raw/samples/cpp/tutorial_code/features2D/SURF_Homography.cpp>`_ This tutorial code's is shown lines below. You can also download it from `here <https://github.com/opencv/opencv/blob/2.4/samples/cpp/tutorial_code/features2D/SURF_Homography.cpp>`_
.. code-block:: cpp .. code-block:: cpp
......
...@@ -48,11 +48,7 @@ The structure of package contents looks as follows: ...@@ -48,11 +48,7 @@ The structure of package contents looks as follows:
:: ::
OpenCV-2.4.11-android-sdk OpenCV-2.4.13-android-sdk
|_ apk
| |_ OpenCV_2.4.11_binary_pack_armv7a.apk
| |_ OpenCV_2.4.11_Manager_2.20_XXX.apk
|
|_ doc |_ doc
|_ samples |_ samples
|_ sdk |_ sdk
......
...@@ -55,14 +55,14 @@ Manager to access OpenCV libraries externally installed in the target system. ...@@ -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.11-android-sdk/sdk`). (:file:`OpenCV-2.4.13-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.11``. :guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.13``.
.. 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. ...@@ -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.11-android-sdk/sdk`). (:file:`OpenCV-2.4.13-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.11``; :guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.13``;
.. 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.11-android-sdk>/sdk/native/libs/<target_arch>` to your native libs from :file:`<OpenCV-2.4.13-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.11-android-sdk/sdk/native/jni/OpenCV.mk"`` ``"include path_to_OpenCV-2.4.13-android-sdk/sdk/native/jni/OpenCV.mk"``
.. code-block:: make .. code-block:: make
:linenos: :linenos:
...@@ -221,7 +221,7 @@ taken: ...@@ -221,7 +221,7 @@ taken:
.. code-block:: make .. code-block:: make
include C:\Work\OpenCV4Android\OpenCV-2.4.11-android-sdk\sdk\native\jni\OpenCV.mk include C:\Work\OpenCV4Android\OpenCV-2.4.13-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:
...@@ -230,7 +230,8 @@ taken: ...@@ -230,7 +230,8 @@ taken:
include $(CLEAR_VARS) include $(CLEAR_VARS)
#. Several variables can be used to customize OpenCV stuff, but you **don't need** to use them when #. Several variables can be used to customize OpenCV stuff, but you **don't need** to use them when
your application uses the `async initialization` via the `OpenCV Manager` API. your application uses the `async initialization` via the `OpenCV Manager` API
(It is not recommended since OpenCV 2.4.13).
.. note:: These variables should be set **before** the ``"include .../OpenCV.mk"`` line: .. note:: These variables should be set **before** the ``"include .../OpenCV.mk"`` line:
......
...@@ -5,10 +5,6 @@ OpenCV 2.4 now comes with the very new :ocv:class:`FaceRecognizer` class for fac ...@@ -5,10 +5,6 @@ OpenCV 2.4 now comes with the very new :ocv:class:`FaceRecognizer` class for fac
These documents are the help I have wished for, when I was working myself into face recognition. I hope you also think the new :ocv:class:`FaceRecognizer` is a useful addition to OpenCV. These documents are the help I have wished for, when I was working myself into face recognition. I hope you also think the new :ocv:class:`FaceRecognizer` is a useful addition to OpenCV.
Please issue any feature requests and/or bugs on the official OpenCV bug tracker at:
* http://code.opencv.org/projects/opencv/issues
Contents Contents
======== ========
......
package org.opencv.android; package org.opencv.android;
import android.content.Context; import android.content.Context;
import android.util.Log;
/** /**
* Helper class provides common initialization methods for OpenCV library. * Helper class provides common initialization methods for OpenCV library.
*/ */
public class OpenCVLoader public class OpenCVLoader
{ {
private static final String TAG = "OpenCVLoader";
/** /**
* OpenCV Library version 2.4.2. * OpenCV Library version 2.4.2.
*/ */
...@@ -62,6 +65,11 @@ public class OpenCVLoader ...@@ -62,6 +65,11 @@ public class OpenCVLoader
*/ */
public static final String OPENCV_VERSION_2_4_12 = "2.4.12"; public static final String OPENCV_VERSION_2_4_12 = "2.4.12";
/**
* OpenCV Library version 2.4.13.
*/
public static final String OPENCV_VERSION_2_4_13 = "2.4.13";
/** /**
* 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.
...@@ -91,6 +99,11 @@ public class OpenCVLoader ...@@ -91,6 +99,11 @@ public class OpenCVLoader
public static boolean initAsync(String Version, Context AppContext, public static boolean initAsync(String Version, Context AppContext,
LoaderCallbackInterface Callback) LoaderCallbackInterface Callback)
{ {
if (initDebug()) {
Callback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
return true;
}
Log.w(TAG, "OpenCV binaries are not packaged with application. Trying to use OpenCV Manager...");
return AsyncServiceHelper.initOpenCV(Version, AppContext, Callback); return AsyncServiceHelper.initOpenCV(Version, AppContext, Callback);
} }
} }
This diff is collapsed.
...@@ -2,5 +2,3 @@ if(BUILD_ANDROID_SERVICE) ...@@ -2,5 +2,3 @@ if(BUILD_ANDROID_SERVICE)
add_subdirectory(engine) add_subdirectory(engine)
#add_subdirectory(engine_test) #add_subdirectory(engine_test)
endif() endif()
install(FILES "readme.txt" DESTINATION "apk/" COMPONENT libs)
...@@ -79,3 +79,11 @@ OpenCV version constants ...@@ -79,3 +79,11 @@ OpenCV version constants
.. data:: OPENCV_VERSION_2_4_11 .. data:: OPENCV_VERSION_2_4_11
OpenCV Library version 2.4.11 OpenCV Library version 2.4.11
.. data:: OPENCV_VERSION_2_4_12
OpenCV Library version 2.4.12
.. data:: OPENCV_VERSION_2_4_13
OpenCV Library version 2.4.13
How to select the proper version of OpenCV Manager How to select the proper version of OpenCV Manager
-------------------------------------------------- --------------------------------------------------
DEPRECATED: This information is outdated since OpenCV 2.4.12
Since version 1.7 several packages of OpenCV Manager are built. Every package is targeted for some Since version 1.7 several packages of OpenCV Manager are built. Every package is targeted for some
specific hardware platform and includes corresponding OpenCV binaries. So, in most cases OpenCV specific hardware platform and includes corresponding OpenCV binaries. So, in most cases OpenCV
Manager uses built-in version of OpenCV. Separate package with OpenCV binaries is currently used in Manager uses built-in version of OpenCV. Separate package with OpenCV binaries is currently used in
......
...@@ -3,7 +3,6 @@ LOCAL_PATH := $(call my-dir) ...@@ -3,7 +3,6 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
#OPENCV_CAMERA_MODULES:=off #OPENCV_CAMERA_MODULES:=off
#OPENCV_INSTALL_MODULES:=off
#OPENCV_LIB_TYPE:=SHARED #OPENCV_LIB_TYPE:=SHARED
include ../../sdk/native/jni/OpenCV.mk include ../../sdk/native/jni/OpenCV.mk
......
...@@ -30,7 +30,7 @@ static void help() ...@@ -30,7 +30,7 @@ static void help()
"Using OpenCV version " << CV_VERSION << "\n\n" "Using OpenCV version " << CV_VERSION << "\n\n"
" 1) This demo is mainly based on work from Javier Barandiaran Martirena\n" " 1) This demo is mainly based on work from Javier Barandiaran Martirena\n"
" See this page http://code.opencv.org/projects/opencv/wiki/Posit.\n" " See this page https://github.com/opencv/opencv/wiki/Posit .\n"
" 2) This is a demo to illustrate how to use **OpenGL Callback**.\n" " 2) This is a demo to illustrate how to use **OpenGL Callback**.\n"
" 3) You need Qt binding to compile this sample with OpenGL support enabled.\n" " 3) You need Qt binding to compile this sample with OpenGL support enabled.\n"
" 4) The features' detection is very basic and could highly be improved\n" " 4) The features' detection is very basic and could highly be improved\n"
......
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