Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '2.4'

  • Loading branch information...
commit 67073daf1997f39dc56c3e4092dd42b381063d64 2 parents 3785439 + 74e5ff2
@taka-no-me taka-no-me authored
Showing with 11,000 additions and 12,143 deletions.
  1. +27 −10 3rdparty/tbb/CMakeLists.txt
  2. +18 −7 CMakeLists.txt
  3. +111 −46 android/android.toolchain.cmake
  4. +4 −0 android/service/doc/JavaHelper.rst
  5. +3 −4 android/service/engine/AndroidManifest.xml
  6. +1 −1  android/service/engine/jni/BinderComponent/OpenCVEngine.cpp
  7. +1 −1  android/service/engine/jni/Tests/OpenCVEngineTest.cpp
  8. +1 −1  android/service/engine/project.properties
  9. +6 −6 android/service/readme.txt
  10. +1 −0  cmake/OpenCVDetectAndroidSDK.cmake
  11. +5 −2 cmake/OpenCVDetectCUDA.cmake
  12. +4 −2 cmake/OpenCVDetectCXXCompiler.cmake
  13. +11 −1 cmake/OpenCVFindLibsGUI.cmake
  14. +1 −0  cmake/OpenCVFindLibsGrfmt.cmake
  15. +6 −4 cmake/OpenCVFindLibsPerf.cmake
  16. +20 −6 cmake/OpenCVFindLibsVideo.cmake
  17. +1 −0  cmake/OpenCVLegacyOptions.cmake
  18. 0  cmake/{ → checks}/OpenCVDetectCudaArch.cu
  19. +10 −0 cmake/checks/vfwtest.cpp
  20. +11 −0 cmake/checks/win32uitest.cpp
  21. +11 −2 cmake/templates/cvconfig.h.cmake
  22. +1 −1  doc/_themes/blue/layout.html
  23. +2 −2 doc/tutorials/features2d/feature_description/feature_description.rst
  24. +7 −7 doc/tutorials/introduction/android_binary_package/O4A_SDK.rst
  25. +8 −8 doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst
  26. +0 −2  doc/tutorials/introduction/linux_eclipse/linux_eclipse.rst
  27. +1 −1  modules/calib3d/test/test_solvepnp_ransac.cpp
  28. +21 −5 modules/calib3d/test/test_stereomatching.cpp
  29. +1 −1  modules/contrib/doc/facerec/facerec_tutorial.rst
  30. +1 −1  modules/contrib/doc/facerec/src/CMakeLists.txt
  31. +1 −1  modules/contrib/include/opencv2/contrib/contrib.hpp
  32. +1 −1  modules/contrib/src/ba.cpp
  33. +1 −0  modules/contrib/src/fuzzymeanshifttracker.cpp
  34. +1 −1  modules/core/doc/intro.rst
  35. +1 −1  modules/core/include/opencv2/core/core.hpp
  36. +8 −2 modules/core/include/opencv2/core/cvdef.h
  37. +2 −0  modules/core/include/opencv2/core/mat.hpp
  38. +12 −0 modules/core/include/opencv2/core/mat.inl.hpp
  39. +9 −27 modules/core/src/lapack.cpp
  40. +1 −1  modules/core/src/matop.cpp
  41. +1 −1  modules/core/src/matrix.cpp
  42. +13 −0 modules/core/test/test_arithm.cpp
  43. +1 −1  modules/features2d/doc/feature_detection_and_description.rst
  44. +1 −1  modules/features2d/src/keypoint.cpp
  45. +3 −4 modules/flann/include/opencv2/flann/dist.h
  46. +0 −2  modules/gpu/CMakeLists.txt
  47. +2 −2 modules/gpu/perf/perf_video.cpp
  48. +5 −5 modules/gpu/src/element_operations.cpp
  49. +12 −10 modules/gpu/src/tvl1flow.cpp
  50. +16 −4 modules/highgui/CMakeLists.txt
  51. +1 −0  modules/highgui/include/opencv2/highgui/highgui_c.h
  52. +3 −3 modules/highgui/perf/perf_precomp.hpp
  53. +14 −6 modules/highgui/src/cap.cpp
  54. +2 −1  modules/highgui/src/cap_dshow.cpp
  55. +4 −4 modules/highgui/src/cap_ffmpeg.cpp
  56. +32 −24 modules/highgui/src/cap_ffmpeg_impl.hpp
  57. +1 −0  modules/highgui/src/cap_libv4l.cpp
  58. +2,810 −0 modules/highgui/src/cap_msmf.cpp
  59. +1 −1  modules/highgui/src/cap_vfw.cpp
  60. +1 −8 modules/highgui/src/precomp.hpp
  61. +8 −8 modules/highgui/src/window.cpp
  62. +1 −1  modules/highgui/test/test_ffmpeg.cpp
  63. +1 −1  modules/highgui/test/test_gui.cpp
  64. +4 −7 modules/highgui/test/test_precomp.hpp
  65. +3 −3 modules/imgproc/src/imgwarp.cpp
  66. +8 −1 modules/java/CMakeLists.txt
  67. +1 −1  modules/java/android_test/CMakeLists.txt
  68. +12 −1 modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java
  69. +3 −0  modules/java/generator/src/java/android+CameraBridgeViewBase.java
  70. +3 −7 modules/java/generator/src/java/android+JavaCameraView.java
  71. +6 −0 modules/java/generator/src/java/android+OpenCVLoader.java
  72. +4 −4 modules/java/generator/src/java/core+MatOfDMatch.java
  73. +2 −1  modules/legacy/src/blobtrackingauto.cpp
  74. +1 −1  modules/legacy/src/calibfilter.cpp
  75. +1 −1  modules/legacy/src/epilines.cpp
  76. +50 −104 modules/nonfree/test/test_gpu.cpp
  77. +0 −70 modules/nonfree/test/test_main.cpp
  78. +5 −3 modules/nonfree/test/test_precomp.hpp
  79. +0 −11 modules/nonfree/test/test_surf.ocl.cpp
  80. +1 −1  modules/ocl/CMakeLists.txt
  81. +33 −1 modules/ocl/include/opencv2/ocl.hpp
  82. +0 −120 modules/ocl/perf/interpolation.hpp
  83. +99 −79 modules/ocl/perf/main.cpp
  84. +862 −4,073 modules/ocl/perf/perf_arithm.cpp
  85. +63 −65 modules/ocl/perf/perf_blend.cpp
  86. +150 −0 modules/ocl/perf/perf_brute_force_matcher.cpp
  87. +26 −96 modules/ocl/perf/perf_canny.cpp
  88. +91 −0 modules/ocl/perf/perf_color.cpp
  89. +40 −72 modules/ocl/perf/perf_columnsum.cpp
  90. +31 −68 modules/ocl/perf/perf_fft.cpp
  91. +222 −1,059 modules/ocl/perf/perf_filters.cpp
  92. +39 −64 modules/ocl/perf/perf_gemm.cpp
  93. +71 −106 modules/ocl/perf/perf_haar.cpp
  94. +31 −109 modules/ocl/perf/perf_hog.cpp
  95. +611 −1,854 modules/ocl/perf/perf_imgproc.cpp
  96. +74 −160 modules/ocl/perf/perf_match_template.cpp
  97. +93 −650 modules/ocl/perf/perf_matrix_operation.cpp
  98. +84 −0 modules/ocl/perf/perf_norm.cpp
  99. +32 −82 modules/ocl/perf/perf_pyrdown.cpp
  100. +143 −0 modules/ocl/perf/perf_pyrlk.cpp
  101. +31 −65 modules/ocl/perf/perf_pyrup.cpp
  102. +73 −410 modules/ocl/perf/perf_split_merge.cpp
  103. +324 −6 modules/ocl/perf/precomp.cpp
  104. +350 −33 modules/ocl/perf/precomp.hpp
  105. +0 −265 modules/ocl/perf/utility.cpp
  106. +0 −182 modules/ocl/perf/utility.hpp
  107. +2 −3 modules/ocl/src/fft.cpp
  108. +18 −6 modules/ocl/src/initialization.cpp
  109. +7 −5 modules/ocl/src/mcwutil.cpp
  110. +68 −34 modules/ocl/src/opencl/arithm_absdiff.cl
  111. +65 −31 modules/ocl/src/opencl/arithm_add.cl
  112. +126 −104 modules/ocl/src/opencl/arithm_addWeighted.cl
  113. +53 −28 modules/ocl/src/opencl/arithm_add_scalar.cl
  114. +53 −28 modules/ocl/src/opencl/arithm_add_scalar_mask.cl
  115. +103 −87 modules/ocl/src/opencl/arithm_bitwise_and.cl
  116. +236 −179 modules/ocl/src/opencl/arithm_bitwise_and_mask.cl
  117. +183 −124 modules/ocl/src/opencl/arithm_bitwise_and_scalar.cl
  118. +206 −147 modules/ocl/src/opencl/arithm_bitwise_and_scalar_mask.cl
  119. +36 −21 modules/ocl/src/opencl/arithm_bitwise_not.cl
  120. +55 −39 modules/ocl/src/opencl/arithm_bitwise_or.cl
  121. +235 −178 modules/ocl/src/opencl/arithm_bitwise_or_mask.cl
  122. +179 −119 modules/ocl/src/opencl/arithm_bitwise_or_scalar.cl
  123. +208 −148 modules/ocl/src/opencl/arithm_bitwise_or_scalar_mask.cl
  124. +97 −83 modules/ocl/src/opencl/arithm_bitwise_xor.cl
  125. +235 −178 modules/ocl/src/opencl/arithm_bitwise_xor_mask.cl
  126. +184 −125 modules/ocl/src/opencl/arithm_bitwise_xor_scalar.cl
  127. +207 −147 modules/ocl/src/opencl/arithm_bitwise_xor_scalar_mask.cl
  128. +137 −77 modules/ocl/src/opencl/arithm_compare_eq.cl
  129. +135 −76 modules/ocl/src/opencl/arithm_compare_ne.cl
  130. +61 −50 modules/ocl/src/opencl/arithm_div.cl
  131. +20 −4 modules/ocl/src/opencl/arithm_flip.cl
  132. +25 −10 modules/ocl/src/opencl/arithm_mul.cl
  133. +380 −0 modules/ocl/src/opencl/stereobp.cl
  134. +517 −0 modules/ocl/src/stereobp.cpp
  135. +50 −7 modules/ocl/test/test_calib3d.cpp
  136. +1 −1  modules/python/src2/cv2.cpp
  137. +3 −3 modules/stitching/include/opencv2/stitching/detail/warpers.hpp
  138. +9 −2 modules/stitching/src/matchers.cpp
  139. +0 −2  modules/superres/CMakeLists.txt
  140. +15 −14 modules/video/src/tvl1flow.cpp
  141. +6 −0 platforms/winrt/arm.winrt.toolchain.cmake
  142. +6 −0 platforms/winrt/scripts/cmake_winrt.cmd
  143. +8 −0 samples/android/native-activity/.classpath
  144. +75 −0 samples/android/native-activity/.cproject
  145. +33 −0 samples/android/native-activity/.project
  146. +4 −0 samples/android/native-activity/.settings/org.eclipse.jdt.core.prefs
  147. +12 −0 samples/android/native-activity/CMakeLists.txt
  148. +1 −1  samples/android/native-activity/jni/native.cpp
  149. +1 −1  samples/android/tutorial-2-mixedprocessing/jni/jni_part.cpp
  150. +1 −1  samples/cpp/Qt_sample/main.cpp
  151. +1 −1  samples/cpp/stereo_calib.cpp
  152. +1 −2  samples/gpu/super_resolution.cpp
