コード例 #1
0
        public async Task <int> CountRecursivelyAsync(int count)
        {
            if (count <= 0)
            {
                return(count);
            }


            FilterInfoCollection WebcamColl;

            WebcamColl       = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            Device           = new VideoCaptureDevice(WebcamColl[0].MonikerString);
            Device.NewFrame += Device_NewFrame;
            Device.Start();
            Thread.Sleep(1000);
            Device.SignalToStop();

            ImageTesting imageTesting = new ImageTesting();
            await imageTesting.CropFacesAsync(results);


            var result = 1 + await CountRecursivelyAsync(count - 1);

            await Task.Yield();

            return(result);
        }
コード例 #2
0
        public async Task MainAsync()
        {
            FilterInfoCollection WebcamColl;

            WebcamColl       = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            Device           = new VideoCaptureDevice(WebcamColl[0].MonikerString);
            Device.NewFrame += Device_NewFrame;
            Device.Start();
            // For
            // Thread.Sleep(20000);
            Thread.Sleep(1000);
            Device.SignalToStop();

            ImageTesting imageTesting = new ImageTesting();
            await imageTesting.CropFacesAsync(results);
        }
コード例 #3
0
        public async Task CheckAsync(TimeSpan recursiveTimer)
        {
            FilterInfoCollection WebcamColl;

            WebcamColl       = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            Device           = new VideoCaptureDevice(WebcamColl[0].MonikerString);
            Device.NewFrame += Device_NewFrame;
            Device.Start();
            Thread.Sleep(1000);
            Device.SignalToStop();

            ImageTesting imageTesting = new ImageTesting();

            imageTesting.CropFacesAsync(results);


            await Task.FromResult(5);

            CheckAsync(recursiveTimer);
        }