<< Image analysis | Image analysis | findContours >>

scicv >> Image analysis > Canny

# Canny

Finds edges in an image

### Syntax

    img_out = Canny(img_in, threshold1, threshold2, apertureSize[, L2gradient])

### Parameters

img_in

  Input image (single channel 8-bit) (Mat).

threshold1

  First threshold for the hysteresis procedure (double).

threshold2

  Second threshold for the hysteresis procedure (double).

apertureSize

  Aperture size for the Sobel operator (double) (default 3).

L2gradient

  Flag indicating to use the more accurate L2 norm for the image gradient magnitude (double) (default %f).

img_out

  Output image (Mat).

### Description

`Canny` finds edges in an image using the Canny algorithm.

### Examples

    scicv_Init();

    img_gray = imread(getSampleImage("shapes.png"), CV_LOAD_IMAGE_GRAYSCALE);

    subplot(1,2,1);
    matplot(img_gray);

    thresh = 100;
    img_canny = Canny(img_gray, thresh, thresh*2, 3);

    subplot(1,2,2);
    matplot(img_canny);

    delete_Mat(img_gray);
    delete_Mat(img_canny);

Report an issue
<< Image analysis | Image analysis | findContours >>