20 #ifndef TESSERACT_TEXTORD_TABFIND_H_ 21 #define TESSERACT_TEXTORD_TABFIND_H_ 23 #include "alignedblob.h" 24 #include "tesscallback.h" 25 #include "tabvector.h" 56 TabVector_LIST* vlines,
int vertical_x,
int vertical_y,
95 bool ignore_unmergeables,
int max_gutter_width,
101 int max_gutter,
bool left,
188 BLOBNBOX_LIST* image_blobs,
TO_BLOCK* block,
189 int min_gutter_width,
double tabfind_aligned_gap_fraction,
219 int min_gutter_width,
220 double tabfind_aligned_gap_fraction,
231 TabVector_LIST* horizontal_lines,
232 int* min_gutter_width);
248 double tabfind_aligned_gap_fraction);
255 double tabfind_aligned_gap_fraction);
273 int min_gutter_width,
275 int* vertical_x,
int* vertical_y);
286 int* vertical_x,
int* vertical_y);
332 bool look_left,
bool ignore_images,
333 double min_overlap_fraction,
334 int gap_limit,
int top_y,
int bottom_y);
354 bool Deskew(TabVector_LIST* hlines, BLOBNBOX_LIST* image_blobs,
385 #endif // TESSERACT_TEXTORD_TABFIND_H_ Definition: colpartitiongrid.h:33
ScrollView * FindTabBoxes(int min_gutter_width, double tabfind_aligned_gap_fraction)
Definition: tabfind.cpp:560
TabFind(int gridsize, const ICOORD &bleft, const ICOORD &tright, TabVector_LIST *vlines, int vertical_x, int vertical_y, int resolution)
Definition: tabfind.cpp:66
void SetVerticalSkewAndParallelize(int vertical_x, int vertical_y)
Definition: tabfind.cpp:908
ICOORD image_origin_
Definition: tabfind.h:370
bool Deskew(TabVector_LIST *hlines, BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew)
Definition: tabfind.cpp:1266
int GutterWidth(int bottom_y, int top_y, const TabVector &v, bool ignore_unmergeables, int max_gutter_width, int *required_shift)
Definition: tabfind.cpp:162
bool ConfirmRaggedRight(BLOBNBOX *bbox, int min_gutter)
Definition: tabfind.cpp:782
void SetupTabSearch(int x, int y, int *min_key, int *max_key)
Definition: tabfind.cpp:491
void ComputeColumnWidths(ScrollView *tab_win, ColPartitionGrid *part_grid)
Definition: tabfind.cpp:951
void AddPartnerVector(BLOBNBOX *left_blob, BLOBNBOX *right_blob, TabVector *left, TabVector *right)
Definition: tabfind.cpp:1189
Definition: alignedblob.h:81
TabAlignment
Definition: tabvector.h:45
void DontFindTabVectors(BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew)
Definition: tabfind.cpp:453
TabVector_LIST dead_vectors_
Definition: tabfind.h:373
ScrollView * FindInitialTabVectors(BLOBNBOX_LIST *image_blobs, int min_gutter_width, double tabfind_aligned_gap_fraction, TO_BLOCK *block)
Definition: tabfind.cpp:515
Definition: tabvector.h:112
GenericVector< BLOBNBOX * > left_tab_boxes_
Definition: tabfind.h:379
void GutterWidthAndNeighbourGap(int tab_x, int mean_height, int max_gutter, bool left, BLOBNBOX *bbox, int *gutter_width, int *neighbour_gap)
Definition: tabfind.cpp:209
int FindMedianGutterWidth(TabVector_LIST *tab_vectors)
Definition: tabfind.cpp:1081
void SortVectors()
Definition: tabfind.cpp:924
int LeftEdgeForBox(const TBOX &box, bool crossing, bool extended)
Definition: tabfind.cpp:287
WidthCallback * width_cb_
Definition: tabfind.h:377
bool FindTabVectors(TabVector_LIST *hlines, BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, int min_gutter_width, double tabfind_aligned_gap_fraction, ColPartitionGrid *part_grid, FCOORD *deskew, FCOORD *reskew)
Definition: tabfind.cpp:423
bool InsertBlob(bool h_spread, bool v_spread, BLOBNBOX *blob, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
Definition: tabfind.cpp:119
void Reset()
Definition: tabfind.cpp:1346
Definition: baseapi.cpp:94
ICOORD vertical_skew_
Definition: tabfind.h:367
TabVector_IT v_it_
Definition: tabfind.h:372
void CleanupTabs()
Definition: tabfind.cpp:1239
static bool DifferentSizes(int size1, int size2)
Definition: tabfind.cpp:408
bool CommonWidth(int width)
Definition: tabfind.cpp:395
static void RotateBlobList(const FCOORD &rotation, BLOBNBOX_LIST *blobs)
Definition: tabfind.cpp:1257
bool TestBoxForTabs(BLOBNBOX *bbox, int min_gutter_width, double tabfind_aligned_gap_fraction)
Definition: tabfind.cpp:596
void ResetForVerticalText(const FCOORD &rotate, const FCOORD &rerotate, TabVector_LIST *horizontal_lines, int *min_gutter_width)
Definition: tabfind.cpp:1301
void FindAllTabVectors(int min_gutter_width)
Definition: tabfind.cpp:804
Definition: blobbox.h:144
bool ConfirmRaggedLeft(BLOBNBOX *bbox, int min_gutter)
Definition: tabfind.cpp:773
const ICOORD & bleft() const
Definition: bbgrid.h:73
int gridsize() const
Definition: bbgrid.h:64
TabVector * RightTabForBox(const TBOX &box, bool crossing, bool extended)
Definition: tabfind.cpp:305
int resolution_
Definition: tabfind.h:368
virtual ~TabFind()
Definition: tabfind.cpp:79
Definition: tesscallback.h:1673
void TidyBlobs(TO_BLOCK *block)
Definition: tabfind.cpp:466
void ApplyTabConstraints()
Definition: tabfind.cpp:1392
const ICOORD & image_origin() const
Definition: tabfind.h:165
WidthCallback * WidthCB()
Definition: tabfind.h:158
TabVector * LeftTabForBox(const TBOX &box, bool crossing, bool extended)
Definition: tabfind.cpp:349
TabVector * FindTabVector(int search_size_multiple, int min_gutter_width, TabAlignment alignment, BLOBNBOX *bbox, int *vertical_x, int *vertical_y)
Definition: tabfind.cpp:892
ICOORDELT_LIST column_widths_
Definition: tabfind.h:375
void ReflectInYAxis()
Definition: tabfind.cpp:1357
Definition: statistc.h:33
integer coordinate
Definition: points.h:32
ScrollView * DisplayTabVectors(ScrollView *tab_win)
Definition: tabfind.cpp:498
void EvaluateTabs()
Definition: tabfind.cpp:930
Definition: alignedblob.h:42
void ComputeDeskewVectors(FCOORD *deskew, FCOORD *reskew)
Definition: tabfind.cpp:1381
void MarkVerticalText()
Definition: tabfind.cpp:1066
TabVector_LIST * dead_vectors()
Definition: tabfind.h:176
void MakeColumnWidths(int col_widths_size, STATS *col_widths)
Definition: tabfind.cpp:1030
void SetBlockRuleEdges(TO_BLOCK *block)
Definition: tabfind.cpp:134
int RightEdgeForBox(const TBOX &box, bool crossing, bool extended)
Definition: tabfind.cpp:282
Definition: blobbox.h:705
TabVector_LIST * vectors()
Definition: tabfind.h:173
static bool VeryDifferentSizes(int size1, int size2)
Definition: tabfind.cpp:414
bool NothingYOverlapsInBox(const TBOX &search_box, const TBOX &target_box)
Definition: tabfind.cpp:791
TabVector_LIST vectors_
Definition: tabfind.h:371
const ICOORD & tright() const
Definition: bbgrid.h:76
void InsertBlobsToGrid(bool h_spread, bool v_spread, BLOBNBOX_LIST *blobs, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
Definition: tabfind.cpp:92
GenericVector< BLOBNBOX * > right_tab_boxes_
Definition: tabfind.h:380
void ApplyPartitionsToColumnWidths(ColPartitionGrid *part_grid, STATS *col_widths)
Definition: tabfind.cpp:980
BLOBNBOX * AdjacentBlob(const BLOBNBOX *bbox, bool look_left, bool ignore_images, double min_overlap_fraction, int gap_limit, int top_y, int bottom_y)
Definition: tabfind.cpp:1109
const int kColumnWidthFactor
Definition: tabfind.h:42
void SetBlobRuleEdges(BLOBNBOX_LIST *blobs)
Definition: tabfind.cpp:143