Display the samples with the given indexed feature that also match the given shape.
| 838 | // Display the samples with the given indexed feature that also match |
| 839 | // the given shape. |
| 840 | void 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. |
no test coverage detected