36 : cube_cntxt_(
tesseract->GetCubeRecoContext()),
48 if (page_pix == NULL)
return 0;
53 cube_cntxt_, page_pix, char_box.
left(),
54 pixGetHeight(page_pix) - char_box.
top(),
57 if (alt_list != NULL) {
60 for (
int i = 0; i < alt_list->AltCount(); ++i) {
62 int alt_id = alt_list->Alt(i);
70 return results->
size();
79 : cube_cntxt_(
tesseract->GetCubeRecoContext()),
94 if (page_pix == NULL)
return num_results;
99 cube_cntxt_, page_pix, char_box.
left(),
100 pixGetHeight(page_pix) - char_box.
top(),
104 if (alt_list != NULL) {
105 for (
int r = 0; r < num_results; ++r) {
107 double best_prob = 0.0;
108 for (
int i = 0; i < alt_list->AltCount(); ++i) {
109 int alt_id = alt_list->Alt(i);
111 if (unichar_id == (*results)[r].unichar_id &&
112 alt_list->AltProb(i) > best_prob) {
113 best_prob = alt_list->AltProb(i);
116 (*results)[r].rating = best_prob;
123 return results->
size();
128 return &shape_table_;
virtual ~CubeClassifier()
int UnicharID(const char_32 *str) const
virtual const ShapeTable * GetShapeTable() const
virtual int UnicharClassifySample(const TrainingSample &sample, Pix *page_pix, int debug, UNICHAR_ID keep_this, GenericVector< UnicharRating > *results)
CharAltList * RecognizeChar()
CubeTessClassifier(Tesseract *tesseract)
CharSet * CharacterSet() const
virtual ~CubeTessClassifier()
virtual const ShapeTable * GetShapeTable() const
virtual int UnicharClassifySample(const TrainingSample &sample, Pix *page_pix, int debug, UNICHAR_ID keep_this, GenericVector< UnicharRating > *results)
static int SortDescendingRating(const void *t1, const void *t2)
virtual int UnicharClassifySample(const TrainingSample &sample, Pix *page_pix, int debug, UNICHAR_ID keep_this, GenericVector< UnicharRating > *results)
const char_32 * ClassString(int class_id) const
CubeClassifier(Tesseract *tesseract)