EDGE(1)

NAME
edge - edge detection

SYNOPSIS
E = edge(Img)
E = edge(Img, <opt_args>)
E = edge(Img, method)
E = edge(Img, method, thresh)
E = edge(Img, method, thresh, direction)

PARAMETERS

Img M x N Grayscale (intensity) image in any range.

<opt_args>
    this is a sequence of statements key1=value1, key2=value2,... where key1, key2,... can be one of the following:
    method
        may be 'sobel'(default) or 'prewitt'. Other methods will appear in the future.
    thresh
        sets the threshold level, from 0 to 1. Defaults to 0.5. If negative, then the output image, E, will have the un-thresholded gradient image.
    direction
        may be 'horizontal', 'vertical' or 'both'(default). This determines the direction to compute the image gradient.

DESCRIPTION
The function edge performs edge detection on a grayscale intensity image. The user may set the method, the threshold level and the direction of the edge detection.

edge(Img) Detects edges in Img, using the sobel gradient estimator, 0.5 threshold level and in both horizontal and vertical directions.

The other parameters are optional and non-positional. That is, they may be passed to the function by their name. The following example illustrates this.

EXAMPLE
initial_dir = PWD;
chdir (SIPDIR + 'examples');
Img = imread('tru.jpg');
Img = im2gray(Img);
xbasc()
imshow(Img);
e = edge(Img);  // sobel, thresh = 0.5
xbasc()
imshow(e,2)
e = edge(Img,'prewitt'); // thresh = 0.5
xbasc()
imshow(e,2)
e = edge(Img,'prewitt', 0.7);
xbasc()
imshow(e,2)
e = edge(Img,thresh = 0.7); // sobel
xbasc()
imshow(e,2)
e = edge(Img,direction='vertical'); // sobel
xbasc()
imshow(e,2)
e = edge(Img,thresh=-1);
xbasc()
imshow(e,[])
chdir(initial_dir);

REMARKS
There are only simple methods implemented in this version. In the future, more sophisticated algorithms will be available, while maintaining the same interface.

AUTHORS
Ricardo Fabbri <rfabbri@if.sc.usp.br>

AVAILABILITY
The latest version of the Scilab Image Processing toolbox can be found at

    http://cyvision.if.sc.usp.br/~rfabbri/sip/

SEE ALSO
bwborder, im2gray, imconv, mkfilter