Dual TV-L1 optical flow
Estimate flow with a robust data term and a total-variation smoothness penalty.
The object moves right and upward; most of the background remains still.
Warp the second image using the current flow.
Optimize the robust brightness residual and spatial regularization.
Mint vectors follow the moving object. Grey vectors represent the nearly static background; each vector belongs to an image location.
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
Experiment at pixel level
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.
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
Select a pixel
Select a pixel
When to use it
Preserve motion boundaries while reducing sensitivity to some brightness outliers.
How it works
- 01Warp the second image using the current flow.
- 02Optimize the robust brightness residual and spatial regularization.
- 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.
Related methods
Lucas-Kanade optical flow
Follow selected points by finding the small displacement that best aligns each local patch.
Farneback dense optical flow
Estimate a displacement vector at every pixel using local polynomial approximations.
DIS dense optical flow
Combine fast patch alignment with spatial propagation and dense refinement.
MOG2 background subtraction
Learn a mixture of colour distributions at each pixel and flag observations that do not fit the background.