Skip to content

Commit

Permalink
Update tests (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherphil authored Apr 28, 2024
1 parent a178c50 commit 388360d
Show file tree
Hide file tree
Showing 31 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions src/filter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1031,4 +1031,18 @@ mod tests {
);
let _ = gaussian_blur_f32(&image, -0.5);
}

#[test]
fn test_gaussian_on_u8_white_idempotent() {
let image = ImageBuffer::<Luma<u8>, Vec<u8>>::from_pixel(64, 64, Luma([255]));
let image2 = gaussian_blur_f32(&image, 10f32);
assert_pixels_eq_within!(image2, image, 0);
}

#[test]
fn test_gaussian_on_f32_white_idempotent() {
let image = ImageBuffer::<Luma<f32>, Vec<f32>>::from_pixel(64, 64, Luma([1.0]));
let image2 = gaussian_blur_f32(&image, 10f32);
assert_pixels_eq_within!(image2, image, 1e-6);
}
}
Binary file modified tests/data/truth/antialiased_lines_rgb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/cubic_bezier_curve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/elephant_affine_bicubic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/elephant_affine_bilinear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/elephant_affine_nearest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/elephant_gradients.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/elephant_matched.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/elephant_rotate_bicubic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/elephant_rotate_bicubic_rgba.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/elephant_rotate_bilinear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/elephant_rotate_bilinear_rgba.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/elephant_rotate_nearest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/elephant_rotate_nearest_rgba.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/filled_ellipse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/hollow_ellipse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/hough_lines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/lumaphant_bilateral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/lumaphant_eq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/polygon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/polygon_antialiased.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/polygon_hollow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/robin_sharpen3x3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/robin_sharpen_gaussian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/spiral_polygon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/zebra_adaptive_threshold.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/truth/zebra_canny.png
Binary file modified tests/data/truth/zebra_gaussian_10.png
Binary file modified tests/data/truth/zebra_gaussian_3.png
Binary file modified tests/data/truth/zebra_otsu.png
14 changes: 0 additions & 14 deletions tests/regression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,20 +355,6 @@ fn test_gaussian_blur_stdev_10() {
});
}

#[test]
fn test_gaussian_on_u8_white_idempotent() {
let image = ImageBuffer::<Luma<u8>, Vec<u8>>::from_pixel(64, 64, Luma([255]));
let image2 = gaussian_blur_f32(&image, 10f32);
assert_pixels_eq_within!(image2, image, 0);
}

#[test]
fn test_gaussian_on_f32_white_idempotent() {
let image = ImageBuffer::<Luma<f32>, Vec<f32>>::from_pixel(64, 64, Luma([1.0]));
let image2 = gaussian_blur_f32(&image, 10f32);
assert_pixels_eq_within!(image2, image, 1e-6);
}

#[test]
fn test_adaptive_threshold() {
use imageproc::contrast::adaptive_threshold;
Expand Down

0 comments on commit 388360d

Please sign in to comment.