Tesseract 3.02

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions
tesseract::EquationDetectBase Class Reference

`#include <equationdetectbase.h>`

Inheritance diagram for tesseract::EquationDetectBase:

List of all members.

## 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)

## Detailed Description

Definition at line 32 of file equationdetectbase.h.

## Constructor & Destructor Documentation

tesseract::EquationDetectBase::EquationDetectBase | ( |  | ) |

Definition at line 26 of file equationdetectbase.cpp.

{
}

tesseract::EquationDetectBase::~EquationDetectBase | ( |  | ) |

virtual

Definition at line 29 of file equationdetectbase.cpp.

{
}

## Member Function Documentation

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);
}

The documentation for this class was generated from the following files:

- /mnt/data/src/tesseract-ocr/textord/equationdetectbase.h
- /mnt/data/src/tesseract-ocr/textord/equationdetectbase.cpp