eduardolundgren / tracking.js

A modern approach for Computer Vision on the web
http://trackingjs.com
Other
9.43k stars 1.44k forks source link

face detection then background removal? #318

Open cesarpachon opened 6 years ago

cesarpachon commented 6 years ago

hi, face detection is nice, but it is a square that approximates the real silhouette. what would be the best approach to detect the silhouette, by example to remove the background?

austince commented 6 years ago

You could do some edge detection around the square? Or apply a generic "face shape" to the center of the square? I'm not sure what the state of the art Computer Vision methods are for this

Jylomaki commented 6 years ago

There is the face alignment approach: deforming a (face)shape to try to match image: https://github.com/eduardolundgren/tracking.js/blob/master/examples/face_alignment_webcam.html (if you want to test locally on browser, get the gui package and put it in a node-package folder) or this: https://github.com/auduno/clmtrackr

Face alignement shapes most of the time goes up to the eyebrow, so you may need another way of getting hairs and the upper head if you need it.

If you want to remove the background and you have a still camera maybe try an approach based on optic flow, but I'm not sure.