21 #include "config_auto.h"
36 "Prioritize blob division over chopping", this->params()),
38 "Top choice only from CP", this->params()),
40 "Enable adaptive classifier", this->params()),
41 INT_MEMBER(classify_debug_level, 0,
"Classify debug level",
46 "Character Normalization Range ...", this->params()),
47 double_MEMBER(classify_min_norm_scale_x, 0.0,
"Min char x-norm scale ...",
49 double_MEMBER(classify_max_norm_scale_x, 0.325,
"Max char x-norm scale ...",
51 double_MEMBER(classify_min_norm_scale_y, 0.0,
"Min char y-norm scale ...",
53 double_MEMBER(classify_max_norm_scale_y, 0.325,
"Max char y-norm scale ...",
55 BOOL_MEMBER(tess_cn_matching, 0,
"Character Normalized Matching",
57 BOOL_MEMBER(tess_bn_matching, 0,
"Baseline Normalized Matching",
60 "Enable adaptive classifier",
63 "Use pre-adapted classifier templates", this->params()),
65 "Save adapted templates to a file", this->params()),
66 BOOL_MEMBER(classify_enable_adaptive_debugger, 0,
"Enable match debugger",
68 INT_MEMBER(matcher_debug_level, 0,
"Matcher Debug Level", this->params()),
69 INT_MEMBER(matcher_debug_flags, 0,
"Matcher Debug Flags", this->params()),
70 INT_MEMBER(classify_learning_debug_level, 0,
"Learning Debug Level: ",
72 double_MEMBER(matcher_good_threshold, 0.125,
"Good Match (0-1)",
74 double_MEMBER(matcher_great_threshold, 0.0,
"Great Match (0-1)",
76 double_MEMBER(matcher_perfect_threshold, 0.02,
"Perfect Match (0-1)",
78 double_MEMBER(matcher_bad_match_pad, 0.15,
"Bad Match Pad (0-1)",
80 double_MEMBER(matcher_rating_margin, 0.1,
"New template margin (0-1)",
82 double_MEMBER(matcher_avg_noise_size, 12.0,
"Avg. noise blob length",
84 INT_MEMBER(matcher_permanent_classes_min, 1,
"Min # of permanent classes",
86 INT_MEMBER(matcher_min_examples_for_prototyping, 3,
87 "Reliable Config Threshold", this->params()),
88 INT_MEMBER(matcher_sufficient_examples_for_prototyping, 5,
89 "Enable adaption even if the ambiguities have not been seen",
92 "Maximum angle delta for prototype clustering",
95 "Penalty to apply when a non-alnum is vertically out of "
96 "its expected textline position",
98 double_MEMBER(rating_scale, 1.5,
"Rating scaling factor", this->params()),
99 double_MEMBER(certainty_scale, 20.0,
"Certainty scaling factor",
102 "Scale factor for features not used", this->params()),
103 INT_MEMBER(classify_adapt_proto_threshold, 230,
104 "Threshold for good protos during adaptive 0-255",
106 INT_MEMBER(classify_adapt_feature_threshold, 230,
107 "Threshold for good features during adaptive 0-255",
110 "Do not include character fragments in the"
111 " results of the classifier", this->params()),
112 double_MEMBER(classify_character_fragments_garbage_certainty_threshold,
113 -3.0,
"Exclude fragments that do not look like whole"
114 " characters from training and adaption", this->params()),
116 "Bring up graphical debugging windows for fragments training",
119 "Use two different windows for debugging the matching: "
120 "One for the protos and one for the features.", this->params()),
121 STRING_MEMBER(classify_learn_debug_str,
"",
"Class str to debug learning",
123 INT_MEMBER(classify_class_pruner_threshold, 229,
124 "Class Pruner Threshold 0-255", this->params()),
125 INT_MEMBER(classify_class_pruner_multiplier, 30,
126 "Class Pruner Multiplier 0-255: ", this->params()),
128 "Class Pruner CutoffStrength: ", this->params()),
130 "Integer Matcher Multiplier 0-255: ", this->params()),
131 EnableLearning(true),
132 INT_MEMBER(il1_adaption_test, 0,
"Dont adapt to i/I at beginning of word",
135 "Assume the input is numbers [0-9].", this->params()),
156 AdaptiveMatcherCalls = 0;
157 BaselineClassifierCalls = 0;
158 CharNormClassifierCalls = 0;
159 AmbigClassifierCalls = 0;
160 NumWordsAdaptedTo = 0;
161 NumCharsAdaptedTo = 0;
162 NumBaselineClassesTried = 0;
163 NumCharNormClassesTried = 0;
164 NumAmbigClassesTried = 0;
165 NumClassesOutput = 0;
166 NumAdaptationsFailed = 0;
168 FeaturesHaveBeenExtracted =
false;
170 learn_debug_win_ =
NULL;
171 learn_fragmented_word_debug_win_ =
NULL;
172 learn_fragments_debug_win_ =
NULL;
180 delete learn_debug_win_;
181 delete learn_fragmented_word_debug_win_;
182 delete learn_fragments_debug_win_;
183 delete[] CharNormCutoffs;
184 delete[] BaselineCutoffs;