|
| TabFind (int gridsize, const ICOORD &bleft, const ICOORD &tright, TabVector_LIST *vlines, int vertical_x, int vertical_y, int resolution) |
|
virtual | ~TabFind () |
|
void | InsertBlobsToGrid (bool h_spread, bool v_spread, BLOBNBOX_LIST *blobs, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid) |
|
bool | InsertBlob (bool h_spread, bool v_spread, BLOBNBOX *blob, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid) |
|
void | SetBlockRuleEdges (TO_BLOCK *block) |
|
void | SetBlobRuleEdges (BLOBNBOX_LIST *blobs) |
|
int | GutterWidth (int bottom_y, int top_y, const TabVector &v, bool ignore_unmergeables, int max_gutter_width, int *required_shift) |
|
void | GutterWidthAndNeighbourGap (int tab_x, int mean_height, int max_gutter, bool left, BLOBNBOX *bbox, int *gutter_width, int *neighbour_gap) |
|
int | RightEdgeForBox (const TBOX &box, bool crossing, bool extended) |
|
int | LeftEdgeForBox (const TBOX &box, bool crossing, bool extended) |
|
TabVector * | RightTabForBox (const TBOX &box, bool crossing, bool extended) |
|
TabVector * | LeftTabForBox (const TBOX &box, bool crossing, bool extended) |
|
bool | CommonWidth (int width) |
|
WidthCallback * | WidthCB () |
|
const ICOORD & | image_origin () const |
|
| AlignedBlob (int gridsize, const ICOORD &bleft, const ICOORD &tright) |
|
virtual | ~AlignedBlob () |
|
ScrollView * | DisplayTabs (const char *window_name, ScrollView *tab_win) |
|
TabVector * | FindVerticalAlignment (AlignedBlobParams align_params, BLOBNBOX *bbox, int *vertical_x, int *vertical_y) |
|
| BlobGrid (int gridsize, const ICOORD &bleft, const ICOORD &tright) |
|
virtual | ~BlobGrid () |
|
void | InsertBlobList (BLOBNBOX_LIST *blobs) |
|
| BBGrid () |
|
| BBGrid (int gridsize, const ICOORD &bleft, const ICOORD &tright) |
|
virtual | ~BBGrid () |
|
void | Init (int gridsize, const ICOORD &bleft, const ICOORD &tright) |
|
void | Clear () |
|
void | ClearGridData (void(*free_method)(BLOBNBOX *)) |
|
void | InsertBBox (bool h_spread, bool v_spread, BLOBNBOX *bbox) |
|
void | InsertPixPtBBox (int left, int bottom, Pix *pix, BLOBNBOX *bbox) |
|
void | RemoveBBox (BLOBNBOX *bbox) |
|
bool | RectangleEmpty (const TBOX &rect) |
|
IntGrid * | CountCellElements () |
|
ScrollView * | MakeWindow (int x, int y, const char *window_name) |
|
void | DisplayBoxes (ScrollView *window) |
|
void | AssertNoDuplicates () |
|
virtual void | HandleClick (int x, int y) |
|
| GridBase ()=default |
|
| GridBase (int gridsize, const ICOORD &bleft, const ICOORD &tright) |
|
virtual | ~GridBase () |
|
void | Init (int gridsize, const ICOORD &bleft, const ICOORD &tright) |
|
int | gridsize () const |
|
int | gridwidth () const |
|
int | gridheight () const |
|
const ICOORD & | bleft () const |
|
const ICOORD & | tright () const |
|
void | GridCoords (int x, int y, int *grid_x, int *grid_y) const |
|
void | ClipGridCoords (int *x, int *y) const |
|
|
TabVector_LIST * | vectors () |
|
TabVector_LIST * | dead_vectors () |
|
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 | DontFindTabVectors (BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew) |
|
void | TidyBlobs (TO_BLOCK *block) |
|
void | SetupTabSearch (int x, int y, int *min_key, int *max_key) |
|
ScrollView * | DisplayTabVectors (ScrollView *tab_win) |
|
ScrollView * | FindInitialTabVectors (BLOBNBOX_LIST *image_blobs, int min_gutter_width, double tabfind_aligned_gap_fraction, TO_BLOCK *block) |
|
void | ResetForVerticalText (const FCOORD &rotate, const FCOORD &rerotate, TabVector_LIST *horizontal_lines, int *min_gutter_width) |
|
void | Reset () |
|
void | ReflectInYAxis () |
|
|
ScrollView * | FindTabBoxes (int min_gutter_width, double tabfind_aligned_gap_fraction) |
|
bool | TestBoxForTabs (BLOBNBOX *bbox, int min_gutter_width, double tabfind_aligned_gap_fraction) |
|
bool | ConfirmRaggedLeft (BLOBNBOX *bbox, int min_gutter) |
|
bool | ConfirmRaggedRight (BLOBNBOX *bbox, int min_gutter) |
|
bool | NothingYOverlapsInBox (const TBOX &search_box, const TBOX &target_box) |
|
void | FindAllTabVectors (int min_gutter_width) |
|
int | FindTabVectors (int search_size_multiple, TabAlignment alignment, int min_gutter_width, TabVector_LIST *vectors, int *vertical_x, int *vertical_y) |
|
TabVector * | FindTabVector (int search_size_multiple, int min_gutter_width, TabAlignment alignment, BLOBNBOX *bbox, int *vertical_x, int *vertical_y) |
|
void | SetVerticalSkewAndParallelize (int vertical_x, int vertical_y) |
|
void | SortVectors () |
|
void | EvaluateTabs () |
|
void | ComputeColumnWidths (ScrollView *tab_win, ColPartitionGrid *part_grid) |
|
void | ApplyPartitionsToColumnWidths (ColPartitionGrid *part_grid, STATS *col_widths) |
|
void | MakeColumnWidths (int col_widths_size, STATS *col_widths) |
|
void | MarkVerticalText () |
|
int | FindMedianGutterWidth (TabVector_LIST *tab_vectors) |
|
BLOBNBOX * | AdjacentBlob (const BLOBNBOX *bbox, bool look_left, bool ignore_images, double min_overlap_fraction, int gap_limit, int top_y, int bottom_y) |
|
void | AddPartnerVector (BLOBNBOX *left_blob, BLOBNBOX *right_blob, TabVector *left, TabVector *right) |
|
void | CleanupTabs () |
|
bool | Deskew (TabVector_LIST *hlines, BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew) |
|
void | ComputeDeskewVectors (FCOORD *deskew, FCOORD *reskew) |
|
void | ApplyTabConstraints () |
|
The TabFind class contains code to find tab-stops and maintain the vectors_ list of tab vectors. Also provides an interface to find neighbouring blobs in the grid of BLOBNBOXes that is used by multiple subclasses. Searching is a complex operation because of the need to enforce rule/separator lines, and tabstop boundaries, (when available), so as the holder of the list of TabVectors this class provides the functions.
TabVector * tesseract::TabFind::RightTabForBox |
( |
const TBOX & |
box, |
|
|
bool |
crossing, |
|
|
bool |
extended |
|
) |
| |
Return the TabVector that corresponds to the right edge for the given box. If there is a TabVector to the right that vertically overlaps it, then return it, otherwise return nullptr. Note that Right and Left refer to the position of the TabVector, not its type, ie RightTabForBox returns the nearest TabVector to the right of the box, regardless of its type. If a TabVector crosses right through the box (as opposed to grazing one edge or missing entirely), then crossing false will ignore such a line. Crossing true will return the line for BOTH left and right edges. If extended is true, then TabVectors are considered to extend to their extended_start/end_y, otherwise, just the startpt_ and endpt_. These functions make use of an internal iterator to the vectors_ list for speed when used repeatedly on neighbouring boxes. The caveat is that the iterator must be updated whenever the list is modified.