tezvyn:

Sparse vs dense optical flow and Lucas-Kanade

AI-drafted, machine-checkedSource: interviewbeginner
WHAT IT TESTS

understanding motion estimation granularity.

OUTLINE

sparse flow tracks selected feature points, dense flow computes a vector per pixel; Lucas-Kanade solves brightness constancy in a local window assuming constant motion.

WHAT THIS TESTS Whether you understand that optical flow estimates apparent pixel motion between frames and that sparse and dense differ in coverage, not merely quality.

A GOOD ANSWER COVERS Optical flow describes the apparent motion of brightness patterns between consecutive frames. Sparse optical flow estimates motion only at a set of selected points, typically good-to-track features like corners detected by Shi-Tomasi or Harris, producing a few reliable vectors cheaply. Dense optical flow estimates a displacement vector for every pixel, giving a full motion field useful for segmentation or warping but far more expensive. The Lucas-Kanade method is a classic sparse approach. It rests on two assumptions: brightness constancy, that a pixel's intensity is unchanged as it moves, and small motion, letting a first-order Taylor expansion linearize the constraint. A single pixel gives one equation in two unknowns, the aperture problem, so Lucas-Kanade assumes every pixel in a small neighborhood moves identically, yielding an overdetermined system solved by least squares.

COMMON WRONG ANSWERS Saying sparse flow is just low-quality dense flow; they target different point sets. Forgetting the aperture problem and why a window is needed. Claiming Lucas-Kanade handles large motions directly without a coarse-to-fine pyramid.

LIKELY FOLLOW-UPS What is the aperture problem? Why use an image pyramid with Lucas-Kanade for larger motion? How does Farneback or a deep network like RAFT do dense flow? Where does the least-squares system become singular?

ONE CONCRETE EXAMPLE Tracking a moving car, detect 200 corners on it, then for each corner take a 5 by 5 window, build the least-squares system from spatial and temporal gradients, and solve for the per-corner motion vector, getting sparse arrows on the car rather than a per-pixel field.

Read the original → en.wikipedia.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.