26 #ifndef CUBE_LINE_SEGMENTER_H
27 #define CUBE_LINE_SEGMENTER_H
30 #include "allheaders.h"
41 if (init_ ==
false && Init() ==
false) {
47 if (init_ ==
false && Init() ==
false) {
53 if (init_ ==
false && Init() ==
false) {
57 return columns_->boxa->box[col];
60 if (init_ ==
false && Init() ==
false) {
67 if (init_ ==
false && Init() ==
false) {
74 if (init_ ==
false && Init() ==
false) {
82 Pix *
Line(
int line, Box **line_box);
85 static const float kMinValidLineHgtRatio;
86 static const int kLineSepMorphMinHgt;
87 static const int kHgtBins;
88 static const int kMaxConnCompHgt;
89 static const int kMaxConnCompWid;
90 static const int kMaxHorzAspectRatio;
91 static const int kMaxVertAspectRatio;
92 static const int kMinWid;
93 static const int kMinHgt;
94 static const double kMaxValidLineRatio;
110 double est_alef_hgt_;
118 Pix *CleanUp(Pix *pix);
120 double ValidityRatio(Pix *line_mask_pix, Box *line_box);
122 bool ValidLine(Pix *line_mask_pix, Box *line_box);
124 Pixa *SplitLine(Pix *line_mask_pix, Box *line_box);
126 Pixa *CrackLine(Pix *line_mask_pix, Box *line_box);
127 Pixa *CrackLine(Pix *line_mask_pix, Box *line_box,
int line_cnt);
129 bool SmallLine(Box *line_box);
131 Boxa * ComputeLineConComps(Pix *line_mask_pix, Box *line_box,
132 Pixa **con_comps_pixa);
134 Pix *PixUnion(Pix *dest_pix, Box *dest_box, Pix *src_pix, Box *src_box);
136 Pix *Pixa2Pix(Pixa *pixa, Box **dest_box,
int start_pix,
int pix_cnt);
138 Pix *Pixa2Pix(Pixa *pixa, Box **dest_box);
140 bool MergeLine(Pix *line_mask_pix, Box *line_box,
141 Pixa *lines, Boxaa *lines_con_comps);
143 bool AddLines(Pixa *lines);
145 bool EstimateFontParams();
148 Pixa *VerticalClosing(Pix *pix,
int thresold, Boxa **boxa);
150 int *IndexRTL(Pixa *pixa);
156 #endif // CUBE_LINE_SEGMENTER_H
Pix * Line(int line, Box **line_box)
CubeLineSegmenter(CubeRecoContext *cntxt, Pix *img)
Pix * PostProcessedImage()