Any ideas how to approach this problem?

Hi there.

I would appreciate some ideas from you guys how to tackle the following problem.
I basically get lots of images which contain each one face. The task would be to cut the image, so that only the head is visible and the background transparent. If someone takes a selfie for example, the end result should be only the head (with hair) and a transparent background.
I already researched a bit, but couldn’t really find something suited for this. Face detection for example only creates bounding boxes around the face, but I would need the exact shape of the head I guess.
Right now I have a solution where people cut out the faces manually, but this doesn’t scale well.
Any ideas on what approach would be best for this?

OpenCV is your friend here. There are many ways to accomplish this… Depending on how accurate you need it to be, here’s a somewhat complex example…

There are other methods available. A quick google for “OpenCV background removal” should get you started.

Thank you for the info. Will look into “OpenCV”.

Use segmentation.