DADiSP Worksheet Functions > Function Categories > Image Processing > SOBEL

 

SOBEL

Purpose:

Performs a nonlinear 2D Sobel edge detection.

Syntax:

SOBEL(image, thresh, overlay)

image

-

An image or table.

thresh

-

Optional. A real, the threshold for edge detection. Defaults to mean of image.

overlay

-

Optional. An integer, overlay pixel flag:

0:

do not overlay original image (default)

1:

overlay original image

Returns:

A table.

Example:

If 15 represents White, and 0 Black,

 

W1: {{ 5, 2, 9,  1},

     { 1, 4, 3,  5}, 

     {11, 8, 7, 10}, 

     { 6, 6, 1,  2}} 

 

W2: sobel(W1, 5, 1)

 

W2 == {{0, 0, 0, 0},

       {0, 4, 3, 0}, 

       {0, 8, 7, 0}, 

       {0, 0, 0, 0}} 

 

W3: sobel(W1, 3, 0)

 

W3 == {{0,  0,  0, 0},

       {0, 15, 15, 0}, 

       {0, 15,  0, 0}, 

       {0,  0,  0, 0}} 

Remarks:

If the absolute value difference between pixels is less than the threshold, a black pixel is produced in the output image. Otherwise a white pixel is produced. If overlay is 1, then the actual image value is substituted for resulting black pixels.

See Also:

CONV2D

IMINTERP

NONLIN2D