Median method (Main Control)

C++ Builder example

Delphi example

 

Builder Syntax

int Median (Cardinal uDim);

Delphi Syntax

Median (uDim: Cardinal): Integer;

Overview

Refer to Removing Noise.

Remarks

Changes the color of each pixel in the bitmap to the median color of pixels in its neighborhood. This is similar to the Average method, but it is used for noise reduction, rather than a blur effect.

You control the effect by specifying the size of the neighborhood that is used for calculating the median value. For 8x8, pass 8 in the uDim parameter.

This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

If the bitmap has a region, this method works only on the region. If the bitmap does not have a region, this method works on the entire bitmap.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements:

Sharpen method, Posterize method, Mosaic method, Emboss method, Average method, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Oilify method, Solarize method, WindowLevel method, Deskew method, GlowFilter method, HalfTone method, UnsharpMask method, ShowMedianDlg method

Topics:

Raster Images: Filtering Images

 

Raster Images: Where the Region Preempts the Bitmap