How to improve grayscale image quality for eye detection? [closed]
Hei guys,
Currently I am converting preview frames into grayscale using the codes below:
Imgproc.cvtColor(matYuv, matRgb, Imgproc.COLOR_YUV420sp2RGB, 4);
Imgproc.cvtColor(matRgb, matGray, Imgproc.COLOR_RGB2GRAY, 0);
I am using this preview frames for eye detection using haarcascades_eye.xml cascade classifier. Before passing the region of interest for eye detection, I'm doing some preprocessing as below:
Imgproc.equalizeHist(matGray, matGray);
However, I find that the image produces is distorted as in "white washed" when the lighting is low and as a consequence, the eye detection is bad. Is there any preprocessing that can be done to enhance this images?
Thanks.
Not answering your question, but you can use stronger methods for eye detection, for example flandmark detector.
Thx for the suggestion. Just browsed through the implementation of fladmark. Looks straightfoward. Btw, I am developing an Android application. Integrating with Android will include working with JNI etc. My only concern might be whether it would be too heavy on a smartphone.
Still looking for any optimization that can be done to the image before eye detection.
if you restrict it to the face roi (detected by a cascade before), it won't be slower than applying a cascade for eyes again.