Gets the max distance for the given canonical sample. ComputeCanonicalSamples must have been called first.
| 472 | // Gets the max distance for the given canonical sample. |
| 473 | // ComputeCanonicalSamples must have been called first. |
| 474 | float TrainingSampleSet::GetCanonicalDist(int font_id, int class_id) const { |
| 475 | ASSERT_HOST(font_class_array_ != NULL); |
| 476 | int font_index = font_id_map_.SparseToCompact(font_id); |
| 477 | if (font_index < 0) return 0.0f; |
| 478 | if ((*font_class_array_)(font_index, class_id).canonical_sample >= 0) |
| 479 | return (*font_class_array_)(font_index, class_id).canonical_dist; |
| 480 | else |
| 481 | return 0.0f; |
| 482 | } |
| 483 | |
| 484 | // Generates indexed features for all samples with the supplied feature_space. |
| 485 | void TrainingSampleSet::IndexFeatures(const IntFeatureSpace& feature_space) { |
nothing calls this directly
no test coverage detected