36 :
BOOL_MEMBER(allow_blob_division, true,
"Use divisible blobs chopping",
39 "Prioritize blob division over chopping", this->params()),
42 BOOL_MEMBER(classify_enable_learning, true,
"Enable adaptive classifier",
44 INT_MEMBER(classify_debug_level, 0,
"Classify debug level",
49 "Character Normalization Range ...", this->params()),
50 double_MEMBER(classify_min_norm_scale_x, 0.0,
"Min char x-norm scale ...",
53 "Max char x-norm scale ...",
55 double_MEMBER(classify_min_norm_scale_y, 0.0,
"Min char y-norm scale ...",
58 "Max char y-norm scale ...",
61 "Veto ratio between classifier ratings", this->params()),
63 "Veto difference between classifier certainties",
65 BOOL_MEMBER(tess_cn_matching, 0,
"Character Normalized Matching",
67 BOOL_MEMBER(tess_bn_matching, 0,
"Baseline Normalized Matching",
70 "Enable adaptive classifier", this->params()),
72 "Use pre-adapted classifier templates", this->params()),
74 "Save adapted templates to a file", this->params()),
75 BOOL_MEMBER(classify_enable_adaptive_debugger, 0,
"Enable match debugger",
78 "Non-linear stroke-density normalization", this->params()),
79 INT_MEMBER(matcher_debug_level, 0,
"Matcher Debug Level", this->params()),
80 INT_MEMBER(matcher_debug_flags, 0,
"Matcher Debug Flags", this->params()),
81 INT_MEMBER(classify_learning_debug_level, 0,
"Learning Debug Level: ",
83 double_MEMBER(matcher_good_threshold, 0.125,
"Good Match (0-1)",
85 double_MEMBER(matcher_reliable_adaptive_result, 0.0,
"Great Match (0-1)",
87 double_MEMBER(matcher_perfect_threshold, 0.02,
"Perfect Match (0-1)",
89 double_MEMBER(matcher_bad_match_pad, 0.15,
"Bad Match Pad (0-1)",
91 double_MEMBER(matcher_rating_margin, 0.1,
"New template margin (0-1)",
93 double_MEMBER(matcher_avg_noise_size, 12.0,
"Avg. noise blob length",
95 INT_MEMBER(matcher_permanent_classes_min, 1,
"Min # of permanent classes",
97 INT_MEMBER(matcher_min_examples_for_prototyping, 3,
98 "Reliable Config Threshold", this->params()),
99 INT_MEMBER(matcher_sufficient_examples_for_prototyping, 5,
100 "Enable adaption even if the ambiguities have not been seen",
103 "Maximum angle delta for prototype clustering",
106 "Penalty to apply when a non-alnum is vertically out of " 107 "its expected textline position",
109 double_MEMBER(rating_scale, 1.5,
"Rating scaling factor", this->params()),
110 double_MEMBER(certainty_scale, 20.0,
"Certainty scaling factor",
113 "Scale factor for features not used", this->params()),
115 classify_adapted_pruning_factor, 2.5,
116 "Prune poor adapted results this much worse than best result",
119 "Threshold at which classify_adapted_pruning_factor starts",
121 INT_MEMBER(classify_adapt_proto_threshold, 230,
122 "Threshold for good protos during adaptive 0-255",
124 INT_MEMBER(classify_adapt_feature_threshold, 230,
125 "Threshold for good features during adaptive 0-255",
128 "Do not include character fragments in the" 129 " results of the classifier",
131 double_MEMBER(classify_character_fragments_garbage_certainty_threshold,
133 "Exclude fragments that do not look like whole" 134 " characters from training and adaption",
137 "Bring up graphical debugging windows for fragments training",
140 "Use two different windows for debugging the matching: " 141 "One for the protos and one for the features.",
143 STRING_MEMBER(classify_learn_debug_str,
"",
"Class str to debug learning",
145 INT_MEMBER(classify_class_pruner_threshold, 229,
146 "Class Pruner Threshold 0-255", this->params()),
147 INT_MEMBER(classify_class_pruner_multiplier, 15,
148 "Class Pruner Multiplier 0-255: ", this->params()),
150 "Class Pruner CutoffStrength: ", this->params()),
152 "Integer Matcher Multiplier 0-255: ", this->params()),
153 EnableLearning(true),
155 "Don't adapt to i/I at beginning of word", this->params()),
157 "Assume the input is numbers [0-9].", this->params()),
158 double_MEMBER(speckle_large_max_size, 0.30,
"Max large speckle size",
161 "Penalty to add to worst rating for noise", this->params()),
164 static_classifier_(NULL) {
182 NumAdaptationsFailed = 0;
184 learn_debug_win_ = NULL;
185 learn_fragmented_word_debug_win_ = NULL;
186 learn_fragments_debug_win_ = NULL;
194 delete learn_debug_win_;
195 delete learn_fragmented_word_debug_win_;
196 delete learn_fragments_debug_win_;
197 delete[] CharNormCutoffs;
198 delete[] BaselineCutoffs;
205 delete static_classifier_;
206 static_classifier_ = static_classifier;
213 BLOB_CHOICE_IT bc_it(choices);
218 if (!choices->empty() && blob_length > 0) {
219 bc_it.move_to_last();
231 bc_it.add_to_end(blob_choice);
238 return bbox.
width() < speckle_size && bbox.
height() < speckle_size;
UnicityTable< FontSet > fontset_table_
bool LargeSpeckle(const TBLOB &blob)
ADAPT_TEMPLATES AdaptedTemplates
_ConstTessMemberResultCallback_0_0< false, R, T1 >::base * NewPermanentTessCallback(const T1 *obj, R(T2::*member)() const)
void FontInfoDeleteCallback(FontInfo f)
void FontSetDeleteCallback(FontSet fs)
#define STRING_MEMBER(name, val, comment, vec)
INT_TEMPLATES PreTrainedTemplates
bool disable_character_fragments
TBOX bounding_box() const
int classify_integer_matcher_multiplier
UnicityTable< FontInfo > fontinfo_table_
bool CompareFontSet(const FontSet &fs1, const FontSet &fs2)
#define BOOL_MEMBER(name, val, comment, vec)
#define INT_MEMBER(name, val, comment, vec)
#define double_MEMBER(name, val, comment, vec)
void AddLargeSpeckleTo(int blob_length, BLOB_CHOICE_LIST *choices)
void EndAdaptiveClassifier()
bool CompareFontInfo(const FontInfo &fi1, const FontInfo &fi2)
double speckle_large_max_size
void SetStaticClassifier(ShapeClassifier *static_classifier)
ADAPT_TEMPLATES BackupAdaptedTemplates
double speckle_rating_penalty