CImage:FiltGradient


The FiltGradient method applies a directional gradient filter to the image. This filter selects features aligned along specific directions and may also be used to produce the effect of low-angle illumination.

Syntax

bResult = CImage:FiltGradient( angle )

Remarks

This method constructs a 3x3 gradient mask using the specified rotation angle and applies it to the image. This is a discrete form of the mathematical directional gradient operator. The visual effect is to change the image into a false relief map with illumination shining from the direction specified by the rotation angle.

Example

Suppose an image is displayed in a CImageView named V. The following script applies a 45 degree gradient operator to the displayed image:

 

I = V:GetImage()

-- attach the current displayed image

I:FiltGradient( 45 )

-- apply the filter

V:Update()

-- update the display after the scale

Related Topics

CImage class, FiltLine , FiltPrewitt


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