Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

jQuery wrapper on Liuliu Face detection javascript portage

branch: master

This branch is 0 commits ahead and 0 commits behind master

Merge pull request #1 from plamba95/patch-1

fixed <img> tag, add id="myPicture"
latest commit c88e8566bf
Jay Salvat authored
Octocat-spinner-32 css Simplified demo November 07, 2010
Octocat-spinner-32 img Simplified demo November 07, 2010
Octocat-spinner-32 js Updated face.js March 24, 2011
Octocat-spinner-32 README.md Fix README.md November 05, 2010
Octocat-spinner-32 index.html fixed <img> tag, add id="myPicture" November 07, 2011
README.md

Face detection jquery plugin

A jQuery plugin which detects faces in pictures and returns theirs coords. This plugin uses an algorithm by Liu Liu.

Demo here: http://facedetection.jaysalvat.com/

Html & Scripts

Includes

<script src="http://code.jquery.com/jquery-1.4.3.min.js"></script> 
<script src="js/facedetection/ccv.js"></script> 
<script src="js/facedetection/face.js"></script>
<script src="js/jquery.facedetection.js"></script> 

Image

<img id="myPicture" src="img/face.jpg">

Script

<script>
    $(function() {
        var coords = $('#myPicture').faceDetection();
        console.log(coords);    
    });
</script> 

Results

Returns an array with found faces object:

x: Y coord of the face

y: Y coord of the face

width: Width of the face

height: Height of the face

positionX: X position relative to the document

positionY: Y position relative to the document

offsetX: X position relative to the offset parent

offsetY: Y position relative to the offset parent

confidence: Level of confidence

Settings

confidence: Minimum level of confidence

start: Callback function trigged just before the process starts. DOES'NT WORK PROPERLY

start:function(img) {
    // ...
}

complete: Callback function trigged after the detection is completed

complete:function(img, coords) {
    // ...
}

error: Callback function trigged on errors

error:function(img, code, message) {
    // ...
}
Something went wrong with that request. Please try again.