|
Tesseract
3.02
|
#include <equationdetectbase.h>
Public Member Functions | |
| EquationDetectBase () | |
| virtual | ~EquationDetectBase () |
| virtual int | LabelSpecialText (TO_BLOCK *to_block)=0 |
| virtual int | FindEquationParts (ColPartitionGrid *part_grid, ColPartitionSet **best_columns)=0 |
Static Public Member Functions | |
| static void | RenderSpecialText (Pix *pix, BLOBNBOX *blob) |
Definition at line 32 of file equationdetectbase.h.
| tesseract::EquationDetectBase::EquationDetectBase | ( | ) |
Definition at line 26 of file equationdetectbase.cpp.
{
}
| tesseract::EquationDetectBase::~EquationDetectBase | ( | ) | [virtual] |
Definition at line 29 of file equationdetectbase.cpp.
{
}
| virtual int tesseract::EquationDetectBase::FindEquationParts | ( | ColPartitionGrid * | part_grid, |
| ColPartitionSet ** | best_columns | ||
| ) | [pure virtual] |
Implemented in tesseract::EquationDetect.
| virtual int tesseract::EquationDetectBase::LabelSpecialText | ( | TO_BLOCK * | to_block | ) | [pure virtual] |
Implemented in tesseract::EquationDetect.
| void tesseract::EquationDetectBase::RenderSpecialText | ( | Pix * | pix, |
| BLOBNBOX * | blob | ||
| ) | [static] |
Definition at line 32 of file equationdetectbase.cpp.
{
ASSERT_HOST(pix != NULL && pixGetDepth(pix) == 32 && blob != NULL);
const TBOX& tbox = blob->bounding_box();
int height = pixGetHeight(pix);
const int box_width = 5;
// Coordinate translation: tesseract use left bottom as the original, while
// leptonica uses left top as the original.
Box *box = boxCreate(tbox.left(), height - tbox.top(),
tbox.width(), tbox.height());
switch (blob->special_text_type()) {
case BSTT_MATH: // Red box.
pixRenderBoxArb(pix, box, box_width, 255, 0, 0);
break;
case BSTT_DIGIT: // cyan box.
pixRenderBoxArb(pix, box, box_width, 0, 255, 255);
break;
case BSTT_ITALIC: // Green box.
pixRenderBoxArb(pix, box, box_width, 0, 255, 0);
break;
case BSTT_UNCLEAR: // blue box.
pixRenderBoxArb(pix, box, box_width, 0, 255, 0);
break;
case BSTT_NONE:
default:
// yellow box.
pixRenderBoxArb(pix, box, box_width, 255, 255, 0);
break;
}
boxDestroy(&box);
}