private ReadPage ( |
||
imageGray | ||
imageBinary | ||
imageBinarySplit | ||
sections | ExplOCR.PageSections | |
return | void |
public static void ProcessImageFile(OcrReader ocrReader, string file) { using (Bitmap bmp = ImageFiles.LoadImageFile(file)) { Bitmap grayscale, binary, binarySplit; PageSections pageSections = PrepareBitmaps(bmp, out grayscale, out binary, out binarySplit); ocrReader.ReadPage(new Bytemap(grayscale), new Bytemap(binary), new Bytemap(binarySplit), pageSections); grayscale.Dispose(); binary.Dispose(); binarySplit.Dispose(); } }
public static bool ProcessImage(OcrReader ocrReader, Bitmap bmp, out Bitmap displayA, out Bitmap displayB) { Bitmap grayscale, binary, binarySplit; bmp = bmp.Clone() as Bitmap; PageSections pageSections = PrepareBitmaps(bmp, out grayscale, out binary, out binarySplit); if (pageSections == null) { displayA = new Bitmap(binary); displayB = new Bitmap(grayscale); return false; } ocrReader.ReadPage(new Bytemap(grayscale), new Bytemap(binary), new Bytemap(binarySplit), pageSections); displayA = new Bitmap(binary); displayB = new Bitmap(grayscale); AnnotatePageStructure(displayA, pageSections); AnnotatePageHeatmap(displayB, ocrReader.QualityData); return true; }