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

Method UniformSamples

deps/tesseract/classify/sampleiterator.cpp:220–229  ·  view source on GitHub ↗

Adjust the weights of all the samples to be uniform in the given charset. Returns the number of samples in the iterator.

Source from the content-addressed store, hash-verified

218// Adjust the weights of all the samples to be uniform in the given charset.
219// Returns the number of samples in the iterator.
220int SampleIterator::UniformSamples() {
221 int num_good_samples = 0;
222 for (Begin(); !AtEnd(); Next()) {
223 TrainingSample* sample = MutableSample();
224 sample->set_weight(1.0);
225 ++num_good_samples;
226 }
227 NormalizeSamples();
228 return num_good_samples;
229}
230
231// Normalize the weights of all the samples in the charset_map so they sum
232// to 1. Returns the minimum assigned sample weight.

Callers

nothing calls this directly

Calls 1

set_weightMethod · 0.80

Tested by

no test coverage detected