Ejemplo n.º 1
0
    static void engine_ExpressivEmoStateUpdated(object sender, EmoStateUpdatedEventArgs e)
    {
        EmoState es = e.emoState;

        isBlink        = es.ExpressivIsBlink();
        isLeftWink     = es.ExpressivIsLeftWink();
        isRightWink    = es.ExpressivIsRightWink();
        isEyesOpen     = es.ExpressivIsEyesOpen();
        isLookingUp    = es.ExpressivIsLookingUp();
        isLookingDown  = es.ExpressivIsLookingDown();
        isLookingLeft  = es.ExpressivIsLookingLeft();
        isLookingRight = es.ExpressivIsLookingRight();
        es.ExpressivGetEyelidState(out eyelidStateLeft, out eyelidStateRight);
        es.ExpressivGetEyeLocation(out eyeLocationX, out eyeLocationY);
        eyebrowExtent   = es.ExpressivGetEyebrowExtent();
        smileExtent     = es.ExpressivGetSmileExtent();
        clenchExtent    = es.ExpressivGetClenchExtent();
        upperFaceAction = es.ExpressivGetUpperFaceAction();
        upperFacePower  = es.ExpressivGetUpperFaceActionPower();
        lowerFaceAction = es.ExpressivGetLowerFaceAction();
        lowerFacePower  = es.ExpressivGetLowerFaceActionPower();
        for (int i = 0; i < expAlgoList.Length; ++i)
        {
            isExpActiveList[i] = es.ExpressivIsActive(expAlgoList[i]);
        }
    }
Ejemplo n.º 2
0
        //Event handler for Expressiv event
        void ExpressivEmoStateUpdated()
        {
            if (FEmoState[0] != null)
            {
                EmoState es = FEmoState[0];

                mIsBlink        = es.ExpressivIsBlink();
                mIsLeftWink     = es.ExpressivIsLeftWink();
                mIsRightWink    = es.ExpressivIsRightWink();
                mIsEyesOpen     = es.ExpressivIsEyesOpen();
                mIsLookingUp    = es.ExpressivIsLookingUp();
                mIsLookingDown  = es.ExpressivIsLookingDown();
                mIsLookingLeft  = es.ExpressivIsLookingLeft();
                mIsLookingRight = es.ExpressivIsLookingRight();
                mLeftEyelid     = 0.0F;
                mRightEyelid    = 0.0F;
                mX = 0.0F;
                mY = 0.0F;
                es.ExpressivGetEyelidState(out mLeftEyelid, out mRightEyelid);
                es.ExpressivGetEyeLocation(out mX, out mY);
                mEyebrowExtent   = es.ExpressivGetEyebrowExtent();
                mSmileExtent     = es.ExpressivGetSmileExtent();
                mClenchExtent    = es.ExpressivGetClenchExtent();
                mUpperFaceAction = es.ExpressivGetUpperFaceAction();
                mUpperFacePower  = es.ExpressivGetUpperFaceActionPower();
                mLowerFaceAction = es.ExpressivGetLowerFaceAction();
                mLowerFacePower  = es.ExpressivGetLowerFaceActionPower();
                for (int i = 0; i < mExpAlgoList.Length; ++i)
                {
                    mIsExpActiveList[i] = es.ExpressivIsActive(mExpAlgoList[i]);
                }
            }
        }
Ejemplo n.º 3
0
    private static void engine_ExpressivEmoStateUpdated(object sender, EmoStateUpdatedEventArgs e)
    {
        EmoState emoState = e.emoState;

        EmoExpressiv.isBlink        = emoState.ExpressivIsBlink();
        EmoExpressiv.isLeftWink     = emoState.ExpressivIsLeftWink();
        EmoExpressiv.isRightWink    = emoState.ExpressivIsRightWink();
        EmoExpressiv.isEyesOpen     = emoState.ExpressivIsEyesOpen();
        EmoExpressiv.isLookingUp    = emoState.ExpressivIsLookingUp();
        EmoExpressiv.isLookingDown  = emoState.ExpressivIsLookingDown();
        EmoExpressiv.isLookingLeft  = emoState.ExpressivIsLookingLeft();
        EmoExpressiv.isLookingRight = emoState.ExpressivIsLookingRight();
        emoState.ExpressivGetEyelidState(out EmoExpressiv.eyelidStateLeft, out EmoExpressiv.eyelidStateRight);
        emoState.ExpressivGetEyeLocation(out EmoExpressiv.eyeLocationX, out EmoExpressiv.eyeLocationY);
        EmoExpressiv.eyebrowExtent   = emoState.ExpressivGetEyebrowExtent();
        EmoExpressiv.smileExtent     = emoState.ExpressivGetSmileExtent();
        EmoExpressiv.clenchExtent    = emoState.ExpressivGetClenchExtent();
        EmoExpressiv.upperFaceAction = emoState.ExpressivGetUpperFaceAction();
        EmoExpressiv.upperFacePower  = emoState.ExpressivGetUpperFaceActionPower();
        EmoExpressiv.lowerFaceAction = emoState.ExpressivGetLowerFaceAction();
        EmoExpressiv.lowerFacePower  = emoState.ExpressivGetLowerFaceActionPower();
        for (int i = 0; i < EmoExpressiv.expAlgoList.Length; i++)
        {
            EmoExpressiv.isExpActiveList[i] = emoState.ExpressivIsActive(EmoExpressiv.expAlgoList[i]);
        }
    }
Ejemplo n.º 4
0
        void engine_EmoStateUpdated(object sender, EmoStateUpdatedEventArgs e)
        {
            EmotivUser = e.userId;
            // enable data aquisition for this user.
            engine.DataAcquisitionEnable(e.userId, true);

            // ask for up to 1 second of buffered data
            engine.EE_DataSetBufferSizeInSec(1);



            EmoState es  = e.emoState;
            DateTime now = DateTime.Now;
            //int x,y;
            //engine.HeadsetGetGyroDelta(e.userId, out x, out y);

            //values["GyroDeltaX"] = (float)x;
            //values["GyroDeltaY"] = (float)y;
            Dictionary <string, float> values = new Dictionary <string, float>();

            values["AffectivGetExcitementShortTermScore"] = es.AffectivGetExcitementShortTermScore();
            values["AffectivGetExcitementLongTermScore"]  = es.AffectivGetExcitementLongTermScore();
            values["AffectivGetEngagementBoredomScore"]   = es.AffectivGetEngagementBoredomScore();
            values["AffectivGetMeditationScore"]          = es.AffectivGetMeditationScore();
            values["AffectivGetFrustrationScore"]         = es.AffectivGetFrustrationScore();
            float leftEye, rightEye;

            es.ExpressivGetEyelidState(out leftEye, out rightEye);
            values["ExpressivGetEyelidStateLeft"]  = leftEye;
            values["ExpressivGetEyelidStateRight"] = rightEye;
            es.ExpressivGetEyeLocation(out leftEye, out rightEye);
            values["ExpressivGetEyeLocationLeft"]      = leftEye;
            values["ExpressivGetEyeLocationRight"]     = rightEye;
            values["ExpressivGetClenchExtent"]         = es.ExpressivGetClenchExtent();
            values["ExpressivGetEyebrowExtent"]        = es.ExpressivGetEyebrowExtent();
            values["ExpressivGetLowerFaceActionPower"] = es.ExpressivGetLowerFaceActionPower();
            values["ExpressivGetSmileExtent"]          = es.ExpressivGetSmileExtent();
            values["ExpressivGetUpperFaceActionPower"] = es.ExpressivGetUpperFaceActionPower();
            values["ExpressivIsBlink"]        = bool2float(es.ExpressivIsBlink());
            values["ExpressivIsEyesOpen"]     = bool2float(es.ExpressivIsEyesOpen());
            values["ExpressivIsLeftWink"]     = bool2float(es.ExpressivIsLeftWink());
            values["ExpressivIsLookingDown"]  = bool2float(es.ExpressivIsLookingDown());
            values["ExpressivIsLookingLeft"]  = bool2float(es.ExpressivIsLookingLeft());
            values["ExpressivIsLookingRight"] = bool2float(es.ExpressivIsLookingRight());
            values["ExpressivIsLookingUp"]    = bool2float(es.ExpressivIsLookingUp());
            values["ExpressivIsRightWink"]    = bool2float(es.ExpressivIsRightWink());

            Sender.uploadEmotivEvent(user, now, values);
        }
