DADiSP Worksheet Functions > Function Categories > Image Processing > MEDFILT
Performs 2D median filtering on an image matrix.
MEDFILT(image, ksize)
image |
- |
Any image table or expression evaluating to a table. |
ksize |
- |
Optional. An integer. Kernel size, must be odd. Defaults to 3. |
An array the filtered image.
W1: density(ravel(readb("baboon.dat", ubyte), 128));gray
W2: medfilt(w1)
W1 reads and shapes a 128x256 raw binary image. W2 contains the 3x3 median filtered output.
W1: readimage(gethome + "data\mandrill.bmp")
W2: medfilt(w1, 5)
W1 reads a 250x240 bitmap image. The result is a 24 bit RGB image. W2 contains the 5x5 median filtered output.
For 24 bit RGB images, MEDFILT automatically performs filtering on each R, G, B component.
If the filter kernel is even, the size is incremented to make it odd.
See MEDFILT1 to perform median filtering on a series.