-
-
Notifications
You must be signed in to change notification settings - Fork 257
Add mask expansion slider to enlarge safe area around detected person #670
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
Conversation
Co-authored-by: umireon <[email protected]>
Co-authored-by: umireon <[email protected]>
Co-authored-by: umireon <[email protected]>
|
@royshil Do you think this feature is good? |
|
Yea it seems like a useful tool |
|
Proposed in #637. I'll refine this impl and make this PR ready. |
|
@copilot Yea it seems like a useful tool |
Co-authored-by: umireon <[email protected]>
Done! Moved the Mask Expansion slider out of the threshold group and into the main advanced settings section. Now users only need to enable "Advanced settings" to access it, rather than having to enable both "Advanced settings" and "Enable threshold". (commit 6fa964e) |
|
How about this? 2025-11-11.2.27.51.mov.mp4 |
royshil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a cool little addition
Merge at will
…royshil#670) * Initial plan * Add mask expansion feature to enlarge safe area around detected person Co-authored-by: umireon <[email protected]> * Address code review feedback: add constant for max expansion iterations Co-authored-by: umireon <[email protected]> * Follow codebase pattern: use inline magic numbers with clear comments Co-authored-by: umireon <[email protected]> * Move mask expansion slider to advanced settings (not in threshold group) Co-authored-by: umireon <[email protected]> * Update background-filter.cpp * Update background-filter.cpp --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: umireon <[email protected]> Co-authored-by: Kaito Udagawa <[email protected]>
Adds user-controllable dilation to expand the foreground mask, preventing edge clipping during movement. Addresses the issue where tight background removal causes parts of the subject to be cut off, particularly useful when combining with chroma key on small green screens.
Implementation
Technical Details
Uses OpenCV's morphological dilation as suggested by @umireon. Also adds missing localization string for "TemporalSmoothFactor" found during implementation.
The slider is hidden by default (behind Advanced settings checkbox) to keep the UI simple for most users, while remaining easily accessible for advanced users who need fine control over mask expansion.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.