/home/rays/src/opensrc/tesseract-ocr/training/commontraining.cpp File Reference

#include "commontraining.h"
#include "base/init_google.h"
#include "base/commandlineflags.h"
#include "allheaders.h"
#include "ccutil.h"
#include "classify.h"
#include "oldlist.h"
#include "globals.h"
#include "mf.h"
#include "clusttool.h"
#include "cluster.h"
#include "tessopt.h"
#include "efio.h"
#include "emalloc.h"
#include "featdefs.h"
#include "fontinfo.h"
#include "intfeaturespace.h"
#include "mastertrainer.h"
#include "tessdatamanager.h"
#include "tprintf.h"
#include "freelist.h"
#include "params.h"
#include "shapetable.h"
#include "unicity_table.h"
#include <math.h>

Namespaces

namespace  tesseract

Functions

 INT_PARAM_FLAG (debug_level, 0,"Level of Trainer debugging")
 INT_PARAM_FLAG (load_images, 0,"Load images with tr files")
 STRING_PARAM_FLAG (configfile,"","File to load more configs from")
 STRING_PARAM_FLAG (D,"","Directory to write output files to")
 STRING_PARAM_FLAG (F,"font_properties","File listing font properties")
 STRING_PARAM_FLAG (X,"","File listing font xheights")
 STRING_PARAM_FLAG (U,"unicharset","File to load unicharset from")
 STRING_PARAM_FLAG (O,"","File to write unicharset to")
 STRING_PARAM_FLAG (input_trainer,"","File to load trainer from")
 STRING_PARAM_FLAG (output_trainer,"","File to write trainer to")
 STRING_PARAM_FLAG (test_ch,"","UTF8 test character string")
void ParseArguments (int *argc, char ***argv)
ShapeTable * tesseract::LoadShapeTable (const STRING &file_prefix)
void tesseract::WriteShapeTable (const STRING &file_prefix, const ShapeTable &shape_table)
MasterTrainer * tesseract::LoadTrainingData (int argc, const char *const *argv, bool replication, ShapeTable **shape_table, STRING *file_prefix)
const char * GetNextFilename (int argc, const char *const *argv)
LABELEDLIST FindList (LIST List, char *Label)
LABELEDLIST NewLabeledList (const char *Label)
void ReadTrainingSamples (const FEATURE_DEFS_STRUCT &feature_defs, const char *feature_name, int max_samples, UNICHARSET *unicharset, FILE *file, LIST *training_samples)
void FreeTrainingSamples (LIST CharList)
void FreeLabeledList (LABELEDLIST LabeledList)
CLUSTERERSetUpForClustering (const FEATURE_DEFS_STRUCT &FeatureDefs, LABELEDLIST char_sample, const char *program_feature_type)
void MergeInsignificantProtos (LIST ProtoList, const char *label, CLUSTERER *Clusterer, CLUSTERCONFIG *Config)
void CleanUpUnusedData (LIST ProtoList)
LIST RemoveInsignificantProtos (LIST ProtoList, BOOL8 KeepSigProtos, BOOL8 KeepInsigProtos, int N)
MERGE_CLASS FindClass (LIST List, const char *Label)
MERGE_CLASS NewLabeledClass (const char *Label)
void FreeLabeledClassList (LIST ClassList)
CLASS_STRUCTSetUpForFloat2Int (const UNICHARSET &unicharset, LIST LabeledClassList)
void Normalize (float *Values)
void FreeNormProtoList (LIST CharList)
void AddToNormProtosList (LIST *NormProtoList, LIST ProtoList, char *CharName)
int NumberOfProtos (LIST ProtoList, BOOL8 CountSigProtos, BOOL8 CountInsigProtos)

Variables

CLUSTERCONFIG Config = { elliptical, 0.625, 0.05, 1.0, 1e-6, 0 }
const char * kUsage = "[flags] [ .tr files ... ]\n"
FEATURE_DEFS_STRUCT feature_defs
CCUtil ccutil

Function Documentation

void AddToNormProtosList ( LIST NormProtoList,
LIST  ProtoList,
char *  CharName 
)
void CleanUpUnusedData ( LIST  ProtoList  ) 
MERGE_CLASS FindClass ( LIST  List,
const char *  Label 
)
LABELEDLIST FindList ( LIST  List,
char *  Label 
)
void FreeLabeledClassList ( LIST  ClassList  ) 
void FreeLabeledList ( LABELEDLIST  LabeledList  ) 
void FreeNormProtoList ( LIST  CharList  ) 
void FreeTrainingSamples ( LIST  CharList  ) 
const char* GetNextFilename ( int  argc,
const char *const *  argv 
)
INT_PARAM_FLAG ( load_images  ,
,
"Load images with tr files"   
)
INT_PARAM_FLAG ( debug_level  ,
,
"Level of Trainer debugging"   
)
void MergeInsignificantProtos ( LIST  ProtoList,
const char *  label,
CLUSTERER Clusterer,
CLUSTERCONFIG Config 
)
MERGE_CLASS NewLabeledClass ( const char *  Label  ) 
LABELEDLIST NewLabeledList ( const char *  Label  ) 
void Normalize ( float *  Values  ) 
int NumberOfProtos ( LIST  ProtoList,
BOOL8  CountSigProtos,
BOOL8  CountInsigProtos 
)
void ParseArguments ( int *  argc,
char ***  argv 
)
void ReadTrainingSamples ( const FEATURE_DEFS_STRUCT feature_defs,
const char *  feature_name,
int  max_samples,
UNICHARSET unicharset,
FILE *  file,
LIST training_samples 
)
LIST RemoveInsignificantProtos ( LIST  ProtoList,
BOOL8  KeepSigProtos,
BOOL8  KeepInsigProtos,
int  N 
)
CLUSTERER* SetUpForClustering ( const FEATURE_DEFS_STRUCT FeatureDefs,
LABELEDLIST  char_sample,
const char *  program_feature_type 
)
CLASS_STRUCT* SetUpForFloat2Int ( const UNICHARSET unicharset,
LIST  LabeledClassList 
)

SetUpForFloat2Int

STRING_PARAM_FLAG ( test_ch  ,
""  ,
"UTF8 test character string"   
)
STRING_PARAM_FLAG ( output_trainer  ,
""  ,
"File to write trainer to"   
)
STRING_PARAM_FLAG ( input_trainer  ,
""  ,
"File to load trainer from"   
)
STRING_PARAM_FLAG ( ,
""  ,
"File to write unicharset to"   
)
STRING_PARAM_FLAG ( ,
"unicharset"  ,
"File to load unicharset from"   
)
STRING_PARAM_FLAG ( ,
""  ,
"File listing font xheights"   
)
STRING_PARAM_FLAG ( ,
"font_properties"  ,
"File listing font properties"   
)
STRING_PARAM_FLAG ( ,
""  ,
"Directory to write output files to"   
)
STRING_PARAM_FLAG ( configfile  ,
""  ,
"File to load more configs from"   
)

Variable Documentation

CLUSTERCONFIG Config = { elliptical, 0.625, 0.05, 1.0, 1e-6, 0 }
const char* kUsage = "[flags] [ .tr files ... ]\n"
Generated on Thu Feb 2 08:19:22 2012 for Tesseract by  doxygen 1.6.3