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 Apart

Lesson 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