Ejemplo n.º 1
0
        private void Set(GazeData other)
        {
            State           = other.State;
            TimeStamp       = other.TimeStamp;
            TimeStampString = other.TimeStampString;

            RawCoordinates      = new Point2D(other.RawCoordinates);
            SmoothedCoordinates = new Point2D(other.SmoothedCoordinates);

            LeftEye  = new Eye(other.LeftEye);
            RightEye = new Eye(other.RightEye);

            IsFixated = other.IsFixated;
        }
Ejemplo n.º 2
0
        public GazeData(GazeData other)
        {
            if (null != other)
            {
                State = other.State;
                TimeStamp = other.TimeStamp;
                TimeStampString = other.TimeStampString;

                RawCoordinates = new Point2D(other.RawCoordinates);
                SmoothedCoordinates = new Point2D(other.SmoothedCoordinates);

                LeftEye = new Eye(other.LeftEye);
                RightEye = new Eye(other.RightEye);

                IsFixated = other.IsFixated;
            }
        }
Ejemplo n.º 3
0
        public GazeData(GazeData other)
        {
            if (null != other)
            {
                State           = other.State;
                TimeStamp       = other.TimeStamp;
                TimeStampString = other.TimeStampString;

                RawCoordinates      = new Point2D(other.RawCoordinates);
                SmoothedCoordinates = new Point2D(other.SmoothedCoordinates);

                LeftEye  = new Eye(other.LeftEye);
                RightEye = new Eye(other.RightEye);

                IsFixated = other.IsFixated;
            }
        }
Ejemplo n.º 4
0
            public void OnGazeUpdate(GazeData gazeData)
            {
                if (!hasRecievedGazeData)
                    hasRecievedGazeData = !hasRecievedGazeData;

                if (GazeManager.DebugMode)
                    Debug.WriteLine("Thread: " + Thread.CurrentThread.Name + ", onGazeUpdate: " + gazeData.ToString());
            }
Ejemplo n.º 5
0
        public void TestGazeData()
        {
            GazeData gd = new GazeData();
            gd.LeftEye.PupilSize = 11.1d;
            gd.RightEye.PupilCenterCoordinates = new Point2D(800.13f, 20.325f);
            gd.State = 1;

            Assert.IsNotNull(gd.State);
            Assert.IsTrue(!gd.HasRawGazeCoordinates());

            String json = JsonConvert.SerializeObject(gd);
            GazeData gd2 = JsonConvert.DeserializeObject<GazeData>(json);

            Assert.AreEqual(gd, gd2);
            Assert.AreEqual(gd.GetHashCode(), gd2.GetHashCode());
        }
Ejemplo n.º 6
0
        private void Set(GazeData other)
        {
            State = other.State;
            TimeStamp = other.TimeStamp;
            TimeStampString = other.TimeStampString;

            RawCoordinates = new Point2D(other.RawCoordinates);
            SmoothedCoordinates = new Point2D(other.SmoothedCoordinates);

            LeftEye = new Eye(other.LeftEye);
            RightEye = new Eye(other.RightEye);

            IsFixated = other.IsFixated;
        }
Ejemplo n.º 7
0
 public void OnGazeUpdate(GazeData gazeData)
 {
     var x = (int)Math.Round(gazeData.SmoothedCoordinates.X, 0);
     var y = (int)Math.Round(gazeData.SmoothedCoordinates.Y, 0);
     if (x == 0 & y == 0) return;
     // Invoke thread
     Dispatcher.BeginInvoke(new Action(() => UpdateUI(x, y)));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Calculates distance between pupil centers based on previously
 /// recorded min and max values
 /// </summary>
 /// <param name="gazeData">gaze data frame to base calculation upon</param>
 /// <returns>a normalized value [0f..1f]</returns>
 public static double GetEyesDistanceNormalized(GazeData gazeData)
 {
     return GetEyesDistanceNormalized(gazeData.LeftEye, gazeData.RightEye);
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Find average pupil center of two eyes.
        /// </summary>
        /// <param name="gazeData">gaze data frame to base calculation upon</param>
        /// <param name="screenWidth"></param>
        /// <param name="screenHeight"></param>
        /// <returns>the average center point in pixels</returns>
        public static Point2D GetEyesCenterPixels(GazeData gazeData, int screenWidth, int screenHeight)
        {
            if (null != gazeData)
                return GetEyesCenterPixels(gazeData.LeftEye, gazeData.RightEye, screenWidth, screenHeight);

            return Point2D.Zero;
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Find average pupil center of two eyes.
        /// </summary>
        /// <param name="gazeData">gaze data frame to base calculation upon</param>
        /// <returns>the average center point in normalized values</returns>
        public static Point2D GetEyesCenterNormalized(GazeData gazeData)
        {
            if (null != gazeData)
                return GetEyesCenterNormalized(gazeData.LeftEye, gazeData.RightEye);

            return Point2D.Zero;
        }