288 pixOr(photo_mask_pix, photo_mask_pix, nontext_map_);
294 denorm_, &projection_,
295 &part_grid_, &big_parts_);
297 input_block,
this, &part_grid_, &big_parts_);
301 input_block,
this, &part_grid_, &big_parts_);
306 ColPartition_IT p_it(&big_parts_);
307 for (p_it.mark_cycle_pt(); !p_it.cycled_list(); p_it.forward())
308 p_it.data()->DisownBoxes();
310 delete stroke_width_;
311 stroke_width_ =
NULL;
327 bool input_is_rtl = input_block->block->right_to_left();
332 ReflectForRtl(input_block, &image_bblobs_);
344 min_gutter_width_, &part_grid_, &deskew_, &reskew_);
348 0.0
f, 0.0
f, 1.0
f, 1.0
f, 0.0
f, 0.0
f);
349 denorm_ = new_denorm;
355 if (!MakeColumns(single_column)) {
363 #ifndef GRAPHICS_DISABLED
366 input_block->plot_graded_blobs(rej_win);
368 #endif // GRAPHICS_DISABLED
374 GridSplitPartitions();
378 GridMergePartitions();
381 InsertRemainingNoise(input_block);
383 GridInsertHLinePartitions();
384 GridInsertVLinePartitions();
394 if (equation_detect_) {
398 TableFinder table_finder;
401 table_finder.set_left_to_right_language(
402 !input_block->block->right_to_left());
405 table_finder.InsertCleanPartitions(&part_grid_, input_block);
407 table_finder.LocateTables(&part_grid_, best_columns_,
WidthCB(), reskew_);
409 GridRemoveUnderlinePartitions();
419 #ifndef GRAPHICS_DISABLED
432 #endif // GRAPHICS_DISABLED
437 ReleaseBlobsAndCleanupUnused(input_block);
442 TransformToBlocks(blocks, to_blocks);
444 tprintf(
"Found %d blocks, %d to_blocks\n",
445 blocks->length(), to_blocks->length());
448 DisplayBlocks(blocks);
449 RotateAndReskewBlocks(input_is_rtl, to_blocks);
451 #ifndef GRAPHICS_DISABLED
452 if (blocks_win_ !=
NULL) {
453 bool waiting =
false;
458 if (*event->parameter ==
'd')
470 #endif // GRAPHICS_DISABLED
ScrollView * FindInitialTabVectors(BLOBNBOX_LIST *image_blobs, int min_gutter_width, TO_BLOCK *block)
void ReTypeBlobs(BLOBNBOX_LIST *im_blobs)
WidthCallback * WidthCB()
virtual int FindEquationParts(ColPartitionGrid *part_grid, ColPartitionSet **best_columns)=0
bool FindTabVectors(TabVector_LIST *hlines, BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, int min_gutter_width, ColPartitionGrid *part_grid, FCOORD *deskew, FCOORD *reskew)
void SetBlockRuleEdges(TO_BLOCK *block)
bool textord_debug_images
bool textord_tabfind_show_initial_partitions
void DisplayBoxes(ScrollView *window)
void DontFindTabVectors(BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew)
void SetTabStops(TabFind *tabgrid)
int textord_debug_tabfind
void FindPartitionPartners()
static void TransferImagePartsToImageMask(const FCOORD &rerotation, ColPartitionGrid *part_grid, Pix *image_mask)
void GradeBlobsIntoPartitions(const FCOORD &rerotation, TO_BLOCK *block, Pix *nontext_pix, const DENORM *denorm, TextlineProjection *projection, ColPartitionGrid *part_grid, ColPartition_LIST *big_parts)
bool textord_debug_printable
void FindLeaderPartitions(TO_BLOCK *block, ColPartitionGrid *part_grid)
void InsertBlobsToGrid(bool h_spread, bool v_spread, BLOBNBOX_LIST *blobs, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
void GridFindMargins(ColPartitionSet **best_columns)
bool textord_tabfind_find_tables
void FindFigureCaptions()
DLLSYM void tprintf(const char *format,...)
void AssertNoDuplicates()
const ICOORD & tright() const
void DeleteUnknownParts(TO_BLOCK *block)
void SetupNormalization(const BLOCK *block, const ROW *row, const FCOORD *rotation, const DENORM *predecessor, const DENORM_SEG *segs, int num_segs, float x_origin, float y_origin, float x_scale, float y_scale, float final_xshift, float final_yshift)
static const STRING & textord_debug_pix()
ScrollView * DisplayTabVectors(ScrollView *tab_win)
bool textord_tabfind_show_reject_blobs
static void FindImagePartitions(Pix *image_pix, const FCOORD &rotation, const FCOORD &rerotation, TO_BLOCK *block, TabFind *tab_grid, ColPartitionGrid *part_grid, ColPartition_LIST *big_parts)
const ICOORD & image_origin() const
void TidyBlobs(TO_BLOCK *block)
const ICOORD & bleft() const
void RemoveLineResidue(ColPartition_LIST *big_part_list)
void RefinePartitionPartners(bool get_desperate)
int textord_tabfind_show_partitions
ScrollView * MakeWindow(int x, int y, const char *window_name)