Update OpenCV to 4.5.2 release #8457
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR rolls up a build of the latest OpenCV release, tested under mingw64 and mingw32.
The changes to packaging are fairly minor, though the PR is bigger than it strictly has to be because I took the possibly-controversial step of re-rolling all of the existing patches that didn't apply cleanly. The first patch didn't apply at all and required an update, and some of the others were applying but with hundreds of lines of offset, so I decided to refresh them all. If that's a problem, let me know and I'll be happy to drop those changes from the PR.
In addition to re-rolling many existing patches, and deleting the no-longer-used patch 0005 from the repo, changes required to successfully build were:
Added new patch 0105 to fix the build of new contrib module
wechat_qrcode
. It was usingiconv
assuming it was part of the base system -- a correct assumption, on POSIX. On Windows it requires linking withlibiconv
, which is available in MSYS2. I added code to itsCMakeLists.txt
to discover Iconv using the CMake-standard find module, and added it as a new dependency in thePKGBUILD
.I should note that someone already submitted an upstream patch at wechat_qr: disable iconv dependancy for mingw opencv/opencv_contrib#2916 to go in the opposite direction, and disable wechat_qrcode's iconv use under MinGW. I have a question in at that PR as to why disabling it was chosen over linking in
libiconv
, but regardless I didn't discover that divergence until I was preparing to submit my change upstream as a PR.I had to disable
PKG_CONFIG_WITHOUT_PREFIX
on the CMake command line, because the newOpenCVUtils.cmake
functions for linking in dependencies create targets that break on paths rooted at/mingw64/
.Issue manifested as a CMake configuration failure, claiming that Tesseract had a "nonexistent path"
/mingw64/include/leptonica/
in itsINTERFACE_INCLUDE_DIRECTORIES
. Removing the setting changed itspkg-config
output to includeC:/msys64/...
and placated CMake.With these changes, and some downstream re-tooling to support the migration of the previous object tracking API to a
cv::legacy::
namespace that occurred between 4.5.0 and 4.5.1 (but was broken into incompatibility by missing headers in 4.5.1, the main reason we're looking to move to 4.5.2), our OpenCV-enabled application builds successfully against these packages and passes all of its existing unit tests.The console output of
C:/msys64/mingw64/bin/opencv_version_win32.exe
is also informative as to the state of the build, as it serves as a configuration summary for the package. Its output is included below.Console output of
opencv_version_win32.exe
on MinGW64