ReadPage() private method

private ReadPage ( Bytemap imageGray, Bytemap imageBinary, Bytemap imageBinarySplit, ExplOCR.PageSections sections ) : void
imageGray Bytemap
imageBinary Bytemap
imageBinarySplit Bytemap
sections ExplOCR.PageSections
return void
Esempio n. 1
0
 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();
     }
 }
Esempio n. 2
0
        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;
        }