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]);
        }
    }
Example #2
0
 //another condition to accept facial expresions with power
 public bool ActionConditionEmotiv(EdkDll.IEE_FacialExpressionAlgo_t facialExpression, bool isUpperFace, float statePower)
 {
     if (EEGManager.Instance.FacialExpressionLowerFaceAction == facialExpression && EEGManager.Instance.FacialExpressionUpperFaceActionPower >= statePower && isUpperFace)
     {
         return(true);
     }
     else if (EEGManager.Instance.FacialExpressionLowerFaceAction == facialExpression && EEGManager.Instance.FacialExpressionLowerFaceActionPower >= statePower && !isUpperFace)
     {
         return(true);
     }
     return(false);
 }
 public void StartTrainFacialExpression(EdkDll.IEE_FacialExpressionAlgo_t FacialExpressionAlg)
 {
     engine.FacialExpressionSetTrainingAction((uint)EmoUserManagement.currentUser, FacialExpressionAlg);
     engine.FacialExpressionSetTrainingControl((uint)EmoUserManagement.currentUser, EdkDll.IEE_FacialExpressionTrainingControl_t.FE_START);
 }
Example #4
0
 /// <summary>
 /// Query whether the signal is too noisy for Expressiv detection to be active
 /// </summary>
 /// <param name="type">Expressiv detection type</param>
 /// <returns>detection state (false: Not Active, true: Active)</returns>
 public Boolean FacialExpressionIsActive(EdkDll.IEE_FacialExpressionAlgo_t type)
 {
     return(EdkDll.IS_FacialExpressionIsActive(hEmoState, type));
 }
Example #5
0
        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();
        }