Exemplo n.º 1
0
        /// <summary>
        /// Is called when new gaze data is available, updates track status and raises OnGazeDataChanged
        /// </summary>
        /// <param name="sender">The Sender.</param>
        /// <param name="e">Gaze data.</param>
        private void SmartEyeGazeDataAvailable(object sender, GazeDataReceivedEventArgs e)
        {
            // Send the gaze data to the track status control.
            SmartEyeGazeData gd = e.Gazedata;

            this.smartEyeTrackStatus.OnGazeData(gd);
            if (this.dlgTrackStatus != null && this.dlgTrackStatus.Visible)
            {
                this.dlgTrackStatus.Update(gd);
            }

            GazeData newGD = new GazeData();

            newGD.Time = gd.Time;

            if (gd.HeadQuality >= 1 && gd.GazeQuality > this.smartEyeSettings.QualityThreshold) // cut off bad quality data
            {
                newGD.GazePosX  = gd.GazePosX;
                newGD.GazePosY  = gd.GazePosY;
                newGD.PupilDiaX = gd.PupilDiaX;
                newGD.PupilDiaY = gd.PupilDiaY;
            }
            else
            {
                newGD.GazePosX  = null;
                newGD.GazePosY  = null;
                newGD.PupilDiaX = null;
                newGD.PupilDiaY = null;
            }

            this.OnGazeDataChanged(new GazeDataChangedEventArgs(newGD));
        }
Exemplo n.º 2
0
    /// <summary>
    /// Is called when new gaze data is available, updates track status and raises OnGazeDataChanged
    /// </summary>
    /// <param name="sender">The Sender.</param>
    /// <param name="e">Gaze data.</param>
    private void SmartEyeGazeDataAvailable(object sender, GazeDataReceivedEventArgs e)
    {
      // Send the gaze data to the track status control.
      SmartEyeGazeData gd = e.Gazedata;
      this.smartEyeTrackStatus.OnGazeData(gd);
      if (this.dlgTrackStatus != null && this.dlgTrackStatus.Visible)
      {
        this.dlgTrackStatus.Update(gd);
      }

      GazeData newGD = new GazeData();
      newGD.Time = gd.Time;

      if (gd.HeadQuality >= 1 && gd.GazeQuality > this.smartEyeSettings.QualityThreshold)   // cut off bad quality data
      {
        newGD.GazePosX = gd.GazePosX;
        newGD.GazePosY = gd.GazePosY;
        newGD.PupilDiaX = gd.PupilDiaX;
        newGD.PupilDiaY = gd.PupilDiaY;
      }
      else
      {
        newGD.GazePosX = null;
        newGD.GazePosY = null;
        newGD.PupilDiaX = null;
        newGD.PupilDiaY = null;
      }

      this.OnGazeDataChanged(new GazeDataChangedEventArgs(newGD));
    }