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, &part_grid_, &big_parts_);
311 input_block,
this, &part_grid_, &big_parts_);
317 ColPartition_IT p_it(&big_parts_);
318 for (p_it.mark_cycle_pt(); !p_it.cycled_list(); p_it.forward())
319 p_it.data()->DisownBoxesNoAssert();
321 delete stroke_width_;
322 stroke_width_ = NULL;
327 input_block->ComputeEdgeOffsets(thresholds_pix, grey_pix);
343 bool input_is_rtl = input_block->block->right_to_left();
348 ReflectForRtl(input_block, &image_bblobs_);
361 min_gutter_width_, tabfind_aligned_gap_fraction_,
362 &part_grid_, &deskew_, &reskew_);
366 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f);
367 denorm_ = new_denorm;
373 if (!MakeColumns(
false)) {
382 #ifndef GRAPHICS_DISABLED 385 input_block->plot_graded_blobs(rej_win);
387 #endif // GRAPHICS_DISABLED 393 GridSplitPartitions();
397 GridMergePartitions();
400 InsertRemainingNoise(input_block);
402 GridInsertHLinePartitions();
403 GridInsertVLinePartitions();
415 if (equation_detect_) {
419 TableFinder table_finder;
422 table_finder.set_left_to_right_language(
423 !input_block->block->right_to_left());
426 table_finder.InsertCleanPartitions(&part_grid_, input_block);
428 table_finder.LocateTables(&part_grid_, best_columns_,
WidthCB(), reskew_);
430 GridRemoveUnderlinePartitions();
440 #ifndef GRAPHICS_DISABLED 443 if (window != NULL) {
455 #endif // GRAPHICS_DISABLED 461 ReleaseBlobsAndCleanupUnused(input_block);
469 TransformToBlocks(blocks, to_blocks);
471 tprintf(
"Found %d blocks, %d to_blocks\n",
472 blocks->length(), to_blocks->length());
475 DisplayBlocks(blocks);
476 RotateAndReskewBlocks(input_is_rtl, to_blocks);
478 #ifndef GRAPHICS_DISABLED 479 if (blocks_win_ != NULL) {
480 bool waiting =
false;
484 if (event->type ==
SVET_INPUT && event->parameter != NULL) {
485 if (*event->parameter ==
'd')
497 #endif // GRAPHICS_DISABLED bool textord_tabfind_show_initial_partitions
bool PSM_COL_FIND_ENABLED(int pageseg_mode)
void Image(struct Pix *image, int x_pos, int y_pos)
void SetBlockRuleEdges(TO_BLOCK *block)
void FindFigureCaptions()
const ICOORD & tright() const
bool textord_debug_images
void TidyBlobs(TO_BLOCK *block)
int textord_tabfind_show_partitions
static void TransferImagePartsToImageMask(const FCOORD &rerotation, ColPartitionGrid *part_grid, Pix *image_mask)
void SetTabStops(TabFind *tabgrid)
void GridFindMargins(ColPartitionSet **best_columns)
ScrollView * DisplayTabVectors(ScrollView *tab_win)
void RemoveLineResidue(ColPartition_LIST *big_part_list)
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 PSM_SPARSE(int pageseg_mode)
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_find_tables
void DisplayBoxes(ScrollView *window)
static const STRING & textord_debug_pix()
void DeleteUnknownParts(TO_BLOCK *block)
void FindLeaderPartitions(TO_BLOCK *block, ColPartitionGrid *part_grid)
ScrollView * MakeWindow(int x, int y, const char *window_name)
void InsertBlobsToGrid(bool h_spread, bool v_spread, BLOBNBOX_LIST *blobs, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
SVEvent * AwaitEvent(SVEventType type)
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)
void ReTypeBlobs(BLOBNBOX_LIST *im_blobs)
void AssertNoDuplicates()
bool textord_debug_printable
virtual int FindEquationParts(ColPartitionGrid *part_grid, ColPartitionSet **best_columns)=0
int textord_debug_tabfind
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)
const ICOORD & image_origin() const
ScrollView * FindInitialTabVectors(BLOBNBOX_LIST *image_blobs, int min_gutter_width, double tabfind_aligned_gap_fraction, TO_BLOCK *block)
const ICOORD & bleft() const
WidthCallback * WidthCB()
void RefinePartitionPartners(bool get_desperate)
bool textord_tabfind_show_reject_blobs
void DontFindTabVectors(BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew)
void ExtractPartitionsAsBlocks(BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks)
void FindPartitionPartners()