Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

2-D median filtering

- example
`B = medfilt2(A)`

`B = medfilt2(A, [m n])`

`B = medfilt2(___,padopt)`

`gpuarrayB = medfilt2(gpuarrayA,___)`

performs
median filtering of the matrix `B`

= medfilt2(`A`

)`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.

performs
the median filtering operation on a GPU. The input image and the output
image are gpuArrays. When working with gpuArrays, `gpuarrayB`

= medfilt2(`gpuarrayA`

,___)`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.

[1] Lim, Jae S., *Two-Dimensional
Signal and Image Processing*, Englewood Cliffs, NJ, Prentice
Hall, 1990, pp. 469-476.

Was this topic helpful?