Skip to content

Commit

Permalink
Updates opencv to 4.5.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
hediet committed Apr 14, 2021
1 parent 068fea2 commit f028040
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
rust:
- stable
version:
- opencv: 4.5.1
- opencv: 4.5.2
brew: "@4"
features: opencv-4
os:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
rust:
- stable
version:
- opencv: 4.5.1
- opencv: 4.5.2
brew: "@4"
features: opencv-4
os:
Expand Down Expand Up @@ -116,8 +116,8 @@ jobs:
if [ "${{ matrix.os.family }}" = "windows" ]; then
cp "target/release/slideo.exe" "$staging/"
cp "C:\tools\opencv\build\x64\vc15\bin\opencv_world451.dll" "$staging/"
cp "C:\tools\opencv\build\x64\vc15\bin\opencv_videoio_ffmpeg451_64.dll" "$staging/"
cp "C:\tools\opencv\build\x64\vc15\bin\opencv_world452.dll" "$staging/"
cp "C:\tools\opencv\build\x64\vc15\bin\opencv_videoio_ffmpeg452_64.dll" "$staging/"
cp "C:\tools\opencv\LICENSE_FFMPEG.txt" "$staging/"
cp "C:\tools\opencv\LICENSE.txt" "$staging/LICENSE_OPENCV.txt"
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ An installer is not yet provided. Feel free to contribute!

(untested)

- OpenCV 4.5.1
- OpenCV 4.5.2
- Poppler

## Usage
Expand Down
5 changes: 4 additions & 1 deletion ci/install-macos-brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

set -vex

brew install opencv"$BREW_OPENCV_VERSION"
# See https://cmichel.io/how-to-install-an-old-package-version-with-brew/. Needs to be compiled though.
#brew tap-new $USER/local-opencv
#brew extract --version=$OPENCV_VERSION opencv $USER/local-opencv
brew install opencv@4
2 changes: 1 addition & 1 deletion crates/matching-opencv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Henning Dieterichs <henning.dieterichs@live.de>"]
edition = "2018"

[dependencies]
opencv = "0.49"
opencv = "0.52"
rayon = "1.5.0"
anyhow = "1.0.38"
thread_local = "1.1.3"
Expand Down
2 changes: 1 addition & 1 deletion crates/matching-opencv/src/feature_extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl FeatureExtractor {
}

pub fn find_keypoints_and_descriptors(&mut self, src: &Mat) -> KeypointsWithDescriptors {
let mut descriptors = Mat::default().unwrap();
let mut descriptors = Mat::default();
let mut keypoints = Vector::new();
self.ptr
.detect_and_compute(
Expand Down
2 changes: 1 addition & 1 deletion crates/matching-opencv/src/image_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use opencv::{
};

pub fn to_small_image(mat: &Mat) -> Mat {
let mut scaled_mat = Mat::default().unwrap();
let mut scaled_mat = Mat::default();
let size = mat.size().unwrap();
let max_area = 300 * 400;
let factor = ((max_area as f32) / (size.area() as f32)).sqrt();
Expand Down
4 changes: 2 additions & 2 deletions crates/matching-opencv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl<I: MatchableImage> ProcessedImage<I> {
panic!("Could not read file '{:?}'", path);
}

let mut normalized_img_mat = Mat::default().unwrap();
let mut normalized_img_mat = Mat::default();
cvt_color(&img_mat, &mut normalized_img_mat, COLOR_BGRA2BGR, 0).unwrap();

let result = FEATURE_EXTRACTOR.with(|e| {
Expand Down Expand Up @@ -335,7 +335,7 @@ impl<I: MatchableImage + Send + Copy + Eq> OpenCVVideoMatcherTask<I> {
let mut rated_best_matches = rated_best_matches
.into_iter()
.map(|(slide_info, matches, _rating, transformation)| {
let mut frame_proj = Mat::default().unwrap();
let mut frame_proj = Mat::default();
warp_affine(
&frame,
&mut frame_proj,
Expand Down
2 changes: 1 addition & 1 deletion crates/matching-opencv/src/video_capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl Iterator for VideoCaptureIter {
type Item = (Mat, Duration, usize);

fn next(&mut self) -> Option<(Mat, Duration, /* frame */ usize)> {
let mut frame = Mat::default().unwrap();
let mut frame = Mat::default();
loop {
let frame_idx = self.video.get(CAP_PROP_POS_FRAMES).unwrap();
let time_passed = Duration::from_secs_f64(frame_idx / self.fps);
Expand Down

0 comments on commit f028040

Please sign in to comment.