Skip to content

Commit 59306da

Browse files
committed
Update to OpenCV 4.10.0
1 parent 5b847dd commit 59306da

File tree

92 files changed

+1965
-685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1965
-685
lines changed

README.md

Lines changed: 61 additions & 248 deletions
Large diffs are not rendered by default.

autoit-addon/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
1212
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
1313
endif()
1414

15-
set(OpenCV_VERSION 4.9.0 CACHE STRING "Choose the OpenCV version.")
15+
set(OpenCV_VERSION 4.10.0 CACHE STRING "Choose the OpenCV version.")
1616
file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/../autoit-opencv-com/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake" SYMBOLIC)
1717
file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/../autoit-opencv-com/patches" "${CMAKE_CURRENT_SOURCE_DIR}/patches" SYMBOLIC)
1818
include(cmake/RequireOpenCV.cmake)

autoit-addon/addon.au3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Func _Addon_DLLClose()
1414
EndFunc ;==>_Addon_DLLClose
1515

1616
Func _Addon_FindDLL($sFile = Default, $sFilter = Default, $sDir = Default, $bReverse = Default)
17-
If $sFile == Default Then $sFile = "autoit_addon490*"
17+
If $sFile == Default Then $sFile = "autoit_addon4100*"
1818
Local $_cv_build_type = EnvGet("OPENCV_BUILD_TYPE")
1919
Local $sBuildType = $_cv_build_type == "Debug" ? "Debug" : "Release"
2020
Local $sPostfix = $_cv_build_type == "Debug" ? "d" : ""

