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

bSuccess = CImage:FiltGradient( angle )

where

    angle is the rotation angle in degrees.

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

  

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

FiltLine

FiltPrewitt

CImage class