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

#include <colpartitiongrid.h>

Inheritance diagram for tesseract::ColPartitionGrid:
Collaboration diagram for tesseract::ColPartitionGrid:

Public Member Functions

 ColPartitionGrid ()=default
 
 ColPartitionGrid (int gridsize, const ICOORD &bleft, const ICOORD &tright)
 
virtual ~ColPartitionGrid ()=default
 
void HandleClick (int x, int y)
 
void Merges (TessResultCallback2< bool, ColPartition *, TBOX *> *box_cb, TessResultCallback2< bool, const ColPartition *, const ColPartition *> *confirm_cb)
 
bool MergePart (TessResultCallback2< bool, ColPartition *, TBOX *> *box_cb, TessResultCallback2< bool, const ColPartition *, const ColPartition *> *confirm_cb, ColPartition *part)
 
int ComputeTotalOverlap (ColPartitionGrid **overlap_grid)
 
void FindOverlappingPartitions (const TBOX &box, const ColPartition *not_this, ColPartition_CLIST *parts)
 
ColPartitionBestMergeCandidate (const ColPartition *part, ColPartition_CLIST *candidates, bool debug, TessResultCallback2< bool, const ColPartition *, const ColPartition *> *confirm_cb, int *overlap_increase)
 
void SplitOverlappingPartitions (ColPartition_LIST *big_parts)
 
bool GridSmoothNeighbours (BlobTextFlowType source_type, Pix *nontext_map, const TBOX &im_box, const FCOORD &rerotation)
 
void ReflectInYAxis ()
 
void Deskew (const FCOORD &deskew)
 
void ExtractPartitionsAsBlocks (BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks)
 
void SetTabStops (TabFind *tabgrid)
 
bool MakeColPartSets (PartSetVector *part_sets)
 
ColPartitionSetMakeSingleColumnSet (WidthCallback *cb)
 
void ClaimBoxes ()
 
void ReTypeBlobs (BLOBNBOX_LIST *im_blobs)
 
void RecomputeBounds (int gridsize, const ICOORD &bleft, const ICOORD &tright, const ICOORD &vertical)
 
void GridFindMargins (ColPartitionSet **best_columns)
 
void ListFindMargins (ColPartitionSet **best_columns, ColPartition_LIST *parts)
 
void DeleteParts ()
 
void DeleteUnknownParts (TO_BLOCK *block)
 
void DeleteNonLeaderParts ()
 
void FindFigureCaptions ()
 
void FindPartitionPartners ()
 
void FindPartitionPartners (bool upper, ColPartition *part)
 
void FindVPartitionPartners (bool to_the_left, ColPartition *part)
 
void RefinePartitionPartners (bool get_desperate)
 
- Public Member Functions inherited from tesseract::BBGrid< ColPartition, ColPartition_CLIST, ColPartition_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)(ColPartition *))
 
void InsertBBox (bool h_spread, bool v_spread, ColPartition *bbox)
 
void InsertPixPtBBox (int left, int bottom, Pix *pix, ColPartition *bbox)
 
void RemoveBBox (ColPartition *bbox)
 
bool RectangleEmpty (const TBOX &rect)
 
IntGridCountCellElements ()
 
ScrollViewMakeWindow (int x, int y, const char *window_name)
 
void DisplayBoxes (ScrollView *window)
 
void AssertNoDuplicates ()
 
- 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 FindMergeCandidates (const ColPartition *part, const TBOX &search_box, bool debug, ColPartition_CLIST *candidates)
 
bool SmoothRegionType (Pix *nontext_map, const TBOX &im_box, const FCOORD &rerotation, bool debug, ColPartition *part)
 
BlobRegionType SmoothInOneDirection (BlobNeighbourDir direction, Pix *nontext_map, const TBOX &im_box, const FCOORD &rerotation, bool debug, const ColPartition &part, int *best_distance)
 
void AccumulatePartDistances (const ColPartition &base_part, const ICOORD &dist_scaling, const TBOX &search_box, Pix *nontext_map, const TBOX &im_box, const FCOORD &rerotation, bool debug, GenericVector< int > *dists)
 
void FindPartitionMargins (ColPartitionSet *columns, ColPartition *part)
 
int FindMargin (int x, bool right_to_left, int x_limit, int y_bottom, int y_top, const ColPartition *not_this)
 

Additional Inherited Members

- Protected Attributes inherited from tesseract::BBGrid< ColPartition, ColPartition_CLIST, ColPartition_C_IT >
ColPartition_CLIST * grid_
 
- Protected Attributes inherited from tesseract::GridBase
int gridsize_
 
int gridwidth_
 
int gridheight_
 
int gridbuckets_
 
ICOORD bleft_
 
ICOORD tright_
 

Constructor & Destructor Documentation

◆ ColPartitionGrid() [1/2]

tesseract::ColPartitionGrid::ColPartitionGrid ( )
default

◆ ColPartitionGrid() [2/2]

tesseract::ColPartitionGrid::ColPartitionGrid ( int  gridsize,
const ICOORD bleft,
const ICOORD tright 
)

◆ ~ColPartitionGrid()

virtual tesseract::ColPartitionGrid::~ColPartitionGrid ( )
virtualdefault

Member Function Documentation

◆ AccumulatePartDistances()

void tesseract::ColPartitionGrid::AccumulatePartDistances ( const ColPartition base_part,
const ICOORD dist_scaling,
const TBOX search_box,
Pix *  nontext_map,
const TBOX im_box,
const FCOORD rerotation,
bool  debug,
GenericVector< int > *  dists 
)
private

◆ BestMergeCandidate()

ColPartition * tesseract::ColPartitionGrid::BestMergeCandidate ( const ColPartition part,
ColPartition_CLIST *  candidates,
bool  debug,
TessResultCallback2< bool, const ColPartition *, const ColPartition *> *  confirm_cb,
int *  overlap_increase 
)

◆ ClaimBoxes()

void tesseract::ColPartitionGrid::ClaimBoxes ( )

◆ ComputeTotalOverlap()

int tesseract::ColPartitionGrid::ComputeTotalOverlap ( ColPartitionGrid **  overlap_grid)

◆ DeleteNonLeaderParts()

void tesseract::ColPartitionGrid::DeleteNonLeaderParts ( )

◆ DeleteParts()

void tesseract::ColPartitionGrid::DeleteParts ( )

◆ DeleteUnknownParts()

void tesseract::ColPartitionGrid::DeleteUnknownParts ( TO_BLOCK block)

◆ Deskew()

void tesseract::ColPartitionGrid::Deskew ( const FCOORD deskew)

◆ ExtractPartitionsAsBlocks()

void tesseract::ColPartitionGrid::ExtractPartitionsAsBlocks ( BLOCK_LIST *  blocks,
TO_BLOCK_LIST *  to_blocks 
)

◆ FindFigureCaptions()

void tesseract::ColPartitionGrid::FindFigureCaptions ( )

◆ FindMargin()

int tesseract::ColPartitionGrid::FindMargin ( int  x,
bool  right_to_left,
int  x_limit,
int  y_bottom,
int  y_top,
const ColPartition not_this 
)
private

◆ FindMergeCandidates()

void tesseract::ColPartitionGrid::FindMergeCandidates ( const ColPartition part,
const TBOX search_box,
bool  debug,
ColPartition_CLIST *  candidates 
)
private

◆ FindOverlappingPartitions()

void tesseract::ColPartitionGrid::FindOverlappingPartitions ( const TBOX box,
const ColPartition not_this,
ColPartition_CLIST *  parts 
)

◆ FindPartitionMargins()

void tesseract::ColPartitionGrid::FindPartitionMargins ( ColPartitionSet columns,
ColPartition part 
)
private

◆ FindPartitionPartners() [1/2]

void tesseract::ColPartitionGrid::FindPartitionPartners ( )

◆ FindPartitionPartners() [2/2]

void tesseract::ColPartitionGrid::FindPartitionPartners ( bool  upper,
ColPartition part 
)

◆ FindVPartitionPartners()

void tesseract::ColPartitionGrid::FindVPartitionPartners ( bool  to_the_left,
ColPartition part 
)

◆ GridFindMargins()

void tesseract::ColPartitionGrid::GridFindMargins ( ColPartitionSet **  best_columns)

◆ GridSmoothNeighbours()

bool tesseract::ColPartitionGrid::GridSmoothNeighbours ( BlobTextFlowType  source_type,
Pix *  nontext_map,
const TBOX im_box,
const FCOORD rerotation 
)

◆ HandleClick()

void tesseract::ColPartitionGrid::HandleClick ( int  x,
int  y 
)
virtual

◆ ListFindMargins()

void tesseract::ColPartitionGrid::ListFindMargins ( ColPartitionSet **  best_columns,
ColPartition_LIST *  parts 
)

◆ MakeColPartSets()

bool tesseract::ColPartitionGrid::MakeColPartSets ( PartSetVector part_sets)

◆ MakeSingleColumnSet()

ColPartitionSet * tesseract::ColPartitionGrid::MakeSingleColumnSet ( WidthCallback cb)

◆ MergePart()

bool tesseract::ColPartitionGrid::MergePart ( TessResultCallback2< bool, ColPartition *, TBOX *> *  box_cb,
TessResultCallback2< bool, const ColPartition *, const ColPartition *> *  confirm_cb,
ColPartition part 
)

◆ Merges()

void tesseract::ColPartitionGrid::Merges ( TessResultCallback2< bool, ColPartition *, TBOX *> *  box_cb,
TessResultCallback2< bool, const ColPartition *, const ColPartition *> *  confirm_cb 
)

◆ RecomputeBounds()

void tesseract::ColPartitionGrid::RecomputeBounds ( int  gridsize,
const ICOORD bleft,
const ICOORD tright,
const ICOORD vertical 
)

◆ RefinePartitionPartners()

void tesseract::ColPartitionGrid::RefinePartitionPartners ( bool  get_desperate)

◆ ReflectInYAxis()

void tesseract::ColPartitionGrid::ReflectInYAxis ( )

◆ ReTypeBlobs()

void tesseract::ColPartitionGrid::ReTypeBlobs ( BLOBNBOX_LIST *  im_blobs)

◆ SetTabStops()

void tesseract::ColPartitionGrid::SetTabStops ( TabFind tabgrid)

◆ SmoothInOneDirection()

BlobRegionType tesseract::ColPartitionGrid::SmoothInOneDirection ( BlobNeighbourDir  direction,
Pix *  nontext_map,
const TBOX im_box,
const FCOORD rerotation,
bool  debug,
const ColPartition part,
int *  best_distance 
)
private

◆ SmoothRegionType()

bool tesseract::ColPartitionGrid::SmoothRegionType ( Pix *  nontext_map,
const TBOX im_box,
const FCOORD rerotation,
bool  debug,
ColPartition part 
)
private

◆ SplitOverlappingPartitions()

void tesseract::ColPartitionGrid::SplitOverlappingPartitions ( ColPartition_LIST *  big_parts)

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