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.

Syntax

bResult = CImage:FiltRank( cols, rows, percentile, CRect=nil )

bullet.gif    cols is the column length of the filter kernel.

bullet.gif    rows is the row length of the filter kernel.

bullet.gif    Percentile is the neighborhood percentile rank to select.

bullet.gif    CRect is the rectangle defining the area to process. If omitted, it defaults to nil and the entire image is processed.

bullet.gif    On success, this method returns true.

bullet.gif    On failure, this method returns false.

Remarks

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.

Example

Suppose an image is displayed in a CImageView named V. The following script removes point defects from the [100:300, 400:800] pixel region using a 3x3 rank filter at 45 percentile rank:

I = V:GetImage()

-- attach the current displayed image

R = new_rect(100,300,400,800)

-- setup the rectangle to process

I:FiltRank(3,3,45,R)

-- apply the filter

V:Update()

-- update the display after the scale

R:delete()

-- done with the CRect

Related Topics

CImage class, FiltMedian, FiltMin, FiltMax


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.