CImage:FiltSobel


The FiltSobel method applies a Sobel edge detection operator to the image. The mean level of the resulting image is 0.

Syntax

bSuccess = CImage:FiltSobel()

where

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

  

This method creates an image containing a measure of edge strength. The pixel value contains the value of the local absolute gradient which is independent of both background level and slope. Depending upon whether the second derivative is positive or negative, the edge image may contain positive or negative values.

Example

Suppose an image is displayed in a CImageView named V. The following script creates an edge strength map by applying the Sobel operator to the displayed image:

I = V:GetImage()

-- attach the current displayed image

I:FiltSobel()

-- apply the filter

V:Update()

-- update the display after the scale

Related Topics

FiltLaplacian

CImage class