internal static async Task <WriteableBitmap> FromStreamtoWritableBitmap(InMemoryRandomAccessStream stream) { WriteableBitmap writableBitmap = new WriteableBitmap(1, 1); BitmapPixelFormat format = BitmapPixelFormat.Unknown; writableBitmap = await WriteableBitmapExtensions.FromStream(writableBitmap, stream, format); return(writableBitmap); }
public async Task <WriteableBitmap> RecognizePlateAsync(IRandomAccessStream imageStream) { var writeableBitmap = await WriteableBitmapExtensions.FromStream(null, imageStream); await SaveImageAsync(writeableBitmap); var processedImage = GetEdgedImage(writeableBitmap.Clone()); var possiblePlatePositions = await GetPlateRectanglesAsync(processedImage); var plate = FindPlate(possiblePlatePositions, writeableBitmap); if (plate == null) { return(null); } await SaveImageAsync(plate); return(plate); }