C# Class Ocronet.Dynamic.Recognizers.Linerec

Inheritance: Ocronet.Dynamic.Interfaces.IRecognizeLine
Exibir arquivo Open project: nickun/OCRonet Class Usage Examples

Public Methods

Method Description
AddTrainingLine ( Intarray cseg, Bytearray image_grayscale, string tr ) : bool

Train on a text line, given a segmentation. This is analogous to addTrainingLine(bytearray,nustring) except that it takes the "ground truth" line segmentation.

AddTrainingLine ( Intarray cseg, string tr ) : void

Train on a text line. Usage is: call addTrainingLine with training data, then call finishTraining The state of the object is undefined between calling addTrainingLine and finishTraining, and it is an error to call recognizeLine before finishTraining completes. This allows both batch and incemental training. NB: you might train on length 1 strings for single character training and might train on words if line alignment is not working (well, for some training data)

Epoch ( int n ) : void
EstimateSpaceSize ( ) : void
FinishTraining ( ) : void
GetClassifier ( ) : IModel
IncClass ( int c ) : void

Original name: inc_class

Info ( ) : void
Linerec ( ) : System
Linerec ( string classifier1 = "latin", string extractor1 = "scaledfe", string segmenter1 = "DpSegmenter", int use_reject = 1 ) : System
Load ( string filename ) : void
LoadLinerec ( string filename ) : Linerec
LoadOldFormat ( BinaryReader reader ) : void
LoadOldFormat ( string path ) : void
OnTrainRound ( object sender, TrainEventArgs args ) : void
RecognizeLine ( IGenericFst result, Bytearray image ) : double

Recognize a text line and return a lattice representing the recognition alternatives.

RecognizeLine ( Intarray segmentation_, IGenericFst result, Bytearray image_ ) : double

This is a weird, optional method that exposes character segmentation for those line recognizers that have it segmentation contains colored pixels, and a transition in the transducer of the form * --- 1/eps --> * --- 2/a --> * means that pixels with color 1 and 2 together form the letter "a"

Save ( string filepath ) : void

Save network to file

SetClassifier ( IModel classifier ) : void
SetLine ( Bytearray image ) : void
StartTraining ( string type = "adaptation" ) : void

Private Methods

Method Description
Classifier_TrainRound ( object sender, TrainEventArgs e ) : void
TryAttachClassifierEvent ( IModel classifier ) : void
riuniform ( int hi ) : int

Method Details

AddTrainingLine() public method

Train on a text line, given a segmentation. This is analogous to addTrainingLine(bytearray,nustring) except that it takes the "ground truth" line segmentation.
public AddTrainingLine ( Intarray cseg, Bytearray image_grayscale, string tr ) : bool
cseg Intarray
image_grayscale Bytearray
tr string
return bool

AddTrainingLine() public method

Train on a text line. Usage is: call addTrainingLine with training data, then call finishTraining The state of the object is undefined between calling addTrainingLine and finishTraining, and it is an error to call recognizeLine before finishTraining completes. This allows both batch and incemental training. NB: you might train on length 1 strings for single character training and might train on words if line alignment is not working (well, for some training data)
public AddTrainingLine ( Intarray cseg, string tr ) : void
cseg Intarray
tr string
return void

Epoch() public method

public Epoch ( int n ) : void
n int
return void

EstimateSpaceSize() public method

public EstimateSpaceSize ( ) : void
return void

FinishTraining() public method

public FinishTraining ( ) : void
return void

GetClassifier() public method

public GetClassifier ( ) : IModel
return IModel

IncClass() public method

Original name: inc_class
public IncClass ( int c ) : void
c int
return void

Info() public method

public Info ( ) : void
return void

Linerec() public method

public Linerec ( ) : System
return System

Linerec() public method

public Linerec ( string classifier1 = "latin", string extractor1 = "scaledfe", string segmenter1 = "DpSegmenter", int use_reject = 1 ) : System
classifier1 string
extractor1 string
segmenter1 string
use_reject int
return System

Load() public method

public Load ( string filename ) : void
filename string
return void

LoadLinerec() public static method

public static LoadLinerec ( string filename ) : Linerec
filename string
return Linerec

LoadOldFormat() public method

public LoadOldFormat ( BinaryReader reader ) : void
reader System.IO.BinaryReader
return void

LoadOldFormat() public method

public LoadOldFormat ( string path ) : void
path string
return void

OnTrainRound() public method

public OnTrainRound ( object sender, TrainEventArgs args ) : void
sender object
args TrainEventArgs
return void

RecognizeLine() public method

Recognize a text line and return a lattice representing the recognition alternatives.
public RecognizeLine ( IGenericFst result, Bytearray image ) : double
result Ocronet.Dynamic.Interfaces.IGenericFst
image Bytearray
return double

RecognizeLine() public method

This is a weird, optional method that exposes character segmentation for those line recognizers that have it segmentation contains colored pixels, and a transition in the transducer of the form * --- 1/eps --> * --- 2/a --> * means that pixels with color 1 and 2 together form the letter "a"
public RecognizeLine ( Intarray segmentation_, IGenericFst result, Bytearray image_ ) : double
segmentation_ Intarray
result Ocronet.Dynamic.Interfaces.IGenericFst
image_ Bytearray
return double

Save() public method

Save network to file
public Save ( string filepath ) : void
filepath string full file path
return void

SetClassifier() public method

public SetClassifier ( IModel classifier ) : void
classifier IModel
return void

SetLine() public method

public SetLine ( Bytearray image ) : void
image Bytearray
return void

StartTraining() public method

public StartTraining ( string type = "adaptation" ) : void
type string
return void