#include <mastertrainer.h>
Public Member Functions | |
MasterTrainer (NormalizationMode norm_mode, bool shape_analysis, bool replicate_samples, int debug_level) | |
~MasterTrainer () | |
bool | Serialize (FILE *fp) const |
void | LoadUnicharset (const char *filename) |
void | SetFeatureSpace (const IntFeatureSpace &fs) |
void | ReadTrainingSamples (const char *page_name, const FEATURE_DEFS_STRUCT &feature_defs, bool verification) |
void | AddSample (bool verification, const char *unichar_str, TrainingSample *sample) |
void | LoadPageImages (const char *filename) |
void | PostLoadCleanup () |
void | PreTrainingSetup () |
void | SetupMasterShapes () |
void | IncludeJunk () |
void | ReplicateAndRandomizeSamplesIfRequired () |
bool | LoadFontInfo (const char *filename) |
bool | LoadXHeights (const char *filename) |
bool | AddSpacingInfo (const char *filename) |
int | GetFontInfoId (const char *font_name) |
int | GetBestMatchingFontInfoId (const char *filename) |
const STRING & | GetTRFileName (int index) const |
void | SetupFlatShapeTable (ShapeTable *shape_table) |
CLUSTERER * | SetupForClustering (const ShapeTable &shape_table, const FEATURE_DEFS_STRUCT &feature_defs, int shape_id, int *num_samples) |
void | WriteInttempAndPFFMTable (const UNICHARSET &unicharset, const UNICHARSET &shape_set, const ShapeTable &shape_table, CLASS_STRUCT *float_classes, const char *inttemp_file, const char *pffmtable_file) |
const UNICHARSET & | unicharset () const |
TrainingSampleSet * | GetSamples () |
const ShapeTable & | master_shapes () const |
void | DebugCanonical (const char *unichar_str1, const char *unichar_str2) |
void | DisplaySamples (const char *unichar_str1, int cloud_font, const char *unichar_str2, int canonical_font) |
void | TestClassifierVOld (bool replicate_samples, ShapeClassifier *test_classifier, ShapeClassifier *old_classifier) |
void | TestClassifierOnSamples (CountTypes error_mode, int report_level, bool replicate_samples, ShapeClassifier *test_classifier, STRING *report_string) |
double | TestClassifier (CountTypes error_mode, int report_level, bool replicate_samples, TrainingSampleSet *samples, ShapeClassifier *test_classifier, STRING *report_string) |
float | ShapeDistance (const ShapeTable &shapes, int s1, int s2) |
Private Member Functions | |
void | ReplaceFragmentedSamples () |
void | ClusterShapes (int min_shapes, int max_shape_unichars, float max_dist, ShapeTable *shape_table) |
tesseract::MasterTrainer::MasterTrainer | ( | NormalizationMode | norm_mode, |
bool | shape_analysis, | ||
bool | replicate_samples, | ||
int | debug_level | ||
) |
tesseract::MasterTrainer::~MasterTrainer | ( | ) |
void tesseract::MasterTrainer::AddSample | ( | bool | verification, |
const char * | unichar_str, | ||
TrainingSample * | sample | ||
) |
bool tesseract::MasterTrainer::AddSpacingInfo | ( | const char * | filename | ) |
|
private |
void tesseract::MasterTrainer::DebugCanonical | ( | const char * | unichar_str1, |
const char * | unichar_str2 | ||
) |
void tesseract::MasterTrainer::DisplaySamples | ( | const char * | unichar_str1, |
int | cloud_font, | ||
const char * | unichar_str2, | ||
int | canonical_font | ||
) |
int tesseract::MasterTrainer::GetBestMatchingFontInfoId | ( | const char * | filename | ) |
int tesseract::MasterTrainer::GetFontInfoId | ( | const char * | font_name | ) |
|
inline |
|
inline |
void tesseract::MasterTrainer::IncludeJunk | ( | ) |
bool tesseract::MasterTrainer::LoadFontInfo | ( | const char * | filename | ) |
void tesseract::MasterTrainer::LoadPageImages | ( | const char * | filename | ) |
void tesseract::MasterTrainer::LoadUnicharset | ( | const char * | filename | ) |
bool tesseract::MasterTrainer::LoadXHeights | ( | const char * | filename | ) |
|
inline |
void tesseract::MasterTrainer::PostLoadCleanup | ( | ) |
void tesseract::MasterTrainer::PreTrainingSetup | ( | ) |
void tesseract::MasterTrainer::ReadTrainingSamples | ( | const char * | page_name, |
const FEATURE_DEFS_STRUCT & | feature_defs, | ||
bool | verification | ||
) |
|
private |
void tesseract::MasterTrainer::ReplicateAndRandomizeSamplesIfRequired | ( | ) |
bool tesseract::MasterTrainer::Serialize | ( | FILE * | fp | ) | const |
|
inline |
void tesseract::MasterTrainer::SetupFlatShapeTable | ( | ShapeTable * | shape_table | ) |
CLUSTERER * tesseract::MasterTrainer::SetupForClustering | ( | const ShapeTable & | shape_table, |
const FEATURE_DEFS_STRUCT & | feature_defs, | ||
int | shape_id, | ||
int * | num_samples | ||
) |
void tesseract::MasterTrainer::SetupMasterShapes | ( | ) |
float tesseract::MasterTrainer::ShapeDistance | ( | const ShapeTable & | shapes, |
int | s1, | ||
int | s2 | ||
) |
double tesseract::MasterTrainer::TestClassifier | ( | CountTypes | error_mode, |
int | report_level, | ||
bool | replicate_samples, | ||
TrainingSampleSet * | samples, | ||
ShapeClassifier * | test_classifier, | ||
STRING * | report_string | ||
) |
void tesseract::MasterTrainer::TestClassifierOnSamples | ( | CountTypes | error_mode, |
int | report_level, | ||
bool | replicate_samples, | ||
ShapeClassifier * | test_classifier, | ||
STRING * | report_string | ||
) |
void tesseract::MasterTrainer::TestClassifierVOld | ( | bool | replicate_samples, |
ShapeClassifier * | test_classifier, | ||
ShapeClassifier * | old_classifier | ||
) |
|
inline |
void tesseract::MasterTrainer::WriteInttempAndPFFMTable | ( | const UNICHARSET & | unicharset, |
const UNICHARSET & | shape_set, | ||
const ShapeTable & | shape_table, | ||
CLASS_STRUCT * | float_classes, | ||
const char * | inttemp_file, | ||
const char * | pffmtable_file | ||
) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |