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

Method DisplayClassifyAs

deps/tesseract/classify/tessclassifier.cpp:68–83  ·  view source on GitHub ↗

Displays classification as the given shape_id. Creates as many windows as it feels fit, using index as a guide for placement. Adds any created windows to the windows output and returns a new index that may be used by any subsequent classifiers. Caller waits for the user to view and then destroys the windows by clearing the vector.

Source from the content-addressed store, hash-verified

66// by any subsequent classifiers. Caller waits for the user to view and
67// then destroys the windows by clearing the vector.
68int TessClassifier::DisplayClassifyAs(
69 const TrainingSample& sample, Pix* page_pix, int unichar_id, int index,
70 PointerVector<ScrollView>* windows) {
71 int shape_id = unichar_id;
72 // TODO(rays) Fix this so it works with both flat and real shapetables.
73 // if (GetShapeTable() != NULL)
74 // shape_id = BestShapeForUnichar(sample, page_pix, unichar_id, NULL);
75 if (shape_id < 0) return index;
76 if (UnusedClassIdIn(classify_->PreTrainedTemplates, shape_id)) {
77 tprintf("No built-in templates for class/shape %d\n", shape_id);
78 return index;
79 }
80 classify_->ShowBestMatchFor(shape_id, sample.features(),
81 sample.num_features());
82 return index;
83}
84
85} // namespace tesseract
86

Callers

nothing calls this directly

Calls 3

ShowBestMatchForMethod · 0.80
featuresMethod · 0.80
num_featuresMethod · 0.80

Tested by

no test coverage detected