1
$\begingroup$

When we say we set a threshold to the edge finding, what values are we exactly thresholding on? I know a threshold value to limit only certain edges to show up, but what value of the edges is compared with the threshold?

In both the sobel and canny edge detection, they are comparing with a threshold value but I am never sure what values of the edges are being compared.

$\endgroup$
1
$\begingroup$

Its simple. The gradient matrix is computed while performing the Canny/Sobel edge detection. No the gradient varies according to the edge. When you digitize this gradient function, you get a value which tells the magnitude of the gradient at that point.

When you threshold. These magnitudes are compared to the threshold value. If you want weak edges, you keep low threshold values. In such a case all minor edges will show up as well. If you want only strong 'clear' edges, then you keep higher threshold values.

$\endgroup$
  • $\begingroup$ So the gradient magnitude are the change of the pixel colour values between one pixel and the other pixel on its left and right? $\endgroup$ – xenon Mar 16 '13 at 16:03
  • $\begingroup$ Yes. Precisely that. However Canny uses Laplacian operator and not gradient. $\endgroup$ – Naresh Mar 16 '13 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.