Files
opencv-MIRROR/modules/video/include
RS Nikhil Krishna 75ff081cfb video: reuse the polynomial expansion between Farneback calls
Add OPTFLOW_FARNEBACK_REUSE_EXPANSION, an opt-in flag set through
FarnebackOpticalFlow::setFlags() / create(..., flags). When set, calc() keeps
the polynomial expansion of the previous call's next frame and reuses it as
the expansion of the following call's prev frame, which saves roughly 9-14%
on consecutive-frame sequences. Results are bit-identical with reuse on and
off. The flag adds no virtual methods, is ignored by calcOpticalFlowFarneback()
and by the OpenCL path, and clearing it or calling collectGarbage() frees the
cache.

Tests go into test_OF_accuracy.cpp and test_OF_reproducibility.cpp and seed
their data from theRNG(). Includes a perf test and a tutorial section.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 22:32:58 -05:00
..