Skip to content
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

Background blur halo effect #414

Closed
dekatr0n opened this issue Aug 1, 2023 · 10 comments
Closed

Background blur halo effect #414

dekatr0n opened this issue Aug 1, 2023 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@dekatr0n
Copy link

dekatr0n commented Aug 1, 2023

Is your feature request related to a problem? Please describe.

I use the plugin to blur my background, but I've noticed that the blurred background often has a halo effect around the detected mask, where the colors of the subject bleed into the blurred background. This is especially noticeable if you stand against a dark background while wearing light colors.

Describe the solution you'd like

While blurring the background, the filter should only use the pixels outside the detected mask to create the blur effect.

Describe alternatives you've considered

I've noticed that the background blur implementations in Google Meet and Zoom do this correctly, and there is no halo effect.

Additional context

I'm not exactly sure how this can be approached from an implementation POV, but maybe the "Repeat edge pixels" feature of After Effects can be some inspiration?

@dekatr0n dekatr0n added the enhancement New feature or request label Aug 1, 2023
@royshil
Copy link
Collaborator

royshil commented Aug 1, 2023

Thanks for the feedback @dekatr0n
can you post a screenshot here of the halo effect?

@dekatr0n
Copy link
Author

dekatr0n commented Aug 1, 2023

Sure, here's a side-by-side with Google Meet and Zoom. If you look at the edges of my shoulders, you can see that obs-backgroundremoval has the halo effect while Meet and Zoom have sharp edges.

halo-effect

@umireon umireon added question Further information is requested and removed enhancement New feature or request labels Aug 1, 2023
@royshil
Copy link
Collaborator

royshil commented Aug 1, 2023

Alright yeah
Thanks for sharing this!
I know how to solve it. Our blur algorithm needs to take into account the mask, which it doesn't right now. That's not a huge lift, I can take care of it very soon.

@umireon umireon added enhancement New feature or request and removed question Further information is requested labels Aug 1, 2023
@royshil royshil self-assigned this Aug 2, 2023
@royshil
Copy link
Collaborator

royshil commented Aug 2, 2023

montage
I was able to solve it. A PR will be up soon, please help test 🙏

@royshil
Copy link
Collaborator

royshil commented Aug 2, 2023

Fixed by #415

@dekatr0n
Copy link
Author

dekatr0n commented Aug 2, 2023

I'm amazed at your speed and dedication to this project ❤️

I would like to help test it out, but I'm not exactly sure how. I tried downloading and installing the Windows build artifact from here, but I cannot see the fix in action. Do I have to build it myself?

@royshil
Copy link
Collaborator

royshil commented Aug 2, 2023

Yes.. that's supposed to be a build that includes the fix.

However the fix is in the .effect files and not the .dll file (assuming Windows).

Can you see that you copy in the effects as well from the build?

@dekatr0n
Copy link
Author

dekatr0n commented Aug 2, 2023

Thanks, I can confirm that the fix works, but only when focal blur is disabled. When focal blur is enabled, the image still has a noticeable halo. Why is that? Here's is a comparison screenshot for reference:

halo-fix-comparison

@royshil
Copy link
Collaborator

royshil commented Aug 2, 2023

@dekatr0n thanks for the thorough testing, i appreciate your help!

the focal blur is different in nature. it doesn't use a mask per-se, so we can't block the non-masked pixels

while i think it might be possible to get the focal blur to be sharper around the edges, it will add (in my current analysis) some significant computation overhead in the pixel shader

it think we should merge the halo fix for now, and come back to focal blur later

@dekatr0n
Copy link
Author

dekatr0n commented Aug 4, 2023

That makes sense. Thanks for the prompt fix!

@royshil royshil closed this as completed Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants