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

Method GetCanonicalDist

deps/tesseract/classify/trainingsampleset.cpp:474–482  ·  view source on GitHub ↗

Gets the max distance for the given canonical sample. ComputeCanonicalSamples must have been called first.

Source from the content-addressed store, hash-verified

472// Gets the max distance for the given canonical sample.
473// ComputeCanonicalSamples must have been called first.
474float TrainingSampleSet::GetCanonicalDist(int font_id, int class_id) const {
475 ASSERT_HOST(font_class_array_ != NULL);
476 int font_index = font_id_map_.SparseToCompact(font_id);
477 if (font_index < 0) return 0.0f;
478 if ((*font_class_array_)(font_index, class_id).canonical_sample >= 0)
479 return (*font_class_array_)(font_index, class_id).canonical_dist;
480 else
481 return 0.0f;
482}
483
484// Generates indexed features for all samples with the supplied feature_space.
485void TrainingSampleSet::IndexFeatures(const IntFeatureSpace& feature_space) {

Callers

nothing calls this directly

Calls 1

SparseToCompactMethod · 0.45

Tested by

no test coverage detected