Are there any additional preprocessing steps to take for gender recognition in a live camera preview?
When I trained my FisherFaceRecognizer
in my PC using the GENDER-FERET database, I used dlib to align and frontalize the face, grayscaled it, and did a histogram equalization on it before putting it into the list of data to train said FisherFaceRecognizer
. When I tested it with the GENDER-FERET test set with the usual way, most of the predicted genders return the correct values, around 95-98%.
But when I use the generated YAML from that into my Android app's FisherFaceRecognizer
on a live camera preview, it all falls apart, with fluctuating prediction results when I aim the camera at someone's face, especially in a computer screen, and sometimes wrong prediction results altogether.
Now I think it's because the data from the camera preview cannot replicate the ideal test conditions that netted me the 95-98% accuracy, especially when I aim said camera at a face behind the computer screen. So I'm thinking of background removal and illumination standardization.
Does OpenCV4Android 2.4.13.3 or 3.3.0 have protocols for those, and what other steps can/should I take to preprocess the images from a live camera preview to nearly replicate the 95-98% accuracy?
Edit: Also, should I choose the haarcascade_frontalface_default.xml
instead of lbpcascade_frontalface.xml
for my CascadeClassifier?
for face recognition? Because while the haar one may be more accurate than the lbp one, it'd tank my framerate.
just to clarify: if you're using histogram equalization and pose normalization for your train images, you'dhave to do the same on your android device later for testing, right ?
Yes, and I'll probably have to use the dlib-android library for that. Though with fewer landmark points and with an emphasis on the eyes, because the lbpcascade/haarcascade might not be good enough.
Though I suppose I can train the
FaceRecognizer
with the same face tilted at different angles to alleviate the pose normalization part...i'm only guessing, but that sounds counter-productive. (esp. the FisherFaces one should profit from pose normalisation, and suffer from tilting variation)
(try both, and report back, i guess ?)