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

Method CharNormClassifier

deps/tesseract/classify/adaptmatch.cpp:1355–1369  ·  view source on GitHub ↗

---------------------------------------------------------------------------*/ * This routine extracts character normalized features * from the unknown character and matches them against the * specified set of templates. The classes which match * are added to Results. * * @param blob blob to be classified * @param sample templates to classify unknown against * @param adapt_results place to

Source from the content-addressed store, hash-verified

1353 * @note History: Tue Mar 12 16:02:52 1991, DSJ, Created.
1354 */
1355int Classify::CharNormClassifier(TBLOB *blob,
1356 const TrainingSample& sample,
1357 ADAPT_RESULTS *adapt_results) {
1358 // This is the length that is used for scaling ratings vs certainty.
1359 adapt_results->BlobLength =
1360 IntCastRounded(sample.outline_length() / kStandardFeatureLength);
1361 GenericVector<UnicharRating> unichar_results;
1362 static_classifier_->UnicharClassifySample(sample, blob->denorm().pix(), 0,
1363 -1, &unichar_results);
1364 // Convert results to the format used internally by AdaptiveClassifier.
1365 for (int r = 0; r < unichar_results.size(); ++r) {
1366 AddNewResult(unichar_results[r], adapt_results);
1367 }
1368 return sample.num_features();
1369} /* CharNormClassifier */
1370
1371// As CharNormClassifier, but operates on a TrainingSample and outputs to
1372// a GenericVector of ShapeRating without conversion to classes.

Callers

nothing calls this directly

Calls 7

IntCastRoundedFunction · 0.85
outline_lengthMethod · 0.80
pixMethod · 0.80
denormMethod · 0.80
num_featuresMethod · 0.80
UnicharClassifySampleMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected