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

Method UnicharClassifySample

deps/tesseract/classify/tessclassifier.cpp:31–51  ·  view source on GitHub ↗

Classifies the given [training] sample, writing to results. See ShapeClassifier for a full description.

Source from the content-addressed store, hash-verified

29// Classifies the given [training] sample, writing to results.
30// See ShapeClassifier for a full description.
31int TessClassifier::UnicharClassifySample(
32 const TrainingSample& sample, Pix* page_pix, int debug,
33 UNICHAR_ID keep_this, GenericVector<UnicharRating>* results) {
34 int old_matcher_level = classify_->matcher_debug_level;
35 int old_matcher_flags = classify_->matcher_debug_flags;
36 int old_classify_level = classify_->classify_debug_level;
37 if (debug) {
38 // Explicitly set values of various control parameters to generate debug
39 // output if required, restoring the old values after classifying.
40 classify_->matcher_debug_level.set_value(2);
41 classify_->matcher_debug_flags.set_value(25);
42 classify_->classify_debug_level.set_value(3);
43 }
44 classify_->CharNormTrainingSample(pruner_only_, keep_this, sample, results);
45 if (debug) {
46 classify_->matcher_debug_level.set_value(old_matcher_level);
47 classify_->matcher_debug_flags.set_value(old_matcher_flags);
48 classify_->classify_debug_level.set_value(old_classify_level);
49 }
50 return results->size();
51}
52
53// Provides access to the ShapeTable that this classifier works with.
54const ShapeTable* TessClassifier::GetShapeTable() const {

Callers 3

ComputeErrorRateMethod · 0.45
DebugNewErrorsMethod · 0.45
CharNormClassifierMethod · 0.45

Calls 3

set_valueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected