Skip to content

Commit a93f27d

Browse files
committed
Upgrade image to 0.25
1 parent 82a25ee commit a93f27d

11 files changed

Lines changed: 27 additions & 31 deletions

File tree

akaze/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ readme = "README.md"
1313

1414
[dependencies]
1515
cv-core = { version = "0.15.0", path = "../cv-core" }
16-
image = { version = "0.24", default-features = false }
16+
image = { version = "0.25", default-features = false }
1717
log = { version = "0.4.14", default-features = false }
1818
primal = { version = "0.3.0", default-features = false }
1919
derive_more = { version = "0.99.17", default-features = false }
20-
nshare = { git = "https://github.com/rust-cv/nshare.git", rev = "cd4a5c007ecf4ef62c938a6ac64fd90edf895360", default-features = false, features = [
20+
nshare = { version = "0.10", default-features = false, features = [
2121
"ndarray",
2222
"image",
2323
] }
24-
ndarray = { version = "0.15.4", default-features = false }
24+
ndarray = { version = "0.16", default-features = false }
2525
float-ord = { version = "0.3.2", default-features = false }
2626
space = "0.17.0"
2727
bitarray = "0.9.0"
@@ -41,9 +41,9 @@ rand = "0.8.4"
4141
rand_pcg = "0.3.1"
4242
criterion = "0.3.5"
4343
pretty_env_logger = "0.4.0"
44-
image = "0.24"
44+
image = "0.25"
4545
bitarray = { version = "0.9.0", features = ["space"] }
46-
imageproc = "0.23.0"
46+
imageproc = "0.25.0"
4747

4848
[[bench]]
4949
name = "criterion"

akaze/src/image.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use derive_more::{Deref, DerefMut};
22
use image::{DynamicImage, ImageBuffer, Luma, Pixel};
33
use log::*;
44
use ndarray::{azip, s, Array2, ArrayView2, ArrayViewMut2};
5-
use nshare::{MutNdarray2, RefNdarray2};
5+
use nshare::{AsNdarray2, AsNdarray2Mut};
66
use std::f32;
77
use wide::f32x4;
88

@@ -116,11 +116,11 @@ impl GrayFloatImage {
116116
}
117117

118118
pub fn ref_array2(&self) -> ArrayView2<f32> {
119-
self.0.ref_ndarray2()
119+
self.0.as_ndarray2()
120120
}
121121

122122
pub fn mut_array2(&mut self) -> ArrayViewMut2<f32> {
123-
self.0.mut_ndarray2()
123+
self.0.as_ndarray2_mut()
124124
}
125125

126126
pub fn zero_array(&self) -> Array2<f32> {

cv-sfm/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ space = { version = "0.17.0", default-features = false }
2828
maplit = { version = "1.0.2", default-features = false }
2929
log = { version = "0.4.14", default-features = false }
3030
itertools = { version = "0.10.3", default-features = false }
31-
image = { version = "0.24", default-features = false }
31+
image = { version = "0.25", default-features = false }
3232
ply-rs = { version = "0.1.3", default-features = false }
33-
imageproc = "0.23"
33+
imageproc = "0.25"
3434
conv = { version = "0.3.3", default-features = false }
3535
bitarray = { version = "0.9.0", default-features = false, features = ["space"] }
3636
serde = { version = "1.0.136", features = ["derive"], optional = true }

cv-sfm/src/bicubic.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
66
use conv::ValueInto;
77
use image::{GenericImageView, Pixel};
8-
use imageproc::{
9-
definitions::{Clamp, Image},
10-
math::cast,
11-
};
8+
use imageproc::definitions::{Clamp, Image};
129

1310
fn blend_cubic<P>(px0: &P, px1: &P, px2: &P, px3: &P, x: f32) -> P
1411
where
@@ -18,10 +15,10 @@ where
1815
let mut outp = *px0;
1916

2017
for i in 0..(P::CHANNEL_COUNT as usize) {
21-
let p0 = cast(px0.channels()[i]);
22-
let p1 = cast(px1.channels()[i]);
23-
let p2 = cast(px2.channels()[i]);
24-
let p3 = cast(px3.channels()[i]);
18+
let p0 = px0.channels()[i].value_into().unwrap();
19+
let p1 = px1.channels()[i].value_into().unwrap();
20+
let p2 = px2.channels()[i].value_into().unwrap();
21+
let p3 = px3.channels()[i].value_into().unwrap();
2522
#[rustfmt::skip]
2623
let pval = p1 + 0.5 * x * (p2 - p0 + x * (2.0 * p0 - 5.0 * p1 + 4.0 * p2 - p3 + x * (3.0 * (p1 - p2) + p3 - p0)));
2724
outp.channels_mut()[i] = <P as Pixel>::Subpixel::clamp(pval);

cv/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ hgg = { version = "0.4.1", optional = true }
5959
levenberg-marquardt = { version = "0.12.0", optional = true }
6060
arrsac = { version = "0.10.0", optional = true }
6161
bitarray = { version = "0.9.0", features = ["space"], optional = true }
62-
image = { version = "0.24", default-features = false, optional = true }
63-
imageproc = { version = "0.23", default-features = false, optional = true }
62+
image = { version = "0.25", default-features = false, optional = true }
63+
imageproc = { version = "0.25", default-features = false, optional = true }
6464
eye = { version = "0.4.1", optional = true }
6565
ndarray-vision = { version = "0.3.0", default-features = false, optional = true }
6666

kpdraw/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ edition = "2021"
77
[dependencies]
88
akaze = { version = "0.7.0", path = "../akaze" }
99
structopt = "0.3.26"
10-
image = { version = "0.24", features = ["png", "jpeg"] }
11-
imageproc = "0.23"
10+
image = { version = "0.25", features = ["png", "jpeg"] }
11+
imageproc = "0.25"

kpdraw/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use image::ImageOutputFormat;
21
use std::{
32
io::{Cursor, Write},
43
path::PathBuf,
@@ -36,7 +35,7 @@ fn main() {
3635
} else {
3736
let mut output = Cursor::new(Vec::new());
3837
image
39-
.write_to(&mut output, ImageOutputFormat::Png)
38+
.write_to(&mut output, image::ImageFormat::Png)
4039
.expect("failed to write image to stdout");
4140
stdout
4241
.lock()

tutorial-code/chapter3-akaze-feature-extraction/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66

77
[dependencies]
88
cv = { version = "0.6.0", path = "../../cv" }
9-
image = "0.24"
10-
imageproc = "0.23"
9+
image = "0.25"
10+
imageproc = "0.25"
1111
open = "2.0.2"
1212
tempfile = "3.3.0"

tutorial-code/chapter4-feature-matching/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ edition = "2021"
55

66
[dependencies]
77
cv = { version = "0.6.0", path = "../../cv" }
8-
image = "0.24"
9-
imageproc = "0.23"
8+
image = "0.25"
9+
imageproc = "0.25"
1010
open = "2.0.2"
1111
tempfile = "3.3.0"
1212
itertools = "0.10.3"

tutorial-code/chapter5-geometric-verification/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ edition = "2021"
55

66
[dependencies]
77
cv = { version = "0.6.0", path = "../../cv" }
8-
image = "0.24"
9-
imageproc = "0.23"
8+
image = "0.25"
9+
imageproc = "0.25"
1010
open = "2.0.2"
1111
tempfile = "3.3.0"
1212
itertools = "0.10.3"

0 commit comments

Comments
 (0)