Tesseract 3.01
/data/source/tesseract-ocr/training/commontraining.cpp File Reference
#include "commontraining.h"
#include "oldlist.h"
#include "globals.h"
#include "mf.h"
#include "clusttool.h"
#include "cluster.h"
#include "tessopt.h"
#include "featdefs.h"
#include "efio.h"
#include "emalloc.h"
#include "tprintf.h"
#include "freelist.h"
#include "unicity_table.h"
#include <math.h>

Defines

#define round(x, frag)   (floor(x/frag+.5)*frag)

Functions

void ParseArguments (int argc, char **argv)
char * GetNextFilename (int Argc, char **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, float linear_spread, float circular_spread, UNICHARSET *unicharset, FILE *file, LIST *training_samples)
void WriteTrainingSamples (const FEATURE_DEFS_STRUCT &FeatureDefs, char *Directory, LIST CharList, const char *program_feature_type)
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, char *Label)
MERGE_CLASS NewLabeledClass (char *Label)
void FreeLabeledClassList (LIST ClassList)
void SetUpForFloat2Int (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 }
char * Directory = NULL
const char * InputUnicharsetFile = NULL
const char * OutputUnicharsetFile = NULL
const char * InputFontInfoFile = NULL
const char * InputXHeightsFile = NULL
FLOAT32 RoundingAccuracy = 0.0f
char CTFontName [MAXNAMESIZE]
const char * test_ch = ""

Define Documentation

#define round (   x,
  frag 
)    (floor(x/frag+.5)*frag)

Function Documentation

void AddToNormProtosList ( LIST NormProtoList,
LIST  ProtoList,
char *  CharName 
)
void CleanUpUnusedData ( LIST  ProtoList)
MERGE_CLASS FindClass ( LIST  List,
char *  Label 
)
LABELEDLIST FindList ( LIST  List,
char *  Label 
)
void FreeLabeledClassList ( LIST  ClassList)
void FreeLabeledList ( LABELEDLIST  LabeledList)
void FreeNormProtoList ( LIST  CharList)
void FreeTrainingSamples ( LIST  CharList)
char* GetNextFilename ( int  Argc,
char **  Argv 
)
void MergeInsignificantProtos ( LIST  ProtoList,
const char *  label,
CLUSTERER Clusterer,
CLUSTERCONFIG Config 
)
MERGE_CLASS NewLabeledClass ( 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,
float  linear_spread,
float  circular_spread,
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 
)
void SetUpForFloat2Int ( const UNICHARSET unicharset,
LIST  LabeledClassList 
)

SetUpForFloat2Int

void WriteTrainingSamples ( const FEATURE_DEFS_STRUCT FeatureDefs,
char *  Directory,
LIST  CharList,
const char *  program_feature_type 
)

Variable Documentation

CLUSTERCONFIG Config = { elliptical, 0.625, 0.05, 1.0, 1e-6, 0 }
char CTFontName[MAXNAMESIZE]
char* Directory = NULL
const char* InputFontInfoFile = NULL
const char* InputUnicharsetFile = NULL
const char* InputXHeightsFile = NULL
const char* OutputUnicharsetFile = NULL
const char* test_ch = ""
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines