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),
173 shape_table_(nullptr),
175 static_classifier_(nullptr) {
193 NumAdaptationsFailed = 0;
195 learn_debug_win_ =
nullptr;
196 learn_fragmented_word_debug_win_ =
nullptr;
197 learn_fragments_debug_win_ =
nullptr;
203 delete learn_debug_win_;
204 delete learn_fragmented_word_debug_win_;
205 delete learn_fragments_debug_win_;
212 delete static_classifier_;
213 static_classifier_ = static_classifier;
220 BLOB_CHOICE_IT bc_it(choices);
225 if (!choices->empty() && blob_length > 0) {
226 bc_it.move_to_last();
236 -1, 0.0f, FLT_MAX, 0,
238 bc_it.add_to_end(blob_choice);
245 return bbox.
width() < speckle_size && bbox.
height() < speckle_size;
250 #endif // def DISABLED_LEGACY_ENGINE
#define BOOL_MEMBER(name, val, comment, vec)
void AddLargeSpeckleTo(int blob_length, BLOB_CHOICE_LIST *choices)
UnicityTable< FontSet > fontset_table_
double speckle_large_max_size
UnicityTable< FontInfo > fontinfo_table_
void EndAdaptiveClassifier()
#define INT_MEMBER(name, val, comment, vec)
double speckle_rating_penalty
bool LargeSpeckle(const TBLOB &blob)
INT_TEMPLATES PreTrainedTemplates
void FontSetDeleteCallback(FontSet fs)
bool CompareFontSet(const FontSet &fs1, const FontSet &fs2)
ADAPT_TEMPLATES BackupAdaptedTemplates
FEATURE_DEFS_STRUCT feature_defs_
ADAPT_TEMPLATES AdaptedTemplates
#define STRING_MEMBER(name, val, comment, vec)
#define double_MEMBER(name, val, comment, vec)
_ConstTessMemberResultCallback_5_0< false, R, T1, P1, P2, P3, P4, P5 >::base * NewPermanentTessCallback(const T1 *obj, R(T2::*member)(P1, P2, P3, P4, P5) const, typename Identity< P1 >::type p1, typename Identity< P2 >::type p2, typename Identity< P3 >::type p3, typename Identity< P4 >::type p4, typename Identity< P5 >::type p5)
void FontInfoDeleteCallback(FontInfo f)
bool disable_character_fragments
void InitFeatureDefs(FEATURE_DEFS_STRUCT *featuredefs)
TBOX bounding_box() const
int classify_integer_matcher_multiplier
void SetStaticClassifier(ShapeClassifier *static_classifier)
bool CompareFontInfo(const FontInfo &fi1, const FontInfo &fi2)