Q: Define optical flow. What are the two basic assumptions you consider before computing optical flow? Explain in detail the working principle of Horn and Shunck method for computing optical flow. What are the differences between Horn-Shunck method and Lucas-Kanade method employed for optical flow? (Marks: 2+4+8+2 = 16)

Answer:

1. Definition of Optical Flow (2 Marks)

Optical flow is the pattern of apparent motion of brightness patterns in an image sequence. It represents the projection of the 3D motion of scene points onto the 2D image plane. It is typically represented as a dense 2D vector field, , where each vector indicates the instantaneous velocity (image displacement in and directions per unit time) of the brightness pattern located at pixel coordinates between two consecutive frames.

2. Basic Assumptions for Computing Optical Flow (4 Marks)

Two fundamental assumptions are typically made when deriving basic optical flow computation methods:

  • (i) Brightness Constancy: The perceived brightness (intensity) of a moving object point remains constant over time, at least for short durations between consecutive frames. If represents the image intensity at pixel at time , then for a displacement over a time interval , this assumption is mathematically stated as:

  • (ii) Small Motion: The displacement of image points between consecutive frames is small (typically only a few pixels). This assumption allows the use of first-order Taylor series expansions to linearize the relationship between intensity changes and motion, simplifying the computation.

3. Working Principle of Horn & Schunck Method (8 Marks)

The Horn and Schunck method is a classic variational approach to compute a dense optical flow field. Its working principle involves combining the brightness constancy assumption with a global smoothness constraint to resolve the ambiguities inherent in local motion estimation (the aperture problem).

  • Step 1: Optical Flow Constraint Equation (OFCE): Starting with the brightness constancy assumption: Assuming small motion, we perform a first-order Taylor series expansion of the right side around : Substituting this back into the brightness constancy equation and simplifying gives: Let , , . Dividing by and defining the optical flow velocity components and , we get the Optical Flow Constraint Equation (OFCE): This equation relates the unknown flow to the measurable spatial () and temporal () image intensity derivatives. However, this single equation provides only one constraint for two unknowns () at each pixel, leading to the aperture problem (only the flow component normal to the image gradient can be determined locally).

  • Step 2: Smoothness Constraint: To overcome the aperture problem, Horn and Schunck introduced a global smoothness constraint. This assumes that the optical flow field varies smoothly across the image, meaning neighbouring pixels tend to have similar flow vectors. This constraint is mathematically expressed by penalizing large spatial gradients of the flow components and . The measure of non-smoothness is given by:

  • Step 3: Variational Formulation (Minimization): The Horn-Schunck method seeks to find the optical flow field that minimizes a global error functional , which is a weighted sum of the error in satisfying the brightness constancy constraint and the measure of non-smoothness, integrated over the entire image domain : Here, is a regularization parameter that controls the trade-off between adherence to the brightness constancy (data term) and the smoothness of the flow field (smoothness term).

  • Step 4: Solution via Calculus of Variations: The minimization of the functional is achieved using the calculus of variations, leading to the Euler-Lagrange equations. These result in a pair of coupled partial differential equations (PDEs): where is the Laplacian operator.

  • Step 5: Iterative Numerical Solution: These PDEs are typically solved numerically on a discrete pixel grid. The spatial and temporal derivatives () are approximated using finite difference masks (e.g., Roberts masks, Sobel masks, or simple differences). The Laplacian is also approximated, often using a local averaging scheme where , where is the average of in a small neighbourhood. This leads to an iterative solution: where is the iteration number, and are the local averages of the flow components from the previous iteration, and The iteration starts with an initial guess (e.g., ) and continues until the flow field converges (changes between iterations are below a threshold). The result is a dense optical flow field, providing a velocity vector for every pixel.

4. Differences between Horn-Schunck and Lucas-Kanade Methods (2 Marks)

FeatureHorn-Schunck MethodLucas-Kanade Method
Constraint TypeGlobal Smoothness ConstraintLocal Constant Flow Constraint
ScopeConsiders the entire image simultaneouslyConsiders a small local window () around each pixel/feature
Math FormulationMinimizes global energy functional (Variational Calculus)Solves local overdetermined system via Weighted Least Squares
Output DensityNaturally Dense (vector per pixel)Sparse (one vector per window/feature point) in basic form; Dense variants exist
ComputationIterative solution of PDEs, potentially slowOften closed-form solution (matrix inversion) per window, generally faster
AssumptionsBrightness constancy, small motion, global flow smoothnessBrightness constancy, small motion, local flow constancy