Description

Brings out edges and contours in an image using 3x3 convolution filters.

Return Type

A McImage object.  

The resulting McImage.

Syntax

object.Sobel ([vSourceImg])

The Sobel Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McEdges.
vSourceImgOptional. A Variant value.

Optional input McImage or McRegionAccess.

Remarks

This filter extracts and enhances edges and contours in an image by expressing intensity differences (gradients) between neighboring pixels as an intensity value. This is done by combining the difference between the top and bottom rows in a neighborhood, with the difference between the left and right columns, using the following formula:

where: X = (C + 2F + I) - (A + 2D +G) Y = (A + 2B + C) - (G + 2H +I)

and where the neighborhood is arranged as a row of pixels A, B and C, followed by a row of pixels D, E and F, followed by a row of pixels G, H and I.

In neighborhoods where there is no difference among values in the neighborhood, the pixel's intensity is set to 0 (black); where there is the greatest possible difference, the pixel is set to 255 (white).

The results are similar to the Roberts filter, highlighted edges against a dark background, but the Sobel filter is less sensitive to image noise. This generally results in an image with smoother outlines of only the principle edges.

Exceptions

The exception mceINVALIDARG (E_INVALIDARG) will be thrown if one of the parameters is invalid.