ArticleslgStudy

physics

Optical flow

Optical flow is a physics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Optical flow rather than just read about it. In short: 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.

Optical flow — main illustration
Optical flow — illustration

Key takeaways

  • Optical flow belongs to physics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Optical flow to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Optical flow from memory before moving on to harder problems.

Reference excerpt

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,

𝜶̂=arg⁡min𝜶∑(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.

Illustrations

Optical flow: The optic flow experienced by a rotating observer (in this case a fly). The direction and magnitude of optic flow at each location is represented by the direction and length of each arrow.
The optic flow experienced by a rotating observer (in this case a fly). The direction and magnitude of optic flow at each location is represented by the direction and length of each arrow.
Optical flow: The optical flow vector of a moving object in a video sequence
The optical flow vector of a moving object in a video sequence

Worked examples

Example 1 — a first encounter with Optical flow

Start with the simplest possible case. Write down what Optical flow claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In physics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Optical flow before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Optical flow ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Optical flow

In research
Optical flow appears in physics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Optical flow in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Optical flow is common in secondary-school and first-year university syllabi. It links to neighbouring topics Motion in computer vision, so understanding it makes those chapters shorter.
In everyday life
Look for Optical flow outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Optical flow” →

How to study Optical flow in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Optical flow means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Optical flow out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Optical flow in simple terms?

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.

Why does Optical flow matter?

Because it connects several physics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Optical flow?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Optical flow.

Tags

  • Motion in computer vision

Keep exploring