Quiz: images as landscapes
Before this unit: Day 14: Labelling.
See also: Day 2: Edges, blobs and ridges.
Short questions to test your understanding. Try each on paper first, then open the answer. The image is a landscape (grey level = height); water rises from every regional minimum (or only from markers), and a dam is built where two lakes meet.
Q1. You flood an image of bright nuclei on a dark background. Where do the basins start, and what should you flood instead?
Water collects in valleys.
The minima are in the dark background, so the basins grow from the background and the dams fall on the bright nuclei: the wrong way round. Flood the inverted image (255 - f, or -f): the nuclei become valleys. Or flood the gradient magnitude, whose valleys are the flat insides of nuclei and background alike.
Q2. A 1D signal has regional minima at samples 4 and 11 and no other minimum between them. The highest sample between them has height 9, at sample 7. Where is the dam, and at which water level is it built?
When can the two lakes first touch?
At sample 7, at level 9. Below 9 the two lakes are separated by sample 7; at 9 both reach it. The dam height is the pass between the basins.
Q3. Why does flooding the gradient magnitude put the boundaries on edges, and flooding the intensity not?
Where is \|\nabla f\| small, and where large?
The gradient magnitude is small inside regions of nearly constant intensity (valleys) and large on edges (ridges); the dams sit on ridges, so on the edges. Flooding the intensity puts the basins in the dark parts and the dams on the brightest lines between them, which are edges only when the objects are dark valleys separated by bright ridges.
Q4. A noisy image of 20 cells gives 3000 regions after the watershed of its gradient. What went wrong?
Count the sources.
Every regional minimum of the landscape starts a basin, and noise makes thousands of tiny minima: oversegmentation. Fewer sources are needed: smooth first, keep only the minima deeper than h (h-minima), or flood from markers.
Q5. A basin has its bottom at 30 and its lowest pass to a deeper basin at 34. Does it survive h-minima with h = 3? With h = 4? With h = 5?
Its depth is 4. A basin survives when it is deeper than h.
h = 3: yes (filled to 33, still below its pass). h = 4: no (filled to 34, it reaches the pass and merges). h = 5: no.
Q6. You flood from 3 markers. There are 40 regional minima. How many regions do you get, and what happens to the other 37 minima?
Only markers are sources.
3 regions (if every pixel can be reached from some marker). The 37 unmarked minima are not sources: each is filled by water from whichever marker reaches it first, so it becomes part of that marker’s region (it is “drowned”).
Q7. A wide flat ridge (a plateau) separates two basins. Where should the dam go, and why does the order of flooding on the plateau matter?
Both lakes reach the plateau at the same level.
In its middle: both lakes arrive at the same level, one at each end, and should spread over the plateau at the same speed. The flooding algorithm achieves this by processing equal heights first in, first out; a different order (e.g. last in, first out) lets one lake run across the plateau and the dam ends up in an arbitrary place.
Q8. (math) For f(x, y) = (x^2 - 1)^2 + y^2, what are the two catchment basins, and what is the height of the pass between the minima?
Follow -\nabla f; the x component is -4x(x^2 - 1).
The half-planes x < 0 and x > 0 (the sign of x never changes along the flow); the watershed line is x = 0. The pass is the saddle at (0, 0), height f(0, 0) = 1.