Face Detection
The following livescript uses MATLAB functionalities to simulate the face detection application. Face detection algorithm is implemented using Local Binary Patterns and Cascading Classifiers.
Read the input image.
inImgPath = 'data/face_detection.png';
inImgUMat = nxpvt.imread(inImgPath);
fprintf('Failed to open input image: %s.', inImgPath);
Define a face detector object.
fdetector = nxpvt.FaceDetector(width, height);
Apply the face detection algorithm on the grayscale image.
[bbox, l] = fdetector.GetFaces(inImgUMat);
Add the result on the original image.
outImgUMat = nxpvt.cv.rectangle(inImgUMat, bbox, [255, 0 ,0], 5);
nxpvt.imshow(outImgUMat);