tesseract
5.0.0-alpha-619-ge9db
|
Go to the documentation of this file.
22 #ifndef TESSERACT_TRAINING_MASTERTRAINER_H_
23 #define TESSERACT_TRAINING_MASTERTRAINER_H_
47 class ShapeClassifier;
72 bool replicate_samples,
int debug_level);
84 feature_map_.
Init(fs);
96 void AddSample(
bool verification,
const char* unichar_str,
163 return tr_filenames_[index];
173 int shape_id,
int* num_samples);
183 const char* inttemp_file,
184 const char* pffmtable_file);
193 return master_shapes_;
198 void DebugCanonical(
const char* unichar_str1,
const char* unichar_str2);
199 #ifndef GRAPHICS_DISABLED
211 const char* unichar_str2,
int canonical_font);
212 #endif // GRAPHICS_DISABLED
222 bool replicate_samples,
240 bool replicate_samples,
253 void ReplaceFragmentedSamples();
260 void ClusterShapes(
int min_shapes,
int max_shape_unichars,
287 bool enable_shape_analysis_;
289 bool enable_replication_;
293 int prev_unichar_id_;
309 #endif // TESSERACT_TRAINING_MASTERTRAINER_H_
CLUSTERER * SetupForClustering(const ShapeTable &shape_table, const FEATURE_DEFS_STRUCT &feature_defs, int shape_id, int *num_samples)
bool Serialize(FILE *fp) const
const ShapeTable & master_shapes() const
void LoadUnicharset(const char *filename)
void AddSample(bool verification, const char *unichar_str, TrainingSample *sample)
MasterTrainer(NormalizationMode norm_mode, bool shape_analysis, bool replicate_samples, int debug_level)
const STRING & GetTRFileName(int index) const
void Init(const IntFeatureSpace &feature_space)
void SetFeatureSpace(const IntFeatureSpace &fs)
double TestClassifier(CountTypes error_mode, int report_level, bool replicate_samples, TrainingSampleSet *samples, ShapeClassifier *test_classifier, STRING *report_string)
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)
void DisplaySamples(const char *unichar_str1, int cloud_font, const char *unichar_str2, int canonical_font)
bool AddSpacingInfo(const char *filename)
int GetFontInfoId(const char *font_name)
bool LoadFontInfo(const char *filename)
const UNICHARSET & unicharset() const
int GetBestMatchingFontInfoId(const char *filename)
void ReadTrainingSamples(const char *page_name, const FEATURE_DEFS_STRUCT &feature_defs, bool verification)
bool operator<(const ShapeDist &other) const
FEATURE_DEFS_STRUCT feature_defs
float ShapeDistance(const ShapeTable &shapes, int s1, int s2)
bool LoadXHeights(const char *filename)
void TestClassifierVOld(bool replicate_samples, ShapeClassifier *test_classifier, ShapeClassifier *old_classifier)
void DebugCanonical(const char *unichar_str1, const char *unichar_str2)
void ReplicateAndRandomizeSamplesIfRequired()
void SetupFlatShapeTable(ShapeTable *shape_table)
void LoadPageImages(const char *filename)
const UNICHARSET & unicharset() const
ShapeDist(int s1, int s2, float dist)
TrainingSampleSet * GetSamples()
void TestClassifierOnSamples(CountTypes error_mode, int report_level, bool replicate_samples, ShapeClassifier *test_classifier, STRING *report_string)