CImage:FiltGaussian
The FiltGaussian method smooths an image by applying a filter kernel having Gaussian weights in an elliptical shape. The filter can be rotated.
bResult = CImage:FiltGaussian( sigma, ratio, angle, CRect=nil ) |
This method smooths the image using an elliptical shaped filter kernel having Gaussian weights. By comparison, FiltEllipse uses an elliptical shape with equal weights.
This filter is specified in terms of its major axis. Be wary of the apparent small size of the filter based on its sigma value. The filter extends to 2.5 x sigma along the semi-major axis. Therefore specifying sigma=3 produces a filter kernel 2 x 3 x 2.5 = 15 pixels wide. Note that the processing time increases in proportion to the product filter width x filter height; processing a 15x15 kernel takes 9 times longer than processing a 5x5 kernel.
Suppose an image is displayed in a CImageView named V. The following script fragment smooths the region [100:300, 400:800] using a 10x5 Gaussian filter rotated 45 degrees:
|
-- attach the current displayed image |
|
-- setup the rectangle to process |
|
-- apply the filter |
|
-- update the display after the scale |
|
-- done with the CRect |