Bump OpenCV to 4.7.0
MODIFY
.github/workflows/opencv-rust.yml
.github/workflows/opencv-rust.yml
@@ -17,16 +17,16 @@ jobs:
- ubuntu-20.04
- macos-11
version:
- - opencv: 3.4.17
- - opencv: 4.6.0
+ - opencv: 3.4.19
+ - opencv: 4.7.0
exclude:
- os-image: macos-11
version:
- opencv: 3.4.17
+ opencv: 3.4.19
include:
- os-image: ubuntu-20.04
version:
- opencv: 4.6.0-static
+ opencv: 4.7.0-static
runs-on: ${{ matrix.os-image }}
env:
Atlas_ROOT_DIR: /usr/include/ # for cmake to find lapacke.h
@@ -70,7 +70,7 @@ jobs:
- ubuntu-20.04
- windows-2022
version:
- - vcpkg: 2022.10.19
+ - vcpkg: 2023.01.09
runs-on: ${{ matrix.os-image }}
env:
VCPKG_VERSION: ${{ matrix.version.vcpkg }}
@@ -81,7 +81,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/build
- key: vcpkg-${{ matrix.version.vcpkg }}-${{ matrix.os-image }}-1
+ key: vcpkg-${{ matrix.version.vcpkg }}-${{ matrix.os-image }}
- name: Install dependencies
env:

MODIFY
ci/install-focal-vcpkg.sh
ci/install-focal-vcpkg.sh
@@ -4,7 +4,8 @@ set -vex
sudo apt-get update
sudo apt-get install -y clang libharfbuzz0b git curl zip unzip tar bison gperf libx11-dev libxft-dev libxext-dev \
- libgles2-mesa-dev autoconf libtool build-essential libxrandr-dev libxi-dev libxcursor-dev libxdamage-dev libxinerama-dev
+ libgles2-mesa-dev autoconf libtool build-essential libxrandr-dev libxi-dev libxcursor-dev libxdamage-dev libxinerama-dev \
+ libdbus-1-dev libxtst-dev
export VCPKG_ROOT="$HOME/build/vcpkg"
if [[ -e "$VCPKG_ROOT" && ! -e "$VCPKG_ROOT/.git" ]]; then

MODIFY
ci/install-macos-brew.sh
ci/install-macos-brew.sh
set -vex
brew -v update
+
+# fixes the install at 2023-01-14
+rm -f /usr/local/bin/2to3-3.11
+rm -f /usr/local/bin/idle3.11
+rm -f /usr/local/bin/pydoc3.11
+rm -f /usr/local/bin/python3.11
+rm -f /usr/local/bin/python3.11-config
+rm -f /usr/local/bin/2to3
+rm -f /usr/local/bin/idle3
+rm -f /usr/local/bin/pydoc3
+rm -f /usr/local/bin/python3
+rm -f /usr/local/bin/python3-config
+
brew -v install opencv"$BREW_OPENCV_VERSION"

MODIFY
ci/install-windows-chocolatey.sh
ci/install-windows-chocolatey.sh
set -vex
-choco install -y llvm --version 15.0.5
+choco install -y llvm --version "$CHOCO_LLVM_VERSION"
choco install -y opencv --version "$OPENCV_VERSION"

MODIFY
ci/install-windows-vcpkg.sh
ci/install-windows-vcpkg.sh
@@ -23,6 +23,10 @@ echo "set(VCPKG_BUILD_TYPE release)" >> triplets/x64-windows-static.cmake
echo "set(VCPKG_BUILD_TYPE release)" >> triplets/x86-windows.cmake
export VCPKG_DEFAULT_TRIPLET=x64-windows
#./vcpkg install llvm # takes very long time
-choco install -y llvm --version 15.0.5
+choco install -y llvm --version "$CHOCO_LLVM_VERSION"
+
+# workaround for https://github.com/microsoft/vcpkg/issues/28896
+patch -p1 < "$GITHUB_WORKSPACE/ci/vcpkg-msys-patch.diff"
+
./vcpkg install --recurse "opencv[contrib,nonfree]"
popd

