Skip to content

Commit c56cced

Browse files
authored
keep only 1 laplacian for simplicity (#745)
1 parent 1772053 commit c56cced

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/filter/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,14 +440,14 @@ where
440440
/// ```
441441
#[must_use = "the function does not modify the original image"]
442442
pub fn laplacian_filter(image: &GrayImage) -> Image<Luma<i16>> {
443-
filter_clamped(image, kernel::FOUR_LAPLACIAN_3X3)
443+
filter_clamped(image, kernel::LAPLACIAN_3X3)
444444
}
445445

446446
#[must_use = "the function does not modify the original image"]
447447
#[cfg(feature = "rayon")]
448448
#[doc = generate_parallel_doc_comment!("laplacian_filter")]
449449
pub fn laplacian_filter_parallel(image: &GrayImage) -> Image<Luma<i16>> {
450-
filter_clamped_parallel(image, kernel::FOUR_LAPLACIAN_3X3)
450+
filter_clamped_parallel(image, kernel::LAPLACIAN_3X3)
451451
}
452452

453453
#[cfg(test)]

src/kernel.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,5 @@ pub const ROBERTS_HORIZONTAL_2X2: Kernel<'static, i32> = Kernel::new(&[1, 0, 0,
8686
/// The roberts vertical 3x3 kernel.
8787
pub const ROBERTS_VERTICAL_2X2: Kernel<'static, i32> = Kernel::new(&[0, 1, -1, -0], 2, 2);
8888

89-
/// The 4-connectivity laplacian 3x3 kernel.
90-
pub const FOUR_LAPLACIAN_3X3: Kernel<'static, i16> =
91-
Kernel::new(&[0, 1, 0, 1, -4, 1, 0, 1, 0], 3, 3);
92-
/// The 8-connectivity laplacian 3x3 kernel.
93-
pub const EIGHT_LAPLACIAN_3X3: Kernel<'static, i16> =
94-
Kernel::new(&[1, 1, 1, 1, -8, 1, 1, 1, 1], 3, 3);
89+
/// The laplacian 3x3 kernel.
90+
pub const LAPLACIAN_3X3: Kernel<'static, i16> = Kernel::new(&[0, 1, 0, 1, -4, 1, 0, 1, 0], 3, 3);

0 commit comments

Comments
 (0)