Displays classification as the given shape_id. Creates as many windows as it feels fit, using index as a guide for placement. Adds any created windows to the windows output and returns a new index that may be used by any subsequent classifiers. Caller waits for the user to view and then destroys the windows by clearing the vector.
| 66 | // by any subsequent classifiers. Caller waits for the user to view and |
| 67 | // then destroys the windows by clearing the vector. |
| 68 | int TessClassifier::DisplayClassifyAs( |
| 69 | const TrainingSample& sample, Pix* page_pix, int unichar_id, int index, |
| 70 | PointerVector<ScrollView>* windows) { |
| 71 | int shape_id = unichar_id; |
| 72 | // TODO(rays) Fix this so it works with both flat and real shapetables. |
| 73 | // if (GetShapeTable() != NULL) |
| 74 | // shape_id = BestShapeForUnichar(sample, page_pix, unichar_id, NULL); |
| 75 | if (shape_id < 0) return index; |
| 76 | if (UnusedClassIdIn(classify_->PreTrainedTemplates, shape_id)) { |
| 77 | tprintf("No built-in templates for class/shape %d\n", shape_id); |
| 78 | return index; |
| 79 | } |
| 80 | classify_->ShowBestMatchFor(shape_id, sample.features(), |
| 81 | sample.num_features()); |
| 82 | return index; |
| 83 | } |
| 84 | |
| 85 | } // namespace tesseract |
| 86 |
nothing calls this directly
no test coverage detected