CImage:FiltRank
The FiltRank method applies a rank filter to the image. This filter selects the neighborhood value having a particular percentile rank. The filter can be tuned for removing noise or for other morphological effects.
bResult = CImage:FiltRank( cols, rows, percentile, CRect=nil ) |
This method applies a rectangular rank filter to the image. The ranking operation is a nonlinear process because the resulting value cannot be determined by applying linear operations (addition and multiplication) to other pixel values.
Suppose an image is displayed in a CImageView named V. The following script fragment removes point defects from the [100:300, 400:800] pixel region using a 3x3 rank filter at 45 percentile rank:
|
-- attach the current displayed image |
|
-- setup the rectangle to process |
|
-- apply the filter |
|
-- update the display after the scale |
|
-- done with the CRect |