Ask Your Question

Chymera's profile - activity

2014-05-08 19:03:31 -0600 received badge  Supporter (source)
2014-05-08 19:03:14 -0600 received badge  Critic (source)
2013-03-25 16:32:32 -0600 commented question Static Face and Eye detection in Python

True--- but I've checked m eye detection again, and what you suggest would probably only improve m speed (which I have no issues with). I'm not getting any off-face eye detection - it's just that I either get the same eye multiply detected or left/right eye cross-detection. Any idea what I can do about that? how come haar cascades don't have rule for merging overlapping feature detects?

2013-03-25 14:19:03 -0600 commented question Static Face and Eye detection in Python

can I set a ROI for the face area while still getting coordinates relative to the entire picture?

2013-03-24 19:35:46 -0600 received badge  Editor (source)
2013-03-24 19:35:03 -0600 asked a question Static Face and Eye detection in Python

Hello guys, I know this is a rather popular question to ask - but none of the cases I found particularly addressed my issue. I am using opencv via the python bindings and I am using this script to autorotate and mask face pictures https://github.com/TheChymera/Epproc/blob/dc4a47c0258e83c911cadd4791abcdda3b2ec9a7/pproc.py

I am using haar cascades for face and eye detection.

I use the cascades like this:

def Load(picture):
    pic = cv2.imread(picture)
    faceCasc = cv2.CascadeClassifier('/usr/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml')
    leyeCasc = cv2.CascadeClassifier('/usr/share/OpenCV/haarcascades/haarcascade_lefteye_2splits.xml')
    reyeCasc = cv2.CascadeClassifier('/usr/share/OpenCV/haarcascades/haarcascade_righteye_2splits.xml')
    eyesCasc = cv2.CascadeClassifier('/usr/share/OpenCV/haarcascades/haarcascade_mcs_eyepair_small.xml')
    return(pic, faceCasc, leyeCasc, reyeCasc, eyesCasc)

and call them like this:

leye = leyeCasc.detectMultiScale(smallimg, haar_scale_eye, min_neighbors_eye, haar_flags_eye, min_size_eye, max_size_eye)

Sadly I have to play with the parameters a LOT to get the cascades to work at all - and even when they do ~2/3 of my pics get false negatives/positives. My pictures are very sharp and very high resolution (~3k x 5k - the faces are ~1/9 of that).

I recently came across this article http://docs.opencv.org/modules/contrib/doc/facerec/facerec_tutorial.html

Which seems really great, but sadly I could not figure out how/whether these methods can be used to give me a simple square (maybe even circle/ellipse?) delineating the features I am looking for. Also, is there anything similar for eye detection? Or will I have to continue relying on haar cascades for that?

Cheers,