-
Notifications
You must be signed in to change notification settings - Fork 5.9k
In support of Optional Known Foreground Mask for Background Subtractors #4017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 tasks
28b9ac4 to
9b0a011
Compare
9b0a011 to
0813a2f
Compare
0813a2f to
7deee2b
Compare
asmorkalov
approved these changes
Oct 6, 2025
|
@D00E Thanks a lot for the refresh. Looks like similar patch should be applied to cudabgsegm and cudalegacy modules too. See CI failures. |
|
Thanks for the heads up, @asmorkalov , this has now been sorted :) should be ready to go |
|
There are CUDA build errors still: |
|
@D00E Friendly reminder. You almost reached the goal. |
9933e45 to
4ff3501
Compare
is missing. |
4ff3501 to
d7870d9
Compare
asmorkalov
approved these changes
Oct 14, 2025
asmorkalov
pushed a commit
to opencv/opencv
that referenced
this pull request
Oct 14, 2025
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 #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: opencv/opencv_contrib#4017
|
@asmorkalov thanks for the help and support :) |
abdulrahman305 bot
pushed a commit
to abdulrahman305/opencv
that referenced
this pull request
Oct 15, 2025
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 opencv#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 opencv#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: opencv/opencv_contrib#4017
abdulrahman305 bot
pushed a commit
to abdulrahman305/opencv
that referenced
this pull request
Oct 17, 2025
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 opencv#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 opencv#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: opencv/opencv_contrib#4017
abdulrahman305 bot
pushed a commit
to abdulrahman305/opencv
that referenced
this pull request
Oct 19, 2025
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 opencv#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 opencv#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: opencv/opencv_contrib#4017
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
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
There is accuracy test, performance test and test data in opencv_extra repository, if applicable
x Patch to opencv_extra has the same branch name.
The feature is well documented and sample code can be built with the project CMake
Description
Is in support to a pull request regarding, issue opencv/opencv#26476.
Core paired pull request: opencv/opencv#27810
This adds function templates inline with the pure virtual overloaded apply function present for background subtraction. Supporting the build of the pull request: