allo- / virtual_webcam_background

Use a virtual webcam background and overlays with body-pix and v4l2loopback
GNU General Public License v3.0
306 stars 47 forks source link

Implement a filter to translate the image to the detected head or eyes #77

Open schuellerf opened 3 years ago

schuellerf commented 3 years ago

I just wanted to play around with a mainly transparent image just containing some text which floats next to my head. It seems to work and does what I intended to

allo- commented 3 years ago

Can you change the class Name (not the filter name) to CamelCase to match the other filters?

I tested it by moving the background image. Maybe you like to have a look as well either for this filter or maybe as another one. I think by reversing the tracking direction (or not fixing a point?) one could create an interesting parallax effect that looks like the camera is moving around when the background image is moved. But that's just an idea, maybe I look into playing with this when you're not interested yourself.

allo- commented 3 years ago

And maybe you should rebase it onto my branch to check for any conflicts. But I think there were no breaking changes (except that it will break when using mediapipe, but the other filters using part masks are currently broken with mediapipe as well).

schuellerf commented 3 years ago

Which branch? Due to https://github.com/mrxz/virtual_webcam_background/pull/1 I'm actually based on this "gui" branch but I wanted to keep this separated for your convenience

schuellerf commented 3 years ago

Can you change the class Name (not the filter name) to CamelCase to match the other filters?

I tested it by moving the background image. Maybe you like to have a look as well either for this filter or maybe as another one. I think by reversing the tracking direction (or not fixing a point?) one could create an interesting parallax effect that looks like the camera is moving around when the background image is moved. But that's just an idea, maybe I look into playing with this when you're not interested yourself.

For a parallax effect, I would also include to enrich the image scaling to be able to scale larger than the webcam dimensions (for now there is only scaling with the resulting image being the webcam resolution again, I think)

allo- commented 3 years ago

Which branch?

Rebase and change the class name on the branch you want to merge (currently schuellerf:master).

For a parallax effect, I would also include to enrich the image scaling to be able to scale larger than the webcam dimensions (for now there is only scaling with the resulting image being the webcam resolution again, I think)

Indeed, the Image moved around over a black background, but having an image larger than the output frame is not that complicated. I am not sure how to fit it in the current pipeline which passes webcam size frames around, but for the effect alone maybe the filter could load the image itself and then re-use the head tracking filter.

I'd need to read what other movements belong to a real parallax effect. It just looked already similar when I tested moving around the background image.