Description

Sorts pixels in nxn kernel and replaces the center of the pixel matrix with one of the pixels in the sorted array by threshold and rank.

Return Type

A McImage object.  

The resulting McImage.

Syntax

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

The Rank 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 ranked pixel to be replaced by the ranked.

RankOptional. A Double value.

Percentage rank (from 0.0 to 100.0) of the replacement pixel. Rank 0 means the lowest pixel value in the kernel, Rank 100 means the highest pixel value in the kernel. Rank 50 means the median pixel value.

vSourceImgOptional. A Variant value.

Optional input IMcImage.

Remarks

Threshold specifies the absoulte difference between the value of the center pixel and the replacement pixel as a percentage of McImage.RangeMin to McImage.RangeMax. If the difference is higher than the threshold, the center pixel will be replaced with the new pixel. Rank specifies which pixel in the sorted array will be used as a candidate replacement pixel.

Rank is the superset of the median filter (Median). The median filter sorts the pixel array and picks the center pixel of the sorted array. Rank with Rank of 50.0 is the same as Median.

Exceptions

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