opencv/samples
Dave Merchant 0ee9c27966
Merge pull request #27810 from D00E:known-foreground-mask
2025-10-14T05:53:31.5387050Z C:\GHA-OCV-1\_work\ci-gha-workflow\ci-gha-workflow\opencv\modules\imgcodecs\src\bitstrm.cpp(156,57): warning C4244: 'argument': conversion from 'int64_t' to 'ptrdiff_t', possible loss of data [C:\GHA-OCV-1\_work\ci-gha-workflow\ci-gha-workflow\build\modules\imgcodecs\opencv_imgcodecs.vcxproj]

### Pull Request Readiness Checklist

Optional Known Foreground Mask for Background Subtractors #27810

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [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
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake

### Description
This adds an optional foreground input mask parameter to the MOG2 and KNN background subtractors, in line with issue https://github.com/opencv/opencv/issues/26476

4 tests are added under test_bgfg2.cpp:
2 for each subtractor type (1 with shadow detection and 1 without)
A demo shows the feature with only 3 parameters and with a 4th optional foreground mask for both core subtractor types.

Note: To patch contrib inheritance of the background subtraction class, empty apply method which throws a not implemented error is added to contrib subclasses. This is done to keep the overloaded apply function as pure virtual. Contrib PR to be made and linked shortly.  
Contrib Repo Paired Pull Request: https://github.com/opencv/opencv_contrib/pull/4017
2025-10-14 09:56:06 +03:00
..
android Merge pull request #26698 from warped-rudi:mediandk2 2025-01-03 17:53:00 +03:00
cpp Updated Tutorial PSNR for identical images 2025-10-02 00:03:28 +01:00
data Fix data01.xml file for example_cpp_logistic_regression 2025-01-25 00:53:52 +03:00
directx Merge pull request #27434 from leopardracer:4.x 2025-06-11 16:19:05 +03:00
dnn Update person_reid.py 2025-06-16 12:09:29 +03:00
gdb Merge pull request #21805 from rogday:pretty_fix 2022-04-20 04:55:04 +00:00
gpu Add MORPH_DIAMOND support to samples and tutorials 2025-06-27 21:09:53 +05:30
hal Fix configuring with CMake version 4 2025-04-02 13:45:08 -07:00
install fix 4.x links 2021-12-22 13:24:30 +00:00
java New normalization in histogram comparison tutorial to use KV divergence 2025-07-07 08:43:16 +02:00
opencl samples: fix OpenCL events leaks 2020-05-14 17:15:09 +00:00
opengl Merge pull request #26815 from shyama7004:fix-deprecation 2025-01-22 13:53:59 +03:00
openvx Fix configuring with CMake version 4 2025-04-02 13:45:08 -07:00
python Merge pull request #27810 from D00E:known-foreground-mask 2025-10-14 09:56:06 +03:00
semihosting fix 4.x links 2021-12-22 13:24:30 +00:00
swift/ios Update tests and samples to work with changes to dynamic build 2020-09-27 21:12:28 +09:00
sycl Update CMakeLists.txt 2025-06-12 17:03:07 +02:00
tapi Merge pull request #27453 from MELSunny:4.x 2025-07-18 11:19:58 +03:00
va_intel samples(va): fix build warnings, use cv::format() 2021-02-19 10:36:26 +00:00
winrt Merge pull request #27434 from leopardracer:4.x 2025-06-11 16:19:05 +03:00
winrt_universal samples: avoid using of legacy C-like API (part 2) 2018-03-29 14:17:23 +03:00
wp8 Merge pull request #20223 from jogo-:3.4_wp8_samples_typos 2021-06-07 17:32:14 +00:00
_winpack_build_sample.cmd Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-05-18 17:50:16 +00:00
_winpack_run_python_sample.cmd samples: add Python 3.12 2023-12-20 21:32:46 +03:00
CMakeLists.example.in Fix configuring with CMake version 4 2025-04-02 13:45:08 -07:00
CMakeLists.txt Fix configuring with CMake version 4 2025-04-02 13:45:08 -07:00
samples_utils.cmake imgproc: add IntelligentScissors 2020-12-25 10:57:11 +00:00