Skip to content
AI.info

Computer vision

Optical Flow and Dense Correspondence

Understand dense pixel correspondence, brightness assumptions, occlusion, flow fields, and the evaluation of motion estimates.

By the end you can

Motion in the world is not identical to motion in the image

A stationary wall moves across the image when the camera pans; a rotating ball can change appearance while its center barely moves; a hidden surface disappears and creates no valid correspondence.

Optical flow estimates apparent image displacement, conditioned on visibility and imaging; it does not directly provide object motion in world coordinates.

Flow is a two-dimensional correspondence field, not a complete description of physical motion.

Visual

From two frames to a motion field

Modern flow systems combine appearance matching with iterative refinement. Every stage below has a published way to be measured. The last one — marking uncertainty and occlusion — is the stage this lesson returns to twice, because it is the one an average error score erases.

FigureProcess · 5 steps
  1. 1. Extract features

    Represent each frame at pixel or patch locations.

  2. 2. Compare candidate positions

    Build local or global evidence for where features moved.

  3. 3. Initialize a flow field

    Propose horizontal and vertical displacement for each location.

  4. 4. Refine with context

    Use recurrent, pyramidal, or multiscale updates to resolve ambiguity.

  5. 5. Mark uncertainty and occlusion

    Separate unsupported correspondence from confident motion.

Comparison

Useful flow assumptions and where they fail

Classical and learned methods still rely on some notion of matchability. The smoothness entry in this table is not a stylistic preference. It is arithmetic.

Two frames give one measurement at a point. The flow at that point has two components. Horn and Schunck said so in 1980: flow “cannot be computed locally, since only one independent measurement is available from the image sequence at a point, while the flow velocity has two components”. Their abstract names the second constraint they added to close the gap: “A method for finding the optical flow pattern is presented which assumes that the apparent velocity of the brightness pattern varies smoothly almost everywhere in the image.” The same memo flags its own exception, giving examples “where the assumption of smoothness is violated at singular points or along lines in the image”. The assumption arrived with its failure case attached.

Middlebury's own paper rebuilds that step in 2011. Brightness constancy linearises to the optical flow constraint u∂I/∂x + v∂I/∂y + ∂I/∂t = 0, which is “just one constraint on the two unknowns at each pixel” — “the origin of the Aperture Problem”. Aggregating that residual in L2 is, in their equation 5, “the Horn and Schunck algorithm (Horn and Schunck 1981)”. They also name what the aggregation quietly assumes: Gaussian, independent, identically distributed errors, a picture that “is rarely true in practice, particularly near occlusion boundaries where pixels at time t may not be visible at time t + 1”.

The visibility row has a measured size as well. Under a sub-heading called “Unmatched Pixels”, the Sintel paper counts them: “With large motions, these are common and we find that nearly 8.5% of the pixels in Sintel are unmatched.” The penalty is not a matter of degree. “Algorithms with EPEs of less than 0.5 pixel on Middlebury have EPE of approximately 10 pixels on MPI-Sintel; a 20-fold increase. In unmatched regions we observe EPEs of more than 40 pixels.” In those regions “errors here are an order of magnitude higher than in matched regions”. And because the motion-boundary statistics deliberately exclude unmatched pixels, the authors advise that “to get a full picture of the difficulty caused by occlusions one should separately consider errors both near motion boundaries and inside unmatched regions”. The release carrying those numbers is 1628 ground-truth flow frames at 1024 × 436, split into 1064 training and 564 withheld test frames.

FigureComparison · 4 columns

Brightness constancy

Corresponding points retain similar appearance.

  • Works under stable illumination
  • Fails with reflections and lighting change
  • Approximate after feature extraction
  • Not valid through occlusion

Local smoothness

Nearby pixels often move similarly.

  • Useful inside surfaces
  • Fails at motion boundaries
  • Can erase thin independent motion
  • Needs edge-aware treatment

Small displacement

Local search can find nearby matches.

  • Supports simple iterative methods
  • Fails with fast motion
  • Pyramids extend effective range
  • Repetition remains ambiguous

Visibility

A point exists in both frames.

  • Required for true correspondence
  • Broken by occlusion and disocclusion
  • Needs masks or confidence
  • Cannot be solved by smoothness alone

Case

Rendering the same frames three ways shows which assumption breaks

