-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Description
Good day Vladimir !
Tell me what's wrong with my code.
Example- Recognition_face_by_lbph.php is at the root of the site - it works great.
But if I want to do the same in the my model, I get the error ERR_EMPTY_RESPONSE.
<?php
use CV\Face\LBPHFaceRecognizer, CV\CascadeClassifier, CV\Scalar, CV\Point;
use function CV\{imread, cvtColor, equalizeHist};
use const CV\{COLOR_BGR2GRAY};
class opencv_model extends Model
{
function __construct()
{
}
function recognize_face()
{
$faceClassifier = new CascadeClassifier();
$faceClassifier->load(URL . 'phpocv/models/lbpcascades/lbpcascade_frontalface.xml');
$faceRecognizer = LBPHFaceRecognizer::create();
$filenam = __DIR__.'/faces.jpg';
$labels = ['unknown', 'vadim', 'alice'];
$src = cv\imread($filenam);
$gray = cvtColor($src, COLOR_BGR2GRAY);
// until this - everyfing work fine
$faceClassifier->detectMultiScale($gray, $faces); // if i uncomment this line - all broke down...
var_dump($faces);
}
}
Metadata
Metadata
Assignees
Labels
No labels