Face recognition technology for OPENCV and PHP
OPENCV packages that must be relied upon before installation: (Please install first) PKGCONFIGLIBPNGZLIBLIBJPEGLIBTIFFPYTHON[OPENCV installation] Www.opencv.org.tar XVZF OPENCV-1.0.0.TAR.GZCD opencv-1.0.0./configuremakemake installmake Check (checks if all are installed correctly) [Facedetect]/HTTP Www.xarg.org/download/facedetect-1.0.0.tar.gztar XZVF FACEDETECT-1.0.0.TAR.GZCD facedetect-1.0.0/usr/local/php/ Bin/phpize./configure--with-php-config=/usr/local/php/bin/php-configmakemake Testmake Install[ImageMagick] http:/ /www.imagemagick.org/tar JXVF IMAGEMAGICK-6.5.0-0.TAR.BZ2CD Imagemagick-6.5.0-0./configuremakemake Install[imagick ] Http://pecl.php.net/imagicktar zxvf imagick-2.3.0b1.tgzimagick-2.3.0b1/usr/local/php/bin/phpize./configure-- With-php-config=/usr/local/php/bin/php-configmakemake testmake install[Configuration]ll/usr/local/php/lib/php/extensions/ no-debug-non-zts-20060613/See if there are facedetect.so and Imagick.sovi/usr/local/php/lib/php.ini added under [PHP] module: extension = facedetect.soextension = imagick.so Restart apache[test code] Remove all XML files from the OpenCV source code/data/haarcascades/in the PHP executable directory//---------- --------//monitoring hasA few faces//------------------//Check how many face Var_dump (Face_count (' Party.jpeg ', Haarcascade_frontalface_alt.xml '));// Returns the position parameter of the face shape in the picture, multiple returns the array $arr = Face_detect (' party.jpeg ', Haarcascade_frontalface_alt2.xml ');p rint_r ($arr);//-------- ----------//Face twist//------------------
Setfillalpha (0.0);//$draw->setstrokecolor ($borderColor);//$draw->setstrokewidth (1); if (Is_array ($all)) { foreach ($all as $v) {$im _cl = $im->clone (); $im _cl->cropimage ($v [' W '], $v [' H '], $v [' X '], $v [' Y ']); $im _cl->swirlimage (60); $im->compositeimage ($im _cl, Imagick::composite_over, $v [' X '], $v [' Y ']); $draw->rectangle ($v [' X '], $v [' Y '], $v [' x ']+ $v [' W '], $v [' Y ']+ $v [' H ']); $im->drawimage ($draw); }}header ("Content-type:image/png"); echo $im;} Else{?>
------------------//Face recognition//------------------
<title>Human Face recognition</title>Human Face recognition
PS: Please upload a picture with a human face
$v) {$tmp _name_new = $tmp _name. " _ ". $k; $x = $v [' x ']; $y = $v [' y ']; $w = $v [' W ']; $h = $v [' h ']; $DST _pic ="./". $tmp _name_new. $fix _pic;//Echo $src _pic."
";//Echo $DST _pic."
"; $cmd ="/usr/local/bin/convert-crop ". $w." X ". $h." + ". $x." + ". $y." ". $src _pic." ". $dst _pic;//echo $cmd."
"Echo ' $cmd '; $pic _src[] ="./". $tmp _name $fix _pic; $pic _dst[] ="./". $tmp _name_new. $fix _pic;} foreach ($pic _src as $key = + $value) {echo "+ =
";}}? >
?
?
At present, for testing, and other applications, and then publish the results of the experiment ~ ~
?
?
1 Floor, 2011-03-21
Facedetect How to install under Windows Server Ah, seemingly did not find, do you have?
2/F Purpen 2011-03-26
Long and Dangling wrote
Facedetect How to install under Windows Server Ah, seemingly did not find, do you have?
No, not tested under Windows.