using OpenCvSharp; /// /// Represents eye tracking data /// public class EyeTrackingData { // Eye positions in screen space (0-1 range) public float LeftEyeX { get; set; } public float LeftEyeY { get; set; } public float RightEyeX { get; set; } public float RightEyeY { get; set; } // Eye openness values (0-1 range, where 0 = closed, 1 = fully open) public float LeftEyeOpenness { get; set; } = 1.0f; public float RightEyeOpenness { get; set; } = 1.0f; public Mat LeftEyeImage { get; set; } public Mat RightEyeImage { get; set; } // Confidence value (0-1 range) public float Confidence { get; set; } = 0.8f; // Flag conditions for multi-task model (0-1 range, probability of flag condition) public float LeftEyeFlagProbability { get; set; } = 0.0f; public float RightEyeFlagProbability { get; set; } = 0.0f; // Computed flag conditions (true if probability > threshold) public bool LeftEyeFlagCondition { get; set; } = false; public bool RightEyeFlagCondition { get; set; } = false; // Timestamp in milliseconds public long Timestamp { get; set; } // Helper method to check if any flag condition is detected public bool HasAnyFlagCondition() { return LeftEyeFlagCondition || RightEyeFlagCondition; } // Helper method to set flag conditions based on probability threshold public void SetFlagConditions(float threshold = 0.5f) { LeftEyeFlagCondition = LeftEyeFlagProbability > threshold; RightEyeFlagCondition = RightEyeFlagProbability > threshold; } }