iPhone 上的人脸识别 [英] Face Recognition on the iPhone

查看:34
本文介绍了iPhone 上的人脸识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 iPhone 上进行面部识别.有人可以向我提供参考资料/文章来为我指明正确的方向吗?我做了研究并意识到我需要先进行面部检测以提取图像,然后通过将其与数据库中的其他图像进行比较来进行面部识别.

我意识到我已经通过使用 OpenCV 或使用 iOS 5.0 及更高版本来检测人脸来进行人脸检测.我不确定面部识别(我计划将图像存储在远程数据库中,然后与远程数据库进行比较).

解决方案

人脸检测

我会使用开放简历中提供的 Haarcascades 来执行快速准确的人脸检测.

http://opencv.willowgarage.com/wiki/FaceDetection

人脸识别

我会使用诸如主成分分析 (PCA) 又名特征脸之类的方法.

http://www.cognotics.com/opencv/servo_2007_series/part_5/index.html

该链接显示了有关如何使用 OpenCV 进行操作的教程 - 我认为这是为 C 编写的,但我相信您可以了解它的基本原理.

如果你觉得勇敢,你也可以考虑自己实现它(还不错)...

http://www.face-rec.org/algorithms/PCA/jcn.pdf

http://blog.zabarauskas.com/eigenfaces-tutorial/

数据库

我实际上做了一些与您类似的事情,尽管是在 PC 上而不是 iPhone 上,但它仍然是相同的概念.我将所有图像作为 Blob 数据类型存储在数据库中,然后在必要时将它们加载到我的程序中.

编辑

数据库是系统中特别棘手的部分,因为这是最大的瓶颈所在.在我的应用程序中,我将执行以下步骤...

  1. 打开应用程序并从数据库中获取训练图像
  2. 根据这些图像生成训练集
  3. 完成 1 和 2 后,系统会非常快,因为它只对训练集进行识别.

对我来说幸运的是,我的数据库服务器位于 LAN 上,因此速度不是问题,但是我可以理解为什么您会遇到问题,因为在移动设备上您的数据连接有限(速度/带宽).您可以压缩图像,但是这可能会导致识别率下降,因为图像质量下降,而且您必须在设备上解码.还有一个问题是如何将远程数据库暴露给应用程序,但我相信使用 PHP 和 JSON(以及其他技术,见下文)是可能的.

从远程数据库中检索数据

也许您可以与数据库进行初始同步,以便将图像缓存在手机上?无论如何,我认为您可能会以某种方式在某个时候将图像保存在手机上.

找出将识别数据/图像存储在数据库中的最佳方式是我面临的最大挑战之一,因此我很想知道您是否找到了一种好的方法.

How can I do facial recognition on the iPhone. Could someone provide me with references/articles to point me in the right direction please? I have done research and realised that I need to do face detection first to extract the image and then do facial recognition by comparing it with other images within a database.

I have realised that I have do the face detection by using OpenCV or by utilising iOS 5.0 and upwards to detect the face. I am unsure on the facial recognition (I plan on storing images on a remote database and then doing the comparison against the remote database).

解决方案

Face detection

I would use the Haarcascades available in open CV to perform quick and accurate face detection.

http://opencv.willowgarage.com/wiki/FaceDetection

Face recognition

I would use a method such as Principal Component Analysis (PCA) a.k.a eigenfaces.

http://www.cognotics.com/opencv/servo_2007_series/part_5/index.html

That link shows a tutorial on how to get that working with OpenCV - I think this is written for C but i'm sure you can get the basic jist of it.

You could also look at implementing it yourself if you feel brave (it's not too bad)...

http://www.face-rec.org/algorithms/PCA/jcn.pdf

http://blog.zabarauskas.com/eigenfaces-tutorial/

Database

I actually did something similar to you albeit on a PC not an iPhone but its still the same concept. I stored all my images in the database as Blob data types then loaded them into my program when necessary.

Edit

The database is a particularly tricky part of the system as this is where the biggest bottleneck is. In my application, I would go through the following steps...

  1. Open application and grab training images from database
  2. Generate training set based on these images
  3. Once 1 and 2 have been completed the system is very quick as it just performs recognition against the training set.

Fortunately for me, my database server was located on a LAN therefore speed wasn't a problem, however I can see why you have an issue due to the fact that on a mobile device you have a limited data connection (speed/bandwidth). You can compress the images however this may lead to a worse recognition rate, due to image quality reduction and also you will have to decode on the device. There is also the issue of how to expose the remote database to the application, however I do believe this is possible using PHP and JSON (and other technologies, see below).

Retrieving data from a remote database

Maybe you could do an initial synchronize with the database so that the images are cached on the phone? One way or another I think you are probably going to have to have the images on the phone at some point regardless.

Figuring out the best way to store the recognition data/images in the database was one of the biggest challenges I faced so I would be interested to hear if you find a good method.

这篇关于iPhone 上的人脸识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