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

Method GlobalSampleIndex

deps/tesseract/classify/trainingsampleset.cpp:452–458  ·  view source on GitHub ↗

Returns the total index of the requested sample. OrganizeByFontAndClass must have been already called.

Source from the content-addressed store, hash-verified

450// Returns the total index of the requested sample.
451// OrganizeByFontAndClass must have been already called.
452int TrainingSampleSet::GlobalSampleIndex(int font_id, int class_id,
453 int index) const {
454 ASSERT_HOST(font_class_array_ != NULL);
455 int font_index = font_id_map_.SparseToCompact(font_id);
456 if (font_index < 0) return -1;
457 return (*font_class_array_)(font_index, class_id).samples[index];
458}
459
460// Gets the canonical sample for the given font, class pair.
461// ComputeCanonicalSamples must have been called first.

Callers

nothing calls this directly

Calls 1

SparseToCompactMethod · 0.45

Tested by

no test coverage detected