How to improve grayscale image quality for eye detection?

asked 2014-06-23 04:50:36 -0500

updated 2014-06-23 05:02:39 -0500

berak gravatar image

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.

edit retag flag offensive close merge delete

Comments

Not answering your question, but you can use stronger methods for eye detection, for example flandmark detector.

GilLevi gravatar imageGilLevi ( 2014-06-23 13:13:13 -0500 )edit

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.

Jagatheesan Jack gravatar imageJagatheesan Jack ( 2014-06-24 06:47:16 -0500 )edit

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.

berak gravatar imageberak ( 2014-06-24 06:52:24 -0500 )edit