Description

Despeckles an image by modifying pixels that vary significantly from their surroundings. This is a statistical filter.

Return Type

A McImage object.  

The resulting McImage.

Syntax

object.Median ([lPasses], [Size], [Threshold], [vSourceImg])

The Median Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McEnhance.
lPassesOptional. A Long value.

Number of times to apply the filter. If not given or negative then the Passes property is used. Unless you have changed it, Passes will be 1.

SizeOptional. A Long value.

Size of convolution kernel (3, 5, or 7).

ThresholdOptional. A Double value.

Percentage (from 0.0 to 100.0) of McImage.RangeMin to McImage.RangeMax by which the center pixel must deviate from the median pixel to be replaced by the median.

vSourceImgOptional. A Variant value.

Optional input IMcImage.

Remarks

This filter calculates the median value of the intensity inside a 3x3, 5x5, or 7x7 neighborhood and changes the value of the center pixel if its intensity is more than Threshold away from the median. Threshold is given as a percentage of McImage.RangeMin to McImage.RangeMax.

Exceptions

The exception mceINVALIDARG (E_INVALIDARG) will be thrown if one of the parameters is invalid.