Compare commits
223 Commits
4.1.1
...
4.1.2-openvino
| Author | SHA1 | Date | |
|---|---|---|---|
| 9fa6c2ac04 | |||
| b8d4664e6e | |||
| bd5d16ce36 | |||
| e98852a389 | |||
| 08e4ffdf79 | |||
| 8b42995e8b | |||
| 84c3bbd934 | |||
| a0d227714e | |||
| bea2c75452 | |||
| fafada28eb | |||
| 4ffb5b62ea | |||
| f73395122c | |||
| 0a13633411 | |||
| 76e403cf25 | |||
| 00f36a261b | |||
| fe42933ac5 | |||
| b17d16623a | |||
| ba703157cf | |||
| 8bd2720c28 | |||
| 7e46766c8d | |||
| 61cc855564 | |||
| e736f590f7 | |||
| 9ef5373776 | |||
| 6d669dcd7d | |||
| abd7d63b74 | |||
| 55c1720719 | |||
| 6769ee3748 | |||
| 07f0225ca6 | |||
| f7b5900671 | |||
| 8a7e74673e | |||
| 3c62f3a8e3 | |||
| 48d41ab088 | |||
| 0fda243a05 | |||
| 70dfae31a2 | |||
| e98e58c65a | |||
| 3b9f981358 | |||
| 048ddbf9ee | |||
| 2a6527e751 | |||
| 26228e6b4d | |||
| f3aab47f94 | |||
| 1661e83939 | |||
| f224d740a3 | |||
| 700f7a275f | |||
| e319340253 | |||
| 6508bbcef5 | |||
| 9bf8b496d6 | |||
| d4120dd2fe | |||
| 8c849a48cc | |||
| 654d0c29ad | |||
| 8d0b3dad5c | |||
| 90eb529bc4 | |||
| 6506c19ac3 | |||
| 834c992553 | |||
| 30a60d396b | |||
| d134ec54c5 | |||
| ca7640e10f | |||
| 288e6f9c07 | |||
| 70b883cfeb | |||
| ea525d5685 | |||
| 1ae001d10a | |||
| 1b40528e1a | |||
| 4e67eb6c42 | |||
| 824465ea27 | |||
| 4a33014edc | |||
| 57676cf64d | |||
| a7b954f655 | |||
| 114674c3d9 | |||
| c05595e482 | |||
| d4d7ab0620 | |||
| c74206e4de | |||
| 96d5cbd036 | |||
| d0c4a92b4c | |||
| d7409604b5 | |||
| 29dbeb253c | |||
| 5a497077f1 | |||
| 576644a197 | |||
| 410583e5f9 | |||
| 6bf6d1dc6b | |||
| 56e832ee43 | |||
| 601096f360 | |||
| aa09febf79 | |||
| 8aca1934ff | |||
| ccecd3405a | |||
| 8a0b93bc4d | |||
| 8b1fe8f6e0 | |||
| 7243eda2ff | |||
| 3f7cc45686 | |||
| 84b8a2fb05 | |||
| c93e2ff81d | |||
| 0cdfd72529 | |||
| 70ce2bbb9e | |||
| 4700722444 | |||
| 464972855e | |||
| 58ca013b90 | |||
| 869ea22f34 | |||
| 8ef8088686 | |||
| c5e9bbe4f3 | |||
| 0e92ac2af7 | |||
| b77a0039ee | |||
| 33fb253a66 | |||
| 51ceabb2eb | |||
| b2274a63cd | |||
| 6a439ae53d | |||
| b1a5c76215 | |||
| 9612397aa2 | |||
| 04f720d56a | |||
| 19a4b51371 | |||
| b8f35aa109 | |||
| a1e96a7deb | |||
| fcc7d8dd4e | |||
| a41b79d43e | |||
| ec43292e1e | |||
| 7df3141bbc | |||
| ea667d82b3 | |||
| 57ccf14952 | |||
| 0a02dd5f58 | |||
| 13ecd5bb25 | |||
| a703b9ed84 | |||
| 32aba5e64b | |||
| e4a80aee09 | |||
| 26551f178c | |||
| dbf8e22fad | |||
| 0b5d0b83be | |||
| 32772a5436 | |||
| 35e5f00cac | |||
| 290da93845 | |||
| f6bb900259 | |||
| f7f2438478 | |||
| 2ad0487cec | |||
| 72ccb5fe6e | |||
| 7c96857c02 | |||
| 15b8a8d935 | |||
| bf0765fc7f | |||
| 59de4d9ad8 | |||
| e0cb01e2cf | |||
| 4c168e95de | |||
| 183fc43a67 | |||
| c95407f1bc | |||
| f1ea9d86b9 | |||
| e06efd5329 | |||
| 358d69956a | |||
| 935067ee05 | |||
| 212f0fb509 | |||
| d513fb4c8e | |||
| 596b8a5d06 | |||
| 6f267be6f1 | |||
| 76b40a37e7 | |||
| 487d331d74 | |||
| a77275e650 | |||
| 5e527d22e3 | |||
| 40c71a2463 | |||
| 5ef548a985 | |||
| f38a61c66d | |||
| 3f92bcc11a | |||
| b2135be594 | |||
| 816929c704 | |||
| a9839af903 | |||
| 6193e403e7 | |||
| 32da0705cf | |||
| ba1a48c2ce | |||
| 821f17d666 | |||
| 0e1ef8f8e1 | |||
| 96a27f4266 | |||
| 26ac5a3bdc | |||
| cf93a05d2d | |||
| 174b4ce29d | |||
| 90ccd2f37c | |||
| a4b4432015 | |||
| bca49b99ca | |||
| 6427744063 | |||
| 365323afec | |||
| 99f709ca96 | |||
| 3fc02353be | |||
| 0757a51e2b | |||
| 290078e0d0 | |||
| ca79f75b32 | |||
| 987bb2ca61 | |||
| 960bb540ec | |||
| b9d6fc9dad | |||
| 1031b7f4bc | |||
| 406313bbc5 | |||
| cadb4dee14 | |||
| d2c64b566b | |||
| c5069266dc | |||
| 59b0314a0e | |||
| d6ba235655 | |||
| 63775320ae | |||
| 95eb199f41 | |||
| d659eb9327 | |||
| f17a6b478b | |||
| f18cbd036a | |||
| b584c23061 | |||
| ba934ff1ce | |||
| b811420d28 | |||
| b231e91d87 | |||
| f9cefc84a3 | |||
| 977d2c4330 | |||
| 3f4004ae45 | |||
| fc85f3644d | |||
| 03fe1cb7fc | |||
| 4dadf17bd9 | |||
| 6d5ac67681 | |||
| 1275248f39 | |||
| d3cf0d2c06 | |||
| 304e3ac12f | |||
| 778f42ad34 | |||
| f482050f9a | |||
| 5ef7325874 | |||
| 5a6b23e8f3 | |||
| e90438fe3c | |||
| f7d5b39ec9 | |||
| eec9fa9d5e | |||
| 4d3989817c | |||
| 59864a3bbc | |||
| f9f160404a | |||
| 4e998c9ade | |||
| ebaefbb745 | |||
| 47c5ee5d9c | |||
| 77d4e3e8d2 | |||
| a0c3bb70a9 | |||
| 3debb98805 | |||
| 95c65aff75 | |||
| 97681d0607 |
@@ -1127,6 +1127,7 @@ inline int TEGRA_FILTERINIT(cvhalFilter2D **context, uchar *kernel_data, size_t
|
||||
{
|
||||
std::memcpy(ctx->kernel_data + kernel_width * j, kernel_data + kernel_step * j, kernel_width * sizeof(int16_t));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
delete[] ctx->kernel_data;
|
||||
delete ctx;
|
||||
@@ -1243,6 +1244,7 @@ inline int TEGRA_SEPFILTERINIT(cvhalFilter2D **context, int src_type, int dst_ty
|
||||
ctx->kernely_data[0]=((int16_t*)kernely_data)[0];
|
||||
ctx->kernely_data[1]=((int16_t*)kernely_data)[1];
|
||||
ctx->kernely_data[2]=((int16_t*)kernely_data)[2];
|
||||
break;
|
||||
default:
|
||||
delete ctx;
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Binaries branch name: ffmpeg/master_20190616
|
||||
# Binaries were created for OpenCV: 7b099e0fe2d929e55d6705b6ad510c2c9081606b
|
||||
ocv_update(FFMPEG_BINARIES_COMMIT "998718df34e35ea0fa429724875fc3900faa266f")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "f03b47fb809edd2e06b6db135cbd3e49")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "5c4571459570c288d874704244c428b5")
|
||||
ocv_update(FFMPEG_FILE_HASH_CMAKE "f710891525a04586d565d0e700e62a9c")
|
||||
# Binaries branch name: ffmpeg/master_20190910
|
||||
# Binaries were created for OpenCV: bea2c7545243ba2dabce6badc94dd55894a8e5ca
|
||||
ocv_update(FFMPEG_BINARIES_COMMIT "197f87f7e811a9ded35d989b37e50501ff6afaa4")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "ab380c9dde361f30dd3604f88eef6c48")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "90260a4da737fc045c9279567313ee9d")
|
||||
ocv_update(FFMPEG_FILE_HASH_CMAKE "ad57c038ba34b868277ccbe6dd0f9602")
|
||||
|
||||
function(download_win_ffmpeg script_var)
|
||||
set(${script_var} "" PARENT_SCOPE)
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
#if !defined(JAS_WIN_MSVC_BUILD)
|
||||
/* A configure-based build is being used. */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
// uClibc-ng workaround: https://github.com/opencv/opencv/pull/15279
|
||||
#ifndef L_tmpnam
|
||||
#define L_tmpnam 20
|
||||
#endif
|
||||
|
||||
|
||||
/* Extra debugging support */
|
||||
|
||||
@@ -15,13 +15,6 @@ else()
|
||||
ocv_list_filterout(lib_srcs jmemnobs.c)
|
||||
endif()
|
||||
|
||||
if(WINRT)
|
||||
add_definitions(-DNO_GETENV)
|
||||
get_directory_property( DirDefs COMPILE_DEFINITIONS )
|
||||
message(STATUS "Adding NO_GETENV to compiler definitions for WINRT:")
|
||||
message(STATUS " COMPILE_DEFINITIONS = ${DirDefs}")
|
||||
endif()
|
||||
|
||||
# ----------------------------------------------------------------------------------
|
||||
# Define the library target:
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
@@ -47,7 +47,9 @@ if(";${CPU_BASELINE_FINAL};" MATCHES "SSE2"
|
||||
endif()
|
||||
|
||||
if(PPC64LE OR PPC64)
|
||||
if(ENABLE_VSX AND NOT PPC64)
|
||||
# VSX3 features are backwards compatible
|
||||
if(";${CPU_BASELINE_FINAL};" MATCHES "VSX.*"
|
||||
AND NOT PPC64)
|
||||
list(APPEND lib_srcs powerpc/powerpc_init.c powerpc/filter_vsx_intrinsics.c)
|
||||
add_definitions(-DPNG_POWERPC_VSX_OPT=2)
|
||||
else()
|
||||
|
||||
@@ -29,40 +29,19 @@ else()
|
||||
cmake_minimum_required(VERSION "${MIN_VER_CMAKE}" FATAL_ERROR)
|
||||
endif()
|
||||
|
||||
option(ENABLE_PIC "Generate position independent code (necessary for shared libraries)" TRUE)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ${ENABLE_PIC})
|
||||
|
||||
set(OPENCV_MATHJAX_RELPATH "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0" CACHE STRING "URI to a MathJax installation")
|
||||
|
||||
# Following block can break build in case of cross-compiling
|
||||
# but CMAKE_CROSSCOMPILING variable will be set only on project(OpenCV) command
|
||||
# so we will try to detect cross-compiling by the presence of CMAKE_TOOLCHAIN_FILE
|
||||
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
if(NOT CMAKE_TOOLCHAIN_FILE)
|
||||
# it _must_ go before project(OpenCV) in order to work
|
||||
if(WIN32)
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory")
|
||||
else()
|
||||
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory")
|
||||
endif()
|
||||
else()
|
||||
#Android: set output folder to ${CMAKE_BINARY_DIR}
|
||||
set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH "root for library output, set this to change where android libs are compiled to" )
|
||||
# any cross-compiling
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#
|
||||
# Configure CMake policies
|
||||
#
|
||||
if(POLICY CMP0026)
|
||||
cmake_policy(SET CMP0026 NEW)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0042)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
cmake_policy(SET CMP0042 NEW) # CMake 3.0+ (2.8.12): MacOS "@rpath" in target's install name
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0046)
|
||||
cmake_policy(SET CMP0046 NEW)
|
||||
cmake_policy(SET CMP0046 NEW) # warn about non-existed dependencies
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0051)
|
||||
@@ -74,17 +53,25 @@ if(POLICY CMP0054) # CMake 3.1: Only interpret if() arguments as variables or k
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0056)
|
||||
cmake_policy(SET CMP0056 NEW)
|
||||
cmake_policy(SET CMP0056 NEW) # try_compile(): link flags
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0067)
|
||||
cmake_policy(SET CMP0067 NEW)
|
||||
cmake_policy(SET CMP0067 NEW) # CMake 3.8: try_compile(): honor language standard variables (like C++11)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0068)
|
||||
cmake_policy(SET CMP0068 NEW) # CMake 3.9+: `RPATH` settings on macOS do not affect `install_name`.
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0075)
|
||||
cmake_policy(SET CMP0075 NEW) # CMake 3.12+: Include file check macros honor `CMAKE_REQUIRED_LIBRARIES`
|
||||
endif()
|
||||
|
||||
|
||||
#
|
||||
# Configure OpenCV CMake hooks
|
||||
#
|
||||
include(cmake/OpenCVUtils.cmake)
|
||||
ocv_cmake_reset_hooks()
|
||||
ocv_check_environment_variables(OPENCV_CMAKE_HOOKS_DIR)
|
||||
@@ -97,49 +84,46 @@ endif()
|
||||
|
||||
ocv_cmake_hook(CMAKE_INIT)
|
||||
|
||||
# must go before the project command
|
||||
# must go before the project()/enable_language() commands
|
||||
ocv_update(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
|
||||
if(DEFINED CMAKE_BUILD_TYPE)
|
||||
set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${CMAKE_CONFIGURATION_TYPES}")
|
||||
endif()
|
||||
|
||||
option(ENABLE_PIC "Generate position independent code (necessary for shared libraries)" TRUE)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ${ENABLE_PIC})
|
||||
|
||||
ocv_cmake_hook(PRE_CMAKE_BOOTSTRAP)
|
||||
|
||||
# Bootstap CMake system: setup CMAKE_SYSTEM_NAME and other vars
|
||||
enable_language(CXX C)
|
||||
|
||||
ocv_cmake_hook(POST_CMAKE_BOOTSTRAP)
|
||||
|
||||
if(NOT OPENCV_SKIP_CMAKE_SYSTEM_FILE)
|
||||
include("cmake/platforms/OpenCV-${CMAKE_SYSTEM_NAME}.cmake" OPTIONAL RESULT_VARIABLE "OPENCV_CMAKE_SYSTEM_FILE")
|
||||
if(NOT OPENCV_CMAKE_SYSTEM_FILE)
|
||||
message(STATUS "OpenCV: system-specific configuration file is not found: '${CMAKE_SYSTEM_NAME}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) # https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.html
|
||||
if(NOT CMAKE_TOOLCHAIN_FILE)
|
||||
if(WIN32)
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory" FORCE)
|
||||
else()
|
||||
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory" FORCE)
|
||||
endif()
|
||||
else()
|
||||
# any cross-compiling
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
enable_testing()
|
||||
|
||||
project(OpenCV CXX C)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
|
||||
set(WINRT TRUE)
|
||||
endif()
|
||||
|
||||
if(WINRT OR WINCE)
|
||||
add_definitions(-DNO_GETENV)
|
||||
endif()
|
||||
|
||||
if(WINRT)
|
||||
add_definitions(-DWINRT)
|
||||
|
||||
# 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 10)
|
||||
set(WINRT_10 TRUE)
|
||||
add_definitions(-DWINRT_10)
|
||||
elseif(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(MSVC)
|
||||
set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE)
|
||||
endif()
|
||||
@@ -465,7 +449,7 @@ OCV_OPTION(INSTALL_TESTS "Install accuracy and performance test binar
|
||||
# OpenCV build options
|
||||
# ===================================================
|
||||
OCV_OPTION(ENABLE_CCACHE "Use ccache" (UNIX AND NOT IOS AND (CMAKE_GENERATOR MATCHES "Makefile" OR CMAKE_GENERATOR MATCHES "Ninja")) )
|
||||
OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" ON IF (MSVC OR (NOT IOS AND NOT CMAKE_CROSSCOMPILING) ) )
|
||||
OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" MSVC IF (MSVC OR (NOT IOS AND NOT CMAKE_CROSSCOMPILING) ) )
|
||||
OCV_OPTION(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" (MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) )
|
||||
OCV_OPTION(ENABLE_PROFILING "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF IF CV_GCC )
|
||||
OCV_OPTION(ENABLE_COVERAGE "Enable coverage collection with GCov" OFF IF CV_GCC )
|
||||
@@ -501,6 +485,7 @@ if(ENABLE_IMPL_COLLECTION)
|
||||
add_definitions(-DCV_COLLECT_IMPL_DATA)
|
||||
endif()
|
||||
|
||||
set(OPENCV_MATHJAX_RELPATH "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0" CACHE STRING "URI to a MathJax installation")
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Get actual OpenCV version number from sources
|
||||
@@ -513,9 +498,21 @@ ocv_cmake_hook(POST_OPTIONS)
|
||||
# Build & install layouts
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if(OPENCV_TEST_DATA_PATH)
|
||||
get_filename_component(OPENCV_TEST_DATA_PATH ${OPENCV_TEST_DATA_PATH} ABSOLUTE)
|
||||
endif()
|
||||
|
||||
# Save libs and executables in the same place
|
||||
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin" CACHE PATH "Output directory for applications")
|
||||
|
||||
if(ANDROID)
|
||||
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
|
||||
ocv_update(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib/${ANDROID_NDK_ABI_NAME}")
|
||||
else()
|
||||
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
|
||||
ocv_update(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib")
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
if(ANDROID_ABI MATCHES "NEON")
|
||||
set(ENABLE_NEON ON)
|
||||
@@ -525,134 +522,14 @@ if(ANDROID)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ANDROID OR WIN32)
|
||||
ocv_update(OPENCV_DOC_INSTALL_PATH doc)
|
||||
endif()
|
||||
|
||||
if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||
if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH)
|
||||
ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/")
|
||||
else()
|
||||
message(STATUS "Can't detect runtime and/or arch")
|
||||
ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "")
|
||||
endif()
|
||||
elseif(ANDROID)
|
||||
ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "sdk/native/")
|
||||
else()
|
||||
ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "")
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
ocv_update(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples/${ANDROID_NDK_ABI_NAME}")
|
||||
else()
|
||||
ocv_update(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
ocv_update(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin/${ANDROID_NDK_ABI_NAME}")
|
||||
else()
|
||||
ocv_update(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
|
||||
endif()
|
||||
|
||||
if(NOT OPENCV_TEST_INSTALL_PATH)
|
||||
ocv_update(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
|
||||
endif()
|
||||
|
||||
if (OPENCV_TEST_DATA_PATH)
|
||||
get_filename_component(OPENCV_TEST_DATA_PATH ${OPENCV_TEST_DATA_PATH} ABSOLUTE)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
ocv_update(OPENCV_TEST_DATA_INSTALL_PATH "sdk/etc/testdata")
|
||||
elseif(WIN32)
|
||||
ocv_update(OPENCV_TEST_DATA_INSTALL_PATH "testdata")
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
|
||||
ocv_update(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib/${ANDROID_NDK_ABI_NAME}")
|
||||
ocv_update(OPENCV_LIB_INSTALL_PATH sdk/native/libs/${ANDROID_NDK_ABI_NAME})
|
||||
ocv_update(OPENCV_LIB_ARCHIVE_INSTALL_PATH sdk/native/staticlibs/${ANDROID_NDK_ABI_NAME})
|
||||
ocv_update(OPENCV_3P_LIB_INSTALL_PATH sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME})
|
||||
ocv_update(OPENCV_CONFIG_INSTALL_PATH sdk/native/jni)
|
||||
ocv_update(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
|
||||
ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
||||
ocv_update(OPENCV_OTHER_INSTALL_PATH sdk/etc)
|
||||
ocv_update(OPENCV_LICENSES_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}/licenses")
|
||||
else()
|
||||
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
|
||||
ocv_update(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
|
||||
|
||||
if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||
if(OpenCV_STATIC)
|
||||
ocv_update(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
||||
else()
|
||||
ocv_update(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}")
|
||||
endif()
|
||||
ocv_update(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
||||
ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH samples)
|
||||
ocv_update(OPENCV_JAR_INSTALL_PATH java)
|
||||
ocv_update(OPENCV_OTHER_INSTALL_PATH etc)
|
||||
ocv_update(OPENCV_CONFIG_INSTALL_PATH ".")
|
||||
ocv_update(OPENCV_INCLUDE_INSTALL_PATH "include")
|
||||
ocv_update(OPENCV_LICENSES_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}/licenses")
|
||||
else()
|
||||
# Note: layout differs from OpenCV 3.4
|
||||
include(GNUInstallDirs)
|
||||
ocv_update(OPENCV_INCLUDE_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}/opencv4")
|
||||
ocv_update(OPENCV_LIB_INSTALL_PATH "${CMAKE_INSTALL_LIBDIR}")
|
||||
ocv_update(OPENCV_CONFIG_INSTALL_PATH "${OPENCV_LIB_INSTALL_PATH}/cmake/opencv4")
|
||||
ocv_update(OPENCV_3P_LIB_INSTALL_PATH "${OPENCV_LIB_INSTALL_PATH}/opencv4/3rdparty")
|
||||
ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH "${CMAKE_INSTALL_DATAROOTDIR}/opencv4/samples")
|
||||
ocv_update(OPENCV_DOC_INSTALL_PATH "${CMAKE_INSTALL_DATAROOTDIR}/doc/opencv4")
|
||||
ocv_update(OPENCV_JAR_INSTALL_PATH "${CMAKE_INSTALL_DATAROOTDIR}/java/opencv4")
|
||||
ocv_update(OPENCV_TEST_DATA_INSTALL_PATH "${CMAKE_INSTALL_DATAROOTDIR}/opencv4/testdata")
|
||||
ocv_update(OPENCV_OTHER_INSTALL_PATH "${CMAKE_INSTALL_DATAROOTDIR}/opencv4")
|
||||
ocv_update(OPENCV_LICENSES_INSTALL_PATH "${CMAKE_INSTALL_DATAROOTDIR}/licenses/opencv4")
|
||||
endif()
|
||||
#ocv_update(OPENCV_PYTHON_INSTALL_PATH "python") # no default value, see https://github.com/opencv/opencv/issues/13202
|
||||
endif()
|
||||
|
||||
ocv_update(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}")
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
if(INSTALL_TO_MANGLED_PATHS)
|
||||
foreach(v
|
||||
OPENCV_INCLUDE_INSTALL_PATH
|
||||
# file names include version (.so/.dll): OPENCV_LIB_INSTALL_PATH
|
||||
OPENCV_CONFIG_INSTALL_PATH
|
||||
OPENCV_3P_LIB_INSTALL_PATH
|
||||
OPENCV_SAMPLES_SRC_INSTALL_PATH
|
||||
OPENCV_DOC_INSTALL_PATH
|
||||
# JAR file name includes version: OPENCV_JAR_INSTALL_PATH
|
||||
OPENCV_TEST_DATA_INSTALL_PATH
|
||||
OPENCV_OTHER_INSTALL_PATH
|
||||
)
|
||||
string(REGEX REPLACE "opencv[0-9]*" "opencv-${OPENCV_VERSION}" ${v} "${${v}}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
ocv_update(OPENCV_JNI_INSTALL_PATH "${OPENCV_LIB_INSTALL_PATH}")
|
||||
elseif(INSTALL_CREATE_DISTRIB)
|
||||
ocv_update(OPENCV_JNI_INSTALL_PATH "${OPENCV_JAR_INSTALL_PATH}/${OpenCV_ARCH}")
|
||||
else()
|
||||
ocv_update(OPENCV_JNI_INSTALL_PATH "${OPENCV_JAR_INSTALL_PATH}")
|
||||
endif()
|
||||
ocv_update(OPENCV_JNI_BIN_INSTALL_PATH "${OPENCV_JNI_INSTALL_PATH}")
|
||||
|
||||
if(NOT OPENCV_LIB_ARCHIVE_INSTALL_PATH)
|
||||
set(OPENCV_LIB_ARCHIVE_INSTALL_PATH ${OPENCV_LIB_INSTALL_PATH})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
# Postfix of DLLs:
|
||||
set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}")
|
||||
set(OPENCV_DEBUG_POSTFIX d)
|
||||
ocv_update(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}")
|
||||
ocv_update(OPENCV_DEBUG_POSTFIX d)
|
||||
else()
|
||||
# Postfix of so's:
|
||||
set(OPENCV_DLLVERSION "")
|
||||
set(OPENCV_DEBUG_POSTFIX "")
|
||||
ocv_update(OPENCV_DLLVERSION "")
|
||||
ocv_update(OPENCV_DEBUG_POSTFIX "")
|
||||
endif()
|
||||
|
||||
if(DEFINED CMAKE_DEBUG_POSTFIX)
|
||||
@@ -663,6 +540,8 @@ if((INSTALL_CREATE_DISTRIB AND BUILD_SHARED_LIBS AND NOT DEFINED BUILD_opencv_wo
|
||||
set(BUILD_opencv_world ON CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
include(cmake/OpenCVInstallLayout.cmake)
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Path for build/platform -specific headers
|
||||
# ----------------------------------------------------------------------------
|
||||
@@ -1521,19 +1400,22 @@ endif()
|
||||
|
||||
if(WITH_INF_ENGINE OR INF_ENGINE_TARGET)
|
||||
if(INF_ENGINE_TARGET)
|
||||
list(GET INF_ENGINE_TARGET 0 ie_target)
|
||||
set(__msg "YES (${INF_ENGINE_RELEASE} / ${INF_ENGINE_VERSION})")
|
||||
get_target_property(_lib ${INF_ENGINE_TARGET} IMPORTED_LOCATION)
|
||||
get_target_property(_lib_imp_rel ${INF_ENGINE_TARGET} IMPORTED_IMPLIB_RELEASE)
|
||||
get_target_property(_lib_imp_dbg ${INF_ENGINE_TARGET} IMPORTED_IMPLIB_DEBUG)
|
||||
get_target_property(_lib_rel ${INF_ENGINE_TARGET} IMPORTED_LOCATION_RELEASE)
|
||||
get_target_property(_lib_dbg ${INF_ENGINE_TARGET} IMPORTED_LOCATION_DEBUG)
|
||||
get_target_property(_lib ${ie_target} IMPORTED_LOCATION)
|
||||
get_target_property(_lib_imp_rel ${ie_target} IMPORTED_IMPLIB_RELEASE)
|
||||
get_target_property(_lib_imp_dbg ${ie_target} IMPORTED_IMPLIB_DEBUG)
|
||||
get_target_property(_lib_rel ${ie_target} IMPORTED_LOCATION_RELEASE)
|
||||
get_target_property(_lib_dbg ${ie_target} IMPORTED_LOCATION_DEBUG)
|
||||
ocv_build_features_string(_lib
|
||||
IF _lib THEN "${_lib}"
|
||||
IF _lib_imp_rel AND _lib_imp_dbg THEN "${_lib_imp_rel} / ${_lib_imp_dbg}"
|
||||
IF _lib_rel AND _lib_dbg THEN "${_lib_rel} / ${_lib_dbg}"
|
||||
IF _lib_rel THEN "${_lib_rel}"
|
||||
IF _lib_dbg THEN "${_lib_dbg}"
|
||||
ELSE "unknown"
|
||||
)
|
||||
get_target_property(_inc ${INF_ENGINE_TARGET} INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(_inc ${ie_target} INTERFACE_INCLUDE_DIRECTORIES)
|
||||
status(" Inference Engine:" "${__msg}")
|
||||
status(" libs:" "${_lib}")
|
||||
status(" includes:" "${_inc}")
|
||||
|
||||
@@ -895,7 +895,7 @@ void icvGetNextFromBackgroundData( CvBackgroundData* data,
|
||||
* #pragma omp parallel
|
||||
* {
|
||||
* ...
|
||||
* icvGetBackgourndImage( cvbgdata, cvbgreader, img );
|
||||
* icvGetBackgroundImage( cvbgdata, cvbgreader, img );
|
||||
* ...
|
||||
* }
|
||||
* ...
|
||||
@@ -990,7 +990,7 @@ static int icvInitBackgroundReaders( const char* filename, Size winsize )
|
||||
/*
|
||||
* icvDestroyBackgroundReaders
|
||||
*
|
||||
* Finish backgournd reading process
|
||||
* Finish background reading process
|
||||
*/
|
||||
static
|
||||
void icvDestroyBackgroundReaders()
|
||||
|
||||
@@ -136,7 +136,7 @@ macro(cuda_execute_process status command)
|
||||
# copy and paste a runnable command line.
|
||||
set(cuda_execute_process_string)
|
||||
foreach(arg ${ARGN})
|
||||
# If there are quotes, excape them, so they come through.
|
||||
# If there are quotes, escape them, so they come through.
|
||||
string(REPLACE "\"" "\\\"" arg ${arg})
|
||||
# Args with spaces need quotes around them to get them to be parsed as a single argument.
|
||||
if(arg MATCHES " ")
|
||||
|
||||
@@ -4,16 +4,6 @@ if(NOT MSVC)
|
||||
message(FATAL_ERROR "CRT options are available only for MSVC")
|
||||
endif()
|
||||
|
||||
if (WINRT)
|
||||
if (CMAKE_SYSTEM_VERSION MATCHES 10)
|
||||
add_definitions(/DWINVER=_WIN32_WINNT_WIN10 /DNTDDI_VERSION=NTDDI_WIN10 /D_WIN32_WINNT=_WIN32_WINNT_WIN10)
|
||||
elseif(CMAKE_SYSTEM_VERSION MATCHES 8.1)
|
||||
add_definitions(/DWINVER=_WIN32_WINNT_WINBLUE /DNTDDI_VERSION=NTDDI_WINBLUE /D_WIN32_WINNT=_WIN32_WINNT_WINBLUE)
|
||||
else()
|
||||
add_definitions(/DWINVER=_WIN32_WINNT_WIN8 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=_WIN32_WINNT_WIN8)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Removing LNK4075 warnings for debug WinRT builds
|
||||
# "LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification"
|
||||
# "LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification"
|
||||
|
||||
@@ -854,7 +854,7 @@ macro(__ocv_add_dispatched_file filename target_src_var src_directory dst_direct
|
||||
|
||||
if(";${CPU_DISPATCH_FINAL};" MATCHES "${OPT}" OR __CPU_DISPATCH_INCLUDE_ALL)
|
||||
if(EXISTS "${src_directory}/${filename}.${OPT_LOWER}.cpp")
|
||||
message(STATUS "Using overrided ${OPT} source: ${src_directory}/${filename}.${OPT_LOWER}.cpp")
|
||||
message(STATUS "Using overridden ${OPT} source: ${src_directory}/${filename}.${OPT_LOWER}.cpp")
|
||||
else()
|
||||
list(APPEND ${target_src_var} "${__file}")
|
||||
endif()
|
||||
|
||||
@@ -123,6 +123,9 @@ if(CV_GCC OR CV_CLANG)
|
||||
add_extra_compiler_option(-Wsign-promo)
|
||||
add_extra_compiler_option(-Wuninitialized)
|
||||
add_extra_compiler_option(-Winit-self)
|
||||
if(CV_GCC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))
|
||||
add_extra_compiler_option(-Wno-psabi)
|
||||
endif()
|
||||
if(HAVE_CXX11)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT ENABLE_PRECOMPILED_HEADERS)
|
||||
add_extra_compiler_option(-Wsuggest-override)
|
||||
@@ -282,11 +285,6 @@ if(MSVC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Adding additional using directory for WindowsPhone 8.0 to get Windows.winmd properly
|
||||
if(WINRT_PHONE AND WINRT_8_0)
|
||||
set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} /AI\$(WindowsSDK_MetadataPath)")
|
||||
endif()
|
||||
|
||||
include(cmake/OpenCVCompilerOptimizations.cmake)
|
||||
if(COMMAND ocv_compiler_optimization_options)
|
||||
ocv_compiler_optimization_options()
|
||||
|
||||
@@ -27,7 +27,7 @@ if(ANT_EXECUTABLE)
|
||||
unset(ANT_EXECUTABLE CACHE)
|
||||
else()
|
||||
string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" ANT_VERSION "${ANT_VERSION_FULL}")
|
||||
set(ANT_VERSION "${ANT_VERSION}" CACHE INTERNAL "Detected ant vesion")
|
||||
set(ANT_VERSION "${ANT_VERSION}" CACHE INTERNAL "Detected ant version")
|
||||
|
||||
message(STATUS "Found apache ant: ${ANT_EXECUTABLE} (${ANT_VERSION})")
|
||||
endif()
|
||||
|
||||
@@ -368,7 +368,7 @@ if(HAVE_CUDA)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY} ${CUDA_npp_LIBRARY})
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
|
||||
if(HAVE_CUBLAS)
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cublas_LIBRARY})
|
||||
endif()
|
||||
|
||||
@@ -191,6 +191,25 @@ if(NOT HAVE_CXX11)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_CXX11)
|
||||
message(FATAL_ERROR "OpenCV 4.x requires C++11")
|
||||
endif()
|
||||
|
||||
if((HAVE_CXX11
|
||||
AND NOT MSVC
|
||||
AND NOT (X86 OR X86_64)
|
||||
AND NOT OPENCV_SKIP_LIBATOMIC_COMPILER_CHECK)
|
||||
OR OPENCV_FORCE_LIBATOMIC_COMPILER_CHECK
|
||||
)
|
||||
ocv_check_compiler_flag(CXX "" HAVE_CXX_ATOMICS_WITHOUT_LIB "${OpenCV_SOURCE_DIR}/cmake/checks/atomic_check.cpp")
|
||||
if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES atomic)
|
||||
ocv_check_compiler_flag(CXX "" HAVE_CXX_ATOMICS_WITH_LIB "${OpenCV_SOURCE_DIR}/cmake/checks/atomic_check.cpp")
|
||||
if(HAVE_CXX_ATOMICS_WITH_LIB)
|
||||
list(APPEND OPENCV_LINKER_LIBS atomic)
|
||||
else()
|
||||
message(FATAL_ERROR "C++11 compiler must support std::atomic")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#
|
||||
# Detect parameters:
|
||||
# 1. Native cmake IE package:
|
||||
# - enironment variable InferenceEngine_DIR is set to location of cmake module
|
||||
# - environment variable InferenceEngine_DIR is set to location of cmake module
|
||||
# 2. Custom location:
|
||||
# - INF_ENGINE_INCLUDE_DIRS - headers search location
|
||||
# - INF_ENGINE_LIB_DIRS - library search location
|
||||
@@ -45,7 +45,7 @@ endfunction()
|
||||
|
||||
find_package(InferenceEngine QUIET)
|
||||
if(InferenceEngine_FOUND)
|
||||
set(INF_ENGINE_TARGET IE::inference_engine)
|
||||
set(INF_ENGINE_TARGET ${InferenceEngine_LIBRARIES})
|
||||
set(INF_ENGINE_VERSION "${InferenceEngine_VERSION}" CACHE STRING "")
|
||||
message(STATUS "Detected InferenceEngine: cmake package")
|
||||
endif()
|
||||
@@ -80,9 +80,9 @@ endif()
|
||||
|
||||
if(INF_ENGINE_TARGET)
|
||||
if(NOT INF_ENGINE_RELEASE)
|
||||
message(WARNING "InferenceEngine version have not been set, 2019R2 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors.")
|
||||
message(WARNING "InferenceEngine version have not been set, 2019R3 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors.")
|
||||
endif()
|
||||
set(INF_ENGINE_RELEASE "2019020000" CACHE STRING "Force IE version, should be in form YYYYAABBCC (e.g. 2018R2.0.2 -> 2018020002)")
|
||||
set(INF_ENGINE_RELEASE "2019030000" CACHE STRING "Force IE version, should be in form YYYYAABBCC (e.g. 2018R2.0.2 -> 2018020002)")
|
||||
set_target_properties(${INF_ENGINE_TARGET} PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "HAVE_INF_ENGINE=1;INF_ENGINE_RELEASE=${INF_ENGINE_RELEASE}"
|
||||
)
|
||||
|
||||
@@ -186,11 +186,7 @@ if(NOT ${found})
|
||||
else() #debian based assumed, install to the dist-packages.
|
||||
set(_packages_path "python${_version_major_minor}/dist-packages")
|
||||
endif()
|
||||
if(EXISTS "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${${packages_path}}")
|
||||
set(_packages_path "lib${LIB_SUFFIX}/${_packages_path}")
|
||||
else()
|
||||
set(_packages_path "lib/${_packages_path}")
|
||||
endif()
|
||||
set(_packages_path "lib/${_packages_path}")
|
||||
elseif(CMAKE_HOST_WIN32)
|
||||
get_filename_component(_path "${_executable}" PATH)
|
||||
file(TO_CMAKE_PATH "${_path}" _path)
|
||||
@@ -249,7 +245,7 @@ if(NOT ${found})
|
||||
|
||||
# Export return values
|
||||
set(${found} "${_found}" CACHE INTERNAL "")
|
||||
set(${executable} "${_executable}" CACHE FILEPATH "Path to Python interpretor")
|
||||
set(${executable} "${_executable}" CACHE FILEPATH "Path to Python interpreter")
|
||||
set(${version_string} "${_version_string}" CACHE INTERNAL "")
|
||||
set(${version_major} "${_version_major}" CACHE INTERNAL "")
|
||||
set(${version_minor} "${_version_minor}" CACHE INTERNAL "")
|
||||
|
||||
@@ -122,13 +122,8 @@ endif()
|
||||
# Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages
|
||||
# --------------------------------------------------------------------------------------------
|
||||
if(WIN32)
|
||||
if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(_lib_suffix "lib")
|
||||
else()
|
||||
set(_lib_suffix "staticlib")
|
||||
endif()
|
||||
ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" "${OpenCV_INSTALL_BINARIES_PREFIX}${_lib_suffix}" "OpenCVConfig.root-WIN32.cmake.in")
|
||||
if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows AND NOT OPENCV_SKIP_CMAKE_ROOT_CONFIG)
|
||||
ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" "${OPENCV_LIB_INSTALL_PATH}" "OpenCVConfig.root-WIN32.cmake.in")
|
||||
else()
|
||||
ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" "" "")
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
# message(STATUS "Initial install layout:")
|
||||
# ocv_cmake_dump_vars("OPENCV_.*_INSTALL_PATH")
|
||||
|
||||
if(ANDROID)
|
||||
|
||||
ocv_update(OPENCV_BIN_INSTALL_PATH "sdk/native/bin/${ANDROID_NDK_ABI_NAME}")
|
||||
ocv_update(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
|
||||
ocv_update(OPENCV_SAMPLES_BIN_INSTALL_PATH "sdk/native/samples/${ANDROID_NDK_ABI_NAME}")
|
||||
ocv_update(OPENCV_LIB_INSTALL_PATH "sdk/native/libs/${ANDROID_NDK_ABI_NAME}")
|
||||
ocv_update(OPENCV_LIB_ARCHIVE_INSTALL_PATH "sdk/native/staticlibs/${ANDROID_NDK_ABI_NAME}")
|
||||
ocv_update(OPENCV_3P_LIB_INSTALL_PATH "sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME}")
|
||||
ocv_update(OPENCV_CONFIG_INSTALL_PATH "sdk/native/jni")
|
||||
ocv_update(OPENCV_INCLUDE_INSTALL_PATH "sdk/native/jni/include")
|
||||
ocv_update(OPENCV_OTHER_INSTALL_PATH "sdk/etc")
|
||||
ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH "samples/native")
|
||||
ocv_update(OPENCV_LICENSES_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}/licenses")
|
||||
ocv_update(OPENCV_TEST_DATA_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}/testdata")
|
||||
ocv_update(OPENCV_DOC_INSTALL_PATH "doc")
|
||||
ocv_update(OPENCV_JAR_INSTALL_PATH ".")
|
||||
ocv_update(OPENCV_JNI_INSTALL_PATH "${OPENCV_LIB_INSTALL_PATH}")
|
||||
ocv_update(OPENCV_JNI_BIN_INSTALL_PATH "${OPENCV_JNI_INSTALL_PATH}")
|
||||
|
||||
elseif(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||
|
||||
if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH)
|
||||
set(_prefix "${OpenCV_ARCH}/${OpenCV_RUNTIME}/")
|
||||
else()
|
||||
message(STATUS "Can't detect runtime and/or arch")
|
||||
set(_prefix "")
|
||||
endif()
|
||||
if(OpenCV_STATIC)
|
||||
set(_suffix "staticlib")
|
||||
else()
|
||||
set(_suffix "lib")
|
||||
endif()
|
||||
if(INSTALL_CREATE_DISTRIB)
|
||||
set(_jni_suffix "/${OpenCV_ARCH}")
|
||||
else()
|
||||
set(_jni_suffix "")
|
||||
endif()
|
||||
|
||||
ocv_update(OPENCV_BIN_INSTALL_PATH "${_prefix}bin")
|
||||
ocv_update(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
|
||||
ocv_update(OPENCV_SAMPLES_BIN_INSTALL_PATH "${_prefix}samples")
|
||||
ocv_update(OPENCV_LIB_INSTALL_PATH "${_prefix}${_suffix}")
|
||||
ocv_update(OPENCV_LIB_ARCHIVE_INSTALL_PATH "${OPENCV_LIB_INSTALL_PATH}")
|
||||
ocv_update(OPENCV_3P_LIB_INSTALL_PATH "${OPENCV_LIB_INSTALL_PATH}")
|
||||
ocv_update(OPENCV_CONFIG_INSTALL_PATH ".")
|
||||
ocv_update(OPENCV_INCLUDE_INSTALL_PATH "include")
|
||||
ocv_update(OPENCV_OTHER_INSTALL_PATH "etc")
|
||||
ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH "samples")
|
||||
ocv_update(OPENCV_LICENSES_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}/licenses")
|
||||
ocv_update(OPENCV_TEST_DATA_INSTALL_PATH "testdata")
|
||||
ocv_update(OPENCV_DOC_INSTALL_PATH "doc")
|
||||
ocv_update(OPENCV_JAR_INSTALL_PATH "java")
|
||||
ocv_update(OPENCV_JNI_INSTALL_PATH "java${_jni_suffix}")
|
||||
ocv_update(OPENCV_JNI_BIN_INSTALL_PATH "${OPENCV_JNI_INSTALL_PATH}")
|
||||
|
||||
else() # UNIX
|
||||
|
||||
include(GNUInstallDirs)
|
||||
ocv_update(OPENCV_BIN_INSTALL_PATH "bin")
|
||||
ocv_update(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
|
||||
ocv_update(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
|
||||
ocv_update(OPENCV_LIB_INSTALL_PATH "${CMAKE_INSTALL_LIBDIR}")
|
||||
ocv_update(OPENCV_LIB_ARCHIVE_INSTALL_PATH "${OPENCV_LIB_INSTALL_PATH}")
|
||||
ocv_update(OPENCV_3P_LIB_INSTALL_PATH "${OPENCV_LIB_INSTALL_PATH}/opencv4/3rdparty")
|
||||
ocv_update(OPENCV_CONFIG_INSTALL_PATH "${OPENCV_LIB_INSTALL_PATH}/cmake/opencv4")
|
||||
ocv_update(OPENCV_INCLUDE_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}/opencv4")
|
||||
ocv_update(OPENCV_OTHER_INSTALL_PATH "${CMAKE_INSTALL_DATAROOTDIR}/opencv4")
|
||||
ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}/samples")
|
||||
ocv_update(OPENCV_LICENSES_INSTALL_PATH "${CMAKE_INSTALL_DATAROOTDIR}/licenses/opencv4")
|
||||
ocv_update(OPENCV_TEST_DATA_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}/testdata")
|
||||
ocv_update(OPENCV_DOC_INSTALL_PATH "${CMAKE_INSTALL_DATAROOTDIR}/doc/opencv4")
|
||||
ocv_update(OPENCV_JAR_INSTALL_PATH "${CMAKE_INSTALL_DATAROOTDIR}/java/opencv4")
|
||||
ocv_update(OPENCV_JNI_INSTALL_PATH "${OPENCV_JAR_INSTALL_PATH}")
|
||||
ocv_update(OPENCV_JNI_BIN_INSTALL_PATH "${OPENCV_JNI_INSTALL_PATH}")
|
||||
|
||||
endif()
|
||||
|
||||
ocv_update(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}")
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
if(INSTALL_TO_MANGLED_PATHS)
|
||||
foreach(v
|
||||
OPENCV_INCLUDE_INSTALL_PATH
|
||||
# file names include version (.so/.dll): OPENCV_LIB_INSTALL_PATH
|
||||
OPENCV_CONFIG_INSTALL_PATH
|
||||
OPENCV_3P_LIB_INSTALL_PATH
|
||||
OPENCV_SAMPLES_SRC_INSTALL_PATH
|
||||
OPENCV_DOC_INSTALL_PATH
|
||||
# JAR file name includes version: OPENCV_JAR_INSTALL_PATH
|
||||
OPENCV_TEST_DATA_INSTALL_PATH
|
||||
OPENCV_OTHER_INSTALL_PATH
|
||||
)
|
||||
string(REGEX REPLACE "opencv[0-9]*" "opencv-${OPENCV_VERSION}" ${v} "${${v}}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# message(STATUS "Final install layout:")
|
||||
# ocv_cmake_dump_vars("OPENCV_.*_INSTALL_PATH")
|
||||
@@ -1,4 +1,6 @@
|
||||
set(MIN_VER_CMAKE 3.5.1)
|
||||
if(NOT DEFINED MIN_VER_CMAKE)
|
||||
set(MIN_VER_CMAKE 3.5.1)
|
||||
endif()
|
||||
set(MIN_VER_CUDA 6.5)
|
||||
set(MIN_VER_CUDNN 6)
|
||||
set(MIN_VER_PYTHON2 2.7)
|
||||
|
||||
@@ -852,7 +852,7 @@ macro(ocv_create_module)
|
||||
set(the_module_target ${the_module})
|
||||
endif()
|
||||
|
||||
if(WINRT)
|
||||
if(WINRT AND BUILD_TESTS)
|
||||
# removing APPCONTAINER from modules to run from console
|
||||
# in case of usual starting of WinRT test apps output is missing
|
||||
# so starting of console version w/o APPCONTAINER is required to get test results
|
||||
@@ -1206,10 +1206,6 @@ endfunction()
|
||||
function(ocv_add_accuracy_tests)
|
||||
ocv_debug_message("ocv_add_accuracy_tests(" ${ARGN} ")")
|
||||
|
||||
if(WINRT)
|
||||
set(OPENCV_DEBUG_POSTFIX "")
|
||||
endif()
|
||||
|
||||
set(test_path "${CMAKE_CURRENT_LIST_DIR}/test")
|
||||
if(BUILD_TESTS AND EXISTS "${test_path}")
|
||||
__ocv_parse_test_sources(TEST ${ARGN})
|
||||
|
||||
@@ -305,10 +305,13 @@ fi
|
||||
${_command} '-D$<JOIN:$<TARGET_PROPERTY:${_targetName},COMPILE_DEFINITIONS>,' '-D>'
|
||||
")
|
||||
GET_FILENAME_COMPONENT(_outdir ${_output} PATH)
|
||||
if(NOT CMAKE_HOST_WIN32) # chmod may be not available on Win32/MinGW (and it is not required)
|
||||
set(_pch_prepare_command COMMAND chmod +x "${_pch_generate_file_cmd}")
|
||||
endif()
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT "${_output}"
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${_outdir}"
|
||||
COMMAND chmod +x "${_pch_generate_file_cmd}"
|
||||
${_pch_prepare_command}
|
||||
COMMAND "${_pch_generate_file_cmd}"
|
||||
DEPENDS "${_input}" "${_pch_generate_file_cmd}"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${_name}"
|
||||
|
||||
@@ -16,7 +16,8 @@ function(ocv_cmake_dump_vars)
|
||||
string(TOLOWER "${__variableName}" __variableName_lower)
|
||||
if((__variableName MATCHES "${regex}" OR __variableName_lower MATCHES "${regex_lower}")
|
||||
AND NOT __variableName_lower MATCHES "^__")
|
||||
set(__VARS "${__VARS}${__variableName}=${${__variableName}}\n")
|
||||
get_property(__value VARIABLE PROPERTY "${__variableName}")
|
||||
set(__VARS "${__VARS}${__variableName}=${__value}\n")
|
||||
endif()
|
||||
endforeach()
|
||||
if(DUMP_TOFILE)
|
||||
@@ -414,12 +415,34 @@ MACRO(ocv_check_compiler_flag LANG FLAG RESULT)
|
||||
else()
|
||||
set(__msg "")
|
||||
endif()
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(__link_libs LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
|
||||
else()
|
||||
set(__link_libs)
|
||||
endif()
|
||||
set(__cmake_flags "")
|
||||
if(CMAKE_EXE_LINKER_FLAGS) # CMP0056 do this on new CMake
|
||||
list(APPEND __cmake_flags "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}")
|
||||
endif()
|
||||
|
||||
# CMP0067 do this on new CMake
|
||||
if(DEFINED CMAKE_CXX_STANDARD)
|
||||
list(APPEND __cmake_flags "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}")
|
||||
endif()
|
||||
if(DEFINED CMAKE_CXX_STANDARD_REQUIRED)
|
||||
list(APPEND __cmake_flags "-DCMAKE_CXX_STANDARD_REQUIRED=${CMAKE_CXX_STANDARD_REQUIRED}")
|
||||
endif()
|
||||
if(DEFINED CMAKE_CXX_EXTENSIONS)
|
||||
list(APPEND __cmake_flags "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
|
||||
endif()
|
||||
|
||||
MESSAGE(STATUS "Performing Test ${RESULT}${__msg}")
|
||||
TRY_COMPILE(${RESULT}
|
||||
"${CMAKE_BINARY_DIR}"
|
||||
"${_fname}"
|
||||
CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}" # CMP0056 do this on new CMake
|
||||
CMAKE_FLAGS ${__cmake_flags}
|
||||
COMPILE_DEFINITIONS "${FLAG}"
|
||||
${__link_libs}
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
|
||||
if(${RESULT})
|
||||
@@ -781,7 +804,7 @@ macro(ocv_check_modules define)
|
||||
if(pkgcfg_lib_${define}_${_lib})
|
||||
list(APPEND _libs "${pkgcfg_lib_${define}_${_lib}}")
|
||||
else()
|
||||
message(WARNING "ocv_check_modules(${define}): can't find library '${_lib}'. Specify 'pkgcfg_lib_${define}_${_lib}' manualy")
|
||||
message(WARNING "ocv_check_modules(${define}): can't find library '${_lib}'. Specify 'pkgcfg_lib_${define}_${_lib}' manually")
|
||||
list(APPEND _libs "${_lib}")
|
||||
endif()
|
||||
else()
|
||||
|
||||
@@ -49,7 +49,7 @@ macro(android_get_compatible_target VAR)
|
||||
list(GET ANDROID_SDK_TARGETS 0 __lvl)
|
||||
string(REGEX MATCH "[0-9]+$" __lvl "${__lvl}")
|
||||
|
||||
#find minimal level mathing to all provided levels
|
||||
#find minimal level matching to all provided levels
|
||||
foreach(lvl ${ARGN})
|
||||
string(REGEX MATCH "[0-9]+$" __level "${lvl}")
|
||||
if(__level GREATER __lvl)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <atomic>
|
||||
|
||||
static int test()
|
||||
{
|
||||
std::atomic<int> x;
|
||||
return x;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
return test();
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
# empty
|
||||
@@ -0,0 +1 @@
|
||||
# empty
|
||||
@@ -0,0 +1 @@
|
||||
# empty
|
||||
@@ -0,0 +1,31 @@
|
||||
set(WINRT TRUE)
|
||||
|
||||
add_definitions(-DWINRT -DNO_GETENV)
|
||||
|
||||
# Making definitions available to other configurations and
|
||||
# to filter dependency restrictions at compile time.
|
||||
if(WINDOWS_PHONE)
|
||||
set(WINRT_PHONE TRUE)
|
||||
add_definitions(-DWINRT_PHONE)
|
||||
elseif(WINDOWS_STORE)
|
||||
set(WINRT_STORE TRUE)
|
||||
add_definitions(-DWINRT_STORE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_VERSION MATCHES 10)
|
||||
set(WINRT_10 TRUE)
|
||||
add_definitions(-DWINRT_10)
|
||||
add_definitions(/DWINVER=_WIN32_WINNT_WIN10 /DNTDDI_VERSION=NTDDI_WIN10 /D_WIN32_WINNT=_WIN32_WINNT_WIN10)
|
||||
elseif(CMAKE_SYSTEM_VERSION MATCHES 8.1)
|
||||
set(WINRT_8_1 TRUE)
|
||||
add_definitions(-DWINRT_8_1)
|
||||
add_definitions(/DWINVER=_WIN32_WINNT_WINBLUE /DNTDDI_VERSION=NTDDI_WINBLUE /D_WIN32_WINNT=_WIN32_WINNT_WINBLUE)
|
||||
elseif(CMAKE_SYSTEM_VERSION MATCHES 8.0)
|
||||
set(WINRT_8_0 TRUE)
|
||||
add_definitions(-DWINRT_8_0)
|
||||
add_definitions(/DWINVER=_WIN32_WINNT_WIN8 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=_WIN32_WINNT_WIN8)
|
||||
else()
|
||||
message(STATUS "Unsupported WINRT version (consider upgrading OpenCV): ${CMAKE_SYSTEM_VERSION}")
|
||||
endif()
|
||||
|
||||
set(OPENCV_DEBUG_POSTFIX "")
|
||||
@@ -0,0 +1 @@
|
||||
# empty
|
||||
@@ -0,0 +1 @@
|
||||
add_definitions(-DNO_GETENV)
|
||||
@@ -0,0 +1,6 @@
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/OpenCV_WinRT.cmake")
|
||||
|
||||
# Adding additional using directory for WindowsPhone 8.0 to get Windows.winmd properly
|
||||
if(WINRT_8_0)
|
||||
set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} /AI\$(WindowsSDK_MetadataPath)")
|
||||
endif()
|
||||
@@ -0,0 +1 @@
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/OpenCV_WinRT.cmake")
|
||||
@@ -0,0 +1 @@
|
||||
# empty
|
||||
@@ -18,11 +18,17 @@ namespace cv {
|
||||
extern __declspec(dllimport) bool __termination; // Details: #12750
|
||||
}
|
||||
|
||||
extern "C"
|
||||
BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID lpReserved);
|
||||
#ifdef _WIN32_WCE
|
||||
#define DLL_MAIN_ARG0 HANDLE
|
||||
#else
|
||||
#define DLL_MAIN_ARG0 HINSTANCE
|
||||
#endif
|
||||
|
||||
extern "C"
|
||||
BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID lpReserved)
|
||||
BOOL WINAPI DllMain(DLL_MAIN_ARG0, DWORD fdwReason, LPVOID lpReserved);
|
||||
|
||||
extern "C"
|
||||
BOOL WINAPI DllMain(DLL_MAIN_ARG0, DWORD fdwReason, LPVOID lpReserved)
|
||||
{
|
||||
if (fdwReason == DLL_THREAD_DETACH || fdwReason == DLL_PROCESS_DETACH)
|
||||
{
|
||||
|
||||
@@ -147,7 +147,7 @@ if(DOXYGEN_FOUND)
|
||||
|
||||
# set export variables
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_INPUT_LIST "${rootfile} ; ${faqfile} ; ${paths_include} ; ${paths_hal_interface} ; ${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${tutorial_js_path} ; ${paths_tutorial} ; ${tutorial_contrib_root}")
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_IMAGE_PATH "${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${tutorial_js_path} ; ${paths_tutorial}")
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_IMAGE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/images ; ${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${tutorial_js_path} ; ${paths_tutorial}")
|
||||
string(REPLACE ";" " \\\n" CMAKE_DOXYGEN_EXCLUDE_LIST "${CMAKE_DOXYGEN_EXCLUDE_LIST}")
|
||||
string(REPLACE ";" " " CMAKE_DOXYGEN_ENABLED_SECTIONS "${CMAKE_DOXYGEN_ENABLED_SECTIONS}")
|
||||
# TODO: remove paths_doc from EXAMPLE_PATH after face module tutorials/samples moved to separate folders
|
||||
|
||||
@@ -266,9 +266,7 @@ GENERATE_TAGFILE = @CMAKE_DOXYGEN_OUTPUT_PATH@/html/opencv.tag
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
EXTERNAL_PAGES = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
CLASS_DIAGRAMS = YES
|
||||
MSCGEN_PATH =
|
||||
DIA_PATH =
|
||||
HIDE_UNDOC_RELATIONS = NO
|
||||
HAVE_DOT = NO
|
||||
|
||||
|
Before Width: | Height: | Size: 247 KiB After Width: | Height: | Size: 247 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 176 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
@@ -7,6 +7,9 @@ Installing Emscripten
|
||||
|
||||
[Emscripten](https://github.com/kripken/emscripten) is an LLVM-to-JavaScript compiler. We will use Emscripten to build OpenCV.js.
|
||||
|
||||
@note
|
||||
While this describes installation of required tools from scratch, there's a section below also describing an alternative procedure to perform the same build using docker containers which is often easier.
|
||||
|
||||
To Install Emscripten, follow instructions of [Emscripten SDK](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html).
|
||||
|
||||
For example:
|
||||
@@ -103,3 +106,25 @@ Building OpenCV.js from Source
|
||||
|
||||
@note
|
||||
It requires `node` installed in your development environment.
|
||||
|
||||
Building OpenCV.js with Docker
|
||||
---------------------------------------
|
||||
|
||||
Alternatively, the same build can be can be accomplished using [docker](https://www.docker.com/) containers which is often easier and more reliable, particularly in non linux systems. You only need to install [docker](https://www.docker.com/) on your system and use a popular container that provides a clean well tested environment for emscripten builds like this, that already has latest versions of all the necessary tools installed.
|
||||
|
||||
So, make sure [docker](https://www.docker.com/) is installed in your system and running. The following shell script should work in linux and MacOS:
|
||||
|
||||
@code{.bash}
|
||||
git clone https://github.com/opencv/opencv.git
|
||||
cd opencv
|
||||
docker run --rm --workdir /code -v "$PWD":/code "trzeci/emscripten:latest" python ./platforms/js/build_js.py build_js
|
||||
@endcode
|
||||
|
||||
In Windows use the following PowerShell command:
|
||||
|
||||
@code{.bash}
|
||||
docker run --rm --workdir /code -v "$(get-location):/code" "trzeci/emscripten:latest" python ./platforms/js/build_js.py build_js
|
||||
@endcode
|
||||
|
||||
@note
|
||||
The example uses latest version of [trzeci/emscripten](https://hub.docker.com/r/trzeci/emscripten) docker container. At this time, the latest version works fine and is `trzeci/emscripten:sdk-tag-1.38.32-64bit`
|
||||
|
||||
@@ -13,7 +13,7 @@ Optical Flow
|
||||
------------
|
||||
|
||||
Optical flow is the pattern of apparent motion of image objects between two consecutive frames
|
||||
caused by the movemement of object or camera. It is 2D vector field where each vector is a
|
||||
caused by the movement of object or camera. It is 2D vector field where each vector is a
|
||||
displacement vector showing the movement of points from first frame to second. Consider the image
|
||||
below (Image Courtesy: [Wikipedia article on Optical
|
||||
Flow](http://en.wikipedia.org/wiki/Optical_flow)).
|
||||
|
||||
@@ -40,7 +40,7 @@ goal):
|
||||
img1 = cv.imread('messi5.jpg')
|
||||
|
||||
e1 = cv.getTickCount()
|
||||
for i in xrange(5,49,2):
|
||||
for i in range(5,49,2):
|
||||
img1 = cv.medianBlur(img1,i)
|
||||
e2 = cv.getTickCount()
|
||||
t = (e2 - e1)/cv.getTickFrequency()
|
||||
|
||||
@@ -38,13 +38,13 @@ best matches. There is also **cv.drawMatchesKnn** which draws all the k best mat
|
||||
will draw two match-lines for each keypoint. So we have to pass a mask if we want to selectively
|
||||
draw it.
|
||||
|
||||
Let's see one example for each of SURF and ORB (Both use different distance measurements).
|
||||
Let's see one example for each of SIFT and ORB (Both use different distance measurements).
|
||||
|
||||
### Brute-Force Matching with ORB Descriptors
|
||||
|
||||
Here, we will see a simple example on how to match features between two images. In this case, I have
|
||||
a queryImage and a trainImage. We will try to find the queryImage in trainImage using feature
|
||||
matching. ( The images are /samples/c/box.png and /samples/c/box_in_scene.png)
|
||||
matching. ( The images are /samples/data/box.png and /samples/data/box_in_scene.png)
|
||||
|
||||
We are using ORB descriptors to match features. So let's start with loading images, finding
|
||||
descriptors etc.
|
||||
|
||||
@@ -253,8 +253,8 @@ Here is explained in detail the code for the real time application:
|
||||
@code{.cpp}
|
||||
RobustMatcher rmatcher; // instantiate RobustMatcher
|
||||
|
||||
cv::FeatureDetector * detector = new cv::OrbFeatureDetector(numKeyPoints); // instatiate ORB feature detector
|
||||
cv::DescriptorExtractor * extractor = new cv::OrbDescriptorExtractor(); // instatiate ORB descriptor extractor
|
||||
cv::FeatureDetector * detector = new cv::OrbFeatureDetector(numKeyPoints); // instantiate ORB feature detector
|
||||
cv::DescriptorExtractor * extractor = new cv::OrbDescriptorExtractor(); // instantiate ORB descriptor extractor
|
||||
|
||||
rmatcher.setFeatureDetector(detector); // set feature detector
|
||||
rmatcher.setDescriptorExtractor(extractor); // set descriptor extractor
|
||||
|
||||
@@ -12,7 +12,7 @@ Tutorial was written for the following versions of corresponding software:
|
||||
|
||||
- Download and install Android Studio from https://developer.android.com/studio.
|
||||
|
||||
- Get the latest pre-built OpenCV for Android release from https://github.com/opencv/opencv/releases and unpack it (for example, `opencv-4.1.1-android-sdk.zip`).
|
||||
- Get the latest pre-built OpenCV for Android release from https://github.com/opencv/opencv/releases and unpack it (for example, `opencv-4.1.2-android-sdk.zip`).
|
||||
|
||||
- Download MobileNet object detection model from https://github.com/chuanqi305/MobileNet-SSD. We need a configuration file `MobileNetSSD_deploy.prototxt` and weights `MobileNetSSD_deploy.caffemodel`.
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ This distance is equivalent to count the number of different elements for binary
|
||||
|
||||
To filter the matches, Lowe proposed in @cite Lowe:2004:DIF:993451.996342 to use a distance ratio test to try to eliminate false matches.
|
||||
The distance ratio between the two nearest matches of a considered keypoint is computed and it is a good match when this value is below
|
||||
a thresold. Indeed, this ratio allows helping to discriminate between ambiguous matches (distance ratio between the two nearest neighbors is
|
||||
close to one) and well discriminated matches. The figure below from the SIFT paper illustrates the probability that a match is correct
|
||||
a threshold. Indeed, this ratio allows helping to discriminate between ambiguous matches (distance ratio between the two nearest neighbors
|
||||
is close to one) and well discriminated matches. The figure below from the SIFT paper illustrates the probability that a match is correct
|
||||
based on the nearest-neighbor distance ratio test.
|
||||
|
||||

|
||||
|
||||
@@ -39,7 +39,7 @@ With G-API, we can define it as follows:
|
||||
It is important to understand that the new G-API based version of
|
||||
calcGST() will just produce a compute graph, in contrast to its
|
||||
original version, which actually calculates the values. This is a
|
||||
principial difference -- G-API based functions like this are used to
|
||||
principal difference -- G-API based functions like this are used to
|
||||
construct graphs, not to process the actual data.
|
||||
|
||||
Let's start implementing calcGST() with calculation of \f$J\f$
|
||||
@@ -186,7 +186,7 @@ is also OpenCV-based since it fallbacks to OpenCV functions inside.
|
||||
|
||||
On GNU/Linux, application memory footprint can be profiled with
|
||||
[Valgrind](http://valgrind.org/). On Debian/Ubuntu systems it can be
|
||||
installed like this (assuming you have administrator priveleges):
|
||||
installed like this (assuming you have administrator privileges):
|
||||
|
||||
$ sudo apt-get install valgrind massif-visualizer
|
||||
|
||||
@@ -239,10 +239,10 @@ consumption is because the default naive OpenCV-based backend is used to
|
||||
execute this graph. This backend serves mostly for quick prototyping
|
||||
and debugging algorithms before offload/further optimization.
|
||||
|
||||
This backend doesn't utilize any complex memory mamagement strategies yet
|
||||
This backend doesn't utilize any complex memory management strategies yet
|
||||
since it is not its point at the moment. In the following chapter,
|
||||
we'll learn about Fluid backend and see how the same G-API code can
|
||||
run in a completely different model (and the footprint shrinked to a
|
||||
run in a completely different model (and the footprint shrunk to a
|
||||
number of kilobytes).
|
||||
|
||||
# Backends and kernels {#gapi_anisotropic_backends}
|
||||
@@ -298,7 +298,7 @@ as a _graph compilation option_:
|
||||
|
||||
@snippet cpp/tutorial_code/gapi/porting_anisotropic_image_segmentation/porting_anisotropic_image_segmentation_gapi_fluid.cpp kernel_pkg_use
|
||||
|
||||
Traditional OpenCV is logically divided into modules, whith every
|
||||
Traditional OpenCV is logically divided into modules, with every
|
||||
module providing a set of functions. In G-API, there are also
|
||||
"modules" which are represented as kernel packages provided by a
|
||||
particular backend. In this example, we pass Fluid kernel packages to
|
||||
@@ -375,7 +375,7 @@ left side of the dump) is easily noticeable.
|
||||
The visualization reflects how G-API deals with mixed graphs, also
|
||||
called _heterogeneous_ graphs. The majority of operations in this
|
||||
graph are implemented with Fluid backend, but Box filters are executed
|
||||
by the OpenCV backend. One can easily see that the graph is partioned
|
||||
by the OpenCV backend. One can easily see that the graph is partitioned
|
||||
(with rectangles). G-API groups connected operations based on their
|
||||
affinity, forming _subgraphs_ (or _islands_ in G-API terminology), and
|
||||
our top-level graph becomes a composition of multiple smaller
|
||||
|
||||
@@ -15,7 +15,7 @@ The primary objectives for this tutorial:
|
||||
|
||||
- How to use OpenCV [imread](@ref imread) to load satellite imagery.
|
||||
- How to use OpenCV [imread](@ref imread) to load SRTM Digital Elevation Models
|
||||
- Given the corner coordinates of both the image and DEM, correllate the elevation data to the
|
||||
- Given the corner coordinates of both the image and DEM, correlate the elevation data to the
|
||||
image to find elevations for each pixel.
|
||||
- Show a basic, easy-to-implement example of a terrain heat map.
|
||||
- Show a basic use of DEM data coupled with ortho-rectified imagery.
|
||||
|
||||
@@ -157,7 +157,7 @@ already known by now.
|
||||
- *src*: Source image
|
||||
- *dst*: Destination image
|
||||
- *Size(w, h)*: The size of the kernel to be used (the neighbors to be considered). \f$w\f$ and
|
||||
\f$h\f$ have to be odd and positive numbers otherwise thi size will be calculated using the
|
||||
\f$h\f$ have to be odd and positive numbers otherwise the size will be calculated using the
|
||||
\f$\sigma_{x}\f$ and \f$\sigma_{y}\f$ arguments.
|
||||
- \f$\sigma_{x}\f$: The standard deviation in x. Writing \f$0\f$ implies that \f$\sigma_{x}\f$ is
|
||||
calculated using kernel size.
|
||||
|
||||
@@ -30,7 +30,7 @@ Two of the most basic morphological operations are dilation and erosion. Dilatio
|
||||
|
||||

|
||||
|
||||
- __Erosion__: The vise versa applies for the erosion operation. The value of the output pixel is the <b><em>minimum</em></b> value of all the pixels that fall within the structuring element's size and shape. Look the at the example figures below:
|
||||
- __Erosion__: The vice versa applies for the erosion operation. The value of the output pixel is the <b><em>minimum</em></b> value of all the pixels that fall within the structuring element's size and shape. Look the at the example figures below:
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@ Open your Doxyfile using your favorite text editor and search for the key
|
||||
`TAGFILES`. Change it as follows:
|
||||
|
||||
@code
|
||||
TAGFILES = ./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/4.1.1
|
||||
TAGFILES = ./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/4.1.2
|
||||
@endcode
|
||||
|
||||
If you had other definitions already, you can append the line using a `\`:
|
||||
|
||||
@code
|
||||
TAGFILES = ./docs/doxygen-tags/libstdc++.tag=https://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen \
|
||||
./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/4.1.1
|
||||
./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/4.1.2
|
||||
@endcode
|
||||
|
||||
Doxygen can now use the information from the tag file to link to the OpenCV
|
||||
|
||||
|
Before Width: | Height: | Size: 606 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 606 KiB After Width: | Height: | Size: 606 KiB |
|
Before Width: | Height: | Size: 19 KiB |
@@ -189,7 +189,7 @@ brief->compute(gray, query_kpts, query_desc); //Compute brief descriptors at eac
|
||||
|
||||
OpenCL {#tutorial_transition_hints_opencl}
|
||||
------
|
||||
All specialized `ocl` implemetations has been hidden behind general C++ algorithm interface. Now the function execution path can be selected dynamically at runtime: CPU or OpenCL; this mechanism is also called "Transparent API".
|
||||
All specialized `ocl` implementations has been hidden behind general C++ algorithm interface. Now the function execution path can be selected dynamically at runtime: CPU or OpenCL; this mechanism is also called "Transparent API".
|
||||
|
||||
New class cv::UMat is intended to hide data exchange with OpenCL device in a convenient way.
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ Now we will learn how to write a simple Hello World Application in Xcode using O
|
||||
Output
|
||||
------
|
||||
|
||||

|
||||

|
||||
|
||||
Changes for XCode5+ and iOS8+
|
||||
-----------------------------
|
||||
|
||||
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
@@ -101,7 +101,7 @@ using namespace cv;
|
||||
}
|
||||
@endcode
|
||||
In this case, we initialize the camera and provide the imageView as a target for rendering each
|
||||
frame. CvVideoCamera is basically a wrapper around AVFoundation, so we provie as properties some of
|
||||
frame. CvVideoCamera is basically a wrapper around AVFoundation, so we provide as properties some of
|
||||
the AVFoundation camera options. For example we want to use the front camera, set the video size to
|
||||
352x288 and a video orientation (the video camera normally outputs in landscape mode, which results
|
||||
in transposed data when you design a portrait application).
|
||||
|
||||
|
Before Width: | Height: | Size: 203 KiB After Width: | Height: | Size: 203 KiB |
@@ -205,4 +205,4 @@ The code opens an image, finds the orientation of the detected objects of intere
|
||||
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
@@ -13,7 +13,7 @@ In this tutorial you will learn how to:
|
||||
Motivation
|
||||
----------
|
||||
|
||||
Why is it interesting to extend the SVM optimation problem in order to handle non-linearly separable
|
||||
Why is it interesting to extend the SVM optimization problem in order to handle non-linearly separable
|
||||
training data? Most of the applications in which SVMs are used in computer vision require a more
|
||||
powerful tool than a simple linear classifier. This stems from the fact that in these tasks __the
|
||||
training data can be rarely separated using an hyperplane__.
|
||||
|
||||
@@ -113,7 +113,7 @@ This tutorial code's is shown lines below. You can also download it from
|
||||
Result
|
||||
------
|
||||
|
||||
-# Here is the result of running the code above and using as input the video stream of a build-in
|
||||
-# Here is the result of running the code above and using as input the video stream of a built-in
|
||||
webcam:
|
||||
|
||||

|
||||
|
||||
@@ -15,7 +15,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/samples/cpp/stitching.cpp).
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/stitching.cpp).
|
||||
|
||||
@include samples/cpp/stitching.cpp
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 247 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 176 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
@@ -15,7 +15,7 @@ Optical Flow
|
||||
------------
|
||||
|
||||
Optical flow is the pattern of apparent motion of image objects between two consecutive frames
|
||||
caused by the movemement of object or camera. It is 2D vector field where each vector is a
|
||||
caused by the movement of object or camera. It is 2D vector field where each vector is a
|
||||
displacement vector showing the movement of points from first frame to second. Consider the image
|
||||
below (Image Courtesy: [Wikipedia article on Optical Flow](http://en.wikipedia.org/wiki/Optical_flow)).
|
||||
|
||||
|
||||
@@ -16,4 +16,4 @@ PERF_TEST(Undistort, InitUndistortMap)
|
||||
SANITY_CHECK_NOTHING();
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -627,7 +627,7 @@ static void cvProjectPoints2Internal( const CvMat* objectPoints,
|
||||
|
||||
if( (CV_MAT_TYPE(A->type) != CV_64FC1 && CV_MAT_TYPE(A->type) != CV_32FC1) ||
|
||||
A->rows != 3 || A->cols != 3 )
|
||||
CV_Error( CV_StsBadArg, "Instrinsic parameters must be 3x3 floating-point matrix" );
|
||||
CV_Error( CV_StsBadArg, "Intrinsic parameters must be 3x3 floating-point matrix" );
|
||||
|
||||
cvConvert( A, &_a );
|
||||
fx = a[0]; fy = a[4];
|
||||
@@ -1588,7 +1588,7 @@ static double cvCalibrateCamera2Internal( const CvMat* objectPoints,
|
||||
Mat _Je( maxPoints*2, 6, CV_64FC1 );
|
||||
Mat _err( maxPoints*2, 1, CV_64FC1 );
|
||||
|
||||
const bool allocJo = (solver.state == CvLevMarq::CALC_J) || stdDevs;
|
||||
const bool allocJo = (solver.state == CvLevMarq::CALC_J) || stdDevs || releaseObject;
|
||||
Mat _Jo = allocJo ? Mat( maxPoints*2, maxPoints*3, CV_64FC1, Scalar(0) ) : Mat();
|
||||
|
||||
if(flags & CALIB_USE_LU) {
|
||||
|
||||
@@ -119,7 +119,7 @@ cv::Mat findHomography1D(cv::InputArray _src,cv::InputArray _dst)
|
||||
cv::Mat b = cv::Mat::zeros(count,1,CV_64FC1);
|
||||
|
||||
// fill A;b and perform singular value decomposition
|
||||
// it is assumed that w is one for both cooridnates
|
||||
// it is assumed that w is one for both coordinates
|
||||
// h22 is kept to 1
|
||||
switch(src_n.type())
|
||||
{
|
||||
|
||||
@@ -252,7 +252,7 @@ class Chessboard: public cv::Feature2D
|
||||
/**
|
||||
* \brief Estimates the search area for a specific point based on the given homography
|
||||
*
|
||||
* \param[in] H homography descriping the transformation from ideal board to real one
|
||||
* \param[in] H homography describing the transformation from ideal board to real one
|
||||
* \param[in] row Row of the point
|
||||
* \param[in] col Col of the point
|
||||
* \param[in] p Percentage [0..1]
|
||||
@@ -562,8 +562,8 @@ class Chessboard: public cv::Feature2D
|
||||
void flipHorizontal();
|
||||
|
||||
/**
|
||||
* \brief Flips and rotates the board so that the anlge of
|
||||
* either the black or white diagonale is bigger than the x
|
||||
* \brief Flips and rotates the board so that the angle of
|
||||
* either the black or white diagonal is bigger than the x
|
||||
* and y axis of the board and from a right handed
|
||||
* coordinate system
|
||||
*/
|
||||
@@ -650,7 +650,7 @@ class Chessboard: public cv::Feature2D
|
||||
bool right(bool check_empty=false); // moves one corner to the right or returns false
|
||||
bool bottom(bool check_empty=false); // moves one corner to the bottom or returns false
|
||||
bool top(bool check_empty=false); // moves one corner to the top or returns false
|
||||
bool checkCorner()const; // returns ture if the current corner belongs to at least one
|
||||
bool checkCorner()const; // returns true if the current corner belongs to at least one
|
||||
// none empty cell
|
||||
bool isNaN()const; // returns true if the currnet corner is NaN
|
||||
|
||||
|
||||
@@ -506,7 +506,7 @@ int cv::recoverPose( InputArray E, InputArray _points1, InputArray _points2,
|
||||
// Do the cheirality check.
|
||||
// Notice here a threshold dist is used to filter
|
||||
// out far away points (i.e. infinite points) since
|
||||
// their depth may vary between positive and negtive.
|
||||
// their depth may vary between positive and negative.
|
||||
std::vector<Mat> allTriangulations(4);
|
||||
Mat Q;
|
||||
|
||||
|
||||
@@ -650,7 +650,7 @@ void PoseSolver::makeCanonicalObjectPoints(InputArray _objectPoints, OutputArray
|
||||
|
||||
if (!computeObjextSpaceR3Pts(objectPoints,R))
|
||||
{
|
||||
//we could not compute R, problably because there is a duplicate point in {objectPoints(0),objectPoints(1),objectPoints(2)}.
|
||||
//we could not compute R, probably because there is a duplicate point in {objectPoints(0),objectPoints(1),objectPoints(2)}.
|
||||
//So we compute it with the SVD (which is slower):
|
||||
computeObjextSpaceRSvD(UZero,R);
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ void CV_HomographyTest::print_information_4(int _method, int j, int N, int k, in
|
||||
cout << "Number of point: " << k << endl;
|
||||
cout << "Norm type using in criteria: "; if (NORM_TYPE[l] == 1) cout << "INF"; else if (NORM_TYPE[l] == 2) cout << "L1"; else cout << "L2"; cout << endl;
|
||||
cout << "Difference with noise of point: " << diff << endl;
|
||||
cout << "Maxumum allowed difference: " << max_2diff << endl; cout << endl;
|
||||
cout << "Maximum allowed difference: " << max_2diff << endl; cout << endl;
|
||||
}
|
||||
|
||||
void CV_HomographyTest::print_information_5(int _method, int j, int N, int l, double diff)
|
||||
@@ -204,7 +204,7 @@ void CV_HomographyTest::print_information_5(int _method, int j, int N, int l, do
|
||||
cout << "Count of points: " << N << endl;
|
||||
cout << "Norm type using in criteria: "; if (NORM_TYPE[l] == 1) cout << "INF"; else if (NORM_TYPE[l] == 2) cout << "L1"; else cout << "L2"; cout << endl;
|
||||
cout << "Difference with noise of points: " << diff << endl;
|
||||
cout << "Maxumum allowed difference: " << max_diff << endl; cout << endl;
|
||||
cout << "Maximum allowed difference: " << max_diff << endl; cout << endl;
|
||||
}
|
||||
|
||||
void CV_HomographyTest::print_information_6(int _method, int j, int N, int k, double diff, bool value)
|
||||
@@ -244,7 +244,7 @@ void CV_HomographyTest::print_information_8(int _method, int j, int N, int k, in
|
||||
cout << "Number of point: " << k << " " << endl;
|
||||
cout << "Norm type using in criteria: "; if (NORM_TYPE[l] == 1) cout << "INF"; else if (NORM_TYPE[l] == 2) cout << "L1"; else cout << "L2"; cout << endl;
|
||||
cout << "Difference with noise of point: " << diff << endl;
|
||||
cout << "Maxumum allowed difference: " << max_2diff << endl; cout << endl;
|
||||
cout << "Maximum allowed difference: " << max_2diff << endl; cout << endl;
|
||||
}
|
||||
|
||||
void CV_HomographyTest::run(int)
|
||||
|
||||
@@ -23,7 +23,7 @@ ocv_add_module(core
|
||||
|
||||
set(extra_libs "")
|
||||
|
||||
if(WINRT AND CMAKE_SYSTEM_NAME MATCHES WindowsStore AND CMAKE_SYSTEM_VERSION MATCHES "8.0")
|
||||
if(WINRT AND WINDOWS_STORE AND CMAKE_SYSTEM_VERSION MATCHES "8.0")
|
||||
list(APPEND extra_libs ole32.lib)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -73,8 +73,10 @@
|
||||
@defgroup core_cluster Clustering
|
||||
@defgroup core_utils Utility and system functions and macros
|
||||
@{
|
||||
@defgroup core_logging Logging facilities
|
||||
@defgroup core_utils_sse SSE utilities
|
||||
@defgroup core_utils_neon NEON utilities
|
||||
@defgroup core_utils_vsx VSX utilities
|
||||
@defgroup core_utils_softfloat Softfloat support
|
||||
@defgroup core_utils_samples Utility functions for OpenCV samples
|
||||
@}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
which is incompatible with C
|
||||
|
||||
It is OK to disable it because we only extend few plain structures with
|
||||
C++ construrtors for simpler interoperability with C++ API of the library
|
||||
C++ constructors for simpler interoperability with C++ API of the library
|
||||
*/
|
||||
# pragma warning(disable:4190)
|
||||
# elif defined __clang__ && __clang_major__ >= 3
|
||||
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
CV_WRAP GpuMat(int rows, int cols, int type, GpuMat::Allocator* allocator = GpuMat::defaultAllocator());
|
||||
CV_WRAP GpuMat(Size size, int type, GpuMat::Allocator* allocator = GpuMat::defaultAllocator());
|
||||
|
||||
//! constucts GpuMat and fills it with the specified value _s
|
||||
//! constructs GpuMat and fills it with the specified value _s
|
||||
CV_WRAP GpuMat(int rows, int cols, int type, Scalar s, GpuMat::Allocator* allocator = GpuMat::defaultAllocator());
|
||||
CV_WRAP GpuMat(Size size, int type, Scalar s, GpuMat::Allocator* allocator = GpuMat::defaultAllocator());
|
||||
|
||||
|
||||
@@ -47,12 +47,6 @@
|
||||
|
||||
#include "opencv2/core/cvdef.h"
|
||||
|
||||
#if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \
|
||||
&& defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__)
|
||||
#include <emmintrin.h>
|
||||
#endif
|
||||
|
||||
|
||||
//! @addtogroup core_utils
|
||||
//! @{
|
||||
|
||||
@@ -70,7 +64,24 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__ || defined __ARM_NEON__) && !defined __SOFTFP__ && !defined(__CUDACC__)
|
||||
#if defined(__CUDACC__)
|
||||
// nothing, intrinsics/asm code is not supported
|
||||
#else
|
||||
#if ((defined _MSC_VER && defined _M_X64) \
|
||||
|| (defined __GNUC__ && defined __x86_64__ && defined __SSE2__)) \
|
||||
&& !defined(OPENCV_SKIP_INCLUDE_EMMINTRIN_H)
|
||||
#include <emmintrin.h>
|
||||
#endif
|
||||
|
||||
#if defined __PPC64__ && defined __GNUC__ && defined _ARCH_PWR8 \
|
||||
&& !defined(OPENCV_SKIP_INCLUDE_ALTIVEC_H)
|
||||
#include <altivec.h>
|
||||
#endif
|
||||
|
||||
#if defined(CV_INLINE_ROUND_FLT)
|
||||
// user-specified version
|
||||
// CV_INLINE_ROUND_DBL should be defined too
|
||||
#elif defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__ || defined __ARM_NEON__) && !defined __SOFTFP__
|
||||
// 1. general scheme
|
||||
#define ARM_ROUND(_value, _asm_string) \
|
||||
int res; \
|
||||
@@ -80,13 +91,102 @@
|
||||
return res
|
||||
// 2. version for double
|
||||
#ifdef __clang__
|
||||
#define ARM_ROUND_DBL(value) ARM_ROUND(value, "vcvtr.s32.f64 %[temp], %[value] \n vmov %[res], %[temp]")
|
||||
#define CV_INLINE_ROUND_DBL(value) ARM_ROUND(value, "vcvtr.s32.f64 %[temp], %[value] \n vmov %[res], %[temp]")
|
||||
#else
|
||||
#define ARM_ROUND_DBL(value) ARM_ROUND(value, "vcvtr.s32.f64 %[temp], %P[value] \n vmov %[res], %[temp]")
|
||||
#define CV_INLINE_ROUND_DBL(value) ARM_ROUND(value, "vcvtr.s32.f64 %[temp], %P[value] \n vmov %[res], %[temp]")
|
||||
#endif
|
||||
// 3. version for float
|
||||
#define ARM_ROUND_FLT(value) ARM_ROUND(value, "vcvtr.s32.f32 %[temp], %[value]\n vmov %[res], %[temp]")
|
||||
#endif
|
||||
#define CV_INLINE_ROUND_FLT(value) ARM_ROUND(value, "vcvtr.s32.f32 %[temp], %[value]\n vmov %[res], %[temp]")
|
||||
#elif defined __PPC64__ && defined __GNUC__ && defined _ARCH_PWR8
|
||||
// P8 and newer machines can convert fp32/64 to int quickly.
|
||||
#define CV_INLINE_ROUND_DBL(value) \
|
||||
int out; \
|
||||
double temp; \
|
||||
__asm__( "fctiw %[temp],%[in]\n\tmfvsrwz %[out],%[temp]\n\t" : [out] "=r" (out), [temp] "=d" (temp) : [in] "d" ((double)(value)) : ); \
|
||||
return out;
|
||||
|
||||
// FP32 also works with FP64 routine above
|
||||
#define CV_INLINE_ROUND_FLT(value) CV_INLINE_ROUND_DBL(value)
|
||||
#endif
|
||||
|
||||
#ifdef CV_INLINE_ISINF_FLT
|
||||
// user-specified version
|
||||
// CV_INLINE_ISINF_DBL should be defined too
|
||||
#elif defined __PPC64__ && defined _ARCH_PWR9 && defined(scalar_test_data_class)
|
||||
#define CV_INLINE_ISINF_DBL(value) return scalar_test_data_class(value, 0x30);
|
||||
#define CV_INLINE_ISINF_FLT(value) CV_INLINE_ISINF_DBL(value)
|
||||
#endif
|
||||
|
||||
#ifdef CV_INLINE_ISNAN_FLT
|
||||
// user-specified version
|
||||
// CV_INLINE_ISNAN_DBL should be defined too
|
||||
#elif defined __PPC64__ && defined _ARCH_PWR9 && defined(scalar_test_data_class)
|
||||
#define CV_INLINE_ISNAN_DBL(value) return scalar_test_data_class(value, 0x40);
|
||||
#define CV_INLINE_ISNAN_FLT(value) CV_INLINE_ISNAN_DBL(value)
|
||||
#endif
|
||||
|
||||
#if !defined(OPENCV_USE_FASTMATH_BUILTINS) \
|
||||
&& ( \
|
||||
defined(__x86_64__) || defined(__i686__) \
|
||||
|| defined(__arm__) \
|
||||
|| defined(__PPC64__) \
|
||||
)
|
||||
/* Let builtin C math functions when available. Dedicated hardware is available to
|
||||
round and convert FP values. */
|
||||
#define OPENCV_USE_FASTMATH_BUILTINS 1
|
||||
#endif
|
||||
|
||||
/* Enable builtin math functions if possible, desired, and available.
|
||||
Note, not all math functions inline equally. E.g lrint will not inline
|
||||
without the -fno-math-errno option. */
|
||||
#if defined(CV_ICC)
|
||||
// nothing
|
||||
#elif defined(OPENCV_USE_FASTMATH_BUILTINS) && OPENCV_USE_FASTMATH_BUILTINS
|
||||
#if defined(__clang__)
|
||||
#define CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS
|
||||
#if !defined(CV_INLINE_ISNAN_DBL) && __has_builtin(__builtin_isnan)
|
||||
#define CV_INLINE_ISNAN_DBL(value) return __builtin_isnan(value);
|
||||
#endif
|
||||
#if !defined(CV_INLINE_ISNAN_FLT) && __has_builtin(__builtin_isnan)
|
||||
#define CV_INLINE_ISNAN_FLT(value) return __builtin_isnan(value);
|
||||
#endif
|
||||
#if !defined(CV_INLINE_ISINF_DBL) && __has_builtin(__builtin_isinf)
|
||||
#define CV_INLINE_ISINF_DBL(value) return __builtin_isinf(value);
|
||||
#endif
|
||||
#if !defined(CV_INLINE_ISINF_FLT) && __has_builtin(__builtin_isinf)
|
||||
#define CV_INLINE_ISINF_FLT(value) return __builtin_isinf(value);
|
||||
#endif
|
||||
#elif defined(__GNUC__)
|
||||
#define CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS
|
||||
#if !defined(CV_INLINE_ISNAN_DBL)
|
||||
#define CV_INLINE_ISNAN_DBL(value) return __builtin_isnan(value);
|
||||
#endif
|
||||
#if !defined(CV_INLINE_ISNAN_FLT)
|
||||
#define CV_INLINE_ISNAN_FLT(value) return __builtin_isnanf(value);
|
||||
#endif
|
||||
#if !defined(CV_INLINE_ISINF_DBL)
|
||||
#define CV_INLINE_ISINF_DBL(value) return __builtin_isinf(value);
|
||||
#endif
|
||||
#if !defined(CV_INLINE_ISINF_FLT)
|
||||
#define CV_INLINE_ISINF_FLT(value) return __builtin_isinff(value);
|
||||
#endif
|
||||
#elif defined(_MSC_VER)
|
||||
#if !defined(CV_INLINE_ISNAN_DBL)
|
||||
#define CV_INLINE_ISNAN_DBL(value) return isnan(value);
|
||||
#endif
|
||||
#if !defined(CV_INLINE_ISNAN_FLT)
|
||||
#define CV_INLINE_ISNAN_FLT(value) return isnan(value);
|
||||
#endif
|
||||
#if !defined(CV_INLINE_ISINF_DBL)
|
||||
#define CV_INLINE_ISINF_DBL(value) return isinf(value);
|
||||
#endif
|
||||
#if !defined(CV_INLINE_ISINF_FLT)
|
||||
#define CV_INLINE_ISINF_FLT(value) return isinf(value);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // defined(__CUDACC__)
|
||||
|
||||
/** @brief Rounds floating-point number to the nearest integer
|
||||
|
||||
@@ -96,8 +196,11 @@
|
||||
CV_INLINE int
|
||||
cvRound( double value )
|
||||
{
|
||||
#if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \
|
||||
&& defined __SSE2__ && !defined __APPLE__) || CV_SSE2) && !defined(__CUDACC__)
|
||||
#if defined CV_INLINE_ROUND_DBL
|
||||
CV_INLINE_ROUND_DBL(value);
|
||||
#elif ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \
|
||||
&& defined __SSE2__ && !defined __APPLE__) || CV_SSE2) \
|
||||
&& !defined(__CUDACC__)
|
||||
__m128d t = _mm_set_sd( value );
|
||||
return _mm_cvtsd_si32(t);
|
||||
#elif defined _MSC_VER && defined _M_IX86
|
||||
@@ -109,11 +212,7 @@ cvRound( double value )
|
||||
}
|
||||
return t;
|
||||
#elif defined CV_ICC || defined __GNUC__
|
||||
# if defined ARM_ROUND_DBL
|
||||
ARM_ROUND_DBL(value);
|
||||
# else
|
||||
return (int)lrint(value);
|
||||
# endif
|
||||
return (int)(lrint(value));
|
||||
#else
|
||||
/* it's ok if round does not comply with IEEE754 standard;
|
||||
the tests should allow +/-1 difference when the tested functions use round */
|
||||
@@ -131,8 +230,15 @@ cvRound( double value )
|
||||
*/
|
||||
CV_INLINE int cvFloor( double value )
|
||||
{
|
||||
#if (defined CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS || defined CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS) \
|
||||
&& ( \
|
||||
defined(__PPC64__) \
|
||||
)
|
||||
return __builtin_floor(value);
|
||||
#else
|
||||
int i = (int)value;
|
||||
return i - (i > value);
|
||||
#endif
|
||||
}
|
||||
|
||||
/** @brief Rounds floating-point number to the nearest integer not smaller than the original.
|
||||
@@ -144,8 +250,15 @@ CV_INLINE int cvFloor( double value )
|
||||
*/
|
||||
CV_INLINE int cvCeil( double value )
|
||||
{
|
||||
#if (defined CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS || defined CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS) \
|
||||
&& ( \
|
||||
defined(__PPC64__) \
|
||||
)
|
||||
return __builtin_ceil(value);
|
||||
#else
|
||||
int i = (int)value;
|
||||
return i + (i < value);
|
||||
#endif
|
||||
}
|
||||
|
||||
/** @brief Determines if the argument is Not A Number.
|
||||
@@ -156,10 +269,14 @@ CV_INLINE int cvCeil( double value )
|
||||
otherwise. */
|
||||
CV_INLINE int cvIsNaN( double value )
|
||||
{
|
||||
#if defined CV_INLINE_ISNAN_DBL
|
||||
CV_INLINE_ISNAN_DBL(value);
|
||||
#else
|
||||
Cv64suf ieee754;
|
||||
ieee754.f = value;
|
||||
return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) +
|
||||
((unsigned)ieee754.u != 0) > 0x7ff00000;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** @brief Determines if the argument is Infinity.
|
||||
@@ -170,10 +287,19 @@ CV_INLINE int cvIsNaN( double value )
|
||||
and 0 otherwise. */
|
||||
CV_INLINE int cvIsInf( double value )
|
||||
{
|
||||
#if defined CV_INLINE_ISINF_DBL
|
||||
CV_INLINE_ISINF_DBL(value);
|
||||
#elif defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(__PPC64__)
|
||||
Cv64suf ieee754;
|
||||
ieee754.f = value;
|
||||
return (ieee754.u & 0x7fffffff00000000) ==
|
||||
0x7ff0000000000000;
|
||||
#else
|
||||
Cv64suf ieee754;
|
||||
ieee754.f = value;
|
||||
return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) == 0x7ff00000 &&
|
||||
(unsigned)ieee754.u == 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -181,8 +307,11 @@ CV_INLINE int cvIsInf( double value )
|
||||
/** @overload */
|
||||
CV_INLINE int cvRound(float value)
|
||||
{
|
||||
#if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \
|
||||
&& defined __SSE2__ && !defined __APPLE__) || CV_SSE2) && !defined(__CUDACC__)
|
||||
#if defined CV_INLINE_ROUND_FLT
|
||||
CV_INLINE_ROUND_FLT(value);
|
||||
#elif ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \
|
||||
&& defined __SSE2__ && !defined __APPLE__) || CV_SSE2) \
|
||||
&& !defined(__CUDACC__)
|
||||
__m128 t = _mm_set_ss( value );
|
||||
return _mm_cvtss_si32(t);
|
||||
#elif defined _MSC_VER && defined _M_IX86
|
||||
@@ -194,11 +323,7 @@ CV_INLINE int cvRound(float value)
|
||||
}
|
||||
return t;
|
||||
#elif defined CV_ICC || defined __GNUC__
|
||||
# if defined ARM_ROUND_FLT
|
||||
ARM_ROUND_FLT(value);
|
||||
# else
|
||||
return (int)lrintf(value);
|
||||
# endif
|
||||
return (int)(lrintf(value));
|
||||
#else
|
||||
/* it's ok if round does not comply with IEEE754 standard;
|
||||
the tests should allow +/-1 difference when the tested functions use round */
|
||||
@@ -215,8 +340,15 @@ CV_INLINE int cvRound( int value )
|
||||
/** @overload */
|
||||
CV_INLINE int cvFloor( float value )
|
||||
{
|
||||
#if (defined CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS || defined CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS) \
|
||||
&& ( \
|
||||
defined(__PPC64__) \
|
||||
)
|
||||
return __builtin_floorf(value);
|
||||
#else
|
||||
int i = (int)value;
|
||||
return i - (i > value);
|
||||
#endif
|
||||
}
|
||||
|
||||
/** @overload */
|
||||
@@ -228,8 +360,15 @@ CV_INLINE int cvFloor( int value )
|
||||
/** @overload */
|
||||
CV_INLINE int cvCeil( float value )
|
||||
{
|
||||
#if (defined CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS || defined CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS) \
|
||||
&& ( \
|
||||
defined(__PPC64__) \
|
||||
)
|
||||
return __builtin_ceilf(value);
|
||||
#else
|
||||
int i = (int)value;
|
||||
return i + (i < value);
|
||||
#endif
|
||||
}
|
||||
|
||||
/** @overload */
|
||||
@@ -241,17 +380,25 @@ CV_INLINE int cvCeil( int value )
|
||||
/** @overload */
|
||||
CV_INLINE int cvIsNaN( float value )
|
||||
{
|
||||
#if defined CV_INLINE_ISNAN_FLT
|
||||
CV_INLINE_ISNAN_FLT(value);
|
||||
#else
|
||||
Cv32suf ieee754;
|
||||
ieee754.f = value;
|
||||
return (ieee754.u & 0x7fffffff) > 0x7f800000;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** @overload */
|
||||
CV_INLINE int cvIsInf( float value )
|
||||
{
|
||||
#if defined CV_INLINE_ISINF_FLT
|
||||
CV_INLINE_ISINF_FLT(value);
|
||||
#else
|
||||
Cv32suf ieee754;
|
||||
ieee754.f = value;
|
||||
return (ieee754.u & 0x7fffffff) == 0x7f800000;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
@@ -1231,19 +1231,16 @@ inline int v_signmask(const v_int16x16& a)
|
||||
inline int v_signmask(const v_uint16x16& a)
|
||||
{ return v_signmask(v_reinterpret_as_s16(a)); }
|
||||
|
||||
inline int v_signmask(const v_int32x8& a)
|
||||
{
|
||||
v_int16x16 a16 = v_pack(a, a);
|
||||
return v_signmask(v_pack(a16, a16)) & 0xFF;
|
||||
}
|
||||
inline int v_signmask(const v_uint32x8& a)
|
||||
{ return v_signmask(v_reinterpret_as_s32(a)); }
|
||||
|
||||
inline int v_signmask(const v_float32x8& a)
|
||||
{ return _mm256_movemask_ps(a.val); }
|
||||
inline int v_signmask(const v_float64x4& a)
|
||||
{ return _mm256_movemask_pd(a.val); }
|
||||
|
||||
inline int v_signmask(const v_int32x8& a)
|
||||
{ return v_signmask(v_reinterpret_as_f32(a)); }
|
||||
inline int v_signmask(const v_uint32x8& a)
|
||||
{ return v_signmask(v_reinterpret_as_f32(a)); }
|
||||
|
||||
inline int v_scan_forward(const v_int8x32& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); }
|
||||
inline int v_scan_forward(const v_uint8x32& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); }
|
||||
inline int v_scan_forward(const v_int16x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; }
|
||||
@@ -1270,10 +1267,10 @@ inline int v_scan_forward(const v_float64x4& a) { return trailingZeros32(v_signm
|
||||
|
||||
OPENCV_HAL_IMPL_AVX_CHECK(v_uint8x32, OPENCV_HAL_1ST, -1)
|
||||
OPENCV_HAL_IMPL_AVX_CHECK(v_int8x32, OPENCV_HAL_1ST, -1)
|
||||
OPENCV_HAL_IMPL_AVX_CHECK(v_uint16x16, OPENCV_HAL_AND, (int)0xaaaa)
|
||||
OPENCV_HAL_IMPL_AVX_CHECK(v_int16x16, OPENCV_HAL_AND, (int)0xaaaa)
|
||||
OPENCV_HAL_IMPL_AVX_CHECK(v_uint32x8, OPENCV_HAL_AND, (int)0x8888)
|
||||
OPENCV_HAL_IMPL_AVX_CHECK(v_int32x8, OPENCV_HAL_AND, (int)0x8888)
|
||||
OPENCV_HAL_IMPL_AVX_CHECK(v_uint16x16, OPENCV_HAL_AND, (int)0xaaaaaaaa)
|
||||
OPENCV_HAL_IMPL_AVX_CHECK(v_int16x16, OPENCV_HAL_AND, (int)0xaaaaaaaa)
|
||||
OPENCV_HAL_IMPL_AVX_CHECK(v_uint32x8, OPENCV_HAL_AND, (int)0x88888888)
|
||||
OPENCV_HAL_IMPL_AVX_CHECK(v_int32x8, OPENCV_HAL_AND, (int)0x88888888)
|
||||
|
||||
#define OPENCV_HAL_IMPL_AVX_CHECK_FLT(_Tpvec, allmask) \
|
||||
inline bool v_check_all(const _Tpvec& a) \
|
||||
|
||||
@@ -76,7 +76,7 @@ implemented as a structure based on a one SIMD register.
|
||||
- cv::v_uint32x4 and cv::v_int32x4: four 32-bit integer values (unsgined/signed) - int
|
||||
- cv::v_uint64x2 and cv::v_int64x2: two 64-bit integer values (unsigned/signed) - int64
|
||||
- cv::v_float32x4: four 32-bit floating point values (signed) - float
|
||||
- cv::v_float64x2: two 64-bit floating point valies (signed) - double
|
||||
- cv::v_float64x2: two 64-bit floating point values (signed) - double
|
||||
|
||||
@note
|
||||
cv::v_float64x2 is not implemented in NEON variant, if you want to use this type, don't forget to
|
||||
|
||||
@@ -764,10 +764,10 @@ inline scalartype v_reduce_##suffix(const _Tpvec& a)
|
||||
rs = func(rs, vec_sld(rs, rs, 2)); \
|
||||
return vec_extract(func(rs, vec_sld(rs, rs, 1)), 0); \
|
||||
}
|
||||
OPENCV_HAL_IMPL_VSX_REDUCE_OP_8(v_uint8x16, vec_uchar16, uchar, max, vec_max)
|
||||
OPENCV_HAL_IMPL_VSX_REDUCE_OP_8(v_uint8x16, vec_uchar16, uchar, min, vec_min)
|
||||
OPENCV_HAL_IMPL_VSX_REDUCE_OP_8(v_int8x16, vec_char16, schar, max, vec_max)
|
||||
OPENCV_HAL_IMPL_VSX_REDUCE_OP_8(v_int8x16, vec_char16, schar, min, vec_min)
|
||||
OPENCV_HAL_IMPL_VSX_REDUCE_OP_16(v_uint8x16, vec_uchar16, uchar, max, vec_max)
|
||||
OPENCV_HAL_IMPL_VSX_REDUCE_OP_16(v_uint8x16, vec_uchar16, uchar, min, vec_min)
|
||||
OPENCV_HAL_IMPL_VSX_REDUCE_OP_16(v_int8x16, vec_char16, schar, max, vec_max)
|
||||
OPENCV_HAL_IMPL_VSX_REDUCE_OP_16(v_int8x16, vec_char16, schar, min, vec_min)
|
||||
|
||||
inline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b,
|
||||
const v_float32x4& c, const v_float32x4& d)
|
||||
@@ -845,36 +845,24 @@ inline v_uint64x2 v_popcount(const v_int64x2& a)
|
||||
/** Mask **/
|
||||
inline int v_signmask(const v_uint8x16& a)
|
||||
{
|
||||
vec_uchar16 sv = vec_sr(a.val, vec_uchar16_sp(7));
|
||||
static const vec_uchar16 slm = {0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7};
|
||||
sv = vec_sl(sv, slm);
|
||||
vec_uint4 sv4 = vec_sum4s(sv, vec_uint4_z);
|
||||
static const vec_uint4 slm4 = {0, 0, 8, 8};
|
||||
sv4 = vec_sl(sv4, slm4);
|
||||
return vec_extract(vec_sums((vec_int4) sv4, vec_int4_z), 3);
|
||||
static const vec_uchar16 qperm = {120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0};
|
||||
return vec_extract((vec_int4)vec_vbpermq(v_reinterpret_as_u8(a).val, qperm), 2);
|
||||
}
|
||||
inline int v_signmask(const v_int8x16& a)
|
||||
{ return v_signmask(v_reinterpret_as_u8(a)); }
|
||||
|
||||
inline int v_signmask(const v_int16x8& a)
|
||||
{
|
||||
static const vec_ushort8 slm = {0, 1, 2, 3, 4, 5, 6, 7};
|
||||
vec_short8 sv = vec_sr(a.val, vec_ushort8_sp(15));
|
||||
sv = vec_sl(sv, slm);
|
||||
vec_int4 svi = vec_int4_z;
|
||||
svi = vec_sums(vec_sum4s(sv, svi), svi);
|
||||
return vec_extract(svi, 3);
|
||||
static const vec_uchar16 qperm = {112, 96, 80, 64, 48, 32, 16, 0, 128, 128, 128, 128, 128, 128, 128, 128};
|
||||
return vec_extract((vec_int4)vec_vbpermq(v_reinterpret_as_u8(a).val, qperm), 2);
|
||||
}
|
||||
inline int v_signmask(const v_uint16x8& a)
|
||||
{ return v_signmask(v_reinterpret_as_s16(a)); }
|
||||
|
||||
inline int v_signmask(const v_int32x4& a)
|
||||
{
|
||||
static const vec_uint4 slm = {0, 1, 2, 3};
|
||||
vec_int4 sv = vec_sr(a.val, vec_uint4_sp(31));
|
||||
sv = vec_sl(sv, slm);
|
||||
sv = vec_sums(sv, vec_int4_z);
|
||||
return vec_extract(sv, 3);
|
||||
static const vec_uchar16 qperm = {96, 64, 32, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128};
|
||||
return vec_extract((vec_int4)vec_vbpermq(v_reinterpret_as_u8(a).val, qperm), 2);
|
||||
}
|
||||
inline int v_signmask(const v_uint32x4& a)
|
||||
{ return v_signmask(v_reinterpret_as_s32(a)); }
|
||||
@@ -1051,6 +1039,15 @@ inline v_float64x2 v_cvt_f64(const v_float32x4& a)
|
||||
inline v_float64x2 v_cvt_f64_high(const v_float32x4& a)
|
||||
{ return v_float64x2(vec_cvfo(vec_mergel(a.val, a.val))); }
|
||||
|
||||
// The altivec intrinsic is missing for this 2.06 insn
|
||||
inline v_float64x2 v_cvt_f64(const v_int64x2& a)
|
||||
{
|
||||
vec_double2 out;
|
||||
|
||||
__asm__ ("xvcvsxddp %x0,%x1" : "=wa"(out) : "wa"(a.val));
|
||||
return v_float64x2(out);
|
||||
}
|
||||
|
||||
////////////// Lookup table access ////////////////////
|
||||
|
||||
inline v_int8x16 v_lut(const schar* tab, const int* idx)
|
||||
@@ -1284,7 +1281,7 @@ inline v_float32x4 v_load_expand(const float16_t* ptr)
|
||||
|
||||
inline void v_pack_store(float16_t* ptr, const v_float32x4& v)
|
||||
{
|
||||
// fixme: Is there any buitin op or intrinsic that cover "xvcvsphp"?
|
||||
// fixme: Is there any builtin op or intrinsic that cover "xvcvsphp"?
|
||||
#if CV_VSX3 && !defined(CV_COMPILER_VSX_BROKEN_ASM)
|
||||
vec_ushort8 vf16;
|
||||
__asm__ __volatile__ ("xvcvsphp %x0,%x1" : "=wa" (vf16) : "wf" (v.val));
|
||||
|
||||
@@ -29,7 +29,7 @@ Using this approach OpenCV provides some basic low level functionality for exter
|
||||
|
||||
typedef enum cvResult
|
||||
{
|
||||
CV_ERROR_FAIL = -1, //!< Some error occured (TODO Require to fill exception information)
|
||||
CV_ERROR_FAIL = -1, //!< Some error occurred (TODO Require to fill exception information)
|
||||
CV_ERROR_OK = 0 //!< No error
|
||||
} CvResult;
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ number of components (vectors/matrices) of the outer vector.
|
||||
|
||||
In general, type support is limited to cv::Mat types. Other types are forbidden.
|
||||
But in some cases we need to support passing of custom non-general Mat types, like arrays of cv::KeyPoint, cv::DMatch, etc.
|
||||
This data is not intented to be interpreted as an image data, or processed somehow like regular cv::Mat.
|
||||
This data is not intended to be interpreted as an image data, or processed somehow like regular cv::Mat.
|
||||
To pass such custom type use rawIn() / rawOut() / rawInOut() wrappers.
|
||||
Custom type is wrapped as Mat-compatible `CV_8UC<N>` values (N = sizeof(T), N <= CV_CN_MAX).
|
||||
*/
|
||||
@@ -2380,7 +2380,7 @@ public:
|
||||
// (_type is CV_8UC1, CV_64FC3, CV_32SC(12) etc.)
|
||||
UMat(int rows, int cols, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
|
||||
UMat(Size size, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);
|
||||
//! constucts 2D matrix and fills it with the specified value _s.
|
||||
//! constructs 2D matrix and fills it with the specified value _s.
|
||||
UMat(int rows, int cols, int type, const Scalar& s, UMatUsageFlags usageFlags = USAGE_DEFAULT);
|
||||
UMat(Size size, int type, const Scalar& s, UMatUsageFlags usageFlags = USAGE_DEFAULT);
|
||||
|
||||
@@ -2825,7 +2825,7 @@ public:
|
||||
|
||||
`ref<_Tp>(i0,...[,hashval])` is equivalent to `*(_Tp*)ptr(i0,...,true[,hashval])`.
|
||||
The methods always return a valid reference.
|
||||
If the element did not exist, it is created and initialiazed with 0.
|
||||
If the element did not exist, it is created and initialized with 0.
|
||||
*/
|
||||
//! returns reference to the specified element (1D case)
|
||||
template<typename _Tp> _Tp& ref(int i0, size_t* hashval=0);
|
||||
|
||||
@@ -1699,6 +1699,11 @@ Mat_<_Tp>::Mat_(const std::array<_Tp, _Nm>& arr, bool copyData)
|
||||
template<typename _Tp> inline
|
||||
Mat_<_Tp>& Mat_<_Tp>::operator = (const Mat& m)
|
||||
{
|
||||
if (m.empty())
|
||||
{
|
||||
release();
|
||||
return *this;
|
||||
}
|
||||
if( traits::Type<_Tp>::value == m.type() )
|
||||
{
|
||||
Mat::operator = (m);
|
||||
@@ -1764,7 +1769,7 @@ Mat_<_Tp> Mat_<_Tp>::cross(const Mat_& m) const
|
||||
template<typename _Tp> template<typename T2> inline
|
||||
Mat_<_Tp>::operator Mat_<T2>() const
|
||||
{
|
||||
return Mat_<T2>(*this);
|
||||
return Mat_<T2>(static_cast<const Mat&>(*this));
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
@@ -2054,7 +2059,7 @@ void Mat_<_Tp>::forEach(const Functor& operation) const {
|
||||
|
||||
template<typename _Tp> inline
|
||||
Mat_<_Tp>::Mat_(Mat_&& m)
|
||||
: Mat(m)
|
||||
: Mat(std::move(m))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2070,12 +2075,17 @@ Mat_<_Tp>::Mat_(Mat&& m)
|
||||
: Mat()
|
||||
{
|
||||
flags = (flags & ~CV_MAT_TYPE_MASK) + traits::Type<_Tp>::value;
|
||||
*this = m;
|
||||
*this = std::move(m);
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Mat_<_Tp>& Mat_<_Tp>::operator = (Mat&& m)
|
||||
{
|
||||
if (m.empty())
|
||||
{
|
||||
release();
|
||||
return *this;
|
||||
}
|
||||
if( traits::Type<_Tp>::value == m.type() )
|
||||
{
|
||||
Mat::operator = ((Mat&&)m);
|
||||
|
||||
@@ -27,7 +27,7 @@ These files can be pre-generated for target configurations of your application
|
||||
or generated by CMake on the fly (use CMAKE_BINARY_DIR for that).
|
||||
|
||||
Notes:
|
||||
- H/W capability checks are still responsibility of your applcation
|
||||
- H/W capability checks are still responsibility of your application
|
||||
- runtime dispatching is not covered by this helper header
|
||||
*/
|
||||
|
||||
|
||||
@@ -507,8 +507,8 @@ Special cases:
|
||||
*/
|
||||
CV_EXPORTS softdouble cos( const softdouble& a );
|
||||
|
||||
}
|
||||
//! @} core_utils_softfloat
|
||||
|
||||
//! @}
|
||||
} // cv::
|
||||
|
||||
#endif
|
||||
|
||||
@@ -49,8 +49,8 @@ public:
|
||||
void lock(); //< acquire exclusive (writer) lock
|
||||
void unlock(); //< release exclusive (writer) lock
|
||||
|
||||
void lock_shared(); //< acquire sharable (reader) lock
|
||||
void unlock_shared(); //< release sharable (reader) lock
|
||||
void lock_shared(); //< acquire shareable (reader) lock
|
||||
void unlock_shared(); //< release shareable (reader) lock
|
||||
|
||||
struct Impl;
|
||||
protected:
|
||||
|
||||
@@ -12,15 +12,13 @@
|
||||
#include "logger.defines.hpp"
|
||||
#include "logtag.hpp"
|
||||
|
||||
//! @addtogroup core_logging
|
||||
// This section describes OpenCV logging utilities.
|
||||
//
|
||||
//! @{
|
||||
|
||||
namespace cv {
|
||||
namespace utils {
|
||||
namespace logging {
|
||||
|
||||
//! @addtogroup core_logging
|
||||
//! @{
|
||||
|
||||
/** Set global logging level
|
||||
@return previous logging level
|
||||
*/
|
||||
@@ -148,8 +146,8 @@ struct LogTagAuto
|
||||
# define CV_LOG_VERBOSE(tag, v, ...)
|
||||
#endif
|
||||
|
||||
}}} // namespace
|
||||
|
||||
//! @}
|
||||
|
||||
}}} // namespace
|
||||
|
||||
#endif // OPENCV_LOGGER_HPP
|
||||
|
||||
@@ -7,15 +7,13 @@
|
||||
|
||||
#include <opencv2/core/cvdef.h>
|
||||
|
||||
//! @addtogroup core_logging
|
||||
// This section describes OpenCV tracing utilities.
|
||||
//
|
||||
//! @{
|
||||
|
||||
namespace cv {
|
||||
namespace utils {
|
||||
namespace trace {
|
||||
|
||||
//! @addtogroup core_logging
|
||||
//! @{
|
||||
|
||||
//! Macro to trace function
|
||||
#define CV_TRACE_FUNCTION()
|
||||
|
||||
@@ -247,8 +245,8 @@ CV_EXPORTS void traceArg(const TraceArg& arg, double value);
|
||||
|
||||
//! @endcond
|
||||
|
||||
}}} // namespace
|
||||
|
||||
//! @}
|
||||
|
||||
}}} // namespace
|
||||
|
||||
#endif // OPENCV_TRACE_HPP
|
||||
|
||||