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_WINK_LEFT, EdkDll.IEE_FacialExpressionAlgo_t.FE_WINK_RIGHT }; Boolean[] isExpActiveList = new Boolean[expAlgoList.Length]; Boolean isLeftWink = es.FacialExpressionIsLeftWink(); Boolean isRightWink = es.FacialExpressionIsRightWink(); for (int i = 0; i < expAlgoList.Length; ++i) { isExpActiveList[i] = es.FacialExpressionIsActive(expAlgoList[i]); } if (isLeftWink) { Mouse.LeftClick(); //MessageBox.Show("Left Clicked!"); } if (isRightWink) { Mouse.RightClick(); //MessageBox.Show("Right Clicked!"); } }
/// <summary> /// Verifica si el evento recibido es del tipo eye /// </summary> /// <param name="emoState">Evento recibido </param> /// <returns></returns> private bool CheckEyeEvent(EmoState emoState) { //Se pone en true en caso de que el evento fue del tipo de los ojos var wasEyes = false; if (emoState.FacialExpressionIsBlink()) { wasEyes = true; _facialExpressionDto.Eyes.Change(EyeExpressionEnum.Blink); } else if (emoState.FacialExpressionIsLeftWink()) { wasEyes = true; _facialExpressionDto.Eyes.Change(EyeExpressionEnum.WinkLeft); } else if (emoState.FacialExpressionIsRightWink()) { wasEyes = true; _facialExpressionDto.Eyes.Change(EyeExpressionEnum.WinkRight); } else if (emoState.FacialExpressionIsLookingLeft() == 1) { wasEyes = true; _facialExpressionDto.Eyes.Change(EyeExpressionEnum.LookLeft); } else if (emoState.FacialExpressionIsLookingRight() == 1) { wasEyes = true; _facialExpressionDto.Eyes.Change(EyeExpressionEnum.LookRight); } return(wasEyes); }
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_WINK_LEFT, EdkDll.IEE_FacialExpressionAlgo_t.FE_WINK_RIGHT }; Boolean[] isExpActiveList = new Boolean[expAlgoList.Length]; Boolean isLeftWink = es.FacialExpressionIsLeftWink(); Boolean isRightWink = es.FacialExpressionIsRightWink(); for (int i = 0; i < expAlgoList.Length; ++i) { isExpActiveList[i] = es.FacialExpressionIsActive(expAlgoList[i]); } //expLog.Write("{0},{1},",isLeftWink, isRightWink); //for (int i = 0; i < expAlgoList.Length; ++i) //{ // expLog.Write("{0},", isExpActiveList[i]); //} if (isLeftWink) { Mouse.LeftClick(); } if (isRightWink) { Mouse.RightClick(); } expLog.WriteLine(""); expLog.Flush(); }
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(); }