mirror of
https://github.com/opencv/opencv.git
synced 2026-07-25 13:23:02 +04:00
Compare commits
330 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c12243cf4f | |||
| 39fdcf4df3 | |||
| fd1b30fc6f | |||
| 7ee79b73f6 | |||
| 1f3043f618 | |||
| 1d7d22e117 | |||
| 33ab9ea188 | |||
| 8ad6ba82fc | |||
| 737a1e2f12 | |||
| 850e3c1ca2 | |||
| 7541c590e5 | |||
| caffbaafbe | |||
| f57fb2375e | |||
| a28c8d002d | |||
| a4073ed676 | |||
| 78e07d3210 | |||
| 41af58d1d5 | |||
| bf5393ae58 | |||
| b866e2672a | |||
| 1df0f1da97 | |||
| 535dc1e874 | |||
| 24dea1c616 | |||
| 96c3f16a90 | |||
| fd860d7cd0 | |||
| b46719b093 | |||
| 8b8fc9e66b | |||
| 882c0321f4 | |||
| 8c3c6b31fc | |||
| 5a94a95fbf | |||
| 036c438904 | |||
| 5e095c8fbd | |||
| 665a317f1c | |||
| f7ad192842 | |||
| 58cf11bd44 | |||
| 549ef8f141 | |||
| 176dd96698 | |||
| 5f8f56ea0e | |||
| 47d8187bc3 | |||
| 481f786fe7 | |||
| 3408114602 | |||
| bd2c2f3bd1 | |||
| a4a2659dff | |||
| aa932eab41 | |||
| 565d3dde40 | |||
| 85c08dd170 | |||
| 8bc21fc2f0 | |||
| 57c3e917e2 | |||
| 7658c2e2d5 | |||
| 993e0b0bf9 | |||
| 9aaa27d46b | |||
| 6c55e7c039 | |||
| 1df244b6f4 | |||
| 75558ae75c | |||
| eb40dde688 | |||
| bb72206ec5 | |||
| e9c765ee2c | |||
| 83723c15be | |||
| 8454a8f2d1 | |||
| 6aedd4f7b0 | |||
| e96b8ce781 | |||
| b0cbec922b | |||
| 0f7de40e66 | |||
| 5ad4bed70a | |||
| 330b3e87eb | |||
| 8fb37606f6 | |||
| dc587992a0 | |||
| c1c03e16f4 | |||
| 6006790c18 | |||
| bb2e40b999 | |||
| b1a8e4f760 | |||
| ca1d8c1737 | |||
| ff6881efbf | |||
| 3c85200989 | |||
| e944533f01 | |||
| 85149f8686 | |||
| a12ec66a04 | |||
| 9d90b0549c | |||
| 3bc5958c58 | |||
| 2952c10ced | |||
| 55d1f0b7d6 | |||
| 60064b3de7 | |||
| 02eb8e7c70 | |||
| 786d62e3e5 | |||
| 13cd052990 | |||
| a4e5b09ea4 | |||
| 3ec0e0943c | |||
| 653810e4df | |||
| efa2baed83 | |||
| c9481b0fd7 | |||
| 8138e26163 | |||
| a04a0514b9 | |||
| a9ae0c8e82 | |||
| 3c2e12a744 | |||
| cb55d60f98 | |||
| 6e1a595342 | |||
| 5141141e2b | |||
| 7e6947a940 | |||
| bb989f2034 | |||
| 9c8255feeb | |||
| 4f95e6c70b | |||
| 55a5e6be2c | |||
| 607d3b54ce | |||
| 7ca0557b40 | |||
| 25b4cface0 | |||
| e9bc9c47c2 | |||
| 6a50a51b4e | |||
| 22c0238bf1 | |||
| acbc7362db | |||
| 2466ca02bf | |||
| 7fd5b3a0c5 | |||
| a1a35ca5f7 | |||
| 90a78585fb | |||
| f5be8f6c77 | |||
| 526defab85 | |||
| 44d1738d47 | |||
| f32f0486e2 | |||
| 8e392251ba | |||
| 3863dc5b2b | |||
| 671a630f47 | |||
| d2aaa70e93 | |||
| 4418ee6c77 | |||
| c64a15294d | |||
| ef8182e12a | |||
| b204013483 | |||
| af47b6551f | |||
| 892684ebe5 | |||
| 4c67ae1a0b | |||
| 021473e93e | |||
| b116d6c6e8 | |||
| 6b04c2b904 | |||
| 7061bf0000 | |||
| dab78c26b1 | |||
| a6a0fc5b21 | |||
| fede94e979 | |||
| 6d0407b65e | |||
| 05a45ef6dc | |||
| 298c98ea32 | |||
| ab8afc3bcc | |||
| af806bc816 | |||
| d67d32af48 | |||
| 6ac4a4ceb6 | |||
| 5cb70d34d7 | |||
| b5a7122855 | |||
| e936670571 | |||
| fc06a2384b | |||
| 432cf1152a | |||
| 3136010e1a | |||
| 2fc92448df | |||
| e22979f334 | |||
| a5242265d7 | |||
| 8b791477df | |||
| 268283ff16 | |||
| 6613519c2e | |||
| e0136e39f4 | |||
| 546f70a6f0 | |||
| f85eb23c3b | |||
| 78e89ba3ff | |||
| eb41a574b7 | |||
| 187ab0ca61 | |||
| 7cf5de0ed0 | |||
| 68e9d19743 | |||
| f0197006e0 | |||
| a85bb091c8 | |||
| 3d20157d4f | |||
| 55f78f8a83 | |||
| d08cb6b357 | |||
| d40eefd5a4 | |||
| 4a9b244577 | |||
| cc086b9452 | |||
| 35884a7e3f | |||
| 3109c77013 | |||
| a26ab3ab16 | |||
| 66eb270cf7 | |||
| 354ed5c4d6 | |||
| c52092e6f8 | |||
| 52fa55a770 | |||
| a87e1c2f90 | |||
| cc92cd07e8 | |||
| 7dd67f4997 | |||
| 3c769edea0 | |||
| 3c7f7de477 | |||
| ffabbfa778 | |||
| ca90667723 | |||
| 05d888316a | |||
| b37aaa8303 | |||
| 3cb4954d70 | |||
| feb5b6aa93 | |||
| 2e7e754032 | |||
| cab0ecdf19 | |||
| d3b0cb878a | |||
| 71002e0e79 | |||
| a41ac8fd40 | |||
| 8b3b2a52f0 | |||
| fe0ce9282a | |||
| 25bcca2edb | |||
| 31ef944176 | |||
| 06b0fa6fc2 | |||
| 6d1cbc6458 | |||
| 3f91b0d340 | |||
| a7160d9b12 | |||
| e22c09c601 | |||
| 61293a09ff | |||
| c8cb03fd8f | |||
| 6425ac3b13 | |||
| cbaf0ecaf6 | |||
| b95769333c | |||
| 4743184078 | |||
| 3f180b0ad9 | |||
| 1e00a93f97 | |||
| 450a276f87 | |||
| 0f53526598 | |||
| 780f4ae7c5 | |||
| 4af2eb22ab | |||
| 5de9d8e6e1 | |||
| d3ef3cff94 | |||
| 568303ac7f | |||
| 09c26d6805 | |||
| 939c1d2474 | |||
| b8d40b4ad5 | |||
| ae933db526 | |||
| dfc508bb15 | |||
| 05bc7621e6 | |||
| a94fdbe0f0 | |||
| e7fcffeead | |||
| 8e82bed459 | |||
| 3fe69f4e67 | |||
| ab40c2acf7 | |||
| 7cd198623e | |||
| 16e20e5c73 | |||
| 9e97d7b4db | |||
| 26d7da68fc | |||
| f6f5b6035b | |||
| 966d50762d | |||
| 01c3d491e7 | |||
| f052b0bc4d | |||
| a31b29308f | |||
| 3a53e726dd | |||
| d59a6b29d5 | |||
| cfcef3ec98 | |||
| f49544f310 | |||
| 171b58e2ca | |||
| 7a3c0cb70e | |||
| 1756590117 | |||
| c137ba53a0 | |||
| 6b1d5e48b6 | |||
| fb56d5c482 | |||
| d280205245 | |||
| 0ee8634b2f | |||
| 73f760fdf0 | |||
| 931a519969 | |||
| 0baaf0a60f | |||
| 63a63e3eaa | |||
| 6b9e273f92 | |||
| 2c6114f58d | |||
| 8ba1ec22e4 | |||
| 4bf6bd3d37 | |||
| 09930938e8 | |||
| 09e9e8ad9f | |||
| 34dacdea32 | |||
| 9ddb8bdb8b | |||
| 56856a1810 | |||
| 341de5d53f | |||
| b28056e3dd | |||
| 3e25c085ba | |||
| 5b9182ba43 | |||
| 5a31f6b4e1 | |||
| 2ec92ba440 | |||
| 01e351de37 | |||
| 441f93d58d | |||
| a33d7928a4 | |||
| 9c0b740b84 | |||
| 96b5ec14d4 | |||
| 79ac0d05ce | |||
| 40b765b7c2 | |||
| f426778160 | |||
| f148eaace9 | |||
| 9b87c22e01 | |||
| 9fbd1d68ad | |||
| e01b485ac6 | |||
| bbdf21679f | |||
| e2f74309f7 | |||
| 0ec5561b4e | |||
| 74e2b8cbcb | |||
| 7918267d02 | |||
| 135fa85e8f | |||
| d8f360316d | |||
| b73894b271 | |||
| 0746ec7035 | |||
| a8226814c5 | |||
| 30a3ff0de6 | |||
| dadf53f17c | |||
| f39d351d04 | |||
| 0039690f11 | |||
| 07e07655d4 | |||
| e60dcc9b3b | |||
| 7245803405 | |||
| ce7812fcb0 | |||
| bcf02ae439 | |||
| 8919c3162d | |||
| 2200e0fb7e | |||
| 0ded2984b8 | |||
| 5e44aa37ff | |||
| 9efc57f24b | |||
| 20156d1eeb | |||
| 1138a38dbe | |||
| 63dbeeaac5 | |||
| 655b28ee0c | |||
| 5455e38e15 | |||
| b99f7a29df | |||
| b599774e30 | |||
| e6f7e96ff4 | |||
| b4c7c011b7 | |||
| 3b5530fb67 | |||
| 2c73e49dac | |||
| d6c95621e8 | |||
| b94c513cee | |||
| 614edafe73 | |||
| 9f7548ab89 | |||
| d2409d12c6 | |||
| 6a5f413f27 | |||
| 755527a90a | |||
| 1e90b2f51d | |||
| f57063efa2 | |||
| eee210f3b5 | |||
| 34bc3b8595 | |||
| 5ffb53f229 | |||
| dee3a4b528 | |||
| 26997f32c6 | |||
| 443b3157e0 | |||
| 86fb9f8409 |
Vendored
+1
-1
@@ -54,6 +54,6 @@ if(ENABLE_SOLUTION_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${WEBP_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
||||
ocv_install_target(${WEBP_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
|
||||
|
||||
+34
-22
@@ -45,6 +45,24 @@ endif(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES Window
|
||||
|
||||
if(WINRT)
|
||||
add_definitions(-DWINRT -DNO_GETENV)
|
||||
|
||||
# Making definitions available to other configurations and
|
||||
# to filter dependency restrictions at compile time.
|
||||
if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone)
|
||||
set(WINRT_PHONE TRUE)
|
||||
add_definitions(-DWINRT_PHONE)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES WindowsStore)
|
||||
set(WINRT_STORE TRUE)
|
||||
add_definitions(-DWINRT_STORE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_VERSION MATCHES 8.1)
|
||||
set(WINRT_8_1 TRUE)
|
||||
add_definitions(-DWINRT_8_1)
|
||||
elseif(CMAKE_SYSTEM_VERSION MATCHES 8.0)
|
||||
set(WINRT_8_0 TRUE)
|
||||
add_definitions(-DWINRT_8_0)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0022)
|
||||
@@ -170,6 +188,7 @@ OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF
|
||||
OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENMP "Include OpenMP support" OFF)
|
||||
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF (WIN32 AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_PTHREADS_PF "Use pthreads-based parallel_for" OFF IF (NOT WIN32) )
|
||||
OCV_OPTION(WITH_TIFF "Include TIFF support" ON IF (NOT IOS) )
|
||||
OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
|
||||
@@ -187,6 +206,7 @@ OCV_OPTION(WITH_DIRECTX "Include DirectX support" ON
|
||||
OCV_OPTION(WITH_INTELPERC "Include Intel Perceptual Computing support" OFF IF (WIN32 AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_IPP_A "Include Intel IPP_A support" OFF IF (MSVC OR X86 OR X86_64) )
|
||||
OCV_OPTION(WITH_GDAL "Include GDAL Support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_GPHOTO2 "Include gPhoto2 library support" ON IF (UNIX AND NOT ANDROID) )
|
||||
|
||||
# OpenCV build components
|
||||
# ===================================================
|
||||
@@ -202,8 +222,7 @@ OCV_OPTION(BUILD_WITH_DEBUG_INFO "Include debug info into debug libs (not MSC
|
||||
OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of staticaly linked CRT for staticaly linked OpenCV" ON IF MSVC )
|
||||
OCV_OPTION(BUILD_WITH_DYNAMIC_IPP "Enables dynamic linking of IPP (only for standalone IPP)" OFF )
|
||||
OCV_OPTION(BUILD_FAT_JAVA_LIB "Create fat java wrapper containing the whole OpenCV library" ON IF NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX )
|
||||
OCV_OPTION(BUILD_ANDROID_SERVICE "Build OpenCV Manager for Google Play" OFF IF ANDROID AND ANDROID_SOURCE_TREE )
|
||||
OCV_OPTION(BUILD_ANDROID_PACKAGE "Build platform-specific package for Google Play" OFF IF ANDROID )
|
||||
OCV_OPTION(BUILD_ANDROID_SERVICE "Build OpenCV Manager for Google Play" OFF IF ANDROID )
|
||||
OCV_OPTION(BUILD_CUDA_STUBS "Build CUDA modules stubs when no CUDA SDK" OFF IF (NOT IOS) )
|
||||
|
||||
# 3rd party libs
|
||||
@@ -488,7 +507,7 @@ include(cmake/OpenCVModule.cmake)
|
||||
# Detect endianness of build platform
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL iOS)
|
||||
if(IOS)
|
||||
# test_big_endian needs try_compile, which doesn't work for iOS
|
||||
# http://public.kitware.com/Bug/view.php?id=12288
|
||||
set(WORDS_BIGENDIAN 0)
|
||||
@@ -618,14 +637,6 @@ if(ANDROID)
|
||||
add_subdirectory(platforms/android/service)
|
||||
endif()
|
||||
|
||||
if(BUILD_ANDROID_PACKAGE)
|
||||
add_subdirectory(platforms/android/package)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
add_subdirectory(platforms/android/libinfo)
|
||||
endif()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Finalization: generate configuration-based files
|
||||
# ----------------------------------------------------------------------------
|
||||
@@ -750,6 +761,11 @@ else()
|
||||
endif()
|
||||
status(" Precompiled headers:" PCHSupport_FOUND AND ENABLE_PRECOMPILED_HEADERS THEN YES ELSE NO)
|
||||
|
||||
# ========================== Dependencies ============================
|
||||
ocv_get_all_libs(deps_modules deps_extra deps_3rdparty)
|
||||
status(" Extra dependencies:" ${deps_extra})
|
||||
status(" 3rdparty dependencies:" ${deps_3rdparty})
|
||||
|
||||
# ========================== OpenCV modules ==========================
|
||||
status("")
|
||||
status(" OpenCV modules:")
|
||||
@@ -792,7 +808,7 @@ if(ANDROID)
|
||||
status(" Android toolchain:" "${ANDROID_STANDALONE_TOOLCHAIN}")
|
||||
endif()
|
||||
status(" android tool:" ANDROID_EXECUTABLE THEN "${ANDROID_EXECUTABLE} (${ANDROID_TOOLS_Pkg_Desc})" ELSE NO)
|
||||
status(" Google Play package:" BUILD_ANDROID_PACKAGE THEN YES ELSE NO)
|
||||
status(" Google Play manager:" BUILD_ANDROID_SERVICE THEN YES ELSE NO)
|
||||
status(" Android examples:" BUILD_ANDROID_EXAMPLES AND CAN_BUILD_ANDROID_PROJECTS THEN YES ELSE NO)
|
||||
endif()
|
||||
|
||||
@@ -890,7 +906,7 @@ else()
|
||||
endif()
|
||||
|
||||
if( WITH_GDAL )
|
||||
status(" GDAL:" GDAL_FOUND THEN "${GDAL_LIBRARY}")
|
||||
status(" GDAL:" GDAL_FOUND THEN "${GDAL_LIBRARY}" ELSE "NO")
|
||||
else()
|
||||
status(" GDAL:" "NO")
|
||||
endif()
|
||||
@@ -908,15 +924,6 @@ if(DEFINED WITH_1394)
|
||||
status(" DC1394 2.x:" HAVE_DC1394_2 THEN "YES (ver ${ALIASOF_libdc1394-2_VERSION})" ELSE NO)
|
||||
endif(DEFINED WITH_1394)
|
||||
|
||||
if(ANDROID)
|
||||
if(HAVE_opencv_androidcamera)
|
||||
status(" AndroidNativeCamera:" BUILD_ANDROID_CAMERA_WRAPPER
|
||||
THEN "YES, build for Android${ANDROID_VERSION}" ELSE "YES, use prebuilt libraries")
|
||||
else()
|
||||
status(" AndroidNativeCamera:" "NO (native camera requires Android API level 8 or higher)")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED WITH_AVFOUNDATION)
|
||||
status(" AVFoundation:" WITH_AVFOUNDATION THEN YES ELSE NO)
|
||||
endif(DEFINED WITH_AVFOUNDATION)
|
||||
@@ -1014,6 +1021,10 @@ if(DEFINED WITH_INTELPERC)
|
||||
status(" Intel PerC:" HAVE_INTELPERC THEN "YES" ELSE NO)
|
||||
endif(DEFINED WITH_INTELPERC)
|
||||
|
||||
if(DEFINED WITH_GPHOTO2)
|
||||
status(" gPhoto2:" HAVE_GPHOTO2 THEN "YES" ELSE NO)
|
||||
endif(DEFINED WITH_GPHOTO2)
|
||||
|
||||
|
||||
# ========================== Other third-party libraries ==========================
|
||||
status("")
|
||||
@@ -1039,6 +1050,7 @@ status(" Use OpenMP:" HAVE_OPENMP THEN YES ELSE NO)
|
||||
status(" Use GCD" HAVE_GCD THEN YES ELSE NO)
|
||||
status(" Use Concurrency" HAVE_CONCURRENCY THEN YES ELSE NO)
|
||||
status(" Use C=:" HAVE_CSTRIPES THEN YES ELSE NO)
|
||||
status(" Use pthreads for parallel for:" HAVE_PTHREADS_PF THEN YES ELSE NO)
|
||||
status(" Use Cuda:" HAVE_CUDA THEN "YES (ver ${CUDA_VERSION_STRING})" ELSE NO)
|
||||
status(" Use OpenCL:" HAVE_OPENCL THEN YES ELSE NO)
|
||||
|
||||
|
||||
@@ -54,8 +54,10 @@ bool CvCascadeImageReader::NegReader::nextImg()
|
||||
for( size_t i = 0; i < count; i++ )
|
||||
{
|
||||
src = imread( imgFilenames[last++], 0 );
|
||||
if( src.empty() )
|
||||
if( src.empty() ){
|
||||
last %= count;
|
||||
continue;
|
||||
}
|
||||
round += last / count;
|
||||
round = round % (winSize.width * winSize.height);
|
||||
last %= count;
|
||||
|
||||
+12
-2
@@ -619,6 +619,8 @@ if(DEFINED CUDA_TARGET_CPU_ARCH)
|
||||
set(_cuda_target_cpu_arch_initial "${CUDA_TARGET_CPU_ARCH}")
|
||||
elseif(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|ARM)")
|
||||
set(_cuda_target_cpu_arch_initial "ARM")
|
||||
elseif(CUDA_VERSION VERSION_GREATER "6.5" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|AARCH64)")
|
||||
set(_cuda_target_cpu_arch_initial "AARCH64")
|
||||
else()
|
||||
set(_cuda_target_cpu_arch_initial "")
|
||||
endif()
|
||||
@@ -643,6 +645,12 @@ elseif(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND "${CUDA_T
|
||||
elseif(EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
|
||||
set(_cuda_target_triplet_initial "armv7-linux-gnueabihf")
|
||||
endif()
|
||||
elseif(CUDA_VERSION VERSION_GREATER "6.5" AND CMAKE_CROSSCOMPILING AND "${CUDA_TARGET_CPU_ARCH}" STREQUAL "AARCH64")
|
||||
if("${CUDA_TARGET_OS_VARIANT}" STREQUAL "Android" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/aarch64-linux-androideabi")
|
||||
set(_cuda_target_triplet_initial "aarch64-linux-androideabi")
|
||||
elseif(EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/aarch64-linux-gnueabihf")
|
||||
set(_cuda_target_triplet_initial "aarch64-linux-gnueabihf")
|
||||
endif()
|
||||
endif()
|
||||
set(CUDA_TARGET_TRIPLET "${_cuda_target_triplet_initial}" CACHE STRING "Specify the target triplet for which the input files must be compiled.")
|
||||
file(GLOB __cuda_available_target_tiplets RELATIVE "${CUDA_TOOLKIT_ROOT_DIR}/targets" "${CUDA_TOOLKIT_ROOT_DIR}/targets/*" )
|
||||
@@ -1094,8 +1102,10 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
||||
set(nvcc_flags ${nvcc_flags} -m32)
|
||||
endif()
|
||||
|
||||
if(CUDA_TARGET_CPU_ARCH)
|
||||
set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}")
|
||||
if(CUDA_TARGET_CPU_ARCH AND CUDA_VERSION VERSION_LESS "7.0")
|
||||
# CPU architecture is either ARM or X86. Patch AARCH64 to be ARM
|
||||
string(REPLACE "AARCH64" "ARM" CUDA_TARGET_CPU_ARCH_patched ${CUDA_TARGET_CPU_ARCH})
|
||||
set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH_patched}")
|
||||
endif()
|
||||
|
||||
if(CUDA_TARGET_OS_VARIANT AND CUDA_VERSION VERSION_LESS "7.0")
|
||||
|
||||
@@ -98,6 +98,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_extra_compiler_option(-pthread)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_CLANGCXX)
|
||||
add_extra_compiler_option(-Qunused-arguments)
|
||||
endif()
|
||||
|
||||
if(OPENCV_WARNINGS_ARE_ERRORS)
|
||||
add_extra_compiler_option(-Werror)
|
||||
endif()
|
||||
@@ -127,6 +131,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
endif()
|
||||
if(ENABLE_SSE2)
|
||||
add_extra_compiler_option(-msse2)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-sse2)
|
||||
endif()
|
||||
if(ENABLE_NEON)
|
||||
add_extra_compiler_option("-mfpu=neon")
|
||||
@@ -139,6 +145,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(NOT MINGW)
|
||||
if(ENABLE_AVX)
|
||||
add_extra_compiler_option(-mavx)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-avx)
|
||||
endif()
|
||||
if(ENABLE_AVX2)
|
||||
add_extra_compiler_option(-mavx2)
|
||||
@@ -152,18 +160,26 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(NOT OPENCV_EXTRA_CXX_FLAGS MATCHES "-mavx")
|
||||
if(ENABLE_SSE3)
|
||||
add_extra_compiler_option(-msse3)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-sse3)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SSSE3)
|
||||
add_extra_compiler_option(-mssse3)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-ssse3)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SSE41)
|
||||
add_extra_compiler_option(-msse4.1)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-sse4.1)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SSE42)
|
||||
add_extra_compiler_option(-msse4.2)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-sse4.2)
|
||||
endif()
|
||||
|
||||
if(ENABLE_POPCNT)
|
||||
@@ -265,6 +281,11 @@ if(MSVC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC12 AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /FS")
|
||||
set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} /FS")
|
||||
endif()
|
||||
|
||||
# Extra link libs if the user selects building static libs:
|
||||
if(NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX AND NOT ANDROID)
|
||||
# Android does not need these settings because they are already set by toolchain file
|
||||
|
||||
@@ -82,6 +82,8 @@ if(MSVC)
|
||||
set(OpenCV_RUNTIME vc11)
|
||||
elseif(MSVC_VERSION EQUAL 1800)
|
||||
set(OpenCV_RUNTIME vc12)
|
||||
elseif(MSVC_VERSION EQUAL 1900)
|
||||
set(OpenCV_RUNTIME vc14)
|
||||
endif()
|
||||
elseif(MINGW)
|
||||
set(OpenCV_RUNTIME mingw)
|
||||
|
||||
@@ -180,7 +180,7 @@ unset(__android_project_chain CACHE)
|
||||
# add_android_project(target_name ${path} NATIVE_DEPS opencv_core LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11)
|
||||
macro(add_android_project target path)
|
||||
# parse arguments
|
||||
set(android_proj_arglist NATIVE_DEPS LIBRARY_DEPS SDK_TARGET IGNORE_JAVA IGNORE_MANIFEST)
|
||||
set(android_proj_arglist NATIVE_DEPS LIBRARY_DEPS SDK_TARGET IGNORE_JAVA IGNORE_MANIFEST COPY_LIBS)
|
||||
set(__varname "android_proj_")
|
||||
foreach(v ${android_proj_arglist})
|
||||
set(${__varname}${v} "")
|
||||
@@ -334,14 +334,17 @@ macro(add_android_project target path)
|
||||
add_dependencies(${target} ${android_proj_native_deps})
|
||||
endif()
|
||||
|
||||
if(ANDROID_EXAMPLES_WITH_LIBS)
|
||||
if (android_proj_COPY_LIBS OR ANDROID_EXAMPLES_WITH_LIBS)
|
||||
message(STATUS "Android project with libs: " ${target})
|
||||
add_custom_target(
|
||||
${target}_copy_libs
|
||||
COMMAND ${CMAKE_COMMAND} -DSRC_DIR=${OpenCV_BINARY_DIR}/lib -DDST_DIR=${android_proj_bin_dir}/libs -P ${OpenCV_SOURCE_DIR}/cmake/copyAndroidLibs.cmake
|
||||
WORKING_DIRECTORY ${OpenCV_BINARY_DIR}/lib
|
||||
DEPENDS "${OpenCV_BINARY_DIR}/bin/classes.jar.dephelper" opencv_java
|
||||
)
|
||||
add_dependencies(${target} ${target}_copy_libs)
|
||||
if (ANDROID_EXAMPLES_WITH_LIBS)
|
||||
add_dependencies(${target}_copy_libs "${OpenCV_BINARY_DIR}/bin/classes.jar.dephelper" opencv_java)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(__android_project_chain)
|
||||
|
||||
@@ -84,7 +84,7 @@ if(CUDA_FOUND)
|
||||
set(__cuda_arch_bin "3.2")
|
||||
set(__cuda_arch_ptx "")
|
||||
elseif(AARCH64)
|
||||
set(__cuda_arch_bin "5.2")
|
||||
set(__cuda_arch_bin "5.3")
|
||||
set(__cuda_arch_ptx "")
|
||||
endif()
|
||||
else()
|
||||
|
||||
@@ -114,7 +114,7 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
|
||||
endif()
|
||||
|
||||
|
||||
# Similar code is existed in OpenCVConfig.cmake
|
||||
# Similar code exists in OpenCVConfig.cmake
|
||||
if(NOT DEFINED OpenCV_STATIC)
|
||||
# look for global setting
|
||||
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
|
||||
@@ -143,6 +143,8 @@ if(MSVC)
|
||||
set(OpenCV_RUNTIME vc11)
|
||||
elseif(MSVC_VERSION EQUAL 1800)
|
||||
set(OpenCV_RUNTIME vc12)
|
||||
elseif(MSVC_VERSION EQUAL 1900)
|
||||
set(OpenCV_RUNTIME vc14)
|
||||
endif()
|
||||
elseif(MINGW)
|
||||
set(OpenCV_RUNTIME mingw)
|
||||
|
||||
@@ -37,7 +37,7 @@ function(find_python preferred_version min_version library_env include_dir_env
|
||||
# standard FindPythonInterp always prefers executable from system path
|
||||
# this is really important because we are using the interpreter for numpy search and for choosing the install location
|
||||
foreach(_CURRENT_VERSION ${Python_ADDITIONAL_VERSIONS} "${preferred_version}" "${min_version}")
|
||||
find_host_program(executable
|
||||
find_host_program(PYTHON_EXECUTABLE
|
||||
NAMES python${_CURRENT_VERSION} python
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\${_CURRENT_VERSION}\\\\InstallPath]
|
||||
|
||||
@@ -148,7 +148,7 @@ macro(ipp_detect_version)
|
||||
list(APPEND IPP_LIBRARIES ipp${name})
|
||||
# CMake doesn't support "install(TARGETS ${IPP_PREFIX}${name} " command with imported targets
|
||||
install(FILES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||
DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
||||
DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
string(TOUPPER ${name} uname)
|
||||
set(IPP${uname}_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_3P_LIB_INSTALL_PATH}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}" CACHE INTERNAL "" FORCE)
|
||||
set(IPP${uname}_LOCATION_PATH "${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}" CACHE INTERNAL "" FORCE)
|
||||
|
||||
@@ -208,5 +208,6 @@ if(WITH_GDAL)
|
||||
set(HAVE_GDAL NO)
|
||||
else()
|
||||
set(HAVE_GDAL YES)
|
||||
ocv_include_directories(${GDAL_INCLUDE_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -93,8 +93,25 @@ else()
|
||||
set(HAVE_CSTRIPES 0)
|
||||
endif()
|
||||
|
||||
# --- GCD ---
|
||||
if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
set(HAVE_GCD 1)
|
||||
else()
|
||||
set(HAVE_GCD 0)
|
||||
endif()
|
||||
|
||||
# --- Concurrency ---
|
||||
if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/concurrencytest.cpp")
|
||||
file(WRITE "${_fname}" "#if _MSC_VER < 1600\n#error\n#endif\nint main() { return 0; }\n")
|
||||
try_compile(HAVE_CONCURRENCY "${CMAKE_BINARY_DIR}" "${_fname}")
|
||||
file(REMOVE "${_fname}")
|
||||
else()
|
||||
set(HAVE_CONCURRENCY 0)
|
||||
endif()
|
||||
|
||||
# --- OpenMP ---
|
||||
if(WITH_OPENMP AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
if(WITH_OPENMP)
|
||||
find_package(OpenMP)
|
||||
if(OPENMP_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
@@ -103,19 +120,12 @@ if(WITH_OPENMP AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
|
||||
set(HAVE_OPENMP "${OPENMP_FOUND}")
|
||||
endif()
|
||||
|
||||
# --- GCD ---
|
||||
if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
|
||||
set(HAVE_GCD 1)
|
||||
if(UNIX OR ANDROID)
|
||||
if(NOT APPLE AND NOT HAVE_TBB AND NOT HAVE_OPENMP)
|
||||
set(HAVE_PTHREADS_PF 1)
|
||||
else()
|
||||
set(HAVE_GCD 0)
|
||||
set(HAVE_PTHREADS_PF 0)
|
||||
endif()
|
||||
|
||||
# --- Concurrency ---
|
||||
if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP)
|
||||
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/concurrencytest.cpp")
|
||||
file(WRITE "${_fname}" "#if _MSC_VER < 1600\n#error\n#endif\nint main() { return 0; }\n")
|
||||
try_compile(HAVE_CONCURRENCY "${CMAKE_BINARY_DIR}" "${_fname}")
|
||||
file(REMOVE "${_fname}")
|
||||
else()
|
||||
set(HAVE_CONCURRENCY 0)
|
||||
set(HAVE_PTHREADS_PF 0)
|
||||
endif()
|
||||
|
||||
@@ -216,49 +216,55 @@ if(WITH_FFMPEG)
|
||||
# Do an other trial
|
||||
FIND_FILE(BZIP2_LIBRARIES NAMES libbz2.so.1 PATHS /lib)
|
||||
endif()
|
||||
endif(HAVE_FFMPEG)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
find_path(FFMPEG_INCLUDE_DIR "libavformat/avformat.h"
|
||||
PATHS /usr/local /usr /opt
|
||||
PATH_SUFFIXES include
|
||||
DOC "The path to FFMPEG headers")
|
||||
if(FFMPEG_INCLUDE_DIR)
|
||||
set(HAVE_GENTOO_FFMPEG TRUE)
|
||||
set(FFMPEG_LIB_DIR "${FFMPEG_INCLUDE_DIR}/../lib" CACHE PATH "Full path of FFMPEG library directory")
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavcodec.a")
|
||||
set(HAVE_FFMPEG_CODEC 1)
|
||||
set(ALIASOF_libavcodec_VERSION "Unknown")
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavformat.a")
|
||||
else()
|
||||
find_path(FFMPEG_INCLUDE_DIR "libavformat/avformat.h"
|
||||
PATHS /usr/local /usr /opt
|
||||
PATH_SUFFIXES include
|
||||
DOC "The path to FFMPEG headers")
|
||||
if(FFMPEG_INCLUDE_DIR)
|
||||
set(HAVE_GENTOO_FFMPEG TRUE)
|
||||
set(FFMPEG_LIB_DIR "${FFMPEG_INCLUDE_DIR}/../lib" CACHE PATH "Full path of FFMPEG library directory")
|
||||
find_library(FFMPEG_CODEC_LIB "avcodec" HINTS "${FFMPEG_LIB_DIR}")
|
||||
find_library(FFMPEG_FORMAT_LIB "avformat" HINTS "${FFMPEG_LIB_DIR}")
|
||||
find_library(FFMPEG_UTIL_LIB "avutil" HINTS "${FFMPEG_LIB_DIR}")
|
||||
find_library(FFMPEG_SWSCALE_LIB "swscale" HINTS "${FFMPEG_LIB_DIR}")
|
||||
find_library(FFMPEG_RESAMPLE_LIB "avresample" HINTS "${FFMPEG_LIB_DIR}")
|
||||
if(FFMPEG_CODEC_LIB)
|
||||
set(HAVE_FFMPEG_CODEC 1)
|
||||
endif()
|
||||
if(FFMPEG_FORMAT_LIB)
|
||||
set(HAVE_FFMPEG_FORMAT 1)
|
||||
endif()
|
||||
if(FFMPEG_UTIL_LIB)
|
||||
set(HAVE_FFMPEG_UTIL 1)
|
||||
endif()
|
||||
if(FFMPEG_SWSCALE_LIB)
|
||||
set(HAVE_FFMPEG_SWSCALE 1)
|
||||
endif()
|
||||
if(FFMPEG_CODEC_LIB AND FFMPEG_FORMAT_LIB AND
|
||||
FFMPEG_UTIL_LIB AND FFMPEG_SWSCALE_LIB)
|
||||
set(ALIASOF_libavcodec_VERSION "Unknown")
|
||||
set(ALIASOF_libavformat_VERSION "Unknown")
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavutil.a")
|
||||
set(HAVE_FFMPEG_UTIL 1)
|
||||
set(ALIASOF_libavutil_VERSION "Unknown")
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libswscale.a")
|
||||
set(HAVE_FFMPEG_SWSCALE 1)
|
||||
set(ALIASOF_libswscale_VERSION "Unknown")
|
||||
set(HAVE_FFMPEG 1)
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavresample.a")
|
||||
set(HAVE_FFMPEG_RESAMPLE 1)
|
||||
set(ALIASOF_libavresample_VERSION "Unknown")
|
||||
endif()
|
||||
endif()
|
||||
set(ALIASOF_libavutil_VERSION "Unknown")
|
||||
set(ALIASOF_libswscale_VERSION "Unknown")
|
||||
set(HAVE_FFMPEG 1)
|
||||
if(FFMPEG_RESAMPLE_LIB)
|
||||
set(HAVE_FFMPEG_RESAMPLE 1)
|
||||
set(ALIASOF_libavresample_VERSION "Unknown")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif(FFMPEG_INCLUDE_DIR)
|
||||
if(HAVE_FFMPEG)
|
||||
set(VIDEOIO_LIBRARIES ${VIDEOIO_LIBRARIES} "${FFMPEG_LIB_DIR}/libavcodec.a"
|
||||
"${FFMPEG_LIB_DIR}/libavformat.a" "${FFMPEG_LIB_DIR}/libavutil.a"
|
||||
"${FFMPEG_LIB_DIR}/libswscale.a")
|
||||
if(HAVE_FFMPEG_RESAMPLE)
|
||||
endif(FFMPEG_INCLUDE_DIR)
|
||||
if(HAVE_FFMPEG)
|
||||
set(VIDEOIO_LIBRARIES ${VIDEOIO_LIBRARIES} "${FFMPEG_LIB_DIR}/libavcodec.a"
|
||||
"${FFMPEG_LIB_DIR}/libavformat.a" "${FFMPEG_LIB_DIR}/libavutil.a"
|
||||
"${FFMPEG_LIB_DIR}/libswscale.a")
|
||||
if(HAVE_FFMPEG_RESAMPLE)
|
||||
set(VIDEOIO_LIBRARIES ${VIDEOIO_LIBRARIES} "${FFMPEG_LIB_DIR}/libavresample.a")
|
||||
endif()
|
||||
ocv_include_directories(${FFMPEG_INCLUDE_DIR})
|
||||
endif()
|
||||
ocv_include_directories(${FFMPEG_INCLUDE_DIR})
|
||||
endif(HAVE_FFMPEG)
|
||||
endif()
|
||||
endif(APPLE)
|
||||
endif()
|
||||
endif(WITH_FFMPEG)
|
||||
|
||||
# --- VideoInput/DirectShow ---
|
||||
@@ -305,3 +311,9 @@ endif()
|
||||
if(WITH_INTELPERC)
|
||||
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIntelPerCSDK.cmake")
|
||||
endif(WITH_INTELPERC)
|
||||
|
||||
# --- gPhoto2 ---
|
||||
ocv_clear_vars(HAVE_GPHOTO2)
|
||||
if(WITH_GPHOTO2)
|
||||
CHECK_MODULE(libgphoto2 HAVE_GPHOTO2)
|
||||
endif(WITH_GPHOTO2)
|
||||
|
||||
@@ -19,29 +19,6 @@ if(ANDROID)
|
||||
set(OPENCV_STATIC_LIBTYPE_CONFIGMAKE ${OPENCV_LIBTYPE_CONFIGMAKE})
|
||||
endif()
|
||||
|
||||
# setup lists of camera libs
|
||||
foreach(abi ARMEABI ARMEABI_V7A X86 MIPS)
|
||||
ANDROID_GET_ABI_RAWNAME(${abi} ndkabi)
|
||||
if(BUILD_ANDROID_CAMERA_WRAPPER)
|
||||
if(ndkabi STREQUAL ANDROID_NDK_ABI_NAME)
|
||||
set(OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE "native_camera_r${ANDROID_VERSION}")
|
||||
else()
|
||||
set(OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE "")
|
||||
endif()
|
||||
elseif(HAVE_opencv_androidcamera)
|
||||
set(OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE "")
|
||||
file(GLOB OPENCV_CAMERA_LIBS "${OpenCV_SOURCE_DIR}/3rdparty/lib/${ndkabi}/libnative_camera_r*.so")
|
||||
if(OPENCV_CAMERA_LIBS)
|
||||
list(SORT OPENCV_CAMERA_LIBS)
|
||||
endif()
|
||||
foreach(cam_lib ${OPENCV_CAMERA_LIBS})
|
||||
get_filename_component(cam_lib "${cam_lib}" NAME)
|
||||
string(REGEX REPLACE "lib(native_camera_r[0-9]+\\.[0-9]+\\.[0-9]+)\\.so" "\\1" cam_lib "${cam_lib}")
|
||||
set(OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE "${OPENCV_CAMERA_LIBS_${abi}_CONFIGCMAKE} ${cam_lib}")
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# build the list of opencv libs and dependencies for all modules
|
||||
ocv_get_all_libs(OPENCV_MODULES_CONFIGMAKE OPENCV_EXTRA_COMPONENTS_CONFIGMAKE OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE)
|
||||
|
||||
@@ -61,7 +38,7 @@ if(ANDROID)
|
||||
endforeach()
|
||||
|
||||
if(BUILD_FAT_JAVA_LIB)
|
||||
set(OPENCV_LIBS_CONFIGMAKE java)
|
||||
set(OPENCV_LIBS_CONFIGMAKE java3)
|
||||
else()
|
||||
set(OPENCV_LIBS_CONFIGMAKE "${OPENCV_MODULES_CONFIGMAKE}")
|
||||
endif()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# platform-specific config file
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h")
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/cvconfig.h")
|
||||
install(FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 COMPONENT dev)
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# opencv_modules.hpp based on actual modules list
|
||||
|
||||
@@ -8,71 +8,82 @@
|
||||
#
|
||||
# ${BIN_DIR}/unix-install/opencv.pc -> For use *with* "make install"
|
||||
# -------------------------------------------------------------------------------------------
|
||||
set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(exec_prefix "\${prefix}")
|
||||
set(libdir "") #TODO: need link paths for OpenCV_EXTRA_COMPONENTS
|
||||
set(includedir "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}")
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
set(ocv_optkind OPT)
|
||||
else()
|
||||
set(ocv_optkind DBG)
|
||||
endif()
|
||||
macro(fix_prefix lst isown)
|
||||
set(_lst)
|
||||
foreach(item ${${lst}})
|
||||
if(TARGET ${item})
|
||||
get_target_property(item "${item}" LOCATION_${CMAKE_BUILD_TYPE})
|
||||
if("${isown}")
|
||||
get_filename_component(item "${item}" NAME_WE)
|
||||
string(REGEX REPLACE "^lib(.*)" "\\1" item "${item}")
|
||||
endif()
|
||||
endif()
|
||||
if(item MATCHES "^-l")
|
||||
list(APPEND _lst "${item}")
|
||||
elseif(item MATCHES "[\\/]")
|
||||
get_filename_component(libdir "${item}" PATH)
|
||||
get_filename_component(libname "${item}" NAME_WE)
|
||||
string(REGEX REPLACE "^lib(.*)" "\\1" libname "${libname}")
|
||||
list(APPEND _lst "-L${libdir}" "-l${libname}")
|
||||
else()
|
||||
list(APPEND _lst "-l${item}")
|
||||
endif()
|
||||
endforeach()
|
||||
set(${lst} ${_lst})
|
||||
unset(_lst)
|
||||
endmacro()
|
||||
|
||||
#build the list of opencv libs and dependencies for all modules
|
||||
set(OpenCV_LIB_COMPONENTS "")
|
||||
set(OpenCV_EXTRA_COMPONENTS "")
|
||||
foreach(m ${OPENCV_MODULES_PUBLIC})
|
||||
list(INSERT OpenCV_LIB_COMPONENTS 0 ${${m}_MODULE_DEPS_${ocv_optkind}} ${m})
|
||||
if(${m}_EXTRA_DEPS_${ocv_optkind})
|
||||
list(INSERT OpenCV_EXTRA_COMPONENTS 0 ${${m}_EXTRA_DEPS_${ocv_optkind}})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
ocv_list_unique(OpenCV_LIB_COMPONENTS)
|
||||
ocv_list_unique(OpenCV_EXTRA_COMPONENTS)
|
||||
ocv_list_reverse(OpenCV_LIB_COMPONENTS)
|
||||
ocv_list_reverse(OpenCV_EXTRA_COMPONENTS)
|
||||
# build the list of opencv libs and dependencies for all modules
|
||||
ocv_get_all_libs(_modules _extra _3rdparty)
|
||||
|
||||
#build the list of components
|
||||
set(OpenCV_LIB_COMPONENTS_ "")
|
||||
foreach(CVLib ${OpenCV_LIB_COMPONENTS})
|
||||
if (TARGET ${CVLib})
|
||||
get_target_property(libpath ${CVLib} LOCATION_${CMAKE_BUILD_TYPE})
|
||||
get_filename_component(libname "${libpath}" NAME)
|
||||
|
||||
if(INSTALL_TO_MANGLED_PATHS)
|
||||
set(libname "${libname}.${OPENCV_VERSION}")
|
||||
endif()
|
||||
# Note:
|
||||
# when linking against static libraries, if libfoo depends on libbar, then
|
||||
# libfoo must come first in the linker flags.
|
||||
|
||||
#need better solution....
|
||||
if(libpath MATCHES "3rdparty")
|
||||
set(installDir "share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}")
|
||||
else()
|
||||
set(installDir "${OPENCV_LIB_INSTALL_PATH}")
|
||||
endif()
|
||||
|
||||
set(OpenCV_LIB_COMPONENTS_ "${OpenCV_LIB_COMPONENTS_} \${exec_prefix}/${installDir}/${libname}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# add extra dependencies required for OpenCV
|
||||
set(OpenCV_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS_})
|
||||
if(OpenCV_EXTRA_COMPONENTS)
|
||||
foreach(extra_component ${OpenCV_EXTRA_COMPONENTS})
|
||||
|
||||
if(extra_component MATCHES "^-[lL]" OR extra_component MATCHES "[\\/]")
|
||||
set(maybe_l_prefix "")
|
||||
else()
|
||||
set(maybe_l_prefix "-l")
|
||||
endif()
|
||||
|
||||
set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} ${maybe_l_prefix}${extra_component}")
|
||||
|
||||
endforeach()
|
||||
# world and contrib_world are special targets whose library should come first,
|
||||
# especially for static link.
|
||||
if(_modules MATCHES "opencv_world")
|
||||
set(_modules "opencv_world")
|
||||
endif()
|
||||
|
||||
if(_modules MATCHES "opencv_contrib_world")
|
||||
list(REMOVE_ITEM _modules "opencv_contrib_world")
|
||||
list(INSERT _modules 0 "opencv_contrib_world")
|
||||
endif()
|
||||
|
||||
fix_prefix(_modules TRUE)
|
||||
fix_prefix(_extra FALSE)
|
||||
fix_prefix(_3rdparty TRUE)
|
||||
|
||||
ocv_list_unique(_modules)
|
||||
ocv_list_unique(_extra)
|
||||
ocv_list_unique(_3rdparty)
|
||||
|
||||
set(OPENCV_PC_LIBS
|
||||
"-L\${exec_prefix}/${OPENCV_LIB_INSTALL_PATH}"
|
||||
"${_modules}"
|
||||
)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(OPENCV_PC_LIBS_PRIVATE "${_extra}")
|
||||
else()
|
||||
set(OPENCV_PC_LIBS_PRIVATE
|
||||
"-L\${exec_prefix}/${OPENCV_3P_LIB_INSTALL_PATH}"
|
||||
"${_3rdparty}"
|
||||
"${_extra}"
|
||||
)
|
||||
endif()
|
||||
string(REPLACE ";" " " OPENCV_PC_LIBS "${OPENCV_PC_LIBS}")
|
||||
string(REPLACE ";" " " OPENCV_PC_LIBS_PRIVATE "${OPENCV_PC_LIBS_PRIVATE}")
|
||||
|
||||
#generate the .pc file
|
||||
set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(exec_prefix "\${prefix}")
|
||||
set(libdir "\${exec_prefix}/${OPENCV_LIB_INSTALL_PATH}")
|
||||
set(includedir "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}")
|
||||
|
||||
if(INSTALL_TO_MANGLED_PATHS)
|
||||
set(OPENCV_PC_FILE_NAME "opencv-${OPENCV_VERSION}.pc")
|
||||
else()
|
||||
|
||||
@@ -782,9 +782,14 @@ macro(_ocv_create_module)
|
||||
|
||||
ocv_install_target(${the_module} EXPORT OpenCVModules OPTIONAL
|
||||
RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs
|
||||
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT libs
|
||||
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT libs NAMELINK_SKIP
|
||||
ARCHIVE DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT dev
|
||||
)
|
||||
get_target_property(_target_type ${the_module} TYPE)
|
||||
if("${_target_type}" STREQUAL "SHARED_LIBRARY")
|
||||
install(TARGETS ${the_module}
|
||||
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT dev NAMELINK_ONLY)
|
||||
endif()
|
||||
|
||||
foreach(m ${OPENCV_MODULE_${the_module}_CHILDREN} ${the_module})
|
||||
# only "public" headers need to be installed
|
||||
|
||||
@@ -78,8 +78,22 @@ set(CPACK_COMPONENT_TESTS_DEPENDS libs)
|
||||
|
||||
if(HAVE_CUDA)
|
||||
string(REPLACE "." "-" cuda_version_suffix ${CUDA_VERSION})
|
||||
set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_DEV_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
|
||||
if(${CUDA_VERSION} VERSION_LESS "6.5")
|
||||
set(CPACK_DEB_libs_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_dev_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
|
||||
else()
|
||||
set(CPACK_DEB_libs_PACKAGE_DEPENDS "cuda-cudart-${cuda_version_suffix}, cuda-npp-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_dev_PACKAGE_DEPENDS "cuda-cudart-dev-${cuda_version_suffix}, cuda-npp-dev-${cuda_version_suffix}")
|
||||
if(HAVE_CUFFT)
|
||||
set(CPACK_DEB_libs_PACKAGE_DEPENDS "${CPACK_DEB_libs_PACKAGE_DEPENDS}, cuda-cufft-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_dev_PACKAGE_DEPENDS "${CPACK_DEB_dev_PACKAGE_DEPENDS}, cuda-cufft-dev-${cuda_version_suffix}")
|
||||
endif()
|
||||
if(HAVE_HAVE_CUBLAS)
|
||||
set(CPACK_DEB_libs_PACKAGE_DEPENDS "${CPACK_DEB_libs_PACKAGE_DEPENDS}, cuda-cublas-${cuda_version_suffix}")
|
||||
set(CPACK_DEB_dev_PACKAGE_DEPENDS "${CPACK_DEB_dev_PACKAGE_DEPENDS}, cuda-cublas-dev-${cuda_version_suffix}")
|
||||
endif()
|
||||
endif()
|
||||
set(CPACK_COMPONENT_dev_DEPENDS libs)
|
||||
endif()
|
||||
|
||||
if(NOT OPENCV_CUSTOM_PACKAGE_INFO)
|
||||
|
||||
+16
-1
@@ -796,11 +796,19 @@ macro(ocv_get_all_libs _modules _extra _3rdparty)
|
||||
set(${_3rdparty} "")
|
||||
foreach(m ${OPENCV_MODULES_PUBLIC})
|
||||
get_target_property(deps ${m} INTERFACE_LINK_LIBRARIES)
|
||||
if(NOT deps)
|
||||
set(deps "")
|
||||
endif()
|
||||
list(INSERT ${_modules} 0 ${deps} ${m})
|
||||
foreach (dep ${deps} ${OPENCV_LINKER_LIBS})
|
||||
if (NOT DEFINED OPENCV_MODULE_${dep}_LOCATION)
|
||||
if (TARGET ${dep})
|
||||
list(INSERT ${_3rdparty} 0 ${dep})
|
||||
get_target_property(_output ${dep} ARCHIVE_OUTPUT_DIRECTORY)
|
||||
if ("${_output}" STREQUAL "${3P_LIBRARY_OUTPUT_PATH}")
|
||||
list(INSERT ${_3rdparty} 0 ${dep})
|
||||
else()
|
||||
list(INSERT ${_extra} 0 ${dep})
|
||||
endif()
|
||||
else()
|
||||
list(INSERT ${_extra} 0 ${dep})
|
||||
endif()
|
||||
@@ -808,6 +816,13 @@ macro(ocv_get_all_libs _modules _extra _3rdparty)
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
# ippicv specific handling
|
||||
list(FIND ${_extra} "ippicv" ippicv_idx)
|
||||
if (${ippicv_idx} GREATER -1)
|
||||
list(REMOVE_ITEM ${_extra} "ippicv")
|
||||
list(INSERT ${_3rdparty} 0 "ippicv")
|
||||
endif()
|
||||
|
||||
# split 3rdparty libs and modules
|
||||
list(REMOVE_ITEM ${_modules} ${${_3rdparty}} ${${_extra}})
|
||||
|
||||
|
||||
@@ -54,23 +54,6 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OPENCV_CAMERA_MODULES),on)
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi)
|
||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARMEABI_CONFIGCMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_ARMEABI_V7A_CONFIGCMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_X86_CONFIGCMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),mips)
|
||||
OPENCV_CAMERA_MODULES:=@OPENCV_CAMERA_LIBS_MIPS_CONFIGCMAKE@
|
||||
endif
|
||||
else
|
||||
OPENCV_CAMERA_MODULES:=
|
||||
endif
|
||||
|
||||
ifeq ($(OPENCV_LIB_TYPE),SHARED)
|
||||
OPENCV_LIB_SUFFIX:=so
|
||||
else
|
||||
@@ -92,20 +75,12 @@ define add_opencv_3rdparty_component
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
endef
|
||||
|
||||
define add_opencv_camera_module
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE:=$1
|
||||
LOCAL_SRC_FILES:=$(OPENCV_LIBS_DIR)/lib$1.so
|
||||
include $(PREBUILT_SHARED_LIBRARY)
|
||||
endef
|
||||
|
||||
ifeq ($(OPENCV_MK_$(OPENCV_TARGET_ARCH_ABI)_ALREADY_INCLUDED),)
|
||||
ifeq ($(OPENCV_INSTALL_MODULES),on)
|
||||
$(foreach module,$(OPENCV_LIBS),$(eval $(call add_opencv_module,$(module))))
|
||||
endif
|
||||
|
||||
$(foreach module,$(OPENCV_3RDPARTY_COMPONENTS),$(eval $(call add_opencv_3rdparty_component,$(module))))
|
||||
$(foreach module,$(OPENCV_CAMERA_MODULES),$(eval $(call add_opencv_camera_module,$(module))))
|
||||
|
||||
ifneq ($(OPENCV_BASEDIR),)
|
||||
OPENCV_LOCAL_C_INCLUDES += $(foreach mod, $(OPENCV_MODULES), $(OPENCV_BASEDIR)/modules/$(mod)/include)
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
# - OpenCV_LIB_COMPONENTS : Present OpenCV modules list
|
||||
# - OpenCV_USE_MANGLED_PATHS : Mangled OpenCV path flag
|
||||
# - OpenCV_MODULES_SUFFIX : The suffix for OpenCVModules-XXX.cmake file
|
||||
# - OpenCV_HAVE_ANDROID_CAMERA : Presence of Android native camera wrappers
|
||||
#
|
||||
# Deprecated variables:
|
||||
# - OpenCV_VERSION_TWEAK : Always "0"
|
||||
@@ -77,6 +76,13 @@ if("@USE_IPPICV@" STREQUAL "TRUE") # value is defined by package builder (use ST
|
||||
endif()
|
||||
|
||||
if(NOT TARGET opencv_core)
|
||||
# Extract directory name from full path of the file currently being processed.
|
||||
# Note that CMake 2.8.3 introduced CMAKE_CURRENT_LIST_DIR. We reimplement it
|
||||
# for older versions of CMake to support these as well.
|
||||
if(CMAKE_VERSION VERSION_LESS "2.8.3")
|
||||
get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
endif()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${OpenCV_MODULES_SUFFIX}.cmake)
|
||||
endif()
|
||||
|
||||
@@ -120,9 +126,6 @@ if(NOT WIN32 OR ANDROID)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Presence of Android native camera wrappers
|
||||
set(OpenCV_HAVE_ANDROID_CAMERA @HAVE_opencv_androidcamera@)
|
||||
|
||||
# ======================================================
|
||||
# Include directories to add to the user project:
|
||||
# ======================================================
|
||||
@@ -317,24 +320,6 @@ foreach(__opttype OPT DBG)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# ==============================================================
|
||||
# Android camera helper macro
|
||||
# ==============================================================
|
||||
if(OpenCV_HAVE_ANDROID_CAMERA)
|
||||
macro(COPY_NATIVE_CAMERA_LIBS target)
|
||||
get_target_property(target_location ${target} LOCATION)
|
||||
get_filename_component(target_location "${target_location}" PATH)
|
||||
file(GLOB camera_wrappers "${OpenCV_LIB_DIR_OPT}/libnative_camera_r*.so")
|
||||
foreach(wrapper ${camera_wrappers})
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${wrapper}" "${target_location}"
|
||||
)
|
||||
endforeach()
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
# ==============================================================
|
||||
# Compatibility stuff
|
||||
# ==============================================================
|
||||
|
||||
@@ -178,3 +178,6 @@
|
||||
/* Define if your processor stores words with the most significant byte
|
||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#cmakedefine WORDS_BIGENDIAN
|
||||
|
||||
/* gPhoto2 library */
|
||||
#cmakedefine HAVE_GPHOTO2
|
||||
|
||||
@@ -9,5 +9,6 @@ includedir_new=@includedir@
|
||||
Name: OpenCV
|
||||
Description: Open Source Computer Vision Library
|
||||
Version: @OPENCV_VERSION_PLAIN@
|
||||
Libs: @OpenCV_LIB_COMPONENTS@
|
||||
Libs: @OPENCV_PC_LIBS@
|
||||
Libs.private: @OPENCV_PC_LIBS_PRIVATE@
|
||||
Cflags: -I${includedir_old} -I${includedir_new}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
+2
-3
@@ -111,12 +111,11 @@ if(BUILD_DOCS AND DOXYGEN_FOUND)
|
||||
set(faqfile "${CMAKE_CURRENT_SOURCE_DIR}/faq.markdown")
|
||||
set(tutorial_path "${CMAKE_CURRENT_SOURCE_DIR}/tutorials")
|
||||
set(tutorial_py_path "${CMAKE_CURRENT_SOURCE_DIR}/py_tutorials")
|
||||
set(user_guide_path "${CMAKE_CURRENT_SOURCE_DIR}/user_guide")
|
||||
set(example_path "${CMAKE_SOURCE_DIR}/samples")
|
||||
|
||||
# set export variables
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_INPUT_LIST "${rootfile} ; ${faqfile} ; ${paths_include} ; ${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${user_guide_path} ; ${paths_tutorial}")
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_IMAGE_PATH "${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${user_guide_path} ; ${paths_tutorial}")
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_INPUT_LIST "${rootfile} ; ${faqfile} ; ${paths_include} ; ${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${paths_tutorial}")
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_IMAGE_PATH "${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${paths_tutorial}")
|
||||
# TODO: remove paths_doc from EXAMPLE_PATH after face module tutorials/samples moved to separate folders
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_EXAMPLE_PATH "${example_path} ; ${paths_doc} ; ${paths_sample}")
|
||||
set(CMAKE_DOXYGEN_LAYOUT "${CMAKE_CURRENT_SOURCE_DIR}/DoxygenLayout.xml")
|
||||
|
||||
@@ -625,6 +625,14 @@
|
||||
pages = {430--443},
|
||||
publisher = {Springer}
|
||||
}
|
||||
@inproceedings{mair2010_agast,
|
||||
title={Adaptive and Generic Corner Detection Based on the Accelerated Segment Test"},
|
||||
author={"Elmar Mair and Gregory D. Hager and Darius Burschka and Michael Suppa and Gerhard Hirzinger"},
|
||||
year={"2010"},
|
||||
month={"September"},
|
||||
booktitle={"European Conference on Computer Vision (ECCV'10)"},
|
||||
url={"http://www6.in.tum.de/Main/ResearchAgast"
|
||||
}
|
||||
@ARTICLE{Rubner2000,
|
||||
author = {Rubner, Yossi and Tomasi, Carlo and Guibas, Leonidas J},
|
||||
title = {The earth mover's distance as a metric for image retrieval},
|
||||
|
||||
@@ -22,17 +22,17 @@ red line. All the expected straight lines are bulged out. Visit [Distortion
|
||||
|
||||

|
||||
|
||||
This distortion is solved as follows:
|
||||
This distortion is represented as follows:
|
||||
|
||||
\f[x_{corrected} = x( 1 + k_1 r^2 + k_2 r^4 + k_3 r^6) \\
|
||||
y_{corrected} = y( 1 + k_1 r^2 + k_2 r^4 + k_3 r^6)\f]
|
||||
\f[x_{distorted} = x( 1 + k_1 r^2 + k_2 r^4 + k_3 r^6) \\
|
||||
y_{distorted} = y( 1 + k_1 r^2 + k_2 r^4 + k_3 r^6)\f]
|
||||
|
||||
Similarly, another distortion is the tangential distortion which occurs because image taking lense
|
||||
is not aligned perfectly parallel to the imaging plane. So some areas in image may look nearer than
|
||||
expected. It is solved as below:
|
||||
expected. It is represented as below:
|
||||
|
||||
\f[x_{corrected} = x + [ 2p_1xy + p_2(r^2+2x^2)] \\
|
||||
y_{corrected} = y + [ p_1(r^2+ 2y^2)+ 2p_2xy]\f]
|
||||
\f[x_{distorted} = x + [ 2p_1xy + p_2(r^2+2x^2)] \\
|
||||
y_{distorted} = y + [ p_1(r^2+ 2y^2)+ 2p_2xy]\f]
|
||||
|
||||
In short, we need to find five parameters, known as distortion coefficients given by:
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ Object Tracking
|
||||
---------------
|
||||
|
||||
Now we know how to convert BGR image to HSV, we can use this to extract a colored object. In HSV, it
|
||||
is more easier to represent a color than RGB color-space. In our application, we will try to extract
|
||||
is more easier to represent a color than in BGR color-space. In our application, we will try to extract
|
||||
a blue colored object. So here is the method:
|
||||
|
||||
- Take each frame of the video
|
||||
@@ -89,7 +89,7 @@ just by moving your hand in front of camera and many other funny stuffs.
|
||||
How to find HSV values to track?
|
||||
--------------------------------
|
||||
|
||||
This is a common question found in [stackoverflow.com](www.stackoverflow.com). It is very simple and
|
||||
This is a common question found in [stackoverflow.com](http://www.stackoverflow.com). It is very simple and
|
||||
you can use the same function, cv2.cvtColor(). Instead of passing an image, you just pass the BGR
|
||||
values you want. For example, to find the HSV value of Green, try following commands in Python
|
||||
terminal:
|
||||
|
||||
@@ -85,7 +85,7 @@ Haar-cascade Detection in OpenCV
|
||||
|
||||
OpenCV comes with a trainer as well as detector. If you want to train your own classifier for any
|
||||
object like car, planes etc. you can use OpenCV to create one. Its full details are given here:
|
||||
[Cascade Classifier Training.](http://docs.opencv.org/doc/user_guide/ug_traincascade.html)
|
||||
[Cascade Classifier Training](@ref tutorial_traincascade).
|
||||
|
||||
Here we will deal with detection. OpenCV already contains many pre-trained classifiers for face,
|
||||
eyes, smile etc. Those XML files are stored in opencv/data/haarcascades/ folder. Let's create face
|
||||
|
||||
@@ -194,15 +194,15 @@ while(1):
|
||||
mag, ang = cv2.cartToPolar(flow[...,0], flow[...,1])
|
||||
hsv[...,0] = ang*180/np.pi/2
|
||||
hsv[...,2] = cv2.normalize(mag,None,0,255,cv2.NORM_MINMAX)
|
||||
rgb = cv2.cvtColor(hsv,cv2.COLOR_HSV2BGR)
|
||||
bgr = cv2.cvtColor(hsv,cv2.COLOR_HSV2BGR)
|
||||
|
||||
cv2.imshow('frame2',rgb)
|
||||
cv2.imshow('frame2',bgr)
|
||||
k = cv2.waitKey(30) & 0xff
|
||||
if k == 27:
|
||||
break
|
||||
elif k == ord('s'):
|
||||
cv2.imwrite('opticalfb.png',frame2)
|
||||
cv2.imwrite('opticalhsv.png',rgb)
|
||||
cv2.imwrite('opticalhsv.png',bgr)
|
||||
prvs = next
|
||||
|
||||
cap.release()
|
||||
|
||||
@@ -4,7 +4,6 @@ OpenCV modules {#mainpage}
|
||||
- @ref intro
|
||||
- @ref tutorial_root
|
||||
- @ref tutorial_py_root
|
||||
- @ref tutorial_user_guide
|
||||
- @ref faq
|
||||
- @ref citelist
|
||||
|
||||
|
||||
@@ -14,18 +14,18 @@ Theory
|
||||
For the distortion OpenCV takes into account the radial and tangential factors. For the radial
|
||||
factor one uses the following formula:
|
||||
|
||||
\f[x_{corrected} = x( 1 + k_1 r^2 + k_2 r^4 + k_3 r^6) \\
|
||||
y_{corrected} = y( 1 + k_1 r^2 + k_2 r^4 + k_3 r^6)\f]
|
||||
\f[x_{distorted} = x( 1 + k_1 r^2 + k_2 r^4 + k_3 r^6) \\
|
||||
y_{distorted} = y( 1 + k_1 r^2 + k_2 r^4 + k_3 r^6)\f]
|
||||
|
||||
So for an old pixel point at \f$(x,y)\f$ coordinates in the input image, its position on the corrected
|
||||
output image will be \f$(x_{corrected} y_{corrected})\f$. The presence of the radial distortion
|
||||
manifests in form of the "barrel" or "fish-eye" effect.
|
||||
So for an undistorted pixel point at \f$(x,y)\f$ coordinates, its position on the distorted image
|
||||
will be \f$(x_{distorted} y_{distorted})\f$. The presence of the radial distortion manifests in form
|
||||
of the "barrel" or "fish-eye" effect.
|
||||
|
||||
Tangential distortion occurs because the image taking lenses are not perfectly parallel to the
|
||||
imaging plane. It can be corrected via the formulas:
|
||||
imaging plane. It can be represented via the formulas:
|
||||
|
||||
\f[x_{corrected} = x + [ 2p_1xy + p_2(r^2+2x^2)] \\
|
||||
y_{corrected} = y + [ p_1(r^2+ 2y^2)+ 2p_2xy]\f]
|
||||
\f[x_{distorted} = x + [ 2p_1xy + p_2(r^2+2x^2)] \\
|
||||
y_{distorted} = y + [ p_1(r^2+ 2y^2)+ 2p_2xy]\f]
|
||||
|
||||
So we have five distortion parameters which in OpenCV are presented as one row matrix with 5
|
||||
columns:
|
||||
|
||||
@@ -22,7 +22,7 @@ From our previous tutorial, we know already a bit of *Pixel operators*. An inter
|
||||
\f[g(x) = (1 - \alpha)f_{0}(x) + \alpha f_{1}(x)\f]
|
||||
|
||||
By varying \f$\alpha\f$ from \f$0 \rightarrow 1\f$ this operator can be used to perform a temporal
|
||||
*cross-disolve* between two images or videos, as seen in slide shows and film productions (cool,
|
||||
*cross-dissolve* between two images or videos, as seen in slide shows and film productions (cool,
|
||||
eh?)
|
||||
|
||||
Code
|
||||
|
||||
@@ -35,13 +35,13 @@ Point pt = Point(10, 8);
|
||||
|
||||
- Represents a 4-element vector. The type Scalar is widely used in OpenCV for passing pixel
|
||||
values.
|
||||
- In this tutorial, we will use it extensively to represent RGB color values (3 parameters). It is
|
||||
- In this tutorial, we will use it extensively to represent BGR color values (3 parameters). It is
|
||||
not necessary to define the last argument if it is not going to be used.
|
||||
- Let's see an example, if we are asked for a color argument and we give:
|
||||
@code{.cpp}
|
||||
Scalar( a, b, c )
|
||||
@endcode
|
||||
We would be defining a RGB color such as: *Red = c*, *Green = b* and *Blue = a*
|
||||
We would be defining a BGR color such as: *Blue = a*, *Green = b* and *Red = c*
|
||||
|
||||
Code
|
||||
----
|
||||
@@ -145,7 +145,7 @@ Explanation
|
||||
of size **(w/4.0, w/16.0)**
|
||||
- The ellipse is rotated **angle** degrees
|
||||
- The ellipse extends an arc between **0** and **360** degrees
|
||||
- The color of the figure will be **Scalar( 255, 255, 0)** which means blue in RGB value.
|
||||
- The color of the figure will be **Scalar( 255, 0, 0)** which means blue in RGB value.
|
||||
- The ellipse's **thickness** is 2.
|
||||
- *MyFilledCircle*
|
||||
@code{.cpp}
|
||||
|
||||
@@ -122,8 +122,8 @@ Explanation
|
||||
*image.size()* and *image.type()*
|
||||
|
||||
-# Now, to perform the operation \f$g(i,j) = \alpha \cdot f(i,j) + \beta\f$ we will access to each
|
||||
pixel in image. Since we are operating with RGB images, we will have three values per pixel (R,
|
||||
G and B), so we will also access them separately. Here is the piece of code:
|
||||
pixel in image. Since we are operating with BGR images, we will have three values per pixel (B,
|
||||
G and R), so we will also access them separately. Here is the piece of code:
|
||||
@code{.cpp}
|
||||
for( int y = 0; y < image.rows; y++ ) {
|
||||
for( int x = 0; x < image.cols; x++ ) {
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ library.
|
||||
|
||||
Here's a sample code of how to achieve all the stuff enumerated at the goal list.
|
||||
|
||||
@includelineno cpp/tutorial_code/core/file_input_output/file_input_output.cpp
|
||||
@include cpp/tutorial_code/core/file_input_output/file_input_output.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -57,7 +57,7 @@ the samples directory of OpenCV at the cpp tutorial code for the core section. I
|
||||
how_to_scan_images imageName.jpg intValueToReduce [G]
|
||||
@endcode
|
||||
The final argument is optional. If given the image will be loaded in gray scale format, otherwise
|
||||
the RGB color way is used. The first thing is to calculate the lookup table.
|
||||
the BGR color space is used. The first thing is to calculate the lookup table.
|
||||
|
||||
@snippet how_to_scan_images.cpp dividewith
|
||||
|
||||
@@ -88,7 +88,7 @@ case of a gray scale image we have something like:
|
||||

|
||||
|
||||
For multichannel images the columns contain as many sub columns as the number of channels. For
|
||||
example in case of an RGB color system:
|
||||
example in case of an BGR color system:
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ You may also find the source code in the
|
||||
`samples/cpp/tutorial_code/core/ippasync/ippasync_sample.cpp` file of the OpenCV source library or
|
||||
download it from [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/core/ippasync/ippasync_sample.cpp).
|
||||
|
||||
@includelineno cpp/tutorial_code/core/ippasync/ippasync_sample.cpp
|
||||
@include cpp/tutorial_code/core/ippasync/ippasync_sample.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ possible to use the old functions and in the end just transform the result to a
|
||||
|
||||
@snippet interoperability_with_OpenCV_1.cpp new
|
||||
|
||||
Because, we want to mess around with the images luma component we first convert from the default RGB
|
||||
Because, we want to mess around with the images luma component we first convert from the default BGR
|
||||
to the YUV color space and then split the result up into separate planes. Here the program splits:
|
||||
in the first example it processes each plane using one of the three major image scanning algorithms
|
||||
in OpenCV (C [] operator, iterator, individual element access). In a second variant we add to the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Operations with images {#tutorial_ug_mat}
|
||||
Operations with images {#tutorial_mat_operations}
|
||||
======================
|
||||
|
||||
Input/Output
|
||||
@@ -27,11 +27,6 @@ If you read a jpg file, a 3 channel image is created by default. If you need a g
|
||||
|
||||
@note use imdecode and imencode to read and write image from/to memory rather than a file.
|
||||
|
||||
XML/YAML
|
||||
--------
|
||||
|
||||
TBD
|
||||
|
||||
Basic operations with images
|
||||
----------------------------
|
||||
|
||||
+2
-2
@@ -118,8 +118,8 @@ added.
|
||||
|
||||
There are, however, many other color systems each with their own advantages:
|
||||
|
||||
- RGB is the most common as our eyes use something similar, our display systems also compose
|
||||
colors using these.
|
||||
- RGB is the most common as our eyes use something similar, however keep in mind that OpenCV standard display
|
||||
system composes colors using the BGR color space (a switch of the red and blue channel).
|
||||
- The HSV and HLS decompose colors into their hue, saturation and value/luminance components,
|
||||
which is a more natural way for us to describe colors. You might, for example, dismiss the last
|
||||
component, making your algorithm less sensible to the light conditions of the input image.
|
||||
|
||||
@@ -111,7 +111,7 @@ Explanation
|
||||
pt1.y = rng.uniform( y_1, y_2 );
|
||||
@endcode
|
||||
- We know that **rng** is a *Random number generator* object. In the code above we are
|
||||
calling **rng.uniform(a,b)**. This generates a radombly uniformed distribution between
|
||||
calling **rng.uniform(a,b)**. This generates a randomly uniformed distribution between
|
||||
the values **a** and **b** (inclusive in **a**, exclusive in **b**).
|
||||
- From the explanation above, we deduce that the extremes *pt1* and *pt2* will be random
|
||||
values, so the lines positions will be quite impredictable, giving a nice visual effect
|
||||
@@ -133,7 +133,7 @@ Explanation
|
||||
are used as the *R*, *G* and *B* parameters for the line color. Hence, the color of the
|
||||
lines will be random too!
|
||||
|
||||
-# The explanation above applies for the other functions generating circles, ellipses, polygones,
|
||||
-# The explanation above applies for the other functions generating circles, ellipses, polygons,
|
||||
etc. The parameters such as *center* and *vertices* are also generated randomly.
|
||||
-# Before finishing, we also should take a look at the functions *Display_Random_Text* and
|
||||
*Displaying_Big_End*, since they both have a few interesting features:
|
||||
|
||||
@@ -32,6 +32,9 @@ understanding how to manipulate the images on a pixel level.
|
||||
You'll find out how to scan images with neighbor access and use the @ref cv::filter2D
|
||||
function to apply kernel filters on images.
|
||||
|
||||
- @subpage tutorial_mat_operations
|
||||
|
||||
Reading/writing images from file, accessing pixels, primitive operations, visualizing images.
|
||||
|
||||
- @subpage tutorial_adding_images
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ You can find the images (*graf1.png*, *graf3.png*) and homography (*H1to3p.xml*)
|
||||
|
||||
### Source Code
|
||||
|
||||
@includelineno cpp/tutorial_code/features2D/AKAZE_match.cpp
|
||||
@include cpp/tutorial_code/features2D/AKAZE_match.cpp
|
||||
|
||||
### Explanation
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ To run the code you have to specify input and output video path and object bound
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
@includelineno cpp/tutorial_code/features2D/AKAZE_tracking/planar_tracking.cpp
|
||||
@include cpp/tutorial_code/features2D/AKAZE_tracking/planar_tracking.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -49,13 +49,13 @@ int main( int argc, char** argv )
|
||||
int minHessian = 400;
|
||||
|
||||
Ptr<SURF> detector = SURF::create();
|
||||
detector->setMinHessian(minHessian);
|
||||
detector->setHessianThreshold(minHessian);
|
||||
|
||||
std::vector<KeyPoint> keypoints_1, keypoints_2;
|
||||
Mat descriptors_1, descriptors_2;
|
||||
|
||||
detector->detectAndCompute( img_1, keypoints_1, descriptors_1 );
|
||||
detector->detectAndCompute( img_2, keypoints_2, descriptors_2 );
|
||||
detector->detectAndCompute( img_1, Mat(), keypoints_1, descriptors_1 );
|
||||
detector->detectAndCompute( img_2, Mat(), keypoints_2, descriptors_2 );
|
||||
|
||||
//-- Step 2: Matching descriptor vectors with a brute force matcher
|
||||
BFMatcher matcher(NORM_L2);
|
||||
|
||||
@@ -58,13 +58,13 @@ int main( int argc, char** argv )
|
||||
int minHessian = 400;
|
||||
|
||||
Ptr<SURF> detector = SURF::create();
|
||||
detector->setMinHessian(minHessian);
|
||||
detector->setHessianThreshold(minHessian);
|
||||
|
||||
std::vector<KeyPoint> keypoints_1, keypoints_2;
|
||||
Mat descriptors_1, descriptors_2;
|
||||
|
||||
detector->detectAndCompute( img_1, keypoints_1, descriptors_1 );
|
||||
detector->detectAndCompute( img_2, keypoints_2, descriptors_2 );
|
||||
detector->detectAndCompute( img_1, Mat(), keypoints_1, descriptors_1 );
|
||||
detector->detectAndCompute( img_2, Mat(), keypoints_2, descriptors_2 );
|
||||
|
||||
//-- Step 2: Matching descriptor vectors using FLANN matcher
|
||||
FlannBasedMatcher matcher;
|
||||
|
||||
@@ -20,6 +20,7 @@ This tutorial code's is shown lines below.
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/features2d.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/calib3d.hpp"
|
||||
@@ -50,8 +51,8 @@ int main( int argc, char** argv )
|
||||
std::vector<KeyPoint> keypoints_object, keypoints_scene;
|
||||
Mat descriptors_object, descriptors_scene;
|
||||
|
||||
detector->detectAndCompute( img_object, keypoints_object, descriptors_object );
|
||||
detector->detectAndCompute( img_scene, keypoints_scene, descriptors_scene );
|
||||
detector->detectAndCompute( img_object, Mat(), keypoints_object, descriptors_object );
|
||||
detector->detectAndCompute( img_scene, Mat(), keypoints_scene, descriptors_scene );
|
||||
|
||||
//-- Step 2: Matching descriptor vectors using FLANN matcher
|
||||
FlannBasedMatcher matcher;
|
||||
@@ -81,13 +82,13 @@ int main( int argc, char** argv )
|
||||
Mat img_matches;
|
||||
drawMatches( img_object, keypoints_object, img_scene, keypoints_scene,
|
||||
good_matches, img_matches, Scalar::all(-1), Scalar::all(-1),
|
||||
vector<char>(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS );
|
||||
std::vector<char>(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS );
|
||||
|
||||
//-- Localize the object
|
||||
std::vector<Point2f> obj;
|
||||
std::vector<Point2f> scene;
|
||||
|
||||
for( int i = 0; i < good_matches.size(); i++ )
|
||||
for( size_t i = 0; i < good_matches.size(); i++ )
|
||||
{
|
||||
//-- Get the keypoints from the good matches
|
||||
obj.push_back( keypoints_object[ good_matches[i].queryIdx ].pt );
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ Code
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp)
|
||||
|
||||
@includelineno cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp
|
||||
@include cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ void goodFeaturesToTrack_Demo( int, void* )
|
||||
/// Draw corners detected
|
||||
cout<<"** Number of corners detected: "<<corners.size()<<endl;
|
||||
int r = 4;
|
||||
for( int i = 0; i < corners.size(); i++ )
|
||||
for( size_t i = 0; i < corners.size(); i++ )
|
||||
{ circle( copy, corners[i], r, Scalar(rng.uniform(0,255), rng.uniform(0,255),
|
||||
rng.uniform(0,255)), -1, 8, 0 ); }
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Using Creative Senz3D and other Intel Perceptual Computing SDK compatible depth sensors {#tutorial_ug_intelperc}
|
||||
Using Creative Senz3D and other Intel Perceptual Computing SDK compatible depth sensors {#tutorial_intelperc}
|
||||
=======================================================================================
|
||||
|
||||
Depth sensors compatible with Intel Perceptual Computing SDK are supported through VideoCapture
|
||||
@@ -78,5 +78,5 @@ there are two flags that should be used to set/get property of the needed genera
|
||||
flag value is assumed by default if neither of the two possible values of the property is set.
|
||||
|
||||
For more information please refer to the example of usage
|
||||
[intelpercccaptureccpp](https://github.com/Itseez/opencv/tree/master/samples/cpp/intelperc_capture.cpp)
|
||||
[intelperc_capture.cpp](https://github.com/Itseez/opencv/tree/master/samples/cpp/intelperc_capture.cpp)
|
||||
in opencv/samples/cpp folder.
|
||||
@@ -1,8 +1,8 @@
|
||||
Using Kinect and other OpenNI compatible depth sensors {#tutorial_ug_highgui}
|
||||
Using Kinect and other OpenNI compatible depth sensors {#tutorial_kinect_openni}
|
||||
======================================================
|
||||
|
||||
Depth sensors compatible with OpenNI (Kinect, XtionPRO, ...) are supported through VideoCapture
|
||||
class. Depth map, RGB image and some other formats of output can be retrieved by using familiar
|
||||
class. Depth map, BGR image and some other formats of output can be retrieved by using familiar
|
||||
interface of VideoCapture.
|
||||
|
||||
In order to use depth sensor with OpenCV you should do the following preliminary steps:
|
||||
@@ -46,7 +46,7 @@ VideoCapture can retrieve the following data:
|
||||
- CAP_OPENNI_VALID_DEPTH_MASK - mask of valid pixels (not ocluded, not shaded etc.)
|
||||
(CV_8UC1)
|
||||
|
||||
-# data given from RGB image generator:
|
||||
-# data given from BGR image generator:
|
||||
- CAP_OPENNI_BGR_IMAGE - color image (CV_8UC3)
|
||||
- CAP_OPENNI_GRAY_IMAGE - gray image (CV_8UC1)
|
||||
|
||||
@@ -134,5 +134,5 @@ property. The following properties of cameras available through OpenNI interface
|
||||
- CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION
|
||||
|
||||
For more information please refer to the example of usage
|
||||
[openniccaptureccpp](https://github.com/Itseez/opencv/tree/master/samples/cpp/openni_capture.cpp) in
|
||||
[openni_capture.cpp](https://github.com/Itseez/opencv/tree/master/samples/cpp/openni_capture.cpp) in
|
||||
opencv/samples/cpp folder.
|
||||
@@ -28,7 +28,7 @@ of the bay rise 10, 50, and 100 meters.
|
||||
Code
|
||||
----
|
||||
|
||||
@includelineno cpp/tutorial_code/HighGUI/GDAL_IO/gdal-image.cpp
|
||||
@include cpp/tutorial_code/HighGUI/GDAL_IO/gdal-image.cpp
|
||||
|
||||
How to Read Raster Data using GDAL
|
||||
----------------------------------
|
||||
|
||||
@@ -37,3 +37,7 @@ use the built-in graphical user interface of the library.
|
||||
*Author:* Marvin Smith
|
||||
|
||||
Read common GIS Raster and DEM files to display and manipulate geographic data.
|
||||
|
||||
- @subpage tutorial_kinect_openni
|
||||
|
||||
- @subpage tutorial_intelperc
|
||||
|
||||
@@ -25,7 +25,7 @@ version of it ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutoria
|
||||
You may also find the source code and these video file in the
|
||||
`samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/` folder of the OpenCV source library.
|
||||
|
||||
@includelineno cpp/tutorial_code/HighGUI/video-input-psnr-ssim/video-input-psnr-ssim.cpp
|
||||
@include cpp/tutorial_code/HighGUI/video-input-psnr-ssim/video-input-psnr-ssim.cpp
|
||||
|
||||
How to read a video stream (online-camera or offline-file)?
|
||||
-----------------------------------------------------------
|
||||
|
||||
@@ -12,7 +12,7 @@ class, designed for this.
|
||||
- What type of video files you can create with OpenCV
|
||||
- How to extract a given color channel from a video
|
||||
|
||||
As a simple demonstration I'll just extract one of the RGB color channels of an input video file
|
||||
As a simple demonstration I'll just extract one of the BGR color channels of an input video file
|
||||
into a new video. You can control the flow of the application from its console line arguments:
|
||||
|
||||
- The first argument points to the video file to work on
|
||||
@@ -33,7 +33,7 @@ You may also find the source code and these video file in the
|
||||
`samples/cpp/tutorial_code/highgui/video-write/` folder of the OpenCV source library or [download it
|
||||
from here ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/HighGUI/video-write/video-write.cpp).
|
||||
|
||||
@includelineno cpp/tutorial_code/HighGUI/video-write/video-write.cpp
|
||||
@include cpp/tutorial_code/HighGUI/video-write/video-write.cpp
|
||||
|
||||
The structure of a video
|
||||
------------------------
|
||||
@@ -134,7 +134,7 @@ the object with success you can send the frames of the video in a sequential ord
|
||||
outputVideo.write(res); //or
|
||||
outputVideo << res;
|
||||
@endcode
|
||||
Extracting a color channel from an RGB image means to set to zero the RGB values of the other
|
||||
Extracting a color channel from an BGR image means to set to zero the BGR values of the other
|
||||
channels. You can either do this with image scanning operations or by using the split and merge
|
||||
operations. You first split the channels up into different images, set the other channels to zero
|
||||
images of the same size and type and finally merge them back:
|
||||
|
||||
@@ -61,7 +61,7 @@ Code
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp
|
||||
@include samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
@@ -69,7 +69,7 @@ Explanation
|
||||
-# Most of the stuff shown is known by you (if you have any doubt, please refer to the tutorials in
|
||||
previous sections). Let's check the general structure of the program:
|
||||
|
||||
- Load an image (can be RGB or grayscale)
|
||||
- Load an image (can be BGR or grayscale)
|
||||
- Create two windows (one for dilation output, the other for erosion)
|
||||
- Create a set of 02 Trackbars for each operation:
|
||||
- The first trackbar "Element" returns either **erosion_elem** or **dilation_elem**
|
||||
|
||||
@@ -80,7 +80,7 @@ Code
|
||||
in samples.
|
||||
|
||||
- **Code at glance:**
|
||||
@includelineno samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo1.cpp
|
||||
@include samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo1.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ Code
|
||||
- **Downloadable code**: Click
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp)
|
||||
- **Code at glance:**
|
||||
@includelineno samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp
|
||||
@include samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -47,13 +47,13 @@ Code
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp)
|
||||
- **Code at glance:**
|
||||
|
||||
@includelineno cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp
|
||||
@include cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
-# Declare variables such as the matrices to store the base image and the two other images to
|
||||
compare ( RGB and HSV )
|
||||
compare ( BGR and HSV )
|
||||
@code{.cpp}
|
||||
Mat src_base, hsv_base;
|
||||
Mat src_test1, hsv_test1;
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ Code
|
||||
- **Downloadable code**: Click
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp)
|
||||
- **Code at glance:**
|
||||
@includelineno samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp
|
||||
@include samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -98,7 +98,7 @@ Code
|
||||
- **Downloadable code**: Click
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp)
|
||||
- **Code at glance:**
|
||||
@includelineno samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp
|
||||
@include samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -75,7 +75,7 @@ Code
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp
|
||||
@include samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -47,7 +47,7 @@ Code
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp
|
||||
@include samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -18,7 +18,7 @@ Code
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/imageSegmentation.cpp).
|
||||
@includelineno samples/cpp/tutorial_code/ImgTrans/imageSegmentation.cpp
|
||||
@include samples/cpp/tutorial_code/ImgTrans/imageSegmentation.cpp
|
||||
|
||||
Explanation / Result
|
||||
--------------------
|
||||
|
||||
@@ -42,7 +42,7 @@ Code
|
||||
-# The sample code that we will explain can be downloaded from [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/houghcircles.cpp).
|
||||
A slightly fancier version (which shows trackbars for
|
||||
changing the threshold values) can be found [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp).
|
||||
@includelineno samples/cpp/houghcircles.cpp
|
||||
@include samples/cpp/houghcircles.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -55,7 +55,7 @@ Arranging the terms: \f$r = x \cos \theta + y \sin \theta\f$
|
||||
-# We can do the same operation above for all the points in an image. If the curves of two
|
||||
different points intersect in the plane \f$\theta\f$ - \f$r\f$, that means that both points belong to a
|
||||
same line. For instance, following with the example above and drawing the plot for two more
|
||||
points: \f$x_{1} = 9\f$, \f$y_{1} = 4\f$ and \f$x_{2} = 12\f$, \f$y_{2} = 3\f$, we get:
|
||||
points: \f$x_{1} = 4\f$, \f$y_{1} = 9\f$ and \f$x_{2} = 12\f$, \f$y_{2} = 3\f$, we get:
|
||||
|
||||

|
||||
|
||||
@@ -98,7 +98,7 @@ Code
|
||||
-# The sample code that we will explain can be downloaded from [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/houghlines.cpp). A slightly fancier version
|
||||
(which shows both Hough standard and probabilistic with trackbars for changing the threshold
|
||||
values) can be found [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp).
|
||||
@includelineno samples/cpp/houghlines.cpp
|
||||
@include samples/cpp/houghlines.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -52,7 +52,7 @@ Code
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp
|
||||
@include samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -53,7 +53,7 @@ Code
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp
|
||||
@include samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -109,7 +109,7 @@ Code
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp
|
||||
@include samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -90,7 +90,7 @@ Code
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Geometric_Transforms_Demo.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ImgTrans/Geometric_Transforms_Demo.cpp
|
||||
@include samples/cpp/tutorial_code/ImgTrans/Geometric_Transforms_Demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -21,7 +21,7 @@ Morphology is a set of image processing operations that process images based on
|
||||
|
||||
Two of the most basic morphological operations are dilation and erosion. Dilation adds pixels to the boundaries of the object in an image, while erosion does exactly the opposite. The amount of pixels added or removed, respectively depends on the size and shape of the structuring element used to process the image. In general the rules followed from these two operations have as follows:
|
||||
|
||||
- __Dilation__: The value of the output pixel is the <b><em>maximum</em></b> value of all the pixels that fall within the structuring element's size and shape. For example in a binary image, if any of the pixels of the input image falling within the range of the kernel is set to the value 1, the corresponding pixel of the output image will be set to 1 as well. The latter applies to any type of image (e.g. grayscale, rgb, etc).
|
||||
- __Dilation__: The value of the output pixel is the <b><em>maximum</em></b> value of all the pixels that fall within the structuring element's size and shape. For example in a binary image, if any of the pixels of the input image falling within the range of the kernel is set to the value 1, the corresponding pixel of the output image will be set to 1 as well. The latter applies to any type of image (e.g. grayscale, bgr, etc).
|
||||
|
||||

|
||||
|
||||
@@ -49,7 +49,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Morphology_3.cpp).
|
||||
@includelineno samples/cpp/tutorial_code/ImgProc/Morphology_3.cpp
|
||||
@include samples/cpp/tutorial_code/ImgProc/Morphology_3.cpp
|
||||
|
||||
Explanation / Result
|
||||
--------------------
|
||||
|
||||
@@ -68,7 +68,7 @@ Code
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Pyramids.cpp)
|
||||
|
||||
@includelineno samples/cpp/tutorial_code/ImgProc/Pyramids.cpp
|
||||
@include samples/cpp/tutorial_code/ImgProc/Pyramids.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ Code
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp
|
||||
@include samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ Code
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp
|
||||
@include samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -17,7 +17,7 @@ Code
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp
|
||||
@include samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -17,7 +17,7 @@ Code
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp)
|
||||
|
||||
@includelineno samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp
|
||||
@include samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -18,7 +18,7 @@ Code
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp
|
||||
@include samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ Code
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/pointPolygonTest_demo.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ShapeDescriptors/pointPolygonTest_demo.cpp
|
||||
@include samples/cpp/tutorial_code/ShapeDescriptors/pointPolygonTest_demo.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -98,19 +98,19 @@ Code
|
||||
|
||||
The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Threshold.cpp)
|
||||
@includelineno samples/cpp/tutorial_code/ImgProc/Threshold.cpp
|
||||
@include samples/cpp/tutorial_code/ImgProc/Threshold.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
-# Let's check the general structure of the program:
|
||||
- Load an image. If it is RGB we convert it to Grayscale. For this, remember that we can use
|
||||
- Load an image. If it is BGR we convert it to Grayscale. For this, remember that we can use
|
||||
the function @ref cv::cvtColor :
|
||||
@code{.cpp}
|
||||
src = imread( argv[1], 1 );
|
||||
|
||||
/// Convert the image to Gray
|
||||
cvtColor( src, src_gray, COLOR_RGB2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
@endcode
|
||||
- Create a window to display the result
|
||||
@code{.cpp}
|
||||
|
||||
@@ -185,9 +185,7 @@ corresponding section of @ref tutorial_android_dev_intro.
|
||||
|
||||
**warning**
|
||||
|
||||
Please consider that some samples use Android Java Camera API, which is accessible
|
||||
with an AVD. But most of samples use OpenCV Native Camera which **may not work** with an
|
||||
emulator.
|
||||
Please consider that some samples use Android Java Camera API, which is accessible with an AVD.
|
||||
|
||||
@note Recent *Android SDK tools, revision 19+* can run ARM v7a OS images but they available not for
|
||||
all Android versions.
|
||||
|
||||
@@ -279,7 +279,7 @@ application. It will be capable of accessing camera output, processing it and di
|
||||
android:label="@string/app_name"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
|
||||
@endcode
|
||||
-# Add OpenCV library initialization to your activity. Fix errors by adding requited imports.
|
||||
-# Add OpenCV library initialization to your activity. Fix errors by adding required imports.
|
||||
@code{.java}
|
||||
private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
|
||||
@Override
|
||||
@@ -307,7 +307,7 @@ application. It will be capable of accessing camera output, processing it and di
|
||||
@endcode
|
||||
-# Defines that your activity implements CvCameraViewListener2 interface and fix activity related
|
||||
errors by defining missed methods. For this activity define onCreate, onDestroy and onPause and
|
||||
implement them according code snippet bellow. Fix errors by adding requited imports.
|
||||
implement them according code snippet bellow. Fix errors by adding required imports.
|
||||
@code{.java}
|
||||
private CameraBridgeViewBase mOpenCvCameraView;
|
||||
|
||||
@@ -356,10 +356,7 @@ from camera and implements CvCameraViewListener2 interface to get frames from ca
|
||||
First of all we create our application view using xml layout. Our layout consists of the only one
|
||||
full screen component of class org.opencv.android.JavaCameraView. This class is implemented inside
|
||||
OpenCV library. It is inherited from CameraBridgeViewBase, that extends SurfaceView and uses
|
||||
standard Android camera API. Alternatively you can use org.opencv.android.NativeCameraView class,
|
||||
that implements the same interface, but uses VideoCapture class as camera access back-end.
|
||||
opencv:show_fps="true" and opencv:camera_id="any" options enable FPS message and allow to use any
|
||||
camera on device. Application tries to use back camera first.
|
||||
standard Android camera API.
|
||||
|
||||
After creating layout we need to implement Activity class. OpenCV initialization process has been
|
||||
already discussed above. In this sample we use asynchronous initialization. Implementation of
|
||||
|
||||
@@ -16,7 +16,7 @@ Source Code
|
||||
Download the source code from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/introduction/display_image/display_image.cpp).
|
||||
|
||||
@includelineno cpp/tutorial_code/introduction/display_image/display_image.cpp
|
||||
@include cpp/tutorial_code/introduction/display_image/display_image.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -77,8 +77,7 @@ Following scheme represents common documentation places for _opencv_ repository:
|
||||
<opencv>
|
||||
├── doc - doxygen config files, root page (root.markdown.in), BibTeX file (opencv.bib)
|
||||
│ ├── tutorials - tutorials hierarchy (pages and images)
|
||||
│ ├── py_tutorials - python tutorials hierarchy (pages and images)
|
||||
│ └── user_guide - old user guide (pages and images)
|
||||
│ └── py_tutorials - python tutorials hierarchy (pages and images)
|
||||
├── modules
|
||||
│ └── <modulename>
|
||||
│ ├── doc - documentation pages and images for module
|
||||
@@ -415,7 +414,8 @@ you can manually specify it in curly braces:
|
||||
|
||||
To include whole example file into documentation, _include_ and _includelineno_ commands are used.
|
||||
The file is searched in common samples locations, so you can specify just its name or short part of
|
||||
the path. The _includelineno_ version also shows line numbers.
|
||||
the path. The _includelineno_ version also shows line numbers but prevents copy-pasting since
|
||||
the line numbers are included.
|
||||
|
||||
@verbatim
|
||||
@include samples/cpp/test.cpp
|
||||
|
||||
@@ -56,7 +56,7 @@ Explanation
|
||||
-----------
|
||||
|
||||
-# We begin by loading an image using @ref cv::imread , located in the path given by *imageName*.
|
||||
For this example, assume you are loading a RGB image.
|
||||
For this example, assume you are loading a BGR image.
|
||||
-# Now we are going to convert our image from BGR to Grayscale format. OpenCV has a really nice
|
||||
function to do this kind of transformations:
|
||||
@code{.cpp}
|
||||
|
||||
@@ -257,3 +257,37 @@ _cuda_ module has been split into several smaller pieces:
|
||||
Documentation format {#tutorial_transition_docs}
|
||||
--------------------
|
||||
Documentation has been converted to Doxygen format. You can find updated documentation writing guide in _Tutorials_ section of _OpenCV_ reference documentation (@ref tutorial_documentation).
|
||||
|
||||
Support both versions {#tutorial_transition_both}
|
||||
---------------------
|
||||
In some cases it is possible to support both versions of OpenCV.
|
||||
|
||||
### Source code
|
||||
|
||||
To check library major version in your application source code, the following method should be used:
|
||||
@code{.cpp}
|
||||
#include "opencv2/core/version.hpp"
|
||||
#if CV_MAJOR_VERSION == 2
|
||||
// do opencv 2 code
|
||||
#elif CV_MAJOR_VERSION == 3
|
||||
// do opencv 3 code
|
||||
#endif
|
||||
@endcode
|
||||
|
||||
@note Do not use __CV_VERSION_MAJOR__, it has different meaning for 2.4 and 3.x branches!
|
||||
|
||||
### Build system
|
||||
|
||||
It is possible to link different modules or enable/disable some of the features in your application by checking library version in the build system. Standard cmake or pkg-config variables can be used for this:
|
||||
- `OpenCV_VERSION` for cmake will contain full version: "2.4.11" or "3.0.0" for example
|
||||
- `OpenCV_VERSION_MAJOR` for cmake will contain only major version number: 2 or 3
|
||||
- pkg-config file has standard field `Version`
|
||||
|
||||
Example:
|
||||
@code{.cmake}
|
||||
if(OpenCV_VERSION VERSION_LESS "3.0")
|
||||
# use 2.4 modules
|
||||
else()
|
||||
# use 3.x modules
|
||||
endif()
|
||||
@endcode
|
||||
|
||||
+1
-1
@@ -193,7 +193,7 @@ Now to try this out download our little test [source code
|
||||
or get it from the sample code folder of the OpenCV sources. Add this to your project and build it.
|
||||
Here's its content:
|
||||
|
||||
@includelineno cpp/tutorial_code/introduction/windows_visual_studio_Opencv/introduction_windows_vs.cpp
|
||||
@include cpp/tutorial_code/introduction/windows_visual_studio_Opencv/introduction_windows_vs.cpp
|
||||
|
||||
You can start a Visual Studio build from two places. Either inside from the *IDE* (keyboard
|
||||
combination: Control-F5) or by navigating to your build directory and start the application with a
|
||||
|
||||
@@ -93,7 +93,7 @@ Source Code
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp).
|
||||
@includelineno cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp
|
||||
@include cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp
|
||||
|
||||
@note Another example using PCA for dimensionality reduction while maintaining an amount of variance can be found at [opencv_source_code/samples/cpp/pca.cpp](https://github.com/Itseez/opencv/tree/master/samples/cpp/pca.cpp)
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ the weight vector \f$\beta\f$ and the bias \f$\beta_{0}\f$ of the optimal hyperp
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
@includelineno cpp/tutorial_code/ml/introduction_to_svm/introduction_to_svm.cpp
|
||||
@include cpp/tutorial_code/ml/introduction_to_svm/introduction_to_svm.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -89,7 +89,7 @@ Source Code
|
||||
You may also find the source code in `samples/cpp/tutorial_code/ml/non_linear_svms` folder of the OpenCV source library or
|
||||
[download it from here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp).
|
||||
|
||||
@includelineno cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp
|
||||
@include cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -10,3 +10,7 @@ Ever wondered how your digital camera detects peoples and faces? Look here to fi
|
||||
*Author:* Ana Huamán
|
||||
|
||||
Here we learn how to use *objdetect* to find objects in our images or videos
|
||||
|
||||
- @subpage tutorial_traincascade
|
||||
|
||||
This tutorial describes _opencv_traincascade_ application and its parameters.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Cascade Classifier Training {#tutorial_ug_traincascade}
|
||||
Cascade Classifier Training {#tutorial_traincascade}
|
||||
===========================
|
||||
|
||||
Introduction
|
||||
@@ -31,7 +31,7 @@ Exposure sequence
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
@includelineno cpp/tutorial_code/photo/hdr_imaging/hdr_imaging.cpp
|
||||
@include cpp/tutorial_code/photo/hdr_imaging/hdr_imaging.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -47,7 +47,7 @@ Two different methods are used to generate two foreground masks:
|
||||
The results as well as the input data are shown on the screen.
|
||||
The source file can be downloaded [here ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/video/bg_sub.cpp).
|
||||
|
||||
@includelineno samples/cpp/tutorial_code/video/bg_sub.cpp
|
||||
@include samples/cpp/tutorial_code/video/bg_sub.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -13,7 +13,7 @@ Code
|
||||
----
|
||||
|
||||
You can download the code from [here ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/viz/creating_widgets.cpp).
|
||||
@includelineno samples/cpp/tutorial_code/viz/creating_widgets.cpp
|
||||
@include samples/cpp/tutorial_code/viz/creating_widgets.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -15,7 +15,7 @@ Code
|
||||
----
|
||||
|
||||
You can download the code from [here ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/viz/launching_viz.cpp).
|
||||
@includelineno samples/cpp/tutorial_code/viz/launching_viz.cpp
|
||||
@include samples/cpp/tutorial_code/viz/launching_viz.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -14,7 +14,7 @@ Code
|
||||
----
|
||||
|
||||
You can download the code from [here ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/viz/transformations.cpp).
|
||||
@includelineno samples/cpp/tutorial_code/viz/transformations.cpp
|
||||
@include samples/cpp/tutorial_code/viz/transformations.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -14,7 +14,7 @@ Code
|
||||
----
|
||||
|
||||
You can download the code from [here ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/viz/widget_pose.cpp).
|
||||
@includelineno samples/cpp/tutorial_code/viz/widget_pose.cpp
|
||||
@include samples/cpp/tutorial_code/viz/widget_pose.cpp
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
Features2d {#tutorial_ug_features2d}
|
||||
==========
|
||||
|
||||
Detectors
|
||||
---------
|
||||
|
||||
Descriptors
|
||||
-----------
|
||||
|
||||
Matching keypoints
|
||||
------------------
|
||||
|
||||
### The code
|
||||
|
||||
We will start with a short sample \`opencv/samples/cpp/matcher_simple.cpp\`:
|
||||
|
||||
@code{.cpp}
|
||||
Mat img1 = imread(argv[1], IMREAD_GRAYSCALE);
|
||||
Mat img2 = imread(argv[2], IMREAD_GRAYSCALE);
|
||||
if(img1.empty() || img2.empty())
|
||||
{
|
||||
printf("Can't read one of the images\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// detecting keypoints
|
||||
SurfFeatureDetector detector(400);
|
||||
vector<KeyPoint> keypoints1, keypoints2;
|
||||
detector.detect(img1, keypoints1);
|
||||
detector.detect(img2, keypoints2);
|
||||
|
||||
// computing descriptors
|
||||
SurfDescriptorExtractor extractor;
|
||||
Mat descriptors1, descriptors2;
|
||||
extractor.compute(img1, keypoints1, descriptors1);
|
||||
extractor.compute(img2, keypoints2, descriptors2);
|
||||
|
||||
// matching descriptors
|
||||
BruteForceMatcher<L2<float> > matcher;
|
||||
vector<DMatch> matches;
|
||||
matcher.match(descriptors1, descriptors2, matches);
|
||||
|
||||
// drawing the results
|
||||
namedWindow("matches", 1);
|
||||
Mat img_matches;
|
||||
drawMatches(img1, keypoints1, img2, keypoints2, matches, img_matches);
|
||||
imshow("matches", img_matches);
|
||||
waitKey(0);
|
||||
@endcode
|
||||
|
||||
### The code explained
|
||||
|
||||
Let us break the code down.
|
||||
@code{.cpp}
|
||||
Mat img1 = imread(argv[1], IMREAD_GRAYSCALE);
|
||||
Mat img2 = imread(argv[2], IMREAD_GRAYSCALE);
|
||||
if(img1.empty() || img2.empty())
|
||||
{
|
||||
printf("Can't read one of the images\n");
|
||||
return -1;
|
||||
}
|
||||
@endcode
|
||||
We load two images and check if they are loaded correctly.
|
||||
@code{.cpp}
|
||||
// detecting keypoints
|
||||
Ptr<FeatureDetector> detector = FastFeatureDetector::create(15);
|
||||
vector<KeyPoint> keypoints1, keypoints2;
|
||||
detector->detect(img1, keypoints1);
|
||||
detector->detect(img2, keypoints2);
|
||||
@endcode
|
||||
First, we create an instance of a keypoint detector. All detectors inherit the abstract
|
||||
FeatureDetector interface, but the constructors are algorithm-dependent. The first argument to each
|
||||
detector usually controls the balance between the amount of keypoints and their stability. The range
|
||||
of values is different for different detectors (For instance, *FAST* threshold has the meaning of
|
||||
pixel intensity difference and usually varies in the region *[0,40]*. *SURF* threshold is applied to
|
||||
a Hessian of an image and usually takes on values larger than *100*), so use defaults in case of
|
||||
doubt.
|
||||
@code{.cpp}
|
||||
// computing descriptors
|
||||
Ptr<SURF> extractor = SURF::create();
|
||||
Mat descriptors1, descriptors2;
|
||||
extractor->compute(img1, keypoints1, descriptors1);
|
||||
extractor->compute(img2, keypoints2, descriptors2);
|
||||
@endcode
|
||||
We create an instance of descriptor extractor. The most of OpenCV descriptors inherit
|
||||
DescriptorExtractor abstract interface. Then we compute descriptors for each of the keypoints. The
|
||||
output Mat of the DescriptorExtractor::compute method contains a descriptor in a row *i* for each
|
||||
*i*-th keypoint. Note that the method can modify the keypoints vector by removing the keypoints such
|
||||
that a descriptor for them is not defined (usually these are the keypoints near image border). The
|
||||
method makes sure that the ouptut keypoints and descriptors are consistent with each other (so that
|
||||
the number of keypoints is equal to the descriptors row count). :
|
||||
@code{.cpp}
|
||||
// matching descriptors
|
||||
BruteForceMatcher<L2<float> > matcher;
|
||||
vector<DMatch> matches;
|
||||
matcher.match(descriptors1, descriptors2, matches);
|
||||
@endcode
|
||||
Now that we have descriptors for both images, we can match them. First, we create a matcher that for
|
||||
each descriptor from image 2 does exhaustive search for the nearest descriptor in image 1 using
|
||||
Euclidean metric. Manhattan distance is also implemented as well as a Hamming distance for Brief
|
||||
descriptor. The output vector matches contains pairs of corresponding points indices. :
|
||||
@code{.cpp}
|
||||
// drawing the results
|
||||
namedWindow("matches", 1);
|
||||
Mat img_matches;
|
||||
drawMatches(img1, keypoints1, img2, keypoints2, matches, img_matches);
|
||||
imshow("matches", img_matches);
|
||||
waitKey(0);
|
||||
@endcode
|
||||
The final part of the sample is about visualizing the matching results.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user