Exemplo n.º 1
0
        public void setMode(Mode mode)
        {
            if (warp != null)
            {
                warp.Dispose();
            }
            if (prec != null)
            {
                prec.Dispose();
            }

            this.mode = mode;
            switch (mode)
            {
            case Mode.EYEX_AND_EVIACAM:
                warp  = new EyeXWarpPointer();
                prec  = new NoPrecisionPointer();
                state = TrackingState.RUNNING;
                break;

            case Mode.EYEX_AND_TRACKIR:
                warp = new EyeXWarpPointer();
                prec = new TrackIRPrecisionPointer(PrecisionPointerMode.ROTATION, sensitivity);
                break;

            case Mode.EYEX_AND_SMARTNAV:
                warp  = new EyeXWarpPointer();
                prec  = new NoPrecisionPointer();
                state = TrackingState.RUNNING;
                break;

            case Mode.TRACKIR_ONLY:
                warp = new NoWarpPointer(getScreenCenter());
                prec = new TrackIRPrecisionPointer(PrecisionPointerMode.BOTH, sensitivity);
                break;

            case Mode.EYEX_ONLY:
                warp = new EyeXWarpPointer();
                prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.EVIACAM_ONLY:
                warp  = new NoWarpPointer();
                prec  = new NoPrecisionPointer();
                state = TrackingState.RUNNING;
                break;
            }

            calibrator = new GazeCalibrator(this, warp);

            if (!warp.IsStarted())
            {
                state = TrackingState.ERROR;
            }

            if (!prec.IsStarted())
            {
                state = TrackingState.ERROR;
            }
        }
Exemplo n.º 2
0
        public GazeCalibrator(MouseController controller, WarpPointer warp)
        {
            this.controller = controller;
            this.warp       = warp;
            events          = new List <Event>();

            if (saveCalibration)
            {
                mouseGlobalHook = Hook.GlobalEvents();
                mouseGlobalHook.MouseDownExt += GlobalHookMouseDownExt;
            }
        }
        public void setMode(Mode mode)
        {
            if (warp != null)
            {
                warp.Dispose();
            }
            if (prec != null)
            {
                prec.Dispose();
            }

            switch (mode)
            {
            case Mode.EYEX_ONLY:
                warp = new EyeXWarpPointer(mConfiguration);
                prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.EYEX_ONLY_LeftEye:
                warp = new oneEyeLeft(mConfiguration);
                prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.EYEX_ONLY_RightEye:
                warp = new OneEyeRight(mConfiguration);
                prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.EYEX_ONLY_Head:
                prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.EYE_HEAD_COMBINE:
                warp = new combineEyeAndHead(mConfiguration, sensitivity);
                // prec = new EyeXPrecisionPointer(sensitivity);
                break;
            }


            calibrator = new GazeCalibrator(this, warp);

            if (!warp.IsStarted())
            {
                state = TrackingState.ERROR;
            }

            if (!prec.IsStarted())
            {
                state = TrackingState.ERROR;
            }
        }
Exemplo n.º 4
0
        public void setMode(Mode mode)
        {
            if (warp != null)
            {
                warp.Dispose();
            }
            if (prec != null)
            {
                prec.Dispose();
            }

            this.mode = mode;
            switch (mode)
            {
            case Mode.EYEX_AND_TRACKIR:
                warp = new EyeXWarpPointer(ScreenPixelHelper.ConvertMmToPixels(25));
                prec = new TrackIRPrecisionPointer(ScreenPixelHelper.ConvertMmToPixels(25), 0.3);
                break;

            case Mode.EYEX_AND_SMARTNAV:
                warp  = new EyeXWarpPointer(ScreenPixelHelper.ConvertMmToPixels(1));
                prec  = new NoPrecisionPointer();
                state = TrackingState.RUNNING;
                break;

            case Mode.EYEX_ONLY:
                warp = new EyeXWarpPointer(ScreenPixelHelper.ConvertMmToPixels(5));
                prec = new NoPrecisionPointer();
                break;
            }

            Logger.WriteVar(nameof(mode), mode);

            if (!warp.IsStarted())
            {
                state = TrackingState.ERROR;
            }

            if (!prec.IsStarted())
            {
                state = TrackingState.ERROR;
            }
        }
        public void setMode(Mode mode)
        {
            if (warp != null)
            {
                warp.Dispose();
            }
            if (prec != null)
            {
                prec.Dispose();
            }

            switch (mode)
            {
            case Mode.EYEX_ONLY:
                warp = new EyeXWarpPointer(mConfiguration);
                prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.EYEX_ONLY_OneEye:
                warp = new oneEye(mConfiguration);
                prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.EYEX_ONLY_Head:
                //warp = new EyeXWarpPointer(mConfiguration);
                prec = new EyeXPrecisionPointer(sensitivity);
                break;
            }


            calibrator = new GazeCalibrator(this, warp);

            if (!warp.IsStarted())
            {
                state = TrackingState.ERROR;
            }

            if (!prec.IsStarted())
            {
                state = TrackingState.ERROR;
            }
        }
Exemplo n.º 6
0
        public void setMode(Mode mode)
        {
            if (warp != null)
            {
                warp.Dispose();
            }
            if (prec != null)
            {
                prec.Dispose();
            }
            switch (mode)
            {
            /* case Mode.EYEX_ONLY:
             *   warp = new EyeXWarpPointer(mConfiguration);
             *   prec = new EyeXPrecisionPointer(sensitivity);
             *   break;
             *
             * case Mode.EYEX_ONLY_LeftEye:
             *   warp = new oneEyeLeft(mConfiguration);
             *   prec = new EyeXPrecisionPointer(sensitivity);
             *   break;
             *
             * case Mode.EYEX_ONLY_RightEye:
             *   warp = new OneEyeRight(mConfiguration);
             *   prec = new EyeXPrecisionPointer(sensitivity);
             *   break;
             *
             * case Mode.EYEX_ONLY_Head:
             *   prec = new EyeXPrecisionPointer(sensitivity);
             *   break;
             *
             * case Mode.EYE_HEAD_COMBINE:
             *   warp = new combineEyes(mConfiguration);
             *  // prec = new EyeXPrecisionPointer(sensitivity);
             *   break;*/

            case Mode.BOTH_EYE_AND_HEAD:
                warp = new combineEyes(mConfiguration);
                prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.BOTH_EYE:
                warp = new combineEyes(mConfiguration);
                // prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.LEFT_EYE_AND_HEAD:
                warp = new OneEyeLeft(mConfiguration);
                prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.LEFT_EYE:
                warp = new OneEyeLeft(mConfiguration);
                // prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.RIGHT_EYE_AND_HEAD:
                warp = new OneEyeRight(mConfiguration);
                prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.RIGHT_EYE:
                warp = new OneEyeRight(mConfiguration);
                // prec = new EyeXPrecisionPointer(sensitivity);
                break;

            case Mode.JUST_HEAD:
                prec = new EyeXPrecisionPointer(sensitivity);
                break;
            }


            calibrator = new GazeCalibrator(this, warp);

            /*  if (!warp.IsStarted())
             *    state = TrackingState.ERROR;
             *
             * if (!prec.IsStarted())
             *    state = TrackingState.ERROR;*/
        }