Skip to content

Dual TV-L1 optical flow

Estimate flow with a robust data term and a total-variation smoothness penalty.

Try it on your image ↓

VISUAL WALKTHROUGHMotion
REFERENCE INPUTTwo consecutive frames

The object moves right and upward; most of the background remains still.

RESULTDense displacement field

Mint vectors follow the moving object. Grey vectors represent the nearly static background; each vector belongs to an image location.

STEP 03 / 03

Repeat warping and coarse-to-fine refinement.

Illustrative example. The stages explain the method; they are not a live OpenCV execution.

Try it on an image

YOUR IMAGE · REAL OPENCV

Experiment at pixel level

Open full lab ↗

Estimate dense motion with TV-L1 regularization. This is an iterative CPU experiment.

The engine loads on your first run. Your images stay in this browser.

Input448 × 320
OutputWaiting for a result

Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.

Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Hover to inspect. Click to pin a pixel.
Input
Select a pixel

Output
Select a pixel

Sample models and licenses

When to use it

Preserve motion boundaries while reducing sensitivity to some brightness outliers.

How it works

  1. 01Warp the second image using the current flow.
  2. 02Optimize the robust brightness residual and spatial regularization.
  3. 03Repeat warping and coarse-to-fine refinement.

energy = robust brightness residual + total variation of flow

What to tune

lambda balances data and smoothness; scales and warps control large-motion refinement; stopping settings control work.

Where it breaks down

Regularization can remove small or thin motion. More iterations increase cost and do not resolve genuinely invisible regions.

TypeScript API

Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.

All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.