20 #ifndef TESSERACT_TEXTORD_TABFIND_H_ 21 #define TESSERACT_TEXTORD_TABFIND_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,
166 return image_origin_;
177 return &dead_vectors_;
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);
247 ScrollView* FindTabBoxes(
int min_gutter_width,
248 double tabfind_aligned_gap_fraction);
254 bool TestBoxForTabs(
BLOBNBOX* bbox,
int min_gutter_width,
255 double tabfind_aligned_gap_fraction);
259 bool ConfirmRaggedLeft(
BLOBNBOX* bbox,
int min_gutter);
262 bool ConfirmRaggedRight(
BLOBNBOX* bbox,
int min_gutter);
265 bool NothingYOverlapsInBox(
const TBOX& search_box,
const TBOX& target_box);
269 void FindAllTabVectors(
int min_gutter_width);
273 int min_gutter_width,
275 int* vertical_x,
int* vertical_y);
283 TabVector* FindTabVector(
int search_size_multiple,
int min_gutter_width,
286 int* vertical_x,
int* vertical_y);
290 void SetVerticalSkewAndParallelize(
int vertical_x,
int vertical_y);
316 void MakeColumnWidths(
int col_widths_size,
STATS* col_widths);
319 void MarkVerticalText();
324 int FindMedianGutterWidth(TabVector_LIST* tab_vectors);
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,
358 void ComputeDeskewVectors(
FCOORD* deskew,
FCOORD* reskew);
364 void ApplyTabConstraints();
371 TabVector_LIST vectors_;
373 TabVector_LIST dead_vectors_;
375 ICOORDELT_LIST column_widths_;
385 #endif // TESSERACT_TEXTORD_TABFIND_H_ static bool DifferentSizes(int size1, int size2)
void GutterWidthAndNeighbourGap(int tab_x, int mean_height, int max_gutter, bool left, BLOBNBOX *bbox, int *gutter_width, int *neighbour_gap)
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)
const ICOORD & bleft() const
int RightEdgeForBox(const TBOX &box, bool crossing, bool extended)
void TidyBlobs(TO_BLOCK *block)
int LeftEdgeForBox(const TBOX &box, bool crossing, bool extended)
ScrollView * DisplayTabVectors(ScrollView *tab_win)
TabVector * RightTabForBox(const TBOX &box, bool crossing, bool extended)
TabVector * LeftTabForBox(const TBOX &box, bool crossing, bool extended)
bool InsertBlob(bool h_spread, bool v_spread, BLOBNBOX *blob, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
const int kColumnWidthFactor
bool CommonWidth(int width)
int GutterWidth(int bottom_y, int top_y, const TabVector &v, bool ignore_unmergeables, int max_gutter_width, int *required_shift)
static bool VeryDifferentSizes(int size1, int size2)
WidthCallback * WidthCB()
ScrollView * FindInitialTabVectors(BLOBNBOX_LIST *image_blobs, int min_gutter_width, double tabfind_aligned_gap_fraction, TO_BLOCK *block)
const ICOORD & image_origin() const
void DontFindTabVectors(BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew)
TabFind(int gridsize, const ICOORD &bleft, const ICOORD &tright, TabVector_LIST *vlines, int vertical_x, int vertical_y, int resolution)
void SetupTabSearch(int x, int y, int *min_key, int *max_key)
void InsertBlobsToGrid(bool h_spread, bool v_spread, BLOBNBOX_LIST *blobs, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
void SetBlobRuleEdges(BLOBNBOX_LIST *blobs)
TabVector_LIST * dead_vectors()
TabVector_LIST * vectors()
static void RotateBlobList(const FCOORD &rotation, BLOBNBOX_LIST *blobs)
void SetBlockRuleEdges(TO_BLOCK *block)
const ICOORD & tright() const
void ResetForVerticalText(const FCOORD &rotate, const FCOORD &rerotate, TabVector_LIST *horizontal_lines, int *min_gutter_width)