How to Detect Faces with NXP Vision Toolbox

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Detect Faces with NXP Vision Toolbox

628 Views
NXP Employee
NXP Employee

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);
if isempty(inImgUMat)
    fprintf('Failed to open input image: %s.', inImgPath);
    return;
end
nxpvt.imshow(inImgUMat);
pastedImage_1.png
Define a face detector object.
width = uint32(640);
height = uint32(480);
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);
pastedImage_2.png
Labels (1)
0 Replies