Пример #1
0
        void Start()
        {
            _detector = new EyeLandmarkDetector(_resources);
            _material = new Material(_shader);
            _markers  = Enumerable.Range(0, 5)
                        .Select(x => Instantiate(_markerPrefab, _previewUI.transform))
                        .ToArray();

            if (_image != null)
            {
                RunDetector(_image);
            }
        }
Пример #2
0
 UpperEyelidVertexArray(this EyeLandmarkDetector detector)
 => detector.VertexArray.Skip(13).Take(7);
Пример #3
0
 LowerEyelidVertexArray(this EyeLandmarkDetector detector)
 => detector.VertexArray.Skip(5).Take(8);
Пример #4
0
 IrisVertexArray(this EyeLandmarkDetector detector)
 => detector.VertexArray.Take(5);
Пример #5
0
 public static Vector2 GetEyelidUpper(this EyeLandmarkDetector detector)
 => (detector.VertexArray.ElementAt(17) +
     detector.VertexArray.ElementAt(18)) * 0.5f;
Пример #6
0
 public static Vector2 GetEyelidLower(this EyeLandmarkDetector detector)
 => (detector.VertexArray.ElementAt(8) +
     detector.VertexArray.ElementAt(9)) * 0.5f;
Пример #7
0
 public static Vector2 GetEyelidRight(this EyeLandmarkDetector detector)
 => detector.VertexArray.ElementAt(13);
Пример #8
0
 public static Vector2 GetIrisCenter(this EyeLandmarkDetector detector)
 => detector.VertexArray.ElementAt(0);