MCPcopy Create free account
hub / github.com/creatale/node-dv / ShowBestMatchFor

Method ShowBestMatchFor

deps/tesseract/classify/adaptmatch.cpp:2234–2267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2232 */
2233
2234void Classify::ShowBestMatchFor(int shape_id,
2235 const INT_FEATURE_STRUCT* features,
2236 int num_features) {
2237#ifndef GRAPHICS_DISABLED
2238 uinT32 config_mask;
2239 if (UnusedClassIdIn(PreTrainedTemplates, shape_id)) {
2240 tprintf("No built-in templates for class/shape %d\n", shape_id);
2241 return;
2242 }
2243 if (num_features <= 0) {
2244 tprintf("Illegal blob (char norm features)!\n");
2245 return;
2246 }
2247 UnicharRating cn_result;
2248 classify_norm_method.set_value(character);
2249 im_.Match(ClassForClassId(PreTrainedTemplates, shape_id),
2250 AllProtosOn, AllConfigsOn,
2251 num_features, features, &cn_result,
2252 classify_adapt_feature_threshold, NO_DEBUG,
2253 matcher_debug_separate_windows);
2254 tprintf("\n");
2255 config_mask = 1 << cn_result.config;
2256
2257 tprintf("Static Shape ID: %d\n", shape_id);
2258 ShowMatchDisplay();
2259 im_.Match(ClassForClassId(PreTrainedTemplates, shape_id),
2260 AllProtosOn, reinterpret_cast<BIT_VECTOR>(&config_mask),
2261 num_features, features, &cn_result,
2262 classify_adapt_feature_threshold,
2263 matcher_debug_flags,
2264 matcher_debug_separate_windows);
2265 UpdateMatchDisplay();
2266#endif // GRAPHICS_DISABLED
2267} /* ShowBestMatchFor */
2268
2269// Returns a string for the classifier class_id: either the corresponding
2270// unicharset debug_str or the shape_table_ debug str.

Callers 1

DisplayClassifyAsMethod · 0.80

Calls 3

UpdateMatchDisplayFunction · 0.85
MatchMethod · 0.80
set_valueMethod · 0.45

Tested by

no test coverage detected