tesseract  4.00.00dev
tesseract::EquationDetectBase Class Referenceabstract

#include <equationdetectbase.h>

Inheritance diagram for tesseract::EquationDetectBase:
tesseract::EquationDetect

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

◆ EquationDetectBase()

tesseract::EquationDetectBase::EquationDetectBase ( )

Definition at line 26 of file equationdetectbase.cpp.

26  {
27 }

◆ ~EquationDetectBase()

tesseract::EquationDetectBase::~EquationDetectBase ( )
virtual

Definition at line 29 of file equationdetectbase.cpp.

29  {
30 }

Member Function Documentation

◆ FindEquationParts()

virtual int tesseract::EquationDetectBase::FindEquationParts ( ColPartitionGrid part_grid,
ColPartitionSet **  best_columns 
)
pure virtual

Implemented in tesseract::EquationDetect.

◆ LabelSpecialText()

virtual int tesseract::EquationDetectBase::LabelSpecialText ( TO_BLOCK to_block)
pure virtual

Implemented in tesseract::EquationDetect.

◆ RenderSpecialText()

void tesseract::EquationDetectBase::RenderSpecialText ( Pix *  pix,
BLOBNBOX blob 
)
static

Definition at line 32 of file equationdetectbase.cpp.

33  {
34  ASSERT_HOST(pix != NULL && pixGetDepth(pix) == 32 && blob != NULL);
35  const TBOX& tbox = blob->bounding_box();
36  int height = pixGetHeight(pix);
37  const int box_width = 5;
38 
39  // Coordinate translation: tesseract use left bottom as the original, while
40  // leptonica uses left top as the original.
41  Box *box = boxCreate(tbox.left(), height - tbox.top(),
42  tbox.width(), tbox.height());
43  switch (blob->special_text_type()) {
44  case BSTT_MATH: // Red box.
45  pixRenderBoxArb(pix, box, box_width, 255, 0, 0);
46  break;
47  case BSTT_DIGIT: // cyan box.
48  pixRenderBoxArb(pix, box, box_width, 0, 255, 255);
49  break;
50  case BSTT_ITALIC: // Green box.
51  pixRenderBoxArb(pix, box, box_width, 0, 255, 0);
52  break;
53  case BSTT_UNCLEAR: // blue box.
54  pixRenderBoxArb(pix, box, box_width, 0, 255, 0);
55  break;
56  case BSTT_NONE:
57  default:
58  // yellow box.
59  pixRenderBoxArb(pix, box, box_width, 255, 255, 0);
60  break;
61  }
62  boxDestroy(&box);
63 }
BlobSpecialTextType special_text_type() const
Definition: blobbox.h:274
#define ASSERT_HOST(x)
Definition: errcode.h:84
inT16 left() const
Definition: rect.h:68
inT16 top() const
Definition: rect.h:54
Definition: rect.h:30
inT16 height() const
Definition: rect.h:104
inT16 width() const
Definition: rect.h:111
const TBOX & bounding_box() const
Definition: blobbox.h:215

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