tesseract  5.0.0-alpha-619-ge9db
tablefind.h
Go to the documentation of this file.
1 // File: tablefind.h
3 // Description: Helper classes to find tables from ColPartitions.
4 // Author: Faisal Shafait (faisal.shafait@dfki.de)
5 //
6 // (C) Copyright 2009, Google Inc.
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
18 
19 #ifndef TESSERACT_TEXTORD_TABLEFIND_H_
20 #define TESSERACT_TEXTORD_TABLEFIND_H_
21 
22 #include "colpartitiongrid.h"
23 #include "elst.h"
24 #include "rect.h"
25 
26 namespace tesseract {
27 
28 // Possible types for a column segment.
29 enum ColSegType {
35 };
36 
37 class ColPartitionSet;
38 
39 // ColSegment holds rectangular blocks that represent segmentation of a page
40 // into regions containing single column text/table.
41 class ColSegment;
42 ELISTIZEH(ColSegment)
43 CLISTIZEH(ColSegment)
44 
45 class ColSegment : public ELIST_LINK {
46  public:
47  ColSegment();
48  ~ColSegment() = default;
49 
50  // Simple accessors and mutators
51  const TBOX& bounding_box() const {
52  return bounding_box_;
53  }
54 
55  void set_top(int y) {
56  bounding_box_.set_top(y);
57  }
58 
59  void set_bottom(int y) {
60  bounding_box_.set_bottom(y);
61  }
62 
63  void set_left(int x) {
64  bounding_box_.set_left(x);
65  }
66 
67  void set_right(int x) {
68  bounding_box_.set_right(x);
69  }
70 
71  void set_bounding_box(const TBOX& other) {
72  bounding_box_ = other;
73  }
74 
75  int get_num_table_cells() const {
76  return num_table_cells_;
77  }
78 
79  // set the number of table colpartitions covered by the bounding_box_
80  void set_num_table_cells(int n) {
81  num_table_cells_ = n;
82  }
83 
84  int get_num_text_cells() const {
85  return num_text_cells_;
86  }
87 
88  // set the number of text colpartitions covered by the bounding_box_
89  void set_num_text_cells(int n) {
90  num_text_cells_ = n;
91  }
92 
93  ColSegType type() const {
94  return type_;
95  }
96 
97  // set the type of the block based on the ratio of table to text
98  // colpartitions covered by it.
99  void set_type();
100 
101  // Provides a color for BBGrid to draw the rectangle.
102  ScrollView::Color BoxColor() const;
103 
104  // Insert a rectangle into bounding_box_
105  void InsertBox(const TBOX& other);
106 
107  private:
108  TBOX bounding_box_; // bounding box
109  int num_table_cells_;
110  int num_text_cells_;
111  ColSegType type_;
112 };
113 
114 // Typedef BBGrid of ColSegments
115 using ColSegmentGrid = BBGrid<ColSegment,
116  ColSegment_CLIST,
117  ColSegment_C_IT>;
119  ColSegment_CLIST,
120  ColSegment_C_IT>;
121 
122 // TableFinder is a utility class to find a set of tables given a set of
123 // ColPartitions and Columns. The TableFinder will mark candidate ColPartitions
124 // based on research in "Table Detection in Heterogeneous Documents".
125 // Usage flow is as follows:
126 // TableFinder finder;
127 // finder.InsertCleanPartitions(/* grid info */)
128 // finder.LocateTables(/* ColPartitions and Columns */);
129 // finder.Update TODO(nbeato)
130 class TableFinder {
131  public:
132  // Constructor is simple initializations
133  TableFinder();
134  ~TableFinder();
135 
136  // Set the resolution of the connected components in ppi.
137  void set_resolution(int resolution) {
138  resolution_ = resolution;
139  }
140  // Change the reading order. Initially it is left to right.
141  void set_left_to_right_language(bool order);
142 
143  // Initialize
144  void Init(int grid_size, const ICOORD& bottom_left, const ICOORD& top_right);
145 
146  // Copy cleaned partitions from ColumnFinder's part_grid_ to this
147  // clean_part_grid_ and insert dot-like noise into period_grid_.
148  // It resizes the grids in this object to the dimensions of grid.
149  void InsertCleanPartitions(ColPartitionGrid* grid, TO_BLOCK* block);
150 
151  // High level function to perform table detection
152  // Finds tables and updates the grid object with new partitions for the
153  // tables. The columns and width callbacks are used to merge tables.
154  // The reskew argument is only used to write the tables to the out.png
155  // if that feature is enabled.
156  void LocateTables(ColPartitionGrid* grid,
157  ColPartitionSet** columns,
158  WidthCallback width_cb,
159  const FCOORD& reskew);
160 
161  protected:
162  // Access for the grid dimensions.
163  // The results will not be correct until InsertCleanPartitions
164  // has been called. The values are taken from the grid passed as an argument
165  // to that function.
166  int gridsize() const;
167  int gridwidth() const;
168  int gridheight() const;
169  const ICOORD& bleft() const;
170  const ICOORD& tright() const;
171 
172  // Makes a window for debugging, see BBGrid
173  ScrollView* MakeWindow(int x, int y, const char* window_name);
174 
177  // Inserts text into the table finder.
178  void InsertTextPartition(ColPartition* part);
184  bool AllowTextPartition(const ColPartition& part) const;
185  bool AllowBlob(const BLOBNBOX& blob) const;
186 
190 
191  // Utility function to move segments to col_seg_grid
192  // Note: Move includes ownership,
193  // so segments will be be owned by col_seg_grid
194  void MoveColSegmentsToGrid(ColSegment_LIST* segments,
195  ColSegmentGrid* col_seg_grid);
196 
200 
201  // Initialize the grid and partitions
202  void InitializePartitions(ColPartitionSet** all_columns);
203 
204  // Set left, right and top, bottom spacings of each colpartition.
205  // Left/right spacings are w.r.t the column boundaries
206  // Top/bottom spacings are w.r.t. previous and next colpartitions
207  static void SetPartitionSpacings(ColPartitionGrid* grid,
208  ColPartitionSet** all_columns);
209 
210  // Set spacing and closest neighbors above and below a given colpartition.
211  void SetVerticalSpacing(ColPartition* part);
212 
213  // Set global spacing estimates. This function is dependent on the
214  // partition spacings. So make sure SetPartitionSpacings is called
215  // on the same grid before this.
217  // Access to the global median xheight. The xheight is the height
218  // of a lowercase 'x' character on the page. This can be viewed as the
219  // average height of a lowercase letter in a textline. As a result
220  // it is used to make assumptions about spacing between words and
221  // table cells.
222  void set_global_median_xheight(int xheight);
223  // Access to the global median blob width. The width is useful
224  // when deciding if a partition is noise.
225  void set_global_median_blob_width(int width);
226  // Access to the global median ledding. The ledding is the distance between
227  // two adjacent text lines. This value can be used to get a rough estimate
228  // for the amount of space between two lines of text. As a result, it
229  // is used to calculate appropriate spacing between adjacent rows of text.
230  void set_global_median_ledding(int ledding);
231 
232  // Updates the nearest neighbors for each ColPartition in clean_part_grid_.
233  // The neighbors are most likely SingletonPartner calls after the neighbors
234  // are assigned. This is hear until it is decided to remove the
235  // nearest_neighbor code in ColPartition
236  void FindNeighbors();
237 
242 
243  // High level function to mark partitions as table rows/cells.
244  // When this function is done, the column partitions in clean_part_grid_
245  // should mostly be marked as tables.
246  void MarkTablePartitions();
247  // Marks partitions given a local view of a single partition
250  // Check if the partition has at least one large gap between words or no
251  // significant gap at all
252  // TODO(nbeato): Make const, prevented because blobnbox array access
253  bool HasWideOrNoInterWordGap(ColPartition* part) const;
254  // Checks if a partition is adjacent to leaders on the page
255  bool HasLeaderAdjacent(const ColPartition& part);
256  // Filter individual text partitions marked as table partitions
257  // consisting of paragraph endings, small section headings, and
258  // headers and footers.
259  void FilterFalseAlarms();
260  void FilterParagraphEndings();
261  void FilterHeaderAndFooter();
262  // Mark all ColPartitions as table cells that have a table cell above
263  // and below them
265 
278 
279  // Get Column segments from best_columns_
280  void GetColumnBlocks(ColPartitionSet** columns,
281  ColSegment_LIST *col_segments);
282 
283  // Group Column segments into consecutive single column regions.
284  void GroupColumnBlocks(ColSegment_LIST *current_segments,
285  ColSegment_LIST *col_segments);
286 
287  // Check if two boxes are consecutive within the same column
288  bool ConsecutiveBoxes(const TBOX &b1, const TBOX &b2);
289 
290  // Set the ratio of candidate table partitions in each column
291  void SetColumnsType(ColSegment_LIST* col_segments);
292 
293  // Merge Column Blocks that were split due to the presence of a table
294  void GridMergeColumnBlocks();
295 
301 
302  // Merge partititons cells into table columns
303  // Differs from paper by just looking at marked table partitions
304  // instead of similarity metric.
305  // Modified section 4.1 of paper.
306  void GetTableColumns(ColSegment_LIST *table_columns);
307 
308  // Finds regions within a column that potentially contain a table.
309  // Ie, the table columns from GetTableColumns are turned into boxes
310  // that span the entire page column (using ColumnBlocks found in
311  // earlier functions) in the x direction and the min/max extent of
312  // overlapping table columns in the y direction.
313  // Section 4.2 of paper.
314  void GetTableRegions(ColSegment_LIST *table_columns,
315  ColSegment_LIST *table_regions);
316 
317 
320 
321  // Merge table regions corresponding to tables spanning multiple columns
322  void GridMergeTableRegions();
323  bool BelongToOneTable(const TBOX &box1, const TBOX &box2);
324 
325  // Adjust table boundaries by building a tight bounding box around all
326  // ColPartitions contained in it.
327  void AdjustTableBoundaries();
328 
329  // Grows a table to include partitions that are partially covered
330  // by the table. This includes lines and text. It does not include
331  // noise or images.
332  // On entry, result_box is the minimum size of the result. The results of the
333  // function will union the actual result with result_box.
334  void GrowTableBox(const TBOX& table_box, TBOX* result_box);
335  // Grow a table by increasing the size of the box to include
336  // partitions with significant overlap with the table.
337  void GrowTableToIncludePartials(const TBOX& table_box,
338  const TBOX& search_range,
339  TBOX* result_box);
340  // Grow a table by expanding to the extents of significantly
341  // overlapping lines.
342  void GrowTableToIncludeLines(const TBOX& table_box, const TBOX& search_range,
343  TBOX* result_box);
344  // Checks whether the horizontal line belong to the table by looking at the
345  // side spacing of extra ColParitions that will be included in the table
346  // due to expansion
347  bool HLineBelongsToTable(const ColPartition& part, const TBOX& table_box);
348 
349  // Look for isolated column headers above the given table box and
350  // include them in the table
351  void IncludeLeftOutColumnHeaders(TBOX* table_box);
352 
353  // Remove false alarms consisting of a single column
355 
356  // Return true if at least one gap larger than the global x-height
357  // exists in the horizontal projection
358  bool GapInXProjection(int* xprojection, int length);
359 
362  // This function will run the table recognizer and try to find better
363  // bounding boxes. The structures of the tables never leave this function
364  // right now. It just tries to prune and merge tables based on info it
365  // has available.
366  void RecognizeTables();
367 
371 
372  // Displays Colpartitions marked as table row. Overlays them on top of
373  // part_grid_.
374  void DisplayColSegments(ScrollView* win, ColSegment_LIST *cols,
375  ScrollView::Color color);
376 
377  // Displays the colpartitions using a new coloring on an existing window.
378  // Note: This method is only for debug purpose during development and
379  // would not be part of checked in code
381  ScrollView::Color text_color,
382  ScrollView::Color table_color);
384  ScrollView::Color default_color);
386  ColPartitionGrid* grid,
387  ScrollView::Color default_color);
389  ScrollView::Color color);
390 
391  // Merge all colpartitions in table regions to make them a single
392  // colpartition and revert types of isolated table cells not
393  // assigned to any table to their original types.
395  ColPartitionSet** columns,
396  WidthCallback width_cb);
397 
399  // Useful objects used during table find process.
401  // Resolution of the connected components in ppi.
403  // Estimate of median x-height over the page
405  // Estimate of the median blob width on the page
407  // Estimate of median leading on the page
409  // Grid to hold cleaned colpartitions after removing all
410  // colpartitions that consist of only noise blobs, and removing
411  // noise blobs from remaining colpartitions.
413  // Grid contains the leaders and ruling lines.
415  // Grid contains the broken down column partitions. It can be thought
416  // of as a "word" grid. However, it usually doesn't break apart text lines.
417  // It does break apart table data (most of the time).
419  // Grid of page column blocks
421  // Grid of detected tables
423  // The reading order of text. Defaults to true, for languages such as English.
425 };
426 
427 } // namespace tesseract.
428 
429 #endif // TESSERACT_TEXTORD_TABLEFIND_H_
tesseract::TableFinder::InsertImagePartition
void InsertImagePartition(ColPartition *part)
Definition: tablefind.cpp:421
tesseract::TableFinder
Definition: tablefind.h:130
ScrollView
Definition: scrollview.h:97
elst.h
tesseract::TableFinder::FilterHeaderAndFooter
void FilterHeaderAndFooter()
Definition: tablefind.cpp:1074
tesseract::TableFinder::GroupColumnBlocks
void GroupColumnBlocks(ColSegment_LIST *current_segments, ColSegment_LIST *col_segments)
Definition: tablefind.cpp:538
tesseract::TableFinder::set_global_median_xheight
void set_global_median_xheight(int xheight)
Definition: tablefind.cpp:756
tesseract::TableFinder::set_resolution
void set_resolution(int resolution)
Definition: tablefind.h:137
tesseract::TableFinder::InsertFragmentedTextPartition
void InsertFragmentedTextPartition(ColPartition *part)
Definition: tablefind.cpp:402
tesseract::TableFinder::DisplayColSegmentGrid
void DisplayColSegmentGrid(ScrollView *win, ColSegmentGrid *grid, ScrollView::Color color)
Definition: tablefind.cpp:1891
tesseract::TableFinder::left_to_right_language_
bool left_to_right_language_
Definition: tablefind.h:424
tesseract::TableFinder::table_grid_
ColSegmentGrid table_grid_
Definition: tablefind.h:422
tesseract::TableFinder::GridMergeColumnBlocks
void GridMergeColumnBlocks()
Definition: tablefind.cpp:1195
tesseract::COL_TEXT
Definition: tablefind.h:31
tesseract::ColSegment
Definition: tablefind.h:45
tesseract::ColSegmentGrid
BBGrid< ColSegment, ColSegment_CLIST, ColSegment_C_IT > ColSegmentGrid
Definition: tablefind.h:117
tesseract::TableFinder::set_global_median_ledding
void set_global_median_ledding(int ledding)
Definition: tablefind.cpp:762
tesseract::ColSegment::set_num_text_cells
void set_num_text_cells(int n)
Definition: tablefind.h:89
tesseract::TableFinder::AllowBlob
bool AllowBlob(const BLOBNBOX &blob) const
Definition: tablefind.cpp:502
ICOORD
integer coordinate
Definition: points.h:30
tesseract::WidthCallback
std::function< bool(int)> WidthCallback
Definition: tabfind.h:35
tesseract::TableFinder::DisplayColPartitionConnections
void DisplayColPartitionConnections(ScrollView *win, ColPartitionGrid *grid, ScrollView::Color default_color)
Definition: tablefind.cpp:1950
tesseract::COL_COUNT
Definition: tablefind.h:34
tesseract::TableFinder::RecognizeTables
void RecognizeTables()
Definition: tablefind.cpp:1817
tesseract::TableFinder::~TableFinder
~TableFinder()
Definition: tablefind.cpp:167
TO_BLOCK
Definition: blobbox.h:691
tesseract::ColSegment::get_num_text_cells
int get_num_text_cells() const
Definition: tablefind.h:84
tesseract::TableFinder::set_global_median_blob_width
void set_global_median_blob_width(int width)
Definition: tablefind.cpp:759
tesseract::TableFinder::DisplayColSegments
void DisplayColSegments(ScrollView *win, ColSegment_LIST *cols, ScrollView::Color color)
Definition: tablefind.cpp:1871
tesseract::TableFinder::HasLeaderAdjacent
bool HasLeaderAdjacent(const ColPartition &part)
Definition: tablefind.cpp:946
tesseract::TableFinder::AdjustTableBoundaries
void AdjustTableBoundaries()
Definition: tablefind.cpp:1486
tesseract::ColSegment::set_bounding_box
void set_bounding_box(const TBOX &other)
Definition: tablefind.h:71
tesseract::ColPartitionSet
Definition: colpartitionset.h:39
tesseract::TableFinder::ConsecutiveBoxes
bool ConsecutiveBoxes(const TBOX &b1, const TBOX &b2)
Definition: tablefind.cpp:568
tesseract::TableFinder::InsertLeaderPartition
void InsertLeaderPartition(ColPartition *part)
Definition: tablefind.cpp:410
tesseract::TableFinder::SplitAndInsertFragmentedTextPartition
void SplitAndInsertFragmentedTextPartition(ColPartition *part)
Definition: tablefind.cpp:436
rect.h
FCOORD
Definition: points.h:187
BLOBNBOX
Definition: blobbox.h:142
tesseract::TableFinder::bleft
const ICOORD & bleft() const
Definition: tablefind.cpp:387
ELISTIZEH
#define ELISTIZEH(CLASSNAME)
Definition: elst.h:907
tesseract::TableFinder::IncludeLeftOutColumnHeaders
void IncludeLeftOutColumnHeaders(TBOX *table_box)
Definition: tablefind.cpp:1664
tesseract::ColPartition
Definition: colpartition.h:67
tesseract::TableFinder::gridwidth
int gridwidth() const
Definition: tablefind.cpp:381
tesseract::TableFinder::AllowTextPartition
bool AllowTextPartition(const ColPartition &part) const
Definition: tablefind.cpp:489
tesseract::TableFinder::resolution_
int resolution_
Definition: tablefind.h:402
tesseract::TableFinder::tright
const ICOORD & tright() const
Definition: tablefind.cpp:390
tesseract::COL_TABLE
Definition: tablefind.h:32
tesseract::TableFinder::FilterParagraphEndings
void FilterParagraphEndings()
Definition: tablefind.cpp:994
tesseract::TableFinder::gridheight
int gridheight() const
Definition: tablefind.cpp:384
tesseract::TableFinder::leader_and_ruling_grid_
ColPartitionGrid leader_and_ruling_grid_
Definition: tablefind.h:414
tesseract::TableFinder::GrowTableToIncludePartials
void GrowTableToIncludePartials(const TBOX &table_box, const TBOX &search_range, TBOX *result_box)
Definition: tablefind.cpp:1542
tesseract::TableFinder::InsertRulingPartition
void InsertRulingPartition(ColPartition *part)
Definition: tablefind.cpp:418
tesseract::TableFinder::MarkPartitionsUsingLocalInformation
void MarkPartitionsUsingLocalInformation()
Definition: tablefind.cpp:827
tesseract::TableFinder::clean_part_grid_
ColPartitionGrid clean_part_grid_
Definition: tablefind.h:412
CLISTIZEH
CLISTIZEH(STRING) CLISTIZE(STRING) namespace tesseract
Definition: reject.cpp:50
tesseract::TableFinder::TableFinder
TableFinder()
Definition: tablefind.cpp:159
tesseract::TableFinder::GetTableColumns
void GetTableColumns(ColSegment_LIST *table_columns)
Definition: tablefind.cpp:1273
tesseract::TableFinder::DeleteSingleColumnTables
void DeleteSingleColumnTables()
Definition: tablefind.cpp:1703
tesseract::TableFinder::HasWideOrNoInterWordGap
bool HasWideOrNoInterWordGap(ColPartition *part) const
Definition: tablefind.cpp:857
tesseract::TableFinder::GridMergeTableRegions
void GridMergeTableRegions()
Definition: tablefind.cpp:1386
tesseract::TableFinder::GrowTableBox
void GrowTableBox(const TBOX &table_box, TBOX *result_box)
Definition: tablefind.cpp:1520
tesseract::ColSegment::set_num_table_cells
void set_num_table_cells(int n)
Definition: tablefind.h:80
tesseract::TableFinder::GrowTableToIncludeLines
void GrowTableToIncludeLines(const TBOX &table_box, const TBOX &search_range, TBOX *result_box)
Definition: tablefind.cpp:1570
tesseract::BBGrid< ColSegment, ColSegment_CLIST, ColSegment_C_IT >
tesseract::TableFinder::col_seg_grid_
ColSegmentGrid col_seg_grid_
Definition: tablefind.h:420
tesseract::ColSegment::set_top
void set_top(int y)
Definition: tablefind.h:55
tesseract::TableFinder::FilterFalseAlarms
void FilterFalseAlarms()
Definition: tablefind.cpp:988
tesseract::GridSearch
Definition: bbgrid.h:48
tesseract::COL_MIXED
Definition: tablefind.h:33
tesseract
Definition: baseapi.h:65
tesseract::TableFinder::InsertCleanPartitions
void InsertCleanPartitions(ColPartitionGrid *grid, TO_BLOCK *block)
Definition: tablefind.cpp:193
tesseract::TableFinder::HLineBelongsToTable
bool HLineBelongsToTable(const ColPartition &part, const TBOX &table_box)
Definition: tablefind.cpp:1600
tesseract::TableFinder::SetVerticalSpacing
void SetVerticalSpacing(ColPartition *part)
Definition: tablefind.cpp:666
tesseract::COL_UNKNOWN
Definition: tablefind.h:30
tesseract::TableFinder::set_left_to_right_language
void set_left_to_right_language(bool order)
Definition: tablefind.cpp:177
tesseract::TableFinder::SetColumnsType
void SetColumnsType(ColSegment_LIST *col_segments)
Definition: tablefind.cpp:1143
tesseract::TableFinder::global_median_blob_width_
int global_median_blob_width_
Definition: tablefind.h:406
tesseract::ColSegment::type
ColSegType type() const
Definition: tablefind.h:93
tesseract::TableFinder::MarkTablePartitions
void MarkTablePartitions()
Definition: tablefind.cpp:789
tesseract::TableFinder::SmoothTablePartitionRuns
void SmoothTablePartitionRuns()
Definition: tablefind.cpp:1108
tesseract::TableFinder::Init
void Init(int grid_size, const ICOORD &bottom_left, const ICOORD &top_right)
Definition: tablefind.cpp:181
tesseract::TableFinder::DisplayColPartitions
void DisplayColPartitions(ScrollView *win, ColPartitionGrid *grid, ScrollView::Color text_color, ScrollView::Color table_color)
Definition: tablefind.cpp:1916
tesseract::TableFinder::SetPartitionSpacings
static void SetPartitionSpacings(ColPartitionGrid *grid, ColPartitionSet **all_columns)
Definition: tablefind.cpp:586
tesseract::ColPartitionGrid
Definition: colpartitiongrid.h:32
tesseract::TableFinder::SetGlobalSpacings
void SetGlobalSpacings(ColPartitionGrid *grid)
Definition: tablefind.cpp:709
tesseract::ColSegment::bounding_box
const TBOX & bounding_box() const
Definition: tablefind.h:51
tesseract::TableFinder::global_median_ledding_
int global_median_ledding_
Definition: tablefind.h:408
tesseract::ColSegment::set_right
void set_right(int x)
Definition: tablefind.h:67
tesseract::TableFinder::global_median_xheight_
int global_median_xheight_
Definition: tablefind.h:404
tesseract::TableFinder::fragmented_text_grid_
ColPartitionGrid fragmented_text_grid_
Definition: tablefind.h:418
tesseract::TableFinder::InsertTextPartition
void InsertTextPartition(ColPartition *part)
Definition: tablefind.cpp:394
tesseract::TableFinder::FindNeighbors
void FindNeighbors()
Definition: tablefind.cpp:766
tesseract::ColSegment::set_left
void set_left(int x)
Definition: tablefind.h:63
ELIST_LINK
Definition: elst.h:74
tesseract::TableFinder::MoveColSegmentsToGrid
void MoveColSegmentsToGrid(ColSegment_LIST *segments, ColSegmentGrid *col_seg_grid)
Definition: tablefind.cpp:1176
tesseract::TableFinder::MakeWindow
ScrollView * MakeWindow(int x, int y, const char *window_name)
Definition: tablefind.cpp:518
tesseract::TableFinder::BelongToOneTable
bool BelongToOneTable(const TBOX &box1, const TBOX &box2)
Definition: tablefind.cpp:1444
tesseract::TableFinder::GapInXProjection
bool GapInXProjection(int *xprojection, int length)
Definition: tablefind.cpp:1768
ScrollView::Color
Color
Definition: scrollview.h:100
tesseract::TableFinder::MakeTableBlocks
void MakeTableBlocks(ColPartitionGrid *grid, ColPartitionSet **columns, WidthCallback width_cb)
Definition: tablefind.cpp:1997
tesseract::TableFinder::LocateTables
void LocateTables(ColPartitionGrid *grid, ColPartitionSet **columns, WidthCallback width_cb, const FCOORD &reskew)
Definition: tablefind.cpp:259
tesseract::TableFinder::gridsize
int gridsize() const
Definition: tablefind.cpp:378
tesseract::TableFinder::InitializePartitions
void InitializePartitions(ColPartitionSet **all_columns)
Definition: tablefind.cpp:579
tesseract::TableFinder::GetTableRegions
void GetTableRegions(ColSegment_LIST *table_columns, ColSegment_LIST *table_regions)
Definition: tablefind.cpp:1323
tesseract::ColSegType
ColSegType
Definition: tablefind.h:29
tesseract::TableFinder::GetColumnBlocks
void GetColumnBlocks(ColPartitionSet **columns, ColSegment_LIST *col_segments)
Definition: tablefind.cpp:523
colpartitiongrid.h
tesseract::ColSegment::set_bottom
void set_bottom(int y)
Definition: tablefind.h:59
tesseract::ColSegment::get_num_table_cells
int get_num_table_cells() const
Definition: tablefind.h:75
TBOX
Definition: rect.h:33