autoit-opencv-com/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ file(GLOB_RECURSE files_to_change
4444
../samples/*.psm1
4545
../samples/*.py
4646
../scripts/build.js
47+
../scripts/manual.sh
4748
../src/gen.js
4849
)
4950

@@ -234,9 +235,11 @@ foreach( BUILD_TYPE ${CMAKE_CONFIGURATION_TYPES} )
234235
set_target_properties(interop_opencv PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${BUILD_TYPE_UPPER} "${EXECUTABLE_OUTPUT_PATH}/${BUILD_TYPE}/dotnet")
235236
endforeach()
236237

238+
set(target_name interop_opencv)
237239
# Always generate debug files
238-
if(MSVC AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
239-
target_compile_options(interop_opencv PRIVATE "-debug:pdbonly")
240+
if(MSVC)
241+
target_compile_options(${target_name} PRIVATE $<$<NOT:$<CONFIG:Debug>>:-debug:pdbonly>)
242+
target_compile_options(${target_name} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:/unsafe>)
240243
endif()
241244

242245
# ===============
@@ -284,9 +287,11 @@ set_target_properties(cs_test PROPERTIES
284287

285288
add_dependencies(cs_test cs_assembly)
286289

290+
set(target_name cs_test)
287291
# Always generate debug files
288-
if(MSVC AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
289-
target_compile_options(cs_test PRIVATE "-debug:pdbonly")
292+
if(MSVC)
293+
target_compile_options(${target_name} PRIVATE $<$<NOT:$<CONFIG:Debug>>:-debug:pdbonly>)
294+
target_compile_options(${target_name} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:/unsafe>)
290295
endif()
291296

292297
endif()

autoit-opencv-com/cmake/FindPatch.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
find_package(Git)
2+
13
# https://github.com/scivision/cmake-patch-file/blob/main/cmake/PatchFile.cmake
24
if(WIN32)
35
# prioritize Git Patch on Windows as other Patches may be very old and incompatible.
4-
find_package(Git)
56
if(Git_FOUND)
67
get_filename_component(GIT_DIR ${GIT_EXECUTABLE} DIRECTORY)
78
get_filename_component(GIT_DIR ${GIT_DIR} DIRECTORY)

autoit-opencv-com/cmake/RequireOpenCV.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ include(cmake/FindPatch.cmake)
22

33
set(BUILD_opencv OFF CACHE BOOL "Build opencv from sources.")
44

5+
set(OpenCV_URL_HASH_4100 bff38466091c313dac21a0b73eea8278316a89c1d434c6f0b10697e087670168)
56
set(OpenCV_URL_HASH_490 fefddff0623fbd5a6fa0cecb9bccd4b822478354e6c587ebb6e40ab09dacba51)
67
set(OpenCV_URL_HASH_481 037dd1c5c172237b0a00ee822684e5ac453028e1933111a2c547b62061f8b7e4)
78
set(OpenCV_URL_HASH_480 1c8b1b78a51c46852eb5569d762bd11d0097a45c3db1f03eb41aba6f727b8942)
@@ -14,8 +15,8 @@ set(OpenCV_URL_HASH_452 106b588a82b3045a44305ba426c281887416745d4ce8f3983156d9f8
1415
set(OpenCV_URL_HASH_451 32132dd0bf38c62f73a2f20a0b19785282364f35e19c403f0767aa0266ed410d)
1516
set(OpenCV_URL_HASH_450 65c6b872cfcb1f55f8bedee8b64dc9c4c549035a566ac5ace622a4627c03bcf9)
1617

17-
set(OpenCV_VERSION 4.9.0 CACHE STRING "Choose the OpenCV version.")
18-
set_property(CACHE OpenCV_VERSION PROPERTY STRINGS "4.9.0" "4.8.1" "4.8.0" "4.7.0" "4.6.0" "4.5.5" "4.5.4" "4.5.3" "4.5.2" "4.5.1" "4.5.0")
18+
set(OpenCV_VERSION 4.10.0 CACHE STRING "Choose the OpenCV version.")
19+
set_property(CACHE OpenCV_VERSION PROPERTY STRINGS "4.10.0" "4.9.0" "4.8.1" "4.8.0" "4.7.0" "4.6.0" "4.5.5" "4.5.4" "4.5.3" "4.5.2" "4.5.1" "4.5.0")
1920
string(REPLACE "." "" OpenCV_DLLVERSION ${OpenCV_VERSION})
2021

2122
if (OpenCV_DLLVERSION GREATER_EQUAL 470)

autoit-opencv-com/cmake/git_patch_once.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
find_package(Git)
2+
13
execute_process(
24
COMMAND "${GIT_EXECUTABLE}" apply --check -R "${PATCH_FILE}"
35
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"

autoit-opencv-com/dotnet/OpenCvComInterop.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public static void DllOpen(string openCvWorldDll, string openCvComDll)
9292
}
9393

9494
var parts = openCvWorldDll.Split(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
95-
parts[parts.Length - 1] = "opencv_videoio_ffmpeg490_64.dll";
95+
parts[parts.Length - 1] = "opencv_videoio_ffmpeg4100_64.dll";
9696
var openCvFfmpegDll = string.Join(Path.DirectorySeparatorChar.ToString(), parts);
9797
hOpenCvFfmpeg = LoadLibrary(openCvFfmpegDll);
9898
if (hOpenCvFfmpeg == IntPtr.Zero)
@@ -459,8 +459,8 @@ public static string FindDLL(string path, string filter = null, string rootPath
459459
"autoit-opencv-com",
460460
"autoit-opencv-com\\build_x64\\bin\\" + buildType,
461461
"opencv\\build\\x64\\vc*\\bin",
462-
"opencv-4.9.0-*\\build\\x64\\vc*\\bin",
463-
"opencv-4.9.0-*\\opencv\\build\\x64\\vc*\\bin"
462+
"opencv-4.10.0-*\\build\\x64\\vc*\\bin",
463+
"opencv-4.10.0-*\\opencv\\build\\x64\\vc*\\bin"
464464
};
465465

466466
return FindFile(path + postSuffix + ".dll", rootPath, filter, hints.ToArray());

autoit-opencv-com/install.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141

4242
:mainmenu
4343
@SET DLLDIRNAME=
44-
@SET DLLNAME=autoit_opencv_com490%DEBUG_PREFIX%.dll
44+
@SET DLLNAME=autoit_opencv_com4100%DEBUG_PREFIX%.dll
4545

4646
@IF EXIST "%CD%\build_x64\%INT_DIR%\%DLLNAME%" @SET "DLLDIRNAME=%CD%\build_x64\%INT_DIR%\"
47-
@IF EXIST "%CD%\..\opencv-4.9.0-windows\opencv\build\x64\vc16\bin" @SET "PATH=%CD%\..\opencv-4.9.0-windows\opencv\build\x64\vc16\bin;%PATH%"
47+
@IF EXIST "%CD%\..\opencv-4.10.0-windows\opencv\build\x64\vc16\bin" @SET "PATH=%CD%\..\opencv-4.10.0-windows\opencv\build\x64\vc16\bin;%PATH%"
4848

4949
@SET DLLNAME=%DLLDIRNAME%%DLLNAME%
5050

autoit-opencv-com/patches/001-opencv-src.patch

Lines changed: 88 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,89 @@
1+
diff --git a/modules/dnn/src/caffe/caffe_importer.cpp b/modules/dnn/src/caffe/caffe_importer.cpp
2+
index 6606fc301..a2e3cb2d6 100644
3+
--- a/modules/dnn/src/caffe/caffe_importer.cpp
4+
+++ b/modules/dnn/src/caffe/caffe_importer.cpp
5+
@@ -51,6 +51,7 @@
6+
#include <google/protobuf/io/zero_copy_stream_impl.h>
7+
#include <google/protobuf/reflection.h>
8+
#include "caffe_io.hpp"
9+
+#include <google/protobuf/port_def.inc>
10+
#endif
11+
12+
#include <opencv2/core/utils/fp_control_utils.hpp>
13+
@@ -595,6 +596,7 @@ Net readNetFromCaffe(const std::vector<uchar>& bufferProto, const std::vector<uc
14+
bufferModelPtr, bufferModel.size());
15+
}
16+
17+
+#include <google/protobuf/port_undef.inc>
18+
#else // HAVE_PROTOBUF
19+
20+
#define DNN_PROTOBUF_UNSUPPORTED() CV_Error(Error::StsError, "DNN/Caffe: Build OpenCV with Protobuf to import Caffe models")
21+
diff --git a/modules/gapi/include/opencv2/gapi/util/variant.hpp b/modules/gapi/include/opencv2/gapi/util/variant.hpp
22+
index 48b55646c..9b20a12b3 100644
23+
--- a/modules/gapi/include/opencv2/gapi/util/variant.hpp
24+
+++ b/modules/gapi/include/opencv2/gapi/util/variant.hpp
25+
@@ -132,7 +132,7 @@ namespace util
26+
static bool help(const Memory lhs, const Memory rhs) {
27+
const T& t_lhs = *reinterpret_cast<const T*>(lhs);
28+
const T& t_rhs = *reinterpret_cast<const T*>(rhs);
29+
- return t_lhs == t_rhs;
30+
+ return static_cast<bool>(t_lhs == t_rhs);
31+
}
32+
};
33+
34+
diff --git a/modules/gapi/src/backends/fluid/gfluidcore.cpp b/modules/gapi/src/backends/fluid/gfluidcore.cpp
35+
index 50615b265..c19a19b46 100644
36+
--- a/modules/gapi/src/backends/fluid/gfluidcore.cpp
37+
+++ b/modules/gapi/src/backends/fluid/gfluidcore.cpp
38+
@@ -32,6 +32,15 @@
39+
#include <cassert>
40+
#include <cstdlib>
41+
42+
+// Windows declares several inconvenient macro names. We #undef them and then
43+
+// restore them after
44+
+#ifdef _MSC_VER
45+
+#pragma push_macro("MM_MIN")
46+
+#undef MM_MIN
47+
+#pragma push_macro("MM_MAX")
48+
+#undef MM_MAX
49+
+#endif // _MSC_VER
50+
+
51+
namespace cv {
52+
namespace gapi {
53+
namespace fluid {
54+
@@ -2582,6 +2591,12 @@ GAPI_FLUID_KERNEL(GFluidSqrt, cv::gapi::core::GSqrt, false)
55+
} // namespace gapi
56+
} // namespace cv
57+
58+
+// Restore macro that may have been #undef'd.
59+
+#ifdef _MSC_VER
60+
+#pragma pop_macro("MM_MIN")
61+
+#pragma pop_macro("MM_MAX")
62+
+#endif
63+
+
64+
cv::GKernelPackage cv::gapi::core::fluid::kernels()
65+
{
66+
using namespace cv::gapi::fluid;
67+
diff --git a/modules/highgui/src/window_w32.cpp b/modules/highgui/src/window_w32.cpp
68+
index a3a71a6cc..07e455337 100644
69+
--- a/modules/highgui/src/window_w32.cpp
70+
+++ b/modules/highgui/src/window_w32.cpp
71+
@@ -654,11 +654,11 @@ double cvGetPropTopmost_W32(const char* name)
72+
73+
static double getPropTopmost_(CvWindow& window)
74+
{
75+
- LONG style = GetWindowLongA(window.frame, GWL_EXSTYLE); // -20
76+
+ LONG style = GetWindowLong(window.frame, GWL_EXSTYLE); // -20
77+
if (!style)
78+
{
79+
std::ostringstream errorMsg;
80+
- errorMsg << "window(" << window.name << "): failed to retrieve extended window style using GetWindowLongA(); error code: " << GetLastError();
81+
+ errorMsg << "window(" << window.name << "): failed to retrieve extended window style using GetWindowLong(); error code: " << GetLastError();
82+
CV_Error(Error::StsError, errorMsg.str());
83+
}
84+
185
diff --git a/modules/python/src2/hdr_parser.py b/modules/python/src2/hdr_parser.py
2-
index 710c79217..6e0062ece 100755
86+
index 0dc5dd148..132dbcecb 100755
387
--- a/modules/python/src2/hdr_parser.py
488
+++ b/modules/python/src2/hdr_parser.py
589
@@ -70,6 +70,29 @@ class CppHeaderParser(object):
@@ -67,7 +151,7 @@ index 710c79217..6e0062ece 100755
67151
func_modlist.append("="+arg)
68152
decl_str = decl_str[:npos] + decl_str[npos3+1:]
69153
npos = decl_str.find("CV_WRAP_PHANTOM")
70-
@@ -645,10 +682,13 @@ class CppHeaderParser(object):
154+
@@ -654,10 +691,13 @@ class CppHeaderParser(object):
71155

72156
the function will convert "A" to "cv.A" and "f" to "cv.A.f".
73157
"""
@@ -84,7 +168,7 @@ index 710c79217..6e0062ece 100755
84168
qualified_name = (("." in name) or ("::" in name))
85169
n = ""
86170
for b in self.block_stack:
87-
@@ -740,7 +780,10 @@ class CppHeaderParser(object):
171+
@@ -749,7 +789,10 @@ class CppHeaderParser(object):
88172

89173
if stmt.startswith("enum") or stmt.startswith("namespace"):
90174
# NB: Drop inheritance syntax for enum
@@ -96,7 +180,7 @@ index 710c79217..6e0062ece 100755
96180
stmt_list = stmt.rsplit(" ", 1)
97181
if len(stmt_list) < 2:
98182
stmt_list.append("<unnamed>")
99-
@@ -776,8 +819,18 @@ class CppHeaderParser(object):
183+
@@ -785,8 +828,18 @@ class CppHeaderParser(object):
100184
var_modlist = []
101185
if "CV_PROP_RW" in stmt:
102186
var_modlist.append("/RW")

0 commit comments

Comments
 (0)