292 pixOr(photo_mask_pix, photo_mask_pix, nontext_map_);
299 pageseg_mode, rerotate_, input_block, nontext_map_, denorm_, cjk_script_,
300 &projection_, diacritic_blobs, &part_grid_, &big_parts_);
303 input_block,
this, pixa_debug, &part_grid_,
308 input_block,
this, pixa_debug, &part_grid_,
315 ColPartition_IT p_it(&big_parts_);
316 for (p_it.mark_cycle_pt(); !p_it.cycled_list(); p_it.forward())
317 p_it.data()->DisownBoxesNoAssert();
319 delete stroke_width_;
320 stroke_width_ =
nullptr;
325 input_block->ComputeEdgeOffsets(thresholds_pix, grey_pix);
341 bool input_is_rtl = input_block->block->right_to_left();
346 ReflectForRtl(input_block, &image_bblobs_);
359 min_gutter_width_, tabfind_aligned_gap_fraction_,
360 &part_grid_, &deskew_, &reskew_);
364 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f);
365 denorm_ = new_denorm;
371 if (!MakeColumns(
false)) {
380 #ifndef GRAPHICS_DISABLED 383 input_block->plot_graded_blobs(rej_win);
385 #endif // GRAPHICS_DISABLED 391 GridSplitPartitions();
395 GridMergePartitions();
398 InsertRemainingNoise(input_block);
400 GridInsertHLinePartitions();
401 GridInsertVLinePartitions();
413 if (equation_detect_) {
417 TableFinder table_finder;
420 table_finder.set_left_to_right_language(
421 !input_block->block->right_to_left());
424 table_finder.InsertCleanPartitions(&part_grid_, input_block);
426 table_finder.LocateTables(&part_grid_, best_columns_,
WidthCB(), reskew_);
428 GridRemoveUnderlinePartitions();
438 #ifndef GRAPHICS_DISABLED 441 if (window !=
nullptr) {
450 #endif // GRAPHICS_DISABLED 456 ReleaseBlobsAndCleanupUnused(input_block);
464 TransformToBlocks(blocks, to_blocks);
466 tprintf(
"Found %d blocks, %d to_blocks\n",
467 blocks->length(), to_blocks->length());
470 DisplayBlocks(blocks);
471 RotateAndReskewBlocks(input_is_rtl, to_blocks);
473 #ifndef GRAPHICS_DISABLED 474 if (blocks_win_ !=
nullptr) {
475 bool waiting =
false;
479 if (event->type ==
SVET_INPUT && event->parameter !=
nullptr) {
480 if (*event->parameter ==
'd')
485 blocks_win_ =
nullptr;
492 #endif // GRAPHICS_DISABLED void ReTypeBlobs(BLOBNBOX_LIST *im_blobs)
void AssertNoDuplicates()
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)
static void TransferImagePartsToImageMask(const FCOORD &rerotation, ColPartitionGrid *part_grid, Pix *image_mask)
bool textord_tabfind_find_tables
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)
ScrollView * MakeWindow(int x, int y, const char *window_name)
void DeleteUnknownParts(TO_BLOCK *block)
void GridFindMargins(ColPartitionSet **best_columns)
void FindPartitionPartners()
bool PSM_SPARSE(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)
const ICOORD & bleft() const
void TidyBlobs(TO_BLOCK *block)
ScrollView * DisplayTabVectors(ScrollView *tab_win)
void RemoveLineResidue(ColPartition_LIST *big_part_list)
void SetTabStops(TabFind *tabgrid)
bool textord_tabfind_show_reject_blobs
void FindFigureCaptions()
bool PSM_COL_FIND_ENABLED(int pageseg_mode)
bool textord_tabfind_show_initial_partitions
bool textord_debug_printable
void FindLeaderPartitions(TO_BLOCK *block, ColPartitionGrid *part_grid)
int textord_tabfind_show_partitions
SVEvent * AwaitEvent(SVEventType type)
int textord_debug_tabfind
virtual int FindEquationParts(ColPartitionGrid *part_grid, ColPartitionSet **best_columns)=0
WidthCallback * WidthCB()
ScrollView * FindInitialTabVectors(BLOBNBOX_LIST *image_blobs, int min_gutter_width, double tabfind_aligned_gap_fraction, TO_BLOCK *block)
DLLSYM void tprintf(const char *format,...)
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 DontFindTabVectors(BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew)
void InsertBlobsToGrid(bool h_spread, bool v_spread, BLOBNBOX_LIST *blobs, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
void RefinePartitionPartners(bool get_desperate)
void ExtractPartitionsAsBlocks(BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks)
void DisplayBoxes(ScrollView *window)
void SetBlockRuleEdges(TO_BLOCK *block)
const ICOORD & tright() const