diff --git a/src/corners.rs b/src/corners.rs index 91d8128d..58fb94ae 100644 --- a/src/corners.rs +++ b/src/corners.rs @@ -615,7 +615,7 @@ mod tests { 00, 00, 00, 00, 00, 10, 00; 00, 00, 00, 10, 10, 00, 00); - assert_eq!( + assert_approx_eq!( intensity_centroid(&image, 3, 3, 3), -std::f32::consts::FRAC_PI_4 ); diff --git a/src/geometry.rs b/src/geometry.rs index c904efdc..0bdcfc5e 100644 --- a/src/geometry.rs +++ b/src/geometry.rs @@ -282,7 +282,7 @@ mod tests { arc_length(&[Point::new(1.0, 1.0), Point::new(4.0, 5.0)], false), 5.0 ); - assert_eq!( + assert_approx_eq!( arc_length( &[ Point::new(1.0, 1.0), diff --git a/src/template_matching.rs b/src/template_matching.rs index a9476289..a80257a2 100644 --- a/src/template_matching.rs +++ b/src/template_matching.rs @@ -593,7 +593,7 @@ mod tests { 3.0, 1.0 ); - assert_pixels_eq!(actual, expected); + assert_pixels_eq_within!(actual, expected, 0.1); } #[test] @@ -619,7 +619,7 @@ mod tests { 3.0 / (23.0 * tss).sqrt(), 1.0 / (35.0 * tss).sqrt() ); - assert_pixels_eq!(actual, expected); + assert_pixels_eq_within!(actual, expected, 0.1); } #[test] @@ -694,7 +694,7 @@ mod tests { MatchTemplateMethod::SumOfSquaredErrors, &mask, ); - assert_pixels_eq!(actual, expected); + assert_pixels_eq_within!(actual, expected, 0.1); #[cfg(feature = "rayon")] { @@ -733,7 +733,7 @@ mod tests { MatchTemplateMethod::SumOfSquaredErrorsNormalized, &mask, ); - assert_pixels_eq!(actual, expected); + assert_pixels_eq_within!(actual, expected, 0.1); #[cfg(feature = "rayon")] { @@ -811,7 +811,7 @@ mod tests { MatchTemplateMethod::CrossCorrelationNormalized, &mask, ); - assert_pixels_eq!(actual, expected); + assert_pixels_eq_within!(actual, expected, 0.1); #[cfg(feature = "rayon")] {