You are here : matlabImage Processingmedfilt2

medfilt2() - Image Processing

B = medfilt2(A) performs
median filtering of the matrix A in two dimensions.
Each output pixel contains the median value in a 3-by-3 neighborhood
around the corresponding pixel in the input image. medfilt2 pads
the image with 0's on the edges, so the
median values for points within one-half the width of the neighborhood
([m n]/2) of the edges might appear distorted.B = medfilt2(A, [m
n]) performs median filtering, where each output
pixel contains the median value in the m-by-n neighborhood
around the corresponding pixel in the input image.B = medfilt2(___,padopt) 
controls how medfilt2 pads the matrix boundaries.gpuarrayB = medfilt2(gpuarrayA,___) performs
the median filtering operation on a GPU. The input image and the output
image are gpuArrays. When working with gpuArrays, medfilt2 only
supports square neighborhoods with odd-length sides between 3 and
15. This syntax requires the Parallel Computing Toolbox™. Code Generation support:
Yes.MATLAB Function Block support:
Yes.


Syntax

B = medfilt2(A) exampleB = medfilt2(A, [m
n])B = medfilt2(___,padopt)gpuarrayB = medfilt2(gpuarrayA,___)


Example

1 5
4 8


Output / Return Value


Limitations


Alternatives / See Also


Reference