Home>

The javascript package for face recognition is face detection, which was developed by jay salvat and liu liu. It is a standard jquery plugin. By analyzing the provided images,Returns the coordinates of all found face images,Interested friends follow us to learn js face recognition technology and face recognition javascript class tracking.js

I have always been interested in artificial intelligence recognition technology,Because I can't imagine what kind of algorithm this is,What kind of analysis process.Whether it is voice recognition, face recognition, or other types of recognition,People look and speak differently.You can take a picture in different ways and from different angles.I can't understand how these recognition technologies do it.A game called "Mask" also uses this recognition technology,I think we should also study facial recognition technology.facebook uses this technology,It can also be used in gesture control,Therefore, there will be applications on your website.

One javascript package I found that can be used for face recognition is face detection, which was developed by jay salvat and liu liu. It is a standard jquery plugin. By analyzing the provided images,Returns the coordinates of all found face images.Let's see how it works!

jquery.facedetection

To use the face detection jquery plugin, you need to introduce four js files:

<script src="jquery-1.4.3.min.js"></script>
<!-Mas js->
<script src="facedetection/ccv.js"></script>
<script src="facedetection/face.js"<&/script>
<script src="jquery.facedetection.js"></script>

The first two files of this face recognition plug-in are its various functional programs.You can get an array object through them,These objects store the face coordinate information in the picture.Below is an example:

var coords=jquery ("#​​myimage"). facedetection ();
/* Returns:
 {
 x:525
 y:435, width:144, height:144, positionx:532.6353328125226, positiony:443.240976080536, offsetx:532.6353328125226, offsety:443.240976080536, confidence:12.93120119, neighbour:undefined, }
* /

You can also add event callback functions to the detection method:

var coords=jquery ("#​​myimage"). facedetection ({ complete:function (image, coords) { //do something }, error:function () { console.warn ("Cannot analyze picture"); }});

For the identified face information,You can do any processing stuff.You can draw a border on the face in the picture:

jquery ("img"). each (function () { var img=this; //Get face coordinates var coordinates=jquery (img) .facedetection (); //draw a frame on the face if (coordinates.length) { coordinates.foreach (function (coord) { jquery ("<div>", { css:{ position:"absolute", left:coord.positionx + 5 + "px", top:coord.positiony + 5 + "px", width:coord.width + "px", height:coord.height + "px", border:"3px solid white" } }). appendto (img.parentnode); }); }});

this is very simple,Of course you can do complex processing,For example, extract it.

I used various pictures for face recognition attempts,As I expected,The result was not perfect.But no matter what,Still pretty good.This is a very simple scripting technique,And no technology is perfect.This face recognition plugin does not have a face comparison function.You need to use other methods and provide facial features information to achieve this function.Anyway, pretty good,I highly recommend you give it a try.

Face recognition javascript library tracking.js

For web developers,The open source javascript library tracking.js is making computer vision and augmented reality technology simple, Use it to show somatosensory applications with effects similar to kinect or wii,And the javascript library is small (~ 7k) and very lightweight.And the interface is simple.

tracking.js works in mobile web applications, desktop applications,You can even pair with a node.js-based server. It will bring computer graphics algorithms and technologies to the browser,It has functions:face recognition (when a certain color or when a person/face/body moves), real-time color tracking.For web development,Previously, C or C++ technology was required to achieve similar results.Now, tracking.js provides a web component, so web front-end developers can access html tag components to achieve similar functions.Without having to know javascript, this greatly simplifies web development.

tracking.js includes a color tracking algorithm and object tracking component,It enables web browsers to recognize changes in the face and eyes.For example, the web front-end can also set user avatars using this function,For some websites,This is also a great feature;Match the tracked face data with the background database at the same time,Thus and feedback to the user more useful data.

Currently, the tracking.js source code project has been forked more than 200 times on github. In early August,The js library has been upgraded to version 1.0.

The above content is the javascript face recognition technology and facial recognition javascript class tracking.js for everyone to share.

  • Previous Summary of pointer to data types and operations in C ++
  • Next How to fix the situation where all the pictures are opened by the graphics tablet after the September 10 update in Windows 10 En