tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
tesseract::ColumnFinder Class Reference

#include <colfind.h>

Inheritance diagram for tesseract::ColumnFinder:
Collaboration diagram for tesseract::ColumnFinder:

Public Member Functions

 ColumnFinder (int gridsize, const ICOORD &bleft, const ICOORD &tright, int resolution, bool cjk_script, double aligned_gap_fraction, TabVector_LIST *vlines, TabVector_LIST *hlines, int vertical_x, int vertical_y)
 
virtual ~ColumnFinder ()
 
const DENORMdenorm () const
 
const TextlineProjectionprojection () const
 
void set_cjk_script (bool is_cjk)
 
void SetupAndFilterNoise (PageSegMode pageseg_mode, Pix *photo_mask_pix, TO_BLOCK *input_block)
 
bool IsVerticallyAlignedText (double find_vertical_text_ratio, TO_BLOCK *block, BLOBNBOX_CLIST *osd_blobs)
 
void CorrectOrientation (TO_BLOCK *block, bool vertical_text_lines, int recognition_rotation)
 
int FindBlocks (PageSegMode pageseg_mode, Pix *scaled_color, int scaled_factor, TO_BLOCK *block, Pix *photo_mask_pix, Pix *thresholds_pix, Pix *grey_pix, DebugPixa *pixa_debug, BLOCK_LIST *blocks, BLOBNBOX_LIST *diacritic_blobs, TO_BLOCK_LIST *to_blocks)
 
void GetDeskewVectors (FCOORD *deskew, FCOORD *reskew)
 
void SetEquationDetect (EquationDetectBase *detect)
 
- Public Member Functions inherited from tesseract::TabFind
 TabFind (int gridsize, const ICOORD &bleft, const ICOORD &tright, TabVector_LIST *vlines, int vertical_x, int vertical_y, int resolution)
 
virtual ~TabFind ()
 