Sorry, we could not display the entire diff because it was too big.
View
37 3rdparty/tbb/CMakeLists.txt
@@ -122,15 +122,32 @@ file(GLOB lib_srcs "${tbb_src_dir}/src/tbb/*.cpp")
file(GLOB lib_hdrs "${tbb_src_dir}/src/tbb/*.h")
list(APPEND lib_srcs "${tbb_src_dir}/src/rml/client/rml_tbb.cpp")
-add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required
- -D__TBB_BUILD=1 #required
- -D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk support
- -DUSE_PTHREAD #required for Unix
- -DTBB_USE_GCC_BUILTINS=1 #required for ARM GCC
- -DTBB_USE_DEBUG=0 #just to be sure
- -DTBB_NO_LEGACY=1 #don't need backward compatibility
- -DDO_ITT_NOTIFY=0 #it seems that we don't need these notifications
- )
+if (WIN32)
+ add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0
+ -D__TBB_BUILD=1
+ -D_UNICODE
+ -DUNICODE
+ -DWINAPI_FAMILY=WINAPI_FAMILY_APP
+ -DDO_ITT_NOTIFY=0
+ ) # defines were copied from windows.cl.inc
+set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} /APPCONTAINER")
+else()
+ add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required
+ -D__TBB_BUILD=1 #required
+ -D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk support
+ -DTBB_USE_DEBUG=0 #just to be sure
+ -DTBB_NO_LEGACY=1 #don't need backward compatibility
+ -DDO_ITT_NOTIFY=0 #it seems that we don't need these notifications
+ )
+endif()
+
+if (HAVE_LIBPTHREAD)
+ add_definitions(-DUSE_PTHREAD) #required for Unix
+endif()
+
+if (CMAKE_COMPILER_IS_GNUCXX)
+ add_definitions(-DTBB_USE_GCC_BUILTINS=1) #required for ARM GCC
+endif()
if(ANDROID_COMPILER_IS_CLANG)
add_definitions(-D__TBB_GCC_BUILTIN_ATOMICS_PRESENT=1)
@@ -145,7 +162,7 @@ endif()
set(TBB_SOURCE_FILES ${lib_srcs} ${lib_hdrs})
-if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
+if (ARM AND NOT WIN32)
if (NOT ANDROID)
set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/arm_linux_stub.cpp")
endif()
View
25 CMakeLists.txt
@@ -118,6 +118,7 @@ OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT)
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS AND NOT APPLE) )
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
+OCV_OPTION(WITH_VFW "Include Video for Windows support" ON IF WIN32 )
OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS))
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_GSTREAMER_1_X "Include Gstreamer 1.x support" OFF)
@@ -133,13 +134,15 @@ OCV_OPTION(WITH_PNG "Include PNG support" ON)
OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS) )
+OCV_OPTION(WITH_WIN32UI "Build with Win32 UI Backend support" ON IF WIN32 )
OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF IF APPLE )
OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS) )
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF 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) )
-OCV_OPTION(WITH_VIDEOINPUT "Build HighGUI with DirectShow support" ON IF WIN32 )
+OCV_OPTION(WITH_DSHOW "Build HighGUI with DirectShow support" ON IF (WIN32 AND NOT ARM) )
+OCV_OPTION(WITH_MSMF "Build HighGUI with Media Foundation support" OFF IF WIN32 )
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT APPLE) )
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_CLP "Include Clp support (EPL)" OFF)
@@ -171,7 +174,7 @@ OCV_OPTION(BUILD_JASPER "Build libjasper from source" WIN32 O
OCV_OPTION(BUILD_JPEG "Build libjpeg from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_PNG "Build libpng from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_OPENEXR "Build openexr from source" WIN32 OR ANDROID OR APPLE )
-OCV_OPTION(BUILD_TBB "Download and build TBB from source" ANDROID IF CMAKE_COMPILER_IS_GNUCXX )
+OCV_OPTION(BUILD_TBB "Download and build TBB from source" ANDROID )
# OpenCV installation options
# ===================================================
@@ -600,8 +603,8 @@ else()
if(DEFINED WITH_QT)
status(" QT 4.x:" NO)
endif()
- if(WIN32)
- status(" Win32 UI:" YES)
+ if(DEFINED WITH_WIN32UI)
+ status(" Win32 UI:" HAVE_WIN32UI THEN YES ELSE NO)
else()
if(APPLE)
if(WITH_CARBON)
@@ -665,6 +668,10 @@ endif()
status("")
status(" Video I/O:")
+if (DEFINED WITH_VFW)
+ status(" Video for Windows:" HAVE_VFW THEN YES ELSE NO)
+endif(DEFINED WITH_VFW)
+
if(DEFINED WITH_1394)
status(" DC1394 1.x:" HAVE_DC1394 THEN "YES (ver ${ALIASOF_libdc1394_VERSION})" ELSE NO)
status(" DC1394 2.x:" HAVE_DC1394_2 THEN "YES (ver ${ALIASOF_libdc1394-2_VERSION})" ELSE NO)
@@ -749,9 +756,13 @@ if(DEFINED WITH_V4L)
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
endif(DEFINED WITH_V4L)
-if(DEFINED WITH_VIDEOINPUT)
- status(" DirectShow:" HAVE_VIDEOINPUT THEN YES ELSE NO)
-endif(DEFINED WITH_VIDEOINPUT)
+if(DEFINED WITH_DSHOW)
+ status(" DirectShow:" HAVE_DSHOW THEN YES ELSE NO)
+endif(DEFINED WITH_DSHOW)
+
+if(DEFINED WITH_MSMF)
+ status(" Media Foundation:" HAVE_MSMF THEN YES ELSE NO)
+endif(DEFINED WITH_MSMF)
if(DEFINED WITH_XIMEA)
status(" XIMEA:" HAVE_XIMEA THEN YES ELSE NO)
View
157 android/android.toolchain.cmake
@@ -1,5 +1,5 @@
# Copyright (c) 2010-2011, Ethan Rublee
-# Copyright (c) 2011-2012, Andrey Kamaev
+# Copyright (c) 2011-2013, Andrey Kamaev
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -281,8 +281,14 @@
# [+] updated for NDK r8c
# [+] added support for clang compiler
# - December 2012
+# [+] suppress warning about unused CMAKE_TOOLCHAIN_FILE variable
+# [+] adjust API level to closest compatible as NDK does
# [~] fixed ccache full path search
# [+] updated for NDK r8d
+# [~] compiler options are aligned with NDK r8d
+# - March 2013
+# [+] updated for NDK r8e (x86 version)
+# [+] support x86_64 version of NDK
# ------------------------------------------------------------------------------
cmake_minimum_required( VERSION 2.6.3 )
@@ -292,6 +298,10 @@ if( DEFINED CMAKE_CROSSCOMPILING )
return()
endif()
+if( CMAKE_TOOLCHAIN_FILE )
+ # touch toolchain variable only to suppress "unused variable" warning
+endif()
+
get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
if( _CMAKE_IN_TRY_COMPILE )
include( "${CMAKE_CURRENT_SOURCE_DIR}/../android.toolchain.config.cmake" OPTIONAL )
@@ -305,7 +315,7 @@ set( CMAKE_SYSTEM_VERSION 1 )
# rpath makes low sence for Android
set( CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." )
-set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
+set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
if(NOT DEFINED ANDROID_NDK_SEARCH_PATHS)
if( CMAKE_HOST_WIN32 )
file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
@@ -449,19 +459,32 @@ if( ANDROID_FORBID_SYGWIN )
endif()
endif()
+
# detect current host platform
+if( NOT DEFINED ANDROID_NDK_HOST_X64 AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64|x86_64|AMD64")
+ set( ANDROID_NDK_HOST_X64 1 CACHE BOOL "Try to use 64-bit compiler toolchain" )
+ mark_as_advanced( ANDROID_NDK_HOST_X64 )
+endif()
+
set( TOOL_OS_SUFFIX "" )
if( CMAKE_HOST_APPLE )
- set( ANDROID_NDK_HOST_SYSTEM_NAME "darwin-x86" )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME "darwin-x86_64" )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME2 "darwin-x86" )
elseif( CMAKE_HOST_WIN32 )
- set( ANDROID_NDK_HOST_SYSTEM_NAME "windows" )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME "windows-x86_64" )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME2 "windows" )
set( TOOL_OS_SUFFIX ".exe" )
elseif( CMAKE_HOST_UNIX )
- set( ANDROID_NDK_HOST_SYSTEM_NAME "linux-x86" )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME "linux-x86_64" )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME2 "linux-x86" )
else()
message( FATAL_ERROR "Cross-compilation on your platform is not supported by this cmake toolchain" )
endif()
+if( NOT ANDROID_NDK_HOST_X64 )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} )
+endif()
+
# see if we have path to Android NDK
__INIT_VARIABLE( ANDROID_NDK PATH ENV_ANDROID_NDK )
if( NOT ANDROID_NDK )
@@ -509,7 +532,8 @@ if( ANDROID_NDK )
endif()
set( ANDROID_NDK "${ANDROID_NDK}" CACHE INTERNAL "Path of the Android NDK" FORCE )
set( BUILD_WITH_ANDROID_NDK True )
- file( STRINGS "${ANDROID_NDK}/RELEASE.TXT" ANDROID_NDK_RELEASE LIMIT_COUNT 1 REGEX r[0-9]+[a-z]? )
+ file( STRINGS "${ANDROID_NDK}/RELEASE.TXT" ANDROID_NDK_RELEASE_FULL LIMIT_COUNT 1 REGEX r[0-9]+[a-z]? )
+ string( REGEX MATCH r[0-9]+[a-z]? ANDROID_NDK_RELEASE "${ANDROID_NDK_RELEASE_FULL}" )
elseif( ANDROID_STANDALONE_TOOLCHAIN )
get_filename_component( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" ABSOLUTE )
# try to detect change
@@ -563,22 +587,21 @@ if( BUILD_WITH_STANDALONE_TOOLCHAIN )
endif()
endif()
-macro( __GLOB_NDK_TOOLCHAINS __availableToolchainsVar )
- foreach( __toolchain ${${__availableToolchainsVar}} )
+macro( __GLOB_NDK_TOOLCHAINS __availableToolchainsVar __availableToolchainsLst __host_system_name )
+ foreach( __toolchain ${${__availableToolchainsLst}} )
if( "${__toolchain}" MATCHES "-clang3[.][0-9]$" AND NOT EXISTS "${ANDROID_NDK}/toolchains/${__toolchain}/prebuilt/" )
string( REGEX REPLACE "-clang3[.][0-9]$" "-4.6" __gcc_toolchain "${__toolchain}" )
else()
set( __gcc_toolchain "${__toolchain}" )
endif()
- __DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK}/toolchains/${__gcc_toolchain}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
+ __DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK}/toolchains/${__gcc_toolchain}/prebuilt/${__host_system_name}" )
if( __machine )
string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9]+)?$" __version "${__gcc_toolchain}" )
string( REGEX MATCH "^[^-]+" __arch "${__gcc_toolchain}" )
list( APPEND __availableToolchainMachines "${__machine}" )
list( APPEND __availableToolchainArchs "${__arch}" )
list( APPEND __availableToolchainCompilerVersions "${__version}" )
- else()
- list( REMOVE_ITEM ${__availableToolchainsVar} "${__toolchain}" )
+ list( APPEND ${__availableToolchainsVar} "${__toolchain}" )
endif()
unset( __gcc_toolchain )
endforeach()
@@ -594,17 +617,29 @@ if( BUILD_WITH_ANDROID_NDK )
set( __availableToolchainCompilerVersions "" )
if( ANDROID_TOOLCHAIN_NAME AND EXISTS "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/" )
# do not go through all toolchains if we know the name
- set( __availableToolchains "${ANDROID_TOOLCHAIN_NAME}" )
- __GLOB_NDK_TOOLCHAINS( __availableToolchains )
+ set( __availableToolchainsLst "${ANDROID_TOOLCHAIN_NAME}" )
+ __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst ${ANDROID_NDK_HOST_SYSTEM_NAME} )
+ if( NOT __availableToolchains AND NOT ANDROID_NDK_HOST_SYSTEM_NAME STREQUAL ANDROID_NDK_HOST_SYSTEM_NAME2 )
+ __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst ${ANDROID_NDK_HOST_SYSTEM_NAME2} )
+ if( __availableToolchains )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} )
+ endif()
+ endif()
endif()
if( NOT __availableToolchains )
- file( GLOB __availableToolchains RELATIVE "${ANDROID_NDK}/toolchains" "${ANDROID_NDK}/toolchains/*" )
+ file( GLOB __availableToolchainsLst RELATIVE "${ANDROID_NDK}/toolchains" "${ANDROID_NDK}/toolchains/*" )
if( __availableToolchains )
- list(SORT __availableToolchains) # we need clang to go after gcc
+ list(SORT __availableToolchainsLst) # we need clang to go after gcc
+ endif()
+ __LIST_FILTER( __availableToolchainsLst "^[.]" )
+ __LIST_FILTER( __availableToolchainsLst "llvm" )
+ __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst ${ANDROID_NDK_HOST_SYSTEM_NAME} )
+ if( NOT __availableToolchains AND NOT ANDROID_NDK_HOST_SYSTEM_NAME STREQUAL ANDROID_NDK_HOST_SYSTEM_NAME2 )
+ __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst ${ANDROID_NDK_HOST_SYSTEM_NAME2} )
+ if( __availableToolchains )
+ set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} )
+ endif()
endif()
- __LIST_FILTER( __availableToolchains "^[.]" )
- __LIST_FILTER( __availableToolchains "llvm" )
- __GLOB_NDK_TOOLCHAINS( __availableToolchains )
endif()
if( NOT __availableToolchains )
message( FATAL_ERROR "Could not find any working toolchain in the NDK. Probably your Android NDK is broken." )
@@ -617,11 +652,11 @@ set( __uniqToolchainArchNames ${__availableToolchainArchs} )
list( REMOVE_DUPLICATES __uniqToolchainArchNames )
list( SORT __uniqToolchainArchNames )
foreach( __arch ${__uniqToolchainArchNames} )
-list( APPEND ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${__arch}} )
+ list( APPEND ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${__arch}} )
endforeach()
unset( __uniqToolchainArchNames )
if( NOT ANDROID_SUPPORTED_ABIS )
-message( FATAL_ERROR "No one of known Android ABIs is supported by this cmake toolchain." )
+ message( FATAL_ERROR "No one of known Android ABIs is supported by this cmake toolchain." )
endif()
# choose target ABI
@@ -760,11 +795,22 @@ unset( __availableToolchainCompilerVersions )
# choose native API level
__INIT_VARIABLE( ANDROID_NATIVE_API_LEVEL ENV_ANDROID_NATIVE_API_LEVEL ANDROID_API_LEVEL ENV_ANDROID_API_LEVEL ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME} ANDROID_DEFAULT_NDK_API_LEVEL )
string( REGEX MATCH "[0-9]+" ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" )
-# TODO: filter out unsupported levels
+# adjust API level
+set( __real_api_level ${ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME}} )
+foreach( __level ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )
+ if( NOT __level GREATER ANDROID_NATIVE_API_LEVEL AND NOT __level LESS __real_api_level )
+ set( __real_api_level ${__level} )
+ endif()
+endforeach()
+if( __real_api_level AND NOT ANDROID_NATIVE_API_LEVEL EQUAL __real_api_level )
+ message( STATUS "Adjusting Android API level 'android-${ANDROID_NATIVE_API_LEVEL}' to 'android-${__real_api_level}'")
+ set( ANDROID_NATIVE_API_LEVEL ${__real_api_level} )
+endif()
+unset(__real_api_level)
# validate
list( FIND ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_NATIVE_API_LEVEL}" __levelIdx )
if( __levelIdx EQUAL -1 )
- message( SEND_ERROR "Specified Android native API level (${ANDROID_NATIVE_API_LEVEL}) is not supported by your NDK/toolchain." )
+ message( SEND_ERROR "Specified Android native API level 'android-${ANDROID_NATIVE_API_LEVEL}' is not supported by your NDK/toolchain." )
else()
if( BUILD_WITH_ANDROID_NDK )
__DETECT_NATIVE_API_LEVEL( __realApiLevel "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h" )
@@ -926,7 +972,7 @@ elseif( "${ANDROID_TOOLCHAIN_NAME}" MATCHES "-clang3[.][0-9]?$" )
string( REGEX MATCH "3[.][0-9]$" ANDROID_CLANG_VERSION "${ANDROID_TOOLCHAIN_NAME}")
string( REGEX REPLACE "-clang${ANDROID_CLANG_VERSION}$" "-4.6" ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" )
if( NOT EXISTS "${ANDROID_NDK}/toolchains/llvm-${ANDROID_CLANG_VERSION}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}/bin/clang${TOOL_OS_SUFFIX}" )
- message( FATAL_ERROR "Could not find the " )
+ message( FATAL_ERROR "Could not find the Clang compiler driver" )
endif()
set( ANDROID_COMPILER_IS_CLANG 1 )
set( ANDROID_CLANG_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/llvm-${ANDROID_CLANG_VERSION}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
@@ -1140,38 +1186,52 @@ endif()
# NDK flags
if( ARMEABI OR ARMEABI_V7A )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fpic -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__" )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fpic -funwind-tables" )
if( NOT ANDROID_FORCE_ARM_BUILD AND NOT ARMEABI_V6 )
- # It is recommended to use the -mthumb compiler flag to force the generation
- # of 16-bit Thumb-1 instructions (the default being 32-bit ARM ones).
- set( ANDROID_CXX_FLAGS_RELEASE "-mthumb" )
- set( ANDROID_CXX_FLAGS_DEBUG "-marm -finline-limit=64" )
+ set( ANDROID_CXX_FLAGS_RELEASE "-mthumb -fomit-frame-pointer -fno-strict-aliasing" )
+ set( ANDROID_CXX_FLAGS_DEBUG "-marm -fno-omit-frame-pointer -fno-strict-aliasing" )
+ if( NOT ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -finline-limit=64" )
+ endif()
else()
# always compile ARMEABI_V6 in arm mode; otherwise there is no difference from ARMEABI
- # O3 instead of O2/Os in release mode - like cmake sets for desktop gcc
- set( ANDROID_CXX_FLAGS_RELEASE "-marm" )
- set( ANDROID_CXX_FLAGS_DEBUG "-marm -finline-limit=300" )
+ set( ANDROID_CXX_FLAGS_RELEASE "-marm -fomit-frame-pointer -fstrict-aliasing" )
+ set( ANDROID_CXX_FLAGS_DEBUG "-marm -fno-omit-frame-pointer -fno-strict-aliasing" )
+ if( NOT ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300" )
+ endif()
endif()
elseif( X86 )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" )
- set( ANDROID_CXX_FLAGS_RELEASE "" )
- set( ANDROID_CXX_FLAGS_DEBUG "-finline-limit=300" )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" )
+ if( NOT ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300" )
+ else()
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fPIC" )
+ endif()
+ set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer -fstrict-aliasing" )
+ set( ANDROID_CXX_FLAGS_DEBUG "-fno-omit-frame-pointer -fno-strict-aliasing" )
elseif( MIPS )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fpic -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -frename-registers" )
- set( ANDROID_CXX_FLAGS_RELEASE "-finline-limit=300 -fno-strict-aliasing" )
- set( ANDROID_CXX_FLAGS_DEBUG "-finline-functions -fgcse-after-reload -frerun-cse-after-loop" )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fpic -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0" )
+ set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer" )
+ set( ANDROID_CXX_FLAGS_DEBUG "-fno-omit-frame-pointer" )
+ if( NOT ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers" )
+ set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} -funswitch-loops -finline-limit=300" )
+ endif()
elseif()
set( ANDROID_CXX_FLAGS_RELEASE "" )
set( ANDROID_CXX_FLAGS_DEBUG "" )
endif()
-if( NOT X86 )
- set( ANDROID_CXX_FLAGS "-Wno-psabi ${ANDROID_CXX_FLAGS}" )
+set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fsigned-char" ) # good/necessary when porting desktop libraries
+
+if( NOT X86 AND NOT ANDROID_COMPILER_IS_CLANG )
+ set( ANDROID_CXX_FLAGS "-Wno-psabi ${ANDROID_CXX_FLAGS}" )
endif()
-set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fsigned-char" ) # good/necessary when porting desktop libraries
-set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} -fomit-frame-pointer" )
-set( ANDROID_CXX_FLAGS_DEBUG "${ANDROID_CXX_FLAGS_DEBUG} -fno-strict-aliasing -fno-omit-frame-pointer" )
+if( NOT ANDROID_COMPILER_VERSION VERSION_LESS "4.6" )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -no-canonical-prefixes" ) # see https://android-review.googlesource.com/#/c/47564/
+endif()
# ABI-specific flags
if( ARMEABI_V7A )
@@ -1308,9 +1368,6 @@ if( ANDROID_COMPILER_IS_CLANG )
set( ANDROID_CXX_FLAGS "-target ${ANDROID_LLVM_TRIPLE} ${ANDROID_CXX_FLAGS}" )
endif()
if( BUILD_WITH_ANDROID_NDK )
- if(ANDROID_ARCH_NAME STREQUAL "arm" )
- set( ANDROID_CXX_FLAGS "-isystem ${ANDROID_CLANG_TOOLCHAIN_ROOT}/lib/clang/${ANDROID_CLANG_VERSION}/include ${ANDROID_CXX_FLAGS}" )
- endif()
set( ANDROID_CXX_FLAGS "-gcc-toolchain ${ANDROID_TOOLCHAIN_ROOT} ${ANDROID_CXX_FLAGS}" )
endif()
endif()
@@ -1326,6 +1383,12 @@ set( CMAKE_SHARED_LINKER_FLAGS "" CACHE STRING "shared li
set( CMAKE_MODULE_LINKER_FLAGS "" CACHE STRING "module linker flags" )
set( CMAKE_EXE_LINKER_FLAGS "-Wl,-z,nocopyreloc" CACHE STRING "executable linker flags" )
+# put flags to cache (for debug purpose only)
+set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS}" CACHE INTERNAL "Android specific c/c++ flags" )
+set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE}" CACHE INTERNAL "Android specific c/c++ Release flags" )
+set( ANDROID_CXX_FLAGS_DEBUG "${ANDROID_CXX_FLAGS_DEBUG}" CACHE INTERNAL "Android specific c/c++ Debug flags" )
+set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS}" CACHE INTERNAL "Android specific c/c++ linker flags" )
+
# finish flags
set( CMAKE_CXX_FLAGS "${ANDROID_CXX_FLAGS} ${CMAKE_CXX_FLAGS}" )
set( CMAKE_C_FLAGS "${ANDROID_CXX_FLAGS} ${CMAKE_C_FLAGS}" )
@@ -1456,6 +1519,7 @@ endmacro()
if( NOT PROJECT_NAME STREQUAL "CMAKE_TRY_COMPILE" )
set( __toolchain_config "")
foreach( __var NDK_CCACHE LIBRARY_OUTPUT_PATH_ROOT ANDROID_FORBID_SYGWIN ANDROID_SET_OBSOLETE_VARIABLES
+ ANDROID_NDK_HOST_X64
ANDROID_NDK
ANDROID_STANDALONE_TOOLCHAIN
ANDROID_TOOLCHAIN_NAME
@@ -1512,6 +1576,7 @@ endif()
# ANDROID_NDK
# ANDROID_STANDALONE_TOOLCHAIN
# ANDROID_TOOLCHAIN_NAME : the NDK name of compiler toolchain
+# ANDROID_NDK_HOST_X64 : try to use x86_64 toolchain (default for x64 host systems)
# LIBRARY_OUTPUT_PATH_ROOT : <any valid path>
# NDK_CCACHE : <path to your ccache executable>
# Obsolete:
@@ -1536,7 +1601,7 @@ endif()
# BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used
# ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform
# ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86" or "mips" depending on ANDROID_ABI
-# ANDROID_NDK_RELEASE : one of r5, r5b, r5c, r6, r6b, r7, r7b, r7c, r8, r8b, r8c, r8d; set only for NDK
+# ANDROID_NDK_RELEASE : one of r5, r5b, r5c, r6, r6b, r7, r7b, r7c, r8, r8b, r8c, r8d, r8e; set only for NDK
# ANDROID_ARCH_NAME : "arm" or "x86" or "mips" depending on ANDROID_ABI
# ANDROID_SYSROOT : path to the compiler sysroot
# TOOL_OS_SUFFIX : "" or ".exe" depending on host platform
View
4 android/service/doc/JavaHelper.rst
@@ -51,3 +51,7 @@ OpenCV version constants
.. data:: OPENCV_VERSION_2_4_4
OpenCV Library version 2.4.4
+
+.. data:: OPENCV_VERSION_2_4_5
+
+ OpenCV Library version 2.4.5
View
7 android/service/engine/AndroidManifest.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.opencv.engine"
- android:versionCode="26@ANDROID_PLATFORM_VERSION_CODE@"
- android:versionName="2.6" >
+ android:versionCode="27@ANDROID_PLATFORM_VERSION_CODE@"
+ android:versionName="2.7" >
<uses-sdk android:minSdkVersion="@ANDROID_NATIVE_API_LEVEL@" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
@@ -26,6 +26,5 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
-
-</application>
+ </application>
</manifest>
View
2  android/service/engine/jni/BinderComponent/OpenCVEngine.cpp
@@ -15,7 +15,7 @@ using namespace android;
const int OpenCVEngine::Platform = DetectKnownPlatforms();
const int OpenCVEngine::CpuID = GetCpuID();
-const int OpenCVEngine::KnownVersions[] = {2040000, 2040100, 2040200, 2040300, 2040301, 2040302, 2040400};
+const int OpenCVEngine::KnownVersions[] = {2040000, 2040100, 2040200, 2040300, 2040301, 2040302, 2040400, 2040500};
bool OpenCVEngine::ValidateVersion(int version)
{
View
2  android/service/engine/jni/Tests/OpenCVEngineTest.cpp
@@ -294,7 +294,7 @@ TEST(OpenCVEngineTest, GetPathFor2_4_5)
Starter.PackageManager->InstallVersion(2040500, PLATFORM_UNKNOWN, ARCH_ARMv7);
EXPECT_FALSE(NULL == Engine.get());
String16 result = Engine->GetLibPathByVersion(String16("2.4.5"));
- EXPECT_EQ(0, result.size()); // 2.4.5 is not published yet
+ EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
}
#endif
View
2  android/service/engine/project.properties
@@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
-target=android-9
+target=android-8
View
12 android/service/readme.txt
@@ -14,20 +14,20 @@ manually using adb tool:
.. code-block:: sh
- adb install OpenCV-2.4.4-android-sdk/apk/OpenCV_2.4.4_Manager_2.6_<platform>.apk
+ adb install OpenCV-2.4.5-android-sdk/apk/OpenCV_2.4.5_Manager_2.7_<platform>.apk
Use the table below to determine proper OpenCV Manager package for your device:
+------------------------------+--------------+---------------------------------------------------+
| Hardware Platform | Android ver. | Package name |
+==============================+==============+===================================================+
-| armeabi-v7a (ARMv7-A + NEON) | >= 2.3 | OpenCV_2.4.4_Manager_2.6_armv7a-neon.apk |
+| armeabi-v7a (ARMv7-A + NEON) | >= 2.3 | OpenCV_2.4.5_Manager_2.7_armv7a-neon.apk |
+------------------------------+--------------+---------------------------------------------------+
-| armeabi-v7a (ARMv7-A + NEON) | = 2.2 | OpenCV_2.4.4_Manager_2.6_armv7a-neon-android8.apk |
+| armeabi-v7a (ARMv7-A + NEON) | = 2.2 | OpenCV_2.4.5_Manager_2.7_armv7a-neon-android8.apk |
+------------------------------+--------------+---------------------------------------------------+
-| armeabi (ARMv5, ARMv6) | >= 2.3 | OpenCV_2.4.4_Manager_2.6_armeabi.apk |
+| armeabi (ARMv5, ARMv6) | >= 2.3 | OpenCV_2.4.5_Manager_2.7_armeabi.apk |
+------------------------------+--------------+---------------------------------------------------+
-| Intel x86 | >= 2.3 | OpenCV_2.4.4_Manager_2.6_x86.apk |
+| Intel x86 | >= 2.3 | OpenCV_2.4.5_Manager_2.7_x86.apk |
+------------------------------+--------------+---------------------------------------------------+
-| MIPS | >= 2.3 | OpenCV_2.4.4_Manager_2.6_mips.apk |
+| MIPS | >= 2.3 | OpenCV_2.4.5_Manager_2.7_mips.apk |
+------------------------------+--------------+---------------------------------------------------+
View
1  cmake/OpenCVDetectAndroidSDK.cmake
@@ -278,6 +278,7 @@ macro(add_android_project target path)
if (NATIVE_APP_GLUE)
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
list(APPEND android_proj_jni_files ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
+ ocv_warnings_disable(CMAKE_C_FLAGS -Wstrict-prototypes -Wunused-parameter -Wmissing-prototypes)
set(android_proj_NATIVE_DEPS ${android_proj_NATIVE_DEPS} android)
endif()
View
7 cmake/OpenCVDetectCUDA.cmake
@@ -57,7 +57,7 @@ if(CUDA_FOUND)
elseif(CUDA_GENERATION STREQUAL "Kepler")
set(__cuda_arch_bin "3.0")
elseif(CUDA_GENERATION STREQUAL "Auto")
- execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCudaArch.cu" "--run"
+ execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -142,11 +142,14 @@ if(CUDA_FOUND)
foreach(var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG)
set(${var}_backup_in_cuda_compile_ "${${var}}")
- # we reomove /EHa as it leasd warnings under windows
+ # we remove /EHa as it generates warnings under windows
string(REPLACE "/EHa" "" ${var} "${${var}}")
# we remove -ggdb3 flag as it leads to preprocessor errors when compiling CUDA files (CUDA 4.1)
string(REPLACE "-ggdb3" "" ${var} "${${var}}")
+
+ # we remove -Wsign-promo as it generates warnings under linux
+ string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")
endforeach()
if(BUILD_SHARED_LIBS)
View
6 cmake/OpenCVDetectCXXCompiler.cmake
@@ -93,14 +93,16 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
OUTPUT_VARIABLE CMAKE_OPENCV_GCC_TARGET_MACHINE
OUTPUT_STRIP_TRAILING_WHITESPACE)
- if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "64")
+ if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "amd64|x86_64|AMD64")
set(MINGW64 1)
endif()
endif()
endif()
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*" OR CMAKE_GENERATOR MATCHES "Visual Studio.*Win64")
+if(MINGW64 OR CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*" OR CMAKE_GENERATOR MATCHES "Visual Studio.*Win64")
set(X86_64 1)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*|amd64.*|AMD64.*")
set(X86 1)
+elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*|ARM.*")
+ set(ARM 1)
endif()
View
12 cmake/OpenCVFindLibsGUI.cmake
@@ -2,6 +2,16 @@
# Detect 3rd-party GUI libraries
# ----------------------------------------------------------------------------
+#--- Win32 UI ---
+ocv_clear_vars(HAVE_WIN32UI)
+if(WITH_WIN32UI)
+ TRY_COMPILE(HAVE_WIN32UI
+ "${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp"
+ "${OpenCV_SOURCE_DIR}/cmake/checks/win32uitest.cpp"
+ CMAKE_FLAGS "\"user32.lib\" \"gdi32.lib\""
+ OUTPUT_VARIABLE OUTPUT)
+endif(WITH_WIN32UI)
+
# --- QT4 ---
ocv_clear_vars(HAVE_QT)
if(WITH_QT)
@@ -25,7 +35,7 @@ endif()
# --- OpenGl ---
ocv_clear_vars(HAVE_OPENGL HAVE_QT_OPENGL)
if(WITH_OPENGL)
- if(WIN32 OR QT_QTOPENGL_FOUND OR HAVE_GTKGLEXT)
+ if(WITH_WIN32UI OR (HAVE_QT AND QT_QTOPENGL_FOUND) OR HAVE_GTKGLEXT)
find_package (OpenGL QUIET)
if(OPENGL_FOUND)
set(HAVE_OPENGL TRUE)
View
1  cmake/OpenCVFindLibsGrfmt.cmake
@@ -151,6 +151,7 @@ if(WITH_PNG AND NOT IOS)
else()
include(FindPNG)
if(PNG_FOUND)
+ include(CheckIncludeFile)
check_include_file("${PNG_PNG_INCLUDE_DIR}/png.h" HAVE_PNG_H)
check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H)
if(HAVE_PNG_H)
View
10 cmake/OpenCVFindLibsPerf.cmake
@@ -88,8 +88,9 @@ endif()
# --- OpenMP ---
if(NOT HAVE_TBB AND NOT HAVE_CSTRIPES)
set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/omptest.cpp")
- FILE(WRITE "${_fname}" "#ifndef _OPENMP\n#error\n#endif\nint main() { return 0; }\n")
- TRY_COMPILE(HAVE_OPENMP "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp" "${_fname}")
+ file(WRITE "${_fname}" "#ifndef _OPENMP\n#error\n#endif\nint main() { return 0; }\n")
+ try_compile(HAVE_OPENMP "${CMAKE_BINARY_DIR}" "${_fname}")
+ file(REMOVE "${_fname}")
else()
set(HAVE_OPENMP 0)
endif()
@@ -104,8 +105,9 @@ 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}${CMAKE_FILES_DIRECTORY}/CMakeTmp" "${_fname}")
+ 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()
View
26 cmake/OpenCVFindLibsVideo.cmake
@@ -2,6 +2,15 @@
# Detect 3rd-party video IO libraries
# ----------------------------------------------------------------------------
+ocv_clear_vars(HAVE_VFW)
+if (WITH_VFW)
+ TRY_COMPILE(HAVE_VFW
+ "${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp"
+ "${OpenCV_SOURCE_DIR}/cmake/checks/vfwtest.cpp"
+ CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=vfw32"
+ OUTPUT_VARIABLE OUTPUT)
+ endif(WITH_VFW)
+
# --- GStreamer ---
ocv_clear_vars(HAVE_GSTREAMER)
# try to find gstreamer 0.10 first
@@ -66,7 +75,7 @@ if(WITH_PVAPI)
set(PVAPI_SDK_SUBDIR x86)
elseif(X86_64)
set(PVAPI_SDK_SUBDIR x64)
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES arm)
+ elseif(ARM)
set(PVAPI_SDK_SUBDIR arm)
endif()
@@ -140,7 +149,7 @@ endif(WITH_XIMEA)
# --- FFMPEG ---
ocv_clear_vars(HAVE_FFMPEG HAVE_FFMPEG_CODEC HAVE_FFMPEG_FORMAT HAVE_FFMPEG_UTIL HAVE_FFMPEG_SWSCALE HAVE_GENTOO_FFMPEG HAVE_FFMPEG_FFMPEG)
if(WITH_FFMPEG)
- if(WIN32)
+ if(WIN32 AND NOT ARM)
include("${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/ffmpeg_version.cmake")
elseif(UNIX)
CHECK_MODULE(libavcodec HAVE_FFMPEG_CODEC)
@@ -204,11 +213,16 @@ if(WITH_FFMPEG)
endif(APPLE)
endif(WITH_FFMPEG)
-# --- VideoInput ---
-if(WITH_VIDEOINPUT)
+# --- VideoInput/DirectShow ---
+if(WITH_DSHOW)
# always have VideoInput on Windows
- set(HAVE_VIDEOINPUT 1)
-endif(WITH_VIDEOINPUT)
+ set(HAVE_DSHOW 1)
+endif(WITH_DSHOW)
+
+# --- VideoInput/Microsoft Media Foundation ---
+if(WITH_MSMF)
+ check_include_file(Mfapi.h HAVE_MSMF)
+endif(WITH_MSMF)
# --- Extra HighGUI libs on Windows ---
if(WIN32)
View
1  cmake/OpenCVLegacyOptions.cmake
@@ -12,6 +12,7 @@ endmacro()
ocv_legacy_option(BUILD_NEW_PYTHON_SUPPORT BUILD_opencv_python)
ocv_legacy_option(BUILD_JAVA_SUPPORT BUILD_opencv_java)
ocv_legacy_option(WITH_ANDROID_CAMERA BUILD_opencv_androidcamera)
+ocv_legacy_option(WITH_VIDEOINPUT WITH_DSHOW)
if(DEFINED OPENCV_BUILD_3RDPARTY_LIBS)
set(BUILD_ZLIB ${OPENCV_BUILD_3RDPARTY_LIBS} CACHE BOOL "Set via depricated OPENCV_BUILD_3RDPARTY_LIBS" FORCE)
View
0  cmake/OpenCVDetectCudaArch.cu → cmake/checks/OpenCVDetectCudaArch.cu
File renamed without changes
View
10 cmake/checks/vfwtest.cpp
@@ -0,0 +1,10 @@
+
+#include <windows.h>
+#include <vfw.h>
+
+int main()
+{
+ AVIFileInit();
+ AVIFileExit();
+ return 0;
+}
View
11 cmake/checks/win32uitest.cpp
@@ -0,0 +1,11 @@
+#include <windows.h>
+
+int main(int argc, char** argv)
+{
+ CreateWindow(NULL /*lpClassName*/, NULL /*lpWindowName*/, 0 /*dwStyle*/, 0 /*x*/,
+ 0 /*y*/, 0 /*nWidth*/, 0 /*nHeight*/, NULL /*hWndParent*/, NULL /*hMenu*/,
+ NULL /*hInstance*/, NULL /*lpParam*/);
+ DeleteDC(NULL);
+
+ return 0;
+}
View
13 cmake/templates/cvconfig.h.cmake
@@ -13,6 +13,9 @@
*/
#cmakedefine HAVE_ALLOCA_H 1
+/* Video for Windows support */
+#cmakedefine HAVE_VFW
+
/* V4L capturing support */
#cmakedefine HAVE_CAMV4L
@@ -55,6 +58,9 @@
/* GTK+ 2.0 Thread support */
#cmakedefine HAVE_GTHREAD
+/* Win32 UI */
+#cmakedefine HAVE_WIN32UI
+
/* GTK+ 2.x toolkit */
#cmakedefine HAVE_GTK
@@ -205,8 +211,11 @@
/* AMD's Basic Linear Algebra Subprograms Library*/
#cmakedefine HAVE_CLAMDBLAS
-/* VideoInput library */
-#cmakedefine HAVE_VIDEOINPUT
+/* DirectShow Video Capture library */
+#cmakedefine HAVE_DSHOW
+
+/* Microsoft Media Foundation Capture library */
+#cmakedefine HAVE_MSMF
/* XIMEA camera support */
#cmakedefine HAVE_XIMEA
View
2  doc/_themes/blue/layout.html
@@ -183,7 +183,7 @@
{% if theme_lang == 'c' %}
{% endif %}
{% if theme_lang == 'cpp' %}
- <li>Try the <a href="http://opencv.willowgarage.com/wiki/Welcome?action=AttachFile&do=get&target=opencv_cheatsheet.pdf">Cheatsheet</a>.</li>
+ <li>Try the <a href="http://docs.opencv.org/trunk/opencv_cheatsheet.pdf">Cheatsheet</a>.</li>
{% endif %}
{% if theme_lang == 'py' %}
<li>Try the <a href="cookbook.html">Cookbook</a>.</li>
View
4 doc/tutorials/features2d/feature_description/feature_description.rst
@@ -13,7 +13,7 @@ In this tutorial you will learn how to:
* Use the :descriptor_extractor:`DescriptorExtractor<>` interface in order to find the feature vector correspondent to the keypoints. Specifically:
* Use :surf_descriptor_extractor:`SurfDescriptorExtractor<>` and its function :descriptor_extractor:`compute<>` to perform the required calculations.
- * Use a :brute_force_matcher:`BruteForceMatcher<>` to match the features vector
+ * Use a :brute_force_matcher:`BFMatcher<>` to match the features vector
* Use the function :draw_matches:`drawMatches<>` to draw the detected matches.
@@ -69,7 +69,7 @@ This tutorial code's is shown lines below. You can also download it from `here <
extractor.compute( img_2, keypoints_2, descriptors_2 );
//-- Step 3: Matching descriptor vectors with a brute force matcher
- BruteForceMatcher< L2<float> > matcher;
+ BFMatcher matcher(NORM_L2);
std::vector< DMatch > matches;
matcher.match( descriptors_1, descriptors_2, matches );
View
14 doc/tutorials/introduction/android_binary_package/O4A_SDK.rst
@@ -48,10 +48,10 @@ The structure of package contents looks as follows:
::
- OpenCV-2.4.4-android-sdk
+ OpenCV-2.4.5-android-sdk
|_ apk
- | |_ OpenCV_2.4.4_binary_pack_armv7a.apk
- | |_ OpenCV_2.4.4_Manager_2.6_XXX.apk
+ | |_ OpenCV_2.4.5_binary_pack_armv7a.apk
+ | |_ OpenCV_2.4.5_Manager_2.7_XXX.apk
|
|_ doc
|_ samples
@@ -157,10 +157,10 @@ Get the OpenCV4Android SDK
.. code-block:: bash
- unzip ~/Downloads/OpenCV-2.4.4-android-sdk.zip
+ unzip ~/Downloads/OpenCV-2.4.5-android-sdk.zip
-.. |opencv_android_bin_pack| replace:: :file:`OpenCV-2.4.4-android-sdk.zip`
-.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.4/OpenCV-2.4.4-android-sdk.zip/download
+.. |opencv_android_bin_pack| replace:: :file:`OpenCV-2.4.5-android-sdk.zip`
+.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.5/OpenCV-2.4.5-android-sdk.zip/download
.. |opencv_android_bin_pack_url| replace:: |opencv_android_bin_pack|
.. |seven_zip| replace:: 7-Zip
.. _seven_zip: http://www.7-zip.org/
@@ -295,7 +295,7 @@ Well, running samples from Eclipse is very simple:
.. code-block:: sh
:linenos:
- <Android SDK path>/platform-tools/adb install <OpenCV4Android SDK path>/apk/OpenCV_2.4.4_Manager_2.6_armv7a-neon.apk
+ <Android SDK path>/platform-tools/adb install <OpenCV4Android SDK path>/apk/OpenCV_2.4.5_Manager_2.7_armv7a-neon.apk
.. note:: ``armeabi``, ``armv7a-neon``, ``arm7a-neon-android8``, ``mips`` and ``x86`` stand for
platform targets:
View
16 doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst
@@ -55,14 +55,14 @@ Manager to access OpenCV libraries externally installed in the target system.
:guilabel:`File -> Import -> Existing project in your workspace`.
Press :guilabel:`Browse` button and locate OpenCV4Android SDK
- (:file:`OpenCV-2.4.4-android-sdk/sdk`).
+ (:file:`OpenCV-2.4.5-android-sdk/sdk`).
.. image:: images/eclipse_opencv_dependency0.png
:alt: Add dependency from OpenCV library
:align: center
#. In application project add a reference to the OpenCV Java SDK in
- :guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.4``.
+ :guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.5``.
.. image:: images/eclipse_opencv_dependency1.png
:alt: Add dependency from OpenCV library
@@ -101,7 +101,7 @@ See the "15-puzzle" OpenCV sample for details.
public void onResume()
{
super.onResume();
- OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mLoaderCallback);
+ OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_5, this, mLoaderCallback);
}
...
@@ -128,27 +128,27 @@ described above.
#. Add the OpenCV library project to your workspace the same way as for the async initialization
above. Use menu :guilabel:`File -> Import -> Existing project in your workspace`,
press :guilabel:`Browse` button and select OpenCV SDK path
- (:file:`OpenCV-2.4.4-android-sdk/sdk`).
+ (:file:`OpenCV-2.4.5-android-sdk/sdk`).
.. image:: images/eclipse_opencv_dependency0.png
:alt: Add dependency from OpenCV library
:align: center
#. In the application project add a reference to the OpenCV4Android SDK in
- :guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.4``;
+ :guilabel:`Project -> Properties -> Android -> Library -> Add` select ``OpenCV Library - 2.4.5``;
.. image:: images/eclipse_opencv_dependency1.png
:alt: Add dependency from OpenCV library
:align: center
#. If your application project **doesn't have a JNI part**, just copy the corresponding OpenCV
- native libs from :file:`<OpenCV-2.4.4-android-sdk>/sdk/native/libs/<target_arch>` to your
+ native libs from :file:`<OpenCV-2.4.5-android-sdk>/sdk/native/libs/<target_arch>` to your
project directory to folder :file:`libs/<target_arch>`.
In case of the application project **with a JNI part**, instead of manual libraries copying you
need to modify your ``Android.mk`` file:
add the following two code lines after the ``"include $(CLEAR_VARS)"`` and before
- ``"include path_to_OpenCV-2.4.4-android-sdk/sdk/native/jni/OpenCV.mk"``
+ ``"include path_to_OpenCV-2.4.5-android-sdk/sdk/native/jni/OpenCV.mk"``
.. code-block:: make
:linenos:
@@ -221,7 +221,7 @@ taken:
.. code-block:: make
- include C:\Work\OpenCV4Android\OpenCV-2.4.4-android-sdk\sdk\native\jni\OpenCV.mk
+ include C:\Work\OpenCV4Android\OpenCV-2.4.5-android-sdk\sdk\native\jni\OpenCV.mk
Should be inserted into the :file:`jni/Android.mk` file **after** this line:
View
2  doc/tutorials/introduction/linux_eclipse/linux_eclipse.rst
@@ -201,8 +201,6 @@ Assuming that the image to use as the argument would be located in <DisplayImage
V2: Using CMake+OpenCV with Eclipse (plugin CDT)
==================================================
-(See the `getting started <http://opencv.willowgarage.com/wiki/Getting_started>` section of the OpenCV Wiki)
-
Say you have or create a new file, *helloworld.cpp* in a directory called *foo*:
.. code-block:: cpp
View
2  modules/calib3d/test/test_solvepnp_ransac.cpp
@@ -239,7 +239,7 @@ class CV_solvePnP_Test : public CV_solvePnPRansac_Test
}
};
-TEST(Calib3d_SolvePnPRansac, accuracy) { CV_solvePnPRansac_Test test; test.safe_run(); }
+TEST(DISABLED_Calib3d_SolvePnPRansac, accuracy) { CV_solvePnPRansac_Test test; test.safe_run(); }
TEST(Calib3d_SolvePnP, accuracy) { CV_solvePnP_Test test; test.safe_run(); }
View
26 modules/calib3d/test/test_stereomatching.cpp
@@ -460,14 +460,29 @@ void CV_StereoMatchingTest::run(int)
continue;
}
int dispScaleFactor = datasetsParams[datasetName].dispScaleFactor;
- Mat tmp; trueLeftDisp.convertTo( tmp, CV_32FC1, 1.f/dispScaleFactor ); trueLeftDisp = tmp; tmp.release();
+ Mat tmp;
+
+ trueLeftDisp.convertTo( tmp, CV_32FC1, 1.f/dispScaleFactor );
+ trueLeftDisp = tmp;
+ tmp.release();
+
if( !trueRightDisp.empty() )
- trueRightDisp.convertTo( tmp, CV_32FC1, 1.f/dispScaleFactor ); trueRightDisp = tmp; tmp.release();
+ {
+ trueRightDisp.convertTo( tmp, CV_32FC1, 1.f/dispScaleFactor );
+ trueRightDisp = tmp;
+ tmp.release();
+ }
Mat leftDisp, rightDisp;
int ignBorder = max(runStereoMatchingAlgorithm(leftImg, rightImg, leftDisp, rightDisp, ci), EVAL_IGNORE_BORDER);
- leftDisp.convertTo( tmp, CV_32FC1 ); leftDisp = tmp; tmp.release();
- rightDisp.convertTo( tmp, CV_32FC1 ); rightDisp = tmp; tmp.release();
+
+ leftDisp.convertTo( tmp, CV_32FC1 );
+ leftDisp = tmp;
+ tmp.release();
+
+ rightDisp.convertTo( tmp, CV_32FC1 );
+ rightDisp = tmp;
+ tmp.release();
int tempCode = processStereoMatchingResults( resFS, ci, isWrite,
leftImg, rightImg, trueLeftDisp, trueRightDisp, leftDisp, rightDisp, QualityEvalParams(ignBorder));
@@ -531,7 +546,8 @@ int CV_StereoMatchingTest::processStereoMatchingResults( FileStorage& fs, int ca
// rightDisp is not used in current test virsion
int code = cvtest::TS::OK;
assert( fs.isOpened() );
- assert( trueLeftDisp.type() == CV_32FC1 && trueRightDisp.type() == CV_32FC1 );
+ assert( trueLeftDisp.type() == CV_32FC1 );
+ assert( trueRightDisp.empty() || trueRightDisp.type() == CV_32FC1 );
assert( leftDisp.type() == CV_32FC1 && rightDisp.type() == CV_32FC1 );
// get masks for unknown ground truth disparity values
View
2  modules/contrib/doc/facerec/facerec_tutorial.rst
@@ -7,7 +7,7 @@ Face Recognition with OpenCV
Introduction
============
-`OpenCV (Open Source Computer Vision) <http://opencv.willowgarage.com>`_ is a popular computer vision library started by `Intel <http://www.intel.com>`_ in 1999. The cross-platform library sets its focus on real-time image processing and includes patent-free implementations of the latest computer vision algorithms. In 2008 `Willow Garage <http://www.willowgarage.com>`_ took over support and OpenCV 2.3.1 now comes with a programming interface to C, C++, `Python <http://www.python.org>`_ and `Android <http://www.android.com>`_. OpenCV is released under a BSD license so it is used in academic projects and commercial products alike.
+`OpenCV (Open Source Computer Vision) <http://opencv.org>`_ is a popular computer vision library started by `Intel <http://www.intel.com>`_ in 1999. The cross-platform library sets its focus on real-time image processing and includes patent-free implementations of the latest computer vision algorithms. In 2008 `Willow Garage <http://www.willowgarage.com>`_ took over support and OpenCV 2.3.1 now comes with a programming interface to C, C++, `Python <http://www.python.org>`_ and `Android <http://www.android.com>`_. OpenCV is released under a BSD license so it is used in academic projects and commercial products alike.
OpenCV 2.4 now comes with the very new :ocv:class:`FaceRecognizer` class for face recognition, so you can start experimenting with face recognition right away. This document is the guide I've wished for, when I was working myself into face recognition. It shows you how to perform face recognition with :ocv:class:`FaceRecognizer` in OpenCV (with full source code listings) and gives you an introduction into the algorithms behind. I'll also show how to create the visualizations you can find in many publications, because a lot of people asked for.
View
2  modules/contrib/doc/facerec/src/CMakeLists.txt
@@ -6,7 +6,7 @@ project(facerec_cpp_samples)
#SET(OpenCV_DIR /path/to/your/opencv/installation)
# packages
-find_package(OpenCV REQUIRED) # http://opencv.willowgarage.com
+find_package(OpenCV REQUIRED) # http://opencv.org
# probably you should loop through the sample files here
add_executable(facerec_demo facerec_demo.cpp)
View
2  modules/contrib/include/opencv2/contrib/contrib.hpp
@@ -45,4 +45,4 @@
#error this is a compatibility header which should not be used inside the OpenCV library
#endif
-#include "opencv2/contrib.hpp"
+#include "opencv2/contrib.hpp"
View
2  modules/contrib/src/ba.cpp
@@ -1106,7 +1106,7 @@ void LevMarqSparse::bundleAdjust( std::vector<Point3d>& points, //positions of p
Mat rot_vec = levmarP.rowRange(i*num_cam_param, i*num_cam_param+3);
Rodrigues( rot_vec, R[i] );
//translation
- T[i] = levmarP.rowRange(i*num_cam_param + 3, i*num_cam_param+6);
+ levmarP.rowRange(i*num_cam_param + 3, i*num_cam_param+6).copyTo(T[i]);
//intrinsic camera matrix
double* intr_data = (double*)cameraMatrix[i].data;
View
1  modules/contrib/src/fuzzymeanshifttracker.cpp
@@ -380,6 +380,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::initDepthValues(IplImage *maskImage,
{
if (*depthData)
{
+ d = *depthData;
m1 += d;
if (d < mind)
mind = d;
View
2  modules/core/doc/intro.rst
@@ -4,7 +4,7 @@ Introduction
.. highlight:: cpp
-OpenCV (Open Source Computer Vision Library: http://opencv.willowgarage.com/wiki/) is an open-source BSD-licensed library that includes several hundreds of computer vision algorithms. The document describes the so-called OpenCV 2.x API, which is essentially a C++ API, as opposite to the C-based OpenCV 1.x API. The latter is described in opencv1x.pdf.
+OpenCV (Open Source Computer Vision Library: http://opencv.org) is an open-source BSD-licensed library that includes several hundreds of computer vision algorithms. The document describes the so-called OpenCV 2.x API, which is essentially a C++ API, as opposite to the C-based OpenCV 1.x API. The latter is described in opencv1x.pdf.
OpenCV has a modular structure, which means that the package includes several shared or static libraries. The following modules are available:
View
2  modules/core/include/opencv2/core/core.hpp
@@ -45,4 +45,4 @@
#error this is a compatibility header which should not be used inside the OpenCV library
#endif
-#include "opencv2/core.hpp"
+#include "opencv2/core.hpp"
View
10 modules/core/include/opencv2/core/cvdef.h
@@ -360,6 +360,8 @@ CV_INLINE int cvRound( double value )
fistp t;
}
return t;
+#elif defined _MSC_VER && defined _M_ARM && defined HAVE_TEGRA_OPTIMIZATION
+ TEGRA_ROUND(value);
#elif defined HAVE_LRINT || defined CV_ICC || defined __GNUC__
# ifdef HAVE_TEGRA_OPTIMIZATION
TEGRA_ROUND(value);
@@ -367,8 +369,12 @@ CV_INLINE int cvRound( double value )
return (int)lrint(value);
# endif
#else
- // while this is not IEEE754-compliant rounding, it's usually a good enough approximation
- return (int)(value + (value >= 0 ? 0.5 : -0.5));
+ double intpart, fractpart;
+ fractpart = modf(value, &intpart);
+ if ((fabs(fractpart) != 0.5) || ((((int)intpart) % 2) != 0))
+ return (int)(value + (value >= 0 ? 0.5 : -0.5));
+ else
+ return (int)intpart;
#endif
}
View
2  modules/core/include/opencv2/core/mat.hpp
@@ -1704,6 +1704,7 @@ template<typename _Tp> class SparseMatConstIterator_ : public SparseMatConstIter
SparseMatConstIterator_();
//! the full constructor setting the iterator to the first sparse matrix element
SparseMatConstIterator_(const SparseMat_<_Tp>* _m);
+ SparseMatConstIterator_(const SparseMat* _m);
//! the copy constructor
SparseMatConstIterator_(const SparseMatConstIterator_& it);
@@ -1740,6 +1741,7 @@ template<typename _Tp> class CV_EXPORTS SparseMatIterator_ : public SparseMatCon
SparseMatIterator_();
//! the full constructor setting the iterator to the first sparse matrix element
SparseMatIterator_(SparseMat_<_Tp>* _m);
+ SparseMatIterator_(SparseMat* _m);
//! the copy constructor
SparseMatIterator_(const SparseMatIterator_& it);
View
12 modules/core/include/opencv2/core/mat.inl.hpp
@@ -2588,6 +2588,13 @@ SparseMatConstIterator_<_Tp>::SparseMatConstIterator_(const SparseMat_<_Tp>* _m)
{}
template<typename _Tp> inline
+SparseMatConstIterator_<_Tp>::SparseMatConstIterator_(const SparseMat* _m)
+ : SparseMatConstIterator(_m)
+{
+ CV_Assert( _m->type() == DataType<_Tp>::type );
+}
+
+template<typename _Tp> inline
SparseMatConstIterator_<_Tp>::SparseMatConstIterator_(const SparseMatConstIterator_<_Tp>& it)
: SparseMatConstIterator(it)
{}
@@ -2635,6 +2642,11 @@ SparseMatIterator_<_Tp>::SparseMatIterator_(SparseMat_<_Tp>* _m)
{}
template<typename _Tp> inline
+SparseMatIterator_<_Tp>::SparseMatIterator_(SparseMat* _m)
+ : SparseMatConstIterator_<_Tp>(_m)
+{}
+
+template<typename _Tp> inline
SparseMatIterator_<_Tp>::SparseMatIterator_(const SparseMatIterator_<_Tp>& it)
: SparseMatConstIterator_<_Tp>(it)
{}
View
36 modules/core/src/lapack.cpp
@@ -577,10 +577,10 @@ JacobiSVDImpl_(_Tp* At, size_t astep, _Tp* _W, _Tp* Vt, size_t vstep,
continue;
p *= 2;
- double beta = a - b, gamma = hypot((double)p, beta), delta;
+ double beta = a - b, gamma = hypot((double)p, beta);
if( beta < 0 )
{
- delta = (gamma - beta)*0.5;
+ double delta = (gamma - beta)*0.5;
s = (_Tp)std::sqrt(delta/gamma);
c = (_Tp)(p/(gamma*s*2));
}
@@ -588,36 +588,18 @@ JacobiSVDImpl_(_Tp* At, size_t astep, _Tp* _W, _Tp* Vt, size_t vstep,
{
c = (_Tp)std::sqrt((gamma + beta)/(gamma*2));
s = (_Tp)(p/(gamma*c*2));
- delta = p*p*0.5/(gamma + beta);
}
- W[i] += delta;
- W[j] -= delta;
-
- if( iter % 2 != 0 && W[i] > 0 && W[j] > 0 )
- {
- k = vblas.givens(Ai, Aj, m, c, s);
-
- for( ; k < m; k++ )
- {
- _Tp t0 = c*Ai[k] + s*Aj[k];
- _Tp t1 = -s*Ai[k] + c*Aj[k];
- Ai[k] = t0; Aj[k] = t1;
- }
- }
- else
+ a = b = 0;
+ for( k = 0; k < m; k++ )
{
- a = b = 0;
- for( k = 0; k < m; k++ )
- {
- _Tp t0 = c*Ai[k] + s*Aj[k];
- _Tp t1 = -s*Ai[k] + c*Aj[k];
- Ai[k] = t0; Aj[k] = t1;
+ _Tp t0 = c*Ai[k] + s*Aj[k];
+ _Tp t1 = -s*Ai[k] + c*Aj[k];
+ Ai[k] = t0; Aj[k] = t1;
- a += (double)t0*t0; b += (double)t1*t1;
- }
- W[i] = a; W[j] = b;
+ a += (double)t0*t0; b += (double)t1*t1;
}
+ W[i] = a; W[j] = b;
changed = true;
View
2  modules/core/src/matop.cpp
@@ -324,7 +324,7 @@ void MatOp::augAssignXor(const MatExpr& expr, Mat& m) const
{
Mat temp;
expr.op->assign(expr, temp);
- m /= temp;
+ m ^= temp;
}
View
2  modules/core/src/matrix.cpp
@@ -183,7 +183,7 @@ static void finalizeHdr(Mat& m)
void Mat::create(int d, const int* _sizes, int _type)
{
int i;
- CV_Assert(0 <= d && _sizes && d <= CV_MAX_DIM && _sizes);
+ CV_Assert(0 <= d && d <= CV_MAX_DIM && _sizes);
_type = CV_MAT_TYPE(_type);
if( data && (d == dims || (d == 1 && dims <= 2)) && _type == type() )
View
13 modules/core/test/test_arithm.cpp
@@ -1551,3 +1551,16 @@ TEST(Core_Add, AddToColumnWhen4Rows)
ASSERT_EQ(0, countNonZero(m1 - m2));
}
+
+TEST(Core_round, CvRound)
+{
+ ASSERT_EQ(2, cvRound(2.0));
+ ASSERT_EQ(2, cvRound(2.1));
+ ASSERT_EQ(-2, cvRound(-2.1));
+ ASSERT_EQ(3, cvRound(2.8));
+ ASSERT_EQ(-3, cvRound(-2.8));
+ ASSERT_EQ(2, cvRound(2.5));
+ ASSERT_EQ(4, cvRound(3.5));
+ ASSERT_EQ(-2, cvRound(-2.5));
+ ASSERT_EQ(-4, cvRound(-3.5));
+}
View
2  modules/features2d/doc/feature_detection_and_description.rst
@@ -48,7 +48,7 @@ Maximally stable extremal region extractor. ::
};
The class encapsulates all the parameters of the MSER extraction algorithm (see
-http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions). Also see http://opencv.willowgarage.com/wiki/documentation/cpp/features2d/MSER for useful comments and parameters description.
+http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions). Also see http://code.opencv.org/projects/opencv/wiki/MSER for useful comments and parameters description.
ORB
View
2  modules/features2d/src/keypoint.cpp
@@ -69,7 +69,7 @@ struct KeypointResponseGreater
void KeyPointsFilter::retainBest(std::vector<KeyPoint>& keypoints, int n_points)
{
//this is only necessary if the keypoints size is greater than the number of desired points.
- if( n_points > 0 && keypoints.size() > (size_t)n_points )
+ if( n_points >= 0 && keypoints.size() > (size_t)n_points )
{
if (n_points==0)
{
View
7 modules/flann/include/opencv2/flann/dist.h
@@ -421,7 +421,6 @@ struct Hamming
ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const
{
ResultType result = 0;
-#ifdef __GNUC__
#ifdef __ARM_NEON__
{
uint32x4_t bits = vmovq_n_u32(0);
@@ -438,7 +437,7 @@ struct Hamming
result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);
result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);
}
-#else
+#elif __GNUC__
{
//for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll)
typedef unsigned long long pop_t;
@@ -458,8 +457,8 @@ struct Hamming
result += __builtin_popcountll(a_final ^ b_final);
}
}
-#endif //NEON
-#else
+#else // NO NEON and NOT GNUC
+ typedef unsigned long long pop_t;
HammingLUT lut;
result = lut(reinterpret_cast<const unsigned char*> (a),
reinterpret_cast<const unsigned char*> (b), size * sizeof(pop_t));
View
2  modules/gpu/CMakeLists.txt
@@ -29,8 +29,6 @@ if(HAVE_CUDA)
source_group("Src\\NVidia" FILES ${ncv_files})
ocv_include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS})
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations -Wshadow -Wunused-parameter /wd4211 /wd4201 /wd4100 /wd4505 /wd4408)
- string(REPLACE "-Wsign-promo" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;")
if(MSVC)
if(NOT ENABLE_NOISY_WARNINGS)
View
4 modules/gpu/perf/perf_video.cpp
@@ -1007,7 +1007,7 @@ PERF_TEST_P(Video_Cn_MaxFeatures, Video_GMG,
#if defined(HAVE_NVCUVID) && BUILD_WITH_VIDEO_INPUT_SUPPORT
-PERF_TEST_P(Video, Video_VideoReader, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"))
+PERF_TEST_P(Video, DISABLED_Video_VideoReader, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"))
{
declare.time(20);
@@ -1044,7 +1044,7 @@ PERF_TEST_P(Video, Video_VideoReader, Values("gpu/video/768x576.avi", "gpu/video
#if defined(HAVE_NVCUVID) && defined(WIN32)
-PERF_TEST_P(Video, Video_VideoWriter, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"))
+PERF_TEST_P(Video, DISABLED_Video_VideoWriter, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"))
{
declare.time(30);
View
10 modules/gpu/src/element_operations.cpp
@@ -1793,10 +1793,10 @@ void cv::gpu::exp(const GpuMat& src, GpuMat& dst, Stream& stream)
namespace arithm
{
- void cmpMatEq_v4(PtrStepSz<uint> src1, PtrStepSz<uint> src2, PtrStepSz<uint> dst, cudaStream_t stream);
- void cmpMatNe_v4(PtrStepSz<uint> src1, PtrStepSz<uint> src2, PtrStepSz<uint> dst, cudaStream_t stream);
- void cmpMatLt_v4(PtrStepSz<uint> src1, PtrStepSz<uint> src2, PtrStepSz<uint> dst, cudaStream_t stream);
- void cmpMatLe_v4(PtrStepSz<uint> src1, PtrStepSz<uint> src2, PtrStepSz<uint> dst, cudaStream_t stream);
+ void cmpMatEq_v4(PtrStepSz<unsigned int> src1, PtrStepSz<unsigned int> src2, PtrStepSz<unsigned int> dst, cudaStream_t stream);
+ void cmpMatNe_v4(PtrStepSz<unsigned int> src1, PtrStepSz<unsigned int> src2, PtrStepSz<unsigned int> dst, cudaStream_t stream);
+ void cmpMatLt_v4(PtrStepSz<unsigned int> src1, PtrStepSz<unsigned int> src2, PtrStepSz<unsigned int> dst, cudaStream_t stream);
+ void cmpMatLe_v4(PtrStepSz<unsigned int> src1, PtrStepSz<unsigned int> src2, PtrStepSz<unsigned int> dst, cudaStream_t stream);
template <typename T> void cmpMatEq(PtrStepSzb src1, PtrStepSzb src2, PtrStepSzb dst, cudaStream_t stream);
template <typename T> void cmpMatNe(PtrStepSzb src1, PtrStepSzb src2, PtrStepSzb dst, cudaStream_t stream);
@@ -1820,7 +1820,7 @@ void cv::gpu::compare(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, int c
{cmpMatEq<double> , cmpMatNe<double> , cmpMatLt<double> , cmpMatLe<double> }
};
- typedef void (*func_v4_t)(PtrStepSz<uint> src1, PtrStepSz<uint> src2, PtrStepSz<uint> dst, cudaStream_t stream);
+ typedef void (*func_v4_t)(PtrStepSz<unsigned int> src1, PtrStepSz<unsigned int> src2, PtrStepSz<unsigned int> dst, cudaStream_t stream);
static const func_v4_t funcs_v4[] =
{
cmpMatEq_v4, cmpMatNe_v4, cmpMatLt_v4, cmpMatLe_v4
View
22 modules/gpu/src/tvl1flow.cpp
@@ -129,6 +129,17 @@ void cv::gpu::OpticalFlowDual_TVL1_GPU::operator ()(const GpuMat& I0, const GpuM
gpu::multiply(u1s[s], Scalar::all(0.5), u1s[s]);
gpu::multiply(u2s[s], Scalar::all(0.5), u2s[s]);
}
+ else
+ {
+ u1s[s].create(I0s[s].size(), CV_32FC1);
+ u2s[s].create(I0s[s].size(), CV_32FC1);
+ }
+ }
+
+ if (!useInitialFlow)
+ {
+ u1s[nscales-1].setTo(Scalar::all(0));
+ u2s[nscales-1].setTo(Scalar::all(0));
}
// pyramidal structure for computing the optical flow
@@ -173,18 +184,9 @@ void cv::gpu::OpticalFlowDual_TVL1_GPU::procOneScale(const GpuMat& I0, const Gpu
CV_DbgAssert( I1.size() == I0.size() );
CV_DbgAssert( I1.type() == I0.type() );
- CV_DbgAssert( u1.empty() || u1.size() == I0.size() );
+ CV_DbgAssert( u1.size() == I0.size() );
CV_DbgAssert( u2.size() == u1.size() );
- if (u1.empty())
- {
- u1.create(I0.size(), CV_32FC1);
- u1.setTo(Scalar::all(0));
-
- u2.create(I0.size(), CV_32FC1);
- u2.setTo(Scalar::all(0));
- }
-
GpuMat I1x = I1x_buf(Rect(0, 0, I0.cols, I0.rows));
GpuMat I1y = I1y_buf(Rect(0, 0, I0.cols, I0.rows));
centeredGradient(I1, I1x, I1y);
View
20 modules/highgui/CMakeLists.txt
@@ -95,7 +95,7 @@ if(HAVE_QT)
if(${_have_flag})
set_source_files_properties(${_RCC_OUTFILES} PROPERTIES COMPILE_FLAGS -Wno-missing-declarations)
endif()
-elseif(WIN32)
+elseif(HAVE_WIN32UI)
list(APPEND highgui_srcs src/window_w32.cpp)
elseif(HAVE_GTK)
list(APPEND highgui_srcs src/window_gtk.cpp)
@@ -111,9 +111,21 @@ elseif(APPLE)
endif()
endif()
-if(WIN32)
- list(APPEND highgui_srcs src/cap_vfw.cpp src/cap_cmu.cpp src/cap_dshow.cpp)
-endif(WIN32)
+if(WIN32 AND NOT ARM)
+ list(APPEND highgui_srcs src/cap_cmu.cpp)
+endif()
+
+if (WIN32 AND HAVE_DSHOW)
+ list(APPEND highgui_srcs src/cap_dshow.cpp)
+endif()
+
+if (WIN32 AND HAVE_MSMF)
+ list(APPEND highgui_srcs src/cap_msmf.cpp)
+endif()
+
+if (WIN32 AND HAVE_VFW)
+ list(APPEND highgui_srcs src/cap_vfw.cpp)
+endif()
if(HAVE_XINE)
list(APPEND highgui_srcs src/cap_xine.cpp)
View
1  modules/highgui/include/opencv2/highgui/highgui_c.h
@@ -298,6 +298,7 @@ enum
CV_CAP_UNICAP =600, // Unicap drivers
CV_CAP_DSHOW =700, // DirectShow (via videoInput)
+ CV_CAP_MSMF =1400, // Microsoft Media Foundation (via videoInput)
CV_CAP_PVAPI =800, // PvAPI, Prosilica GigE SDK
View
6 modules/highgui/perf/perf_precomp.hpp
@@ -20,9 +20,9 @@
defined(HAVE_GSTREAMER) || \
defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \
- /*defined(HAVE_OPENNI) || too specialized */ \
defined(HAVE_FFMPEG) || \
- defined(WIN32) /* assume that we have ffmpeg */
+ defined(HAVE_VFW)
+ /*defined(HAVE_OPENNI) too specialized */ \
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 1
#else
@@ -34,7 +34,7 @@
defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \
defined(HAVE_FFMPEG) || \
- defined(WIN32) /* assume that we have ffmpeg */
+ defined(HAVE_VFW)
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 1
#else
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 0
View
20 modules/highgui/src/cap.cpp
@@ -114,7 +114,7 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
{
int domains[] =
{
-#ifdef HAVE_VIDEOINPUT
+#ifdef HAVE_DSHOW
CV_CAP_DSHOW,
#endif
#if 1
@@ -168,7 +168,8 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
// try every possibly installed camera API
for (int i = 0; domains[i] >= 0; i++)
{
-#if defined(HAVE_VIDEOINPUT) || \
+#if defined(HAVE_DSHOW) || \
+ defined(HAVE_MSMF) || \
defined(HAVE_TYZX) || \
defined(HAVE_VFW) || \
defined(HAVE_LIBV4L) || \
@@ -195,11 +196,18 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
switch (domains[i])
{
-#ifdef HAVE_VIDEOINPUT
+#ifdef HAVE_MSMF
+ case CV_CAP_MSMF:
+ capture = cvCreateCameraCapture_MSMF (index);
+ if (capture)
+ return capture;
+ break;
+#endif
+#ifdef HAVE_DSHOW
case CV_CAP_DSHOW:
- capture = cvCreateCameraCapture_DShow (index);
- if (capture)
- return capture;
+ capture = cvCreateCameraCapture_DShow (index);
+ if (capture)
+ return capture;
break;
#endif
View
3  modules/highgui/src/cap_dshow.cpp
@@ -41,7 +41,7 @@
#include "precomp.hpp"
-#if (defined WIN32 || defined _WIN32) && defined HAVE_VIDEOINPUT
+#if (defined WIN32 || defined _WIN32) && defined HAVE_DSHOW
/*
DirectShow-based Video Capturing module is based on
@@ -3098,6 +3098,7 @@ HRESULT videoInput::routeCrossbar(ICaptureGraphBuilder2 **ppBuild, IBaseFilter *
return hr;
}
+
/********************* Capturing video from camera via DirectShow *********************/
class CvCaptureCAM_DShow : public CvCapture
View
8 modules/highgui/src/cap_ffmpeg.cpp
@@ -209,7 +209,7 @@ CvCapture* cvCreateFileCapture_FFMPEG_proxy(const char * filename)
if( result->open( filename ))
return result;
delete result;
-#if defined WIN32 || defined _WIN32
+#ifdef HAVE_VFW
return cvCreateFileCapture_VFW(filename);
#else
return 0;
@@ -263,9 +263,9 @@ CvVideoWriter* cvCreateVideoWriter_FFMPEG_proxy( const char* filename, int fourc
if( result->open( filename, fourcc, fps, frameSize, isColor != 0 ))
return result;
delete result;
-#if defined WIN32 || defined _WIN32
- return cvCreateVideoWriter_VFW(filename, fourcc, fps, frameSize, isColor);
-#else
+#ifdef HAVE_VFW
+ return cvCreateVideoWriter_VFW(filename, fourcc, fps, frameSize, isColor);
+ #else
return 0;
#endif
}
View
56 modules/highgui/src/cap_ffmpeg_impl.hpp
@@ -153,6 +153,14 @@ extern "C" {
#define AVERROR_EOF (-MKTAG( 'E','O','F',' '))
#endif
+#if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(54,25,0)
+# define CV_CODEC_ID AVCodecID
+# define CV_CODEC(name) AV_##name
+#else
+# define CV_CODEC_ID CodecID
+# define CV_CODEC(name) name
+#endif
+
static int get_number_of_cpus(void)
{
#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(52, 111, 0)
@@ -1026,7 +1034,7 @@ static const char * icvFFMPEGErrStr(int err)
/* function internal to FFMPEG (libavformat/riff.c) to lookup codec id by fourcc tag*/
extern "C" {
- enum CodecID codec_get_bmp_id(unsigned int tag);
+ enum CV_CODEC_ID codec_get_bmp_id(unsigned int tag);
}
void CvVideoWriter_FFMPEG::init()
@@ -1078,7 +1086,7 @@ static AVFrame * icv_alloc_picture_FFMPEG(int pix_fmt, int width, int height, bo
/* add a video output stream to the container */
static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
- CodecID codec_id,
+ CV_CODEC_ID codec_id,
int w, int h, int bitrate,
double fps, int pixel_format)
{
@@ -1110,7 +1118,7 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
c->codec_id = oc->oformat->video_codec;
#endif
- if(codec_id != CODEC_ID_NONE){
+ if(codec_id != CV_CODEC(CODEC_ID_NONE)){
c->codec_id = codec_id;
}
@@ -1179,10 +1187,10 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
c->gop_size = 12; /* emit one intra frame every twelve frames at most */
c->pix_fmt = (PixelFormat) pixel_format;
- if (c->codec_id == CODEC_ID_MPEG2VIDEO) {
+ if (c->codec_id == CV_CODEC(CODEC_ID_MPEG2VIDEO)) {
c->max_b_frames = 2;
}
- if (c->codec_id == CODEC_ID_MPEG1VIDEO || c->codec_id == CODEC_ID_MSMPEG4V3){
+ if (c->codec_id == CV_CODEC(CODEC_ID_MPEG1VIDEO) || c->codec_id == CV_CODEC(CODEC_ID_MSMPEG4V3)){
/* needed to avoid using macroblocks in which some coeffs overflow
this doesnt happen with normal video, it just happens here as the
motion of the chroma plane doesnt match the luma plane */
@@ -1290,7 +1298,7 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
#if LIBAVFORMAT_BUILD < 5231
// It is not needed in the latest versions of the ffmpeg
- if( c->codec_id == CODEC_ID_RAWVIDEO && origin != 1 )
+ if( c->codec_id == CV_CODEC(CODEC_ID_RAWVIDEO) && origin != 1 )
{
if( !temp_image.data )
{
@@ -1477,7 +1485,7 @@ void CvVideoWriter_FFMPEG::close()
bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
double fps, int width, int height, bool is_color )
{
- CodecID codec_id = CODEC_ID_NONE;
+ CV_CODEC_ID codec_id = CV_CODEC(CODEC_ID_NONE);
int err, codec_pix_fmt;
double bitrate_scale = 1;
@@ -1518,11 +1526,11 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
/* Lookup codec_id for given fourcc */
#if LIBAVCODEC_VERSION_INT<((51<<16)+(49<<8)+0)
- if( (codec_id = codec_get_bmp_id( fourcc )) == CODEC_ID_NONE )
+ if( (codec_id = codec_get_bmp_id( fourcc )) == CV_CODEC(CODEC_ID_NONE) )
return false;
#else
const struct AVCodecTag * tags[] = { codec_bmp_tags, NULL};
- if( (codec_id = av_codec_get_id(tags, fourcc)) == CODEC_ID_NONE )
+ if( (codec_id = av_codec_get_id(tags, fourcc)) == CV_CODEC(CODEC_ID_NONE) )
return false;
#endif
@@ -1544,20 +1552,20 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
// set a few optimal pixel formats for lossless codecs of interest..
switch (codec_id) {
#if LIBAVCODEC_VERSION_INT>((50<<16)+(1<<8)+0)
- case CODEC_ID_JPEGLS:
+ case CV_CODEC(CODEC_ID_JPEGLS):
// BGR24 or GRAY8 depending on is_color...
codec_pix_fmt = input_pix_fmt;
break;
#endif
- case CODEC_ID_HUFFYUV:
+ case CV_CODEC(CODEC_ID_HUFFYUV):
codec_pix_fmt = PIX_FMT_YUV422P;
break;
- case CODEC_ID_MJPEG:
- case CODEC_ID_LJPEG:
+ case CV_CODEC(CODEC_ID_MJPEG):
+ case CV_CODEC(CODEC_ID_LJPEG):
codec_pix_fmt = PIX_FMT_YUVJ420P;
bitrate_scale = 3;
break;
- case CODEC_ID_RAWVIDEO:
+ case CV_CODEC(CODEC_ID_RAWVIDEO):
codec_pix_fmt = input_pix_fmt == PIX_FMT_GRAY8 ||
input_pix_fmt == PIX_FMT_GRAY16LE ||
input_pix_fmt == PIX_FMT_GRAY16BE ? input_pix_fmt : PIX_FMT_YUV420P;
@@ -1788,7 +1796,7 @@ struct OutputMediaStream_FFMPEG
void write(unsigned char* data, int size, int keyFrame);
// add a video output stream to the container
- static AVStream* addVideoStream(AVFormatContext *oc, CodecID codec_id, int w, int h, int bitrate, double fps, PixelFormat pixel_format);
+ static AVStream* addVideoStream(AVFormatContext *oc, CV_CODEC_ID codec_id, int w, int h, int bitrate, double fps, PixelFormat pixel_format);
AVOutputFormat* fmt_;
AVFormatContext* oc_;
@@ -1835,7 +1843,7 @@ void OutputMediaStream_FFMPEG::close()
}
}
-AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVFormatContext *oc, CodecID codec_id, int w, int h, int bitrate, double fps, PixelFormat pixel_format)
+AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVFormatContext *oc, CV_CODEC_ID codec_id, int w, int h, int bitrate, double fps, PixelFormat pixel_format)
{
#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 10, 0)
AVStream* st = avformat_new_stream(oc, 0);
@@ -1915,10 +1923,10 @@ AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVFormatContext *oc, CodecID
c->gop_size = 12; // emit one intra frame every twelve frames at most
c->pix_fmt = pixel_format;
- if (c->codec_id == CODEC_ID_MPEG2VIDEO)
+ if (c->codec_id == CV_CODEC(CODEC_ID_MPEG2VIDEO))
c->max_b_frames = 2;
- if (c->codec_id == CODEC_ID_MPEG1VIDEO || c->codec_id