mirror of
https://github.com/opencv/opencv.git
synced 2025-06-26 22:31:22 +08:00
Merge remote-tracking branch 'refs/remotes/Itseez/master'
This commit is contained in:
commit
393cd6242e
6
3rdparty/tbb/CMakeLists.txt
vendored
6
3rdparty/tbb/CMakeLists.txt
vendored
@ -5,9 +5,9 @@ if (WIN32 AND NOT ARM)
|
|||||||
message(FATAL_ERROR "BUILD_TBB option supports Windows on ARM only!\nUse regular official TBB build instead of the BUILD_TBB option!")
|
message(FATAL_ERROR "BUILD_TBB option supports Windows on ARM only!\nUse regular official TBB build instead of the BUILD_TBB option!")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(tbb_ver "tbb43_20141204oss")
|
set(tbb_ver "tbb44_20160128oss")
|
||||||
set(tbb_url "http://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb43_20141204oss_src.tgz")
|
set(tbb_url "http://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb44_20160128oss_src_0.tgz")
|
||||||
set(tbb_md5 "e903dd92d9433701f097fa7ca29a3c1f")
|
set(tbb_md5 "9d8a4cdf43496f1b3f7c473a5248e5cc")
|
||||||
set(tbb_version_file "version_string.ver")
|
set(tbb_version_file "version_string.ver")
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
|
||||||
|
133
CMakeLists.txt
133
CMakeLists.txt
@ -81,13 +81,14 @@ if(POLICY CMP0026)
|
|||||||
cmake_policy(SET CMP0026 OLD)
|
cmake_policy(SET CMP0026 OLD)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (POLICY CMP0042)
|
if(POLICY CMP0042)
|
||||||
# silence cmake 3.0+ warnings about MACOSX_RPATH
|
cmake_policy(SET CMP0042 NEW)
|
||||||
cmake_policy(SET CMP0042 OLD)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include(cmake/OpenCVUtils.cmake)
|
||||||
|
|
||||||
# must go before the project command
|
# must go before the project command
|
||||||
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
|
ocv_update(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
|
||||||
if(DEFINED CMAKE_BUILD_TYPE)
|
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()
|
endif()
|
||||||
@ -100,8 +101,6 @@ if(MSVC)
|
|||||||
set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE)
|
set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(cmake/OpenCVUtils.cmake)
|
|
||||||
|
|
||||||
ocv_cmake_eval(DEBUG_PRE ONCE)
|
ocv_cmake_eval(DEBUG_PRE ONCE)
|
||||||
|
|
||||||
ocv_clear_vars(OpenCVModules_TARGETS)
|
ocv_clear_vars(OpenCVModules_TARGETS)
|
||||||
@ -304,50 +303,50 @@ include(cmake/OpenCVVersion.cmake)
|
|||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
# Save libs and executables in the same place
|
# Save libs and executables in the same place
|
||||||
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin" CACHE PATH "Output directory for applications" )
|
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin" CACHE PATH "Output directory for applications")
|
||||||
|
|
||||||
if (ANDROID)
|
if(ANDROID)
|
||||||
if (ANDROID_ABI MATCHES "NEON")
|
if(ANDROID_ABI MATCHES "NEON")
|
||||||
set(ENABLE_NEON ON)
|
set(ENABLE_NEON ON)
|
||||||
endif()
|
endif()
|
||||||
if (ANDROID_ABI MATCHES "VFPV3")
|
if(ANDROID_ABI MATCHES "VFPV3")
|
||||||
set(ENABLE_VFPV3 ON)
|
set(ENABLE_VFPV3 ON)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID OR WIN32)
|
if(ANDROID OR WIN32)
|
||||||
set(OPENCV_DOC_INSTALL_PATH doc)
|
ocv_update(OPENCV_DOC_INSTALL_PATH doc)
|
||||||
else()
|
else()
|
||||||
set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
|
ocv_update(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||||
if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH)
|
if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH)
|
||||||
set(OpenCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/")
|
ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/")
|
||||||
else()
|
else()
|
||||||
message(STATUS "Can't detect runtime and/or arch")
|
message(STATUS "Can't detect runtime and/or arch")
|
||||||
set(OpenCV_INSTALL_BINARIES_PREFIX "")
|
ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "")
|
||||||
endif()
|
endif()
|
||||||
elseif(ANDROID)
|
elseif(ANDROID)
|
||||||
set(OpenCV_INSTALL_BINARIES_PREFIX "sdk/native/")
|
ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "sdk/native/")
|
||||||
else()
|
else()
|
||||||
set(OpenCV_INSTALL_BINARIES_PREFIX "")
|
ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples/${ANDROID_NDK_ABI_NAME}")
|
ocv_update(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples/${ANDROID_NDK_ABI_NAME}")
|
||||||
else()
|
else()
|
||||||
set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")
|
ocv_update(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin/${ANDROID_NDK_ABI_NAME}")
|
ocv_update(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin/${ANDROID_NDK_ABI_NAME}")
|
||||||
else()
|
else()
|
||||||
set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
|
ocv_update(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT OPENCV_TEST_INSTALL_PATH)
|
if(NOT OPENCV_TEST_INSTALL_PATH)
|
||||||
set(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
|
ocv_update(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (OPENCV_TEST_DATA_PATH)
|
if (OPENCV_TEST_DATA_PATH)
|
||||||
@ -356,66 +355,74 @@ endif()
|
|||||||
|
|
||||||
if(OPENCV_TEST_DATA_PATH AND NOT OPENCV_TEST_DATA_INSTALL_PATH)
|
if(OPENCV_TEST_DATA_PATH AND NOT OPENCV_TEST_DATA_INSTALL_PATH)
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
set(OPENCV_TEST_DATA_INSTALL_PATH "sdk/etc/testdata")
|
ocv_update(OPENCV_TEST_DATA_INSTALL_PATH "sdk/etc/testdata")
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
set(OPENCV_TEST_DATA_INSTALL_PATH "testdata")
|
ocv_update(OPENCV_TEST_DATA_INSTALL_PATH "testdata")
|
||||||
else()
|
else()
|
||||||
set(OPENCV_TEST_DATA_INSTALL_PATH "share/OpenCV/testdata")
|
ocv_update(OPENCV_TEST_DATA_INSTALL_PATH "share/OpenCV/testdata")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
|
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
|
||||||
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib/${ANDROID_NDK_ABI_NAME}")
|
ocv_update(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib/${ANDROID_NDK_ABI_NAME}")
|
||||||
set(OPENCV_LIB_INSTALL_PATH sdk/native/libs/${ANDROID_NDK_ABI_NAME})
|
ocv_update(OPENCV_LIB_INSTALL_PATH sdk/native/libs/${ANDROID_NDK_ABI_NAME})
|
||||||
set(OPENCV_3P_LIB_INSTALL_PATH sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME})
|
ocv_update(OPENCV_3P_LIB_INSTALL_PATH sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME})
|
||||||
set(OPENCV_CONFIG_INSTALL_PATH sdk/native/jni)
|
ocv_update(OPENCV_CONFIG_INSTALL_PATH sdk/native/jni)
|
||||||
set(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
|
ocv_update(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
|
||||||
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
||||||
set(OPENCV_OTHER_INSTALL_PATH sdk/etc)
|
ocv_update(OPENCV_OTHER_INSTALL_PATH sdk/etc)
|
||||||
else()
|
else()
|
||||||
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
|
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
|
||||||
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
|
ocv_update(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
|
||||||
|
|
||||||
if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||||
if(OpenCV_STATIC)
|
if(OpenCV_STATIC)
|
||||||
set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
ocv_update(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
||||||
else()
|
else()
|
||||||
set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}")
|
ocv_update(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}")
|
||||||
endif()
|
endif()
|
||||||
set(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
ocv_update(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
|
||||||
set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
|
||||||
set(OPENCV_JAR_INSTALL_PATH java)
|
ocv_update(OPENCV_JAR_INSTALL_PATH java)
|
||||||
set(OPENCV_OTHER_INSTALL_PATH etc)
|
ocv_update(OPENCV_OTHER_INSTALL_PATH etc)
|
||||||
|
ocv_update(OPENCV_CONFIG_INSTALL_PATH ".")
|
||||||
else()
|
else()
|
||||||
set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
|
ocv_update(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
|
||||||
set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
|
ocv_update(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
|
||||||
set(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples)
|
ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples)
|
||||||
set(OPENCV_JAR_INSTALL_PATH share/OpenCV/java)
|
ocv_update(OPENCV_JAR_INSTALL_PATH share/OpenCV/java)
|
||||||
set(OPENCV_OTHER_INSTALL_PATH share/OpenCV)
|
ocv_update(OPENCV_OTHER_INSTALL_PATH share/OpenCV)
|
||||||
endif()
|
|
||||||
set(OPENCV_INCLUDE_INSTALL_PATH "include")
|
|
||||||
|
|
||||||
math(EXPR SIZEOF_VOID_P_BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
if(NOT DEFINED OPENCV_CONFIG_INSTALL_PATH)
|
||||||
if(LIB_SUFFIX AND NOT SIZEOF_VOID_P_BITS EQUAL LIB_SUFFIX)
|
math(EXPR SIZEOF_VOID_P_BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||||
set(OPENCV_CONFIG_INSTALL_PATH lib${LIB_SUFFIX}/cmake/opencv)
|
if(LIB_SUFFIX AND NOT SIZEOF_VOID_P_BITS EQUAL LIB_SUFFIX)
|
||||||
else()
|
ocv_update(OPENCV_CONFIG_INSTALL_PATH lib${LIB_SUFFIX}/cmake/opencv)
|
||||||
set(OPENCV_CONFIG_INSTALL_PATH share/OpenCV)
|
else()
|
||||||
|
ocv_update(OPENCV_CONFIG_INSTALL_PATH share/OpenCV)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
ocv_update(OPENCV_INCLUDE_INSTALL_PATH "include")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}")
|
ocv_update(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}")
|
||||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
|
|
||||||
if(INSTALL_TO_MANGLED_PATHS)
|
if(INSTALL_TO_MANGLED_PATHS)
|
||||||
set(OPENCV_INCLUDE_INSTALL_PATH ${OPENCV_INCLUDE_INSTALL_PATH}/opencv-${OPENCV_VERSION})
|
set(OPENCV_INCLUDE_INSTALL_PATH ${OPENCV_INCLUDE_INSTALL_PATH}/opencv-${OPENCV_VERSION})
|
||||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_3P_LIB_INSTALL_PATH "${OPENCV_3P_LIB_INSTALL_PATH}")
|
foreach(v
|
||||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_SAMPLES_SRC_INSTALL_PATH "${OPENCV_SAMPLES_SRC_INSTALL_PATH}")
|
OPENCV_3P_LIB_INSTALL_PATH
|
||||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_CONFIG_INSTALL_PATH "${OPENCV_CONFIG_INSTALL_PATH}")
|
OPENCV_SAMPLES_SRC_INSTALL_PATH
|
||||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_DOC_INSTALL_PATH "${OPENCV_DOC_INSTALL_PATH}")
|
OPENCV_CONFIG_INSTALL_PATH
|
||||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_JAR_INSTALL_PATH "${OPENCV_JAR_INSTALL_PATH}")
|
OPENCV_DOC_INSTALL_PATH
|
||||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_TEST_DATA_INSTALL_PATH "${OPENCV_TEST_DATA_INSTALL_PATH}")
|
OPENCV_JAR_INSTALL_PATH
|
||||||
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_OTHER_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}")
|
OPENCV_TEST_DATA_INSTALL_PATH
|
||||||
|
OPENCV_OTHER_INSTALL_PATH
|
||||||
|
)
|
||||||
|
string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" ${v} "${${v}}")
|
||||||
|
string(REPLACE "opencv" "opencv-${OPENCV_VERSION}" ${v} "${${v}}")
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
@ -440,7 +447,7 @@ endif()
|
|||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Path for build/platform -specific headers
|
# Path for build/platform -specific headers
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
set(OPENCV_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/" CACHE PATH "Where to create the platform-dependant cvconfig.h")
|
ocv_update(OPENCV_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/" CACHE PATH "Where to create the platform-dependant cvconfig.h")
|
||||||
ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
|
ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@ -453,7 +460,7 @@ set(OPENCV_EXTRA_MODULES_PATH "" CACHE PATH "Where to look for additional OpenCV
|
|||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
find_host_package(Git QUIET)
|
find_host_package(Git QUIET)
|
||||||
|
|
||||||
if(GIT_FOUND)
|
if(NOT DEFINED OPENCV_VCSVERSION AND GIT_FOUND)
|
||||||
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "[0-9].[0-9].[0-9]*"
|
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "[0-9].[0-9].[0-9]*"
|
||||||
WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
|
WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
|
||||||
OUTPUT_VARIABLE OPENCV_VCSVERSION
|
OUTPUT_VARIABLE OPENCV_VCSVERSION
|
||||||
@ -464,7 +471,7 @@ if(GIT_FOUND)
|
|||||||
if(NOT GIT_RESULT EQUAL 0)
|
if(NOT GIT_RESULT EQUAL 0)
|
||||||
set(OPENCV_VCSVERSION "unknown")
|
set(OPENCV_VCSVERSION "unknown")
|
||||||
endif()
|
endif()
|
||||||
else()
|
elseif(NOT DEFINED OPENCV_VCSVERSION)
|
||||||
# We don't have git:
|
# We don't have git:
|
||||||
set(OPENCV_VCSVERSION "unknown")
|
set(OPENCV_VCSVERSION "unknown")
|
||||||
endif()
|
endif()
|
||||||
|
@ -146,7 +146,7 @@ macro(ipp_detect_version)
|
|||||||
IMPORTED_LOCATION ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
IMPORTED_LOCATION ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||||
)
|
)
|
||||||
list(APPEND IPP_LIBRARIES ipp${name})
|
list(APPEND IPP_LIBRARIES ipp${name})
|
||||||
if (NOT BUILD_SHARED_LIBS OR NOT INSTALL_CREATE_DISTRIB)
|
if (NOT BUILD_SHARED_LIBS)
|
||||||
# CMake doesn't support "install(TARGETS ${IPP_PREFIX}${name} " command with imported targets
|
# CMake doesn't support "install(TARGETS ${IPP_PREFIX}${name} " command with imported targets
|
||||||
install(FILES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
install(FILES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||||
DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||||
|
@ -11,47 +11,20 @@ else()
|
|||||||
set(OpenCV_USE_MANGLED_PATHS_CONFIGCMAKE FALSE)
|
set(OpenCV_USE_MANGLED_PATHS_CONFIGCMAKE FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT OpenCV_CUDA_CC)
|
if(HAVE_CUDA)
|
||||||
set(OpenCV_CUDA_CC_CONFIGCMAKE "\"\"")
|
ocv_cmake_configure("${CMAKE_CURRENT_LIST_DIR}/templates/OpenCVConfig-CUDA.cmake.in" CUDA_CONFIGCMAKE @ONLY)
|
||||||
set(OpenCV_CUDA_VERSION "")
|
|
||||||
else()
|
|
||||||
set(OpenCV_CUDA_CC_CONFIGCMAKE "${OpenCV_CUDA_CC}")
|
|
||||||
set(OpenCV_CUDA_VERSION ${CUDA_VERSION_STRING})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT ANDROID_NATIVE_API_LEVEL)
|
if(ANDROID)
|
||||||
set(OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE 0)
|
if(NOT ANDROID_NATIVE_API_LEVEL)
|
||||||
else()
|
set(OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE 0)
|
||||||
set(OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE "${ANDROID_NATIVE_API_LEVEL}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_GENERATOR MATCHES "Visual" OR CMAKE_GENERATOR MATCHES "Xcode")
|
|
||||||
set(OpenCV_ADD_DEBUG_RELEASE_CONFIGCMAKE TRUE)
|
|
||||||
else()
|
|
||||||
set(OpenCV_ADD_DEBUG_RELEASE_CONFIGCMAKE FALSE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
if(MINGW)
|
|
||||||
set(OPENCV_LINK_LIBRARY_SUFFIX ".dll.a")
|
|
||||||
else()
|
else()
|
||||||
set(OPENCV_LINK_LIBRARY_SUFFIX ".lib")
|
set(OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE "${ANDROID_NATIVE_API_LEVEL}")
|
||||||
endif()
|
endif()
|
||||||
|
ocv_cmake_configure("${CMAKE_CURRENT_LIST_DIR}/templates/OpenCVConfig-ANDROID.cmake.in" ANDROID_CONFIGCMAKE @ONLY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#build list of modules available for the OpenCV user
|
set(OPENCV_MODULES_CONFIGCMAKE ${OPENCV_MODULES_PUBLIC})
|
||||||
set(OpenCV_LIB_COMPONENTS "")
|
|
||||||
foreach(m ${OPENCV_MODULES_PUBLIC})
|
|
||||||
list(INSERT OpenCV_LIB_COMPONENTS 0 ${${m}_MODULE_DEPS_OPT} ${m})
|
|
||||||
endforeach()
|
|
||||||
ocv_list_unique(OpenCV_LIB_COMPONENTS)
|
|
||||||
set(OPENCV_MODULES_CONFIGCMAKE ${OpenCV_LIB_COMPONENTS})
|
|
||||||
ocv_list_filterout(OpenCV_LIB_COMPONENTS "^opencv_")
|
|
||||||
if(OpenCV_LIB_COMPONENTS)
|
|
||||||
list(REMOVE_ITEM OPENCV_MODULES_CONFIGCMAKE ${OpenCV_LIB_COMPONENTS})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(BUILD_FAT_JAVA_LIB AND HAVE_opencv_java)
|
if(BUILD_FAT_JAVA_LIB AND HAVE_opencv_java)
|
||||||
list(APPEND OPENCV_MODULES_CONFIGCMAKE opencv_java)
|
list(APPEND OPENCV_MODULES_CONFIGCMAKE opencv_java)
|
||||||
@ -62,33 +35,20 @@ endif()
|
|||||||
# -------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------
|
||||||
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"${OPENCV_CONFIG_FILE_INCLUDE_DIR}\" \"${OpenCV_SOURCE_DIR}/include\" \"${OpenCV_SOURCE_DIR}/include/opencv\"")
|
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"${OPENCV_CONFIG_FILE_INCLUDE_DIR}\" \"${OpenCV_SOURCE_DIR}/include\" \"${OpenCV_SOURCE_DIR}/include/opencv\"")
|
||||||
|
|
||||||
set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "")
|
|
||||||
foreach(m ${OPENCV_MODULES_BUILD})
|
foreach(m ${OPENCV_MODULES_BUILD})
|
||||||
if(EXISTS "${OPENCV_MODULE_${m}_LOCATION}/include")
|
if(EXISTS "${OPENCV_MODULE_${m}_LOCATION}/include")
|
||||||
list(APPEND OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "${OPENCV_MODULE_${m}_LOCATION}/include")
|
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "${OpenCV_INCLUDE_DIRS_CONFIGCMAKE} \"${OPENCV_MODULE_${m}_LOCATION}/include\"")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(ANDROID AND NOT BUILD_SHARED_LIBS AND HAVE_TBB)
|
export(TARGETS ${OpenCVModules_TARGETS} FILE "${CMAKE_BINARY_DIR}/OpenCVModules.cmake")
|
||||||
#export TBB headers location because static linkage of TBB might be troublesome if application wants to use TBB itself
|
|
||||||
list(APPEND OpenCV2_INCLUDE_DIRS_CONFIGCMAKE ${TBB_INCLUDE_DIRS})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(modules_file_suffix "")
|
if(TARGET ippicv AND NOT BUILD_SHARED_LIBS)
|
||||||
if(ANDROID)
|
|
||||||
# the REPLACE here is needed, because OpenCVModules_armeabi.cmake includes
|
|
||||||
# OpenCVModules_armeabi-*.cmake, which would match OpenCVModules_armeabi-v7a*.cmake.
|
|
||||||
string(REPLACE - _ modules_file_suffix "_${ANDROID_NDK_ABI_NAME}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
export(TARGETS ${OpenCVModules_TARGETS} FILE "${CMAKE_BINARY_DIR}/OpenCVModules${modules_file_suffix}.cmake")
|
|
||||||
|
|
||||||
if(TARGET ippicv AND (NOT BUILD_SHARED_LIBS OR NOT INSTALL_CREATE_DISTRIB))
|
|
||||||
set(USE_IPPICV TRUE)
|
set(USE_IPPICV TRUE)
|
||||||
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV ${CMAKE_BINARY_DIR} ${IPPICV_LOCATION_PATH})
|
file(RELATIVE_PATH IPPICV_INSTALL_PATH_RELATIVE_CONFIGCMAKE ${CMAKE_BINARY_DIR} ${IPPICV_LOCATION_PATH})
|
||||||
|
ocv_cmake_configure("${CMAKE_CURRENT_LIST_DIR}/templates/OpenCVConfig-IPPICV.cmake.in" IPPICV_CONFIGCMAKE @ONLY)
|
||||||
else()
|
else()
|
||||||
set(USE_IPPICV FALSE)
|
set(USE_IPPICV FALSE)
|
||||||
set(INSTALL_PATH_RELATIVE_IPPICV "non-existed-path")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig.cmake" @ONLY)
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/OpenCVConfig.cmake" @ONLY)
|
||||||
@ -98,58 +58,60 @@ configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.
|
|||||||
# --------------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------------
|
||||||
# Part 2/3: ${BIN_DIR}/unix-install/OpenCVConfig.cmake -> For use *with* "make install"
|
# Part 2/3: ${BIN_DIR}/unix-install/OpenCVConfig.cmake -> For use *with* "make install"
|
||||||
# -------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------
|
||||||
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}/opencv" "\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}\"")
|
file(RELATIVE_PATH OpenCV_INSTALL_PATH_RELATIVE_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}/" ${CMAKE_INSTALL_PREFIX})
|
||||||
|
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}\" \"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}/opencv\"")
|
||||||
|
|
||||||
set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
|
if(USE_IPPICV)
|
||||||
set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_3P_LIB_INSTALL_PATH}\"")
|
file(RELATIVE_PATH IPPICV_INSTALL_PATH_RELATIVE_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}" ${IPPICV_INSTALL_PATH})
|
||||||
|
ocv_cmake_configure("${CMAKE_CURRENT_LIST_DIR}/templates/OpenCVConfig-IPPICV.cmake.in" IPPICV_CONFIGCMAKE @ONLY)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(UNIX) # ANDROID configuration is created here also
|
function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME)
|
||||||
#http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference
|
ocv_path_join(__install_nested "${OPENCV_CONFIG_INSTALL_PATH}" "${NESTED_PATH}")
|
||||||
# For a command "find_package(<name> [major[.minor]] [EXACT] [REQUIRED|QUIET])"
|
ocv_path_join(__tmp_nested "${TMP_DIR}" "${NESTED_PATH}")
|
||||||
# cmake will look in the following dir on unix:
|
|
||||||
# <prefix>/(share|lib)/cmake/<name>*/ (U)
|
file(RELATIVE_PATH OpenCV_INSTALL_PATH_RELATIVE_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/${__install_nested}" "${CMAKE_INSTALL_PREFIX}/")
|
||||||
# <prefix>/(share|lib)/<name>*/ (U)
|
|
||||||
# <prefix>/(share|lib)/<name>*/(cmake|CMake)/ (U)
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${TMP_DIR}/OpenCVConfig-version.cmake" @ONLY)
|
||||||
if(USE_IPPICV)
|
|
||||||
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}/" ${IPPICV_INSTALL_PATH})
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${__tmp_nested}/OpenCVConfig.cmake" @ONLY)
|
||||||
|
install(EXPORT OpenCVModules DESTINATION "${__install_nested}" FILE OpenCVModules.cmake COMPONENT dev)
|
||||||
|
install(FILES
|
||||||
|
"${TMP_DIR}/OpenCVConfig-version.cmake"
|
||||||
|
"${__tmp_nested}/OpenCVConfig.cmake"
|
||||||
|
DESTINATION "${__install_nested}" COMPONENT dev)
|
||||||
|
|
||||||
|
if(ROOT_NAME)
|
||||||
|
# Root config file
|
||||||
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/${ROOT_NAME}" "${TMP_DIR}/OpenCVConfig.cmake" @ONLY)
|
||||||
|
install(FILES
|
||||||
|
"${TMP_DIR}/OpenCVConfig-version.cmake"
|
||||||
|
"${TMP_DIR}/OpenCVConfig.cmake"
|
||||||
|
DESTINATION "${OPENCV_CONFIG_INSTALL_PATH}" COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" @ONLY)
|
endfunction()
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake" @ONLY)
|
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
|
if(UNIX AND NOT ANDROID)
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig-version.cmake DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
|
ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "")
|
||||||
install(EXPORT OpenCVModules DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
install(FILES "${OpenCV_SOURCE_DIR}/platforms/android/android.toolchain.cmake" DESTINATION ${OPENCV_CONFIG_INSTALL_PATH}/ COMPONENT dev)
|
ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "abi-${ANDROID_NDK_ABI_NAME}" "OpenCVConfig.root-ANDROID.cmake.in")
|
||||||
|
install(FILES "${OpenCV_SOURCE_DIR}/platforms/android/android.toolchain.cmake" DESTINATION "${OPENCV_CONFIG_INSTALL_PATH}" COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# --------------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------------
|
||||||
# Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages
|
# Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages
|
||||||
# --------------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------------
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_CONFIG_PATH}/include\" \"\${OpenCV_CONFIG_PATH}/include/opencv\"")
|
if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||||
set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
|
|
||||||
|
|
||||||
exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/win-install/\"" OUTPUT_VARIABLE RET_VAL)
|
|
||||||
if(USE_IPPICV)
|
|
||||||
file(RELATIVE_PATH INSTALL_PATH_RELATIVE_IPPICV "${CMAKE_INSTALL_PREFIX}/${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" ${IPPICV_INSTALL_PATH})
|
|
||||||
endif()
|
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" @ONLY)
|
|
||||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" @ONLY)
|
|
||||||
if (CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
|
||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" COMPONENT dev)
|
set(_lib_suffix "lib")
|
||||||
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
|
||||||
else()
|
else()
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" COMPONENT dev)
|
set(_lib_suffix "staticlib")
|
||||||
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
|
||||||
endif()
|
endif()
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" DESTINATION ./ COMPONENT dev)
|
ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" "${OpenCV_INSTALL_BINARIES_PREFIX}${_lib_suffix}" "OpenCVConfig.root-WIN32.cmake.in")
|
||||||
install(FILES "${OpenCV_SOURCE_DIR}/cmake/OpenCVConfig.cmake" DESTINATION ./ COMPONENT dev)
|
else()
|
||||||
else ()
|
ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" "" "")
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib/cmake/opencv-${OPENCV_VERSION}" COMPONENT dev)
|
endif()
|
||||||
install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib/cmake/opencv-${OPENCV_VERSION}" FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
|
|
||||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" DESTINATION "lib/cmake/opencv-${OPENCV_VERSION}" COMPONENT dev)
|
|
||||||
endif ()
|
|
||||||
endif()
|
endif()
|
||||||
|
@ -859,7 +859,8 @@ macro(_ocv_create_module)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
get_target_property(_target_type ${the_module} TYPE)
|
get_target_property(_target_type ${the_module} TYPE)
|
||||||
if("${_target_type}" STREQUAL "SHARED_LIBRARY" OR (NOT BUILD_SHARED_LIBS OR NOT INSTALL_CREATE_DISTRIB))
|
if(OPENCV_MODULE_${the_module}_CLASS STREQUAL "PUBLIC" AND
|
||||||
|
("${_target_type}" STREQUAL "SHARED_LIBRARY" OR (NOT BUILD_SHARED_LIBS OR NOT INSTALL_CREATE_DISTRIB)))
|
||||||
ocv_install_target(${the_module} EXPORT OpenCVModules OPTIONAL
|
ocv_install_target(${the_module} EXPORT OpenCVModules OPTIONAL
|
||||||
RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs
|
RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs
|
||||||
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT libs NAMELINK_SKIP
|
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT libs NAMELINK_SKIP
|
||||||
|
@ -30,6 +30,19 @@ function(ocv_cmake_eval var_name)
|
|||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
macro(ocv_cmake_configure file_name var_name)
|
||||||
|
configure_file(${file_name} "${CMAKE_BINARY_DIR}/CMakeConfig-${var_name}.cmake" ${ARGN})
|
||||||
|
file(READ "${CMAKE_BINARY_DIR}/CMakeConfig-${var_name}.cmake" ${var_name})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(ocv_update VAR)
|
||||||
|
if(NOT DEFINED ${VAR})
|
||||||
|
set(${VAR} ${ARGN})
|
||||||
|
else()
|
||||||
|
#ocv_debug_message("Preserve old value for ${VAR}: ${${VAR}}")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
# Search packages for host system instead of packages for target system
|
# Search packages for host system instead of packages for target system
|
||||||
# in case of cross compilation thess macro should be defined by toolchain file
|
# in case of cross compilation thess macro should be defined by toolchain file
|
||||||
if(NOT COMMAND find_host_package)
|
if(NOT COMMAND find_host_package)
|
||||||
@ -71,6 +84,23 @@ macro(ocv_check_environment_variables)
|
|||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro(ocv_path_join result_var P1 P2)
|
||||||
|
string(REGEX REPLACE "^[/]+" "" P2 "${P2}")
|
||||||
|
if("${P1}" STREQUAL "")
|
||||||
|
if("${P2}" STREQUAL "")
|
||||||
|
set(${result_var} ".")
|
||||||
|
else()
|
||||||
|
set(${result_var} "${P2}")
|
||||||
|
endif()
|
||||||
|
elseif("${P1}" STREQUAL "/")
|
||||||
|
set(${result_var} "/${P2}")
|
||||||
|
elseif("${P2}" STREQUAL "")
|
||||||
|
set(${result_var} "${P1}")
|
||||||
|
else()
|
||||||
|
set(${result_var} "${P1}/${P2}")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
# rename modules target to world if needed
|
# rename modules target to world if needed
|
||||||
macro(_ocv_fix_target target_var)
|
macro(_ocv_fix_target target_var)
|
||||||
if(BUILD_opencv_world)
|
if(BUILD_opencv_world)
|
||||||
@ -359,7 +389,7 @@ macro(CHECK_MODULE module_name define)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
set(OPENCV_BUILD_INFO_FILE "${OpenCV_BINARY_DIR}/version_string.tmp")
|
set(OPENCV_BUILD_INFO_FILE "${CMAKE_BINARY_DIR}/version_string.tmp")
|
||||||
file(REMOVE "${OPENCV_BUILD_INFO_FILE}")
|
file(REMOVE "${OPENCV_BUILD_INFO_FILE}")
|
||||||
function(ocv_output_status msg)
|
function(ocv_output_status msg)
|
||||||
message(STATUS "${msg}")
|
message(STATUS "${msg}")
|
||||||
|
13
cmake/templates/OpenCVConfig-ANDROID.cmake.in
Normal file
13
cmake/templates/OpenCVConfig-ANDROID.cmake.in
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Android API level from which OpenCV has been compiled is remembered
|
||||||
|
set(OpenCV_ANDROID_NATIVE_API_LEVEL "@OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE@")
|
||||||
|
|
||||||
|
# ==============================================================
|
||||||
|
# Check OpenCV availability
|
||||||
|
# ==============================================================
|
||||||
|
if(OpenCV_ANDROID_NATIVE_API_LEVEL GREATER ANDROID_NATIVE_API_LEVEL)
|
||||||
|
if(NOT OpenCV_FIND_QUIETLY)
|
||||||
|
message(WARNING "Minimum required by OpenCV API level is android-${OpenCV_ANDROID_NATIVE_API_LEVEL}")
|
||||||
|
endif()
|
||||||
|
set(OpenCV_FOUND 0)
|
||||||
|
return()
|
||||||
|
endif()
|
53
cmake/templates/OpenCVConfig-CUDA.cmake.in
Normal file
53
cmake/templates/OpenCVConfig-CUDA.cmake.in
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# Version Compute Capability from which OpenCV has been compiled is remembered
|
||||||
|
set(OpenCV_COMPUTE_CAPABILITIES "@OpenCV_CUDA_CC@")
|
||||||
|
|
||||||
|
set(OpenCV_CUDA_VERSION "@CUDA_VERSION_STRING@")
|
||||||
|
set(OpenCV_USE_CUBLAS "@HAVE_CUBLAS@")
|
||||||
|
set(OpenCV_USE_CUFFT "@HAVE_CUFFT@")
|
||||||
|
set(OpenCV_USE_NVCUVID "@HAVE_NVCUVID@")
|
||||||
|
|
||||||
|
if(NOT CUDA_FOUND)
|
||||||
|
find_host_package(CUDA ${OpenCV_CUDA_VERSION} EXACT REQUIRED)
|
||||||
|
else()
|
||||||
|
if(NOT CUDA_VERSION_STRING VERSION_EQUAL OpenCV_CUDA_VERSION)
|
||||||
|
message(FATAL_ERROR "OpenCV static library was compiled with CUDA ${OpenCV_CUDA_VERSION} support. Please, use the same version or rebuild OpenCV with CUDA ${CUDA_VERSION_STRING}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(OpenCV_CUDA_LIBS_ABSPATH ${CUDA_LIBRARIES})
|
||||||
|
|
||||||
|
if(${CUDA_VERSION} VERSION_LESS "5.5")
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_npp_LIBRARY})
|
||||||
|
else()
|
||||||
|
find_cuda_helper_libs(nppc)
|
||||||
|
find_cuda_helper_libs(nppi)
|
||||||
|
find_cuda_helper_libs(npps)
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nppc_LIBRARY} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OpenCV_USE_CUBLAS)
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUBLAS_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OpenCV_USE_CUFFT)
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUFFT_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OpenCV_USE_NVCUVID)
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvid_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvenc_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(OpenCV_CUDA_LIBS_RELPATH "")
|
||||||
|
foreach(l ${OpenCV_CUDA_LIBS_ABSPATH})
|
||||||
|
get_filename_component(_tmp ${l} PATH)
|
||||||
|
if(NOT ${_tmp} MATCHES "-Wl.*")
|
||||||
|
list(APPEND OpenCV_CUDA_LIBS_RELPATH ${_tmp})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
list(REMOVE_DUPLICATES OpenCV_CUDA_LIBS_RELPATH)
|
||||||
|
link_directories(${OpenCV_CUDA_LIBS_RELPATH})
|
7
cmake/templates/OpenCVConfig-IPPICV.cmake.in
Normal file
7
cmake/templates/OpenCVConfig-IPPICV.cmake.in
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
if(NOT TARGET ippicv)
|
||||||
|
add_library(ippicv STATIC IMPORTED)
|
||||||
|
set_target_properties(ippicv PROPERTIES
|
||||||
|
IMPORTED_LINK_INTERFACE_LIBRARIES ""
|
||||||
|
IMPORTED_LOCATION "${OpenCV_INSTALL_PATH}/@IPPICV_INSTALL_PATH_RELATIVE_CONFIGCMAKE@"
|
||||||
|
)
|
||||||
|
endif()
|
@ -29,125 +29,15 @@
|
|||||||
#
|
#
|
||||||
# Advanced variables:
|
# Advanced variables:
|
||||||
# - OpenCV_SHARED : Use OpenCV as shared library
|
# - OpenCV_SHARED : Use OpenCV as shared library
|
||||||
# - OpenCV_CONFIG_PATH : Path to this OpenCVConfig.cmake
|
# - OpenCV_INSTALL_PATH : OpenCV location
|
||||||
# - OpenCV_INSTALL_PATH : OpenCV location (not set on Windows)
|
|
||||||
# - OpenCV_LIB_COMPONENTS : Present OpenCV modules list
|
# - OpenCV_LIB_COMPONENTS : Present OpenCV modules list
|
||||||
# - OpenCV_USE_MANGLED_PATHS : Mangled OpenCV path flag
|
# - OpenCV_USE_MANGLED_PATHS : Mangled OpenCV path flag
|
||||||
# - OpenCV_MODULES_SUFFIX : The suffix for OpenCVModules-XXX.cmake file
|
|
||||||
#
|
#
|
||||||
# Deprecated variables:
|
# Deprecated variables:
|
||||||
# - OpenCV_VERSION_TWEAK : Always "0"
|
# - OpenCV_VERSION_TWEAK : Always "0"
|
||||||
#
|
#
|
||||||
# ===================================================================================
|
# ===================================================================================
|
||||||
|
|
||||||
# Search packages for host system instead of packages for target system.
|
|
||||||
# in case of cross compilation thess macro should be defined by toolchain file
|
|
||||||
|
|
||||||
if(NOT COMMAND find_host_package)
|
|
||||||
macro(find_host_package)
|
|
||||||
find_package(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT COMMAND find_host_program)
|
|
||||||
macro(find_host_program)
|
|
||||||
find_program(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT DEFINED OpenCV_MODULES_SUFFIX)
|
|
||||||
if(ANDROID)
|
|
||||||
string(REPLACE - _ OpenCV_MODULES_SUFFIX "_${ANDROID_NDK_ABI_NAME}")
|
|
||||||
else()
|
|
||||||
set(OpenCV_MODULES_SUFFIX "")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if("@USE_IPPICV@" STREQUAL "TRUE") # value is defined by package builder (use STREQUAL to comply new CMake policy CMP0012)
|
|
||||||
if(NOT TARGET ippicv)
|
|
||||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_PATH_RELATIVE_IPPICV@")
|
|
||||||
add_library(ippicv STATIC IMPORTED)
|
|
||||||
set_target_properties(ippicv PROPERTIES
|
|
||||||
IMPORTED_LINK_INTERFACE_LIBRARIES ""
|
|
||||||
IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_PATH_RELATIVE_IPPICV@"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT TARGET opencv_core)
|
|
||||||
# Extract directory name from full path of the file currently being processed.
|
|
||||||
# Note that CMake 2.8.3 introduced CMAKE_CURRENT_LIST_DIR. We reimplement it
|
|
||||||
# for older versions of CMake to support these as well.
|
|
||||||
if(CMAKE_VERSION VERSION_LESS "2.8.3")
|
|
||||||
get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${OpenCV_MODULES_SUFFIX}.cmake)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# TODO All things below should be reviewed. What is about of moving this code into related modules (special vars/hooks/files)
|
|
||||||
|
|
||||||
# Version Compute Capability from which OpenCV has been compiled is remembered
|
|
||||||
set(OpenCV_COMPUTE_CAPABILITIES @OpenCV_CUDA_CC_CONFIGCMAKE@)
|
|
||||||
|
|
||||||
set(OpenCV_CUDA_VERSION @OpenCV_CUDA_VERSION@)
|
|
||||||
set(OpenCV_USE_CUBLAS @HAVE_CUBLAS@)
|
|
||||||
set(OpenCV_USE_CUFFT @HAVE_CUFFT@)
|
|
||||||
set(OpenCV_USE_NVCUVID @HAVE_NVCUVID@)
|
|
||||||
|
|
||||||
# Android API level from which OpenCV has been compiled is remembered
|
|
||||||
if(ANDROID)
|
|
||||||
set(OpenCV_ANDROID_NATIVE_API_LEVEL @OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE@)
|
|
||||||
else()
|
|
||||||
set(OpenCV_ANDROID_NATIVE_API_LEVEL 0)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Some additional settings are required if OpenCV is built as static libs
|
|
||||||
set(OpenCV_SHARED @BUILD_SHARED_LIBS@)
|
|
||||||
|
|
||||||
# Enables mangled install paths, that help with side by side installs
|
|
||||||
set(OpenCV_USE_MANGLED_PATHS @OpenCV_USE_MANGLED_PATHS_CONFIGCMAKE@)
|
|
||||||
|
|
||||||
# Extract the directory where *this* file has been installed (determined at cmake run-time)
|
|
||||||
if(CMAKE_VERSION VERSION_LESS "2.8.12")
|
|
||||||
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE)
|
|
||||||
else()
|
|
||||||
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY CACHE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT WIN32 OR ANDROID)
|
|
||||||
if(ANDROID)
|
|
||||||
set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../..")
|
|
||||||
else()
|
|
||||||
set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../..")
|
|
||||||
endif()
|
|
||||||
# Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
|
|
||||||
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_LESS 2.8)
|
|
||||||
get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_INSTALL_PATH}" ABSOLUTE)
|
|
||||||
else()
|
|
||||||
get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_INSTALL_PATH}" REALPATH)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# ======================================================
|
|
||||||
# Include directories to add to the user project:
|
|
||||||
# ======================================================
|
|
||||||
|
|
||||||
# Provide the include directories to the caller
|
|
||||||
set(OpenCV_INCLUDE_DIRS @OpenCV_INCLUDE_DIRS_CONFIGCMAKE@)
|
|
||||||
|
|
||||||
# ======================================================
|
|
||||||
# Link directories to add to the user project:
|
|
||||||
# ======================================================
|
|
||||||
|
|
||||||
# Provide the libs directories to the caller
|
|
||||||
set(OpenCV_LIB_DIR_OPT @OpenCV_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where release OpenCV libraries are located")
|
|
||||||
set(OpenCV_LIB_DIR_DBG @OpenCV_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where debug OpenCV libraries are located")
|
|
||||||
set(OpenCV_3RDPARTY_LIB_DIR_OPT @OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where release 3rdparty OpenCV dependencies are located")
|
|
||||||
set(OpenCV_3RDPARTY_LIB_DIR_DBG @OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE@ CACHE PATH "Path where debug 3rdparty OpenCV dependencies are located")
|
|
||||||
mark_as_advanced(FORCE OpenCV_LIB_DIR_OPT OpenCV_LIB_DIR_DBG OpenCV_3RDPARTY_LIB_DIR_OPT OpenCV_3RDPARTY_LIB_DIR_DBG OpenCV_CONFIG_PATH)
|
|
||||||
|
|
||||||
# ======================================================
|
# ======================================================
|
||||||
# Version variables:
|
# Version variables:
|
||||||
# ======================================================
|
# ======================================================
|
||||||
@ -158,28 +48,48 @@ SET(OpenCV_VERSION_PATCH @OPENCV_VERSION_PATCH@)
|
|||||||
SET(OpenCV_VERSION_TWEAK 0)
|
SET(OpenCV_VERSION_TWEAK 0)
|
||||||
SET(OpenCV_VERSION_STATUS "@OPENCV_VERSION_STATUS@")
|
SET(OpenCV_VERSION_STATUS "@OPENCV_VERSION_STATUS@")
|
||||||
|
|
||||||
# ====================================================================
|
# Extract directory name from full path of the file currently being processed.
|
||||||
# Link libraries: e.g. opencv_core;opencv_imgproc; etc...
|
# Note that CMake 2.8.3 introduced CMAKE_CURRENT_LIST_DIR. We reimplement it
|
||||||
# ====================================================================
|
# for older versions of CMake to support these as well.
|
||||||
|
if(CMAKE_VERSION VERSION_LESS "2.8.3")
|
||||||
|
get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
|
endif()
|
||||||
|
|
||||||
SET(OpenCV_LIB_COMPONENTS @OPENCV_MODULES_CONFIGCMAKE@)
|
# Extract the directory where *this* file has been installed (determined at cmake run-time)
|
||||||
list(REMOVE_ITEM OpenCV_LIB_COMPONENTS opencv_hal)
|
# Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
|
||||||
SET(OpenCV_WORLD_COMPONENTS @OPENCV_WORLD_MODULES@)
|
set(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/@OpenCV_INSTALL_PATH_RELATIVE_CONFIGCMAKE@" REALPATH)
|
||||||
|
|
||||||
# ==============================================================
|
# Search packages for host system instead of packages for target system.
|
||||||
# Extra include directories, needed by OpenCV 2 new structure
|
# in case of cross compilation thess macro should be defined by toolchain file
|
||||||
# ==============================================================
|
if(NOT COMMAND find_host_package)
|
||||||
SET(OpenCV2_INCLUDE_DIRS @OpenCV2_INCLUDE_DIRS_CONFIGCMAKE@)
|
macro(find_host_package)
|
||||||
if(OpenCV2_INCLUDE_DIRS)
|
find_package(${ARGN})
|
||||||
list(APPEND OpenCV_INCLUDE_DIRS ${OpenCV2_INCLUDE_DIRS})
|
endmacro()
|
||||||
|
endif()
|
||||||
|
if(NOT COMMAND find_host_program)
|
||||||
|
macro(find_host_program)
|
||||||
|
find_program(${ARGN})
|
||||||
|
endmacro()
|
||||||
|
endif()
|
||||||
|
|
||||||
set(OpenCV_ADD_DEBUG_RELEASE @OpenCV_ADD_DEBUG_RELEASE_CONFIGCMAKE@)
|
|
||||||
if(OpenCV_ADD_DEBUG_RELEASE)
|
@CUDA_CONFIGCMAKE@
|
||||||
set(OpenCV_LIB_DIR_OPT "${OpenCV_LIB_DIR_OPT}/Release")
|
@ANDROID_CONFIGCMAKE@
|
||||||
set(OpenCV_LIB_DIR_DBG "${OpenCV_LIB_DIR_DBG}/Debug")
|
|
||||||
set(OpenCV_3RDPARTY_LIB_DIR_OPT "${OpenCV_3RDPARTY_LIB_DIR_OPT}/Release")
|
@IPPICV_CONFIGCMAKE@
|
||||||
set(OpenCV_3RDPARTY_LIB_DIR_DBG "${OpenCV_3RDPARTY_LIB_DIR_DBG}/Debug")
|
|
||||||
endif()
|
# Some additional settings are required if OpenCV is built as static libs
|
||||||
|
set(OpenCV_SHARED @BUILD_SHARED_LIBS@)
|
||||||
|
|
||||||
|
# Enables mangled install paths, that help with side by side installs
|
||||||
|
set(OpenCV_USE_MANGLED_PATHS @OpenCV_USE_MANGLED_PATHS_CONFIGCMAKE@)
|
||||||
|
|
||||||
|
set(OpenCV_LIB_COMPONENTS @OPENCV_MODULES_CONFIGCMAKE@)
|
||||||
|
set(OpenCV_INCLUDE_DIRS @OpenCV_INCLUDE_DIRS_CONFIGCMAKE@)
|
||||||
|
|
||||||
|
if(NOT TARGET opencv_core)
|
||||||
|
include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${OpenCV_MODULES_SUFFIX}.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT CMAKE_VERSION VERSION_LESS "2.8.11")
|
if(NOT CMAKE_VERSION VERSION_LESS "2.8.11")
|
||||||
@ -196,22 +106,6 @@ if(NOT CMAKE_VERSION VERSION_LESS "2.8.11")
|
|||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ==============================================================
|
|
||||||
# Check OpenCV availability
|
|
||||||
# ==============================================================
|
|
||||||
if(ANDROID AND OpenCV_ANDROID_NATIVE_API_LEVEL GREATER ANDROID_NATIVE_API_LEVEL)
|
|
||||||
message(FATAL_ERROR "Minimum required by OpenCV API level is android-${OpenCV_ANDROID_NATIVE_API_LEVEL}")
|
|
||||||
#always FATAL_ERROR because we can't say to the caller that OpenCV is not found
|
|
||||||
#http://www.mail-archive.com/cmake@cmake.org/msg37831.html
|
|
||||||
if(OpenCV_FIND_REQUIRED)
|
|
||||||
message(FATAL_ERROR "Minimum required by OpenCV API level is android-${OpenCV_ANDROID_NATIVE_API_LEVEL}")
|
|
||||||
elseif(NOT OpenCV_FIND_QUIETLY)
|
|
||||||
message(WARNING "Minimum required by OpenCV API level is android-${OpenCV_ANDROID_NATIVE_API_LEVEL}")
|
|
||||||
endif()
|
|
||||||
set(OpenCV_FOUND "OpenCV_FOUND-NOTFOUND")
|
|
||||||
return()#Android toolchain requires CMake > 2.6
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
# Form list of modules (components) to find
|
# Form list of modules (components) to find
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
@ -223,6 +117,8 @@ if(NOT OpenCV_FIND_COMPONENTS)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(OpenCV_WORLD_COMPONENTS @OPENCV_WORLD_MODULES@)
|
||||||
|
|
||||||
# expand short module names and see if requested components exist
|
# expand short module names and see if requested components exist
|
||||||
set(OpenCV_FIND_COMPONENTS_ "")
|
set(OpenCV_FIND_COMPONENTS_ "")
|
||||||
foreach(__cvcomponent ${OpenCV_FIND_COMPONENTS})
|
foreach(__cvcomponent ${OpenCV_FIND_COMPONENTS})
|
||||||
@ -276,89 +172,11 @@ foreach(__cvcomponent ${OpenCV_FIND_COMPONENTS})
|
|||||||
endforeach()
|
endforeach()
|
||||||
set(OpenCV_FIND_COMPONENTS ${OpenCV_FIND_COMPONENTS_})
|
set(OpenCV_FIND_COMPONENTS ${OpenCV_FIND_COMPONENTS_})
|
||||||
|
|
||||||
# ==============================================================
|
|
||||||
# Resolve dependencies
|
|
||||||
# ==============================================================
|
|
||||||
if(OpenCV_USE_MANGLED_PATHS)
|
|
||||||
set(OpenCV_LIB_SUFFIX ".${OpenCV_VERSION_MAJOR}.${OpenCV_VERSION_MINOR}.${OpenCV_VERSION_PATCH}")
|
|
||||||
else()
|
|
||||||
set(OpenCV_LIB_SUFFIX "")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(__opttype OPT DBG)
|
|
||||||
SET(OpenCV_LIBS_${__opttype} "${OpenCV_LIBS}")
|
|
||||||
SET(OpenCV_EXTRA_LIBS_${__opttype} "")
|
|
||||||
|
|
||||||
# CUDA
|
|
||||||
if(OpenCV_CUDA_VERSION)
|
|
||||||
if(NOT CUDA_FOUND)
|
|
||||||
find_host_package(CUDA ${OpenCV_CUDA_VERSION} EXACT REQUIRED)
|
|
||||||
else()
|
|
||||||
if(NOT CUDA_VERSION_STRING VERSION_EQUAL OpenCV_CUDA_VERSION)
|
|
||||||
message(FATAL_ERROR "OpenCV static library was compiled with CUDA ${OpenCV_CUDA_VERSION} support. Please, use the same version or rebuild OpenCV with CUDA ${CUDA_VERSION_STRING}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(OpenCV_CUDA_LIBS_ABSPATH ${CUDA_LIBRARIES})
|
|
||||||
|
|
||||||
if(${CUDA_VERSION} VERSION_LESS "5.5")
|
|
||||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_npp_LIBRARY})
|
|
||||||
else()
|
|
||||||
find_cuda_helper_libs(nppc)
|
|
||||||
find_cuda_helper_libs(nppi)
|
|
||||||
find_cuda_helper_libs(npps)
|
|
||||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nppc_LIBRARY} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(OpenCV_USE_CUBLAS)
|
|
||||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUBLAS_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(OpenCV_USE_CUFFT)
|
|
||||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUFFT_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(OpenCV_USE_NVCUVID)
|
|
||||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvid_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvenc_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(OpenCV_CUDA_LIBS_RELPATH "")
|
|
||||||
foreach(l ${OpenCV_CUDA_LIBS_ABSPATH})
|
|
||||||
get_filename_component(_tmp ${l} PATH)
|
|
||||||
if(NOT ${_tmp} MATCHES "-Wl.*")
|
|
||||||
list(APPEND OpenCV_CUDA_LIBS_RELPATH ${_tmp})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
list(REMOVE_DUPLICATES OpenCV_CUDA_LIBS_RELPATH)
|
|
||||||
link_directories(${OpenCV_CUDA_LIBS_RELPATH})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
# Compatibility stuff
|
# Compatibility stuff
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
||||||
SET(OpenCV_LIB_DIR ${OpenCV_LIB_DIR_DBG} ${OpenCV_3RDPARTY_LIB_DIR_DBG})
|
|
||||||
else()
|
|
||||||
SET(OpenCV_LIB_DIR ${OpenCV_LIB_DIR_OPT} ${OpenCV_3RDPARTY_LIB_DIR_OPT})
|
|
||||||
endif()
|
|
||||||
set(OpenCV_LIBRARIES ${OpenCV_LIBS})
|
set(OpenCV_LIBRARIES ${OpenCV_LIBS})
|
||||||
|
|
||||||
if(CMAKE_CROSSCOMPILING AND OpenCV_SHARED AND (CMAKE_SYSTEM_NAME MATCHES "Linux"))
|
|
||||||
foreach(dir ${OpenCV_LIB_DIR})
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath-link,${dir}")
|
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath-link,${dir}")
|
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-rpath-link,${dir}")
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Some macroses for samples
|
# Some macroses for samples
|
||||||
#
|
#
|
||||||
@ -376,7 +194,7 @@ endmacro()
|
|||||||
# adds include directories in such way that directories from the OpenCV source tree go first
|
# adds include directories in such way that directories from the OpenCV source tree go first
|
||||||
function(ocv_include_directories)
|
function(ocv_include_directories)
|
||||||
set(__add_before "")
|
set(__add_before "")
|
||||||
file(TO_CMAKE_PATH "${OpenCV_DIR}" __baseDir)
|
file(TO_CMAKE_PATH "${OpenCV_INSTALL_PATH}" __baseDir)
|
||||||
foreach(dir ${ARGN})
|
foreach(dir ${ARGN})
|
||||||
get_filename_component(__abs_dir "${dir}" ABSOLUTE)
|
get_filename_component(__abs_dir "${dir}" ABSOLUTE)
|
||||||
if("${__abs_dir}" MATCHES "^${__baseDir}")
|
if("${__abs_dir}" MATCHES "^${__baseDir}")
|
||||||
|
50
cmake/templates/OpenCVConfig.root-ANDROID.cmake.in
Normal file
50
cmake/templates/OpenCVConfig.root-ANDROID.cmake.in
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# ===================================================================================
|
||||||
|
# The OpenCV CMake configuration file
|
||||||
|
#
|
||||||
|
# ** File generated automatically, do not modify **
|
||||||
|
#
|
||||||
|
# Usage from an external project:
|
||||||
|
# In your CMakeLists.txt, add these lines:
|
||||||
|
#
|
||||||
|
# find_package(OpenCV REQUIRED)
|
||||||
|
# include_directories(${OpenCV_INCLUDE_DIRS}) # Not needed for CMake >= 2.8.11
|
||||||
|
# target_link_libraries(MY_TARGET_NAME ${OpenCV_LIBS})
|
||||||
|
#
|
||||||
|
# Or you can search for specific OpenCV modules:
|
||||||
|
#
|
||||||
|
# find_package(OpenCV REQUIRED core videoio)
|
||||||
|
#
|
||||||
|
# If the module is found then OPENCV_<MODULE>_FOUND is set to TRUE.
|
||||||
|
#
|
||||||
|
# This file will define the following variables:
|
||||||
|
# - OpenCV_LIBS : The list of all imported targets for OpenCV modules.
|
||||||
|
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
|
||||||
|
# - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API.
|
||||||
|
# - OpenCV_VERSION : The version of this OpenCV build: "@OPENCV_VERSION_PLAIN@"
|
||||||
|
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION: "@OPENCV_VERSION_MAJOR@"
|
||||||
|
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION: "@OPENCV_VERSION_MINOR@"
|
||||||
|
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION: "@OPENCV_VERSION_PATCH@"
|
||||||
|
# - OpenCV_VERSION_STATUS : Development status of this build: "@OPENCV_VERSION_STATUS@"
|
||||||
|
#
|
||||||
|
# ===================================================================================
|
||||||
|
|
||||||
|
# Extract directory name from full path of the file currently being processed.
|
||||||
|
# Note that CMake 2.8.3 introduced CMAKE_CURRENT_LIST_DIR. We reimplement it
|
||||||
|
# for older versions of CMake to support these as well.
|
||||||
|
if(CMAKE_VERSION VERSION_LESS "2.8.3")
|
||||||
|
get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT DEFINED OpenCV_CONFIG_SUBDIR)
|
||||||
|
set(OpenCV_CONFIG_SUBDIR "/abi-${ANDROID_NDK_ABI_NAME}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_DIR}${OpenCV_CONFIG_SUBDIR}")
|
||||||
|
if(EXISTS "${OpenCV_CONFIG_PATH}/OpenCVConfig.cmake")
|
||||||
|
include("${OpenCV_CONFIG_PATH}/OpenCVConfig.cmake")
|
||||||
|
else()
|
||||||
|
if(NOT OpenCV_FIND_QUIETLY)
|
||||||
|
message(WARNING "Found OpenCV Android Pack but it has no binaries compatible with your ABI (can't find: ${OpenCV_CONFIG_SUBDIR})")
|
||||||
|
endif()
|
||||||
|
set(OpenCV_FOUND FALSE)
|
||||||
|
endif()
|
@ -17,20 +17,16 @@
|
|||||||
#
|
#
|
||||||
# This file will define the following variables:
|
# This file will define the following variables:
|
||||||
# - OpenCV_LIBS : The list of libraries to link against.
|
# - OpenCV_LIBS : The list of libraries to link against.
|
||||||
# - OpenCV_LIB_DIR : The directory(es) where lib files are. Calling LINK_DIRECTORIES
|
|
||||||
# with this path is NOT needed.
|
|
||||||
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
|
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
|
||||||
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability
|
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability
|
||||||
# - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API
|
# - OpenCV_VERSION : The version of this OpenCV build: "@OPENCV_VERSION_PLAIN@"
|
||||||
# - OpenCV_VERSION : The version of this OpenCV build. Example: "2.4.0"
|
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION: "@OPENCV_VERSION_MAJOR@"
|
||||||
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION. Example: "2"
|
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION: "@OPENCV_VERSION_MINOR@"
|
||||||
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION. Example: "4"
|
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION: "@OPENCV_VERSION_PATCH@"
|
||||||
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION. Example: "0"
|
# - OpenCV_VERSION_STATUS : Development status of this build: "@OPENCV_VERSION_STATUS@"
|
||||||
#
|
#
|
||||||
# Advanced variables:
|
# Advanced variables:
|
||||||
# - OpenCV_SHARED
|
# - OpenCV_SHARED
|
||||||
# - OpenCV_CONFIG_PATH
|
|
||||||
# - OpenCV_LIB_COMPONENTS
|
|
||||||
#
|
#
|
||||||
# ===================================================================================
|
# ===================================================================================
|
||||||
#
|
#
|
||||||
@ -64,13 +60,11 @@ endif()
|
|||||||
if(MSVC)
|
if(MSVC)
|
||||||
if(CMAKE_CL_64)
|
if(CMAKE_CL_64)
|
||||||
set(OpenCV_ARCH x64)
|
set(OpenCV_ARCH x64)
|
||||||
set(OpenCV_TBB_ARCH intel64)
|
|
||||||
elseif((CMAKE_GENERATOR MATCHES "ARM") OR ("${arch_hint}" STREQUAL "ARM") OR (CMAKE_VS_EFFECTIVE_PLATFORMS MATCHES "ARM|arm"))
|
elseif((CMAKE_GENERATOR MATCHES "ARM") OR ("${arch_hint}" STREQUAL "ARM") OR (CMAKE_VS_EFFECTIVE_PLATFORMS MATCHES "ARM|arm"))
|
||||||
# see Modules/CmakeGenericSystem.cmake
|
# see Modules/CmakeGenericSystem.cmake
|
||||||
set(OpenCV_ARCH ARM)
|
set(OpenCV_ARCH ARM)
|
||||||
else()
|
else()
|
||||||
set(OpenCV_ARCH x86)
|
set(OpenCV_ARCH x86)
|
||||||
set(OpenCV_TBB_ARCH ia32)
|
|
||||||
endif()
|
endif()
|
||||||
if(MSVC_VERSION EQUAL 1400)
|
if(MSVC_VERSION EQUAL 1400)
|
||||||
set(OpenCV_RUNTIME vc8)
|
set(OpenCV_RUNTIME vc8)
|
||||||
@ -99,22 +93,13 @@ elseif(MINGW)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_GREATER 2.6.2)
|
|
||||||
unset(OpenCV_CONFIG_PATH CACHE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT OpenCV_FIND_QUIETLY)
|
if(NOT OpenCV_FIND_QUIETLY)
|
||||||
message(STATUS "OpenCV ARCH: ${OpenCV_ARCH}")
|
message(STATUS "OpenCV ARCH: ${OpenCV_ARCH}")
|
||||||
message(STATUS "OpenCV RUNTIME: ${OpenCV_RUNTIME}")
|
message(STATUS "OpenCV RUNTIME: ${OpenCV_RUNTIME}")
|
||||||
message(STATUS "OpenCV STATIC: ${OpenCV_STATIC}")
|
message(STATUS "OpenCV STATIC: ${OpenCV_STATIC}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_LESS "2.8.12")
|
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE)
|
|
||||||
else()
|
|
||||||
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY CACHE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(OpenCV_RUNTIME AND OpenCV_ARCH)
|
if(OpenCV_RUNTIME AND OpenCV_ARCH)
|
||||||
if(OpenCV_STATIC AND EXISTS "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib/OpenCVConfig.cmake")
|
if(OpenCV_STATIC AND EXISTS "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib/OpenCVConfig.cmake")
|
||||||
if(OpenCV_CUDA AND EXISTS "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib/OpenCVConfig.cmake")
|
if(OpenCV_CUDA AND EXISTS "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib/OpenCVConfig.cmake")
|
||||||
@ -132,28 +117,8 @@ if(OpenCV_RUNTIME AND OpenCV_ARCH)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(OpenCV_LIB_PATH AND EXISTS "${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
|
if(OpenCV_LIB_PATH AND EXISTS "${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
|
||||||
set(OpenCV_LIB_DIR_OPT "${OpenCV_LIB_PATH}" CACHE PATH "Path where release OpenCV libraries are located" FORCE)
|
|
||||||
set(OpenCV_LIB_DIR_DBG "${OpenCV_LIB_PATH}" CACHE PATH "Path where debug OpenCV libraries are located" FORCE)
|
|
||||||
set(OpenCV_3RDPARTY_LIB_DIR_OPT "${OpenCV_LIB_PATH}" CACHE PATH "Path where release 3rdparty OpenCV dependencies are located" FORCE)
|
|
||||||
set(OpenCV_3RDPARTY_LIB_DIR_DBG "${OpenCV_LIB_PATH}" CACHE PATH "Path where debug 3rdparty OpenCV dependencies are located" FORCE)
|
|
||||||
|
|
||||||
include("${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
|
include("${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
|
||||||
|
|
||||||
if(OpenCV_CUDA)
|
|
||||||
set(_OpenCV_LIBS "")
|
|
||||||
foreach(_lib ${OpenCV_LIBS})
|
|
||||||
string(REPLACE "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}" "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}" _lib2 "${_lib}")
|
|
||||||
if(NOT EXISTS "${_lib}" AND EXISTS "${_lib2}")
|
|
||||||
list(APPEND _OpenCV_LIBS "${_lib2}")
|
|
||||||
else()
|
|
||||||
list(APPEND _OpenCV_LIBS "${_lib}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
set(OpenCV_LIBS ${_OpenCV_LIBS})
|
|
||||||
endif()
|
|
||||||
set(OpenCV_FOUND TRUE CACHE BOOL "" FORCE)
|
|
||||||
set(OPENCV_FOUND TRUE CACHE BOOL "" FORCE)
|
|
||||||
|
|
||||||
if(NOT OpenCV_FIND_QUIETLY)
|
if(NOT OpenCV_FIND_QUIETLY)
|
||||||
message(STATUS "Found OpenCV ${OpenCV_VERSION} in ${OpenCV_LIB_PATH}")
|
message(STATUS "Found OpenCV ${OpenCV_VERSION} in ${OpenCV_LIB_PATH}")
|
||||||
if(NOT OpenCV_LIB_PATH MATCHES "/staticlib")
|
if(NOT OpenCV_LIB_PATH MATCHES "/staticlib")
|
||||||
@ -173,6 +138,5 @@ else()
|
|||||||
You should manually point CMake variable OpenCV_DIR to your build of OpenCV library."
|
You should manually point CMake variable OpenCV_DIR to your build of OpenCV library."
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
set(OpenCV_FOUND FALSE CACHE BOOL "" FORCE)
|
set(OpenCV_FOUND FALSE)
|
||||||
set(OPENCV_FOUND FALSE CACHE BOOL "" FORCE)
|
|
||||||
endif()
|
endif()
|
@ -1,6 +1,7 @@
|
|||||||
set(the_description "The Core Functionality")
|
set(the_description "The Core Functionality")
|
||||||
ocv_add_module(core
|
ocv_add_module(core
|
||||||
PRIVATE_REQUIRED ${ZLIB_LIBRARIES} "${OPENCL_LIBRARIES}" "${VA_LIBRARIES}" "${OPENCV_HAL_LINKER_LIBS}"
|
"${OPENCV_HAL_LINKER_LIBS}"
|
||||||
|
PRIVATE_REQUIRED ${ZLIB_LIBRARIES} "${OPENCL_LIBRARIES}" "${VA_LIBRARIES}"
|
||||||
OPTIONAL opencv_cudev
|
OPTIONAL opencv_cudev
|
||||||
WRAP java python)
|
WRAP java python)
|
||||||
|
|
||||||
|
@ -89,7 +89,8 @@ CV_EXPORTS void exp64f(const double* src, double* dst, int n);
|
|||||||
CV_EXPORTS void log32f(const float* src, float* dst, int n);
|
CV_EXPORTS void log32f(const float* src, float* dst, int n);
|
||||||
CV_EXPORTS void log64f(const double* src, double* dst, int n);
|
CV_EXPORTS void log64f(const double* src, double* dst, int n);
|
||||||
|
|
||||||
CV_EXPORTS void fastAtan2(const float* y, const float* x, float* dst, int n, bool angleInDegrees);
|
CV_EXPORTS void fastAtan32f(const float* y, const float* x, float* dst, int n, bool angleInDegrees);
|
||||||
|
CV_EXPORTS void fastAtan64f(const double* y, const double* x, double* dst, int n, bool angleInDegrees);
|
||||||
CV_EXPORTS void magnitude32f(const float* x, const float* y, float* dst, int n);
|
CV_EXPORTS void magnitude32f(const float* x, const float* y, float* dst, int n);
|
||||||
CV_EXPORTS void magnitude64f(const double* x, const double* y, double* dst, int n);
|
CV_EXPORTS void magnitude64f(const double* x, const double* y, double* dst, int n);
|
||||||
CV_EXPORTS void sqrt32f(const float* src, float* dst, int len);
|
CV_EXPORTS void sqrt32f(const float* src, float* dst, int len);
|
||||||
@ -232,6 +233,7 @@ CV_EXPORTS void exp(const double* src, double* dst, int n);
|
|||||||
CV_EXPORTS void log(const float* src, float* dst, int n);
|
CV_EXPORTS void log(const float* src, float* dst, int n);
|
||||||
CV_EXPORTS void log(const double* src, double* dst, int n);
|
CV_EXPORTS void log(const double* src, double* dst, int n);
|
||||||
|
|
||||||
|
CV_EXPORTS void fastAtan2(const float* y, const float* x, float* dst, int n, bool angleInDegrees);
|
||||||
CV_EXPORTS void magnitude(const float* x, const float* y, float* dst, int n);
|
CV_EXPORTS void magnitude(const float* x, const float* y, float* dst, int n);
|
||||||
CV_EXPORTS void magnitude(const double* x, const double* y, double* dst, int n);
|
CV_EXPORTS void magnitude(const double* x, const double* y, double* dst, int n);
|
||||||
CV_EXPORTS void sqrt(const float* src, float* dst, int len);
|
CV_EXPORTS void sqrt(const float* src, float* dst, int len);
|
||||||
|
@ -317,4 +317,98 @@ template <typename T> struct V_SIMD128Traits
|
|||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
|
||||||
|
//! @cond IGNORED
|
||||||
|
|
||||||
|
namespace cv {
|
||||||
|
|
||||||
|
template <typename R> struct V_RegTrait128;
|
||||||
|
|
||||||
|
template <> struct V_RegTrait128<uchar> {
|
||||||
|
typedef v_uint8x16 reg;
|
||||||
|
typedef v_uint16x8 w_reg;
|
||||||
|
typedef v_uint32x4 q_reg;
|
||||||
|
typedef v_uint8x16 u_reg;
|
||||||
|
static v_uint8x16 zero() { return v_setzero_u8(); }
|
||||||
|
static v_uint8x16 all(uchar val) { return v_setall_u8(val); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <> struct V_RegTrait128<schar> {
|
||||||
|
typedef v_int8x16 reg;
|
||||||
|
typedef v_int16x8 w_reg;
|
||||||
|
typedef v_int32x4 q_reg;
|
||||||
|
typedef v_uint8x16 u_reg;
|
||||||
|
static v_int8x16 zero() { return v_setzero_s8(); }
|
||||||
|
static v_int8x16 all(schar val) { return v_setall_s8(val); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <> struct V_RegTrait128<ushort> {
|
||||||
|
typedef v_uint16x8 reg;
|
||||||
|
typedef v_uint32x4 w_reg;
|
||||||
|
typedef v_int16x8 int_reg;
|
||||||
|
typedef v_uint16x8 u_reg;
|
||||||
|
static v_uint16x8 zero() { return v_setzero_u16(); }
|
||||||
|
static v_uint16x8 all(ushort val) { return v_setall_u16(val); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <> struct V_RegTrait128<short> {
|
||||||
|
typedef v_int16x8 reg;
|
||||||
|
typedef v_int32x4 w_reg;
|
||||||
|
typedef v_uint16x8 u_reg;
|
||||||
|
static v_int16x8 zero() { return v_setzero_s16(); }
|
||||||
|
static v_int16x8 all(short val) { return v_setall_s16(val); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <> struct V_RegTrait128<unsigned> {
|
||||||
|
typedef v_uint32x4 reg;
|
||||||
|
typedef v_uint64x2 w_reg;
|
||||||
|
typedef v_int32x4 int_reg;
|
||||||
|
typedef v_uint32x4 u_reg;
|
||||||
|
static v_uint32x4 zero() { return v_setzero_u32(); }
|
||||||
|
static v_uint32x4 all(unsigned val) { return v_setall_u32(val); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <> struct V_RegTrait128<int> {
|
||||||
|
typedef v_int32x4 reg;
|
||||||
|
typedef v_int64x2 w_reg;
|
||||||
|
typedef v_uint32x4 u_reg;
|
||||||
|
static v_int32x4 zero() { return v_setzero_s32(); }
|
||||||
|
static v_int32x4 all(int val) { return v_setall_s32(val); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <> struct V_RegTrait128<uint64> {
|
||||||
|
typedef v_uint64x2 reg;
|
||||||
|
static v_uint64x2 zero() { return v_setzero_u64(); }
|
||||||
|
static v_uint64x2 all(uint64 val) { return v_setall_u64(val); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <> struct V_RegTrait128<int64> {
|
||||||
|
typedef v_int64x2 reg;
|
||||||
|
static v_int64x2 zero() { return v_setzero_s64(); }
|
||||||
|
static v_int64x2 all(int64 val) { return v_setall_s64(val); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <> struct V_RegTrait128<float> {
|
||||||
|
typedef v_float32x4 reg;
|
||||||
|
typedef v_int32x4 int_reg;
|
||||||
|
typedef v_float32x4 u_reg;
|
||||||
|
static v_float32x4 zero() { return v_setzero_f32(); }
|
||||||
|
static v_float32x4 all(float val) { return v_setall_f32(val); }
|
||||||
|
};
|
||||||
|
|
||||||
|
#if CV_SIMD128_64F
|
||||||
|
template <> struct V_RegTrait128<double> {
|
||||||
|
typedef v_float64x2 reg;
|
||||||
|
typedef v_int32x4 int_reg;
|
||||||
|
typedef v_float64x2 u_reg;
|
||||||
|
static v_float64x2 zero() { return v_setzero_f64(); }
|
||||||
|
static v_float64x2 all(double val) { return v_setall_f64(val); }
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
} // cv::
|
||||||
|
|
||||||
|
//! @endcond
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,6 +25,20 @@ PERF_TEST_P(VectorLength, phase32f, testing::Values(128, 1000, 128*1024, 512*102
|
|||||||
SANITY_CHECK(angle, 5e-5);
|
SANITY_CHECK(angle, 5e-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PERF_TEST_P(VectorLength, phase64f, testing::Values(128, 1000, 128*1024, 512*1024, 1024*1024))
|
||||||
|
{
|
||||||
|
size_t length = GetParam();
|
||||||
|
vector<double> X(length);
|
||||||
|
vector<double> Y(length);
|
||||||
|
vector<double> angle(length);
|
||||||
|
|
||||||
|
declare.in(X, Y, WARMUP_RNG).out(angle);
|
||||||
|
|
||||||
|
TEST_CYCLE_N(200) cv::phase(X, Y, angle, true);
|
||||||
|
|
||||||
|
SANITY_CHECK(angle, 5e-5);
|
||||||
|
}
|
||||||
|
|
||||||
PERF_TEST_P( MaxDim_MaxPoints, kmeans,
|
PERF_TEST_P( MaxDim_MaxPoints, kmeans,
|
||||||
testing::Combine( testing::Values( 16, 32, 64 ),
|
testing::Combine( testing::Values( 16, 32, 64 ),
|
||||||
testing::Values( 300, 400, 500) ) )
|
testing::Values( 300, 400, 500) ) )
|
||||||
|
@ -376,6 +376,110 @@ inline int hal_ni_merge64s(const int64 **src_data, int64 *dst_data, int len, int
|
|||||||
#define cv_hal_merge64s hal_ni_merge64s
|
#define cv_hal_merge64s hal_ni_merge64s
|
||||||
//! @endcond
|
//! @endcond
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@param y,x source Y and X arrays
|
||||||
|
@param dst destination array
|
||||||
|
@param len length of arrays
|
||||||
|
@param angleInDegrees if set to true return angles in degrees, otherwise in radians
|
||||||
|
*/
|
||||||
|
//! @addtogroup core_hal_interface_fastAtan Atan calculation
|
||||||
|
//! @{
|
||||||
|
inline int hal_ni_fastAtan32f(const float* y, const float* x, float* dst, int len, bool angleInDegrees) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
inline int hal_ni_fastAtan64f(const double* y, const double* x, double* dst, int len, bool angleInDegrees) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
//! @}
|
||||||
|
|
||||||
|
//! @cond IGNORED
|
||||||
|
#define cv_hal_fastAtan32f hal_ni_fastAtan32f
|
||||||
|
#define cv_hal_fastAtan64f hal_ni_fastAtan64f
|
||||||
|
//! @endcond
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@param x,y source X and Y arrays
|
||||||
|
@param dst destination array
|
||||||
|
@param len length of arrays
|
||||||
|
*/
|
||||||
|
//! @addtogroup core_hal_interface_magnitude Magnitude calculation
|
||||||
|
//! @{
|
||||||
|
inline int hal_ni_magnitude32f(const float *x, const float *y, float *dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
inline int hal_ni_magnitude64f(const double *x, const double *y, double *dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
//! @}
|
||||||
|
|
||||||
|
//! @cond IGNORED
|
||||||
|
#define cv_hal_magnitude32f hal_ni_magnitude32f
|
||||||
|
#define cv_hal_magnitude64f hal_ni_magnitude64f
|
||||||
|
//! @endcond
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@param src source array
|
||||||
|
@param dst destination array
|
||||||
|
@param len length of arrays
|
||||||
|
*/
|
||||||
|
//! @addtogroup core_hal_interface_invSqrt Inverse square root calculation
|
||||||
|
//! @{
|
||||||
|
inline int hal_ni_invSqrt32f(const float* src, float* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
inline int hal_ni_invSqrt64f(const double* src, double* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
//! @}
|
||||||
|
|
||||||
|
//! @cond IGNORED
|
||||||
|
#define cv_hal_invSqrt32f hal_ni_invSqrt32f
|
||||||
|
#define cv_hal_invSqrt64f hal_ni_invSqrt64f
|
||||||
|
//! @endcond
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@param src source array
|
||||||
|
@param dst destination array
|
||||||
|
@param len length of arrays
|
||||||
|
*/
|
||||||
|
//! @addtogroup core_hal_interface_sqrt Square root calculation
|
||||||
|
//! @{
|
||||||
|
inline int hal_ni_sqrt32f(const float* src, float* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
inline int hal_ni_sqrt64f(const double* src, double* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
//! @}
|
||||||
|
|
||||||
|
//! @cond IGNORED
|
||||||
|
#define cv_hal_sqrt32f hal_ni_sqrt32f
|
||||||
|
#define cv_hal_sqrt64f hal_ni_sqrt64f
|
||||||
|
//! @endcond
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@param src source array
|
||||||
|
@param dst destination array
|
||||||
|
@param len length of arrays
|
||||||
|
*/
|
||||||
|
//! @addtogroup core_hal_interface_log Natural logarithm calculation
|
||||||
|
//! @{
|
||||||
|
inline int hal_ni_log32f(const float* src, float* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
inline int hal_ni_log64f(const double* src, double* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
//! @}
|
||||||
|
|
||||||
|
//! @cond IGNORED
|
||||||
|
#define cv_hal_log32f hal_ni_log32f
|
||||||
|
#define cv_hal_log64f hal_ni_log64f
|
||||||
|
//! @endcond
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@param src source array
|
||||||
|
@param dst destination array
|
||||||
|
@param len length of arrays
|
||||||
|
*/
|
||||||
|
//! @addtogroup core_hal_interface_exp Exponent calculation
|
||||||
|
//! @{
|
||||||
|
inline int hal_ni_exp32f(const float* src, float* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
inline int hal_ni_exp64f(const double* src, double* dst, int len) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
//! @}
|
||||||
|
|
||||||
|
//! @cond IGNORED
|
||||||
|
#define cv_hal_exp32f hal_ni_exp32f
|
||||||
|
#define cv_hal_exp64f hal_ni_exp64f
|
||||||
|
//! @endcond
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Dummy structure storing DFT/DCT context
|
@brief Dummy structure storing DFT/DCT context
|
||||||
|
|
||||||
@ -599,21 +703,25 @@ inline int hal_ni_gemm64fc(const double* src1, size_t src1_step, const double* s
|
|||||||
|
|
||||||
//! @cond IGNORED
|
//! @cond IGNORED
|
||||||
#define CALL_HAL_RET(name, fun, retval, ...) \
|
#define CALL_HAL_RET(name, fun, retval, ...) \
|
||||||
|
{ \
|
||||||
int res = fun(__VA_ARGS__, &retval); \
|
int res = fun(__VA_ARGS__, &retval); \
|
||||||
if (res == CV_HAL_ERROR_OK) \
|
if (res == CV_HAL_ERROR_OK) \
|
||||||
return retval; \
|
return retval; \
|
||||||
else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \
|
else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \
|
||||||
CV_Error_(cv::Error::StsInternal, \
|
CV_Error_(cv::Error::StsInternal, \
|
||||||
("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res));
|
("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res)); \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#define CALL_HAL(name, fun, ...) \
|
#define CALL_HAL(name, fun, ...) \
|
||||||
|
{ \
|
||||||
int res = fun(__VA_ARGS__); \
|
int res = fun(__VA_ARGS__); \
|
||||||
if (res == CV_HAL_ERROR_OK) \
|
if (res == CV_HAL_ERROR_OK) \
|
||||||
return; \
|
return; \
|
||||||
else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \
|
else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \
|
||||||
CV_Error_(cv::Error::StsInternal, \
|
CV_Error_(cv::Error::StsInternal, \
|
||||||
("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res));
|
("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res)); \
|
||||||
|
}
|
||||||
//! @endcond
|
//! @endcond
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -51,11 +51,6 @@ namespace cv
|
|||||||
|
|
||||||
typedef void (*MathFunc)(const void* src, void* dst, int len);
|
typedef void (*MathFunc)(const void* src, void* dst, int len);
|
||||||
|
|
||||||
static const float atan2_p1 = 0.9997878412794807f*(float)(180/CV_PI);
|
|
||||||
static const float atan2_p3 = -0.3258083974640975f*(float)(180/CV_PI);
|
|
||||||
static const float atan2_p5 = 0.1555786518463281f*(float)(180/CV_PI);
|
|
||||||
static const float atan2_p7 = -0.04432655554792128f*(float)(180/CV_PI);
|
|
||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
enum { OCL_OP_LOG=0, OCL_OP_EXP=1, OCL_OP_MAG=2, OCL_OP_PHASE_DEGREES=3, OCL_OP_PHASE_RADIANS=4 };
|
enum { OCL_OP_LOG=0, OCL_OP_EXP=1, OCL_OP_MAG=2, OCL_OP_PHASE_DEGREES=3, OCL_OP_PHASE_RADIANS=4 };
|
||||||
@ -100,29 +95,6 @@ static bool ocl_math_op(InputArray _src1, InputArray _src2, OutputArray _dst, in
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
float fastAtan2( float y, float x )
|
|
||||||
{
|
|
||||||
float ax = std::abs(x), ay = std::abs(y);
|
|
||||||
float a, c, c2;
|
|
||||||
if( ax >= ay )
|
|
||||||
{
|
|
||||||
c = ay/(ax + (float)DBL_EPSILON);
|
|
||||||
c2 = c*c;
|
|
||||||
a = (((atan2_p7*c2 + atan2_p5)*c2 + atan2_p3)*c2 + atan2_p1)*c;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
c = ax/(ay + (float)DBL_EPSILON);
|
|
||||||
c2 = c*c;
|
|
||||||
a = 90.f - (((atan2_p7*c2 + atan2_p5)*c2 + atan2_p3)*c2 + atan2_p1)*c;
|
|
||||||
}
|
|
||||||
if( x < 0 )
|
|
||||||
a = 180.f - a;
|
|
||||||
if( y < 0 )
|
|
||||||
a = 360.f - a;
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ************************************************************************** *\
|
/* ************************************************************************** *\
|
||||||
Fast cube root by Ken Turkowski
|
Fast cube root by Ken Turkowski
|
||||||
(http://www.worldserver.com/turk/computergraphics/papers.html)
|
(http://www.worldserver.com/turk/computergraphics/papers.html)
|
||||||
@ -202,7 +174,6 @@ void magnitude( InputArray src1, InputArray src2, OutputArray dst )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void phase( InputArray src1, InputArray src2, OutputArray dst, bool angleInDegrees )
|
void phase( InputArray src1, InputArray src2, OutputArray dst, bool angleInDegrees )
|
||||||
{
|
{
|
||||||
int type = src1.type(), depth = src1.depth(), cn = src1.channels();
|
int type = src1.type(), depth = src1.depth(), cn = src1.channels();
|
||||||
@ -218,19 +189,8 @@ void phase( InputArray src1, InputArray src2, OutputArray dst, bool angleInDegre
|
|||||||
const Mat* arrays[] = {&X, &Y, &Angle, 0};
|
const Mat* arrays[] = {&X, &Y, &Angle, 0};
|
||||||
uchar* ptrs[3];
|
uchar* ptrs[3];
|
||||||
NAryMatIterator it(arrays, ptrs);
|
NAryMatIterator it(arrays, ptrs);
|
||||||
cv::AutoBuffer<float> _buf;
|
int j, total = (int)(it.size*cn), blockSize = total;
|
||||||
float* buf[2] = {0, 0};
|
|
||||||
int j, k, total = (int)(it.size*cn), blockSize = total;
|
|
||||||
size_t esz1 = X.elemSize1();
|
size_t esz1 = X.elemSize1();
|
||||||
|
|
||||||
if( depth == CV_64F )
|
|
||||||
{
|
|
||||||
blockSize = std::min(blockSize, ((BLOCK_SIZE+cn-1)/cn)*cn);
|
|
||||||
_buf.allocate(blockSize*2);
|
|
||||||
buf[0] = _buf;
|
|
||||||
buf[1] = buf[0] + blockSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
for( size_t i = 0; i < it.nplanes; i++, ++it )
|
for( size_t i = 0; i < it.nplanes; i++, ++it )
|
||||||
{
|
{
|
||||||
for( j = 0; j < total; j += blockSize )
|
for( j = 0; j < total; j += blockSize )
|
||||||
@ -240,53 +200,13 @@ void phase( InputArray src1, InputArray src2, OutputArray dst, bool angleInDegre
|
|||||||
{
|
{
|
||||||
const float *x = (const float*)ptrs[0], *y = (const float*)ptrs[1];
|
const float *x = (const float*)ptrs[0], *y = (const float*)ptrs[1];
|
||||||
float *angle = (float*)ptrs[2];
|
float *angle = (float*)ptrs[2];
|
||||||
hal::fastAtan2( y, x, angle, len, angleInDegrees );
|
hal::fastAtan32f( y, x, angle, len, angleInDegrees );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const double *x = (const double*)ptrs[0], *y = (const double*)ptrs[1];
|
const double *x = (const double*)ptrs[0], *y = (const double*)ptrs[1];
|
||||||
double *angle = (double*)ptrs[2];
|
double *angle = (double*)ptrs[2];
|
||||||
k = 0;
|
hal::fastAtan64f(y, x, angle, len, angleInDegrees);
|
||||||
|
|
||||||
#if CV_SSE2
|
|
||||||
if (USE_SSE2)
|
|
||||||
{
|
|
||||||
for ( ; k <= len - 4; k += 4)
|
|
||||||
{
|
|
||||||
__m128 v_dst0 = _mm_movelh_ps(_mm_cvtpd_ps(_mm_loadu_pd(x + k)),
|
|
||||||
_mm_cvtpd_ps(_mm_loadu_pd(x + k + 2)));
|
|
||||||
__m128 v_dst1 = _mm_movelh_ps(_mm_cvtpd_ps(_mm_loadu_pd(y + k)),
|
|
||||||
_mm_cvtpd_ps(_mm_loadu_pd(y + k + 2)));
|
|
||||||
|
|
||||||
_mm_storeu_ps(buf[0] + k, v_dst0);
|
|
||||||
_mm_storeu_ps(buf[1] + k, v_dst1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for( ; k < len; k++ )
|
|
||||||
{
|
|
||||||
buf[0][k] = (float)x[k];
|
|
||||||
buf[1][k] = (float)y[k];
|
|
||||||
}
|
|
||||||
|
|
||||||
hal::fastAtan2( buf[1], buf[0], buf[0], len, angleInDegrees );
|
|
||||||
k = 0;
|
|
||||||
|
|
||||||
#if CV_SSE2
|
|
||||||
if (USE_SSE2)
|
|
||||||
{
|
|
||||||
for ( ; k <= len - 4; k += 4)
|
|
||||||
{
|
|
||||||
__m128 v_src = _mm_loadu_ps(buf[0] + k);
|
|
||||||
_mm_storeu_pd(angle + k, _mm_cvtps_pd(v_src));
|
|
||||||
_mm_storeu_pd(angle + k + 2, _mm_cvtps_pd(_mm_castsi128_ps(_mm_srli_si128(_mm_castps_si128(v_src), 8))));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for( ; k < len; k++ )
|
|
||||||
angle[k] = buf[0][k];
|
|
||||||
}
|
}
|
||||||
ptrs[0] += len*esz1;
|
ptrs[0] += len*esz1;
|
||||||
ptrs[1] += len*esz1;
|
ptrs[1] += len*esz1;
|
||||||
@ -353,18 +273,9 @@ void cartToPolar( InputArray src1, InputArray src2,
|
|||||||
const Mat* arrays[] = {&X, &Y, &Mag, &Angle, 0};
|
const Mat* arrays[] = {&X, &Y, &Mag, &Angle, 0};
|
||||||
uchar* ptrs[4];
|
uchar* ptrs[4];
|
||||||
NAryMatIterator it(arrays, ptrs);
|
NAryMatIterator it(arrays, ptrs);
|
||||||
cv::AutoBuffer<float> _buf;
|
int j, total = (int)(it.size*cn), blockSize = std::min(total, ((BLOCK_SIZE+cn-1)/cn)*cn);
|
||||||
float* buf[2] = {0, 0};
|
|
||||||
int j, k, total = (int)(it.size*cn), blockSize = std::min(total, ((BLOCK_SIZE+cn-1)/cn)*cn);
|
|
||||||
size_t esz1 = X.elemSize1();
|
size_t esz1 = X.elemSize1();
|
||||||
|
|
||||||
if( depth == CV_64F )
|
|
||||||
{
|
|
||||||
_buf.allocate(blockSize*2);
|
|
||||||
buf[0] = _buf;
|
|
||||||
buf[1] = buf[0] + blockSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
for( size_t i = 0; i < it.nplanes; i++, ++it )
|
for( size_t i = 0; i < it.nplanes; i++, ++it )
|
||||||
{
|
{
|
||||||
for( j = 0; j < total; j += blockSize )
|
for( j = 0; j < total; j += blockSize )
|
||||||
@ -375,55 +286,14 @@ void cartToPolar( InputArray src1, InputArray src2,
|
|||||||
const float *x = (const float*)ptrs[0], *y = (const float*)ptrs[1];
|
const float *x = (const float*)ptrs[0], *y = (const float*)ptrs[1];
|
||||||
float *mag = (float*)ptrs[2], *angle = (float*)ptrs[3];
|
float *mag = (float*)ptrs[2], *angle = (float*)ptrs[3];
|
||||||
hal::magnitude32f( x, y, mag, len );
|
hal::magnitude32f( x, y, mag, len );
|
||||||
hal::fastAtan2( y, x, angle, len, angleInDegrees );
|
hal::fastAtan32f( y, x, angle, len, angleInDegrees );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const double *x = (const double*)ptrs[0], *y = (const double*)ptrs[1];
|
const double *x = (const double*)ptrs[0], *y = (const double*)ptrs[1];
|
||||||
double *angle = (double*)ptrs[3];
|
double *angle = (double*)ptrs[3];
|
||||||
|
|
||||||
hal::magnitude64f(x, y, (double*)ptrs[2], len);
|
hal::magnitude64f(x, y, (double*)ptrs[2], len);
|
||||||
k = 0;
|
hal::fastAtan64f(y, x, angle, len, angleInDegrees);
|
||||||
|
|
||||||
#if CV_SSE2
|
|
||||||
if (USE_SSE2)
|
|
||||||
{
|
|
||||||
for ( ; k <= len - 4; k += 4)
|
|
||||||
{
|
|
||||||
__m128 v_dst0 = _mm_movelh_ps(_mm_cvtpd_ps(_mm_loadu_pd(x + k)),
|
|
||||||
_mm_cvtpd_ps(_mm_loadu_pd(x + k + 2)));
|
|
||||||
__m128 v_dst1 = _mm_movelh_ps(_mm_cvtpd_ps(_mm_loadu_pd(y + k)),
|
|
||||||
_mm_cvtpd_ps(_mm_loadu_pd(y + k + 2)));
|
|
||||||
|
|
||||||
_mm_storeu_ps(buf[0] + k, v_dst0);
|
|
||||||
_mm_storeu_ps(buf[1] + k, v_dst1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for( ; k < len; k++ )
|
|
||||||
{
|
|
||||||
buf[0][k] = (float)x[k];
|
|
||||||
buf[1][k] = (float)y[k];
|
|
||||||
}
|
|
||||||
|
|
||||||
hal::fastAtan2( buf[1], buf[0], buf[0], len, angleInDegrees );
|
|
||||||
k = 0;
|
|
||||||
|
|
||||||
#if CV_SSE2
|
|
||||||
if (USE_SSE2)
|
|
||||||
{
|
|
||||||
for ( ; k <= len - 4; k += 4)
|
|
||||||
{
|
|
||||||
__m128 v_src = _mm_loadu_ps(buf[0] + k);
|
|
||||||
_mm_storeu_pd(angle + k, _mm_cvtps_pd(v_src));
|
|
||||||
_mm_storeu_pd(angle + k + 2, _mm_cvtps_pd(_mm_castsi128_ps(_mm_srli_si128(_mm_castps_si128(v_src), 8))));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for( ; k < len; k++ )
|
|
||||||
angle[k] = buf[0][k];
|
|
||||||
}
|
}
|
||||||
ptrs[0] += len*esz1;
|
ptrs[0] += len*esz1;
|
||||||
ptrs[1] += len*esz1;
|
ptrs[1] += len*esz1;
|
||||||
|
@ -42,116 +42,188 @@
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
#undef HAVE_IPP
|
#undef HAVE_IPP
|
||||||
|
|
||||||
namespace cv { namespace hal {
|
namespace {
|
||||||
|
|
||||||
///////////////////////////////////// ATAN2 ////////////////////////////////////
|
|
||||||
static const float atan2_p1 = 0.9997878412794807f*(float)(180/CV_PI);
|
static const float atan2_p1 = 0.9997878412794807f*(float)(180/CV_PI);
|
||||||
static const float atan2_p3 = -0.3258083974640975f*(float)(180/CV_PI);
|
static const float atan2_p3 = -0.3258083974640975f*(float)(180/CV_PI);
|
||||||
static const float atan2_p5 = 0.1555786518463281f*(float)(180/CV_PI);
|
static const float atan2_p5 = 0.1555786518463281f*(float)(180/CV_PI);
|
||||||
static const float atan2_p7 = -0.04432655554792128f*(float)(180/CV_PI);
|
static const float atan2_p7 = -0.04432655554792128f*(float)(180/CV_PI);
|
||||||
|
|
||||||
void fastAtan2(const float *Y, const float *X, float *angle, int len, bool angleInDegrees )
|
using namespace cv;
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
float scale = angleInDegrees ? 1 : (float)(CV_PI/180);
|
|
||||||
|
|
||||||
#ifdef HAVE_TEGRA_OPTIMIZATION
|
#if CV_SIMD128
|
||||||
if (tegra::useTegra() && tegra::FastAtan2_32f(Y, X, angle, len, scale))
|
|
||||||
return;
|
template <typename T>
|
||||||
|
struct v_atan
|
||||||
|
{
|
||||||
|
typedef V_RegTrait128<T> Trait;
|
||||||
|
typedef typename Trait::reg VT; // vector type
|
||||||
|
enum { WorkWidth = VT::nlanes * 2 };
|
||||||
|
|
||||||
|
v_atan(const T & scale)
|
||||||
|
: s(Trait::all(scale))
|
||||||
|
{
|
||||||
|
eps = Trait::all(DBL_EPSILON);
|
||||||
|
z = Trait::zero();
|
||||||
|
p7 = Trait::all(atan2_p7);
|
||||||
|
p5 = Trait::all(atan2_p5);
|
||||||
|
p3 = Trait::all(atan2_p3);
|
||||||
|
p1 = Trait::all(atan2_p1);
|
||||||
|
val90 = Trait::all(90.f);
|
||||||
|
val180 = Trait::all(180.f);
|
||||||
|
val360 = Trait::all(360.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline int operator()(int len, const T * Y, const T * X, T * angle)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
const int c = VT::nlanes;
|
||||||
|
for ( ; i <= len - c * 2; i += c * 2)
|
||||||
|
{
|
||||||
|
VT x1 = v_load(X + i);
|
||||||
|
VT x2 = v_load(X + i + c);
|
||||||
|
VT y1 = v_load(Y + i);
|
||||||
|
VT y2 = v_load(Y + i + c);
|
||||||
|
v_store(&angle[i], s * one(x1, y1));
|
||||||
|
v_store(&angle[i + c], s * one(x2, y2));
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
inline VT one(VT & x, VT & y)
|
||||||
|
{
|
||||||
|
VT ax = v_abs(x);
|
||||||
|
VT ay = v_abs(y);
|
||||||
|
VT c = v_min(ax, ay) / (v_max(ax, ay) + eps);
|
||||||
|
VT cc = c * c;
|
||||||
|
VT a = (((p7 * cc + p5) * cc + p3) * cc + p1) * c;
|
||||||
|
a = v_select(ax >= ay, a, val90 - a);
|
||||||
|
a = v_select(x < z, val180 - a, a);
|
||||||
|
a = v_select(y < z, val360 - a, a);
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
VT eps;
|
||||||
|
VT z;
|
||||||
|
VT p7;
|
||||||
|
VT p5;
|
||||||
|
VT p3;
|
||||||
|
VT p1;
|
||||||
|
VT val90;
|
||||||
|
VT val180;
|
||||||
|
VT val360;
|
||||||
|
VT s;
|
||||||
|
};
|
||||||
|
|
||||||
|
#if !CV_SIMD128_64F
|
||||||
|
|
||||||
|
// emulation
|
||||||
|
template <>
|
||||||
|
struct v_atan<double>
|
||||||
|
{
|
||||||
|
v_atan(double scale) : impl(static_cast<float>(scale)) {}
|
||||||
|
inline int operator()(int len, const double * Y, const double * X, double * angle)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
const int c = v_atan<float>::WorkWidth;
|
||||||
|
float bufY[c];
|
||||||
|
float bufX[c];
|
||||||
|
float bufA[c];
|
||||||
|
for ( ; i <= len - c ; i += c)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < c; ++j)
|
||||||
|
{
|
||||||
|
bufY[j] = static_cast<float>(Y[i + j]);
|
||||||
|
bufX[j] = static_cast<float>(X[i + j]);
|
||||||
|
}
|
||||||
|
impl(c, bufY, bufX, bufA);
|
||||||
|
for (int j = 0; j < c; ++j)
|
||||||
|
{
|
||||||
|
angle[i + j] = bufA[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
v_atan<float> impl;
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CV_SSE2
|
#endif
|
||||||
Cv32suf iabsmask; iabsmask.i = 0x7fffffff;
|
|
||||||
__m128 eps = _mm_set1_ps((float)DBL_EPSILON), absmask = _mm_set1_ps(iabsmask.f);
|
|
||||||
__m128 _90 = _mm_set1_ps(90.f), _180 = _mm_set1_ps(180.f), _360 = _mm_set1_ps(360.f);
|
|
||||||
__m128 z = _mm_setzero_ps(), scale4 = _mm_set1_ps(scale);
|
|
||||||
__m128 p1 = _mm_set1_ps(atan2_p1), p3 = _mm_set1_ps(atan2_p3);
|
|
||||||
__m128 p5 = _mm_set1_ps(atan2_p5), p7 = _mm_set1_ps(atan2_p7);
|
|
||||||
|
|
||||||
for( ; i <= len - 4; i += 4 )
|
template <typename T>
|
||||||
|
static inline T atanImpl(T y, T x)
|
||||||
|
{
|
||||||
|
T ax = std::abs(x), ay = std::abs(y);
|
||||||
|
T a, c, c2;
|
||||||
|
if( ax >= ay )
|
||||||
{
|
{
|
||||||
__m128 x = _mm_loadu_ps(X + i), y = _mm_loadu_ps(Y + i);
|
c = ay/(ax + static_cast<T>(DBL_EPSILON));
|
||||||
__m128 ax = _mm_and_ps(x, absmask), ay = _mm_and_ps(y, absmask);
|
c2 = c*c;
|
||||||
__m128 mask = _mm_cmplt_ps(ax, ay);
|
a = (((atan2_p7*c2 + atan2_p5)*c2 + atan2_p3)*c2 + atan2_p1)*c;
|
||||||
__m128 tmin = _mm_min_ps(ax, ay), tmax = _mm_max_ps(ax, ay);
|
|
||||||
__m128 c = _mm_div_ps(tmin, _mm_add_ps(tmax, eps));
|
|
||||||
__m128 c2 = _mm_mul_ps(c, c);
|
|
||||||
__m128 a = _mm_mul_ps(c2, p7);
|
|
||||||
a = _mm_mul_ps(_mm_add_ps(a, p5), c2);
|
|
||||||
a = _mm_mul_ps(_mm_add_ps(a, p3), c2);
|
|
||||||
a = _mm_mul_ps(_mm_add_ps(a, p1), c);
|
|
||||||
|
|
||||||
__m128 b = _mm_sub_ps(_90, a);
|
|
||||||
a = _mm_xor_ps(a, _mm_and_ps(_mm_xor_ps(a, b), mask));
|
|
||||||
|
|
||||||
b = _mm_sub_ps(_180, a);
|
|
||||||
mask = _mm_cmplt_ps(x, z);
|
|
||||||
a = _mm_xor_ps(a, _mm_and_ps(_mm_xor_ps(a, b), mask));
|
|
||||||
|
|
||||||
b = _mm_sub_ps(_360, a);
|
|
||||||
mask = _mm_cmplt_ps(y, z);
|
|
||||||
a = _mm_xor_ps(a, _mm_and_ps(_mm_xor_ps(a, b), mask));
|
|
||||||
|
|
||||||
a = _mm_mul_ps(a, scale4);
|
|
||||||
_mm_storeu_ps(angle + i, a);
|
|
||||||
}
|
}
|
||||||
#elif CV_NEON
|
else
|
||||||
float32x4_t eps = vdupq_n_f32((float)DBL_EPSILON);
|
|
||||||
float32x4_t _90 = vdupq_n_f32(90.f), _180 = vdupq_n_f32(180.f), _360 = vdupq_n_f32(360.f);
|
|
||||||
float32x4_t z = vdupq_n_f32(0.0f), scale4 = vdupq_n_f32(scale);
|
|
||||||
float32x4_t p1 = vdupq_n_f32(atan2_p1), p3 = vdupq_n_f32(atan2_p3);
|
|
||||||
float32x4_t p5 = vdupq_n_f32(atan2_p5), p7 = vdupq_n_f32(atan2_p7);
|
|
||||||
|
|
||||||
for( ; i <= len - 4; i += 4 )
|
|
||||||
{
|
{
|
||||||
float32x4_t x = vld1q_f32(X + i), y = vld1q_f32(Y + i);
|
c = ax/(ay + static_cast<T>(DBL_EPSILON));
|
||||||
float32x4_t ax = vabsq_f32(x), ay = vabsq_f32(y);
|
c2 = c*c;
|
||||||
float32x4_t tmin = vminq_f32(ax, ay), tmax = vmaxq_f32(ax, ay);
|
a = 90.f - (((atan2_p7*c2 + atan2_p5)*c2 + atan2_p3)*c2 + atan2_p1)*c;
|
||||||
float32x4_t c = vmulq_f32(tmin, cv_vrecpq_f32(vaddq_f32(tmax, eps)));
|
|
||||||
float32x4_t c2 = vmulq_f32(c, c);
|
|
||||||
float32x4_t a = vmulq_f32(c2, p7);
|
|
||||||
a = vmulq_f32(vaddq_f32(a, p5), c2);
|
|
||||||
a = vmulq_f32(vaddq_f32(a, p3), c2);
|
|
||||||
a = vmulq_f32(vaddq_f32(a, p1), c);
|
|
||||||
|
|
||||||
a = vbslq_f32(vcgeq_f32(ax, ay), a, vsubq_f32(_90, a));
|
|
||||||
a = vbslq_f32(vcltq_f32(x, z), vsubq_f32(_180, a), a);
|
|
||||||
a = vbslq_f32(vcltq_f32(y, z), vsubq_f32(_360, a), a);
|
|
||||||
|
|
||||||
vst1q_f32(angle + i, vmulq_f32(a, scale4));
|
|
||||||
}
|
}
|
||||||
|
if( x < 0 )
|
||||||
|
a = 180.f - a;
|
||||||
|
if( y < 0 )
|
||||||
|
a = 360.f - a;
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
static inline void atanImpl(const T *Y, const T *X, T *angle, int len, bool angleInDegrees)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
T scale = angleInDegrees ? 1 : static_cast<T>(CV_PI/180);
|
||||||
|
|
||||||
|
#if CV_SIMD128
|
||||||
|
i = v_atan<T>(scale)(len, Y, X, angle);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for( ; i < len; i++ )
|
for( ; i < len; i++ )
|
||||||
{
|
{
|
||||||
float x = X[i], y = Y[i];
|
angle[i] = atanImpl<T>(Y[i], X[i]) * scale;
|
||||||
float ax = std::abs(x), ay = std::abs(y);
|
|
||||||
float a, c, c2;
|
|
||||||
if( ax >= ay )
|
|
||||||
{
|
|
||||||
c = ay/(ax + (float)DBL_EPSILON);
|
|
||||||
c2 = c*c;
|
|
||||||
a = (((atan2_p7*c2 + atan2_p5)*c2 + atan2_p3)*c2 + atan2_p1)*c;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
c = ax/(ay + (float)DBL_EPSILON);
|
|
||||||
c2 = c*c;
|
|
||||||
a = 90.f - (((atan2_p7*c2 + atan2_p5)*c2 + atan2_p3)*c2 + atan2_p1)*c;
|
|
||||||
}
|
|
||||||
if( x < 0 )
|
|
||||||
a = 180.f - a;
|
|
||||||
if( y < 0 )
|
|
||||||
a = 360.f - a;
|
|
||||||
angle[i] = (float)(a*scale);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // anonymous::
|
||||||
|
|
||||||
|
namespace cv { namespace hal {
|
||||||
|
|
||||||
|
///////////////////////////////////// ATAN2 ////////////////////////////////////
|
||||||
|
|
||||||
|
void fastAtan32f(const float *Y, const float *X, float *angle, int len, bool angleInDegrees )
|
||||||
|
{
|
||||||
|
CALL_HAL(fastAtan32f, cv_hal_fastAtan32f, Y, X, angle, len, angleInDegrees);
|
||||||
|
atanImpl<float>(Y, X, angle, len, angleInDegrees);
|
||||||
|
}
|
||||||
|
|
||||||
|
void fastAtan64f(const double *Y, const double *X, double *angle, int len, bool angleInDegrees)
|
||||||
|
{
|
||||||
|
CALL_HAL(fastAtan64f, cv_hal_fastAtan64f, Y, X, angle, len, angleInDegrees);
|
||||||
|
atanImpl<double>(Y, X, angle, len, angleInDegrees);
|
||||||
|
}
|
||||||
|
|
||||||
|
// deprecated
|
||||||
|
void fastAtan2(const float *Y, const float *X, float *angle, int len, bool angleInDegrees )
|
||||||
|
{
|
||||||
|
fastAtan32f(Y, X, angle, len, angleInDegrees);
|
||||||
|
}
|
||||||
|
|
||||||
void magnitude32f(const float* x, const float* y, float* mag, int len)
|
void magnitude32f(const float* x, const float* y, float* mag, int len)
|
||||||
{
|
{
|
||||||
|
CALL_HAL(magnitude32f, cv_hal_magnitude32f, x, y, mag, len);
|
||||||
#if defined HAVE_IPP
|
#if defined HAVE_IPP
|
||||||
CV_IPP_CHECK()
|
CV_IPP_CHECK()
|
||||||
{
|
{
|
||||||
@ -188,6 +260,7 @@ void magnitude32f(const float* x, const float* y, float* mag, int len)
|
|||||||
|
|
||||||
void magnitude64f(const double* x, const double* y, double* mag, int len)
|
void magnitude64f(const double* x, const double* y, double* mag, int len)
|
||||||
{
|
{
|
||||||
|
CALL_HAL(magnitude64f, cv_hal_magnitude64f, x, y, mag, len);
|
||||||
#if defined(HAVE_IPP)
|
#if defined(HAVE_IPP)
|
||||||
CV_IPP_CHECK()
|
CV_IPP_CHECK()
|
||||||
{
|
{
|
||||||
@ -225,6 +298,7 @@ void magnitude64f(const double* x, const double* y, double* mag, int len)
|
|||||||
|
|
||||||
void invSqrt32f(const float* src, float* dst, int len)
|
void invSqrt32f(const float* src, float* dst, int len)
|
||||||
{
|
{
|
||||||
|
CALL_HAL(invSqrt32f, cv_hal_invSqrt32f, src, dst, len);
|
||||||
#if defined(HAVE_IPP)
|
#if defined(HAVE_IPP)
|
||||||
CV_IPP_CHECK()
|
CV_IPP_CHECK()
|
||||||
{
|
{
|
||||||
@ -256,6 +330,7 @@ void invSqrt32f(const float* src, float* dst, int len)
|
|||||||
|
|
||||||
void invSqrt64f(const double* src, double* dst, int len)
|
void invSqrt64f(const double* src, double* dst, int len)
|
||||||
{
|
{
|
||||||
|
CALL_HAL(invSqrt64f, cv_hal_invSqrt64f, src, dst, len);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
#if CV_SSE2
|
#if CV_SSE2
|
||||||
@ -271,6 +346,7 @@ void invSqrt64f(const double* src, double* dst, int len)
|
|||||||
|
|
||||||
void sqrt32f(const float* src, float* dst, int len)
|
void sqrt32f(const float* src, float* dst, int len)
|
||||||
{
|
{
|
||||||
|
CALL_HAL(sqrt32f, cv_hal_sqrt32f, src, dst, len);
|
||||||
#if defined(HAVE_IPP)
|
#if defined(HAVE_IPP)
|
||||||
CV_IPP_CHECK()
|
CV_IPP_CHECK()
|
||||||
{
|
{
|
||||||
@ -302,6 +378,7 @@ void sqrt32f(const float* src, float* dst, int len)
|
|||||||
|
|
||||||
void sqrt64f(const double* src, double* dst, int len)
|
void sqrt64f(const double* src, double* dst, int len)
|
||||||
{
|
{
|
||||||
|
CALL_HAL(sqrt64f, cv_hal_sqrt64f, src, dst, len);
|
||||||
#if defined(HAVE_IPP)
|
#if defined(HAVE_IPP)
|
||||||
CV_IPP_CHECK()
|
CV_IPP_CHECK()
|
||||||
{
|
{
|
||||||
@ -433,6 +510,7 @@ static const double exp_max_val = 3000.*(1 << EXPTAB_SCALE); // log10(DBL_MAX) <
|
|||||||
|
|
||||||
void exp32f( const float *_x, float *y, int n )
|
void exp32f( const float *_x, float *y, int n )
|
||||||
{
|
{
|
||||||
|
CALL_HAL(exp32f, cv_hal_exp32f, _x, y, n);
|
||||||
static const float
|
static const float
|
||||||
A4 = (float)(1.000000000000002438532970795181890933776 / EXPPOLY_32F_A0),
|
A4 = (float)(1.000000000000002438532970795181890933776 / EXPPOLY_32F_A0),
|
||||||
A3 = (float)(.6931471805521448196800669615864773144641 / EXPPOLY_32F_A0),
|
A3 = (float)(.6931471805521448196800669615864773144641 / EXPPOLY_32F_A0),
|
||||||
@ -632,6 +710,7 @@ void exp32f( const float *_x, float *y, int n )
|
|||||||
|
|
||||||
void exp64f( const double *_x, double *y, int n )
|
void exp64f( const double *_x, double *y, int n )
|
||||||
{
|
{
|
||||||
|
CALL_HAL(exp64f, cv_hal_exp64f, _x, y, n);
|
||||||
static const double
|
static const double
|
||||||
A5 = .99999999999999999998285227504999 / EXPPOLY_32F_A0,
|
A5 = .99999999999999999998285227504999 / EXPPOLY_32F_A0,
|
||||||
A4 = .69314718055994546743029643825322 / EXPPOLY_32F_A0,
|
A4 = .69314718055994546743029643825322 / EXPPOLY_32F_A0,
|
||||||
@ -1076,6 +1155,7 @@ static const double ln_2 = 0.69314718055994530941723212145818;
|
|||||||
|
|
||||||
void log32f( const float *_x, float *y, int n )
|
void log32f( const float *_x, float *y, int n )
|
||||||
{
|
{
|
||||||
|
CALL_HAL(log32f, cv_hal_log32f, _x, y, n);
|
||||||
static const float shift[] = { 0, -1.f/512 };
|
static const float shift[] = { 0, -1.f/512 };
|
||||||
static const float
|
static const float
|
||||||
A0 = 0.3333333333333333333333333f,
|
A0 = 0.3333333333333333333333333f,
|
||||||
@ -1220,6 +1300,7 @@ void log32f( const float *_x, float *y, int n )
|
|||||||
|
|
||||||
void log64f( const double *x, double *y, int n )
|
void log64f( const double *x, double *y, int n )
|
||||||
{
|
{
|
||||||
|
CALL_HAL(log64f, cv_hal_log64f, x, y, n);
|
||||||
static const double shift[] = { 0, -1./512 };
|
static const double shift[] = { 0, -1./512 };
|
||||||
static const double
|
static const double
|
||||||
A7 = 1.0,
|
A7 = 1.0,
|
||||||
@ -1457,4 +1538,10 @@ void invSqrt(const double* src, double* dst, int len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}} // cv::hal::
|
} // cv::hal::
|
||||||
|
} // cv::
|
||||||
|
|
||||||
|
float cv::fastAtan2( float y, float x )
|
||||||
|
{
|
||||||
|
return atanImpl<float>(y, x);
|
||||||
|
}
|
||||||
|
@ -2718,19 +2718,25 @@ static bool ipp_norm(Mat &src, int normType, Mat &mask, double &result)
|
|||||||
ippiMaskNormFuncC3 ippFuncC3 =
|
ippiMaskNormFuncC3 ippFuncC3 =
|
||||||
normType == NORM_INF ?
|
normType == NORM_INF ?
|
||||||
(type == CV_8UC3 ? (ippiMaskNormFuncC3)ippiNorm_Inf_8u_C3CMR :
|
(type == CV_8UC3 ? (ippiMaskNormFuncC3)ippiNorm_Inf_8u_C3CMR :
|
||||||
|
#if IPP_VERSION_X100 < 900
|
||||||
type == CV_8SC3 ? (ippiMaskNormFuncC3)ippiNorm_Inf_8s_C3CMR :
|
type == CV_8SC3 ? (ippiMaskNormFuncC3)ippiNorm_Inf_8s_C3CMR :
|
||||||
|
#endif
|
||||||
type == CV_16UC3 ? (ippiMaskNormFuncC3)ippiNorm_Inf_16u_C3CMR :
|
type == CV_16UC3 ? (ippiMaskNormFuncC3)ippiNorm_Inf_16u_C3CMR :
|
||||||
type == CV_32FC3 ? (ippiMaskNormFuncC3)ippiNorm_Inf_32f_C3CMR :
|
type == CV_32FC3 ? (ippiMaskNormFuncC3)ippiNorm_Inf_32f_C3CMR :
|
||||||
0) :
|
0) :
|
||||||
normType == NORM_L1 ?
|
normType == NORM_L1 ?
|
||||||
(type == CV_8UC3 ? (ippiMaskNormFuncC3)ippiNorm_L1_8u_C3CMR :
|
(type == CV_8UC3 ? (ippiMaskNormFuncC3)ippiNorm_L1_8u_C3CMR :
|
||||||
|
#if IPP_VERSION_X100 < 900
|
||||||
type == CV_8SC3 ? (ippiMaskNormFuncC3)ippiNorm_L1_8s_C3CMR :
|
type == CV_8SC3 ? (ippiMaskNormFuncC3)ippiNorm_L1_8s_C3CMR :
|
||||||
|
#endif
|
||||||
type == CV_16UC3 ? (ippiMaskNormFuncC3)ippiNorm_L1_16u_C3CMR :
|
type == CV_16UC3 ? (ippiMaskNormFuncC3)ippiNorm_L1_16u_C3CMR :
|
||||||
type == CV_32FC3 ? (ippiMaskNormFuncC3)ippiNorm_L1_32f_C3CMR :
|
type == CV_32FC3 ? (ippiMaskNormFuncC3)ippiNorm_L1_32f_C3CMR :
|
||||||
0) :
|
0) :
|
||||||
normType == NORM_L2 || normType == NORM_L2SQR ?
|
normType == NORM_L2 || normType == NORM_L2SQR ?
|
||||||
(type == CV_8UC3 ? (ippiMaskNormFuncC3)ippiNorm_L2_8u_C3CMR :
|
(type == CV_8UC3 ? (ippiMaskNormFuncC3)ippiNorm_L2_8u_C3CMR :
|
||||||
|
#if IPP_VERSION_X100 < 900
|
||||||
type == CV_8SC3 ? (ippiMaskNormFuncC3)ippiNorm_L2_8s_C3CMR :
|
type == CV_8SC3 ? (ippiMaskNormFuncC3)ippiNorm_L2_8s_C3CMR :
|
||||||
|
#endif
|
||||||
type == CV_16UC3 ? (ippiMaskNormFuncC3)ippiNorm_L2_16u_C3CMR :
|
type == CV_16UC3 ? (ippiMaskNormFuncC3)ippiNorm_L2_16u_C3CMR :
|
||||||
type == CV_32FC3 ? (ippiMaskNormFuncC3)ippiNorm_L2_32f_C3CMR :
|
type == CV_32FC3 ? (ippiMaskNormFuncC3)ippiNorm_L2_32f_C3CMR :
|
||||||
0) : 0;
|
0) : 0;
|
||||||
|
@ -69,8 +69,8 @@ template<typename R> struct TheTest
|
|||||||
EXPECT_EQ(d, res);
|
EXPECT_EQ(d, res);
|
||||||
|
|
||||||
// zero, all
|
// zero, all
|
||||||
Data<R> resZ = RegTrait<R>::zero();
|
Data<R> resZ = V_RegTrait128<LaneType>::zero();
|
||||||
Data<R> resV = RegTrait<R>::all(8);
|
Data<R> resV = V_RegTrait128<LaneType>::all(8);
|
||||||
for (int i = 0; i < R::nlanes; ++i)
|
for (int i = 0; i < R::nlanes; ++i)
|
||||||
{
|
{
|
||||||
EXPECT_EQ((LaneType)0, resZ[i]);
|
EXPECT_EQ((LaneType)0, resZ[i]);
|
||||||
@ -135,7 +135,7 @@ template<typename R> struct TheTest
|
|||||||
// v_expand and v_load_expand
|
// v_expand and v_load_expand
|
||||||
TheTest & test_expand()
|
TheTest & test_expand()
|
||||||
{
|
{
|
||||||
typedef typename RegTrait<R>::w_reg Rx2;
|
typedef typename V_RegTrait128<LaneType>::w_reg Rx2;
|
||||||
Data<R> dataA;
|
Data<R> dataA;
|
||||||
R a = dataA;
|
R a = dataA;
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ template<typename R> struct TheTest
|
|||||||
|
|
||||||
TheTest & test_expand_q()
|
TheTest & test_expand_q()
|
||||||
{
|
{
|
||||||
typedef typename RegTrait<R>::q_reg Rx4;
|
typedef typename V_RegTrait128<LaneType>::q_reg Rx4;
|
||||||
Data<R> data;
|
Data<R> data;
|
||||||
Data<Rx4> out = v_load_expand_q(data.d);
|
Data<Rx4> out = v_load_expand_q(data.d);
|
||||||
const int n = Rx4::nlanes;
|
const int n = Rx4::nlanes;
|
||||||
@ -232,7 +232,7 @@ template<typename R> struct TheTest
|
|||||||
|
|
||||||
TheTest & test_mul_expand()
|
TheTest & test_mul_expand()
|
||||||
{
|
{
|
||||||
typedef typename RegTrait<R>::w_reg Rx2;
|
typedef typename V_RegTrait128<LaneType>::w_reg Rx2;
|
||||||
Data<R> dataA, dataB(2);
|
Data<R> dataA, dataB(2);
|
||||||
R a = dataA, b = dataB;
|
R a = dataA, b = dataB;
|
||||||
Rx2 c, d;
|
Rx2 c, d;
|
||||||
@ -295,7 +295,7 @@ template<typename R> struct TheTest
|
|||||||
|
|
||||||
TheTest & test_dot_prod()
|
TheTest & test_dot_prod()
|
||||||
{
|
{
|
||||||
typedef typename RegTrait<R>::w_reg Rx2;
|
typedef typename V_RegTrait128<LaneType>::w_reg Rx2;
|
||||||
Data<R> dataA, dataB(2);
|
Data<R> dataA, dataB(2);
|
||||||
R a = dataA, b = dataB;
|
R a = dataA, b = dataB;
|
||||||
|
|
||||||
@ -361,7 +361,7 @@ template<typename R> struct TheTest
|
|||||||
|
|
||||||
TheTest & test_absdiff()
|
TheTest & test_absdiff()
|
||||||
{
|
{
|
||||||
typedef typename RegTrait<R>::u_reg Ru;
|
typedef typename V_RegTrait128<LaneType>::u_reg Ru;
|
||||||
typedef typename Ru::lane_type u_type;
|
typedef typename Ru::lane_type u_type;
|
||||||
Data<R> dataA(std::numeric_limits<LaneType>::max()),
|
Data<R> dataA(std::numeric_limits<LaneType>::max()),
|
||||||
dataB(std::numeric_limits<LaneType>::min());
|
dataB(std::numeric_limits<LaneType>::min());
|
||||||
@ -445,7 +445,7 @@ template<typename R> struct TheTest
|
|||||||
template <int s>
|
template <int s>
|
||||||
TheTest & test_pack()
|
TheTest & test_pack()
|
||||||
{
|
{
|
||||||
typedef typename RegTrait<R>::w_reg Rx2;
|
typedef typename V_RegTrait128<LaneType>::w_reg Rx2;
|
||||||
typedef typename Rx2::lane_type w_type;
|
typedef typename Rx2::lane_type w_type;
|
||||||
Data<Rx2> dataA, dataB;
|
Data<Rx2> dataA, dataB;
|
||||||
dataA += std::numeric_limits<LaneType>::is_signed ? -10 : 10;
|
dataA += std::numeric_limits<LaneType>::is_signed ? -10 : 10;
|
||||||
@ -480,8 +480,8 @@ template<typename R> struct TheTest
|
|||||||
template <int s>
|
template <int s>
|
||||||
TheTest & test_pack_u()
|
TheTest & test_pack_u()
|
||||||
{
|
{
|
||||||
typedef typename RegTrait<R>::w_reg Rx2;
|
typedef typename V_TypeTraits<LaneType>::w_type LaneType_w;
|
||||||
typedef typename RegTrait<Rx2>::int_reg Ri2;
|
typedef typename V_RegTrait128<LaneType_w>::int_reg Ri2;
|
||||||
typedef typename Ri2::lane_type w_type;
|
typedef typename Ri2::lane_type w_type;
|
||||||
|
|
||||||
Data<Ri2> dataA, dataB;
|
Data<Ri2> dataA, dataB;
|
||||||
@ -572,7 +572,7 @@ template<typename R> struct TheTest
|
|||||||
|
|
||||||
TheTest & test_float_math()
|
TheTest & test_float_math()
|
||||||
{
|
{
|
||||||
typedef typename RegTrait<R>::int_reg Ri;
|
typedef typename V_RegTrait128<LaneType>::int_reg Ri;
|
||||||
Data<R> data1, data2, data3;
|
Data<R> data1, data2, data3;
|
||||||
data1 *= 1.1;
|
data1 *= 1.1;
|
||||||
data2 += 10;
|
data2 += 10;
|
||||||
|
@ -155,80 +155,4 @@ template <typename R> std::ostream & operator<<(std::ostream & out, const Data<R
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==================================================================================================
|
|
||||||
|
|
||||||
template <typename R> struct RegTrait;
|
|
||||||
|
|
||||||
template <> struct RegTrait<cv::v_uint8x16> {
|
|
||||||
typedef cv::v_uint16x8 w_reg;
|
|
||||||
typedef cv::v_uint32x4 q_reg;
|
|
||||||
typedef cv::v_uint8x16 u_reg;
|
|
||||||
static cv::v_uint8x16 zero() { return cv::v_setzero_u8(); }
|
|
||||||
static cv::v_uint8x16 all(uchar val) { return cv::v_setall_u8(val); }
|
|
||||||
};
|
|
||||||
template <> struct RegTrait<cv::v_int8x16> {
|
|
||||||
typedef cv::v_int16x8 w_reg;
|
|
||||||
typedef cv::v_int32x4 q_reg;
|
|
||||||
typedef cv::v_uint8x16 u_reg;
|
|
||||||
static cv::v_int8x16 zero() { return cv::v_setzero_s8(); }
|
|
||||||
static cv::v_int8x16 all(schar val) { return cv::v_setall_s8(val); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <> struct RegTrait<cv::v_uint16x8> {
|
|
||||||
typedef cv::v_uint32x4 w_reg;
|
|
||||||
typedef cv::v_int16x8 int_reg;
|
|
||||||
typedef cv::v_uint16x8 u_reg;
|
|
||||||
static cv::v_uint16x8 zero() { return cv::v_setzero_u16(); }
|
|
||||||
static cv::v_uint16x8 all(ushort val) { return cv::v_setall_u16(val); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <> struct RegTrait<cv::v_int16x8> {
|
|
||||||
typedef cv::v_int32x4 w_reg;
|
|
||||||
typedef cv::v_uint16x8 u_reg;
|
|
||||||
static cv::v_int16x8 zero() { return cv::v_setzero_s16(); }
|
|
||||||
static cv::v_int16x8 all(short val) { return cv::v_setall_s16(val); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <> struct RegTrait<cv::v_uint32x4> {
|
|
||||||
typedef cv::v_uint64x2 w_reg;
|
|
||||||
typedef cv::v_int32x4 int_reg;
|
|
||||||
typedef cv::v_uint32x4 u_reg;
|
|
||||||
static cv::v_uint32x4 zero() { return cv::v_setzero_u32(); }
|
|
||||||
static cv::v_uint32x4 all(unsigned val) { return cv::v_setall_u32(val); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <> struct RegTrait<cv::v_int32x4> {
|
|
||||||
typedef cv::v_int64x2 w_reg;
|
|
||||||
typedef cv::v_uint32x4 u_reg;
|
|
||||||
static cv::v_int32x4 zero() { return cv::v_setzero_s32(); }
|
|
||||||
static cv::v_int32x4 all(int val) { return cv::v_setall_s32(val); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <> struct RegTrait<cv::v_uint64x2> {
|
|
||||||
static cv::v_uint64x2 zero() { return cv::v_setzero_u64(); }
|
|
||||||
static cv::v_uint64x2 all(uint64 val) { return cv::v_setall_u64(val); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <> struct RegTrait<cv::v_int64x2> {
|
|
||||||
static cv::v_int64x2 zero() { return cv::v_setzero_s64(); }
|
|
||||||
static cv::v_int64x2 all(int64 val) { return cv::v_setall_s64(val); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <> struct RegTrait<cv::v_float32x4> {
|
|
||||||
typedef cv::v_int32x4 int_reg;
|
|
||||||
typedef cv::v_float32x4 u_reg;
|
|
||||||
static cv::v_float32x4 zero() { return cv::v_setzero_f32(); }
|
|
||||||
static cv::v_float32x4 all(float val) { return cv::v_setall_f32(val); }
|
|
||||||
};
|
|
||||||
|
|
||||||
#if CV_SIMD128_64F
|
|
||||||
template <> struct RegTrait<cv::v_float64x2> {
|
|
||||||
typedef cv::v_int32x4 int_reg;
|
|
||||||
typedef cv::v_float64x2 u_reg;
|
|
||||||
static cv::v_float64x2 zero() { return cv::v_setzero_f64(); }
|
|
||||||
static cv::v_float64x2 all(double val) { return cv::v_setall_f64(val); }
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -2411,8 +2411,9 @@ TEST(Core_SolvePoly, regression_5599)
|
|||||||
|
|
||||||
class Core_PhaseTest : public cvtest::BaseTest
|
class Core_PhaseTest : public cvtest::BaseTest
|
||||||
{
|
{
|
||||||
|
int t;
|
||||||
public:
|
public:
|
||||||
Core_PhaseTest() {}
|
Core_PhaseTest(int t_) : t(t_) {}
|
||||||
~Core_PhaseTest() {}
|
~Core_PhaseTest() {}
|
||||||
protected:
|
protected:
|
||||||
virtual void run(int)
|
virtual void run(int)
|
||||||
@ -2421,9 +2422,9 @@ protected:
|
|||||||
const int axisCount = 8;
|
const int axisCount = 8;
|
||||||
const int dim = theRNG().uniform(1,10);
|
const int dim = theRNG().uniform(1,10);
|
||||||
const float scale = theRNG().uniform(1.f, 100.f);
|
const float scale = theRNG().uniform(1.f, 100.f);
|
||||||
Mat x(axisCount + 1, dim, CV_32FC1),
|
Mat x(axisCount + 1, dim, t),
|
||||||
y(axisCount + 1, dim, CV_32FC1);
|
y(axisCount + 1, dim, t);
|
||||||
Mat anglesInDegrees(axisCount + 1, dim, CV_32FC1);
|
Mat anglesInDegrees(axisCount + 1, dim, t);
|
||||||
|
|
||||||
// fill the data
|
// fill the data
|
||||||
x.row(0).setTo(Scalar(0));
|
x.row(0).setTo(Scalar(0));
|
||||||
@ -2696,8 +2697,8 @@ TEST(Core_SVD, accuracy) { Core_SVDTest test; test.safe_run(); }
|
|||||||
TEST(Core_SVBkSb, accuracy) { Core_SVBkSbTest test; test.safe_run(); }
|
TEST(Core_SVBkSb, accuracy) { Core_SVBkSbTest test; test.safe_run(); }
|
||||||
TEST(Core_Trace, accuracy) { Core_TraceTest test; test.safe_run(); }
|
TEST(Core_Trace, accuracy) { Core_TraceTest test; test.safe_run(); }
|
||||||
TEST(Core_SolvePoly, accuracy) { Core_SolvePolyTest test; test.safe_run(); }
|
TEST(Core_SolvePoly, accuracy) { Core_SolvePolyTest test; test.safe_run(); }
|
||||||
TEST(Core_Phase, accuracy) { Core_PhaseTest test; test.safe_run(); }
|
TEST(Core_Phase, accuracy32f) { Core_PhaseTest test(CV_32FC1); test.safe_run(); }
|
||||||
|
TEST(Core_Phase, accuracy64f) { Core_PhaseTest test(CV_64FC1); test.safe_run(); }
|
||||||
|
|
||||||
TEST(Core_SVD, flt)
|
TEST(Core_SVD, flt)
|
||||||
{
|
{
|
||||||
|
@ -812,7 +812,7 @@ void AKAZEFeatures::Compute_Main_Orientation(KeyPoint& kpt, const std::vector<TE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hal::fastAtan2(resY, resX, Ang, ang_size, false);
|
hal::fastAtan32f(resY, resX, Ang, ang_size, false);
|
||||||
// Loop slides pi/3 window around feature point
|
// Loop slides pi/3 window around feature point
|
||||||
for (ang1 = 0; ang1 < (float)(2.0 * CV_PI); ang1 += 0.15f) {
|
for (ang1 = 0; ang1 < (float)(2.0 * CV_PI); ang1 += 0.15f) {
|
||||||
ang2 = (ang1 + (float)(CV_PI / 3.0) >(float)(2.0*CV_PI) ? ang1 - (float)(5.0*CV_PI / 3.0) : ang1 + (float)(CV_PI / 3.0));
|
ang2 = (ang1 + (float)(CV_PI / 3.0) >(float)(2.0*CV_PI) ? ang1 - (float)(5.0*CV_PI / 3.0) : ang1 + (float)(CV_PI / 3.0));
|
||||||
|
@ -75,6 +75,108 @@ CV_EXPORTS void warpPerspectve(int src_type,
|
|||||||
uchar * dst_data, size_t dst_step, int dst_width, int dst_height,
|
uchar * dst_data, size_t dst_step, int dst_width, int dst_height,
|
||||||
const double M[9], int interpolation, int borderType, const double borderValue[4]);
|
const double M[9], int interpolation, int borderType, const double borderValue[4]);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtBGRtoBGR(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int depth, int scn, int dcn, bool swapBlue);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtBGRtoBGR5x5(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int scn, bool swapBlue, int greenBits);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtBGR5x5toBGR(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int dcn, bool swapBlue, int greenBits);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtBGRtoGray(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int depth, int scn, bool swapBlue);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtGraytoBGR(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int depth, int dcn);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtBGR5x5toGray(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int greenBits);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtGraytoBGR5x5(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int greenBits);
|
||||||
|
CV_EXPORTS void cvtBGRtoYUV(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int depth, int scn, bool swapBlue, bool isCbCr);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtYUVtoBGR(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int depth, int dcn, bool swapBlue, bool isCbCr);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtBGRtoXYZ(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int depth, int scn, bool swapBlue);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtXYZtoBGR(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int depth, int dcn, bool swapBlue);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtBGRtoHSV(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int depth, int scn, bool swapBlue, bool isFullRange, bool isHSV);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtHSVtoBGR(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int depth, int dcn, bool swapBlue, bool isFullRange, bool isHSV);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtBGRtoLab(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int depth, int scn, bool swapBlue, bool isLab, bool srgb);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtLabtoBGR(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int depth, int dcn, bool swapBlue, bool isLab, bool srgb);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtTwoPlaneYUVtoBGR(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
int dcn, bool swapBlue, int uIdx);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtThreePlaneYUVtoBGR(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int dst_width, int dst_height,
|
||||||
|
int dcn, bool swapBlue, int uIdx);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtBGRtoThreePlaneYUV(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int scn, bool swapBlue, int uIdx);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtOnePlaneYUVtoBGR(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height,
|
||||||
|
int dcn, bool swapBlue, int uIdx, int ycn);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtRGBAtoMultipliedRGBA(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
|
CV_EXPORTS void cvtMultipliedRGBAtoRGBA(const uchar * src_data, size_t src_step,
|
||||||
|
uchar * dst_data, size_t dst_step,
|
||||||
|
int width, int height);
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -46,6 +46,7 @@
|
|||||||
#define OPENCV_IMGPROC_HAL_REPLACEMENT_HPP
|
#define OPENCV_IMGPROC_HAL_REPLACEMENT_HPP
|
||||||
|
|
||||||
#include "opencv2/core/hal/interface.h"
|
#include "opencv2/core/hal/interface.h"
|
||||||
|
#include "opencv2/imgproc/hal/interface.h"
|
||||||
|
|
||||||
#if defined __GNUC__
|
#if defined __GNUC__
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
@ -298,6 +299,294 @@ inline int hal_ni_warpPerspectve(int src_type, const uchar *src_data, size_t src
|
|||||||
#define cv_hal_warpPerspective hal_ni_warpPerspectve
|
#define cv_hal_warpPerspective hal_ni_warpPerspectve
|
||||||
//! @endcond
|
//! @endcond
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtBGRtoBGR
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param depth image depth (one of CV_8U, CV_16U, CV_32F)
|
||||||
|
@param scn source image channels (3 or 4)
|
||||||
|
@param dcn destination image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R channels will be swapped (BGR->RGB or RGB->BGR)
|
||||||
|
Convert between BGR, BGRA, RGB and RGBA image formats.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtBGRtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int scn, int dcn, bool swapBlue) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtBGRtoBGR5x5
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param scn source image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)
|
||||||
|
@param greenBits number of bits for green channel (5 or 6)
|
||||||
|
Convert from BGR, BGRA, RGB and RGBA to packed BGR or RGB (16 bits per pixel, 555 or 565).
|
||||||
|
Support only CV_8U images (input 3 or 4 channels, output 2 channels).
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtBGRtoBGR5x5(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int scn, bool swapBlue, int greenBits) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtBGR5x5toBGR
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param dcn destination image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R destination channels will be swapped (write RGB)
|
||||||
|
@param greenBits number of bits for green channel (5 or 6)
|
||||||
|
Convert from packed BGR or RGB (16 bits per pixel, 555 or 565) to BGR, BGRA, RGB and RGBA.
|
||||||
|
Support only CV_8U images (input 2 channels, output 3 or 4 channels).
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtBGR5x5toBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int dcn, bool swapBlue, int greenBits) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtBGRtoGray
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param depth image depth (one of CV_8U, CV_16U or CV_32F)
|
||||||
|
@param scn source image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)
|
||||||
|
Convert from BGR, BGRA, RGB or RGBA to 1-channel gray.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtBGRtoGray(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int scn, bool swapBlue) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtGraytoBGR
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param depth image depth (one of CV_8U, CV_16U or CV_32F)
|
||||||
|
@param dcn destination image channels (3 or 4)
|
||||||
|
Convert from 1-channel gray to BGR, RGB, RGBA or BGRA.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtGraytoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int dcn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtBGR5x5toGray
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param greenBits number of bits for green channel (5 or 6)
|
||||||
|
Convert from packed BGR (16 bits per pixel, 555 or 565) to 1-channel gray.
|
||||||
|
Support only CV_8U images.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtBGR5x5toGray(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int greenBits) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtGraytoBGR5x5
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param greenBits number of bits for green channel (5 or 6)
|
||||||
|
Convert from 1-channel gray to packed BGR (16 bits per pixel, 555 or 565).
|
||||||
|
Support only CV_8U images.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtGraytoBGR5x5(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int greenBits) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtBGRtoYUV
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param depth image depth (one of CV_8U, CV_16U or CV_32F)
|
||||||
|
@param scn source image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)
|
||||||
|
@param isCbCr if set to true write output in YCbCr format
|
||||||
|
Convert from BGR, RGB, BGRA or RGBA to YUV or YCbCr.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtBGRtoYUV(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int scn, bool swapBlue, bool isCbCr) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtYUVtoBGR
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param depth image depth (one of CV_8U, CV_16U or CV_32F)
|
||||||
|
@param dcn destination image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R destination channels will be swapped (write RGB)
|
||||||
|
@param isCbCr if set to true treat source as YCbCr
|
||||||
|
Convert from YUV or YCbCr to BGR, RGB, BGRA or RGBA.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtYUVtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int dcn, bool swapBlue, bool isCbCr) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtBGRtoXYZ
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param depth image depth (one of CV_8U, CV_16U or CV_32F)
|
||||||
|
@param scn source image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)
|
||||||
|
Convert from BGR, RGB, BGRA or RGBA to XYZ.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtBGRtoXYZ(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int scn, bool swapBlue) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtXYZtoBGR
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param depth image depth (one of CV_8U, CV_16U or CV_32F)
|
||||||
|
@param dcn destination image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R destination channels will be swapped (write RGB)
|
||||||
|
Convert from XYZ to BGR, RGB, BGRA or RGBA.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtXYZtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int dcn, bool swapBlue) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtBGRtoHSV
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param depth image depth (one of CV_8U or CV_32F)
|
||||||
|
@param scn source image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)
|
||||||
|
@param isFullRange if set to true write hue in range 0-255 (0-360 for float) otherwise in range 0-180
|
||||||
|
@param isHSV if set to true write HSV otherwise HSL
|
||||||
|
Convert from BGR, RGB, BGRA or RGBA to HSV or HSL.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtBGRtoHSV(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int scn, bool swapBlue, bool isFullRange, bool isHSV) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtHSVtoBGR
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param depth image depth (one of CV_8U or CV_32F)
|
||||||
|
@param dcn destination image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R destination channels will be swapped (write RGB)
|
||||||
|
@param isFullRange if set to true read hue in range 0-255 (0-360 for float) otherwise in range 0-180
|
||||||
|
@param isHSV if set to true treat source as HSV otherwise HSL
|
||||||
|
Convert from HSV or HSL to BGR, RGB, BGRA or RGBA.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtHSVtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int dcn, bool swapBlue, bool isFullRange, bool isHSV) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtBGRtoLab
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param depth image depth (one of CV_8U or CV_32F)
|
||||||
|
@param scn source image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)
|
||||||
|
@param isLab if set to true write Lab otherwise Luv
|
||||||
|
@param srgb if set to true use sRGB gamma correction
|
||||||
|
Convert from BGR, RGB, BGRA or RGBA to Lab or Luv.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtBGRtoLab(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int scn, bool swapBlue, bool isLab, bool srgb) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtLabtoBGR
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param depth image depth (one of CV_8U or CV_32F)
|
||||||
|
@param dcn destination image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R destination channels will be swapped (write RGB)
|
||||||
|
@param isLab if set to true treat input as Lab otherwise Luv
|
||||||
|
@param srgb if set to true use sRGB gamma correction
|
||||||
|
Convert from Lab or Luv to BGR, RGB, BGRA or RGBA.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtLabtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int dcn, bool swapBlue, bool isLab, bool srgb) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtTwoPlaneYUVtoBGR
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param dst_width,dst_height destination image size
|
||||||
|
@param dcn destination image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R destination channels will be swapped (write RGB)
|
||||||
|
@param uIdx U-channel index in the interleaved U/V plane (0 or 1)
|
||||||
|
Convert from YUV (YUV420sp (or NV12/NV21) - Y plane followed by interleaved U/V plane) to BGR, RGB, BGRA or RGBA.
|
||||||
|
Only for CV_8U.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtTwoPlaneYUVtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int dst_width, int dst_height, int dcn, bool swapBlue, int uIdx) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtThreePlaneYUVtoBGR
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param dst_width,dst_height destination image size
|
||||||
|
@param dcn destination image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R destination channels will be swapped (write RGB)
|
||||||
|
@param uIdx U-channel plane index (0 or 1)
|
||||||
|
Convert from YUV (YUV420p (or YV12/YV21) - Y plane followed by U and V planes) to BGR, RGB, BGRA or RGBA.
|
||||||
|
Only for CV_8U.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtThreePlaneYUVtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int dst_width, int dst_height, int dcn, bool swapBlue, int uIdx) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtBGRtoThreePlaneYUV
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param scn source image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)
|
||||||
|
@param uIdx U-channel plane index (0 or 1)
|
||||||
|
Convert from BGR, RGB, BGRA or RGBA to YUV (YUV420p (or YV12/YV21) - Y plane followed by U and V planes).
|
||||||
|
Only for CV_8U.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtBGRtoThreePlaneYUV(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int scn, bool swapBlue, int uIdx) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtOnePlaneYUVtoBGR
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
@param dcn destination image channels (3 or 4)
|
||||||
|
@param swapBlue if set to true B and R destination channels will be swapped (write RGB)
|
||||||
|
@param uIdx U-channel index (0 or 1)
|
||||||
|
@param ycn Y-channel index (0 or 1)
|
||||||
|
Convert from UYVY, YUY2 or YVYU to BGR, RGB, BGRA or RGBA.
|
||||||
|
Only for CV_8U.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtOnePlaneYUVtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int dcn, bool swapBlue, int uIdx, int ycn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtRGBAtoMultipliedRGBA
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
Convert from BGRA or RGBA to format with multiplied alpha channel.
|
||||||
|
Only for CV_8U.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtRGBAtoMultipliedRGBA(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief hal_cvtMultipliedRGBAtoRGBA
|
||||||
|
@param src_data,src_step source image data and step
|
||||||
|
@param dst_data,dst_step destination image data and step
|
||||||
|
@param width,height image size
|
||||||
|
Convert from format with multiplied alpha channel to BGRA or RGBA.
|
||||||
|
Only for CV_8U.
|
||||||
|
*/
|
||||||
|
inline int hal_ni_cvtMultipliedRGBAtoRGBA(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||||
|
|
||||||
|
//! @cond IGNORED
|
||||||
|
#define cv_hal_cvtBGRtoBGR hal_ni_cvtBGRtoBGR
|
||||||
|
#define cv_hal_cvtBGRtoBGR5x5 hal_ni_cvtBGRtoBGR5x5
|
||||||
|
#define cv_hal_cvtBGR5x5toBGR hal_ni_cvtBGR5x5toBGR
|
||||||
|
#define cv_hal_cvtBGRtoGray hal_ni_cvtBGRtoGray
|
||||||
|
#define cv_hal_cvtGraytoBGR hal_ni_cvtGraytoBGR
|
||||||
|
#define cv_hal_cvtBGR5x5toGray hal_ni_cvtBGR5x5toGray
|
||||||
|
#define cv_hal_cvtGraytoBGR5x5 hal_ni_cvtGraytoBGR5x5
|
||||||
|
#define cv_hal_cvtBGRtoYUV hal_ni_cvtBGRtoYUV
|
||||||
|
#define cv_hal_cvtYUVtoBGR hal_ni_cvtYUVtoBGR
|
||||||
|
#define cv_hal_cvtBGRtoXYZ hal_ni_cvtBGRtoXYZ
|
||||||
|
#define cv_hal_cvtXYZtoBGR hal_ni_cvtXYZtoBGR
|
||||||
|
#define cv_hal_cvtBGRtoHSV hal_ni_cvtBGRtoHSV
|
||||||
|
#define cv_hal_cvtHSVtoBGR hal_ni_cvtHSVtoBGR
|
||||||
|
#define cv_hal_cvtBGRtoLab hal_ni_cvtBGRtoLab
|
||||||
|
#define cv_hal_cvtLabtoBGR hal_ni_cvtLabtoBGR
|
||||||
|
#define cv_hal_cvtTwoPlaneYUVtoBGR hal_ni_cvtTwoPlaneYUVtoBGR
|
||||||
|
#define cv_hal_cvtThreePlaneYUVtoBGR hal_ni_cvtThreePlaneYUVtoBGR
|
||||||
|
#define cv_hal_cvtBGRtoThreePlaneYUV hal_ni_cvtBGRtoThreePlaneYUV
|
||||||
|
#define cv_hal_cvtOnePlaneYUVtoBGR hal_ni_cvtOnePlaneYUVtoBGR
|
||||||
|
#define cv_hal_cvtRGBAtoMultipliedRGBA hal_ni_cvtRGBAtoMultipliedRGBA
|
||||||
|
#define cv_hal_cvtMultipliedRGBAtoRGBA hal_ni_cvtMultipliedRGBAtoRGBA
|
||||||
|
//! @endcond
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
#if defined __GNUC__
|
#if defined __GNUC__
|
||||||
@ -306,7 +595,6 @@ inline int hal_ni_warpPerspectve(int src_type, const uchar *src_data, size_t src
|
|||||||
# pragma warning( pop )
|
# pragma warning( pop )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "custom_hal.hpp"
|
#include "custom_hal.hpp"
|
||||||
|
|
||||||
//! @cond IGNORED
|
//! @cond IGNORED
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import os, sys, subprocess, argparse, shutil, re
|
import os, sys, subprocess, argparse, shutil, re
|
||||||
|
import logging as log
|
||||||
|
|
||||||
|
log.basicConfig(format='%(message)s', level=log.DEBUG)
|
||||||
|
|
||||||
CMAKE_TEMPLATE='''\
|
CMAKE_TEMPLATE='''\
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||||
@ -83,10 +86,12 @@ class TestCmakeBuild(unittest.TestCase):
|
|||||||
"-DANDROID_TOOLCHAIN_NAME=%s" % self.toolchain,
|
"-DANDROID_TOOLCHAIN_NAME=%s" % self.toolchain,
|
||||||
self.srcdir
|
self.srcdir
|
||||||
]
|
]
|
||||||
|
log.info("Executing: %s" % cmd)
|
||||||
retcode = subprocess.call(cmd)
|
retcode = subprocess.call(cmd)
|
||||||
self.assertEqual(retcode, 0, "cmake failed")
|
self.assertEqual(retcode, 0, "cmake failed")
|
||||||
|
|
||||||
cmd = ["ninja"]
|
cmd = ["ninja"]
|
||||||
|
log.info("Executing: %s" % cmd)
|
||||||
retcode = subprocess.call(cmd)
|
retcode = subprocess.call(cmd)
|
||||||
self.assertEqual(retcode, 0, "make failed")
|
self.assertEqual(retcode, 0, "make failed")
|
||||||
|
|
||||||
|
@ -73,8 +73,7 @@ class ABI:
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%s (%s)" % (self.name, self.toolchain)
|
return "%s (%s)" % (self.name, self.toolchain)
|
||||||
def haveIPP(self):
|
def haveIPP(self):
|
||||||
return False
|
return self.name == "x86" or self.name == "x86_64"
|
||||||
# return self.name == "x86" or self.name == "x86_64"
|
|
||||||
|
|
||||||
ABIs = [
|
ABIs = [
|
||||||
ABI("2", "armeabi-v7a", "arm-linux-androideabi-4.8", cmake_name="armeabi-v7a with NEON"),
|
ABI("2", "armeabi-v7a", "arm-linux-androideabi-4.8", cmake_name="armeabi-v7a with NEON"),
|
||||||
@ -143,7 +142,7 @@ class Builder:
|
|||||||
cmd.append(self.opencvdir)
|
cmd.append(self.opencvdir)
|
||||||
|
|
||||||
if self.use_ccache == True:
|
if self.use_ccache == True:
|
||||||
cmd.extend(["-DNDK_CCACHE=ccache", "-DENABLE_PRECOMPILED_HEADERS=OFF"])
|
cmd.append("-DNDK_CCACHE=ccache")
|
||||||
if do_install:
|
if do_install:
|
||||||
cmd.extend(["-DBUILD_TESTS=ON", "-DINSTALL_TESTS=ON"])
|
cmd.extend(["-DBUILD_TESTS=ON", "-DINSTALL_TESTS=ON"])
|
||||||
execute(cmd)
|
execute(cmd)
|
||||||
@ -238,15 +237,6 @@ class Builder:
|
|||||||
log.info("Copy docs: %s", self.docdest)
|
log.info("Copy docs: %s", self.docdest)
|
||||||
shutil.copytree(self.docdest, os.path.join(self.resultdest, "sdk", "java", "javadoc"))
|
shutil.copytree(self.docdest, os.path.join(self.resultdest, "sdk", "java", "javadoc"))
|
||||||
|
|
||||||
# Patch cmake config
|
|
||||||
with open(os.path.join(self.resultdest, "sdk", "native", "jni", "OpenCVConfig.cmake"), "r+t") as f:
|
|
||||||
contents = f.read()
|
|
||||||
contents, count = re.subn(r'OpenCV_ANDROID_NATIVE_API_LEVEL \d+', "OpenCV_ANDROID_NATIVE_API_LEVEL 8", contents)
|
|
||||||
f.seek(0)
|
|
||||||
f.write(contents)
|
|
||||||
f.truncate()
|
|
||||||
log.info("Patch cmake config: %s (%d changes)", f.name, count)
|
|
||||||
|
|
||||||
# Clean samples
|
# Clean samples
|
||||||
path = os.path.join(self.resultdest, "samples")
|
path = os.path.join(self.resultdest, "samples")
|
||||||
for item in os.listdir(path):
|
for item in os.listdir(path):
|
||||||
|
Loading…
Reference in New Issue
Block a user