简体   繁体   English

iOS OpenCV haarcascade用于其他面部情绪

[英]iOS OpenCV haarcascade for other facial emotions

I have been trying OpenCV iOS sample to achieve facial emotion recognition. 我一直在尝试使用OpenCV iOS样本来实现面部情感识别。 I got OpenCV sample iOS project 'openCViOSFaceTrackingTutorial' from below link. 我从下面的链接获得了OpenCV示例iOS项目'openCViOSFaceTrackingTutorial'。 https://github.com/egeorgiou/openCViOSFaceTrackingTutorial/tree/master/openCViOSFaceTrackingTutorial https://github.com/egeorgiou/openCViOSFaceTrackingTutorial/tree/master/openCViOSFaceTrackingTutorial

This sample project uses 'face detection', it works fine. 此示例项目使用“面部检测”,它工作正常。 It uses 'haarcascade_frontalface_alt2.xml' trained model. 它使用'haarcascade_frontalface_alt2.xml'训练模型。

I want to use the same project but have haarcascade for other facial emotions like Sad, Surprise. 我想使用相同的项目,但有其他面部情绪的haarcascade,如悲伤,惊喜。 I have been searching for how to train haarcascade for emotions like Sad, Surprise etc. but couldn't find any clue. 我一直在寻找如何训练haarcascade的悲伤,惊喜等情绪,但找不到任何线索。

Could someone advise me, how to train haarcascade for emotions like Sad, Surprise etc. to use in this sample OpenCV iOS project? 有人可以告诉我,如何训练像悲伤,惊喜等情绪的haarcascade在这个示例OpenCV iOS项目中使用? Or will there be readymade haarcascade for emotions like Sad, Surprise etc. to use for this iOS sample. 或者是否会有像Sad,Surprise等情绪的现成haarcascade用于此iOS样本。

Thanks 谢谢

you can read tutorial on how to generate haarcascade file, but generating haarcascade for emotions is not easy task. 你可以阅读关于如何生成haarcascade文件的教程 ,但是为情绪生成haarcascade并不是一件容易的事。

I would suggest to extract Mouth and eye from face and using haarcascade and process these rectangles for detecting emotions. 我建议从脸上提取嘴和眼睛并使用haarcascade并处理这些矩形来检测情绪。 you can get gaarcascade for mouth and eye from here . 你可以从这里获得口和眼睛的gaarcascade。 Mouth and Eye are complicated feature so will not work if you will try to find it in whole image, so first find the front face and try to detect mouth and eye within face rectangle only. 嘴和眼是复杂的功能,如果你试图在整个图像中找到它,将无法工作,所以首先找到正面,并尝试仅检测面部矩形内的嘴和眼。

There are open source library available on github for emotion detaction, though these are not for ios, you can use similar algorithm to implement in ios. github上有开源库用于情感分离,虽然这些不适用于ios,你可以使用类似的算法在ios中实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM