SIP Toolbox

edge - Edge detection

Calling Sequence

E = edge(Img)
E = edge(Img, <named_args>)
E = edge(Img, method)
E = edge(Img, method, thresh)
E = edge(Img, method, thresh, direction)
E = edge(Img, method, thresh, direction, sigma)

Input Parameters

Output Parameters

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.

Examples

   initial_dir = PWD;
   chdir (SIPDIR + 'images');

   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,'fftderiv', 0.4);  // FFT gradient method; 0.4 threshold
   xbasc()
   imshow(e,[])

   // It is useful to thin the edges, eliminating redundant pixels:
   e = thin(e);
   xbasc()
   imshow(e,[])

   e = edge(Img,'fftderiv',sigma=3,thresh=-1); // thicker edges, no threshold
   xbasc()
   imshow(e,[])

   e = edge(Img,thresh=-1);
   xbasc()
   imshow(e,[])

   chdir(initial_dir);
   

Authors

Ricardo Fabbri <ricardofabbri (AT) users DOT sf DOT net>

Bibliography

"Shape Analysis and Classification", L. da F. Costa and R. M. Cesar Jr., CRC Press, section 3.3.

Availability

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

http://siptoolbox.sourceforge.net

See Also

bwborder,  mogrify,  getangle,  imconv,  im2gray,  mkfilter,