19#ifndef TESSERACT_TEXTORD_TABLEFIND_H_
20#define TESSERACT_TEXTORD_TABLEFIND_H_
50 bounding_box_.set_top(
y);
54 bounding_box_.set_bottom(
y);
58 bounding_box_.set_left(
x);
62 bounding_box_.set_right(
x);
66 bounding_box_ = other;
70 return num_table_cells_;
79 return num_text_cells_;
99 void InsertBox(
const TBOX &other);
103 int num_table_cells_;
129 resolution_ = resolution;
132 void set_left_to_right_language(
bool order);
135 void Init(
int grid_size,
const ICOORD &bottom_left,
const ICOORD &top_right);
155 int gridsize()
const;
156 int gridwidth()
const;
157 int gridheight()
const;
158 const ICOORD &bleft()
const;
159 const ICOORD &tright()
const;
162 ScrollView *MakeWindow(
int x,
int y,
const char *window_name);
172 void SplitAndInsertFragmentedTextPartition(
ColPartition *part);
173 bool AllowTextPartition(
const ColPartition &part)
const;
174 bool AllowBlob(
const BLOBNBOX &blob)
const;
183 void MoveColSegmentsToGrid(ColSegment_LIST *segments,
211 void set_global_median_xheight(
int xheight);
214 void set_global_median_blob_width(
int width);
219 void set_global_median_ledding(
int ledding);
225 void FindNeighbors();
235 void MarkTablePartitions();
237 void MarkPartitionsUsingLocalInformation();
248 void FilterFalseAlarms();
249 void FilterParagraphEndings();
250 void FilterHeaderAndFooter();
253 void SmoothTablePartitionRuns();
270 ColSegment_LIST *col_segments);
273 void GroupColumnBlocks(ColSegment_LIST *current_segments,
274 ColSegment_LIST *col_segments);
277 bool ConsecutiveBoxes(
const TBOX &b1,
const TBOX &b2);
280 void SetColumnsType(ColSegment_LIST *col_segments);
283 void GridMergeColumnBlocks();
295 void GetTableColumns(ColSegment_LIST *table_columns);
303 void GetTableRegions(ColSegment_LIST *table_columns,
304 ColSegment_LIST *table_regions);
310 void GridMergeTableRegions();
311 bool BelongToOneTable(
const TBOX &box1,
const TBOX &box2);
315 void AdjustTableBoundaries();
322 void GrowTableBox(
const TBOX &table_box,
TBOX *result_box);
325 void GrowTableToIncludePartials(
const TBOX &table_box,
326 const TBOX &search_range,
TBOX *result_box);
329 void GrowTableToIncludeLines(
const TBOX &table_box,
const TBOX &search_range,
338 void IncludeLeftOutColumnHeaders(
TBOX *table_box);
341 void DeleteSingleColumnTables();
345 bool GapInXProjection(
int *xprojection,
int length);
353 void RecognizeTables();
361 void DisplayColSegments(
ScrollView *win, ColSegment_LIST *cols,
#define ELISTIZEH(CLASSNAME)
#define CLISTIZEH(CLASSNAME)
std::function< bool(int)> WidthCallback
void set_bounding_box(const TBOX &other)
int get_num_table_cells() const
void set_num_table_cells(int n)
void set_num_text_cells(int n)
int get_num_text_cells() const
const TBOX & bounding_box() const
int global_median_ledding_
bool left_to_right_language_
void set_resolution(int resolution)
int global_median_blob_width_
ColPartitionGrid leader_and_ruling_grid_
ColSegmentGrid col_seg_grid_
int global_median_xheight_
ColSegmentGrid table_grid_
ColPartitionGrid fragmented_text_grid_
ColPartitionGrid clean_part_grid_