It takes as input a gray scale image, and produces as output an image showing the positions of tracked intensity discontinuities. How It Works The Canny operator works in a multi-stage process. First of all the image is smoothed by Gaussian convolution .
Edges give rise to ridges in the gradient magnitude image.
The algorithm then tracks along the top of these ridges and sets to zero all pixels that are not actually on the ridge top so as to give a thin line in the output, a process known as non-maximal suppression . Tracking can only begin at a point on a ridge higher than T1 . Tracking then continues in both directions out from that point until the height of the ridge falls below T2 . This hysteresis helps to ensure that noisy edges are not broken up into multiple edge fragments. Increasing the width of the Gaussian kernel reduces the detector's sensitivity to noise, at the expense of losing some of the finer detail in the image.