facedetector php
1.0.0
GDを使用して画像の顔の位置を識別します。
$ php composer.phar require " crucifyer/facedetector-php " " dev-main "
$ detector = new Xeno Image FaceDetector (imagefile or gdresource or imagebinary);
$ face = $ detector -> FaceDetect ();
[ ' x ' => int, ' y ' => int, ' w ' => int]
$ faces = $ detector -> FaceDetect ( true );
[
[ ' x ' => int, ' y ' => int, ' w ' => int],
[ ' x ' => int, ' y ' => int, ' w ' => int],
[ ' x ' => int, ' y ' => int, ' w ' => int],
[ ' x ' => int, ' y ' => int, ' w ' => int],
[ ' x ' => int, ' y ' => int, ' w ' => int],
]
FaceDetector:: FaceDetect ([multiplue bool], [resSize int])
$ face = $ detector -> FaceDetect ();
$ size = $ detector -> getImageSize ();
$ direction = Xeno Image FaceDetector:: AlignDirection ( $ size [ ' width ' ], $ size [ ' height ' ], $ face [ ' x ' ], $ face [ ' y ' ], $ face [ ' w ' ]);
$ faces = Xeno Image FaceDetector:: FilterSmallFaces ( $ faces );
$ detector = new Xeno Image FaceDetector (imagefile or gdresource or imagebinary);
$ direction = $ detector -> getDirection ();
$ detector = new Xeno Image FaceDetector (imagefile or gdresource or imagebinary);
[gd resource or boolean] = $ detector -> cropThumbnail (size, [direction], [file], [type]);