CImage:FiltRect
The FiltRect method smooths an image by applying a filter kernel having equal weights in a rectangular shape.
bResult = CImage:FiltRect( cols, rows, CRect=nil ) |
cols is the column length of the filter kernel.
rows is the row length of the filter kernel.
CRect is the rectangle defining the area to process. If omitted, it defaults to nil and the entire image is processed.
On success, this method returns true.
On failure, this method returns false.
This method smooths the image using a rectangle shaped filter kernel having equal weights. By comparison, FiltBinomial uses an elliptical shape with binomial coefficient weights. Both of these filters are elongated parallel to the x or y axis. Conversely, the FiltGaussian and FiltEllipse methods can be rotated to a specified angle.
Suppose an image is displayed in a CImageView named V. The following script smooths the region [100:300, 400:800] using a 25x25 Rectangle filter:
|
-- attach the current displayed image |
|
-- setup the rectangle to process |
|
-- apply the filter |
|
-- update the display after the scale |
|
-- done with the CRect |
CImage class, FiltBinomial, FiltEllipse, FiltGaussian
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.