303 pixOr(photo_mask_pix, photo_mask_pix, nontext_map_);
310 pageseg_mode, rerotate_, input_block, nontext_map_, denorm_, cjk_script_,
311 &projection_, diacritic_blobs, &part_grid_, &big_parts_);
314 input_block,
this, &part_grid_, &big_parts_);
318 input_block,
this, &part_grid_, &big_parts_);
324 ColPartition_IT p_it(&big_parts_);
325 for (p_it.mark_cycle_pt(); !p_it.cycled_list(); p_it.forward())
326 p_it.data()->DisownBoxesNoAssert();
328 delete stroke_width_;
329 stroke_width_ =
NULL;
334 input_block->ComputeEdgeOffsets(thresholds_pix, grey_pix);
350 bool input_is_rtl = input_block->block->right_to_left();
355 ReflectForRtl(input_block, &image_bblobs_);
368 min_gutter_width_, tabfind_aligned_gap_fraction_,
369 &part_grid_, &deskew_, &reskew_);
373 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f);
374 denorm_ = new_denorm;
380 if (!MakeColumns(
false)) {
389 #ifndef GRAPHICS_DISABLED
392 input_block->plot_graded_blobs(rej_win);
394 #endif // GRAPHICS_DISABLED
400 GridSplitPartitions();
404 GridMergePartitions();
407 InsertRemainingNoise(input_block);
409 GridInsertHLinePartitions();
410 GridInsertVLinePartitions();
422 if (equation_detect_) {
426 TableFinder table_finder;
429 table_finder.set_left_to_right_language(
430 !input_block->block->right_to_left());
433 table_finder.InsertCleanPartitions(&part_grid_, input_block);
435 table_finder.LocateTables(&part_grid_, best_columns_,
WidthCB(), reskew_);
437 GridRemoveUnderlinePartitions();
447 #ifndef GRAPHICS_DISABLED
450 if (window !=
NULL) {
462 #endif // GRAPHICS_DISABLED
468 ReleaseBlobsAndCleanupUnused(input_block);
476 TransformToBlocks(blocks, to_blocks);
478 tprintf(
"Found %d blocks, %d to_blocks\n",
479 blocks->length(), to_blocks->length());
482 DisplayBlocks(blocks);
483 RotateAndReskewBlocks(input_is_rtl, to_blocks);
485 #ifndef GRAPHICS_DISABLED
486 if (blocks_win_ !=
NULL) {
487 bool waiting =
false;
492 if (*event->parameter ==
'd')
504 #endif // GRAPHICS_DISABLED
void InsertBlobsToGrid(bool h_spread, bool v_spread, BLOBNBOX_LIST *blobs, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
bool textord_tabfind_find_tables
bool PSM_SPARSE(int pageseg_mode)
void ExtractPartitionsAsBlocks(BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks)
bool textord_debug_images
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)
void SetTabStops(TabFind *tabgrid)
static const STRING & textord_debug_pix()
void Image(struct Pix *image, int x_pos, int y_pos)
void GridFindMargins(ColPartitionSet **best_columns)
virtual int FindEquationParts(ColPartitionGrid *part_grid, ColPartitionSet **best_columns)=0
bool textord_tabfind_show_reject_blobs
void FindLeaderPartitions(TO_BLOCK *block, ColPartitionGrid *part_grid)
void DisplayBoxes(ScrollView *window)
int textord_debug_tabfind
bool textord_tabfind_show_initial_partitions
void DontFindTabVectors(BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew)
void DeleteUnknownParts(TO_BLOCK *block)
bool textord_debug_printable
ScrollView * DisplayTabVectors(ScrollView *tab_win)
SVEvent * AwaitEvent(SVEventType type)
const ICOORD & bleft() const
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 FindPartitionPartners()
void ReTypeBlobs(BLOBNBOX_LIST *im_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)
void RemoveLineResidue(ColPartition_LIST *big_part_list)
ScrollView * MakeWindow(int x, int y, const char *window_name)
void TidyBlobs(TO_BLOCK *block)
void AssertNoDuplicates()
void SetBlockRuleEdges(TO_BLOCK *block)
WidthCallback * WidthCB()
const ICOORD & tright() const
bool PSM_COL_FIND_ENABLED(int pageseg_mode)
void FindFigureCaptions()
const ICOORD & image_origin() const
ScrollView * FindInitialTabVectors(BLOBNBOX_LIST *image_blobs, int min_gutter_width, double tabfind_aligned_gap_fraction, TO_BLOCK *block)
static void TransferImagePartsToImageMask(const FCOORD &rerotation, ColPartitionGrid *part_grid, Pix *image_mask)
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)
int textord_tabfind_show_partitions
void RefinePartitionPartners(bool get_desperate)