本周的文件交换选择

我们最好的用户提交

深受深入学习的脸部检测

布雷特本周的选择是MTCNN Face Detection, 经过贾斯汀粉红色蛋白是来自我们咨询部门的Mathworks同事。

We have provided the functionality to detect faces using MathWorks' tools since 2012. Our face detectors, which live in the电脑视觉工具箱那rely on theViola-Jones algorithm,很容易实现:

img = imread('visionteam.jpg'的); imshow(img) faceDetector = vision.CascadeObjectDetector(); bboxes = step(faceDetector, img); figure imshow(img) title(“使用级联物体检测器的脸部检测”的)为了ii = 1:size(bboxes, 1) drawrectangle('Position',bboxes(ii,:),'Facealpha',0);结尾

The default model for the (tunable) cascade object detector uses classification and regression tree analysis (CART) of“哈尔像”的功能。正如您可以看到的那样,模型经常工作得很好。此外,您可以使用“FrontalFacelBP”模型来使用“本地二进制模式。”这两种模型都适用于上面的图像,检测正直和前方面向的面孔。

There are other detection models you can invoke with the CascadeObjectDetector, including 'UpperBody', 'EyePair' (big and small), 'LeftEye' and 'RightEye' (two options), 'ProfileFace', 'Mouth', and 'Nose'. (In addition, you can readily训练你自己!的)

这让我挑选了今天的选择。

贾斯汀的提交实施“多任务级联卷积网络”(MTCCN)to solve the face detection problem. Having options is good; the built-in models don'talways工作好:

请注意两个实例中的大量误报。

In contrast, the MTCCN model works remarkably well on this image:

[bboxes, scores, landmarks] = mtcnn.detectFaces(img); figure imshow(img) title('mtcnn'的)为了ii = 1:size(bboxes, 1) drawrectangle('Position',bboxes(ii,:),'Facealpha',0);结尾

我欣赏的另一件事是,面部地标是自动提供的,作为MTCNN模型的输出:

抓住onxs = landmarks(:, :, 1); ys = landmarks(:, :, 2);为了II = 1:尺寸(xs,1)为了JJ = 1:大小(xs,2)绘图(xs(ii,jj),ys(ii,jj),'r。'的)结尾结尾

MTCNN模型也似乎相当强劲;it even works on the 'cameraman' image, despite the fact that the face in the image is clearly not forward facing. (Both vision.CascadeObjectDetector face detectors fail on the image, at least with default parameterizations.)

我还应该注意,而内置的工具箱功能可以适应RGB或灰度图像,但MTCNN检测器仅在RGB图像上运行。但这是解决的一个简单问题:

如果尺寸(IMG,3)== 1 IMG = REPMAT(IMG,[1 1 3]);结尾

谢谢,贾斯汀!这是我们的检测工具的一个很好的补充!

一如既往,我欢迎你的thoughts and comments




与MATLAB®R2021A发布

|
  • 打印
  • 发送电子邮件

Comments

要发表评论,请点击here要登录您的MathWorks帐户或创建新的。