tesseract v5.3.3.20231005
|
Public Member Functions | |
ClassPruner (int max_classes) | |
~ClassPruner () | |
void | ComputeScores (const INT_TEMPLATES_STRUCT *int_templates, int num_features, const INT_FEATURE_STRUCT *features) |
void | AdjustForExpectedNumFeatures (const uint16_t *expected_num_features, int cutoff_strength) |
void | DisableDisabledClasses (const UNICHARSET &unicharset) |
void | DisableFragments (const UNICHARSET &unicharset) |
void | NormalizeForXheight (int norm_multiplier, const uint8_t *normalization_factors) |
void | NoNormalization () |
void | PruneAndSort (int pruning_factor, int keep_this, bool max_of_non_fragments, const UNICHARSET &unicharset) |
void | DebugMatch (const Classify &classify, const INT_TEMPLATES_STRUCT *int_templates, const INT_FEATURE_STRUCT *features) const |
void | SummarizeResult (const Classify &classify, const INT_TEMPLATES_STRUCT *int_templates, const uint16_t *expected_num_features, int norm_multiplier, const uint8_t *normalization_factors) const |
int | SetupResults (std::vector< CP_RESULT_STRUCT > *results) const |
Definition at line 132 of file intmatcher.cpp.
|
inline |
Definition at line 134 of file intmatcher.cpp.
|
inline |
Definition at line 156 of file intmatcher.cpp.
|
inline |
Adjusts the scores according to the number of expected features. Used in lieu of a constant bias, this penalizes classes that expect more features than there are present. Thus an actual c will score higher for c than e, even though almost all the features match e as well as c, because e expects more features to be present.
Definition at line 235 of file intmatcher.cpp.
|
inline |
Computes the scores for every class in the character set, by summing the weights for each feature and stores the sums internally in class_count_.
Definition at line 165 of file intmatcher.cpp.
|
inline |
Prints debug info on the class pruner matches for the pruned classes only.
Definition at line 324 of file intmatcher.cpp.
|
inline |
Zeros the scores for classes disabled in the unicharset. Implements the black-list to recognize a subset of the character set.
Definition at line 247 of file intmatcher.cpp.
|
inline |
Zeros the scores of fragments.
Definition at line 256 of file intmatcher.cpp.
|
inline |
The nop normalization copies the class_count_ array to norm_count_.
Definition at line 278 of file intmatcher.cpp.
|
inline |
Normalizes the counts for xheight, putting the normalized result in norm_count_. Applies a simple subtractive penalty for incorrect vertical position provided by the normalization_factors array, indexed by character class, and scaled by the norm_multiplier.
Definition at line 270 of file intmatcher.cpp.
|
inline |
Prunes the classes using <the maximum count> * pruning_factor/256 as a threshold for keeping classes. If max_of_non_fragments, then ignore fragments in computing the maximum count.
Definition at line 287 of file intmatcher.cpp.
|
inline |
Copies the pruned, sorted classes into the output results and returns the number of classes.
Definition at line 374 of file intmatcher.cpp.
|
inline |
Prints a summary of the pruner result.
Definition at line 357 of file intmatcher.cpp.