C# Class ExplOCR.ImageLetters

Datei anzeigen Open project: ThoroughlyLostExplorer/ExplOCR

Public Methods

Method Description
CleanupKerning ( Bytemap sourceFrame, bool number ) : List
CopyRectangle ( Bytemap source, Rectangle area ) : Bytemap

Copy a portion of an existing Bytemap into a new Bytemap. The rectangles that describe the position of the source and the selected area are all relative to the original page bitmap that the OCR is processing.

GetLetterImage ( Bitmap baseBmp, Rectangle frame, Size dimension ) : byte[]
GetPrimitiveLetters ( Bitmap bmp, Rectangle line ) : List
GetPrimitiveLines ( Bitmap bmp ) : List
IsNewHeadlineWord ( List letters, int i ) : bool
IsNewWord ( List letters, int i, bool small ) : bool

Private Methods

Method Description
CopyLetter ( Bytemap source, Rectangle area, Size size ) : Bytemap

Copy a portion of an existing Bytemap into a new Bytemap. The new bytemap will always have a size of 'size' (typically a NN letter) regardless of the size of area. Pruning and zero-padding are used to ensure this. No data outside 'area' is copied. The rectangles that describe the position of the source and the selected area are all relative to the original page bitmap that the OCR is processing.

ExtractBytes ( Bitmap source ) : Bytemap
FloodFill ( int originalValue, byte targetValue, Size frame, byte letterBuf, bool number ) : void
FloodFillColumn ( int originalValue, byte targetValue, int a, Size frame, byte letterBuf, bool number ) : bool
GetRowHistogram ( Bitmap bmp, int y, int height ) : int[]
GetSubRect ( Rectangle r, byte letterBuf, int value ) : Rectangle
ImproveDescriptionLines ( Bitmap bmp, TextSection description ) : TextSection
RefinePartition ( ExplOCR.PageSections pageSections, Bitmap binary ) : ExplOCR.PageSections

Method Details

CleanupKerning() public static method

public static CleanupKerning ( Bytemap sourceFrame, bool number ) : List
sourceFrame Bytemap
number bool
return List

CopyRectangle() public static method

Copy a portion of an existing Bytemap into a new Bytemap. The rectangles that describe the position of the source and the selected area are all relative to the original page bitmap that the OCR is processing.
public static CopyRectangle ( Bytemap source, Rectangle area ) : Bytemap
source Bytemap
area System.Drawing.Rectangle
return Bytemap

GetLetterImage() public static method

public static GetLetterImage ( Bitmap baseBmp, Rectangle frame, Size dimension ) : byte[]
baseBmp System.Drawing.Bitmap
frame System.Drawing.Rectangle
dimension System.Drawing.Size
return byte[]

GetPrimitiveLetters() public static method

public static GetPrimitiveLetters ( Bitmap bmp, Rectangle line ) : List
bmp System.Drawing.Bitmap
line System.Drawing.Rectangle
return List

GetPrimitiveLines() public static method

public static GetPrimitiveLines ( Bitmap bmp ) : List
bmp System.Drawing.Bitmap
return List

IsNewHeadlineWord() public static method

public static IsNewHeadlineWord ( List letters, int i ) : bool
letters List
i int
return bool

IsNewWord() public static method

public static IsNewWord ( List letters, int i, bool small ) : bool
letters List
i int
small bool
return bool