tesseract
5.0.0-alpha-619-ge9db
|
Go to the documentation of this file.
19 #ifndef TESSERACT_TEXTORD_TABFIND_H_
20 #define TESSERACT_TEXTORD_TABFIND_H_
55 TabVector_LIST* vlines,
int vertical_x,
int vertical_y,
94 bool ignore_unmergeables,
int max_gutter_width,
100 int max_gutter,
bool left,
165 return image_origin_;
176 return &dead_vectors_;
187 BLOBNBOX_LIST* image_blobs,
TO_BLOCK* block,
188 int min_gutter_width,
double tabfind_aligned_gap_fraction,
218 int min_gutter_width,
219 double tabfind_aligned_gap_fraction,
230 TabVector_LIST* horizontal_lines,
231 int* min_gutter_width);
246 ScrollView* FindTabBoxes(
int min_gutter_width,
247 double tabfind_aligned_gap_fraction);
253 bool TestBoxForTabs(
BLOBNBOX* bbox,
int min_gutter_width,
254 double tabfind_aligned_gap_fraction);
258 bool ConfirmRaggedLeft(
BLOBNBOX* bbox,
int min_gutter);
261 bool ConfirmRaggedRight(
BLOBNBOX* bbox,
int min_gutter);
264 bool NothingYOverlapsInBox(
const TBOX& search_box,
const TBOX& target_box);
268 void FindAllTabVectors(
int min_gutter_width);
272 int min_gutter_width,
274 int* vertical_x,
int* vertical_y);
282 TabVector* FindTabVector(
int search_size_multiple,
int min_gutter_width,
285 int* vertical_x,
int* vertical_y);
289 void SetVerticalSkewAndParallelize(
int vertical_x,
int vertical_y);
315 void MakeColumnWidths(
int col_widths_size,
STATS* col_widths);
318 void MarkVerticalText();
323 int FindMedianGutterWidth(TabVector_LIST* tab_vectors);
331 bool look_left,
bool ignore_images,
332 double min_overlap_fraction,
333 int gap_limit,
int top_y,
int bottom_y);
353 bool Deskew(TabVector_LIST* hlines, BLOBNBOX_LIST* image_blobs,
357 void ComputeDeskewVectors(
FCOORD* deskew,
FCOORD* reskew);
363 void ApplyTabConstraints();
370 TabVector_LIST vectors_;
372 TabVector_LIST dead_vectors_;
374 ICOORDELT_LIST column_widths_;
384 #endif // TESSERACT_TEXTORD_TABFIND_H_
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)
void SetBlobRuleEdges(BLOBNBOX_LIST *blobs)
const int kColumnWidthFactor
std::function< bool(int)> WidthCallback
void SetupTabSearch(int x, int y, int *min_key, int *max_key)
void GutterWidthAndNeighbourGap(int tab_x, int mean_height, int max_gutter, bool left, BLOBNBOX *bbox, int *gutter_width, int *neighbour_gap)
void InsertBlobsToGrid(bool h_spread, bool v_spread, BLOBNBOX_LIST *blobs, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
const ICOORD & tright() const
int GutterWidth(int bottom_y, int top_y, const TabVector &v, bool ignore_unmergeables, int max_gutter_width, int *required_shift)
ScrollView * FindInitialTabVectors(BLOBNBOX_LIST *image_blobs, int min_gutter_width, double tabfind_aligned_gap_fraction, TO_BLOCK *block)
int RightEdgeForBox(const TBOX &box, bool crossing, bool extended)
bool CommonWidth(int width)
int resolution_
Of source image in pixels per inch.
int LeftEdgeForBox(const TBOX &box, bool crossing, bool extended)
TabVector_LIST * vectors()
void DontFindTabVectors(BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew)
static bool DifferentSizes(int size1, int size2)
static bool VeryDifferentSizes(int size1, int size2)
ICOORD vertical_skew_
Estimate of true vertical in this image.
TabVector * RightTabForBox(const TBOX &box, bool crossing, bool extended)
TabFind(int gridsize, const ICOORD &bleft, const ICOORD &tright, TabVector_LIST *vlines, int vertical_x, int vertical_y, int resolution)
void SetBlockRuleEdges(TO_BLOCK *block)
TabVector * LeftTabForBox(const TBOX &box, bool crossing, bool extended)
ScrollView * DisplayTabVectors(ScrollView *tab_win)
void ResetForVerticalText(const FCOORD &rotate, const FCOORD &rerotate, TabVector_LIST *horizontal_lines, int *min_gutter_width)
bool InsertBlob(bool h_spread, bool v_spread, BLOBNBOX *blob, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
TabVector_LIST * dead_vectors()
const ICOORD & image_origin() const
void TidyBlobs(TO_BLOCK *block)
const ICOORD & bleft() const
static void RotateBlobList(const FCOORD &rotation, BLOBNBOX_LIST *blobs)