GithubHelp home page GithubHelp logo

php-facedetector's Introduction

Face Detection in 100% pure PHP

This is a port of JViolaJones (http://code.google.com/p/jviolajones/) to PHP. The author did a great job writing understandable code. Both thumbs up!

Viola Jones is an object detection method named after Paul Viola and Michael Jones. See their paper: http://research.microsoft.com/en-us/um/people/viola/Pubs/Detect/violaJones_CVPR2001.pdf

Viola Jones is also the object detector from OpenCV (http://sourceforge.net/projects/opencvlibrary/). Technically a classifier (namely a cascade of boosted classifiers working with haar-like features) is trained with a few hundreds of sample views of a particular object (i.e., a face or a car), called positive examples, that are scaled to the same size (say, 20x20), and negative examples - arbitrary images of the same size.  

PHP FaceDetector as well as JViolaJones can handle the classifiers shipped with OpenCV or trained with OpenCV. One classifier (haarcascade_frontalface_default.xml) is shipped with this software, so you don't need to download or install OpenCV, although it is a great tool too.

Basic usage (for details see doc):
<?php
include("FaceDetector.php");
$detector = new FaceDetector();
$detector->scan("test.jpg");
$faces = $detector->getFaces();
foreach($faces as $face)
{
	echo "Face found at x: {$face['x']}, y: {$face['y']}, width: {$face['width']}, height: {$face['height']}<br />\n"; 
}
?>

Felix Koch
[email protected]

php-facedetector's People

Contributors

felixkoch avatar

Watchers

Virat Patel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.