tesseract
5.0.0-alpha-619-ge9db
|
#include <tabfind.h>
|
| TabFind (int gridsize, const ICOORD &bleft, const ICOORD &tright, TabVector_LIST *vlines, int vertical_x, int vertical_y, int resolution) |
|
| ~TabFind () override |
|
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) |
|
| ~AlignedBlob () override |
|
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) |
|
| ~BlobGrid () override |
|
void | InsertBlobList (BLOBNBOX_LIST *blobs) |
|
| BBGrid () |
|
| BBGrid (int gridsize, const ICOORD &bleft, const ICOORD &tright) |
|
| ~BBGrid () override |
|
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 () |
|
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.
Definition at line 52 of file tabfind.h.
◆ TabFind()
tesseract::TabFind::TabFind |
( |
int |
gridsize, |
|
|
const ICOORD & |
bleft, |
|
|
const ICOORD & |
tright, |
|
|
TabVector_LIST * |
vlines, |
|
|
int |
vertical_x, |
|
|
int |
vertical_y, |
|
|
int |
resolution |
|
) |
| |
Definition at line 65 of file tabfind.cpp.
70 image_origin_(0,
tright.
y() - 1),
73 v_it_.add_list_after(vlines);
74 SetVerticalSkewAndParallelize(vertical_x, vertical_y);
75 using namespace std::placeholders;
◆ ~TabFind()
tesseract::TabFind::~TabFind |
( |
| ) |
|
|
override |
◆ CommonWidth()
bool tesseract::TabFind::CommonWidth |
( |
int |
width | ) |
|
Return true if the given width is close to one of the common widths in column_widths_.
Definition at line 394 of file tabfind.cpp.
396 ICOORDELT_IT it(&column_widths_);
397 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
399 if (w->
x() - 1 <= width && width <= w->
y() + 1)
◆ dead_vectors()
TabVector_LIST* tesseract::TabFind::dead_vectors |
( |
| ) |
|
|
inlineprotected |
Definition at line 175 of file tabfind.h.
176 return &dead_vectors_;
◆ DifferentSizes()
bool tesseract::TabFind::DifferentSizes |
( |
int |
size1, |
|
|
int |
size2 |
|
) |
| |
|
static |
Return true if the sizes are more than a factor of 2 different.
Definition at line 407 of file tabfind.cpp.
408 return size1 > size2 * 2 || size2 > size1 * 2;
◆ DisplayTabVectors()
Display the tab vectors found in this grid.
Definition at line 497 of file tabfind.cpp.
498 #ifndef GRAPHICS_DISABLED
500 TabVector_IT it(&vectors_);
501 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
502 TabVector* vector = it.data();
503 vector->Display(tab_win);
◆ DontFindTabVectors()
void tesseract::TabFind::DontFindTabVectors |
( |
BLOBNBOX_LIST * |
image_blobs, |
|
|
TO_BLOCK * |
block, |
|
|
FCOORD * |
deskew, |
|
|
FCOORD * |
reskew |
|
) |
| |
|
protected |
◆ FindInitialTabVectors()
ScrollView * tesseract::TabFind::FindInitialTabVectors |
( |
BLOBNBOX_LIST * |
image_blobs, |
|
|
int |
min_gutter_width, |
|
|
double |
tabfind_aligned_gap_fraction, |
|
|
TO_BLOCK * |
block |
|
) |
| |
|
protected |
Definition at line 514 of file tabfind.cpp.
518 if (textord_tabfind_show_initialtabs) {
523 if (image_blobs !=
nullptr)
526 ScrollView* initial_win = FindTabBoxes(min_gutter_width,
527 tabfind_aligned_gap_fraction);
528 FindAllTabVectors(min_gutter_width);
533 if (textord_tabfind_show_initialtabs && initial_win !=
nullptr)
◆ FindTabVectors()
bool tesseract::TabFind::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 |
|
) |
| |
|
protected |
Top-level function to find TabVectors in an input page block. Returns false if the detected skew angle is impossible. Applies the detected skew angle to deskew the tabs, blobs and part_grid. tabfind_aligned_gap_fraction should be the value of parameter textord_tabfind_aligned_gap_fraction
Definition at line 422 of file tabfind.cpp.
429 tabfind_aligned_gap_fraction,
431 ComputeColumnWidths(tab_win, part_grid);
435 if (!Deskew(hlines, image_blobs, block, deskew, reskew))
437 part_grid->Deskew(*deskew);
438 ApplyTabConstraints();
439 #ifndef GRAPHICS_DISABLED
440 if (textord_tabfind_show_finaltabs) {
446 #endif // GRAPHICS_DISABLED
◆ GutterWidth()
int tesseract::TabFind::GutterWidth |
( |
int |
bottom_y, |
|
|
int |
top_y, |
|
|
const TabVector & |
v, |
|
|
bool |
ignore_unmergeables, |
|
|
int |
max_gutter_width, |
|
|
int * |
required_shift |
|
) |
| |
Definition at line 161 of file tabfind.cpp.
164 bool right_to_left = v.IsLeftTab();
165 int bottom_x = v.XAtY(bottom_y);
166 int top_x = v.XAtY(top_y);
167 int start_x = right_to_left ? std::max(top_x, bottom_x) : std::min(top_x, bottom_x);
169 sidesearch.StartSideSearch(start_x, bottom_y, top_y);
170 int min_gap = max_gutter_width;
173 while ((blob = sidesearch.NextSideSearch(right_to_left)) !=
nullptr) {
175 if (box.
bottom() >= top_y || box.
top() <= bottom_y)
184 int mid_y = (box.
bottom() + box.
top()) / 2;
189 int tab_x = v.XAtY(mid_y);
192 gap = tab_x - box.
right();
193 if (gap < 0 && box.
left() - tab_x < *required_shift)
194 *required_shift = box.
left() - tab_x;
196 gap = box.
left() - tab_x;
197 if (gap < 0 && box.
right() - tab_x > *required_shift)
198 *required_shift = box.
right() - tab_x;
200 if (gap > 0 && gap < min_gap)
204 return min_gap - abs(*required_shift);
◆ GutterWidthAndNeighbourGap()
void tesseract::TabFind::GutterWidthAndNeighbourGap |
( |
int |
tab_x, |
|
|
int |
mean_height, |
|
|
int |
max_gutter, |
|
|
bool |
left, |
|
|
BLOBNBOX * |
bbox, |
|
|
int * |
gutter_width, |
|
|
int * |
neighbour_gap |
|
) |
| |
Find the gutter width and distance to inner neighbour for the given blob.
Definition at line 208 of file tabfind.cpp.
214 int gutter_x = left ? box.
left() : box.
right();
215 int internal_x = left ? box.
right() : box.
left();
217 int tab_gap = left ? gutter_x - tab_x : tab_x - gutter_x;
218 *gutter_width = max_gutter;
222 *gutter_width += tab_gap;
225 tprintf(
"Looking in gutter\n");
227 BLOBNBOX* gutter_bbox = AdjacentBlob(bbox, left,
230 if (gutter_bbox !=
nullptr) {
232 *gutter_width = left ? tab_x - gutter_box.
right()
233 : gutter_box.
left() - tab_x;
235 if (*gutter_width >= max_gutter) {
237 TBOX gutter_box(box);
239 gutter_box.
set_left(tab_x - max_gutter - 1);
240 gutter_box.
set_right(tab_x - max_gutter);
242 if (tab_gutter < tab_x - 1)
243 *gutter_width = tab_x - tab_gutter;
245 gutter_box.
set_left(tab_x + max_gutter);
246 gutter_box.
set_right(tab_x + max_gutter + 1);
248 if (tab_gutter > tab_x + 1)
249 *gutter_width = tab_gutter - tab_x;
252 if (*gutter_width > max_gutter)
253 *gutter_width = max_gutter;
256 tprintf(
"Looking for neighbour\n");
257 BLOBNBOX* neighbour = AdjacentBlob(bbox, !left,
262 if (neighbour !=
nullptr) {
268 if (left && n_box.
left() < neighbour_edge)
269 neighbour_edge = n_box.
left();
270 else if (!left && n_box.
right() > neighbour_edge)
271 neighbour_edge = n_box.
right();
273 *neighbour_gap = left ? neighbour_edge - internal_x
274 : internal_x - neighbour_edge;
◆ image_origin()
const ICOORD& tesseract::TabFind::image_origin |
( |
| ) |
const |
|
inline |
Return the coords at which to draw the image backdrop.
Definition at line 164 of file tabfind.h.
165 return image_origin_;
◆ InsertBlob()
bool tesseract::TabFind::InsertBlob |
( |
bool |
h_spread, |
|
|
bool |
v_spread, |
|
|
BLOBNBOX * |
blob, |
|
|
BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > * |
grid |
|
) |
| |
Insert a single blob into the given grid (not necessarily this). If h_spread, then all cells covered horizontally by the box are used, otherwise, just the bottom-left. Similarly for v_spread. A side effect is that the left and right rule edges of the blob are set according to the tab vectors in this (not grid).
Definition at line 118 of file tabfind.cpp.
◆ InsertBlobsToGrid()
void tesseract::TabFind::InsertBlobsToGrid |
( |
bool |
h_spread, |
|
|
bool |
v_spread, |
|
|
BLOBNBOX_LIST * |
blobs, |
|
|
BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > * |
grid |
|
) |
| |
Insert a list of blobs into the given grid (not necessarily this). See InsertBlob for the other arguments. It would seem to make more sense to swap this and grid, but this way around allows grid to not be derived from TabFind, eg a ColPartitionGrid, while the grid that provides the tab stops(this) has to be derived from TabFind.
Definition at line 91 of file tabfind.cpp.
95 BLOBNBOX_IT blob_it(blobs);
98 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
101 if (
InsertBlob(h_spread, v_spread, blob, grid)) {
108 tprintf(
"Inserted %d blobs into grid, %d rejected.\n",
109 b_count, reject_count);
◆ LeftEdgeForBox()
int tesseract::TabFind::LeftEdgeForBox |
( |
const TBOX & |
box, |
|
|
bool |
crossing, |
|
|
bool |
extended |
|
) |
| |
As RightEdgeForBox, but finds the left Edge instead.
Definition at line 286 of file tabfind.cpp.
◆ LeftTabForBox()
TabVector * tesseract::TabFind::LeftTabForBox |
( |
const TBOX & |
box, |
|
|
bool |
crossing, |
|
|
bool |
extended |
|
) |
| |
As RightTabForBox, but finds the left TabVector instead.
Definition at line 348 of file tabfind.cpp.
352 int top_y = box.
top();
353 int bottom_y = box.
bottom();
354 int mid_y = (top_y + bottom_y) / 2;
355 int left = crossing ? (box.
left() + box.
right()) / 2 : box.
left();
356 int min_key, max_key;
359 while (!v_it_.at_last() && v_it_.data()->sort_key() <= max_key)
361 while (!v_it_.at_first() && v_it_.data()->sort_key() > max_key) {
365 TabVector* best_v =
nullptr;
369 TabVector* v = v_it_.data();
370 int x = v->XAtY(mid_y);
372 (v->VOverlap(top_y, bottom_y) > 0 ||
373 (extended && v->ExtendedOverlap(top_y, bottom_y) > 0))) {
374 if (best_v ==
nullptr || x > best_x) {
379 key_limit = v->sort_key() - (max_key - min_key);
384 if (v_it_.at_first() ||
385 (best_v !=
nullptr && v->sort_key() < key_limit))
388 }
while (!v_it_.at_last());
◆ ReflectInYAxis()
void tesseract::TabFind::ReflectInYAxis |
( |
| ) |
|
|
protected |
Definition at line 1356 of file tabfind.cpp.
1357 TabVector_LIST temp_list;
1358 TabVector_IT temp_it(&temp_list);
1359 v_it_.move_to_first();
1363 while (!v_it_.empty()) {
1364 TabVector* v = v_it_.extract();
1366 v->ReflectInYAxis();
1367 temp_it.add_before_then_move(v);
1369 v_it_.add_list_after(&temp_list);
1370 v_it_.move_to_first();
1373 int tmp = grid_box.left();
1374 grid_box.set_left(-grid_box.right());
1375 grid_box.set_right(-tmp);
1376 Init(
gridsize(), grid_box.botleft(), grid_box.topright());
◆ Reset()
void tesseract::TabFind::Reset |
( |
| ) |
|
|
protected |
Definition at line 1345 of file tabfind.cpp.
1346 v_it_.move_to_first();
1347 for (v_it_.mark_cycle_pt(); !v_it_.cycled_list(); v_it_.forward()) {
1348 if (!v_it_.data()->IsSeparator())
1349 delete v_it_.extract();
◆ ResetForVerticalText()
void tesseract::TabFind::ResetForVerticalText |
( |
const FCOORD & |
rotate, |
|
|
const FCOORD & |
rerotate, |
|
|
TabVector_LIST * |
horizontal_lines, |
|
|
int * |
min_gutter_width |
|
) |
| |
|
protected |
Definition at line 1300 of file tabfind.cpp.
1306 TabVector_LIST ex_verticals;
1307 TabVector_IT ex_v_it(&ex_verticals);
1308 TabVector_LIST vlines;
1309 TabVector_IT v_it(&vlines);
1310 while (!v_it_.empty()) {
1311 TabVector* v = v_it_.extract();
1312 if (v->IsSeparator()) {
1314 ex_v_it.add_after_then_move(v);
1316 v_it.add_after_then_move(v);
1323 int median_gutter = FindMedianGutterWidth(&vlines);
1324 if (median_gutter > *min_gutter_width)
1325 *min_gutter_width = median_gutter;
1327 TabVector_IT h_it(horizontal_lines);
1328 for (h_it.mark_cycle_pt(); !h_it.cycled_list(); h_it.forward()) {
1329 TabVector* h = h_it.data();
1332 v_it_.add_list_after(horizontal_lines);
1333 v_it_.move_to_first();
1334 h_it.set_to_list(horizontal_lines);
1335 h_it.add_list_after(&ex_verticals);
1339 grid_box.rotate_large(rotate);
1340 Init(
gridsize(), grid_box.botleft(), grid_box.topright());
◆ RightEdgeForBox()
int tesseract::TabFind::RightEdgeForBox |
( |
const TBOX & |
box, |
|
|
bool |
crossing, |
|
|
bool |
extended |
|
) |
| |
Return the x-coord that corresponds to the right edge for the given box. If there is a rule line to the right that vertically overlaps it, then return the x-coord of the rule line, otherwise return the right edge of the page. For details see RightTabForBox below.
Definition at line 281 of file tabfind.cpp.
◆ RightTabForBox()
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.
Definition at line 304 of file tabfind.cpp.
308 int top_y = box.
top();
309 int bottom_y = box.
bottom();
310 int mid_y = (top_y + bottom_y) / 2;
311 int right = crossing ? (box.
left() + box.
right()) / 2 : box.
right();
312 int min_key, max_key;
315 while (!v_it_.at_first() && v_it_.data()->sort_key() >= min_key)
317 while (!v_it_.at_last() && v_it_.data()->sort_key() < min_key)
320 TabVector* best_v =
nullptr;
324 TabVector* v = v_it_.data();
325 int x = v->XAtY(mid_y);
327 (v->VOverlap(top_y, bottom_y) > 0 ||
328 (extended && v->ExtendedOverlap(top_y, bottom_y) > 0))) {
329 if (best_v ==
nullptr || x < best_x) {
334 key_limit = v->sort_key() + max_key - min_key;
339 if (v_it_.at_last() ||
340 (best_v !=
nullptr && v->sort_key() > key_limit))
343 }
while (!v_it_.at_first());
◆ RotateBlobList()
void tesseract::TabFind::RotateBlobList |
( |
const FCOORD & |
rotation, |
|
|
BLOBNBOX_LIST * |
blobs |
|
) |
| |
|
staticprotected |
Definition at line 1256 of file tabfind.cpp.
1257 BLOBNBOX_IT it(blobs);
1258 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
1259 it.data()->rotate_box(rotation);
◆ SetBlobRuleEdges()
void tesseract::TabFind::SetBlobRuleEdges |
( |
BLOBNBOX_LIST * |
blobs | ) |
|
Definition at line 142 of file tabfind.cpp.
143 BLOBNBOX_IT blob_it(blobs);
144 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
◆ SetBlockRuleEdges()
void tesseract::TabFind::SetBlockRuleEdges |
( |
TO_BLOCK * |
block | ) |
|
◆ SetupTabSearch()
void tesseract::TabFind::SetupTabSearch |
( |
int |
x, |
|
|
int |
y, |
|
|
int * |
min_key, |
|
|
int * |
max_key |
|
) |
| |
|
protected |
Definition at line 490 of file tabfind.cpp.
493 *min_key = std::min(key1, key2);
494 *max_key = std::max(key1, key2);
◆ TidyBlobs()
void tesseract::TabFind::TidyBlobs |
( |
TO_BLOCK * |
block | ) |
|
|
protected |
Definition at line 465 of file tabfind.cpp.
467 BLOBNBOX_IT blob_it = &block->
blobs;
469 for (large_it.mark_cycle_pt(); !large_it.cycled_list(); large_it.forward()) {
470 BLOBNBOX* large_blob = large_it.data();
471 if (large_blob->
owner() !=
nullptr) {
472 blob_it.add_to_end(large_it.extract());
477 tprintf(
"Moved %d large blobs to normal list\n",
479 #ifndef GRAPHICS_DISABLED
484 #endif // GRAPHICS_DISABLED
◆ vectors()
TabVector_LIST* tesseract::TabFind::vectors |
( |
| ) |
|
|
inlineprotected |
◆ VeryDifferentSizes()
bool tesseract::TabFind::VeryDifferentSizes |
( |
int |
size1, |
|
|
int |
size2 |
|
) |
| |
|
static |
Return true if the sizes are more than a factor of 5 different.
Definition at line 413 of file tabfind.cpp.
414 return size1 > size2 * 5 || size2 > size1 * 5;
◆ WidthCB()
Return a callback for testing CommonWidth.
Definition at line 157 of file tabfind.h.
◆ resolution_
int tesseract::TabFind::resolution_ |
|
protected |
Of source image in pixels per inch.
Definition at line 367 of file tabfind.h.
◆ vertical_skew_
ICOORD tesseract::TabFind::vertical_skew_ |
|
protected |
Estimate of true vertical in this image.
Definition at line 366 of file tabfind.h.
The documentation for this class was generated from the following files:
BLOBNBOX_LIST small_blobs
void plot_graded_blobs(ScrollView *to_win)
static int SortKey(const ICOORD &vertical, int x, int y)
void plot_noise_blobs(ScrollView *to_win)
void InsertBBox(bool h_spread, bool v_spread, BBC *bbox)
ScrollView * MakeWindow(int x, int y, const char *window_name)
BLOBNBOX_LIST noise_blobs
void SetBlobRuleEdges(BLOBNBOX_LIST *blobs)
void set_x(float xin)
rewrite function
const int kColumnWidthFactor
void DeleteUnownedNoise()
void SetupTabSearch(int x, int y, int *min_key, int *max_key)
int16_t x() const
access function
void set_y(float yin)
rewrite function
void InsertBlobsToGrid(bool h_spread, bool v_spread, BLOBNBOX_LIST *blobs, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
static bool UnMergeableType(BlobRegionType type)
const ICOORD & tright() const
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.
BLOBNBOX_LIST large_blobs
int LeftEdgeForBox(const TBOX &box, bool crossing, bool extended)
static bool WithinTestRegion(int detail_level, int x, int y)
bool joined_to_prev() const
void set_left_rule(int new_left)
void set_right_crossing_rule(int new_right)
void set_left_crossing_rule(int new_left)
const TBOX & bounding_box() const
ICOORD vertical_skew_
Estimate of true vertical in this image.
TabVector * RightTabForBox(const TBOX &box, bool crossing, bool extended)
static void MergeSimilarTabVectors(const ICOORD &vertical, TabVector_LIST *vectors, BlobGrid *grid)
TabVector * LeftTabForBox(const TBOX &box, bool crossing, bool extended)
ScrollView * DisplayTabVectors(ScrollView *tab_win)
void DisplayBoxes(ScrollView *window)
void Init(int gridsize, const ICOORD &bleft, const ICOORD &tright)
BlobTextFlowType flow() const
ScrollView * DisplayTabs(const char *window_name, ScrollView *tab_win)
BlobRegionType region_type() const
DLLSYM void tprintf(const char *format,...)
bool InsertBlob(bool h_spread, bool v_spread, BLOBNBOX *blob, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
const double kLineFragmentAspectRatio
tesseract::ColPartition * owner() const
GridSearch< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > BlobGridSearch
int textord_debug_tabfind
const ICOORD & bleft() const
AlignedBlob(int gridsize, const ICOORD &bleft, const ICOORD &tright)
int16_t y() const
access_function
void set_right_rule(int new_right)