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]);
        }
    }
Пример #2
0
        private void Engine_FacialExpressionEmoStateUpdated(object sender, EmoStateUpdatedEventArgs e)
        {
            EmoState es = e.emoState;

            if (es.FacialExpressionIsBlink())
            {
                var a = "";
            }
            var facialExpressionGetUpperFaceActionPower = es.FacialExpressionGetUpperFaceActionPower();

            Console.WriteLine("User " + e.userId + "  Time :  " + es.GetTimeFromStart());
        }
Пример #3
0
        private void Engine_MentalCommandEmoStateUpdated(object sender, EmoStateUpdatedEventArgs e)
        {
            EmoState es = e.emoState;

            if (es.MentalCommandGetCurrentAction() == EdkDll.IEE_MentalCommandAction_t.MC_LEFT)
            {
                var a  = "";
                var aa = es.MentalCommandGetCurrentActionPower();
            }
            if (es.MentalCommandGetCurrentAction() == EdkDll.IEE_MentalCommandAction_t.MC_NEUTRAL)
            {
                var a  = "";
                var aa = es.MentalCommandGetCurrentActionPower();
            }
            var facialExpressionGetUpperFaceActionPower = es.FacialExpressionGetUpperFaceActionPower();

            Console.WriteLine("User " + e.userId + "  Time :  " + es.GetTimeFromStart());
        }
Пример #4
0
        private bool CheckUpperFaceExpression(EmoState emoState)
        {
            var wasUpperExpression = false;
            var power = emoState.FacialExpressionGetUpperFaceActionPower();

            if (emoState.FacialExpressionGetUpperFaceAction() == EdkDll.IEE_FacialExpressionAlgo_t.FE_SUPRISE)
            {
                wasUpperExpression = _facialExpressionDto.UpperFace.IsTheSameThanPrevious(_facialExpressionDto.UpperFace.Type, power);
                _facialExpressionDto.UpperFace.Change(UpperFaceEnum.Surprise, power);
            }
            if (emoState.FacialExpressionGetUpperFaceAction() == EdkDll.IEE_FacialExpressionAlgo_t.FE_FROWN)
            {
                wasUpperExpression = _facialExpressionDto.UpperFace.IsTheSameThanPrevious(_facialExpressionDto.UpperFace.Type, power);;
                _facialExpressionDto.UpperFace.Change(UpperFaceEnum.FurrowBrow, power);
            }

            return(wasUpperExpression);
        }
Пример #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();
        }