How to Detect Faces with NXP Vision Toolbox

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to Detect Faces with NXP Vision Toolbox

3,882 次查看
dumitru-daniel_
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
标签 (1)
0 回复数