fnsmile is an OpenCV based smile detector which uses, besides a cascade smile model, a face model and a nose model to reduce false alarms as much as possible.
This code is supplied as a demo for this blog article. To summarize the main idea in a couple of words, here are the steps of the algorithm:
- Detect all faces on a picture
- Try to detect a nose on each face. Discard faces with no nose (reduces the face model's false alarms)
- Use the lower part of the face, starting from the center of the nose, to detect a smile
OpenCV's cascade models are usually located in /usr/local/share/OpenCV/haarcascades/. You will most certainly have to append the name of the model to this path.
python fnsmile.py -s haarcascade_smile.xml
python fnsmile.py -s haarcascade_smile.xml -f haarcascade_frontalface_default.xml
python fnsmile.py -s haarcascade_smile.xml -f haarcascade_frontalface_default.xml -n haarcascade_mcs_nose.xml
-v 1
-v filename
Amine Sehili ([email protected])
This program is available under the GNU GENERAL PUBLIC LICENSE Version 3.