Face detection in PHP Face detection in PHP php php

Face detection in PHP


It would probably be easier/safer to do this with OpenCV, which is written in lower-level code. PHP is interpreted, so it's likely going to be hella slow when doing the job.

Hope this helps!


You need to turn off error reporting

<?phpini_set( 'display_errors', 1 );error_reporting( E_ALL ^ E_NOTICE );require_once('face_detector.php');$detector = new Face_Detector('detection.dat');$detector->face_detect('img/8.jpg');$detector->toJpeg();?>


Try removing the +1 from these lines:

 $ii_w = $image_width+1; $ii_h = $image_height+1;

This code is trying to check the colors from positions 1 to 320 instead of 0 to 319 in the 320 pixel image.