# Could you describe the effects for varying different parameters of a canny edge detector?

Last couple of questions touched upon Canny edge detector

The basic outline of the algorithm is as follows:

a. Apply Gaussian Convolution. (Choice of $\sigma$ to be made here)
b. Apply 2D derivative
c. Tracking through the ridges of this edges and thresholding (set pixels to zero which are not on the edge) with Hysteresis Lower and Higher T0 and T1 (Choice of $T0$ and $T1$ to be made here).

While, it is claimed that Canny is optimal; when getting practical results matters, tweaking factors as listed above $\sigma, T0,$ and $T1$ does make a lot of difference.

So how does one select these (tweaking) parameters practically? Even if, there is no definite approach or value, what is the general technique to know this?

Following http://www.kerrywong.com/2009/05/07/canny-edge-detection-auto-thresholding/ is one of the few resources that shows how to choose thresholds Tlow and Thigh

According to this, for a picture which is sufficiently spread in historgram, one can choose T_low = 0.66 * mean value of image and T_high = 1.33 * mean value.

However, when the image is not sufficiently spread, one should use median as opposed to mean value of the image.

If the gap between T_low and T_high is very small, the resultant edges will be smaller in continuity and hence there will be more fractions. As the gap increases, you will have more single line edges.

As regards to sigma, as the sigma increases, the smoothing increases and noisy edges will go away, but at the same time, the location of edges may also move little. See this document, http://www.cse.unr.edu/~bebis/CS791E/Notes/EdgeDetection.pdf and results at page 29 shows this effect.