mirror of
https://github.com/opencv/opencv.git
synced 2026-09-25 04:09:57 +03:00
Merge pull request #30056 from vrabaud:old_compilers
Remove references to C++ < 17 and older compiler versions.
This commit is contained in:
@@ -51,11 +51,7 @@ elseif(CV_CLANG)
|
|||||||
set(OPENCV_LINKER_DEFENSES_FLAGS_COMMON "${OPENCV_LINKER_DEFENSES_FLAGS_COMMON} -z noexecstack -z relro -z now" )
|
set(OPENCV_LINKER_DEFENSES_FLAGS_COMMON "${OPENCV_LINKER_DEFENSES_FLAGS_COMMON} -z noexecstack -z relro -z now" )
|
||||||
endif()
|
endif()
|
||||||
elseif(CV_GCC)
|
elseif(CV_GCC)
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
|
ocv_add_defense_compiler_flag("-fstack-protector-strong")
|
||||||
ocv_add_defense_compiler_flag("-fstack-protector")
|
|
||||||
else()
|
|
||||||
ocv_add_defense_compiler_flag("-fstack-protector-strong")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# These flags is added by general options: -Wformat -Wformat-security
|
# These flags is added by general options: -Wformat -Wformat-security
|
||||||
if(NOT CMAKE_CXX_FLAGS MATCHES "-Wformat" OR NOT CMAKE_CXX_FLAGS MATCHES "format-security")
|
if(NOT CMAKE_CXX_FLAGS MATCHES "-Wformat" OR NOT CMAKE_CXX_FLAGS MATCHES "format-security")
|
||||||
|
|||||||
@@ -296,23 +296,19 @@ if(X86 OR X86_64)
|
|||||||
ocv_update(CPU_SSSE3_FLAGS_ON "-mssse3")
|
ocv_update(CPU_SSSE3_FLAGS_ON "-mssse3")
|
||||||
ocv_update(CPU_SSE2_FLAGS_ON "-msse2")
|
ocv_update(CPU_SSE2_FLAGS_ON "-msse2")
|
||||||
ocv_update(CPU_SSE_FLAGS_ON "-msse")
|
ocv_update(CPU_SSE_FLAGS_ON "-msse")
|
||||||
if(NOT (CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")) # GCC >= 5.0
|
ocv_update(CPU_AVX_512F_FLAGS_ON "-mavx512f")
|
||||||
ocv_update(CPU_AVX_512F_FLAGS_ON "-mavx512f")
|
ocv_update(CPU_AVX_512CD_FLAGS_ON "-mavx512cd")
|
||||||
ocv_update(CPU_AVX_512CD_FLAGS_ON "-mavx512cd")
|
ocv_update(CPU_AVX512_KNL_EXTRA_FLAGS_ON "-mavx512er -mavx512pf")
|
||||||
ocv_update(CPU_AVX512_KNL_EXTRA_FLAGS_ON "-mavx512er -mavx512pf")
|
ocv_update(CPU_AVX512_KNM_EXTRA_FLAGS_ON "-mavx5124fmaps -mavx5124vnniw")
|
||||||
ocv_update(CPU_AVX512_KNM_EXTRA_FLAGS_ON "-mavx5124fmaps -mavx5124vnniw")
|
ocv_update(CPU_AVX_512BW_FLAGS_ON "-mavx512bw")
|
||||||
ocv_update(CPU_AVX_512BW_FLAGS_ON "-mavx512bw")
|
ocv_update(CPU_AVX_512DQ_FLAGS_ON "-mavx512dq")
|
||||||
ocv_update(CPU_AVX_512DQ_FLAGS_ON "-mavx512dq")
|
ocv_update(CPU_AVX_512VL_FLAGS_ON "-mavx512vl")
|
||||||
ocv_update(CPU_AVX_512VL_FLAGS_ON "-mavx512vl")
|
ocv_update(CPU_AVX_512IFMA_FLAGS_ON "-mavx512ifma")
|
||||||
ocv_update(CPU_AVX_512IFMA_FLAGS_ON "-mavx512ifma")
|
ocv_update(CPU_AVX_512VBMI_FLAGS_ON "-mavx512vbmi")
|
||||||
ocv_update(CPU_AVX_512VBMI_FLAGS_ON "-mavx512vbmi")
|
ocv_update(CPU_AVX_512VNNI_FLAGS_ON "-mavx512vnni")
|
||||||
ocv_update(CPU_AVX_512VNNI_FLAGS_ON "-mavx512vnni")
|
ocv_update(CPU_AVX_512VBMI2_FLAGS_ON "-mavx512vbmi2")
|
||||||
ocv_update(CPU_AVX_512VBMI2_FLAGS_ON "-mavx512vbmi2")
|
ocv_update(CPU_AVX_512BITALG_FLAGS_ON "-mavx512bitalg")
|
||||||
ocv_update(CPU_AVX_512BITALG_FLAGS_ON "-mavx512bitalg")
|
ocv_update(CPU_AVX_512VPOPCNTDQ_FLAGS_ON "-mavx512vpopcntdq")
|
||||||
ocv_update(CPU_AVX_512VPOPCNTDQ_FLAGS_ON "-mavx512vpopcntdq")
|
|
||||||
else()
|
|
||||||
ocv_update(CPU_AVX_512F_SUPPORTED OFF)
|
|
||||||
endif()
|
|
||||||
elseif(MSVC)
|
elseif(MSVC)
|
||||||
ocv_update(CPU_AVX2_FLAGS_ON "/arch:AVX2")
|
ocv_update(CPU_AVX2_FLAGS_ON "/arch:AVX2")
|
||||||
ocv_update(CPU_AVX_FLAGS_ON "/arch:AVX")
|
ocv_update(CPU_AVX_FLAGS_ON "/arch:AVX")
|
||||||
|
|||||||
@@ -149,20 +149,16 @@ if(CV_GCC OR CV_CLANG OR CV_ICX)
|
|||||||
add_extra_compiler_option(-Wundef)
|
add_extra_compiler_option(-Wundef)
|
||||||
add_extra_compiler_option(-Winit-self)
|
add_extra_compiler_option(-Winit-self)
|
||||||
add_extra_compiler_option(-Wpointer-arith)
|
add_extra_compiler_option(-Wpointer-arith)
|
||||||
if(NOT (CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0"))
|
add_extra_compiler_option(-Wshadow)
|
||||||
add_extra_compiler_option(-Wshadow) # old GCC emits warnings for variables + methods combination
|
|
||||||
endif()
|
|
||||||
add_extra_compiler_option(-Wsign-promo)
|
add_extra_compiler_option(-Wsign-promo)
|
||||||
add_extra_compiler_option(-Wuninitialized)
|
add_extra_compiler_option(-Wuninitialized)
|
||||||
if(CV_GCC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0 OR ARM))
|
if(CV_GCC AND ARM)
|
||||||
add_extra_compiler_option(-Wno-psabi)
|
add_extra_compiler_option(-Wno-psabi)
|
||||||
endif()
|
endif()
|
||||||
if(HAVE_CXX11)
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT ENABLE_PRECOMPILED_HEADERS)
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT ENABLE_PRECOMPILED_HEADERS)
|
add_extra_compiler_option(-Wsuggest-override)
|
||||||
add_extra_compiler_option(-Wsuggest-override)
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
add_extra_compiler_option(-Winconsistent-missing-override)
|
||||||
add_extra_compiler_option(-Winconsistent-missing-override)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_NOISY_WARNINGS)
|
if(ENABLE_NOISY_WARNINGS)
|
||||||
@@ -174,16 +170,13 @@ if(CV_GCC OR CV_CLANG OR CV_ICX)
|
|||||||
add_extra_compiler_option(-Wno-comment)
|
add_extra_compiler_option(-Wno-comment)
|
||||||
if(NOT OPENCV_SKIP_IMPLICIT_FALLTHROUGH
|
if(NOT OPENCV_SKIP_IMPLICIT_FALLTHROUGH
|
||||||
AND NOT " ${CMAKE_CXX_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_CXX_FLAGS}" MATCHES "implicit-fallthrough"
|
AND NOT " ${CMAKE_CXX_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_CXX_FLAGS}" MATCHES "implicit-fallthrough"
|
||||||
AND (CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)
|
AND (CV_GCC OR CV_CLANG)
|
||||||
)
|
)
|
||||||
add_extra_compiler_option(-Wimplicit-fallthrough=3)
|
add_extra_compiler_option(-Wimplicit-fallthrough=3)
|
||||||
endif()
|
endif()
|
||||||
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
|
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
|
||||||
add_extra_compiler_option(-Wno-strict-overflow) # Issue appears when compiling surf.cpp from opencv_contrib/modules/xfeatures2d
|
add_extra_compiler_option(-Wno-strict-overflow) # Issue appears when compiling surf.cpp from opencv_contrib/modules/xfeatures2d
|
||||||
endif()
|
endif()
|
||||||
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
|
||||||
add_extra_compiler_option(-Wno-missing-field-initializers) # GCC 4.x emits warnings about {}, fixed in GCC 5+
|
|
||||||
endif()
|
|
||||||
if(CV_CLANG AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
|
if(CV_CLANG AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
|
||||||
add_extra_compiler_option(-Wno-deprecated-enum-enum-conversion)
|
add_extra_compiler_option(-Wno-deprecated-enum-enum-conversion)
|
||||||
add_extra_compiler_option(-Wno-deprecated-anon-enum-enum-conversion)
|
add_extra_compiler_option(-Wno-deprecated-anon-enum-enum-conversion)
|
||||||
@@ -266,9 +259,6 @@ if(CV_GCC OR CV_CLANG OR CV_ICX)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_INSTRUMENTATION)
|
if(ENABLE_INSTRUMENTATION)
|
||||||
if(NOT HAVE_CXX11)
|
|
||||||
message(WARNING "ENABLE_INSTRUMENTATION requires C++11 support")
|
|
||||||
endif()
|
|
||||||
set(WITH_VTK OFF) # There are issues with VTK 6.0
|
set(WITH_VTK OFF) # There are issues with VTK 6.0
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -314,9 +304,7 @@ if(MSVC)
|
|||||||
|
|
||||||
# Remove unreferenced functions: function level linking
|
# Remove unreferenced functions: function level linking
|
||||||
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /Gy")
|
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /Gy")
|
||||||
if(NOT MSVC_VERSION LESS 1400)
|
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /bigobj")
|
||||||
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /bigobj")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(OPENCV_WARNINGS_ARE_ERRORS)
|
if(OPENCV_WARNINGS_ARE_ERRORS)
|
||||||
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /WX")
|
set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /WX")
|
||||||
@@ -327,7 +315,7 @@ if(MSVC)
|
|||||||
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} /LTCG")
|
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} /LTCG")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT MSVC_VERSION LESS 1800 AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
|
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /FS")
|
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /FS")
|
||||||
set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} /FS")
|
set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} /FS")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -405,7 +405,7 @@ macro(ocv_nvcc_flags)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# disabled because of multiple warnings during building nvcc auto generated files
|
# disabled because of multiple warnings during building nvcc auto generated files
|
||||||
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.6.0")
|
if(CV_GCC)
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wunused-but-set-variable)
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wunused-but-set-variable)
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|||||||
@@ -203,24 +203,11 @@ if(NOT OPENCV_SKIP_CMAKE_CXX_STANDARD)
|
|||||||
ocv_update(CMAKE_CXX_STANDARD 17)
|
ocv_update(CMAKE_CXX_STANDARD 17)
|
||||||
ocv_update(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
ocv_update(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||||
ocv_update(CMAKE_CXX_EXTENSIONS OFF) # use -std=c++17 instead of -std=gnu++17
|
ocv_update(CMAKE_CXX_EXTENSIONS OFF) # use -std=c++17 instead of -std=gnu++17
|
||||||
if("cxx_std_11" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
|
|
||||||
set(HAVE_CXX11 ON)
|
|
||||||
endif()
|
|
||||||
if("cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
|
|
||||||
set(HAVE_CXX17 ON)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT HAVE_CXX11)
|
# Debian 9 - GCC 7.3.0
|
||||||
message(WARNING "OpenCV 5.x requires C++11 support, but it was not detected. Your compilation may fail.")
|
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7)
|
||||||
endif()
|
message(WARNING "OpenCV requires GCC >= 7.x (detected ${CMAKE_CXX_COMPILER_VERSION}). Your compilation may fail.")
|
||||||
if(NOT HAVE_CXX17)
|
|
||||||
message(WARNING "OpenCV 5.x requires C++17 support, but it was not detected. Your compilation may fail.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Debian 10 - GCC 8.3.0
|
|
||||||
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8)
|
|
||||||
message(WARNING "OpenCV requires GCC >= 8.x (detected ${CMAKE_CXX_COMPILER_VERSION}). Your compilation may fail.")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Debian 10 - Clang 7.0
|
# Debian 10 - Clang 7.0
|
||||||
@@ -236,12 +223,12 @@ endif()
|
|||||||
# TODO: check other known compilers versions
|
# TODO: check other known compilers versions
|
||||||
|
|
||||||
set(__OPENCV_ENABLE_ATOMIC_LONG_LONG OFF)
|
set(__OPENCV_ENABLE_ATOMIC_LONG_LONG OFF)
|
||||||
if(HAVE_CXX11 AND (X86 OR X86_64))
|
if(X86 OR X86_64)
|
||||||
set(__OPENCV_ENABLE_ATOMIC_LONG_LONG ON)
|
set(__OPENCV_ENABLE_ATOMIC_LONG_LONG ON)
|
||||||
endif()
|
endif()
|
||||||
option(OPENCV_ENABLE_ATOMIC_LONG_LONG "Enable C++ compiler support for atomic<long long>" ${__OPENCV_ENABLE_ATOMIC_LONG_LONG})
|
option(OPENCV_ENABLE_ATOMIC_LONG_LONG "Enable C++ compiler support for atomic<long long>" ${__OPENCV_ENABLE_ATOMIC_LONG_LONG})
|
||||||
|
|
||||||
if((HAVE_CXX11 AND OPENCV_ENABLE_ATOMIC_LONG_LONG
|
if((OPENCV_ENABLE_ATOMIC_LONG_LONG
|
||||||
AND NOT MSVC
|
AND NOT MSVC
|
||||||
AND NOT (X86 OR X86_64)
|
AND NOT (X86 OR X86_64)
|
||||||
AND NOT OPENCV_SKIP_LIBATOMIC_COMPILER_CHECK)
|
AND NOT OPENCV_SKIP_LIBATOMIC_COMPILER_CHECK)
|
||||||
@@ -260,6 +247,6 @@ if((HAVE_CXX11 AND OPENCV_ENABLE_ATOMIC_LONG_LONG
|
|||||||
else()
|
else()
|
||||||
set(HAVE_ATOMIC_LONG_LONG ON)
|
set(HAVE_ATOMIC_LONG_LONG ON)
|
||||||
endif()
|
endif()
|
||||||
else(HAVE_CXX11 AND OPENCV_ENABLE_ATOMIC_LONG_LONG)
|
else()
|
||||||
set(HAVE_ATOMIC_LONG_LONG ${OPENCV_ENABLE_ATOMIC_LONG_LONG})
|
set(HAVE_ATOMIC_LONG_LONG ${OPENCV_ENABLE_ATOMIC_LONG_LONG})
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ IF(OPENEXR_FOUND)
|
|||||||
if(NOT OPENEXR_VERSION)
|
if(NOT OPENEXR_VERSION)
|
||||||
SET(OPENEXR_VERSION "Unknown")
|
SET(OPENEXR_VERSION "Unknown")
|
||||||
else()
|
else()
|
||||||
if(HAVE_CXX17 AND OPENEXR_VERSION VERSION_LESS "2.3.0")
|
if(OPENEXR_VERSION VERSION_LESS "2.3.0")
|
||||||
message(STATUS " OpenEXR(ver ${OPENEXR_VERSION}) doesn't support C++17 and higher. Updating OpenEXR 2.3.0+ is required.")
|
message(STATUS " OpenEXR(ver ${OPENEXR_VERSION}) doesn't support C++17 and higher. Updating OpenEXR 2.3.0+ is required.")
|
||||||
SET(OPENEXR_FOUND FALSE)
|
SET(OPENEXR_FOUND FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -78,15 +78,6 @@ endif()
|
|||||||
# Details: https://protobuf.dev/news/2022-08-03/
|
# Details: https://protobuf.dev/news/2022-08-03/
|
||||||
# And if std::text_view is in abseil-cpp requests C++17 and later.
|
# And if std::text_view is in abseil-cpp requests C++17 and later.
|
||||||
|
|
||||||
if(HAVE_PROTOBUF)
|
|
||||||
if(NOT (Protobuf_VERSION VERSION_LESS 22))
|
|
||||||
if((CMAKE_CXX_STANDARD EQUAL 98) OR (CMAKE_CXX_STANDARD LESS 17))
|
|
||||||
message(STATUS "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} is too old to support protobuf(${Protobuf_VERSION}) and/or abseil-cpp. Use C++17 or later. Turning HAVE_PROTOBUF off")
|
|
||||||
set(HAVE_PROTOBUF FALSE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(HAVE_PROTOBUF AND PROTOBUF_UPDATE_FILES AND NOT COMMAND PROTOBUF_GENERATE_CPP)
|
if(HAVE_PROTOBUF AND PROTOBUF_UPDATE_FILES AND NOT COMMAND PROTOBUF_GENERATE_CPP)
|
||||||
message(FATAL_ERROR "Can't configure protobuf dependency (BUILD_PROTOBUF=${BUILD_PROTOBUF} PROTOBUF_UPDATE_FILES=${PROTOBUF_UPDATE_FILES})")
|
message(FATAL_ERROR "Can't configure protobuf dependency (BUILD_PROTOBUF=${BUILD_PROTOBUF} PROTOBUF_UPDATE_FILES=${PROTOBUF_UPDATE_FILES})")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ if(NOT DEFINED MIN_VER_CMAKE)
|
|||||||
set(MIN_VER_CMAKE 3.13) # Debian 10
|
set(MIN_VER_CMAKE 3.13) # Debian 10
|
||||||
# set(MIN_VER_CMAKE 3.10) # Visual Studio 2017 15.7
|
# set(MIN_VER_CMAKE 3.10) # Visual Studio 2017 15.7
|
||||||
endif()
|
endif()
|
||||||
set(MIN_VER_CUDA 6.5)
|
set(MIN_VER_CUDA 9.0) # CUDA 9.0 is the minimum version supporting stable C++11 compilation for device code
|
||||||
set(MIN_VER_CUDNN 7.5)
|
set(MIN_VER_CUDNN 7.5)
|
||||||
set(MIN_VER_CUDNNJIT 9.0)
|
set(MIN_VER_CUDNNJIT 9.0)
|
||||||
set(MIN_VER_PYTHON3 3.2)
|
set(MIN_VER_PYTHON3 3.2)
|
||||||
|
|||||||
@@ -14,9 +14,7 @@
|
|||||||
|
|
||||||
IF(CV_GCC)
|
IF(CV_GCC)
|
||||||
|
|
||||||
IF(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.2.0")
|
SET(PCHSupport_FOUND TRUE)
|
||||||
SET(PCHSupport_FOUND TRUE)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
SET(_PCH_include_prefix "-I")
|
SET(_PCH_include_prefix "-I")
|
||||||
SET(_PCH_isystem_prefix "-isystem")
|
SET(_PCH_isystem_prefix "-isystem")
|
||||||
@@ -65,7 +63,7 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
|
|||||||
ocv_is_opencv_directory(__result ${item})
|
ocv_is_opencv_directory(__result ${item})
|
||||||
if(__result)
|
if(__result)
|
||||||
LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}\"${item}\"")
|
LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}\"${item}\"")
|
||||||
elseif(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND
|
elseif(CV_GCC AND
|
||||||
item MATCHES "/usr/include$")
|
item MATCHES "/usr/include$")
|
||||||
# workaround for GCC 6.x bug
|
# workaround for GCC 6.x bug
|
||||||
else()
|
else()
|
||||||
@@ -78,7 +76,7 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
|
|||||||
ocv_is_opencv_directory(__result ${item})
|
ocv_is_opencv_directory(__result ${item})
|
||||||
if(__result)
|
if(__result)
|
||||||
LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}\"${item}\"")
|
LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}\"${item}\"")
|
||||||
elseif(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND
|
elseif(CV_GCC AND
|
||||||
item MATCHES "/usr/include$")
|
item MATCHES "/usr/include$")
|
||||||
# workaround for GCC 6.x bug
|
# workaround for GCC 6.x bug
|
||||||
else()
|
else()
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ function(ocv_create_plugin module default_name dependency_target dependency_targ
|
|||||||
|
|
||||||
target_link_libraries(${OPENCV_PLUGIN_NAME} PRIVATE ${dependency_target})
|
target_link_libraries(${OPENCV_PLUGIN_NAME} PRIVATE ${dependency_target})
|
||||||
set_target_properties(${OPENCV_PLUGIN_NAME} PROPERTIES
|
set_target_properties(${OPENCV_PLUGIN_NAME} PROPERTIES
|
||||||
CXX_STANDARD 11
|
|
||||||
CXX_VISIBILITY_PRESET hidden
|
CXX_VISIBILITY_PRESET hidden
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ function(ocv_include_directories)
|
|||||||
ocv_is_opencv_directory(__is_opencv_dir "${dir}")
|
ocv_is_opencv_directory(__is_opencv_dir "${dir}")
|
||||||
if(__is_opencv_dir)
|
if(__is_opencv_dir)
|
||||||
list(APPEND __add_before "${dir}")
|
list(APPEND __add_before "${dir}")
|
||||||
elseif(((CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0") OR CV_CLANG) AND
|
elseif((CV_GCC OR CV_CLANG) AND
|
||||||
dir MATCHES "/usr/include$")
|
dir MATCHES "/usr/include$")
|
||||||
# workaround for GCC 6.x bug
|
# workaround for GCC 6.x bug
|
||||||
else()
|
else()
|
||||||
@@ -359,7 +359,7 @@ function(ocv_target_include_directories target)
|
|||||||
if("${dir}" STREQUAL "SYSTEM")
|
if("${dir}" STREQUAL "SYSTEM")
|
||||||
set(__var_name __system_params)
|
set(__var_name __system_params)
|
||||||
else()
|
else()
|
||||||
if(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND
|
if(CV_GCC AND
|
||||||
dir MATCHES "/usr/include$")
|
dir MATCHES "/usr/include$")
|
||||||
# workaround for GCC 6.x bug
|
# workaround for GCC 6.x bug
|
||||||
else()
|
else()
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ option(OPENCV_ENABLE_ALLOCATOR_STATS "Enable Allocator metrics" ON)
|
|||||||
|
|
||||||
if(NOT OPENCV_ENABLE_ALLOCATOR_STATS)
|
if(NOT OPENCV_ENABLE_ALLOCATOR_STATS)
|
||||||
add_definitions(-DOPENCV_DISABLE_ALLOCATOR_STATS=1)
|
add_definitions(-DOPENCV_DISABLE_ALLOCATOR_STATS=1)
|
||||||
elseif(HAVE_CXX11 OR DEFINED OPENCV_ALLOCATOR_STATS_COUNTER_TYPE)
|
else()
|
||||||
if(NOT DEFINED OPENCV_ALLOCATOR_STATS_COUNTER_TYPE)
|
if(NOT DEFINED OPENCV_ALLOCATOR_STATS_COUNTER_TYPE)
|
||||||
if(HAVE_ATOMIC_LONG_LONG AND OPENCV_ENABLE_ATOMIC_LONG_LONG)
|
if(HAVE_ATOMIC_LONG_LONG AND OPENCV_ENABLE_ATOMIC_LONG_LONG)
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
#if defined(__OPENCV_BUILD) && defined(__clang__)
|
#if defined(__OPENCV_BUILD) && defined(__clang__)
|
||||||
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
|
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
|
||||||
#endif
|
#endif
|
||||||
#if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__OPENCV_BUILD) && defined(__GNUC__)
|
||||||
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -90,11 +90,9 @@ namespace cv { namespace debug_build_guard { } using namespace debug_build_guard
|
|||||||
|
|
||||||
#ifdef CV_Func
|
#ifdef CV_Func
|
||||||
// keep current value (through OpenCV port file)
|
// keep current value (through OpenCV port file)
|
||||||
#elif defined __GNUC__ || (defined (__cpluscplus) && (__cpluscplus >= 201103))
|
#elif defined __GNUC__ || defined __clang__ || defined __cplusplus
|
||||||
#define CV_Func __func__
|
#define CV_Func __func__
|
||||||
#elif defined __clang__ && (__clang_minor__ * 100 + __clang_major__ >= 305)
|
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
||||||
#define CV_Func __func__
|
|
||||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION >= 199901)
|
|
||||||
#define CV_Func __func__
|
#define CV_Func __func__
|
||||||
#elif defined _MSC_VER
|
#elif defined _MSC_VER
|
||||||
#define CV_Func __FUNCTION__
|
#define CV_Func __FUNCTION__
|
||||||
@@ -114,36 +112,12 @@ namespace cv { namespace debug_build_guard { } using namespace debug_build_guard
|
|||||||
#define CVAUX_CONCAT_EXP(a, b) a##b
|
#define CVAUX_CONCAT_EXP(a, b) a##b
|
||||||
#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
|
#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
|
||||||
|
|
||||||
#if defined(__clang__)
|
#if defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L)
|
||||||
# ifndef __has_extension
|
# define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition)
|
||||||
# define __has_extension __has_feature /* compatibility, for older versions of clang */
|
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||||
# endif
|
# define CV_StaticAssert(condition, reason) _Static_assert((condition), reason " " #condition)
|
||||||
# if __has_extension(cxx_static_assert)
|
#else
|
||||||
# define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition)
|
# define CV_StaticAssert(condition, reason)
|
||||||
# elif __has_extension(c_static_assert)
|
|
||||||
# define CV_StaticAssert(condition, reason) _Static_assert((condition), reason " " #condition)
|
|
||||||
# endif
|
|
||||||
#elif defined(__GNUC__)
|
|
||||||
# if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
|
|
||||||
# define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition)
|
|
||||||
# endif
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
# if _MSC_VER >= 1600 /* MSVC 10 */
|
|
||||||
# define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition)
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#ifndef CV_StaticAssert
|
|
||||||
# if !defined(__clang__) && defined(__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__ > 302)
|
|
||||||
# define CV_StaticAssert(condition, reason) ({ extern int __attribute__((error("CV_StaticAssert: " reason " " #condition))) CV_StaticAssert(); ((condition) ? 0 : CV_StaticAssert()); })
|
|
||||||
# else
|
|
||||||
namespace cv {
|
|
||||||
template <bool x> struct CV_StaticAssert_failed;
|
|
||||||
template <> struct CV_StaticAssert_failed<true> { enum { val = 1 }; };
|
|
||||||
template<int x> struct CV_StaticAssert_test {};
|
|
||||||
}
|
|
||||||
# define CV_StaticAssert(condition, reason)\
|
|
||||||
typedef cv::CV_StaticAssert_test< sizeof(cv::CV_StaticAssert_failed< static_cast<bool>(condition) >) > CVAUX_CONCAT(CV_StaticAssert_failed_at_, __LINE__)
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Suppress warning "-Wdeprecated-declarations" / C4996
|
// Suppress warning "-Wdeprecated-declarations" / C4996
|
||||||
@@ -220,7 +194,7 @@ namespace cv {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CV_ALWAYS_INLINE
|
#ifndef CV_ALWAYS_INLINE
|
||||||
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
|
#if defined(__GNUC__)
|
||||||
#define CV_ALWAYS_INLINE inline __attribute__((always_inline))
|
#define CV_ALWAYS_INLINE inline __attribute__((always_inline))
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
#define CV_ALWAYS_INLINE __forceinline
|
#define CV_ALWAYS_INLINE __forceinline
|
||||||
@@ -437,7 +411,7 @@ Cv64suf;
|
|||||||
#ifndef CV_EXPORTS
|
#ifndef CV_EXPORTS
|
||||||
# if (defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined(CVAPI_EXPORTS)
|
# if (defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined(CVAPI_EXPORTS)
|
||||||
# define CV_EXPORTS __declspec(dllexport)
|
# define CV_EXPORTS __declspec(dllexport)
|
||||||
# elif defined __GNUC__ && __GNUC__ >= 4 && (defined(CVAPI_EXPORTS) || defined(__APPLE__))
|
# elif defined __GNUC__ && (defined(CVAPI_EXPORTS) || defined(__APPLE__))
|
||||||
# define CV_EXPORTS __attribute__ ((visibility ("default")))
|
# define CV_EXPORTS __attribute__ ((visibility ("default")))
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
@@ -729,21 +703,10 @@ __CV_ENUM_FLAGS_BITWISE_XOR_EQ (EnumType, EnumType)
|
|||||||
|
|
||||||
#ifdef CV_XADD
|
#ifdef CV_XADD
|
||||||
// allow to use user-defined macro
|
// allow to use user-defined macro
|
||||||
|
#elif defined __clang__ && !defined __EMSCRIPTEN__ && !defined __INTEL_COMPILER
|
||||||
|
# define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL)
|
||||||
#elif defined __GNUC__ || defined __clang__
|
#elif defined __GNUC__ || defined __clang__
|
||||||
# if defined __clang__ && __clang_major__ >= 3 && !defined __EMSCRIPTEN__ && !defined __INTEL_COMPILER
|
# define CV_XADD(addr, delta) (int)__atomic_fetch_add((unsigned*)(addr), (unsigned)(delta), __ATOMIC_ACQ_REL)
|
||||||
# ifdef __ATOMIC_ACQ_REL
|
|
||||||
# define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL)
|
|
||||||
# else
|
|
||||||
# define CV_XADD(addr, delta) __atomic_fetch_add((_Atomic(int)*)(addr), delta, 4)
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# if defined __ATOMIC_ACQ_REL && !defined __clang__
|
|
||||||
// version for gcc >= 4.7
|
|
||||||
# define CV_XADD(addr, delta) (int)__atomic_fetch_add((unsigned*)(addr), (unsigned)(delta), __ATOMIC_ACQ_REL)
|
|
||||||
# else
|
|
||||||
# define CV_XADD(addr, delta) (int)__sync_fetch_and_add((unsigned*)(addr), (unsigned)(delta))
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#elif defined _MSC_VER && !defined RC_INVOKED
|
#elif defined _MSC_VER && !defined RC_INVOKED
|
||||||
# include <intrin.h>
|
# include <intrin.h>
|
||||||
# define CV_XADD(addr, delta) (int)_InterlockedExchangeAdd((long volatile*)addr, delta)
|
# define CV_XADD(addr, delta) (int)_InterlockedExchangeAdd((long volatile*)addr, delta)
|
||||||
@@ -785,20 +748,9 @@ __CV_ENUM_FLAGS_BITWISE_XOR_EQ (EnumType, EnumType)
|
|||||||
# else
|
# else
|
||||||
# define CV_NODISCARD_STD [[nodiscard]]
|
# define CV_NODISCARD_STD [[nodiscard]]
|
||||||
# endif
|
# endif
|
||||||
# elif __cplusplus >= 201703L
|
# else
|
||||||
// available when compiler is C++17 compliant
|
// available when compiler is C++17 compliant
|
||||||
# define CV_NODISCARD_STD [[nodiscard]]
|
# define CV_NODISCARD_STD [[nodiscard]]
|
||||||
# elif defined(__INTEL_COMPILER)
|
|
||||||
// see above, available when C++17 is enabled
|
|
||||||
# elif defined(_MSC_VER) && _MSC_VER >= 1911 && _MSVC_LANG >= 201703L
|
|
||||||
// available with VS2017 v15.3+ with /std:c++17 or higher; works on functions and classes
|
|
||||||
# define CV_NODISCARD_STD [[nodiscard]]
|
|
||||||
# elif defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 700) && (__cplusplus >= 201103L)
|
|
||||||
// available with GCC 7.0+; works on functions, works or silently fails on classes
|
|
||||||
# define CV_NODISCARD_STD [[nodiscard]]
|
|
||||||
# elif defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 408) && (__cplusplus >= 201103L)
|
|
||||||
// available with GCC 4.8+ but it usually does nothing and can fail noisily -- therefore not used
|
|
||||||
// define CV_NODISCARD_STD [[gnu::warn_unused_result]]
|
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef CV_NODISCARD_STD
|
#ifndef CV_NODISCARD_STD
|
||||||
@@ -810,21 +762,11 @@ __CV_ENUM_FLAGS_BITWISE_XOR_EQ (EnumType, EnumType)
|
|||||||
* C++ 11 *
|
* C++ 11 *
|
||||||
\****************************************************************************************/
|
\****************************************************************************************/
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// MSVC was stuck at __cplusplus == 199711L for a long time, even where it supports C++11,
|
# if __cplusplus < 201103L && !(defined(_MSC_VER) && _MSVC_LANG >= 201103L)
|
||||||
// so check _MSC_VER instead. See:
|
# error "OpenCV 5.x+ requires enabled C++11 support"
|
||||||
// <https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus>
|
|
||||||
# if defined(_MSC_VER)
|
|
||||||
# if _MSC_VER < 1800
|
|
||||||
# error "OpenCV 4.x+ requires enabled C++11 support"
|
|
||||||
# endif
|
|
||||||
# elif __cplusplus < 201103L
|
|
||||||
# error "OpenCV 4.x+ requires enabled C++11 support"
|
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CV_CXX11
|
|
||||||
# define CV_CXX11 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CV_OVERRIDE
|
#ifndef CV_OVERRIDE
|
||||||
# define CV_OVERRIDE override
|
# define CV_OVERRIDE override
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
#include "opencv2/core.hpp"
|
#include "opencv2/core.hpp"
|
||||||
|
|
||||||
#if defined _MSC_VER && _MSC_VER >= 1200
|
#if defined _MSC_VER
|
||||||
#ifndef NOMINMAX
|
#ifndef NOMINMAX
|
||||||
#define NOMINMAX // fix https://github.com/opencv/opencv/issues/17548
|
#define NOMINMAX // fix https://github.com/opencv/opencv/issues/17548
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
namespace {
|
namespace {
|
||||||
inline unsigned int trailingZeros32(unsigned int value) {
|
inline unsigned int trailingZeros32(unsigned int value) {
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#if (_MSC_VER < 1700) || defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC)
|
#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC)
|
||||||
unsigned long index = 0;
|
unsigned long index = 0;
|
||||||
_BitScanForward(&index, value);
|
_BitScanForward(&index, value);
|
||||||
return (unsigned int)index;
|
return (unsigned int)index;
|
||||||
|
|||||||
@@ -1464,12 +1464,7 @@ inline v_float32x16 v_abs(const v_float32x16& x)
|
|||||||
inline v_float64x8 v_abs(const v_float64x8& x)
|
inline v_float64x8 v_abs(const v_float64x8& x)
|
||||||
{
|
{
|
||||||
#ifdef _mm512_abs_pd
|
#ifdef _mm512_abs_pd
|
||||||
#if defined __GNUC__ && (__GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ <= 3) || (__GNUC__ == 8 && __GNUC_MINOR__ <= 2))
|
return v_float64x8(_mm512_abs_pd(x.val));
|
||||||
// Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87476
|
|
||||||
return v_float64x8(_mm512_abs_pd(_mm512_castpd_ps(x.val)));
|
|
||||||
#else
|
|
||||||
return v_float64x8(_mm512_abs_pd(x.val));
|
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
return v_float64x8(_mm512_castsi512_pd(_mm512_and_si512(_mm512_castpd_si512(x.val),
|
return v_float64x8(_mm512_castsi512_pd(_mm512_and_si512(_mm512_castpd_si512(x.val),
|
||||||
_v512_set_epu64(0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF,
|
_v512_set_epu64(0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF,
|
||||||
|
|||||||
@@ -167,23 +167,13 @@ public:
|
|||||||
//! default constructor
|
//! default constructor
|
||||||
Point_();
|
Point_();
|
||||||
Point_(_Tp _x, _Tp _y);
|
Point_(_Tp _x, _Tp _y);
|
||||||
#if (defined(__GNUC__) && __GNUC__ < 5) && !defined(__clang__) // GCC 4.x bug. Details: https://github.com/opencv/opencv/pull/20837
|
|
||||||
Point_(const Point_& pt);
|
|
||||||
Point_(Point_&& pt) CV_NOEXCEPT = default;
|
|
||||||
#elif OPENCV_ABI_COMPATIBILITY < 500
|
|
||||||
Point_(const Point_& pt) = default;
|
Point_(const Point_& pt) = default;
|
||||||
Point_(Point_&& pt) CV_NOEXCEPT = default;
|
Point_(Point_&& pt) CV_NOEXCEPT = default;
|
||||||
#endif
|
|
||||||
Point_(const Size_<_Tp>& sz);
|
Point_(const Size_<_Tp>& sz);
|
||||||
Point_(const Vec<_Tp, 2>& v);
|
Point_(const Vec<_Tp, 2>& v);
|
||||||
|
|
||||||
#if (defined(__GNUC__) && __GNUC__ < 5) && !defined(__clang__) // GCC 4.x bug. Details: https://github.com/opencv/opencv/pull/20837
|
|
||||||
Point_& operator = (const Point_& pt);
|
|
||||||
Point_& operator = (Point_&& pt) CV_NOEXCEPT = default;
|
|
||||||
#elif OPENCV_ABI_COMPATIBILITY < 500
|
|
||||||
Point_& operator = (const Point_& pt) = default;
|
Point_& operator = (const Point_& pt) = default;
|
||||||
Point_& operator = (Point_&& pt) CV_NOEXCEPT = default;
|
Point_& operator = (Point_&& pt) CV_NOEXCEPT = default;
|
||||||
#endif
|
|
||||||
//! conversion to another data type
|
//! conversion to another data type
|
||||||
template<typename _Tp2> operator Point_<_Tp2>() const;
|
template<typename _Tp2> operator Point_<_Tp2>() const;
|
||||||
|
|
||||||
@@ -1204,12 +1194,6 @@ template<typename _Tp> inline
|
|||||||
Point_<_Tp>::Point_(_Tp _x, _Tp _y)
|
Point_<_Tp>::Point_(_Tp _x, _Tp _y)
|
||||||
: x(_x), y(_y) {}
|
: x(_x), y(_y) {}
|
||||||
|
|
||||||
#if (defined(__GNUC__) && __GNUC__ < 5) && !defined(__clang__) // GCC 4.x bug. Details: https://github.com/opencv/opencv/pull/20837
|
|
||||||
template<typename _Tp> inline
|
|
||||||
Point_<_Tp>::Point_(const Point_& pt)
|
|
||||||
: x(pt.x), y(pt.y) {}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename _Tp> inline
|
template<typename _Tp> inline
|
||||||
Point_<_Tp>::Point_(const Size_<_Tp>& sz)
|
Point_<_Tp>::Point_(const Size_<_Tp>& sz)
|
||||||
: x(sz.width), y(sz.height) {}
|
: x(sz.width), y(sz.height) {}
|
||||||
@@ -1218,15 +1202,6 @@ template<typename _Tp> inline
|
|||||||
Point_<_Tp>::Point_(const Vec<_Tp,2>& v)
|
Point_<_Tp>::Point_(const Vec<_Tp,2>& v)
|
||||||
: x(v[0]), y(v[1]) {}
|
: x(v[0]), y(v[1]) {}
|
||||||
|
|
||||||
#if (defined(__GNUC__) && __GNUC__ < 5) && !defined(__clang__) // GCC 4.x bug. Details: https://github.com/opencv/opencv/pull/20837
|
|
||||||
template<typename _Tp> inline
|
|
||||||
Point_<_Tp>& Point_<_Tp>::operator = (const Point_& pt)
|
|
||||||
{
|
|
||||||
x = pt.x; y = pt.y;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename _Tp> template<typename _Tp2> inline
|
template<typename _Tp> template<typename _Tp2> inline
|
||||||
Point_<_Tp>::operator Point_<_Tp2>() const
|
Point_<_Tp>::operator Point_<_Tp2>() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -344,33 +344,8 @@ VSX_IMPL_1RG(vec_udword2, vec_float4, xvcvspuxds, vec_ctulo)
|
|||||||
VSX_FINLINE(rt) fnm(const rg& a) { return __builtin_convertvector(a, rt); }
|
VSX_FINLINE(rt) fnm(const rg& a) { return __builtin_convertvector(a, rt); }
|
||||||
|
|
||||||
#ifndef vec_permi
|
#ifndef vec_permi
|
||||||
#if __clang_major__ < 5
|
|
||||||
// implement vec_permi in a dirty way
|
|
||||||
# define VSX_IMPL_CLANG_4_PERMI(Tvec) \
|
|
||||||
VSX_FINLINE(Tvec) vec_permi(const Tvec& a, const Tvec& b, unsigned const char c) \
|
|
||||||
{ \
|
|
||||||
switch (c) \
|
|
||||||
{ \
|
|
||||||
case 0: \
|
|
||||||
return vec_mergeh(a, b); \
|
|
||||||
case 1: \
|
|
||||||
return vec_mergel(vec_mergeh(a, a), b); \
|
|
||||||
case 2: \
|
|
||||||
return vec_mergeh(vec_mergel(a, a), b); \
|
|
||||||
default: \
|
|
||||||
return vec_mergel(a, b); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
VSX_IMPL_CLANG_4_PERMI(vec_udword2)
|
|
||||||
VSX_IMPL_CLANG_4_PERMI(vec_dword2)
|
|
||||||
VSX_IMPL_CLANG_4_PERMI(vec_double2)
|
|
||||||
|
|
||||||
// vec_xxsldwi is missing in clang 4
|
|
||||||
# define vec_xxsldwi(a, b, c) vec_sld(a, b, (c) * 4)
|
|
||||||
#else
|
|
||||||
// vec_xxpermdi is missing little-endian supports in clang 4 just like gcc4
|
// vec_xxpermdi is missing little-endian supports in clang 4 just like gcc4
|
||||||
# define vec_permi(a, b, c) vec_xxpermdi(b, a, (3 ^ (((c) & 1) << 1 | (c) >> 1)))
|
# define vec_permi(a, b, c) vec_xxpermdi(b, a, (3 ^ (((c) & 1) << 1 | (c) >> 1)))
|
||||||
#endif // __clang_major__ < 5
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// shift left double by word immediate
|
// shift left double by word immediate
|
||||||
@@ -429,25 +404,19 @@ VSX_IMPL_CONVERT(vec_double2, vec_dword2, vec_ctd)
|
|||||||
VSX_IMPL_CONVERT(vec_double2, vec_udword2, vec_ctd)
|
VSX_IMPL_CONVERT(vec_double2, vec_udword2, vec_ctd)
|
||||||
|
|
||||||
// converts word and doubleword to single-precision
|
// converts word and doubleword to single-precision
|
||||||
#if __clang_major__ > 4
|
#undef vec_ctf
|
||||||
# undef vec_ctf
|
|
||||||
#endif
|
|
||||||
VSX_IMPL_CONVERT(vec_float4, vec_int4, vec_ctf)
|
VSX_IMPL_CONVERT(vec_float4, vec_int4, vec_ctf)
|
||||||
VSX_IMPL_CONVERT(vec_float4, vec_uint4, vec_ctf)
|
VSX_IMPL_CONVERT(vec_float4, vec_uint4, vec_ctf)
|
||||||
VSX_REDIRECT_1RG(vec_float4, vec_dword2, vec_ctfo, __builtin_vsx_xvcvsxdsp)
|
VSX_REDIRECT_1RG(vec_float4, vec_dword2, vec_ctfo, __builtin_vsx_xvcvsxdsp)
|
||||||
VSX_REDIRECT_1RG(vec_float4, vec_udword2, vec_ctfo, __builtin_vsx_xvcvuxdsp)
|
VSX_REDIRECT_1RG(vec_float4, vec_udword2, vec_ctfo, __builtin_vsx_xvcvuxdsp)
|
||||||
|
|
||||||
// converts single and double precision to signed word
|
// converts single and double precision to signed word
|
||||||
#if __clang_major__ > 4
|
#undef vec_cts
|
||||||
# undef vec_cts
|
|
||||||
#endif
|
|
||||||
VSX_REDIRECT_1RG(vec_int4, vec_double2, vec_ctso, __builtin_vsx_xvcvdpsxws)
|
VSX_REDIRECT_1RG(vec_int4, vec_double2, vec_ctso, __builtin_vsx_xvcvdpsxws)
|
||||||
VSX_IMPL_CONVERT(vec_int4, vec_float4, vec_cts)
|
VSX_IMPL_CONVERT(vec_int4, vec_float4, vec_cts)
|
||||||
|
|
||||||
// converts single and double precision to unsigned word
|
// converts single and double precision to unsigned word
|
||||||
#if __clang_major__ > 4
|
#undef vec_ctu
|
||||||
# undef vec_ctu
|
|
||||||
#endif
|
|
||||||
VSX_REDIRECT_1RG(vec_uint4, vec_double2, vec_ctuo, __builtin_vsx_xvcvdpuxws)
|
VSX_REDIRECT_1RG(vec_uint4, vec_double2, vec_ctuo, __builtin_vsx_xvcvdpuxws)
|
||||||
VSX_IMPL_CONVERT(vec_uint4, vec_float4, vec_ctu)
|
VSX_IMPL_CONVERT(vec_uint4, vec_float4, vec_ctu)
|
||||||
|
|
||||||
@@ -510,7 +479,6 @@ VSX_IMPL_CONV_EVEN_2_4(vec_uint4, vec_double2, vec_ctu, vec_ctuo)
|
|||||||
* changing behavior of conversion intrinsics for gcc has effect on Eigen
|
* changing behavior of conversion intrinsics for gcc has effect on Eigen
|
||||||
* so we redefine old behavior again only on gcc, clang
|
* so we redefine old behavior again only on gcc, clang
|
||||||
*/
|
*/
|
||||||
#if !defined(__clang__) || __clang_major__ > 4
|
|
||||||
// ignoring second arg since Eigen only truncates toward zero
|
// ignoring second arg since Eigen only truncates toward zero
|
||||||
# define VSX_IMPL_CONV_2VARIANT(rt, rg, fnm, fn2) \
|
# define VSX_IMPL_CONV_2VARIANT(rt, rg, fnm, fn2) \
|
||||||
VSX_FINLINE(rt) fnm(const rg& a, int only_truncate) \
|
VSX_FINLINE(rt) fnm(const rg& a, int only_truncate) \
|
||||||
@@ -526,7 +494,6 @@ VSX_IMPL_CONV_EVEN_2_4(vec_uint4, vec_double2, vec_ctu, vec_ctuo)
|
|||||||
// define vec_cts for converting double precision to signed doubleword
|
// define vec_cts for converting double precision to signed doubleword
|
||||||
// which isn't compatible with xlc but its okay since Eigen only uses it for gcc
|
// which isn't compatible with xlc but its okay since Eigen only uses it for gcc
|
||||||
VSX_IMPL_CONV_2VARIANT(vec_dword2, vec_double2, vec_cts, vec_ctsl)
|
VSX_IMPL_CONV_2VARIANT(vec_dword2, vec_double2, vec_cts, vec_ctsl)
|
||||||
#endif // Eigen
|
|
||||||
|
|
||||||
#endif // Common GCC, CLANG compatibility
|
#endif // Common GCC, CLANG compatibility
|
||||||
|
|
||||||
|
|||||||
@@ -48,12 +48,6 @@
|
|||||||
namespace cv
|
namespace cv
|
||||||
{
|
{
|
||||||
|
|
||||||
// On Win64 optimized versions of DFT and DCT fail the tests (fixed in VS2010)
|
|
||||||
#if defined _MSC_VER && !defined CV_ICC && defined _M_X64 && _MSC_VER < 1600
|
|
||||||
# pragma optimize("", off)
|
|
||||||
# pragma warning(disable: 4748)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if IPP_VERSION_X100 >= 710
|
#if IPP_VERSION_X100 >= 710
|
||||||
#define USE_IPP_DFT 1
|
#define USE_IPP_DFT 1
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -58,10 +58,6 @@
|
|||||||
# include "opencv2/core/eigen.hpp"
|
# include "opencv2/core/eigen.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined _M_IX86 && defined _MSC_VER && _MSC_VER < 1700
|
|
||||||
#pragma float_control(precise, on)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace cv
|
namespace cv
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
#define HAVE_GCD
|
#define HAVE_GCD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined _MSC_VER && _MSC_VER >= 1600
|
#if defined _MSC_VER
|
||||||
#define HAVE_CONCURRENCY
|
#define HAVE_CONCURRENCY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -128,8 +128,6 @@
|
|||||||
#elif defined HAVE_GCD
|
#elif defined HAVE_GCD
|
||||||
#include <dispatch/dispatch.h>
|
#include <dispatch/dispatch.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#elif defined WINRT && _MSC_VER < 1900
|
|
||||||
#include <ppltasks.h>
|
|
||||||
#elif defined HAVE_CONCURRENCY
|
#elif defined HAVE_CONCURRENCY
|
||||||
#include <ppl.h>
|
#include <ppl.h>
|
||||||
#elif defined HAVE_PTHREADS_PF
|
#elif defined HAVE_PTHREADS_PF
|
||||||
|
|||||||
@@ -519,7 +519,7 @@ CoreTLSData& getCoreTlsData();
|
|||||||
#if defined(BUILD_SHARED_LIBS)
|
#if defined(BUILD_SHARED_LIBS)
|
||||||
#if defined _WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
#define CL_RUNTIME_EXPORT __declspec(dllexport)
|
#define CL_RUNTIME_EXPORT __declspec(dllexport)
|
||||||
#elif defined __GNUC__ && __GNUC__ >= 4
|
#elif defined __GNUC__
|
||||||
#define CL_RUNTIME_EXPORT __attribute__ ((visibility ("default")))
|
#define CL_RUNTIME_EXPORT __attribute__ ((visibility ("default")))
|
||||||
#else
|
#else
|
||||||
#define CL_RUNTIME_EXPORT
|
#define CL_RUNTIME_EXPORT
|
||||||
|
|||||||
@@ -869,7 +869,6 @@ TEST(Core_Allocation, alignedAllocation)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !(defined(__GNUC__) && __GNUC__ < 5) // GCC 4.8 emits: 'is_trivially_copyable' is not a member of 'std'
|
|
||||||
TEST(Core_Types, trivially_copyable)
|
TEST(Core_Types, trivially_copyable)
|
||||||
{
|
{
|
||||||
EXPECT_TRUE(std::is_trivially_copyable<cv::Complexd>::value);
|
EXPECT_TRUE(std::is_trivially_copyable<cv::Complexd>::value);
|
||||||
@@ -889,7 +888,6 @@ TEST(Core_Types, trivially_copyable_extra)
|
|||||||
EXPECT_TRUE(std::is_trivially_copyable<cv::TermCriteria>::value);
|
EXPECT_TRUE(std::is_trivially_copyable<cv::TermCriteria>::value);
|
||||||
EXPECT_TRUE(std::is_trivially_copyable<cv::Moments>::value);
|
EXPECT_TRUE(std::is_trivially_copyable<cv::Moments>::value);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
template <typename T> class Rect_Test : public testing::Test {};
|
template <typename T> class Rect_Test : public testing::Test {};
|
||||||
|
|
||||||
|
|||||||
@@ -100,11 +100,6 @@ CV_OperationsTest::~CV_OperationsTest() {}
|
|||||||
#define CHECK_DIFF(a, b) checkDiff(a, b, "(" #a ") != (" #b ") at l." STR(__LINE__))
|
#define CHECK_DIFF(a, b) checkDiff(a, b, "(" #a ") != (" #b ") at l." STR(__LINE__))
|
||||||
#define CHECK_DIFF_FLT(a, b) checkDiffF(a, b, "(" #a ") !=(eps) (" #b ") at l." STR(__LINE__))
|
#define CHECK_DIFF_FLT(a, b) checkDiffF(a, b, "(" #a ") !=(eps) (" #b ") at l." STR(__LINE__))
|
||||||
|
|
||||||
#if defined _MSC_VER && _MSC_VER < 1400
|
|
||||||
#define MSVC_OLD 1
|
|
||||||
#else
|
|
||||||
#define MSVC_OLD 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename _Tp> void CV_OperationsTest::TestType(Size sz, _Tp value)
|
template<typename _Tp> void CV_OperationsTest::TestType(Size sz, _Tp value)
|
||||||
{
|
{
|
||||||
@@ -295,9 +290,7 @@ bool CV_OperationsTest::TestMat()
|
|||||||
CHECK_DIFF(4.0 * (maskMat1 | maskMat1), maskMat4);
|
CHECK_DIFF(4.0 * (maskMat1 | maskMat1), maskMat4);
|
||||||
CHECK_DIFF((maskMat4 | maskMat4)/4.0, maskMat1);
|
CHECK_DIFF((maskMat4 | maskMat4)/4.0, maskMat1);
|
||||||
|
|
||||||
#if !MSVC_OLD
|
|
||||||
CHECK_DIFF(2.0 * (maskMat1 * 2.0) , maskMat4);
|
CHECK_DIFF(2.0 * (maskMat1 * 2.0) , maskMat4);
|
||||||
#endif
|
|
||||||
CHECK_DIFF((maskMat4 / 2.0) / 2.0 , maskMat1);
|
CHECK_DIFF((maskMat4 / 2.0) / 2.0 , maskMat1);
|
||||||
CHECK_DIFF(-(maskMat4 - maskMat5) , maskMat1);
|
CHECK_DIFF(-(maskMat4 - maskMat5) , maskMat1);
|
||||||
CHECK_DIFF(-((maskMat4 - maskMat5) * 1.0), maskMat1);
|
CHECK_DIFF(-((maskMat4 - maskMat5) * 1.0), maskMat1);
|
||||||
@@ -363,7 +356,6 @@ bool CV_OperationsTest::TestMat()
|
|||||||
|
|
||||||
m = maskMat1.clone(); m+=(maskMat1 * 3.0 + 1.0); CHECK_DIFF(m, maskMat5);
|
m = maskMat1.clone(); m+=(maskMat1 * 3.0 + 1.0); CHECK_DIFF(m, maskMat5);
|
||||||
m = maskMat5.clone(); m-=(maskMat1 * 3.0 + 1.0); CHECK_DIFF(m, maskMat1);
|
m = maskMat5.clone(); m-=(maskMat1 * 3.0 + 1.0); CHECK_DIFF(m, maskMat1);
|
||||||
#if !MSVC_OLD
|
|
||||||
m = mi.clone(); m+=(3.0 * mi * mt + d1); CHECK_DIFF_FLT(m, mi + d1 * 4);
|
m = mi.clone(); m+=(3.0 * mi * mt + d1); CHECK_DIFF_FLT(m, mi + d1 * 4);
|
||||||
m = mi.clone(); m-=(3.0 * mi * mt + d1); CHECK_DIFF_FLT(m, mi - d1 * 4);
|
m = mi.clone(); m-=(3.0 * mi * mt + d1); CHECK_DIFF_FLT(m, mi - d1 * 4);
|
||||||
m = mi.clone(); m*=(mt * 1.0); CHECK_DIFF_FLT(m, d1);
|
m = mi.clone(); m*=(mt * 1.0); CHECK_DIFF_FLT(m, d1);
|
||||||
@@ -420,7 +412,6 @@ bool CV_OperationsTest::TestMat()
|
|||||||
CHECK_DIFF_FLT(mt.inv() * mt, d1);
|
CHECK_DIFF_FLT(mt.inv() * mt, d1);
|
||||||
|
|
||||||
CHECK_DIFF_FLT(mt.inv() * (2*mt - mt), d1);
|
CHECK_DIFF_FLT(mt.inv() * (2*mt - mt), d1);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
catch (const test_excep& e)
|
catch (const test_excep& e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -93,10 +93,6 @@ endif()
|
|||||||
if(HAVE_CUDA)
|
if(HAVE_CUDA)
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
|
||||||
endif()
|
endif()
|
||||||
if(NOT HAVE_CXX11)
|
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-undef) # LANG_CXX11 from protobuf files
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(APPLE_FRAMEWORK)
|
if(APPLE_FRAMEWORK)
|
||||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshorten-64-to-32)
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshorten-64-to-32)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -55,15 +55,7 @@ enum class NearestMode {
|
|||||||
ROUND_PREFER_FLOOR
|
ROUND_PREFER_FLOOR
|
||||||
};
|
};
|
||||||
|
|
||||||
#if __cplusplus < 201703L
|
using std::clamp;
|
||||||
template<typename T>
|
|
||||||
static T clamp(T d, T min, T max)
|
|
||||||
{
|
|
||||||
return std::min(std::max(d, min), max);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#define clamp std::clamp
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline NearestMode parseNearestMode(const String& s)
|
static inline NearestMode parseNearestMode(const String& s)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,15 +15,7 @@ namespace cv
|
|||||||
namespace dnn
|
namespace dnn
|
||||||
{
|
{
|
||||||
|
|
||||||
#if __cplusplus < 201703L
|
using std::clamp;
|
||||||
template<typename T>
|
|
||||||
static T clamp(T d, T min, T max)
|
|
||||||
{
|
|
||||||
return std::min(std::max(d, min), max);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#define clamp std::clamp
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static MatShape inferTransformLayoutShape(const MatShape& inpshape_,
|
static MatShape inferTransformLayoutShape(const MatShape& inpshape_,
|
||||||
DataLayout outlayout,
|
DataLayout outlayout,
|
||||||
|
|||||||
@@ -9,12 +9,12 @@
|
|||||||
#define __OPENCV_DNN_ONNX_SIMPLIFIER_HPP__
|
#define __OPENCV_DNN_ONNX_SIMPLIFIER_HPP__
|
||||||
#ifdef HAVE_PROTOBUF
|
#ifdef HAVE_PROTOBUF
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
||||||
#endif
|
#endif
|
||||||
#include "opencv-onnx.pb.h"
|
#include "opencv-onnx.pb.h"
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -31,17 +31,12 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
|
||||||
#if defined _MSC_VER && _MSC_VER < 1910/*MSVS 2017*/
|
#if defined(__GNUC__)
|
||||||
#pragma warning(push)
|
|
||||||
#pragma warning(disable: 4503) // decorated name length exceeded, name was truncated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
||||||
#endif
|
#endif
|
||||||
#include "opencv-onnx.pb.h"
|
#include "opencv-onnx.pb.h"
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -28,17 +28,12 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#if defined _MSC_VER && _MSC_VER < 1910/*MSVS 2017*/
|
#if defined(__GNUC__)
|
||||||
#pragma warning(push)
|
|
||||||
#pragma warning(disable: 4503) // decorated name length exceeded, name was truncated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
||||||
#endif
|
#endif
|
||||||
#include "opencv-onnx.pb.h"
|
#include "opencv-onnx.pb.h"
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
#define INF_ENGINE_VER_MAJOR_LE(ver) (((INF_ENGINE_RELEASE) / 10000) <= ((ver) / 10000))
|
#define INF_ENGINE_VER_MAJOR_LE(ver) (((INF_ENGINE_RELEASE) / 10000) <= ((ver) / 10000))
|
||||||
#define INF_ENGINE_VER_MAJOR_EQ(ver) (((INF_ENGINE_RELEASE) / 10000) == ((ver) / 10000))
|
#define INF_ENGINE_VER_MAJOR_EQ(ver) (((INF_ENGINE_RELEASE) / 10000) == ((ver) / 10000))
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__)
|
||||||
//#pragma GCC diagnostic push
|
//#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
||||||
#endif
|
#endif
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
#include <openvino/pass/serialize.hpp>
|
#include <openvino/pass/serialize.hpp>
|
||||||
#include <openvino/pass/convert_fp32_to_fp16.hpp>
|
#include <openvino/pass/convert_fp32_to_fp16.hpp>
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__)
|
||||||
//#pragma GCC diagnostic pop
|
//#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Declaration of various functions which are related to Tensorflow models reading.
|
|||||||
#define __OPENCV_DNN_TF_IO_HPP__
|
#define __OPENCV_DNN_TF_IO_HPP__
|
||||||
#ifdef HAVE_PROTOBUF
|
#ifdef HAVE_PROTOBUF
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
||||||
#endif
|
#endif
|
||||||
@@ -22,7 +22,7 @@ Declaration of various functions which are related to Tensorflow models reading.
|
|||||||
#include <google/protobuf/message.h>
|
#include <google/protobuf/message.h>
|
||||||
#include <google/protobuf/text_format.h>
|
#include <google/protobuf/text_format.h>
|
||||||
#include <google/protobuf/io/zero_copy_stream_impl.h>
|
#include <google/protobuf/io/zero_copy_stream_impl.h>
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__GNUC__)
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -14,10 +14,8 @@ namespace cv
|
|||||||
|
|
||||||
struct Random
|
struct Random
|
||||||
{
|
{
|
||||||
static const uint64 default_seed = 0xffffffff;
|
|
||||||
#if __cplusplus < 201103L
|
|
||||||
typedef uint64 seed_type;
|
typedef uint64 seed_type;
|
||||||
#endif
|
static const uint64 default_seed = 0xffffffff;
|
||||||
|
|
||||||
RNG rng;
|
RNG rng;
|
||||||
|
|
||||||
|
|||||||
@@ -406,7 +406,7 @@ int GenericIndex<Distance>::radiusSearch(const std::vector<ElementType>& query,
|
|||||||
|
|
||||||
FLANN_DISTANCE_CHECK
|
FLANN_DISTANCE_CHECK
|
||||||
|
|
||||||
return nnIndex->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);
|
return nnIndex->radiusSearch(m_query,m_indices,m_dists,static_cast<float>(radius),searchParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Distance>
|
template <typename Distance>
|
||||||
@@ -426,7 +426,7 @@ int GenericIndex<Distance>::radiusSearch(const Mat& query, Mat& indices, Mat& di
|
|||||||
|
|
||||||
FLANN_DISTANCE_CHECK
|
FLANN_DISTANCE_CHECK
|
||||||
|
|
||||||
return nnIndex->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);
|
return nnIndex->radiusSearch(m_query,m_indices,m_dists,static_cast<float>(radius),searchParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -502,8 +502,8 @@ public:
|
|||||||
::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size());
|
::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size());
|
||||||
::cvflann::Matrix<DistanceType> m_dists(&dists[0], 1, dists.size());
|
::cvflann::Matrix<DistanceType> m_dists(&dists[0], 1, dists.size());
|
||||||
|
|
||||||
if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);
|
if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,static_cast<float>(radius),searchParams);
|
||||||
if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);
|
if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,static_cast<float>(radius),searchParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
CV_DEPRECATED int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)
|
CV_DEPRECATED int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)
|
||||||
@@ -520,8 +520,8 @@ public:
|
|||||||
CV_Assert(dists.isContinuous());
|
CV_Assert(dists.isContinuous());
|
||||||
::cvflann::Matrix<DistanceType> m_dists((DistanceType*)dists.ptr<DistanceType>(0), dists.rows, dists.cols);
|
::cvflann::Matrix<DistanceType> m_dists((DistanceType*)dists.ptr<DistanceType>(0), dists.rows, dists.cols);
|
||||||
|
|
||||||
if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);
|
if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,static_cast<float>(radius),searchParams);
|
||||||
if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);
|
if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,static_cast<float>(radius),searchParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
CV_DEPRECATED void save(String filename)
|
CV_DEPRECATED void save(String filename)
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
#include "nn_index.h"
|
#include "nn_index.h"
|
||||||
#include "dynamic_bitset.h"
|
#include "dynamic_bitset.h"
|
||||||
@@ -143,7 +144,8 @@ public:
|
|||||||
#ifndef OPENCV_FLANN_USE_STD_RAND
|
#ifndef OPENCV_FLANN_USE_STD_RAND
|
||||||
cv::randShuffle(vind_);
|
cv::randShuffle(vind_);
|
||||||
#else
|
#else
|
||||||
std::random_shuffle(vind_.begin(), vind_.end());
|
std::mt19937 std_rng(12345);
|
||||||
|
std::shuffle(vind_.begin(), vind_.end(), std_rng);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tree_roots_[i] = divideTree(vind_.data(), int(size_) );
|
tree_roots_[i] = divideTree(vind_.data(), int(size_) );
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
//! @cond IGNORED
|
//! @cond IGNORED
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <random>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
@@ -362,7 +363,8 @@ inline LshTable<unsigned char>::LshTable(unsigned int feature_size, unsigned int
|
|||||||
#ifndef OPENCV_FLANN_USE_STD_RAND
|
#ifndef OPENCV_FLANN_USE_STD_RAND
|
||||||
cv::randShuffle(indices);
|
cv::randShuffle(indices);
|
||||||
#else
|
#else
|
||||||
std::random_shuffle(indices.begin(), indices.end());
|
std::mt19937 std_rng(12345);
|
||||||
|
std::shuffle(indices.begin(), indices.end(), std_rng);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Generate a random set of order of subsignature_size_ bits
|
// Generate a random set of order of subsignature_size_ bits
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
namespace cvflann
|
namespace cvflann
|
||||||
{
|
{
|
||||||
@@ -127,7 +128,8 @@ public:
|
|||||||
#ifndef OPENCV_FLANN_USE_STD_RAND
|
#ifndef OPENCV_FLANN_USE_STD_RAND
|
||||||
cv::randShuffle(vals_);
|
cv::randShuffle(vals_);
|
||||||
#else
|
#else
|
||||||
std::random_shuffle(vals_.begin(), vals_.end());
|
std::mt19937 std_rng(12345);
|
||||||
|
std::shuffle(vals_.begin(), vals_.end(), std_rng);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
counter_ = 0;
|
counter_ = 0;
|
||||||
|
|||||||
@@ -4,10 +4,6 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#if defined (_MSC_VER) && (_MSC_VER <= 1700)
|
|
||||||
static inline double cbrt(double x) { return (double)cv::cubeRoot((float)x); };
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
void polishQuarticRoots(const double *coeffs, double *roots, int nb_roots) {
|
void polishQuarticRoots(const double *coeffs, double *roots, int nb_roots) {
|
||||||
const int iterations = 2;
|
const int iterations = 2;
|
||||||
|
|||||||
@@ -317,10 +317,6 @@ struct MomentsInTile_SIMD<ushort, int, int64>
|
|||||||
#endif // CV_SIMD || CV_SIMD_SCALABLE
|
#endif // CV_SIMD || CV_SIMD_SCALABLE
|
||||||
|
|
||||||
template<typename T, typename WT, typename MT>
|
template<typename T, typename WT, typename MT>
|
||||||
#if defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 9
|
|
||||||
// Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60196
|
|
||||||
__attribute__((optimize("no-tree-vectorize")))
|
|
||||||
#endif
|
|
||||||
static void momentsInTile( const Mat& img, double* moments )
|
static void momentsInTile( const Mat& img, double* moments )
|
||||||
{
|
{
|
||||||
Size size = img.size();
|
Size size = img.size();
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
#include <opencv2/core/utils/configuration.private.hpp>
|
#include <opencv2/core/utils/configuration.private.hpp>
|
||||||
#include <opencv2/core/utils/logger.hpp>
|
#include <opencv2/core/utils/logger.hpp>
|
||||||
|
|
||||||
#if defined _MSC_VER && _MSC_VER >= 1200
|
#if defined _MSC_VER
|
||||||
# pragma warning( disable: 4100 4244 4267 )
|
# pragma warning( disable: 4100 4244 4267 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@
|
|||||||
#include "grfmt_png.hpp"
|
#include "grfmt_png.hpp"
|
||||||
#include <opencv2/core/utils/logger.hpp>
|
#include <opencv2/core/utils/logger.hpp>
|
||||||
|
|
||||||
#if defined _MSC_VER && _MSC_VER >= 1200
|
#if defined _MSC_VER
|
||||||
// interaction between '_setjmp' and C++ object destruction is non-portable
|
// interaction between '_setjmp' and C++ object destruction is non-portable
|
||||||
#pragma warning( disable: 4611 )
|
#pragma warning( disable: 4611 )
|
||||||
#pragma warning( disable: 4244 )
|
#pragma warning( disable: 4244 )
|
||||||
|
|||||||
@@ -44,14 +44,6 @@
|
|||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
|
||||||
// std::isnan is a part of C++11 and it is not supported in MSVS2010/2012
|
|
||||||
#if defined _MSC_VER && _MSC_VER < 1800 /* MSVC 2013 */
|
|
||||||
#include <float.h>
|
|
||||||
namespace std {
|
|
||||||
template <typename T> bool isnan(T value) { return _isnan(value) != 0; }
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <typename T> struct pixelInfo_
|
template <typename T> struct pixelInfo_
|
||||||
{
|
{
|
||||||
static const int channels = 1;
|
static const int channels = 1;
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__OPENCV_BUILD) && defined(__GNUC__)
|
||||||
//#pragma GCC diagnostic push
|
//#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
||||||
#endif
|
#endif
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
|
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
|
||||||
#endif
|
#endif
|
||||||
#include "opencv2/ts/ts_gtest.h"
|
#include "opencv2/ts/ts_gtest.h"
|
||||||
#if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5
|
#if defined(__OPENCV_BUILD) && defined(__GNUC__)
|
||||||
//#pragma GCC diagnostic pop
|
//#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
#if defined(__OPENCV_BUILD) && defined(__clang__) && ((__clang_major__*100 + __clang_minor__) >= 1301)
|
#if defined(__OPENCV_BUILD) && defined(__clang__) && ((__clang_major__*100 + __clang_minor__) >= 1301)
|
||||||
|
|||||||
@@ -60,9 +60,6 @@ using namespace cv;
|
|||||||
|
|
||||||
#define CALC_FFMPEG_VERSION(a,b,c) ( a<<16 | b<<8 | c )
|
#define CALC_FFMPEG_VERSION(a,b,c) ( a<<16 | b<<8 | c )
|
||||||
|
|
||||||
#if defined _MSC_VER && _MSC_VER >= 1200
|
|
||||||
#pragma warning( disable: 4244 4510 4610 )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
@@ -162,12 +159,6 @@ inline static AVRational av_make_q(int num, int den)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// GCC 4.x compilation bug. Details: https://github.com/opencv/opencv/issues/20292
|
|
||||||
#if (defined(__GNUC__) && __GNUC__ < 5) && !defined(__clang__)
|
|
||||||
#undef USE_AV_HW_CODECS
|
|
||||||
#define USE_AV_HW_CODECS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//#define USE_AV_HW_CODECS 0
|
//#define USE_AV_HW_CODECS 0
|
||||||
#ifndef USE_AV_HW_CODECS
|
#ifndef USE_AV_HW_CODECS
|
||||||
#if LIBAVUTIL_VERSION_MAJOR >= 56 // FFMPEG 4.0+
|
#if LIBAVUTIL_VERSION_MAJOR >= 56 // FFMPEG 4.0+
|
||||||
@@ -178,9 +169,7 @@ inline static AVRational av_make_q(int num, int den)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined _MSC_VER && _MSC_VER >= 1200
|
|
||||||
#pragma warning( default: 4244 4510 4610 )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
#define CV_WARN(message)
|
#define CV_WARN(message)
|
||||||
@@ -190,13 +179,6 @@ inline static AVRational av_make_q(int num, int den)
|
|||||||
|
|
||||||
#if defined _WIN32
|
#if defined _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#if defined _MSC_VER && _MSC_VER < 1900
|
|
||||||
struct timespec
|
|
||||||
{
|
|
||||||
time_t tv_sec;
|
|
||||||
long tv_nsec;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__
|
#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ extern "C"
|
|||||||
# define OPENCV_FFMPEG_API
|
# define OPENCV_FFMPEG_API
|
||||||
#elif defined _WIN32
|
#elif defined _WIN32
|
||||||
# define OPENCV_FFMPEG_API __declspec(dllexport)
|
# define OPENCV_FFMPEG_API __declspec(dllexport)
|
||||||
#elif defined __GNUC__ && __GNUC__ >= 4
|
#elif defined __GNUC__
|
||||||
# define OPENCV_FFMPEG_API __attribute__ ((visibility ("default")))
|
# define OPENCV_FFMPEG_API __attribute__ ((visibility ("default")))
|
||||||
#else
|
#else
|
||||||
# define OPENCV_FFMPEG_API
|
# define OPENCV_FFMPEG_API
|
||||||
|
|||||||
Reference in New Issue
Block a user