2-D median filtering

`B = medfilt2(A)`

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

This function supports code generation (see Tips).

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™.

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

Was this topic helpful?