#include <cubeclassifier.h>
Definition at line 57 of file cubeclassifier.h.
Definition at line 79 of file cubeclassifier.cpp.
82 pruner_(
new TessClassifier(
true, tesseract)) {
CubeRecoContext * GetCubeRecoContext()
const ShapeTable * shape_table() const
| tesseract::CubeTessClassifier::~CubeTessClassifier |
( |
| ) |
|
|
virtual |
Implements tesseract::ShapeClassifier.
Definition at line 90 of file cubeclassifier.cpp.
95 if (page_pix ==
NULL)
return num_results;
100 cube_cntxt_, page_pix, char_box.
left(),
101 pixGetHeight(page_pix) - char_box.
top(),
105 if (alt_list !=
NULL) {
106 for (
int r = 0; r < num_results; ++r) {
107 const Shape& shape = shape_table_.
GetShape((*results)[r].shape_id);
109 double best_prob = 0.0;
110 for (
int i = 0; i < alt_list->AltCount(); ++i) {
111 int alt_id = alt_list->Alt(i);
112 int unichar_id = char_set->UnicharID(char_set->ClassString(alt_id));
113 if (shape.ContainsUnichar(unichar_id) &&
114 alt_list->AltProb(i) > best_prob) {
115 best_prob = alt_list->AltProb(i);
118 (*results)[r].rating = best_prob;
125 return results->
size();
const Shape & GetShape(int shape_id) const
virtual int ClassifySample(const TrainingSample &sample, Pix *page_pix, int debug, int keep_this, GenericVector< ShapeRating > *results)
static int SortDescendingRating(const void *t1, const void *t2)
CharAltList * RecognizeChar()
CharSet * CharacterSet() const
| const ShapeTable * tesseract::CubeTessClassifier::GetShapeTable |
( |
| ) |
const |
|
virtual |
The documentation for this class was generated from the following files: