Ejemplo n.º 1
0
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();
            await CameraService.AuthorizeCameraUse();

            _cameraService  = new CameraService();
            _personObserver = new PersonObserver(_cameraService);
            AddVideoPreview();
            _cameraService.SetupLiveCameraStream();
            _personObserver.Start();
        }
Ejemplo n.º 2
0
 public PersonObserver(CameraService cameraService)
 {
     _cameraService = cameraService;
     detector       = CIDetector.CreateFaceDetector(null, true);
     client         = new FaceAccessClient();
     speechService  = new SpeechService();
     timer          = new Task(async() =>
     {
         while (true)
         {
             await Task.Delay(500);
             var result = await CheckCurrentFrame();
             if (result)
             {
                 await Task.Delay(2000);
             }
         }
     });
 }