Files
opencv-MIRROR/modules/video
47022578z-collab d21a05f1af Merge pull request #30086 from 47022578z-collab:fix-farneback-initial-flow
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.
2026-09-29 19:44:42 +03:00
..