Skip to content

DIS dense optical flow

Combine fast patch alignment with spatial propagation and dense refinement.

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

Densify and optionally refine the resulting flow.

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 using DIS; inspect dx and dy in pixels.

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

Estimate dense motion on CPU when latency matters.

How it works

  1. 01Estimate patch displacement with inverse search.
  2. 02Propagate useful proposals to neighbouring patches.
  3. 03Densify and optionally refine the resulting flow.

patch search → propagation → dense refinement

What to tune

Choose a preset first, then tune patch size, stride, finest scale and refinement iterations.

Where it breaks down

Presets trade speed against detail and robustness. Small structures and occlusion boundaries can be oversmoothed.

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.