tesseract  3.05.02
tesseract::CubeLineSegmenter Class Reference

#include <cube_line_segmenter.h>

Public Member Functions

 CubeLineSegmenter (CubeRecoContext *cntxt, Pix *img)
 
 ~CubeLineSegmenter ()
 
Pix * PostProcessedImage ()
 
int ColumnCnt ()
 
Box * Column (int col)
 
int LineCnt ()
 
Pixa * ConComps ()
 
Pixaa * Columns ()
 
double AlefHgtEst ()
 
double DotHgtEst ()
 
Pix * Line (int line, Box **line_box)
 

Detailed Description

Definition at line 34 of file cube_line_segmenter.h.

Constructor & Destructor Documentation

◆ CubeLineSegmenter()

tesseract::CubeLineSegmenter::CubeLineSegmenter ( CubeRecoContext cntxt,
Pix *  img 
)

Definition at line 36 of file cube_line_segmenter.cpp.

36  {
37  cntxt_ = cntxt;
38  orig_img_ = img;
39  img_ = NULL;
40  lines_pixa_ = NULL;
41  init_ = false;
42  line_cnt_ = 0;
43  columns_ = NULL;
44  con_comps_ = NULL;
45  est_alef_hgt_ = 0.0;
46  est_dot_hgt_ = 0.0;
47 }

◆ ~CubeLineSegmenter()

tesseract::CubeLineSegmenter::~CubeLineSegmenter ( )

Definition at line 49 of file cube_line_segmenter.cpp.

49  {
50  if (img_ != NULL) {
51  pixDestroy(&img_);
52  img_ = NULL;
53  }
54 
55  if (lines_pixa_ != NULL) {
56  pixaDestroy(&lines_pixa_);
57  lines_pixa_ = NULL;
58  }
59 
60  if (con_comps_ != NULL) {
61  pixaDestroy(&con_comps_);
62  con_comps_ = NULL;
63  }
64 
65  if (columns_ != NULL) {
66  pixaaDestroy(&columns_);
67  columns_ = NULL;
68  }
69 }

Member Function Documentation

◆ AlefHgtEst()

double tesseract::CubeLineSegmenter::AlefHgtEst ( )
inline

Definition at line 80 of file cube_line_segmenter.h.

80 { return est_alef_hgt_; }

◆ Column()

Box* tesseract::CubeLineSegmenter::Column ( int  col)
inline

Definition at line 52 of file cube_line_segmenter.h.

52  {
53  if (init_ == false && Init() == false) {
54  return NULL;
55  }
56 
57  return columns_->boxa->box[col];
58  }

◆ ColumnCnt()

int tesseract::CubeLineSegmenter::ColumnCnt ( )
inline

Definition at line 46 of file cube_line_segmenter.h.

46  {
47  if (init_ == false && Init() == false) {
48  return 0;
49  }
50  return columns_->n;
51  }

◆ Columns()

Pixaa* tesseract::CubeLineSegmenter::Columns ( )
inline

Definition at line 73 of file cube_line_segmenter.h.

73  {
74  if (init_ == false && Init() == false) {
75  return NULL;
76  }
77 
78  return columns_;
79  }

◆ ConComps()

Pixa* tesseract::CubeLineSegmenter::ConComps ( )
inline

Definition at line 66 of file cube_line_segmenter.h.

66  {
67  if (init_ == false && Init() == false) {
68  return NULL;
69  }
70 
71  return con_comps_;
72  }

◆ DotHgtEst()

double tesseract::CubeLineSegmenter::DotHgtEst ( )
inline

Definition at line 81 of file cube_line_segmenter.h.

81 { return est_dot_hgt_; }

◆ Line()

Pix * tesseract::CubeLineSegmenter::Line ( int  line,
Box **  line_box 
)

Definition at line 870 of file cube_line_segmenter.cpp.

870  {
871  if (init_ == false && Init() == false) {
872  return NULL;
873  }
874 
875  if (line < 0 || line >= line_cnt_) {
876  return NULL;
877  }
878 
879  (*line_box) = lines_pixa_->boxa->box[line];
880  return lines_pixa_->pix[line];
881 }

◆ LineCnt()

int tesseract::CubeLineSegmenter::LineCnt ( )
inline

Definition at line 59 of file cube_line_segmenter.h.

59  {
60  if (init_ == false && Init() == false) {
61  return 0;
62  }
63 
64  return line_cnt_;
65  }

◆ PostProcessedImage()

Pix* tesseract::CubeLineSegmenter::PostProcessedImage ( )
inline

Definition at line 40 of file cube_line_segmenter.h.

40  {
41  if (init_ == false && Init() == false) {
42  return NULL;
43  }
44  return img_;
45  }

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