> ## Content Index
> Fetch the complete content index at: https://yinguobing.com/blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# Apple官方二维码与人脸检测示例代码
- URL: https://yinguobing.com/blog/avcam-barcode-sample-code-for-face-detection/
- Published: 2016-10-06T08:51:02.000Z
- Updated: 2022-05-29T07:44:05.000Z
- Description: 在Apple Developer站点发现了一段官方的示例代码，展示了如何做实时的二维码读取与人脸检测。
- Author: 尹国冰
- Tags: iOS

在Apple Developer站点发现了一段官方的示例代码，展示了如何做实时的二维码读取与人脸检测。

![AVCamBarcode Screenshot](https://yinguobing.com/blog/content/images/2016/10/ios-face-detection.jpg)

因为最近一直在研究计算机人脸检测，尝试之后发现Apple提供的人脸检测模块已经非常成熟，主要表现为：

- 检测速度快，在我的iPhone 5C上感觉不到延迟；
- 算法比较稳健，无论手机是竖直还是倾斜，旋转，都能很好的检测到人脸；
- 报点位置稳定。不会像OpenCV示例代码中那样跳来跳去。（当然，在OpenCV中也可以加卡尔曼滤波来处理）。

对于开发者来说，这已经是可用度非常高的模块了。

代码下载地址：  
[https://developer.apple.com/library/prerelease/content/samplecode/AVCamBarcode/Introduction/Intro.html](https://developer.apple.com/library/prerelease/content/samplecode/AVCamBarcode/Introduction/Intro.html?ref=yinguobing.com)