296 pixOr(photo_mask_pix, photo_mask_pix, nontext_map_);
303 pageseg_mode, rerotate_, input_block, nontext_map_, denorm_, cjk_script_,
304 &projection_, diacritic_blobs, &part_grid_, &big_parts_);
307 input_block,
this, pixa_debug, &part_grid_,
312 input_block,
this, pixa_debug, &part_grid_,
319 ColPartition_IT p_it(&big_parts_);
320 for (p_it.mark_cycle_pt(); !p_it.cycled_list(); p_it.forward())
321 p_it.data()->DisownBoxesNoAssert();
323 delete stroke_width_;
324 stroke_width_ = NULL;
329 input_block->ComputeEdgeOffsets(thresholds_pix, grey_pix);
345 bool input_is_rtl = input_block->block->right_to_left();
350 ReflectForRtl(input_block, &image_bblobs_);
363 min_gutter_width_, tabfind_aligned_gap_fraction_,
364 &part_grid_, &deskew_, &reskew_);
368 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f);
369 denorm_ = new_denorm;
375 if (!MakeColumns(
false)) {
384 #ifndef GRAPHICS_DISABLED 387 input_block->plot_graded_blobs(rej_win);
389 #endif // GRAPHICS_DISABLED 395 GridSplitPartitions();
399 GridMergePartitions();
402 InsertRemainingNoise(input_block);
404 GridInsertHLinePartitions();
405 GridInsertVLinePartitions();
417 if (equation_detect_) {
421 TableFinder table_finder;
424 table_finder.set_left_to_right_language(
425 !input_block->block->right_to_left());
428 table_finder.InsertCleanPartitions(&part_grid_, input_block);
430 table_finder.LocateTables(&part_grid_, best_columns_,
WidthCB(), reskew_);
432 GridRemoveUnderlinePartitions();
442 #ifndef GRAPHICS_DISABLED 445 if (window != NULL) {
454 #endif // GRAPHICS_DISABLED 460 ReleaseBlobsAndCleanupUnused(input_block);
468 TransformToBlocks(blocks, to_blocks);
470 tprintf(
"Found %d blocks, %d to_blocks\n",
471 blocks->length(), to_blocks->length());
474 DisplayBlocks(blocks);
475 RotateAndReskewBlocks(input_is_rtl, to_blocks);
477 #ifndef GRAPHICS_DISABLED 478 if (blocks_win_ != NULL) {
479 bool waiting =
false;
483 if (event->type ==
SVET_INPUT && event->parameter != NULL) {
484 if (*event->parameter ==
'd')
496 #endif // GRAPHICS_DISABLED bool PSM_SPARSE(int pageseg_mode)
bool textord_debug_printable
void DisplayBoxes(ScrollView *window)
void SetBlockRuleEdges(TO_BLOCK *block)
void InsertBlobsToGrid(bool h_spread, bool v_spread, BLOBNBOX_LIST *blobs, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
bool textord_tabfind_find_tables
void DeleteUnknownParts(TO_BLOCK *block)
ScrollView * DisplayTabVectors(ScrollView *tab_win)
ScrollView * MakeWindow(int x, int y, const char *window_name)
void ExtractPartitionsAsBlocks(BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks)
const ICOORD & bleft() const
void SetupNormalization(const BLOCK *block, const FCOORD *rotation, const DENORM *predecessor, float x_origin, float y_origin, float x_scale, float y_scale, float final_xshift, float final_yshift)
bool textord_tabfind_show_initial_partitions
void FindFigureCaptions()
void DontFindTabVectors(BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew)
void AssertNoDuplicates()
virtual int FindEquationParts(ColPartitionGrid *part_grid, ColPartitionSet **best_columns)=0
static void FindImagePartitions(Pix *image_pix, const FCOORD &rotation, const FCOORD &rerotation, TO_BLOCK *block, TabFind *tab_grid, DebugPixa *pixa_debug, ColPartitionGrid *part_grid, ColPartition_LIST *big_parts)
int textord_debug_tabfind
int textord_tabfind_show_partitions
const ICOORD & tright() const
void RefinePartitionPartners(bool get_desperate)
void TidyBlobs(TO_BLOCK *block)
ScrollView * FindInitialTabVectors(BLOBNBOX_LIST *image_blobs, int min_gutter_width, double tabfind_aligned_gap_fraction, TO_BLOCK *block)
void FindPartitionPartners()
static void TransferImagePartsToImageMask(const FCOORD &rerotation, ColPartitionGrid *part_grid, Pix *image_mask)
void FindLeaderPartitions(TO_BLOCK *block, ColPartitionGrid *part_grid)
bool PSM_COL_FIND_ENABLED(int pageseg_mode)
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)
bool textord_tabfind_show_reject_blobs
WidthCallback * WidthCB()
void ReTypeBlobs(BLOBNBOX_LIST *im_blobs)
void SetTabStops(TabFind *tabgrid)
void GradeBlobsIntoPartitions(PageSegMode pageseg_mode, const FCOORD &rerotation, TO_BLOCK *block, Pix *nontext_pix, const DENORM *denorm, bool cjk_script, TextlineProjection *projection, BLOBNBOX_LIST *diacritic_blobs, ColPartitionGrid *part_grid, ColPartition_LIST *big_parts)
void GridFindMargins(ColPartitionSet **best_columns)
SVEvent * AwaitEvent(SVEventType type)
void RemoveLineResidue(ColPartition_LIST *big_part_list)