Getting the LABEL_EYE_CLOSED attribute

Getting the LABEL_EYE_CLOSED attribute


I wrote a program to detect the attributes, all attributes are being detected correctly except the labels INDEX_EYE_CLOSED_LEFT and INDEX_EYE_CLOSED_RIGHT which always return 0.

Looking at the sample binaries I found that it does not provide this information either. Is it implemented? Or is it a bug?

I'm using UtilMPipeline and the OnNewFrame code is the following:

      public override bool OnNewFrame()
            faceAnalysis = QueryFace();
            faceAnalysis.QueryFace(fidx, out faceId, out timeStamp);

            //Get face attributes (smile, age group, gender, eye blink, etc)
            face_attributes = (PXCMFaceAnalysis.Attribute)faceAnalysis.DynamicCast(PXCMFaceAnalysis.Attribute.CUID);            

            face_attributes.QueryProfile(PXCMFaceAnalysis.Attribute.Label.LABEL_EYE_CLOSED, 0, out attProfileInfo[0]);
            face_attributes.SetProfile(PXCMFaceAnalysis.Attribute.Label.LABEL_EYE_CLOSED, ref attProfileInfo[0]);
            attributeStatus = face_attributes.QueryData(PXCMFaceAnalysis.Attribute.Label.LABEL_EYE_CLOSED, faceId, out blink);

            //face_attributes.QueryProfile(PXCMFaceAnalysis.Attribute.Label.LABEL_EMOTION, 0, out attProfileInfo[0]);
            //face_attributes.SetProfile(PXCMFaceAnalysis.Attribute.Label.LABEL_EMOTION, ref attProfileInfo[0]);
            //attributeStatus = face_attributes.QueryData(PXCMFaceAnalysis.Attribute.Label.LABEL_EMOTION, faceId, out smile);

When I uncomment the commented code I correctly get the smile indicator from 0 to 100.


7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Please see sample in The face attribute also needs initialization, and the initialization cannot be right before QueryData, as nothing is processed right after initialization.


Hi, Xiantin

I'm not really sure what you mean with "The face attribute also needs initialization, and the initialization cannot be right before QueryData", looked at the example about face recognition and everything seems fine. Note that all other attributes are being detected correctly (smile, age group, gender) but the eye closed is not being detected for some reason.

Could you please explain more about the code? Has someone obtained INDEX_EYE_CLOSED_LEFT or INDEX_EYE_CLOSED_RIGHT scores different from 0?


I have tried to get Eye_Closed attributes in c#. It works with issue... all the time score[ INDEX_EYE_CLOSED_LEFT] ==  score[ INDEX_EYE_CLOSED_RIGHT]. If I'am closing right eye then face analyzer returns what left eye is closed too. My demo tracks only right eye, if I close left eye nothing happens, don't know why.

I have overriden method OnFaceSetup and added

attribute.QueryProfile(PXCMFaceAnalysis.Attribute.Label.LABEL_EYE_CLOSED, out pinfo);

pinfo.threshold = 50;

attribute.SetProfile(PXCMFaceAnalysis.Attribute.Label.LABEL_EYE_CLOSED, ref pinfo);

Confirmed, by changing the threshold to 50 we can detect pretty well when both eyes are closed. It does not detect left or right eye status separately. The score for both eyes closed is stored in the first index of the array given to QueryData().

it is possible to get other emotion than smile from PXCMFaceAnalysis.Attribute ?

Hi Zeeshan, the Intel SDK downloaded at June 2013 does not support more emotion detection than "smile". I'm almost sure they will add more labels in the following months since the programming structure clearly leaves space for that.

Leave a Comment

Please sign in to add a comment. Not a member? Join today