Пример #1
0
        async Task DetectBitmapInBackgroundAsync(IBuffer proxyResult, double factor, int min, int size, ImageCropper parent)
        {
            // Decode
            BitmapDecoder bd = await BitmapDecoder.CreateAsync(proxyResult.AsStream().AsRandomAccessStream());

            BitmapFrame bf = await bd.GetFrameAsync(0);


            // Detect
            AnimeFaceDetector c = new AnimeFaceDetector();

            c.LoadCascade();
            var s = await c.DetectBitmap(bf, factor, min, new Size(size, size));

            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                parent.Rects = s.ToList();
            });
        }
Пример #2
0
        async Task DetectBitmapInBackgroundAsync(BitmapFrame bf, double factor, int min, int size, ImageCropper parent)
        {
            AnimeFaceDetector c = new AnimeFaceDetector();

            c.LoadCascade();
            var s = await c.DetectBitmap(bf, factor, min, new Size(size, size));

            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                parent.Rects = s.ToList();
            });

            //Rects = s.ToList();
        }