maximumfilter
Maximum filter is a nonlinear image processing operation that replaces each pixel with the maximum value found in a local neighborhood around that pixel. The neighborhood is defined by a window, often a square of odd size such as 3x3 or 5x5, or by an arbitrary footprint. The result emphasizes bright regions within the window and smooths out small dark speckle.
In grayscale mathematics, the maximum filter is equivalent to dilation with a flat structuring element. Given
Boundary handling varies between implementations. Common approaches pad the image, using modes such as reflect, constant,
Properties and effects include robustness to pepper (dark) noise, since dark outliers are raised to the neighborhood
Implementations exist in many libraries, such as SciPy’s ndimage.maximum_filter, OpenCV’s dilation with a rectangular kernel, and