void InsertBlobsToGrid (bool h_spread, bool v_spread, BLOBNBOX_LIST *blobs, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
 
bool InsertBlob (bool h_spread, bool v_spread, BLOBNBOX *blob, BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > *grid)
 
void SetBlockRuleEdges (TO_BLOCK *block)
 
void SetBlobRuleEdges (BLOBNBOX_LIST *blobs)
 
int GutterWidth (int bottom_y, int top_y, const TabVector &v, bool ignore_unmergeables, int max_gutter_width, int *required_shift)
 
void GutterWidthAndNeighbourGap (int tab_x, int mean_height, int max_gutter, bool left, BLOBNBOX *bbox, int *gutter_width, int *neighbour_gap)
 
int RightEdgeForBox (const TBOX &box, bool crossing, bool extended)
 
int LeftEdgeForBox (const TBOX &box, bool crossing, bool extended)
 
TabVectorRightTabForBox (const TBOX &box, bool crossing, bool extended)
 
TabVectorLeftTabForBox (const TBOX &box, bool crossing, bool extended)
 
bool CommonWidth (int width)
 
WidthCallbackWidthCB ()
 
const ICOORDimage_origin () const
 
- Public Member Functions inherited from tesseract::AlignedBlob
 AlignedBlob (int gridsize, const ICOORD &bleft, const ICOORD &tright)
 
virtual ~AlignedBlob ()
 
ScrollViewDisplayTabs (const char *window_name, ScrollView *tab_win)
 
TabVectorFindVerticalAlignment (AlignedBlobParams align_params, BLOBNBOX *bbox, int *vertical_x, int *vertical_y)
 
- Public Member Functions inherited from tesseract::BlobGrid
 BlobGrid (int gridsize, const ICOORD &bleft, const ICOORD &tright)
 
virtual ~BlobGrid ()
 
void InsertBlobList (BLOBNBOX_LIST *blobs)
 
- Public Member Functions inherited from tesseract::BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT >
 BBGrid ()
 
 BBGrid (int gridsize, const ICOORD &bleft, const ICOORD &tright)
 
virtual ~BBGrid ()
 
void Init (int gridsize, const ICOORD &bleft, const ICOORD &tright)
 
void Clear ()
 
void ClearGridData (void(*free_method)(BLOBNBOX *))
 
void InsertBBox (bool h_spread, bool v_spread, BLOBNBOX *bbox)
 
void InsertPixPtBBox (int left, int bottom, Pix *pix, BLOBNBOX *bbox)
 
void RemoveBBox (BLOBNBOX *bbox)
 
bool RectangleEmpty (const TBOX &rect)
 
IntGridCountCellElements ()
 
ScrollViewMakeWindow (int x, int y, const char *window_name)
 
void DisplayBoxes (ScrollView *window)
 
void AssertNoDuplicates ()
 
virtual void HandleClick (int x, int y)
 
- Public Member Functions inherited from tesseract::GridBase
 GridBase ()=default
 
 GridBase (int gridsize, const ICOORD &bleft, const ICOORD &tright)
 
virtual ~GridBase ()
 
void Init (int gridsize, const ICOORD &bleft, const ICOORD &tright)
 
int gridsize () const
 
int gridwidth () const
 
int gridheight () const
 
const ICOORDbleft () const
 
const ICOORDtright () const
 
void GridCoords (int x, int y, int *grid_x, int *grid_y) const
 
void ClipGridCoords (int *x, int *y) const
 

Private Member Functions

void DisplayBlocks (BLOCK_LIST *blocks)
 
void DisplayColumnBounds (PartSetVector *sets)
 
bool MakeColumns (bool single_column)
 
void ImproveColumnCandidates (PartSetVector *src_sets, PartSetVector *column_sets)
 
void PrintColumnCandidates (const char *title)
 
bool AssignColumns (const PartSetVector &part_sets)
 
bool BiggestUnassignedRange (int set_count, const bool *any_columns_possible, int *start, int *end)
 
int RangeModalColumnSet (int **column_set_costs, const int *assigned_costs, int start, int end)
 
void ShrinkRangeToLongestRun (int **column_set_costs, const int *assigned_costs, const bool *any_columns_possible, int column_set_id, int *best_start, int *best_end)
 
void ExtendRangePastSmallGaps (int **column_set_costs, const int *assigned_costs, const bool *any_columns_possible, int column_set_id, int step, int end, int *start)
 
void AssignColumnToRange (int column_set_id, int start, int end, int **column_set_costs, int *assigned_costs)
 
void ComputeMeanColumnGap (bool any_multi_column)
 
void ReleaseBlobsAndCleanupUnused (TO_BLOCK *block)
 
void GridSplitPartitions ()
 
void GridMergePartitions ()
 
void InsertRemainingNoise (TO_BLOCK *block)
 
void GridRemoveUnderlinePartitions ()
 
void GridInsertHLinePartitions ()
 
void GridInsertVLinePartitions ()
 
void SetPartitionTypes ()
 
void SmoothPartnerRuns ()
 
void AddToTempPartList (ColPartition *part, ColPartition_CLIST *temp_list)
 
void EmptyTempPartList (ColPartition_CLIST *temp_list, WorkingPartSet_LIST *work_set)
 
void TransformToBlocks (BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks)
 
void ReflectForRtl (TO_BLOCK *input_block, BLOBNBOX_LIST *bblobs)
 
void RotateAndReskewBlocks (bool input_is_rtl, TO_BLOCK_LIST *to_blocks)
 
FCOORD ComputeBlockAndClassifyRotation (BLOCK *block)
 

Private Attributes

bool cjk_script_
 
int min_gutter_width_
 
int mean_column_gap_
 
double tabfind_aligned_gap_fraction_
 
FCOORD deskew_
 
FCOORD reskew_
 
FCOORD rotation_
 
FCOORD rerotate_
 
FCOORD text_rotation_
 
PartSetVector column_sets_
 
ColPartitionSet ** best_columns_
 
StrokeWidthstroke_width_
 
ColPartitionGrid part_grid_
 
ColPartition_LIST good_parts_
 
ColPartition_LIST big_parts_
 
ColPartition_LIST noise_parts_
 
BLOBNBOX_LIST image_bblobs_
 
TabVector_LIST horizontal_lines_
 
Pix * nontext_map_
 
TextlineProjection projection_
 
DENORMdenorm_
 
ScrollViewinput_blobs_win_
 
EquationDetectBaseequation_detect_
 

Static Private Attributes

static ScrollViewblocks_win_ = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from tesseract::TabFind
static bool DifferentSizes (int size1, int size2)
 
static bool VeryDifferentSizes (int size1, int size2)
 
- Static Public Member Functions inherited from tesseract::AlignedBlob
static bool WithinTestRegion (int detail_level, int x, int y)
 
- Protected Member Functions inherited from tesseract::TabFind
TabVector_LIST * vectors ()
 
TabVector_LIST * dead_vectors ()
 
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 DontFindTabVectors (BLOBNBOX_LIST *image_blobs, TO_BLOCK *block, FCOORD *deskew, FCOORD *reskew)
 
void TidyBlobs (TO_BLOCK *block)
 
void SetupTabSearch (int x, int y, int *min_key, int *max_key)
 
ScrollViewDisplayTabVectors (ScrollView *tab_win)
 
ScrollViewFindInitialTabVectors (BLOBNBOX_LIST *image_blobs, int min_gutter_width, double tabfind_aligned_gap_fraction, TO_BLOCK *block)
 
void ResetForVerticalText (const FCOORD &rotate, const FCOORD &rerotate, TabVector_LIST *horizontal_lines, int *min_gutter_width)
 
void Reset ()
 
void ReflectInYAxis ()
 
- Static Protected Member Functions inherited from tesseract::TabFind
static void RotateBlobList (const FCOORD &rotation, BLOBNBOX_LIST *blobs)
 
- Protected Attributes inherited from tesseract::TabFind
ICOORD vertical_skew_
 
int resolution_
 
- Protected Attributes inherited from tesseract::BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT >
BLOBNBOX_CLIST * grid_
 
- Protected Attributes inherited from tesseract::GridBase
int gridsize_
 
int gridwidth_
 
int gridheight_
 
int gridbuckets_
 
ICOORD bleft_
 
ICOORD tright_
 

Constructor & Destructor Documentation

◆ ColumnFinder()

tesseract::ColumnFinder::ColumnFinder ( int  gridsize,
const ICOORD bleft,
const ICOORD tright,
int  resolution,
bool  cjk_script,
double  aligned_gap_fraction,
TabVector_LIST *  vlines,
TabVector_LIST *  hlines,
int  vertical_x,
int  vertical_y 
)

◆ ~ColumnFinder()

tesseract::ColumnFinder::~ColumnFinder ( )
virtual

Member Function Documentation

◆ AddToTempPartList()

void tesseract::ColumnFinder::AddToTempPartList ( ColPartition part,
ColPartition_CLIST *  temp_list 
)
private

◆ AssignColumns()

bool tesseract::ColumnFinder::AssignColumns ( const PartSetVector part_sets)
private

◆ AssignColumnToRange()

void tesseract::ColumnFinder::AssignColumnToRange ( int  column_set_id,
int  start,
int  end,
int **  column_set_costs,
int *  assigned_costs 
)
private

◆ BiggestUnassignedRange()

bool tesseract::ColumnFinder::BiggestUnassignedRange ( int  set_count,
const bool *  any_columns_possible,
int *  start,
int *  end 
)
private

◆ ComputeBlockAndClassifyRotation()

FCOORD tesseract::ColumnFinder::ComputeBlockAndClassifyRotation ( BLOCK block)
private

◆ ComputeMeanColumnGap()

void tesseract::ColumnFinder::ComputeMeanColumnGap ( bool  any_multi_column)
private

◆ CorrectOrientation()

void tesseract::ColumnFinder::CorrectOrientation ( TO_BLOCK block,
bool  vertical_text_lines,
int  recognition_rotation 
)

◆ denorm()

const DENORM* tesseract::ColumnFinder::denorm ( ) const
inline

◆ DisplayBlocks()

void tesseract::ColumnFinder::DisplayBlocks ( BLOCK_LIST *  blocks)
private

◆ DisplayColumnBounds()

void tesseract::ColumnFinder::DisplayColumnBounds ( PartSetVector sets)
private

◆ EmptyTempPartList()

void tesseract::ColumnFinder::EmptyTempPartList ( ColPartition_CLIST *  temp_list,
WorkingPartSet_LIST *  work_set 
)
private

◆ ExtendRangePastSmallGaps()

void tesseract::ColumnFinder::ExtendRangePastSmallGaps ( int **  column_set_costs,
const int *  assigned_costs,
const bool *  any_columns_possible,
int  column_set_id,
int  step,
int  end,
int *  start 
)
private

◆ FindBlocks()

int tesseract::ColumnFinder::FindBlocks ( PageSegMode  pageseg_mode,
Pix *  scaled_color,
int  scaled_factor,
TO_BLOCK block,
Pix *  photo_mask_pix,
Pix *  thresholds_pix,
Pix *  grey_pix,
DebugPixa pixa_debug,
BLOCK_LIST *  blocks,
BLOBNBOX_LIST *  diacritic_blobs,
TO_BLOCK_LIST *  to_blocks 
)

◆ GetDeskewVectors()

void tesseract::ColumnFinder::GetDeskewVectors ( FCOORD deskew,
FCOORD reskew 
)

◆ GridInsertHLinePartitions()

void tesseract::ColumnFinder::GridInsertHLinePartitions ( )
private

◆ GridInsertVLinePartitions()

void tesseract::ColumnFinder::GridInsertVLinePartitions ( )
private

◆ GridMergePartitions()

void tesseract::ColumnFinder::GridMergePartitions ( )
private

◆ GridRemoveUnderlinePartitions()

void tesseract::ColumnFinder::GridRemoveUnderlinePartitions ( )
private

◆ GridSplitPartitions()

void tesseract::ColumnFinder::GridSplitPartitions ( )
private

◆ ImproveColumnCandidates()

void tesseract::ColumnFinder::ImproveColumnCandidates ( PartSetVector src_sets,
PartSetVector column_sets 
)
private

◆ InsertRemainingNoise()

void tesseract::ColumnFinder::InsertRemainingNoise ( TO_BLOCK block)
private

◆ IsVerticallyAlignedText()

bool tesseract::ColumnFinder::IsVerticallyAlignedText ( double  find_vertical_text_ratio,
TO_BLOCK block,
BLOBNBOX_CLIST *  osd_blobs 
)

◆ MakeColumns()

bool tesseract::ColumnFinder::MakeColumns ( bool  single_column)
private

◆ PrintColumnCandidates()

void tesseract::ColumnFinder::PrintColumnCandidates ( const char *  title)
private

◆ projection()

const TextlineProjection* tesseract::ColumnFinder::projection ( ) const
inline

◆ RangeModalColumnSet()

int tesseract::ColumnFinder::RangeModalColumnSet ( int **  column_set_costs,
const int *  assigned_costs,
int  start,
int  end 
)
private

◆ ReflectForRtl()

void tesseract::ColumnFinder::ReflectForRtl ( TO_BLOCK input_block,
BLOBNBOX_LIST *  bblobs 
)
private

◆ ReleaseBlobsAndCleanupUnused()

void tesseract::ColumnFinder::ReleaseBlobsAndCleanupUnused ( TO_BLOCK block)
private

◆ RotateAndReskewBlocks()

void tesseract::ColumnFinder::RotateAndReskewBlocks ( bool  input_is_rtl,
TO_BLOCK_LIST *  to_blocks 
)
private

◆ set_cjk_script()

void tesseract::ColumnFinder::set_cjk_script ( bool  is_cjk)
inline

◆ SetEquationDetect()

void tesseract::ColumnFinder::SetEquationDetect ( EquationDetectBase detect)

◆ SetPartitionTypes()

void tesseract::ColumnFinder::SetPartitionTypes ( )
private

◆ SetupAndFilterNoise()

void tesseract::ColumnFinder::SetupAndFilterNoise ( PageSegMode  pageseg_mode,
Pix *  photo_mask_pix,
TO_BLOCK input_block 
)

◆ ShrinkRangeToLongestRun()

void tesseract::ColumnFinder::ShrinkRangeToLongestRun ( int **  column_set_costs,
const int *  assigned_costs,
const bool *  any_columns_possible,
int  column_set_id,
int *  best_start,
int *  best_end 
)
private

◆ SmoothPartnerRuns()

void tesseract::ColumnFinder::SmoothPartnerRuns ( )
private

◆ TransformToBlocks()

void tesseract::ColumnFinder::TransformToBlocks ( BLOCK_LIST *  blocks,
TO_BLOCK_LIST *  to_blocks 
)
private

Member Data Documentation

◆ best_columns_

ColPartitionSet** tesseract::ColumnFinder::best_columns_
private

◆ big_parts_

ColPartition_LIST tesseract::ColumnFinder::big_parts_
private

◆ blocks_win_

ScrollView * tesseract::ColumnFinder::blocks_win_ = nullptr
staticprivate

◆ cjk_script_

bool tesseract::ColumnFinder::cjk_script_
private

◆ column_sets_

PartSetVector tesseract::ColumnFinder::column_sets_
private

◆ denorm_

DENORM* tesseract::ColumnFinder::denorm_
private

◆ deskew_

FCOORD tesseract::ColumnFinder::deskew_
private

◆ equation_detect_

EquationDetectBase* tesseract::ColumnFinder::equation_detect_
private

◆ good_parts_

ColPartition_LIST tesseract::ColumnFinder::good_parts_
private

◆ horizontal_lines_

TabVector_LIST tesseract::ColumnFinder::horizontal_lines_
private

◆ image_bblobs_

BLOBNBOX_LIST tesseract::ColumnFinder::image_bblobs_
private

◆ input_blobs_win_

ScrollView* tesseract::ColumnFinder::input_blobs_win_
private

◆ mean_column_gap_

int tesseract::ColumnFinder::mean_column_gap_
private

◆ min_gutter_width_

int tesseract::ColumnFinder::min_gutter_width_
private

◆ noise_parts_

ColPartition_LIST tesseract::ColumnFinder::noise_parts_
private

◆ nontext_map_

Pix* tesseract::ColumnFinder::nontext_map_
private

◆ part_grid_

ColPartitionGrid tesseract::ColumnFinder::part_grid_
private

◆ projection_

TextlineProjection tesseract::ColumnFinder::projection_
private

◆ rerotate_

FCOORD tesseract::ColumnFinder::rerotate_
private

◆ reskew_

FCOORD tesseract::ColumnFinder::reskew_
private

◆ rotation_

FCOORD tesseract::ColumnFinder::rotation_
private

◆ stroke_width_

StrokeWidth* tesseract::ColumnFinder::stroke_width_
private

◆ tabfind_aligned_gap_fraction_

double tesseract::ColumnFinder::tabfind_aligned_gap_fraction_
private

◆ text_rotation_

FCOORD tesseract::ColumnFinder::text_rotation_
private

The documentation for this class was generated from the following files: