All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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

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 }
#define NULL
Definition: host.h:144
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 }
#define NULL
Definition: host.h:144

Member Function Documentation

double tesseract::CubeLineSegmenter::AlefHgtEst ( )
inline

Definition at line 80 of file cube_line_segmenter.h.

80 { return est_alef_hgt_; }
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  }
#define NULL
Definition: host.h:144
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  }
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  }
#define NULL
Definition: host.h:144
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  }
#define NULL
Definition: host.h:144
double tesseract::CubeLineSegmenter::DotHgtEst ( )
inline

Definition at line 81 of file cube_line_segmenter.h.

81 { return est_dot_hgt_; }
Pix * tesseract::CubeLineSegmenter::Line ( int  line,
Box **  line_box 
)

Definition at line 876 of file cube_line_segmenter.cpp.

876  {
877  if (init_ == false && Init() == false) {
878  return NULL;
879  }
880 
881  if (line < 0 || line >= line_cnt_) {
882  return NULL;
883  }
884 
885  (*line_box) = lines_pixa_->boxa->box[line];
886  return lines_pixa_->pix[line];
887 }
#define NULL
Definition: host.h:144
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  }
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  }
#define NULL
Definition: host.h:144

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