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

Method DisplaySamplesWithFeature

deps/tesseract/classify/trainingsampleset.cpp:840–858  ·  view source on GitHub ↗

Display the samples with the given indexed feature that also match the given shape.

Source from the content-addressed store, hash-verified

838// Display the samples with the given indexed feature that also match
839// the given shape.
840void TrainingSampleSet::DisplaySamplesWithFeature(int f_index,
841 const Shape& shape,
842 const IntFeatureSpace& space,
843 ScrollView::Color color,
844 ScrollView* window) const {
845 for (int s = 0; s < num_raw_samples(); ++s) {
846 const TrainingSample* sample = GetSample(s);
847 if (shape.ContainsUnichar(sample->class_id())) {
848 GenericVector<int> indexed_features;
849 space.IndexAndSortFeatures(sample->features(), sample->num_features(),
850 &indexed_features);
851 for (int f = 0; f < indexed_features.size(); ++f) {
852 if (indexed_features[f] == f_index) {
853 sample->DisplayFeatures(color, window);
854 }
855 }
856 }
857 }
858}
859
860
861} // namespace tesseract.

Callers 1

DisplaySamplesMethod · 0.80

Calls 7

ContainsUnicharMethod · 0.80
class_idMethod · 0.80
featuresMethod · 0.80
num_featuresMethod · 0.80
DisplayFeaturesMethod · 0.80
IndexAndSortFeaturesMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected