reference
labkit.image.meanFilter2
Apply normalized 2-D mean filtering with edge correction.
Syntax
imageOut = labkit.image.meanFilter2(imageIn, windowSize)Description
Replaces each sample with the arithmetic mean of the rectangular neighborhood that overlaps the image. At an edge or corner, the divisor is reduced to the number of available samples instead of assuming zero padding. Each channel of a 3-D image is filtered independently.
windowSize is rounded to an integer and limited to at least 1. Both odd and even widths are accepted; conv2 determines the alignment of an even window. Input is converted to double for calculation. NaN values are not omitted and therefore propagate to neighborhoods that include them.
Inputs
imageIn- 2-D image matrix or 3-D image with channels in dimension 3.
windowSize- Numeric scalar neighborhood width in pixels.
Outputs
imageOut- Double array with the same size as imageIn.
Failure Behavior
imageIn must be compatible with double and conv2, and windowSize must be convertible to one numeric scalar. Unsupported types, sparse arrays, or nonscalar window values raise the originating MATLAB error.
Example
impulse = [0 0 0; 0 1 0; 0 0 0];
smoothed = labkit.image.meanFilter2(impulse, 3);Related APIs
labkit.image.localContrast— Enhance local value-channel contrast with a mean-filter mask.labkit.image.sharpen— Apply generic unsharp-mask sharpening.labkit.image.adjustBrightnessContrast— Apply simple brightness and contrast adjustment.labkit.image.adjustHueSaturation— Apply HSV hue and saturation adjustment.labkit.image.assertSupportedPaths— Throw when any path has an unsupported image extension.labkit.image.displayName— Return a short image-file display name.labkit.image.ensureRgb— Return image data with exactly three color channels.labkit.image.fileDialogFilter— Return a file-chooser-compatible image filter.
Source
This page is generated from the MATLAB help text in +labkit/+image/meanFilter2.m.