You are here : matlabImage Processingimboxfilt

imboxfilt() - Image Processing

B = imboxfilt(A) filters
image A with a 2-D, 3-by-3 box filter. A box
filter is also called a mean filter.exampleB = imboxfilt(A,filterSize) filters
image A with a 2-D box filter with size specified
by filterSize.exampleB = imboxfilt(___,Name,Value) filters
image A with a 2-D box filter where Name-Value
pairs control aspects of the filtering.Code Generation support:
Yes.MATLAB Function Block support:
Yes.


Syntax

B = imboxfilt(A) exampleB = imboxfilt(A,filterSize) exampleB = imboxfilt(___,Name,Value) example


Example

Compute Mean Filter Over Specified NeighborhoodOpen This Example
Read image into the workspace.A = imread('cameraman.tif');
Perform the mean filtering using an 11-by-11 filter.localMean = imboxfilt(A,11);
Display the original image and the filtered image, side-by-side.imshowpair(A,localMean,'montage')

Compute Local Area Sums Over Specified NeighborhoodOpen This Example
Read image into the workspace.A = imread('cameraman.tif');
Change the data type of the image to double to avoid integer overflow.A = double(A);
Filter image, calculating local area sums, using a 15-by-15 box filter. To calculate local area sums, rather than the mean, set the NormalizationFactor parameter to 1.localSums = imboxfilt(A, 15, 'NormalizationFactor',1);
Display the original image and the filtered image, side-by-side.imshowpair(A,localSums,'montage')


Output / Return Value


Limitations


Alternatives / See Also


Reference