CImage:FiltEllipse


The FiltEllipse method smooths an image by applying a filter kernel having equal weights in an elliptical shape. The filter can be rotated.

Syntax

bSuccess = CImage:FiltEllipse( cols, rows, angle )

bSuccess = CImage:FiltEllipse( cols, rows, angle, CRect )

where

    cols is the column length of the filter kernel.

    rows is the row length of the filter kernel.

    angle is the rotation angle in degrees.

    CRect is the CRect object defining the area to process. If omitted, the entire image is processed.

    bSuccess is the returned success code. On success it is true, otherwise false.

  

This method smooths the image using an elliptical shaped filter kernel having equal weights. By comparison, FiltBinomial uses an elliptical shape with binomial coefficient weights but cannot be rotated. The FiltGaussian method has similar properties of elongation and rotation but uses Gaussian weights rather than equal weights.

Example

Suppose an image is displayed in a CImageView named V. The following script smooths the region [100:300, 400:800] using a 5x11 ellipse filter rotated 45 degrees:

I = V:GetImage()

-- attach the current displayed image

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

-- setup the rectangle to process

I:FiltEllipse(5,11,45,R)

-- apply the filter

V:Update()

-- update the display after the scale

Related Topics

FiltGaussian

FiltBinomial

FiltRect

CImage class