Quiz: watershed as a minimum spanning forest
Before this unit: Spanning trees: single linkage and FH (previous unit); Day 27: Graph cuts; Day 15: Watershed.
See also: Day 28: Ising model and Markov random fields; Day 35: Gaussian mixtures.
Short questions to test your understanding. Try each on paper first, then open the answer. Edge weights are altitudes or dissimilarities (small = easy to cross).
Q1. In what sense is Meyer’s flooding “Prim’s algorithm from all markers at once”?
What does Prim’s algorithm add in every step?
Prim grows a tree by always adding the cheapest edge that leaves it. Flooding with edge altitudes \max(f_p, f_q) always takes the lowest pass out of the already flooded set and gives the new pixel the label of its flooded neighbour. Started from all markers, it grows one tree per marker, cheapest edge first: a minimum spanning forest rooted at the markers.
Q2. What is a “cut edge” in the seeded minimum spanning forest, and what does it correspond to in the watershed picture?
When does Prim refuse an edge although one end is new?
An edge whose two ends belong to trees of different markers. It is never added (it would merge two markers’ regions). The set of cut edges is the watershed: the place where floods from two markers meet.
Q3. Pixel p can reach marker A along a path whose highest edge is 7, and marker B along a path whose highest edge is 6, but that path is twice as long. Which marker does the watershed give it?
Does path length count?
B, assuming no path to A has a highest edge below 6. The watershed assigns each pixel to the marker with the lowest highest pass (minimax distance); the length of the path plays no role.
Q4. You square all edge weights before computing the watershed. What changes? And for a graph cut?
Which methods depend only on the order of the weights?
The watershed does not change: squaring (of non-negative weights) keeps their order, and Prim and Kruskal only compare weights. A graph cut adds weights up, so a different transformation can change which cut is cheapest.
Q5. Why does a narrow gap in a dark boundary let the watershed leak?
How is the cost of a path computed?
The cost of a path is its single highest edge. A path through the gap avoids the high boundary entirely; its cost is set by the low values in and around the gap. One low pass is enough, however short the gap.
Q6. Why does the watershed not have the graph cut’s shrinking bias?
What does the result depend on?
The graph cut pays for every cut edge, so short boundaries (around small seeds, across thin structures) are cheap. The watershed has no cost for boundary length at all: each pixel goes to the marker it can reach over the lowest pass, whatever the length of the resulting boundary.
Q7. Same seeds, same image: the graph cut adds up cut weights, the random walker squares of differences, the watershed takes a maximum. Which one gives probabilities, and which is fastest?
Soft vs hard; linear system vs sort.
Only the random walker gives probabilities (soft labels). The watershed is the fastest: a sort (or bucket queue) and one pass; the graph cut needs a max-flow, the walker a large linear system.
Q8. (math) Why does the minimum spanning tree of the graph extended by a virtual root (joined to all markers by weight -\infty) contain all root edges?
Cut property.
For a marker m, take the split \{m\} versus all other nodes. The edges across it are (r, m) with weight -\infty and m’s ordinary edges. (r, m) is strictly the cheapest, so by the cut property (and the exchange argument behind it) every minimum spanning tree contains it.