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(); }); }
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(); }