mirror of
https://github.com/opencv/opencv.git
synced 2026-11-26 03:18:11 -06:00
video: add validation for OPTFLOW_USE_INITIAL_FLOW in calcOpticalFlowFarneback - #30086 Add explicit parameter check for initial flow in `calcOpticalFlowFarneback`. When `OPTFLOW_USE_INITIAL_FLOW` flag is passed but the `flow` matrix is empty/missing, this provides a descriptive runtime error instead of non-deterministic behavior or garbage values. Fixes #7276. ### Pull Request Readiness Checklist - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV. - [x] The PR is proposed to the proper branch (`4.x`). - [x] There is a reference to the original bug report (#7276). - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable. - [x] The feature is well documented and sample code can be built with the project CMake.