L
L
Leonid Fedotov2014-06-10 20:22:37
JavaScript
Leonid Fedotov, 2014-06-10 20:22:37

How to recognize a person in pure Javascript or Node.JS?

There is an HTML5 application on the go that recognizes a face (or multiple faces) using HAAR Cascades object detection via a webcam. Using the coordinates of the position of the face, you can track the further movement of the user. But here's the problem: I want each moving face to have a signature - who it is. To do this, you can create a kind of database of known users and, when recognizing a face, get its owner from the same database. The difficulty is that I didn’t even find approximate solutions :( Everywhere, only ordinary face position recognition and that’s it.
Google+ has a function “find me in friends’ photos.” Actually, it’s probably implemented somehow the same way.
I’ll be very glad if you tell me some JavaScript or Node.js solutions with OpenCV, but PHP with its OpenCV will work too :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
[
[email protected]><e, 2014-06-10
@iLeonidze

If you know how to select areas of faces in images, then your task is to classify these areas. Classification is a well-known machine learning problem. And OpenCV has a module for machine learning (if you don't know which one to choose, choose Support Vector Machines).
The first step is to train the classifiers. Those. make a training sample (face-correct answer pairs), and adjust the algorithm based on it. You may have to mark faces for this sample manually (in a good way, the training sample should be very large, from several thousand examples to the limits of computing power), or maybe you will find something already ready.
Actually, the pipeline will be reduced to approximately the following:
1. Find the area of ​​the face (your Haar cascade is used here)
2. Based on the area, build some feature representation of the face (for example, a HoG descriptor , I advise you to search the net for what features people use for faces).
3. This representation is fed to the trained classifier (trained on the same representations, of course)
4. The classifier produces the desired answer.

I will be very glad if you tell me some solutions in JavaScript or Node.js with OpenCV. Although, PHP with its OpenCV is also suitable
The OpenCV I know is a C++ library, so it's not clear why Node.JS bindings would be different from php bindings. Although I have not met with either one or the other, I could be wrong.
If we talk about implementation, then I would implement this module entirely in C ++, which I would copy (at least as a Node.JS module) and call it from the node. Actually, look at the OpenCV tutorials on this topic, there should be something there.
Google+ has a "find me in friends photos" feature. Actually, it is probably implemented somehow the same way.
Google and Facebook probably use much cooler algorithms than I described (of course, because the best of the best work there). For example, Facebook 's DeepFace builds 3D face models.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question