canny

[ XITE Reference Manual | XITE home ]

Name

canny, canny_filters, canny_scale - detect edges in image using Canny operator

Syntax

 #include <xite/canny.h>

 int canny( IBAND input, IBAND magnitude,
    IBAND angle, IBAND laplace, int lngth,
    int h1[], int h2[], int h3[], double scale,
    int thin, int verbose );

 int canny_filters( float sigma, int k, int h1[],
    int h2[], int h3[], int verbose );

 double canny_scale( double sigma, int k );

Description

canny performs the canny edge detector on the input image input. Output from the function are the edge magnitude, the edge angle and the laplace. The filter is specified by a gaussian function h1, the first derivative h2, and the second derivative h3, all of length lngth. The outputs are scaled down with a factor scale. If thin is true, thinning of the edge is performed. The function may be silent or verbose.

canny_filters computes the filters h1, h2, and h3. based on sigma and k. The function returns the filter length. You may try sigma=1.0 .. 7.0 and k=200 .. 500. John Canny has used 2.0 and 450 as default values.

canny_scale returns a default scale value based on sigma and magnification k.

Restrictions

The current implementation has a maximum filter length of 50, and a maximum input image width of 1024.

All the band parameters in canny must have pixel type unsigned byte.

Return value

For canny_scale
The default scale value.

For canny_filters
Filter length.

For canny

 0 : Ok
 1 : Bad pixeltype
 2 : Filter length too large
 3 : Input image too small compared to filter
     length

Reference

John Canny: A computational Approach to Edge Detection. IEEE Transactions on Pattern analysis and Machine Int. Vol. PAMI-8 No 6 Nov. 1986

Author

 Paul Kloschinsky
 Modified for XITE by Otto Milvang and Svein Bøe.