Face recognition with eyes, mouth, ears .. in Javascript

I was interested in looking for information about face recognition using Canvas and, in particular, on how to detect parts of the face.

Let's say I take a picture from my webcam, and then I want to detect the eyes, mouth, nose and ears in order to separate them into different images.

What will be the process for this?

+4
source share
2 answers

You can use HTML5 getUserMedia as well as headtrackr.js to achieve what you are looking for. In addition, you can discover objects, access user media, and more. Hope this is what you are looking for.

+3
source

The fact that I recently tried to solve the same problem (face and eye detection) was as follows:

  • Reduce the processed image to achieve decent performance (I scaled down to 320 pixels)

  • Face detection in an image using the Core Computer Vision library - https://github.com/liuliu/ccv

  • Based on the detected information about the face rectangle, detect the eyes using HAAR object detectors (it has a cascade for detecting only eyes - https://github.com/inspirit/jsfeat

For step 2, I also used grayscale and equalize_histogram from the JSFEAT library.

Also, if step 3 fails, you can try to guess the position of the eyes (depending on how high precision you will do).

This workflow gave me satisfactory results and performance. He tested it both on the desktop (~ 500 ms on the iMac) and on mobile devices (~ 3000 ms on the iphone 4 using a webcam image). Unfortunately, I cannot post a link to a working example at the moment, but I will post a link to github as soon as I have something there.

+6
source

Source: https://habr.com/ru/post/1492041/


All Articles