CImage:FiltLaplacian


The FiltLaplacian method applies a discrete Laplacian filter to an image. This is a simple form of edge finder that is independent of gradient direction and background slope.

Syntax

bSuccess = CImage:FiltLaplacian()

bSuccess = CImage:FiltLaplacian( nType )

where

    nType is the Laplacian type, in the range 1 to 3. If omitted the default is type 1.

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

  

This method applies a discrete Laplacian filter to enhance edge features while removing gradients and background. Three different types of Laplacian are provided, based on the type of "connectedness" within the pixel neighborhood. These are types 1, 2, and 3. Each higher numbered type has a stronger effect. If the type argument is specified then the default is type=1.

Example

Suppose an image is displayed in a CImageView named V. The following script applies the default Laplacian type 1 filter to the image:

I = V:GetImage()

-- attach the current displayed image

I:FiltLaplacian()

-- apply the filter

V:Update()

-- update the display after the scale

Related Topics

FiltSobel

CImage class