Quiz: Horn–Schunck and evaluating flow
Before this unit: Lucas–Kanade: local least squares and pyramids (previous unit); Day 2: Edges, blobs and ridges; Day 23: FFT registration.
See also: Day 5: Deconvolution; Day 6: Splines and NURBS.
Short questions to test your understanding. Try each on paper first, then open the answer.
Q1. Horn–Schunck minimises “data + λ·smoothness”. What exactly does each term measure?
One term per pixel, one per pair of neighbours.
Data: for each pixel, how badly its vector violates its own constraint I_xu + I_yv + I_t = 0 (squared). Smoothness: for each pair of neighbouring pixels, how much their vectors differ (squared). λ sets the balance.
Q2. You run Horn–Schunck with λ = 0.01 and with λ = 10⁵ on a cell crawling over a still background. Describe both results.
Which term wins in each case?
λ tiny: each pixel jumps onto its own constraint line: noisy, and in flat regions undetermined (only the normal flow along edges). λ huge: the field is nearly uniform: the cell’s motion is smeared over the background and the boundary disappears (and convergence is very slow).
Q3. Why does the flow in the middle of a large uniform disc only appear after many iterations?
Where does the information come from, and how far does it travel per iteration?
Inside the disc there are no gradients, so no constraints: the only information comes from the textured border, and each iteration passes it on by averaging with the neighbours, about one pixel per iteration (it spreads like heat). A disc of radius 30 needs hundreds to thousands of iterations. Coarse-to-fine (or multigrid) solvers speed this up.
Q4. A pixel with (I_x, I_y, I_t) = (2, 0, -4) has neighbour average (\bar u, \bar v) = (0, 0). Compute one Horn–Schunck update for λ = 1 and for λ = 3.
u = \bar u - I_x(I_x\bar u + I_y\bar v + I_t)/(4\lambda + I_x^2 + I_y^2).
λ = 1: u = 0 - 2 \cdot (-4)/(4 + 4) = 1, v = 0. λ = 3: u = 8/(12 + 4) = 0.5, v = 0. The constraint alone says u = 2; the larger λ, the more the pixel stays with its neighbours.
Q5. Two estimates both have an endpoint error of 0.5 px: one at a pixel moving 0.6 px per frame, one at a pixel moving 2.5 px per frame. Which has the larger angular error, and why is the endpoint error usually preferred?
Compare the space–time vectors (u, v, 1).
The slow pixel: for (0.1, 0) against (0.6, 0) the angular error is 25°, for (2, 1) against (2.5, 1) only 5.8°. The angular error depends on the speed, which makes errors at slow pixels look much worse; the endpoint error is in pixels for every pixel alike and easier to interpret.
Q6. Your warping residual is close to zero everywhere. Can you conclude that the flow is right?
What does a wrong flow do in a flat region?
No. A small residual is necessary but not sufficient: in flat regions (and along edges, for the component along the edge) a wrong flow moves flat onto flat and leaves no residual. A large residual reliably flags failures (occlusions, boundaries, bleaching); a small one proves nothing in regions without texture.
Q7. (math) Show that a Horn–Schunck update leaves a pixel unchanged if its neighbour average already satisfies its constraint.
Look at the numerator of the step.
The step is -\nabla I\,(I_x\bar u + I_y\bar v + I_t)/(4\lambda + |\nabla I|^2). If (\bar u, \bar v) satisfies the constraint, the numerator I_x\bar u + I_y\bar v + I_t is 0, so the new vector equals the average. If that average also equals the pixel’s current vector, nothing changes: the field is a fixed point, which (by the derivation) is exactly where \partial E/\partial u_p = \partial E/\partial v_p = 0.