C# Class HistogramOCRTrainer.HistogramOCR

example usage: https://github.com/andreigec/Word-Find-Solver
Afficher le fichier Open project: andreigec/Word-Find-Solver Class Usage Examples

Méthodes publiques

Свойство Type Description
HistogramHeight int
HistogramWidth int
Letters List
WhiteBitmap System.Drawing.Bitmap

Méthodes publiques

Méthode Description
DeSerialise ( string filename ) : HistogramOCR

Des the serialise.

HistogramOCR ( int HWidth = 20, int HHeight = 20 ) : System

initialise with a file, or blank

Normalise ( Bitmap b1 ) : Bitmap

trim white and resize to created dimensions

PerformOCR ( Bitmap b, int spaceForWhiteSpace = -1 ) : string[]

Performs the ocr.

PerformOCR ( string filename, int spaceForWhiteSpace = -1 ) : string[]

Performs the ocr.

PerformOCRCharacterPerfect ( Bitmap b ) : char?

Performs the ocr character perfect.

Serialise ( string filename ) : void

Serialises the specified filename.

SplitUp ( Bitmap b, int whiteToSpace = -1 ) : System.Drawing.Bitmap[][]

Splits up.

Train ( Bitmap b, char letterChar ) : bool

take an image of a letter and a character of what it is, and train the ocr

Train ( string filename, string letters, int spaceForWhiteSpace = -1 ) : bool

Trains the specified filename.

Private Methods

Méthode Description
GetOffScore ( Bitmap b, HistogramLetter l ) : int

get score. score of 0 is perfect

PerformOCRCharacter ( Bitmap b, bool perfectOnly = false ) : char

Performs the ocr character.

Split ( Bitmap b, bool byRow, int &whiteToSpace ) : IEnumerable

Splits the specified b.

Method Details

DeSerialise() public static méthode

Des the serialise.
public static DeSerialise ( string filename ) : HistogramOCR
filename string The filename.
Résultat HistogramOCR

HistogramOCR() public méthode

initialise with a file, or blank
public HistogramOCR ( int HWidth = 20, int HHeight = 20 ) : System
HWidth int Width of the h.
HHeight int Height of the h.
Résultat System

Normalise() public méthode

trim white and resize to created dimensions
public Normalise ( Bitmap b1 ) : Bitmap
b1 System.Drawing.Bitmap The b1.
Résultat System.Drawing.Bitmap

PerformOCR() public méthode

Performs the ocr.
public PerformOCR ( Bitmap b, int spaceForWhiteSpace = -1 ) : string[]
b System.Drawing.Bitmap The b.
spaceForWhiteSpace int The space for white space.
Résultat string[]

PerformOCR() public méthode

Performs the ocr.
public PerformOCR ( string filename, int spaceForWhiteSpace = -1 ) : string[]
filename string The filename.
spaceForWhiteSpace int The space for white space.
Résultat string[]

PerformOCRCharacterPerfect() public méthode

Performs the ocr character perfect.
public PerformOCRCharacterPerfect ( Bitmap b ) : char?
b System.Drawing.Bitmap The b.
Résultat char?

Serialise() public méthode

Serialises the specified filename.
public Serialise ( string filename ) : void
filename string The filename.
Résultat void

SplitUp() public méthode

Splits up.
public SplitUp ( Bitmap b, int whiteToSpace = -1 ) : System.Drawing.Bitmap[][]
b System.Drawing.Bitmap The b.
whiteToSpace int default = will calculate
Résultat System.Drawing.Bitmap[][]

Train() public méthode

take an image of a letter and a character of what it is, and train the ocr
public Train ( Bitmap b, char letterChar ) : bool
b System.Drawing.Bitmap The b.
letterChar char The letter character.
Résultat bool

Train() public méthode

Trains the specified filename.
public Train ( string filename, string letters, int spaceForWhiteSpace = -1 ) : bool
filename string The filename.
letters string The letters.
spaceForWhiteSpace int The space for white space.
Résultat bool

Property Details

HistogramHeight public_oe property

public int HistogramHeight
Résultat int

HistogramWidth public_oe property

public int HistogramWidth
Résultat int

Letters public_oe property

public List Letters
Résultat List

WhiteBitmap public_oe static_oe property

The white bitmap
public static Bitmap,System.Drawing WhiteBitmap
Résultat System.Drawing.Bitmap