MODIFY
ci/install.sh
ci/install.sh
@@ -19,6 +19,7 @@ elif [[ "$OS_FAMILY" == "macOS" ]]; then
"$ci_dir/install-macos-framework.sh"
fi
elif [[ "$OS_FAMILY" == "Windows" ]]; then
+ export CHOCO_LLVM_VERSION=15.0.5
if [[ "$VCPKG_VERSION" != "" ]]; then # vcpkg build
"$ci_dir/install-windows-vcpkg.sh"
else # chocolatey build

MODIFY
ci/script.sh
ci/script.sh
@@ -41,11 +41,15 @@ elif [[ "$OS_FAMILY" == "Linux" ]]; then
else
non_static_version=${OPENCV_VERSION%-static}
if [[ "$non_static_version" != "$OPENCV_VERSION" ]]; then # static build
- export OPENCV_LINK_LIBS=opencv_highgui,opencv_objdetect,opencv_dnn,opencv_calib3d,opencv_videostab,opencv_features2d,opencv_stitching,opencv_flann,opencv_videoio,opencv_rgbd,opencv_aruco,opencv_video,opencv_ml,opencv_imgcodecs,opencv_imgproc,opencv_core,ittnotify,tbb,liblibwebp,liblibtiff,liblibjpeg-turbo,liblibpng,liblibopenjp2,ippiw,ippicv,liblibprotobuf,quirc,zlib
+ export OPENCV_LINK_LIBS=opencv_highgui,opencv_objdetect,opencv_dnn,opencv_videostab,opencv_calib3d,opencv_features2d,opencv_stitching,opencv_flann,opencv_videoio,opencv_rgbd,opencv_aruco,opencv_video,opencv_ml,opencv_imgcodecs,opencv_imgproc,opencv_core,ittnotify,tbb,liblibwebp,liblibtiff,liblibjpeg-turbo,liblibpng,liblibopenjp2,ippiw,ippicv,liblibprotobuf,quirc,zlib
fi
fi
fi
+if [[ "$OPENCV_VERSION" == "4.2.0" || "$OPENCV_VERSION" == "3.4.16" ]]; then
+ rm -vf tests/*4_2_0_norun.rs
+fi
+
echo "=== Current directory: $(pwd)"
echo "=== Environment variable dump:"
export

ADD
ci/vcpkg-msys-patch.diff
+diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake
+index 98effb4f9ef32..8b0b3d931d74e 100644
+--- a/scripts/cmake/vcpkg_acquire_msys.cmake
++++ b/scripts/cmake/vcpkg_acquire_msys.cmake
+@@ -184,8 +184,8 @@ function(vcpkg_acquire_msys out_msys_root)
+ DEPS libiconv libintl
+ )
+ z_vcpkg_acquire_msys_declare_package(
+- URL "https://repo.msys2.org/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz"
+- SHA512 b309799e5a9d248ef66eaf11a0bd21bf4e8b9bd5c677c627ec83fa760ce9f0b54ddf1b62cbb436e641fbbde71e3b61cb71ff541d866f8ca7717a3a0dbeb00ebf
++ URL "https://repo.msys2.org/msys/x86_64/libtool-2.4.7-3-x86_64.pkg.tar.zst"
++ SHA512 a202ddaefa93d8a4b15431dc514e3a6200c47275c5a0027c09cc32b28bc079b1b9a93d5ef65adafdc9aba5f76a42f3303b1492106ddf72e67f1801ebfe6d02cc
+ DEPS grep sed coreutils file findutils
+ )
+ z_vcpkg_acquire_msys_declare_package(

MODIFY
tests/marshalling.rs
tests/marshalling.rs
@@ -170,47 +170,6 @@ fn string_out_argument() -> Result<()> {
Ok(())
}
-/// Setting and getting fields through Ptr
-#[test]
-fn field_access_on_ptr() -> Result<()> {
- #![cfg(all(ocvrs_has_module_aruco, any(ocvrs_opencv_branch_34, ocvrs_opencv_branch_4)))]
- use opencv::aruco::EstimateParameters;
- // the location and parameters are wildly different between even the minor release in the OpenCV branches, so for now
- // let's just limit to only those fields that are stable
- // #[cfg(ocvrs_opencv_branch_34)]
- // use opencv::aruco::PatternPos::CW_top_left_corner as LeftTop;
- // #[cfg(ocvrs_opencv_branch_4)]
- // use opencv::aruco::PatternPositionType::ARUCO_CW_TOP_LEFT_CORNER as LeftTop;
- // #[cfg(ocvrs_opencv_branch_34)]
- // use opencv::calib3d::SolvePnPMethod::{SOLVEPNP_EPNP, SOLVEPNP_MAX_COUNT};
- // #[cfg(ocvrs_opencv_branch_4)]
- // use opencv::calib3d::{SOLVEPNP_EPNP, SOLVEPNP_MAX_COUNT};
- use opencv::core::Ptr;
-
- let mut params = EstimateParameters::default()?;
- assert_ne!(true, params.use_extrinsic_guess());
- params.set_use_extrinsic_guess(true);
- let params_ptr = Ptr::<EstimateParameters>::new(params);
- assert_eq!(true, params_ptr.use_extrinsic_guess());
-
- let plain = EstimateParameters::default()?;
- let mut ptr = Ptr::<EstimateParameters>::new(EstimateParameters::default()?);
-
- // assert_eq!(plain.pattern(), ptr.pattern());
- // ptr.set_pattern(LeftTop);
- // assert_eq!(LeftTop, ptr.pattern());
-
- assert_eq!(plain.use_extrinsic_guess(), ptr.use_extrinsic_guess());
- ptr.set_use_extrinsic_guess(true);
- assert_eq!(true, ptr.use_extrinsic_guess());
-
- // assert_eq!(plain.solve_pnp_method(), ptr.solve_pnp_method());
- // ptr.set_solve_pnp_method(SOLVEPNP_MAX_COUNT);
- // assert_eq!(ptr.solve_pnp_method(), SOLVEPNP_MAX_COUNT);
-
- Ok(())
-}
-
/// Test whether the return of the small simple structures works as intended
#[test]
fn simple_struct_return_infallible() -> Result<()> {

ADD
tests/marshalling_4_2_0_norun.rs
+//! Tests that will not be run in CI on OpenCV 4.2.0 due to missing classes
+
+use opencv::prelude::*;
+use opencv::Result;
+
+/// Setting and getting fields through Ptr
+#[test]
+fn field_access_on_ptr() -> Result<()> {
+ #![cfg(all(ocvrs_has_module_aruco, any(ocvrs_opencv_branch_34, ocvrs_opencv_branch_4)))]
+ use opencv::aruco::EstimateParameters;
+ // the location and parameters are wildly different between even the minor release in the OpenCV branches, so for now
+ // let's just limit to only those fields that are stable
+ // #[cfg(ocvrs_opencv_branch_34)]
+ // use opencv::aruco::PatternPos::CW_top_left_corner as LeftTop;
+ // #[cfg(ocvrs_opencv_branch_4)]
+ // use opencv::aruco::PatternPositionType::ARUCO_CW_TOP_LEFT_CORNER as LeftTop;
+ // #[cfg(ocvrs_opencv_branch_34)]
+ // use opencv::calib3d::SolvePnPMethod::{SOLVEPNP_EPNP, SOLVEPNP_MAX_COUNT};
+ // #[cfg(ocvrs_opencv_branch_4)]
+ // use opencv::calib3d::{SOLVEPNP_EPNP, SOLVEPNP_MAX_COUNT};
+ use opencv::core::Ptr;
+
+ let mut params = EstimateParameters::default()?;
+ assert_ne!(true, params.use_extrinsic_guess());
+ params.set_use_extrinsic_guess(true);
+ let params_ptr = Ptr::<EstimateParameters>::new(params);
+ assert_eq!(true, params_ptr.use_extrinsic_guess());
+
+ let plain = EstimateParameters::default()?;
+ let mut ptr = Ptr::<EstimateParameters>::new(EstimateParameters::default()?);
+
+ // assert_eq!(plain.pattern(), ptr.pattern());
+ // ptr.set_pattern(LeftTop);
+ // assert_eq!(LeftTop, ptr.pattern());
+
+ assert_eq!(plain.use_extrinsic_guess(), ptr.use_extrinsic_guess());
+ ptr.set_use_extrinsic_guess(true);
+ assert_eq!(true, ptr.use_extrinsic_guess());
+
+ // assert_eq!(plain.solve_pnp_method(), ptr.solve_pnp_method());
+ // ptr.set_solve_pnp_method(SOLVEPNP_MAX_COUNT);
+ // assert_eq!(ptr.solve_pnp_method(), SOLVEPNP_MAX_COUNT);
+
+ Ok(())
+}

Bump OpenCV to 4.7.0