DIS dense optical flow
Combine fast patch alignment with spatial propagation and dense refinement.
The object moves right and upward; most of the background remains still.
Estimate patch displacement with inverse search.
Propagate useful proposals to neighbouring patches.
Mint vectors follow the moving object. Grey vectors represent the nearly static background; each vector belongs to an image location.
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
Experiment at pixel level
Estimate dense motion using DIS; inspect dx and dy in pixels.
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
Estimate dense motion on CPU when latency matters.
How it works
- 01Estimate patch displacement with inverse search.
- 02Propagate useful proposals to neighbouring patches.
- 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.
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.
Dual TV-L1 optical flow
Estimate flow with a robust data term and a total-variation smoothness penalty.
MOG2 background subtraction
Learn a mixture of colour distributions at each pixel and flag observations that do not fit the background.