static void engine_EmoStateUpdated(object sender, EmoStateUpdatedEventArgs e) { EmoState es = e.emoState; isBlink = es.FacialExpressionIsBlink(); isLeftWink = es.FacialExpressionIsLeftWink(); isRightWink = es.FacialExpressionIsRightWink(); isEyesOpen = es.FacialExpressionIsEyesOpen(); isLookingUp = es.FacialExpressionIsLookingUp(); isLookingDown = es.FacialExpressionIsLookingDown(); isLookingLeft = es.FacialExpressionIsLookingLeft(); isLookingRight = es.FacialExpressionIsLookingRight(); es.FacialExpressionGetEyelidState(out eyelidStateLeft, out eyelidStateRight); es.FacialExpressionGetEyeLocation(out eyeLocationX, out eyeLocationY); eyebrowExtent = es.FacialExpressionGetEyebrowExtent(); smileExtent = es.FacialExpressionGetSmileExtent(); clenchExtent = es.FacialExpressionGetClenchExtent(); upperFaceAction = es.FacialExpressionGetUpperFaceAction(); upperFacePower = es.FacialExpressionGetUpperFaceActionPower(); lowerFaceAction = es.FacialExpressionGetLowerFaceAction(); lowerFacePower = es.FacialExpressionGetLowerFaceActionPower(); for (int i = 0; i < expAlgoList.Length; ++i) { isExpActiveList[i] = es.FacialExpressionIsActive(expAlgoList[i]); } }
static void engine_FacialExpressionEmoStateUpdated(object sender, EmoStateUpdatedEventArgs e) { EmoState es = e.emoState; Single timeFromStart = es.GetTimeFromStart(); EdkDll.IEE_FacialExpressionAlgo_t[] expAlgoList = { EdkDll.IEE_FacialExpressionAlgo_t.FE_BLINK, EdkDll.IEE_FacialExpressionAlgo_t.FE_CLENCH, EdkDll.IEE_FacialExpressionAlgo_t.FE_SUPRISE, EdkDll.IEE_FacialExpressionAlgo_t.FE_FROWN, EdkDll.IEE_FacialExpressionAlgo_t.FE_HORIEYE, EdkDll.IEE_FacialExpressionAlgo_t.FE_NEUTRAL, EdkDll.IEE_FacialExpressionAlgo_t.FE_SMILE, EdkDll.IEE_FacialExpressionAlgo_t.FE_WINK_LEFT, EdkDll.IEE_FacialExpressionAlgo_t.FE_WINK_RIGHT }; Boolean[] isExpActiveList = new Boolean[expAlgoList.Length]; Boolean isBlink = es.FacialExpressionIsBlink(); Boolean isLeftWink = es.FacialExpressionIsLeftWink(); Boolean isRightWink = es.FacialExpressionIsRightWink(); Boolean isEyesOpen = es.FacialExpressionIsEyesOpen(); Boolean isLookingUp = es.FacialExpressionIsLookingUp(); Boolean isLookingDown = es.FacialExpressionIsLookingDown(); Single leftEye = 0.0F; Single rightEye = 0.0F; Single x = 0.0F; Single y = 0.0F; es.FacialExpressionGetEyelidState(out leftEye, out rightEye); es.FacialExpressionGetEyeLocation(out x, out y); Single eyebrowExtent = es.FacialExpressionGetEyebrowExtent(); Single smileExtent = es.FacialExpressionGetSmileExtent(); Single clenchExtent = es.FacialExpressionGetClenchExtent(); EdkDll.IEE_FacialExpressionAlgo_t upperFaceAction = es.FacialExpressionGetUpperFaceAction(); Single upperFacePower = es.FacialExpressionGetUpperFaceActionPower(); EdkDll.IEE_FacialExpressionAlgo_t lowerFaceAction = es.FacialExpressionGetLowerFaceAction(); Single lowerFacePower = es.FacialExpressionGetLowerFaceActionPower(); for (int i = 0; i < expAlgoList.Length; ++i) { isExpActiveList[i] = es.FacialExpressionIsActive(expAlgoList[i]); } expLog.Write( "{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},", timeFromStart, isBlink, isLeftWink, isRightWink, isEyesOpen, isLookingUp, isLookingDown, leftEye, rightEye, x, y, eyebrowExtent, smileExtent, upperFaceAction, upperFacePower, lowerFaceAction, lowerFacePower); for (int i = 0; i < expAlgoList.Length; ++i) { expLog.Write("{0},", isExpActiveList[i]); } expLog.WriteLine(""); expLog.Flush(); }