# Which sigma to use for edge detection

I know that in many edge detection algorithm the first step is choosing a scale to work on. We actually operate on the chosen scale by applying a gaussian blur on the original image. I wanted to know , what is the relation between the detected edge's width to the sigma.

e.g. If I want to detect lines 5 pixel wide , which sigma should I use? How should I change it if I want to find a line 10 pixels wide?

One more thing to add is that an edge detection is usually defined more or less like from Wikipedia:

Identifying points in a digital image at which the image brightness changes sharply or, more formally, has discontinuities.

They have a nice illustration: Here, the edge is between $4$th and $5$th pixel (or, between $3$rd and $4$th, if you count $0$-based). (because the gradient is 2 1 2 148 4 1).

What I want to say, is that what you refer to as "thick" edges, will most likely be detected as two edges. As an example, take a look at these example images from the Wikipedia Canny page:  Note the bars going out of the valve (the long thin white structures), and note how in the edge detection result, they are detected as two lines (outer and inner edge).

This can, of course, be avoided, combining the blurring (the $\sigma$ parameter) and some edge thinning techniques. After you blur the image, what was once a wide, sharp edge having just one peak in gradient will now have a gradient slowly reaching maximum and then slowly dropping towards zero.

If there was no blurring, the gradient would be e.g.
2 1 3 130 4 2 3 111 2 0 2.
After blurring, the gradient might look like:
2 1 2 50 85 120 94 63 12 2 0.

In the after-blurring the edge detector will detect a $5px$ long edge. If you want to get just the location of the edge marked by $1px$ wide line, the edge supressing technique is what finds the "maximum" in your blurred-edge gradient and marks the middle pixel (e.g. one with gradient $120$) as the actual edge.

Hope this helps.

The $\sigma$ decides the scale of objects being simplified. This is explained here:

The size of the Gaussian filter: the smoothing filter used in the first stage directly affects the results of the Canny algorithm. Smaller filters cause less blurring, and allow detection of small, sharp lines. A larger filter causes more blurring, smearing out the value of a given pixel over a larger area of the image. Larger blurring radii are more useful for detecting larger, smoother edges – for instance, the edge of a rainbow.

Thus the support size of the Gaussian function decides the level of details that are simplified. Simplest way is to test with binary squares/circles.

For better understanding of $\sigma$ I would suggest reading some about the scale spaces. Some reading recommendations may be found here: http://www.csc.kth.se/~tony/earlyvision.html