Stella
Stella

Reputation: 1868

iOS OpenCV haarcascade for other facial emotions

I have been trying OpenCV iOS sample to achieve facial emotion recognition. I got OpenCV sample iOS project 'openCViOSFaceTrackingTutorial' from below link. 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.

I want to use the same project but have haarcascade for other facial emotions like Sad, Surprise. I have been searching for how to train haarcascade for emotions like Sad, Surprise etc. but couldn't find any clue.

Could someone advise me, how to train haarcascade for emotions like Sad, Surprise etc. to use in this sample OpenCV iOS project? Or will there be readymade haarcascade for emotions like Sad, Surprise etc. to use for this iOS sample.

Thanks

Upvotes: 11

Views: 1438

Answers (1)

PlusInfosys
PlusInfosys

Reputation: 3436

you can read tutorial on how to generate haarcascade file, but generating haarcascade for emotions is not easy task.

I would suggest to extract Mouth and eye from face and using haarcascade and process these rectangles for detecting emotions. you can get gaarcascade for mouth and eye from here . 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.

Upvotes: 4

Related Questions