MPI-Sintel was built to take the optical-flow assumptions apart one at a time. The same animated frames were rendered in three passes and released in 2012. The Albedo pass carries “roughly piecewise constant colors with no illumination effects”, so that “it adheres to brightness constancy everywhere except at occlusion regions”. The assumption is a render setting there, not a hope about the world. Clean “adds complexity by introducing illumination of various kinds”, among them “specular reflections, inter-reflections, and mirroring effects”. Final “adds atmospheric effects, depth of field blur, motion blur, color correction” on top of that. Compare a system across the three passes and you learn which assumption a drop in accuracy came from.

The same release ships a mask for the pixels that have no partner at all: “we know which pixels were unmatched in each frame and define an “Unmatched” mask to evaluate flow accuracy in these regions”. Of the 35 clips, they “were split into a training set of 23 clips and a test set of 12 clips”. The pass comparison and the unmatched scoring both run on frames the model never saw.

Example

Scenes that expose correspondence weakness

These cases reveal different limits. They should not be collapsed into one average error, and the spread between them is now measured rather than argued.

RobustSpring, an ICLR 2026 benchmark, does the measuring: “RobustSpring applies 20 different image corruptions, including noise, blur, color changes, quality degradations, and weather distortions, in a time-, stereo-, and depth-consistent manner to the high-resolution Spring dataset, creating a suite of 20,000 corrupted images that reflect challenging conditions.” The 20 corruptions fall into five families — colour, blur, noise, quality and weather — and produce 40,000 frames, 20,000 stereo pairs. Each model is scored by how far its corrupted prediction moves from its own clean one.

The movement is large and it is not uniform. RAFT sits at a 6.79% 1px error on clean Spring. Under corruption it shifts by an average of 20.18 points of 1px outlier rate, and by 42.41 px of endpoint error under rain alone. SEA-RAFT is cleaner at 3.69% and shifts less on average, 17.52 points — but 60.52 points under snow. PWCNet shifts 90.80 points under snow. Accuracy and robustness do not track each other at all: “Transformer models (GMFlow, FlowFormer) perform best overall but struggle with noise”, while “Stacked models (e.g. SEA-RAFT, FlowNet2) uniquely resist noise”. A single leaderboard position tells you nothing about which of the six scenes below will break the system you are choosing.

  • Textureless wall: Many candidate matches have nearly identical appearance — the case Middlebury scores separately as Untext.
  • Rotating propeller: Motion is fast, periodic, and blurred within the exposure; blur is one of the five corruption families RobustSpring scores.
  • Water surface: Reflections and deformation violate stable appearance, the assumption Sintel's Albedo pass switches off and its Clean pass switches back on.
  • Passing car: New background becomes visible as the vehicle moves away — the unmatched regions where Sintel measures EPEs of more than 40 pixels.
  • Flickering screen: Pixel intensity changes without corresponding geometric motion; colour change is a measured corruption family, not a hypothetical.
  • Thin cable: Smoothness priors merge its motion with the background, the exception Horn and Schunck flagged along lines in the image.

Analogy

Following leaves between two photographs of a stream

Two photographs of a stream are taken moments apart, and every visible leaf in the first must be matched to its location in the second. Some leaves move, some disappear under water, and several look nearly identical.

A leaf is a discrete thing to follow, while optical flow also assigns correspondence to texture and surfaces without discrete leaf identities. Matching, ambiguity, and occlusion are what the stream case captures.

Not every pixel in one frame has a valid partner in the next.

Key idea

Low average endpoint error can hide the boundary failures that matter

Most pixels may belong to static backgrounds, allowing a model to score well while failing on moving people, thin structures, or occlusion boundaries.

Report errors by motion magnitude, boundary distance, object class, visibility, and downstream use; visualize vectors and warped frames, not only color-coded flow.

This is not an aspiration. A public benchmark has done it since 2007. Middlebury scores three region masks rather than one, and its own paper says why: “We follow the procedure in Scharstein and Szeliski (2002) and compute the error measure statistics over three types of region masks: everywhere (All), around motion discontinuities (Disc), and in textureless regions (Untext).” Disc is “computed by taking the gradient of the ground-truth flow field, thresholding the magnitude, and then dilating the resulting mask with a 9 × 9 box”. Untext is “computed by taking the gradient of the image, thresholding the magnitude, and dilating with a 3 × 3 box”. Each error measure is then reported over eight statistics. Average and standard deviation. The robustness measures R0.5, R1.0 and R2.0, the percentage of pixels whose endpoint error exceeds X pixels. The accuracy measures A50, A75 and A95, the error at the Xth percentile. That is why the published site runs to 32 metric/statistic pages, each of them ranked “over all 24 columns (eight sequences times three region masks each)” across Army, Mequon, Schefflera, Wooden, Grove, Urban, Yosemite and Teddy. The same paper argues that the endpoint error should be preferred over the long-standing angular error.

The distance between an average and a slice can be enormous inside a single row of a single table. The Spring benchmark, released in 2023, renders 6000 stereo image pairs from 47 sequences of the Blender movie “Spring” at 1920×1080. Its 23812 ground-truth motion frames are computed at 3840×2160, so four ground-truth values exist per pixel; 37 sequences train, 10 test. Its headline quantity is deliberately simple: “For reference disparity, target disparity and optical flow, the 1px outlier rate defines the percentage of pixels that deviate more than 1px from the ground truth.” Broken out by region, RAFT reads 6.79% outliers overall and 6.43% in low-detail regions — and 64.09% in high-detail regions and 39.48% in unmatched regions, at an average endpoint error of 1.476 px. The live leaderboard carries the identical row: 6.790 / 6.426 / 64.087 / 5.999 / 39.481, EPE 1.476. Nor does a stronger model dissolve the gap. The top-ranked entry on 3 September 2026, RoCo-14 CAR-WAFT, posts 3.151% overall against 58.640% in high-detail regions.

The older benchmarks already report more than one number, and they disagree about which number to report. Sintel shows EPE matched and EPE unmatched next to the overall figure, so occluded pixels are never averaged away. KITTI 2015 does not report average endpoint error at all. It reports outliers instead. Menze and Geiger count a pixel as wrong only when the flow “exceeds 3 pixels and 5% of its true value”, a rule applied over 200 annotated test scenes with background and foreground reported apart. The two views can sit far apart on one system. RAFT was scored at 5.10% outliers on KITTI in 2020, and at 2.855 pixels of average endpoint error on Sintel's final pass.

One model, one table, one benchmark: 6.79% and 64.09%. Only the pixels being counted changed.

Steps

Audit an optical-flow system

Treat correspondence quality, visibility, and temporal use as separate questions.

The last step — testing the downstream task rather than the flow field — is the one teams skip as impractical. A public benchmark has built it in since 2007. Beside its two flow-accuracy measures, Middlebury reports two interpolation measures: an interpolation error IE, “the root-mean-square (RMS) difference between the ground-truth image and the estimated interpolated image”, and a gradient-normalized error NE whose scaling constant is set to ε = 1.0 graylevels per pixel squared. The evaluation site still describes itself in exactly those terms, as reporting “two measures of flow accuracy (endpoint and angular error) and two measures of interpolation quality”.

The instructive part is what scoring a downstream task cost. Interpolation quality is a different question from flow accuracy, so it needed different footage: “For IE and NE, which measure interpolation accuracy, we use only four of the above datasets (Mequon, Schefflera, Urban, and Teddy) and replace the other four with the high-speed datasets Backyard, Basketball, Dumptruck, and Evergreen.” Army, Wooden, Grove and Yosemite drop out. High-frame-rate sequences take their place. Expect the same in your own audit: the data that answers step 2 will usually not answer step 5.

FigureProcess · 5 steps
  1. 1. Verify frame timing

    Confirm ordering, timestamps, synchronization, and dropped-frame behavior.

  2. 2. Measure displacement regimes

    Slice static, small, large, rotational, and nonrigid motion.

  3. 3. Evaluate occlusion explicitly

    Use valid masks and separate newly hidden or revealed regions.

  4. 4. Inspect motion boundaries

    Check bleeding across objects and loss of thin motion.

  5. 5. Test downstream tasks

    Measure stabilization, tracking, interpolation, or control outcomes.

Flow confidence should distinguish ambiguity from disagreement

A matching cost may be broad because texture repeats, while an ensemble may disagree because the input is out of distribution; these uncertainty signals do not mean the same thing.

Validate confidence against actual correspondence error and occlusion; downstream systems should be able to ignore or escalate unsupported vectors.

There is a published protocol for that validation. Seven authors set it out in 2018 as a sparsification plot. Remove pixels in order of estimated uncertainty and watch the average endpoint error of what remains fall. Then compare that curve against an “Oracle Sparsification” that removes pixels in order of their true ground-truth error. The gap between the two curves reduces to one number. “To quantify the sparsification error with a single number, we use the Area Under the Sparsification Error curve (AUSE).” On Sintel train clean, their FlowNetH-Pred-Merged reaches AUSE 0.095 at EPE 3.36 and 60 ms, against 0.212 for an empirical dropout estimate and 0.191 for an SGDR ensemble. A confidence estimate that good is worth acting on: “Removing 20 percent of the pixels results in halving the average endpoint error.”

Uncertainty is useful when its failure event and calibration population are defined — and AUSE says how useful, in one number.

Key takeaways