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

Method MutableSample

deps/tesseract/classify/trainingsampleset.cpp:191–198  ·  view source on GitHub ↗

Get a sample by its font, class, index. Does not randomize. OrganizeByFontAndClass must have been already called.

Source from the content-addressed store, hash-verified

189// Get a sample by its font, class, index. Does not randomize.
190// OrganizeByFontAndClass must have been already called.
191TrainingSample* TrainingSampleSet::MutableSample(int font_id, int class_id,
192 int index) {
193 ASSERT_HOST(font_class_array_ != NULL);
194 int font_index = font_id_map_.SparseToCompact(font_id);
195 if (font_index < 0) return NULL;
196 int sample_index = (*font_class_array_)(font_index, class_id).samples[index];
197 return samples_[sample_index];
198}
199
200// Returns a string debug representation of the given sample:
201// font, unichar_str, bounding box, page.

Callers

nothing calls this directly

Calls 1

SparseToCompactMethod · 0.45

Tested by

no test coverage detected