pub fn maximum_filter<T, D>(
input: &ArrayBase<OwnedRepr<T>, D>,
size: &[usize],
mode: Option<BorderMode>,
origin: Option<&[isize]>,
) -> Result<ArrayBase<OwnedRepr<T>, D>, NdimageError>where
T: Float + FromPrimitive + Debug + PartialOrd + Clone + Send + Sync + AddAssign + DivAssign + 'static,
D: Dimension + 'static,Expand description
Apply a maximum filter to an n-dimensional array
A maximum filter replaces each element with the maximum value in its neighborhood.
§Arguments
input- Input array to filtersize- Size of the filter kernel in each dimension. If a single integer is provided, it will be used for all dimensions.mode- Border handling mode (defaults to Reflect)origin- Origin of the filter kernel. Default is None, which centers the kernel.
§Returns
Result<Array<T, D>>- Filtered array
§Examples
use scirs2_core::ndarray::{Array2, array};
use scirs2_ndimage::filters::{maximum_filter, BorderMode};
let input = array![[1.0, 2.0, 3.0],
[4.0, 5.0, 6.0],
[7.0, 8.0, 9.0]];
// Apply 3x3 maximum filter
let filtered = maximum_filter(&input, &[3, 3], None, None).expect("Operation failed");