Optical flow or optic flow is the pattern of apparent motion of objects, surfaces, and edges in a visual scene caused by the relative motion between an observer and a scene. Optical flow can also be defined as the distribution of apparent velocities of movement of brightness pattern in an image. The concept of optic flow has roots as far back as Euclid's Optics, but its modern formulation arose from Second World War research into pilot vision during landing. Several researchers arrived at the idea independently; James J. Gibson gave it its most influential treatment, publishing his theory in 1947 and created the term "optic flow" in 1950. The term optical flow is also used by roboticists, encompassing related techniques from image processing and control of navigation including motion detection, object segmentation, time-to-contact information, focus of expansion calculations, luminance, motion compensated encoding, and stereo disparity measurement.
Estimation Optical flow can be estimated in a number of ways. Broadly, optical flow estimation approaches can be divided into machine learning based models (sometimes called data-driven models), classical models (sometimes called knowledge-driven models) which do not use machine learning and hybrid models which use aspects of both learning based models and classical models.
Classical models Many classical models use the intuitive assumption of brightness constancy; that even if a point moves between frames, its brightness stays constant. To formalise this intuitive assumption, consider two consecutive frames from a video sequence, with intensity I(x,y,t), where (x,y) refer to pixel coordinates and t refers to time. In this case, the brightness constancy constraint is
I(x,y,t)−I(x+u,y+v,t+1)=0, where 𝐰:=(u,v) is the displacement vector between a point in the first frame and the corresponding point in the second frame. By itself, the brightness constancy constraint cannot be solved for u and v at each pixel, since there is only one equation and two unknowns. This is known as the aperture problem. Therefore, additional constraints must be imposed to estimate the flow field.
Regularized models Perhaps the most natural approach to addressing the aperture problem is to apply a smoothness constraint or a regularization constraint to the flow field. One can combine both of these constraints to formulate estimating optical flow as an optimization problem, where the goal is to minimize the cost function of the form,
E=∬ΩΨ(I(x+u,y+v,t+1)−I(x,y,t))+αΨ(|∇u|)+αΨ(|∇v|)dxdy, where Ω is the extent of the images I(x,y), ∇ is the gradient operator, α is a constant, and Ψ() is a loss function. This optimisation problem is difficult to solve owing to its non-linearity. To address this issue, one can use a variational approach and linearise the brightness constancy constraint using a first order Taylor series approximation. Specifically, the brightness constancy constraint is approximated as,
∂I∂xu+∂I∂yv+∂I∂t=0. For convenience, the derivatives of the image, ∂I∂x, ∂I∂y and ∂I∂t are often condensed to become Ix, Iy and It. Doing so, allows one to rewrite the linearised brightness constancy constraint as,
Ixu+Iyv+It=0. The optimization problem can now be rewritten as
E=∬ΩΨ(Ixu+Iyv+It)+αΨ(|∇u|)+αΨ(|∇v|)dxdy. For the choice of Ψ(x)=x2, this method is the same as the Horn-Schunck method. Of course, other choices of cost function have been used such as Ψ(x)=x2+ϵ2, which is a differentiable variant of the L1 norm. To solve the aforementioned optimization problem, one can use the Euler–Lagrange equations to provide a system of partial differential equations for each point in I(x,y,t). In the simplest case of using Ψ(x)=x2, these equations are,
Ix(Ixu+Iyv+It)−αΔu=0, Iy(Ixu+Iyv+It)−αΔv=0, where Δ=∂2∂x2+∂2∂y2 denotes the Laplace operator. Since the image data is made up of discrete pixels, these equations are discretised. Doing so yields a system of linear equations which can be solved for (u,v) at each pixel, using an iterative scheme such as Gauss-Seidel. Although, linearising the brightness constancy constraint simplifies the optimisation problem significantly, the linearisation is only valid for small displacements and/or smooth images. To avoid this problem, a multi-scale or coarse-to-fine approach is often used. In such a scheme, the images are initially downsampled and the linearised Euler–Lagrange equations are solved at the reduced resolution. The estimated flow field at this scale is then used to initialise the process at next scale. This initialisation process is often performed by warping one frame using the current estimate of flow field so that it is as similar to other as possible. An alternate approach is to discretize the optimisation problem and then perform a search of the possible (u,v) values without linearising it. This search is often performed using Max-flow min-cut theorem algorithms, linear programming or belief propagation methods. These regularized methods typically require manual tuning of the Lagrange multiplier, the so-called regularization parameters. There has been some progress in the automatic determination of these parameters in the context of optical flow applied to particle image velocimetry (PIV) data.
Parametric models Instead of applying the regularization constraint on a point by point basis as per a regularized model, one can group pixels into regions and estimate the motion of these regions. This is known as a parametric model, since the motion of these regions is parameterized. In formulating optical flow estimation in this way, one makes the assumption that the motion field in each region be fully characterised by a set of parameters. Therefore, the goal of a parametric model is to estimate the motion parameters that minimise a loss function which can be written as,
𝜶̂=argmin𝜶∑(x,y)∈ℛg(x,y)ρ(x,y,I1,I2,u𝜶,v𝜶), where 𝜶 is the set of parameters determining the motion in the region ℛ, ρ() is data cost term, g() is a weighting function that determines the influence of pixel (x,y) on the total cost, and I1 and I2 are frames 1 and 2 from a pair of consecutive frames. The simplest parametric model is the Lucas-Kanade method. This uses rectangular regions and parameterises the motion as purely translational. The Lucas-Kanade method uses the original brightness constancy constraint as the data cost term and selects g(x,y)=1. This yields the local loss function,
… excerpt ends here. Continue reading the full article.


