如何使用Open CV检测哈欠 [英] How can I detect yawn using Open CV

查看:154
本文介绍了如何使用Open CV检测哈欠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个iOS应用程序,需要检测用户何时打哈欠。



我所做的是包括Open CV并使用haar级联查找面孔,以及然后在面孔内找到嘴巴(也是使用haarcascade)。



我遇到的麻烦是我相信能够很容易地发现哈欠像做某事一样喜欢(face.y - mouth.y)<某事=哈欠。



但我遇到的问题是面部和嘴部的面积是不稳定的,我的意思是每次循环运行X和Y的值为面部和嘴巴(很明显)不一样。



我可以使用任何张嘴哈尔级联,或者我怎么知道用户何时打开嘴巴?

解决方案

作为一般情况,支持向量机(SVM)用于表情识别,如愤怒,微笑,惊喜等还在积极发展的地方。谷歌搜索给你提供了很多关于这个主题的论文,(甚至我的一个同学也把这作为他的最后一年项目)。为此,首先您需要训练SVM并且要做到这一点,您需要打哈欠和正常面部的样本图像。



打呵欠几乎与惊喜相似,两个案件都张开嘴。我建议您查看以下论文的第3页:



最后,我相信你可以在google上找到很多细节,因为它是一个活跃的开发区域,很多论文都在那里。



另一种选择



我听过几次这个地区的另一个选择是 Active Appearance Model 。但我对此一无所知。谷歌吧。


I am developing an application for iOS that needs to detect when the user yawns.

What I did is include Open CV and find faces using a haar cascade, and then find mouth inside the faces (too using a haarcascade).

The trouble that I have is that I believed that it would be so easy to detect a yawn like doing something like (face.y - mouth.y) < something = yawn.

But the problem that I have is that the rects for face and mouth are "inestables", I mean every time that the loop runs X and Y values for the rects of face and mouth are (obviusly) not the same.

Is there any "open mouth" haar cascade that I can use, or how can I know when the user opens the mouth?

解决方案

As a general, Support Vector Machine (SVM) is used for facial expression recognition like anger,smile, surprise etc where still active development takes place. Googling give you a lot of papers on this topic, (even one of my class mate did this as his final year project). For that, at first you need to train the SVM and to do that, you need sample images of yawning and normal faces.

Yawning is almost similar to surprise, where mouth open on both cases. I recommend you to check out page 3 of below paper : Real Time Facial Expression Recognition in Video using Support Vector Machines (If you can't access the link, google by paper name)

The paper (even my classmate) used displacement vector of facial features. For this, you find some feature points on the face. For example, in the paper, they have used eye pupil,extreme points of lids, nose tip, extreme points of mouth region (lips) etc. Then they continuously track the location of the features and find euclidean distance between them. They are used to train the SVM.

Check out below two papers :

Feature Points Extraction from Faces

Fully Automatic Facial Feature Point Detection Using Gabor Feature Based Boosted Classifiers

Look image below what i mean by feature points on face:

In your case, i think you are implementing it in iPhone in real time. So may be you can avoid feature points at eyes (although not an good idea, since when you yawn, eyes become small in size). But compared to it, feature points at lips shows more variations and predominant. So, implementing on lip alone may save time. (Well, it all depends on you).

Lip Segmentation : It is already discussed in SOF and check out this question : OpenCV Lip Segmentation

And finally, i am sure you can find a lot of details on googling, because it is an active development area, and a lot of papers are out there.

Another Option :

Another option in this region, which i have heard several times, is Active Appearance Model. But I don't know anything about it. Google it yourself.

这篇关于如何使用Open CV检测哈欠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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