Canny, one stage per panel
Four panels: the photo, the gradient magnitude, what survives non-maximum suppression, and what survives hysteresis. The edge-pixel count updates as you move any control.
Try this
Set the two thresholds equal — that turns hysteresis off — and watch the edge count collapse. Then raise only the high one and see whole contours vanish, because you removed the seeds their chains needed.
Where this lab comes from
Canny: Non-Maximum Suppression and Hysteresis, Taken ApartLesson 4 of the Edge Detection unit. Canny is two independent mechanisms, not one tuned number. NMS collapses a five-pixel ridge to one pixel by comparing along the gradient; hysteresis keeps a weak chain because it touches a strong seed. Worked on nine numbers: a single threshold gives either 1 pixel or 9, and hysteresis gives the 6 that belong to a real contour. Measured on a photo, that is 204 contours averaging 18.68 px against 393 averaging 9.69 px at the same pixel budget.
More in edges and features
- An edge, and its two derivatives — One row of pixels, with the first and second derivative stacked underneath.
- Flat, edge, or corner — Drag a window over a photo; two eigenvalues deliver the verdict.
- Picking the right scale — Five discs of different sizes, one sigma slider.