Ejemplo n.º 5
0
        static void engine_ExpressivEmoStateUpdated(object sender, EmoStateUpdatedEventArgs e)
        {
            EmoState es = e.emoState;

            Single timeFromStart = es.GetTimeFromStart();

            EdkDll.EE_ExpressivAlgo_t[] expAlgoList =
            {
                EdkDll.EE_ExpressivAlgo_t.EXP_BLINK,
                EdkDll.EE_ExpressivAlgo_t.EXP_CLENCH,
                EdkDll.EE_ExpressivAlgo_t.EXP_EYEBROW,
                EdkDll.EE_ExpressivAlgo_t.EXP_FURROW,
                EdkDll.EE_ExpressivAlgo_t.EXP_HORIEYE,
                EdkDll.EE_ExpressivAlgo_t.EXP_LAUGH,
                EdkDll.EE_ExpressivAlgo_t.EXP_NEUTRAL,
                EdkDll.EE_ExpressivAlgo_t.EXP_SMILE,
                EdkDll.EE_ExpressivAlgo_t.EXP_SMIRK_LEFT,
                EdkDll.EE_ExpressivAlgo_t.EXP_SMIRK_RIGHT,
                EdkDll.EE_ExpressivAlgo_t.EXP_WINK_LEFT,
                EdkDll.EE_ExpressivAlgo_t.EXP_WINK_RIGHT
            };
            Boolean[] isExpActiveList = new Boolean[expAlgoList.Length];

            Boolean isBlink        = es.ExpressivIsBlink();
            Boolean isLeftWink     = es.ExpressivIsLeftWink();
            Boolean isRightWink    = es.ExpressivIsRightWink();
            Boolean isEyesOpen     = es.ExpressivIsEyesOpen();
            Boolean isLookingUp    = es.ExpressivIsLookingUp();
            Boolean isLookingDown  = es.ExpressivIsLookingDown();
            Boolean isLookingLeft  = es.ExpressivIsLookingLeft();
            Boolean isLookingRight = es.ExpressivIsLookingRight();
            Single  leftEye        = 0.0F;
            Single  rightEye       = 0.0F;
            Single  x = 0.0F;
            Single  y = 0.0F;

            es.ExpressivGetEyelidState(out leftEye, out rightEye);
            es.ExpressivGetEyeLocation(out x, out y);
            Single eyebrowExtent = es.ExpressivGetEyebrowExtent();
            Single smileExtent   = es.ExpressivGetSmileExtent();
            Single clenchExtent  = es.ExpressivGetClenchExtent();

            EdkDll.EE_ExpressivAlgo_t upperFaceAction = es.ExpressivGetUpperFaceAction();
            Single upperFacePower = es.ExpressivGetUpperFaceActionPower();

            EdkDll.EE_ExpressivAlgo_t lowerFaceAction = es.ExpressivGetLowerFaceAction();
            Single lowerFacePower = es.ExpressivGetLowerFaceActionPower();

            for (int i = 0; i < expAlgoList.Length; ++i)
            {
                isExpActiveList[i] = es.ExpressivIsActive(expAlgoList[i]);
            }

            expLog.Write(
                "{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18},",
                timeFromStart,
                isBlink, isLeftWink, isRightWink, isEyesOpen, isLookingUp,
                isLookingDown, isLookingLeft, isLookingRight, 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();
        }