21 #ifdef DISABLED_LEGACY_ENGINE
29 INT_MEMBER(classify_debug_level, 0,
"Classify debug level",
33 "Assume the input is numbers [0-9].", this->params()),
36 "Veto ratio between classifier ratings", this->params()),
39 "Veto difference between classifier certainties",
48 #else // DISABLED_LEGACY_ENGINE not defined
61 :
BOOL_MEMBER(allow_blob_division, true,
"Use divisible blobs chopping",
64 "Prioritize blob division over chopping", this->params()),
65 BOOL_MEMBER(classify_enable_learning, true,
"Enable adaptive classifier",
67 INT_MEMBER(classify_debug_level, 0,
"Classify debug level",
72 "Character Normalization Range ...", this->params()),
74 "Veto ratio between classifier ratings", this->params()),
76 "Veto difference between classifier certainties",
78 BOOL_MEMBER(tess_cn_matching, 0,
"Character Normalized Matching",
80 BOOL_MEMBER(tess_bn_matching, 0,
"Baseline Normalized Matching",
83 "Enable adaptive classifier", this->params()),
85 "Use pre-adapted classifier templates", this->params()),
87 "Save adapted templates to a file", this->params()),
88 BOOL_MEMBER(classify_enable_adaptive_debugger, 0,
"Enable match debugger",
91 "Non-linear stroke-density normalization", this->params()),
92 INT_MEMBER(matcher_debug_level, 0,
"Matcher Debug Level", this->params()),
93 INT_MEMBER(matcher_debug_flags, 0,
"Matcher Debug Flags", this->params()),
94 INT_MEMBER(classify_learning_debug_level, 0,
"Learning Debug Level: ",
96 double_MEMBER(matcher_good_threshold, 0.125,
"Good Match (0-1)",
98 double_MEMBER(matcher_reliable_adaptive_result, 0.0,
"Great Match (0-1)",
100 double_MEMBER(matcher_perfect_threshold, 0.02,
"Perfect Match (0-1)",
102 double_MEMBER(matcher_bad_match_pad, 0.15,
"Bad Match Pad (0-1)",
104 double_MEMBER(matcher_rating_margin, 0.1,
"New template margin (0-1)",
106 double_MEMBER(matcher_avg_noise_size, 12.0,
"Avg. noise blob length",
108 INT_MEMBER(matcher_permanent_classes_min, 1,
"Min # of permanent classes",
110 INT_MEMBER(matcher_min_examples_for_prototyping, 3,
111 "Reliable Config Threshold", this->params()),
112 INT_MEMBER(matcher_sufficient_examples_for_prototyping, 5,
113 "Enable adaption even if the ambiguities have not been seen",
116 "Maximum angle delta for prototype clustering",
119 "Penalty to apply when a non-alnum is vertically out of "
120 "its expected textline position",
122 double_MEMBER(rating_scale, 1.5,
"Rating scaling factor", this->params()),
123 double_MEMBER(certainty_scale, 20.0,
"Certainty scaling factor",
126 "Scale factor for features not used", this->params()),
128 classify_adapted_pruning_factor, 2.5,
129 "Prune poor adapted results this much worse than best result",
132 "Threshold at which classify_adapted_pruning_factor starts",
134 INT_MEMBER(classify_adapt_proto_threshold, 230,
135 "Threshold for good protos during adaptive 0-255",
137 INT_MEMBER(classify_adapt_feature_threshold, 230,
138 "Threshold for good features during adaptive 0-255",
141 "Do not include character fragments in the"
142 " results of the classifier",
144 double_MEMBER(classify_character_fragments_garbage_certainty_threshold,
146 "Exclude fragments that do not look like whole"
147 " characters from training and adaption",
149 BOOL_MEMBER(classify_debug_character_fragments, false,
150 "Bring up graphical debugging windows for fragments training",
153 "Use two different windows for debugging the matching: "
154 "One for the protos and one for the features.",
156 STRING_MEMBER(classify_learn_debug_str,
"",
"Class str to debug learning",
158 INT_MEMBER(classify_class_pruner_threshold, 229,
159 "Class Pruner Threshold 0-255", this->params()),
160 INT_MEMBER(classify_class_pruner_multiplier, 15,
161 "Class Pruner Multiplier 0-255: ", this->params()),
163 "Class Pruner CutoffStrength: ", this->params()),
165 "Integer Matcher Multiplier 0-255: ", this->params()),
167 "Assume the input is numbers [0-9].", this->params()),
168 double_MEMBER(speckle_large_max_size, 0.30,
"Max large speckle size",
171 "Penalty to add to worst rating for noise", this->params()),
172 im_(&classify_debug_level),
174 using namespace std::placeholders;
185 delete learn_debug_win_;
186 delete learn_fragmented_word_debug_win_;
187 delete learn_fragments_debug_win_;
194 delete static_classifier_;
195 static_classifier_ = static_classifier;
202 BLOB_CHOICE_IT bc_it(choices);
207 if (!choices->empty() && blob_length > 0) {
208 bc_it.move_to_last();
218 -1, 0.0f, FLT_MAX, 0,
220 bc_it.add_to_end(blob_choice);
227 return bbox.
width() < speckle_size && bbox.
height() < speckle_size;
232 #endif // def DISABLED_LEGACY_ENGINE