Skip to content

Commit

Permalink
[OpenCV] update to 4.5.2 (#18572)
Browse files Browse the repository at this point in the history
* [OpenCV] update to 4.5.2

* update version refs

* [OpenCV4] fix qt integration

* fix refs
  • Loading branch information
cenit authored Jun 21, 2021
1 parent cff982f commit a7d3367
Show file tree
Hide file tree
Showing 19 changed files with 138 additions and 64 deletions.
2 changes: 1 addition & 1 deletion ports/opencv/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opencv",
"version": "4.5.1",
"version": "4.5.2",
"description": "Computer vision library",
"homepage": "https://github.com/opencv/opencv",
"dependencies": [
Expand Down
6 changes: 3 additions & 3 deletions ports/opencv3/0002-install-options.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fcb4a1d..5810b0c 100644
index f6a2da5..10aa531 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -607,7 +607,7 @@ endif()
Expand All @@ -12,10 +12,10 @@ index fcb4a1d..5810b0c 100644
endif()

diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake
index 8a3dcdb..b8b3bae 100644
index 3cb10a1..fc81377 100644
--- a/cmake/OpenCVCompilerOptions.cmake
+++ b/cmake/OpenCVCompilerOptions.cmake
@@ -262,7 +262,6 @@ if(MSVC)
@@ -276,7 +276,6 @@ if(MSVC)
#endif()

if(BUILD_WITH_DEBUG_INFO)
Expand Down
32 changes: 16 additions & 16 deletions ports/opencv3/0003-force-package-requirements.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake
index f99bb33..5407f70 100644
index 2d28dff..6dbeca9 100644
--- a/cmake/OpenCVFindLibsGrfmt.cmake
+++ b/cmake/OpenCVFindLibsGrfmt.cmake
@@ -7,7 +7,7 @@ if(BUILD_ZLIB)
ocv_clear_vars(ZLIB_FOUND)
else()
ocv_clear_internal_cache_vars(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
@@ -11,7 +11,7 @@ else()
set(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_SUFFIXES .so)
endif()
- find_package(ZLIB "${MIN_VER_ZLIB}")
+ find_package(ZLIB "${MIN_VER_ZLIB}" REQUIRED)
if(ZLIB_FOUND AND ANDROID)
if(ZLIB_LIBRARIES MATCHES "/usr/(lib|lib32|lib64)/libz.so$")
set(ZLIB_LIBRARIES z)
@@ -33,7 +33,7 @@ if(WITH_JPEG)
if(ANDROID)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
unset(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
@@ -41,7 +41,7 @@ if(WITH_JPEG)
ocv_clear_vars(JPEG_FOUND)
else()
ocv_clear_internal_cache_vars(JPEG_LIBRARY JPEG_INCLUDE_DIR)
Expand All @@ -20,7 +20,7 @@ index f99bb33..5407f70 100644
endif()

if(NOT JPEG_FOUND)
@@ -79,7 +79,7 @@ if(WITH_TIFF)
@@ -87,7 +87,7 @@ if(WITH_TIFF)
ocv_clear_vars(TIFF_FOUND)
else()
ocv_clear_internal_cache_vars(TIFF_LIBRARY TIFF_INCLUDE_DIR)
Expand All @@ -29,7 +29,7 @@ index f99bb33..5407f70 100644
if(TIFF_FOUND)
ocv_parse_header("${TIFF_INCLUDE_DIR}/tiff.h" TIFF_VERSION_LINES TIFF_VERSION_CLASSIC TIFF_VERSION_BIG TIFF_VERSION TIFF_BIGTIFF_VERSION)
endif()
@@ -123,7 +123,7 @@ if(WITH_WEBP)
@@ -131,7 +131,7 @@ if(WITH_WEBP)
ocv_clear_vars(WEBP_FOUND WEBP_LIBRARY WEBP_LIBRARIES WEBP_INCLUDE_DIR)
else()
ocv_clear_internal_cache_vars(WEBP_LIBRARY WEBP_INCLUDE_DIR)
Expand All @@ -38,7 +38,7 @@ index f99bb33..5407f70 100644
if(WEBP_FOUND)
set(HAVE_WEBP 1)
endif()
@@ -164,7 +164,7 @@ if(WITH_JASPER)
@@ -172,7 +172,7 @@ if(WITH_JASPER)
if(BUILD_JASPER)
ocv_clear_vars(JASPER_FOUND)
else()
Expand All @@ -47,7 +47,7 @@ index f99bb33..5407f70 100644
endif()

if(NOT JASPER_FOUND)
@@ -189,7 +189,7 @@ if(WITH_PNG)
@@ -197,7 +197,7 @@ if(WITH_PNG)
ocv_clear_vars(PNG_FOUND)
else()
ocv_clear_internal_cache_vars(PNG_LIBRARY PNG_INCLUDE_DIR)
Expand All @@ -56,7 +56,7 @@ index f99bb33..5407f70 100644
if(PNG_FOUND)
include(CheckIncludeFile)
check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H)
@@ -221,7 +221,7 @@ if(WITH_OPENEXR)
@@ -229,7 +229,7 @@ if(WITH_OPENEXR)
ocv_clear_vars(HAVE_OPENEXR)
if(NOT BUILD_OPENEXR)
ocv_clear_internal_cache_vars(OPENEXR_INCLUDE_PATHS OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_VERSION)
Expand All @@ -65,7 +65,7 @@ index f99bb33..5407f70 100644
endif()

if(OPENEXR_FOUND)
@@ -239,7 +239,7 @@ endif()
@@ -247,7 +247,7 @@ endif()

# --- GDAL (optional) ---
if(WITH_GDAL)
Expand All @@ -74,7 +74,7 @@ index f99bb33..5407f70 100644

if(NOT GDAL_FOUND)
set(HAVE_GDAL NO)
@@ -251,7 +251,7 @@ if(WITH_GDAL)
@@ -259,7 +259,7 @@ if(WITH_GDAL)
endif()

if(WITH_GDCM)
Expand Down
4 changes: 2 additions & 2 deletions ports/opencv3/0006-fix-uwp.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake
index efb6ca8..8ca8609 100644
index bcbca83..872f05f 100644
--- a/cmake/OpenCVModule.cmake
+++ b/cmake/OpenCVModule.cmake
@@ -1184,7 +1184,7 @@ function(ocv_add_perf_tests)
@@ -1186,7 +1186,7 @@ function(ocv_add_perf_tests)
set_target_properties(${the_target} PROPERTIES FOLDER "tests performance")
endif()

Expand Down
4 changes: 2 additions & 2 deletions ports/opencv3/0008-devendor-quirc.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5810b0c..04315e3 100644
index 10aa531..74e5ca4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -771,7 +771,7 @@ if(WITH_OPENVX)
@@ -778,7 +778,7 @@ if(WITH_OPENVX)
endif()

if(WITH_QUIRC)
Expand Down
7 changes: 4 additions & 3 deletions ports/opencv3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv4")
message(FATAL_ERROR "OpenCV 4 is installed, please uninstall and try again:\n vcpkg remove opencv4")
endif()

set(OPENCV_VERSION "3.4.13")
set(OPENCV_VERSION "3.4.14")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO opencv/opencv
REF ${OPENCV_VERSION}
SHA512 ec87b10534b9187c5ac2eea498c05c73bceab08afaed93b5a117ed34d1eeeb0ffc45901642bebf8f55126fd49ec78d731fc61debe6b40d8642f1323b5dbbeacf
SHA512 b8373ead40549e3d487227947c6bd00f6eba368e48bb9356d41cb0f3bfabfb0b10b6e64712febc11ab1e5a1901b1db8b83b63ba492f4e3816c15fa7ddaaf7e69
HEAD_REF master
PATCHES
0001-disable-downloading.patch
Expand All @@ -39,6 +39,7 @@ file(REMOVE "${SOURCE_PATH}/cmake/FindCUDNN.cmake")
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_WITH_STATIC_CRT)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"contrib" WITH_CONTRIB
"cuda" WITH_CUBLAS
"cuda" WITH_CUDA
Expand Down Expand Up @@ -114,7 +115,7 @@ if("contrib" IN_LIST FEATURES)
OUT_SOURCE_PATH CONTRIB_SOURCE_PATH
REPO opencv/opencv_contrib
REF ${OPENCV_VERSION}
SHA512 49f0aed8e07a443f354859a16c8de5ceae26560f141721ae4beb0d5fcc5b24b755ee313519e159b1a5b6ba125dcca8584f2a515e0ac96a8c9c36bb11ac6b3375
SHA512 30f4f25e40908a9d823304197c475dc0f1ae2b24ec5b1ce0484b39959b88897d1291b5b0e12530db24af96d664e90137582e4b03e4dca7fde1319044bdec9b77
HEAD_REF master
PATCHES
0007-fix-hdf5.patch
Expand Down
2 changes: 1 addition & 1 deletion ports/opencv3/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opencv3",
"version": "3.4.13",
"version": "3.4.14",
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"dependencies": [
Expand Down
8 changes: 4 additions & 4 deletions ports/opencv4/0002-install-options.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 45fc6de..9cd2b4e 100644
index 5a0c62e..118b318 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -607,7 +607,7 @@ endif()
@@ -610,7 +610,7 @@ endif()
ocv_cmake_hook(POST_CMAKE_BUILD_OPTIONS)

# --- Python Support ---
Expand All @@ -12,10 +12,10 @@ index 45fc6de..9cd2b4e 100644
endif()

diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake
index 5e3c056..19f5795 100644
index 40a058d..04f50fb 100644
--- a/cmake/OpenCVCompilerOptions.cmake
+++ b/cmake/OpenCVCompilerOptions.cmake
@@ -264,7 +264,6 @@ if(MSVC)
@@ -278,7 +278,6 @@ if(MSVC)
#endif()

if(BUILD_WITH_DEBUG_INFO)
Expand Down
34 changes: 17 additions & 17 deletions ports/opencv4/0003-force-package-requirements.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake
index 2e4e4af..8cd9c75 100644
index 23a6ca6..8ea5497 100644
--- a/cmake/OpenCVFindLibsGrfmt.cmake
+++ b/cmake/OpenCVFindLibsGrfmt.cmake
@@ -7,7 +7,7 @@ if(BUILD_ZLIB)
ocv_clear_vars(ZLIB_FOUND)
else()
ocv_clear_internal_cache_vars(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
@@ -11,7 +11,7 @@ else()
set(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_SUFFIXES .so)
endif()
- find_package(ZLIB "${MIN_VER_ZLIB}")
+ find_package(ZLIB "${MIN_VER_ZLIB}" REQUIRED)
if(ZLIB_FOUND AND ANDROID)
if(ZLIB_LIBRARIES MATCHES "/usr/(lib|lib32|lib64)/libz.so$")
set(ZLIB_LIBRARIES z)
@@ -33,7 +33,7 @@ if(WITH_JPEG)
if(ANDROID)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
unset(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
@@ -41,7 +41,7 @@ if(WITH_JPEG)
ocv_clear_vars(JPEG_FOUND)
else()
ocv_clear_internal_cache_vars(JPEG_LIBRARY JPEG_INCLUDE_DIR)
Expand All @@ -20,7 +20,7 @@ index 2e4e4af..8cd9c75 100644
endif()

if(NOT JPEG_FOUND)
@@ -79,7 +79,7 @@ if(WITH_TIFF)
@@ -87,7 +87,7 @@ if(WITH_TIFF)
ocv_clear_vars(TIFF_FOUND)
else()
ocv_clear_internal_cache_vars(TIFF_LIBRARY TIFF_INCLUDE_DIR)
Expand All @@ -29,7 +29,7 @@ index 2e4e4af..8cd9c75 100644
if(TIFF_FOUND)
ocv_parse_header("${TIFF_INCLUDE_DIR}/tiff.h" TIFF_VERSION_LINES TIFF_VERSION_CLASSIC TIFF_VERSION_BIG TIFF_VERSION TIFF_BIGTIFF_VERSION)
endif()
@@ -123,7 +123,7 @@ if(WITH_WEBP)
@@ -131,7 +131,7 @@ if(WITH_WEBP)
ocv_clear_vars(WEBP_FOUND WEBP_LIBRARY WEBP_LIBRARIES WEBP_INCLUDE_DIR)
else()
ocv_clear_internal_cache_vars(WEBP_LIBRARY WEBP_INCLUDE_DIR)
Expand All @@ -38,7 +38,7 @@ index 2e4e4af..8cd9c75 100644
if(WEBP_FOUND)
set(HAVE_WEBP 1)
endif()
@@ -164,7 +164,7 @@ if(WITH_OPENJPEG)
@@ -172,7 +172,7 @@ if(WITH_OPENJPEG)
if(BUILD_OPENJPEG)
ocv_clear_vars(OpenJPEG_FOUND)
else()
Expand All @@ -47,7 +47,7 @@ index 2e4e4af..8cd9c75 100644
endif()

if(NOT OpenJPEG_FOUND OR OPENJPEG_MAJOR_VERSION LESS 2)
@@ -192,7 +192,7 @@ if(WITH_JASPER AND NOT HAVE_OPENJPEG)
@@ -200,7 +200,7 @@ if(WITH_JASPER AND NOT HAVE_OPENJPEG)
if(BUILD_JASPER)
ocv_clear_vars(JASPER_FOUND)
else()
Expand All @@ -56,7 +56,7 @@ index 2e4e4af..8cd9c75 100644
endif()

if(NOT JASPER_FOUND)
@@ -217,7 +217,7 @@ if(WITH_PNG)
@@ -225,7 +225,7 @@ if(WITH_PNG)
ocv_clear_vars(PNG_FOUND)
else()
ocv_clear_internal_cache_vars(PNG_LIBRARY PNG_INCLUDE_DIR)
Expand All @@ -65,7 +65,7 @@ index 2e4e4af..8cd9c75 100644
if(PNG_FOUND)
include(CheckIncludeFile)
check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H)
@@ -249,7 +249,7 @@ if(WITH_OPENEXR)
@@ -257,7 +257,7 @@ if(WITH_OPENEXR)
ocv_clear_vars(HAVE_OPENEXR)
if(NOT BUILD_OPENEXR)
ocv_clear_internal_cache_vars(OPENEXR_INCLUDE_PATHS OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_VERSION)
Expand All @@ -74,7 +74,7 @@ index 2e4e4af..8cd9c75 100644
endif()

if(OPENEXR_FOUND)
@@ -267,7 +267,7 @@ endif()
@@ -275,7 +275,7 @@ endif()

# --- GDAL (optional) ---
if(WITH_GDAL)
Expand All @@ -83,7 +83,7 @@ index 2e4e4af..8cd9c75 100644

if(NOT GDAL_FOUND)
set(HAVE_GDAL NO)
@@ -279,7 +279,7 @@ if(WITH_GDAL)
@@ -287,7 +287,7 @@ if(WITH_GDAL)
endif()

if(WITH_GDCM)
Expand Down
4 changes: 2 additions & 2 deletions ports/opencv4/0004-fix-policy-CMP0057.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt
index a31d969..fa779e4 100644
index 3a79631..b8ac4d5 100644
--- a/modules/videoio/CMakeLists.txt
+++ b/modules/videoio/CMakeLists.txt
@@ -1,3 +1,4 @@
+cmake_minimum_required(VERSION 3.3)
set(VIDEOIO_PLUGIN_LIST "" CACHE STRING "List of videoio backends to be compiled as plugins (ffmpeg, gstreamer, mfx, msmf or special value 'all')")
set(VIDEOIO_ENABLE_PLUGINS "ON" CACHE BOOL "Allow building videoio plugin support")
set(VIDEOIO_ENABLE_STRICT_PLUGIN_CHECK "ON" CACHE BOOL "Make sure OpenCV version is the same in plugin and host code")
mark_as_advanced(VIDEOIO_PLUGIN_LIST VIDEOIO_ENABLE_PLUGINS)
4 changes: 2 additions & 2 deletions ports/opencv4/0006-fix-uwp.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake
index a548df3..1799e44 100644
index 224953a..3b3a3b2 100644
--- a/cmake/OpenCVModule.cmake
+++ b/cmake/OpenCVModule.cmake
@@ -1198,7 +1198,7 @@ function(ocv_add_perf_tests)
@@ -1200,7 +1200,7 @@ function(ocv_add_perf_tests)
set_target_properties(${the_target} PROPERTIES FOLDER "tests performance")
endif()

Expand Down
4 changes: 2 additions & 2 deletions ports/opencv4/0008-devendor-quirc.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9cd2b4e..b34f20e 100644
index 118b318..b6e661d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -776,7 +776,7 @@ if(WITH_OPENVX)
@@ -795,7 +795,7 @@ if(WITH_OPENVX)
endif()

if(WITH_QUIRC)
Expand Down
37 changes: 37 additions & 0 deletions ports/opencv4/0009-fix-qt-integration.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From f479935cda5eb38a4a4a9e909b6f4f82a0c7533d Mon Sep 17 00:00:00 2001
From: Christoph Rackwitz <christoph.rackwitz@gmail.com>
Date: Thu, 8 Apr 2021 12:59:06 +0200
Subject: [PATCH] fix for #19870

HAVE_QT and HAVE_WIN32UI can both be true at the same time
if HAVE_QT, window_w32.cpp is not included in the build, see CMakeLists.txt
---
modules/highgui/src/window.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/highgui/src/window.cpp b/modules/highgui/src/window.cpp
index 406871b7e8f8..d2cf1e1e4826 100644
--- a/modules/highgui/src/window.cpp
+++ b/modules/highgui/src/window.cpp
@@ -93,7 +93,9 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu
break;

case cv::WND_PROP_VSYNC:
- #if defined (HAVE_WIN32UI)
+ #if defined (HAVE_QT)
+ // nothing
+ #elif defined (HAVE_WIN32UI)
cvSetPropVsync_W32(name, (prop_value != 0));
#else
// not implemented yet for other toolkits
@@ -191,7 +193,9 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
break;

case cv::WND_PROP_VSYNC:
- #if defined (HAVE_WIN32UI)
+ #if defined (HAVE_QT)
+ return -1;
+ #elif defined (HAVE_WIN32UI)
return cvGetPropVsync_W32(name);
#else
return -1;
Loading

0 comments on commit a7d3367

Please sign in to comment.