291 pixOr(photo_mask_pix, photo_mask_pix, nontext_map_);
298 pageseg_mode, rerotate_, input_block, nontext_map_, denorm_, cjk_script_,
299 &projection_, diacritic_blobs, &part_grid_, &big_parts_);
302 input_block,
this, pixa_debug, &part_grid_,
307 input_block,
this, pixa_debug, &part_grid_,
314 ColPartition_IT p_it(&big_parts_);
315 for (p_it.mark_cycle_pt(); !p_it.cycled_list(); p_it.forward())
316 p_it.data()->DisownBoxesNoAssert();
318 delete stroke_width_;
319 stroke_width_ =
nullptr;
324 input_block->ComputeEdgeOffsets(thresholds_pix, grey_pix);
340 bool input_is_rtl = input_block->block->right_to_left();
345 ReflectForRtl(input_block, &image_bblobs_);
358 min_gutter_width_, tabfind_aligned_gap_fraction_,
359 &part_grid_, &deskew_, &reskew_);
361 auto* new_denorm =
new DENORM;
363 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f);
364 denorm_ = new_denorm;
370 if (!MakeColumns(
false)) {
379 #ifndef GRAPHICS_DISABLED
380 if (textord_tabfind_show_reject_blobs) {
382 input_block->plot_graded_blobs(rej_win);
390 GridSplitPartitions();
394 GridMergePartitions();
397 InsertRemainingNoise(input_block);
399 GridInsertHLinePartitions();
400 GridInsertVLinePartitions();
405 if (textord_tabfind_show_initial_partitions) {
412 if (equation_detect_) {
415 if (textord_tabfind_find_tables) {
416 TableFinder table_finder;
419 table_finder.set_left_to_right_language(
420 !input_block->block->right_to_left());
423 table_finder.InsertCleanPartitions(&part_grid_, input_block);
425 table_finder.LocateTables(&part_grid_, best_columns_,
WidthCB(), reskew_);
427 GridRemoveUnderlinePartitions();
437 #ifndef GRAPHICS_DISABLED
438 if (textord_tabfind_show_partitions) {
440 if (window !=
nullptr) {
444 if (window !=
nullptr && textord_tabfind_show_partitions > 1) {
455 ReleaseBlobsAndCleanupUnused(input_block);
463 TransformToBlocks(blocks, to_blocks);
465 tprintf(
"Found %d blocks, %d to_blocks\n",
466 blocks->length(), to_blocks->length());
469 DisplayBlocks(blocks);
470 RotateAndReskewBlocks(input_is_rtl, to_blocks);
472 #ifndef GRAPHICS_DISABLED
473 if (blocks_win_ !=
nullptr) {
474 bool waiting =
false;
478 if (event->type ==
SVET_INPUT && event->parameter !=
nullptr) {
479 if (*event->parameter ==
'd')
484 blocks_win_ =
nullptr;
bool textord_debug_printable
bool PSM_COL_FIND_ENABLED(int pageseg_mode)
bool PSM_SPARSE(int pageseg_mode)
void DisplayBoxes(ScrollView *window)
void AssertNoDuplicates()
ScrollView * MakeWindow(int x, int y, const char *window_name)
void ExtractPartitionsAsBlocks(BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks)
void SetTabStops(TabFind *tabgrid)
void RefinePartitionPartners(bool get_desperate)
void GridFindMargins(ColPartitionSet **best_columns)
void FindPartitionPartners()
void DeleteUnknownParts(TO_BLOCK *block)
void FindFigureCaptions()
void ReTypeBlobs(BLOBNBOX_LIST *im_blobs)
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)
static void TransferImagePartsToImageMask(const FCOORD &rerotation, ColPartitionGrid *part_grid, Pix *image_mask)
void RemoveLineResidue(ColPartition_LIST *big_part_list)
void FindLeaderPartitions(TO_BLOCK *block, ColPartitionGrid *part_grid)
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 InsertBlobsToGrid(bool h_spread, bool v_spread, BLOBNBOX_LIST *blobs, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
void DontFindTabVectors(BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew)
WidthCallback * WidthCB()
int resolution_
Of source image in pixels per inch.
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 TidyBlobs(TO_BLOCK *block)
ScrollView * FindInitialTabVectors(BLOBNBOX_LIST *image_blobs, int min_gutter_width, double tabfind_aligned_gap_fraction, TO_BLOCK *block)
ScrollView * DisplayTabVectors(ScrollView *tab_win)
SVEvent * AwaitEvent(SVEventType type)