84 void set_max_text_height(
int height);
88 bool is_lined()
const;
89 unsigned row_count()
const;
90 unsigned column_count()
const;
91 unsigned cell_count()
const;
92 void set_bounding_box(
const TBOX &box);
93 const TBOX &bounding_box()
const;
94 int median_cell_height();
95 int median_cell_width();
96 int row_height(
unsigned row)
const;
97 int column_width(
unsigned column)
const;
98 int space_above()
const;
99 int space_below()
const;
105 bool FindLinedStructure();
110 bool FindWhitespacedStructure();
120 int CountFilledCells();
121 int CountFilledCellsInRow(
int row);
122 int CountFilledCellsInColumn(
int column);
123 int CountFilledCells(
unsigned row_start,
unsigned row_end,
unsigned column_start,
unsigned column_end);
129 bool VerifyRowFilled(
int row);
131 double CalculateCellFilledPercentage(
unsigned row,
unsigned column);
139 void ClearStructure();
148 bool VerifyLinedTableCells();
158 bool VerifyWhitespacedTable();
160 void FindWhitespacedColumns();
162 void FindWhitespacedRows();
170 void CalculateMargins();
174 int FindVerticalMargin(
ColPartitionGrid *grid,
int start_x,
bool decrease)
const;
175 int FindHorizontalMargin(
ColPartitionGrid *grid,
int start_y,
bool decrease)
const;
177 void CalculateStats();
187 void AbsorbNearbyLines();
210 static void FindCellSplitLocations(
const std::vector<int> &min_list,
211 const std::vector<int> &max_list,
int max_merged,
212 std::vector<int> *locations);
220 int CountVerticalIntersections(
int x);
221 int CountHorizontalIntersections(
int y);
224 int CountPartitions(
const TBOX &box);
268 void set_min_height(
int height);
269 void set_min_width(
int width);
274 void set_max_text_height(
int height);
323 bool HasSignificantLines(
const TBOX &guess);
332 bool FindLinesBoundingBox(
TBOX *bounding_box);
337 bool FindLinesBoundingBoxIteration(
TBOX *bounding_box);
353 int NextHorizontalSplit(
int left,
int right,
int y,
bool top_to_bottom);
362 int max_text_height_ = INT32_MAX;
std::vector< int > cell_y_
~StructuredTable()=default
ColPartitionGrid * text_grid_
std::vector< int > cell_x_
ColPartitionGrid * line_grid_
~TableRecognizer()=default
TableRecognizer()=default