tesseract v5.3.3.20231005
|
#include <colpartition.h>
Public Member Functions | |
ColPartition ()=default | |
ColPartition (BlobRegionType blob_type, const ICOORD &vertical) | |
~ColPartition () | |
const TBOX & | bounding_box () const |
int | left_margin () const |
void | set_left_margin (int margin) |
int | right_margin () const |
void | set_right_margin (int margin) |
int | median_top () const |
int | median_bottom () const |
int | median_left () const |
int | median_right () const |
int | median_height () const |
void | set_median_height (int height) |
int | median_width () const |
void | set_median_width (int width) |
BlobRegionType | blob_type () const |
void | set_blob_type (BlobRegionType t) |
BlobTextFlowType | flow () const |
void | set_flow (BlobTextFlowType f) |
int | good_blob_score () const |
bool | good_width () const |
bool | good_column () const |
bool | left_key_tab () const |
int | left_key () const |
bool | right_key_tab () const |
int | right_key () const |
PolyBlockType | type () const |
void | set_type (PolyBlockType t) |
BLOBNBOX_CLIST * | boxes () |
int | boxes_count () const |
void | set_vertical (const ICOORD &v) |
ColPartition_CLIST * | upper_partners () |
ColPartition_CLIST * | lower_partners () |
void | set_working_set (WorkingPartSet *working_set) |
bool | block_owned () const |
void | set_block_owned (bool owned) |
bool | desperately_merged () const |
ColPartitionSet * | column_set () const |
void | set_side_step (int step) |
int | bottom_spacing () const |
void | set_bottom_spacing (int spacing) |
int | top_spacing () const |
void | set_top_spacing (int spacing) |
void | set_table_type () |
void | clear_table_type () |
bool | inside_table_column () |
void | set_inside_table_column (bool val) |
ColPartition * | nearest_neighbor_above () const |
void | set_nearest_neighbor_above (ColPartition *part) |
ColPartition * | nearest_neighbor_below () const |
void | set_nearest_neighbor_below (ColPartition *part) |
int | space_above () const |
void | set_space_above (int space) |
int | space_below () const |
void | set_space_below (int space) |
int | space_to_left () const |
void | set_space_to_left (int space) |
int | space_to_right () const |
void | set_space_to_right (int space) |
uint8_t * | color1 () |
uint8_t * | color2 () |
bool | owns_blobs () const |
void | set_owns_blobs (bool owns_blobs) |
int | MidY () const |
int | MedianY () const |
int | MidX () const |
int | SortKey (int x, int y) const |
int | XAtY (int sort_key, int y) const |
int | KeyWidth (int left_key, int right_key) const |
int | ColumnWidth () const |
int | BoxLeftKey () const |
int | BoxRightKey () const |
int | LeftAtY (int y) const |
int | RightAtY (int y) const |
bool | IsLeftOf (const ColPartition &other) const |
bool | ColumnContains (int x, int y) const |
bool | IsEmpty () const |
bool | IsSingleton () const |
bool | HOverlaps (const ColPartition &other) const |
bool | VOverlaps (const ColPartition &other) const |
int | VCoreOverlap (const ColPartition &other) const |
int | HCoreOverlap (const ColPartition &other) const |
bool | VSignificantCoreOverlap (const ColPartition &other) const |
bool | WithinSameMargins (const ColPartition &other) const |
bool | TypesMatch (const ColPartition &other) const |
bool | IsLineType () const |
bool | IsImageType () const |
bool | IsTextType () const |
bool | IsPulloutType () const |
bool | IsVerticalType () const |
bool | IsHorizontalType () const |
bool | IsUnMergeableType () const |
bool | IsVerticalLine () const |
bool | IsHorizontalLine () const |
void | AddBox (BLOBNBOX *box) |
void | RemoveBox (BLOBNBOX *box) |
BLOBNBOX * | BiggestBox () |
TBOX | BoundsWithoutBox (BLOBNBOX *box) |
void | ClaimBoxes () |
void | DisownBoxes () |
void | DisownBoxesNoAssert () |
bool | ReleaseNonLeaderBoxes () |
void | DeleteBoxes () |
void | ReflectInYAxis () |
bool | IsLegal () |
bool | MatchingColumns (const ColPartition &other) const |
bool | MatchingTextColor (const ColPartition &other) const |
bool | MatchingSizes (const ColPartition &other) const |
bool | ConfirmNoTabViolation (const ColPartition &other) const |
bool | MatchingStrokeWidth (const ColPartition &other, double fractional_tolerance, double constant_tolerance) const |
bool | OKDiacriticMerge (const ColPartition &candidate, bool debug) const |
void | SetLeftTab (const TabVector *tab_vector) |
void | SetRightTab (const TabVector *tab_vector) |
void | CopyLeftTab (const ColPartition &src, bool take_box) |
void | CopyRightTab (const ColPartition &src, bool take_box) |
int | LeftBlobRule () const |
int | RightBlobRule () const |
float | SpecialBlobsDensity (const BlobSpecialTextType type) const |
int | SpecialBlobsCount (const BlobSpecialTextType type) |
void | SetSpecialBlobsDensity (const BlobSpecialTextType type, const float density) |
void | ComputeSpecialBlobsDensity () |
void | AddPartner (bool upper, ColPartition *partner) |
void | RemovePartner (bool upper, ColPartition *partner) |
ColPartition * | SingletonPartner (bool upper) |
void | Absorb (ColPartition *other, const WidthCallback &cb) |
bool | OKMergeOverlap (const ColPartition &merge1, const ColPartition &merge2, int ok_box_overlap, bool debug) |
BLOBNBOX * | OverlapSplitBlob (const TBOX &box) |
ColPartition * | SplitAtBlob (BLOBNBOX *split_blob) |
ColPartition * | SplitAt (int split_x) |
void | ComputeLimits () |
int | CountOverlappingBoxes (const TBOX &box) |
void | SetPartitionType (int resolution, ColPartitionSet *columns) |
PolyBlockType | PartitionType (ColumnSpanningType flow) const |
void | ColumnRange (int resolution, ColPartitionSet *columns, int *first_col, int *last_col) |
void | SetColumnGoodness (const WidthCallback &cb) |
bool | MarkAsLeaderIfMonospaced () |
void | SetRegionAndFlowTypesFromProjectionValue (int value) |
void | SetBlobTypes () |
bool | HasGoodBaseline () |
void | AddToWorkingSet (const ICOORD &bleft, const ICOORD &tright, int resolution, ColPartition_LIST *used_parts, WorkingPartSet_LIST *working_set) |
TO_ROW * | MakeToRow () |
ColPartition * | ShallowCopy () const |
ColPartition * | CopyButDontOwnBlobs () |
ScrollView::Color | BoxColor () const |
void | Print () const |
void | PrintColors () |
void | SmoothPartnerRun (int working_set_count) |
void | RefinePartners (PolyBlockType type, bool get_desperate, ColPartitionGrid *grid) |
bool | IsInSameColumnAs (const ColPartition &part) const |
void | set_first_column (int column) |
void | set_last_column (int column) |
![]() | |
ELIST2_LINK () | |
ELIST2_LINK (const ELIST2_LINK &)=delete | |
void | operator= (const ELIST2_LINK &) |
Static Public Member Functions | |
static ColPartition * | MakeLinePartition (BlobRegionType blob_type, const ICOORD &vertical, int left, int bottom, int right, int top) |
static ColPartition * | FakePartition (const TBOX &box, PolyBlockType block_type, BlobRegionType blob_type, BlobTextFlowType flow) |
static ColPartition * | MakeBigPartition (BLOBNBOX *box, ColPartition_LIST *big_part_list) |
static bool | TypesMatch (BlobRegionType type1, BlobRegionType type2) |
static bool | TypesSimilar (PolyBlockType type1, PolyBlockType type2) |
static void | LineSpacingBlocks (const ICOORD &bleft, const ICOORD &tright, int resolution, ColPartition_LIST *block_parts, ColPartition_LIST *used_parts, BLOCK_LIST *completed_blocks, TO_BLOCK_LIST *to_blocks) |
static TO_BLOCK * | MakeBlock (const ICOORD &bleft, const ICOORD &tright, ColPartition_LIST *block_parts, ColPartition_LIST *used_parts) |
static TO_BLOCK * | MakeVerticalTextBlock (const ICOORD &bleft, const ICOORD &tright, ColPartition_LIST *block_parts, ColPartition_LIST *used_parts) |
static int | SortByBBox (const void *p1, const void *p2) |
ColPartition is a partition of a horizontal slice of the page. It starts out as a collection of blobs at a particular y-coord in the grid, but ends up (after merging and uniquing) as an approximate text line. ColPartitions are also used to hold a partitioning of the page into columns, each representing one column. Although a ColPartition applies to a given y-coordinate range, eventually, a ColPartitionSet of ColPartitions emerges, which represents the columns over a wide y-coordinate range.
Definition at line 67 of file colpartition.h.
|
default |
tesseract::ColPartition::ColPartition | ( | BlobRegionType | blob_type, |
const ICOORD & | vertical | ||
) |
blob_type | is the blob_region_type_ of the blobs in this partition. |
vertical | is the direction of logical vertical on the possibly skewed image. |
Definition at line 91 of file colpartition.cpp.
tesseract::ColPartition::~ColPartition | ( | ) |
Definition at line 146 of file colpartition.cpp.
void tesseract::ColPartition::Absorb | ( | ColPartition * | other, |
const WidthCallback & | cb | ||
) |
Definition at line 674 of file colpartition.cpp.
void tesseract::ColPartition::AddBox | ( | BLOBNBOX * | box | ) |
Definition at line 180 of file colpartition.cpp.
void tesseract::ColPartition::AddPartner | ( | bool | upper, |
ColPartition * | partner | ||
) |
Definition at line 638 of file colpartition.cpp.
void tesseract::ColPartition::AddToWorkingSet | ( | const ICOORD & | bleft, |
const ICOORD & | tright, | ||
int | resolution, | ||
ColPartition_LIST * | used_parts, | ||
WorkingPartSet_LIST * | working_set | ||
) |
Definition at line 1411 of file colpartition.cpp.
BLOBNBOX * tesseract::ColPartition::BiggestBox | ( | ) |
Definition at line 229 of file colpartition.cpp.
|
inline |
Definition at line 147 of file colpartition.h.
|
inline |
Definition at line 204 of file colpartition.h.
|
inline |
Definition at line 219 of file colpartition.h.
|
inline |
Definition at line 108 of file colpartition.h.
Definition at line 250 of file colpartition.cpp.
ScrollView::Color tesseract::ColPartition::BoxColor | ( | ) | const |
Definition at line 1850 of file colpartition.cpp.
|
inline |
Definition at line 186 of file colpartition.h.
|
inline |
Definition at line 189 of file colpartition.h.
|
inline |
Definition at line 332 of file colpartition.h.
|
inline |
Definition at line 336 of file colpartition.h.
void tesseract::ColPartition::ClaimBoxes | ( | ) |
Definition at line 263 of file colpartition.cpp.
|
inline |
Definition at line 238 of file colpartition.h.
|
inline |
Definition at line 285 of file colpartition.h.
|
inline |
Definition at line 288 of file colpartition.h.
|
inline |
Definition at line 213 of file colpartition.h.
|
inline |
Definition at line 353 of file colpartition.h.
void tesseract::ColPartition::ColumnRange | ( | int | resolution, |
ColPartitionSet * | columns, | ||
int * | first_col, | ||
int * | last_col | ||
) |
Definition at line 1107 of file colpartition.cpp.
|
inline |
Definition at line 328 of file colpartition.h.
void tesseract::ColPartition::ComputeLimits | ( | ) |
Definition at line 905 of file colpartition.cpp.
void tesseract::ColPartition::ComputeSpecialBlobsDensity | ( | ) |
Definition at line 617 of file colpartition.cpp.
bool tesseract::ColPartition::ConfirmNoTabViolation | ( | const ColPartition & | other | ) | const |
Definition at line 437 of file colpartition.cpp.
ColPartition * tesseract::ColPartition::CopyButDontOwnBlobs | ( | ) |
Definition at line 1835 of file colpartition.cpp.
void tesseract::ColPartition::CopyLeftTab | ( | const ColPartition & | src, |
bool | take_box | ||
) |
Definition at line 552 of file colpartition.cpp.
void tesseract::ColPartition::CopyRightTab | ( | const ColPartition & | src, |
bool | take_box | ||
) |
Definition at line 566 of file colpartition.cpp.
int tesseract::ColPartition::CountOverlappingBoxes | ( | const TBOX & | box | ) |
Definition at line 1010 of file colpartition.cpp.
void tesseract::ColPartition::DeleteBoxes | ( | ) |
Definition at line 326 of file colpartition.cpp.
|
inline |
Definition at line 210 of file colpartition.h.
void tesseract::ColPartition::DisownBoxes | ( | ) |
Definition at line 279 of file colpartition.cpp.
void tesseract::ColPartition::DisownBoxesNoAssert | ( | ) |
Definition at line 292 of file colpartition.cpp.
|
static |
Definition at line 108 of file colpartition.cpp.
|
inline |
Definition at line 153 of file colpartition.h.
|
inline |
Definition at line 159 of file colpartition.h.
|
inline |
Definition at line 165 of file colpartition.h.
|
inline |
Definition at line 162 of file colpartition.h.
bool tesseract::ColPartition::HasGoodBaseline | ( | ) |
Definition at line 1343 of file colpartition.cpp.
|
inline |
Definition at line 384 of file colpartition.h.
|
inline |
Definition at line 365 of file colpartition.h.
|
inline |
Definition at line 243 of file colpartition.h.
|
inline |
Definition at line 357 of file colpartition.h.
|
inline |
Definition at line 459 of file colpartition.h.
|
inline |
Definition at line 445 of file colpartition.h.
|
inline |
Definition at line 429 of file colpartition.h.
bool tesseract::ColPartition::IsInSameColumnAs | ( | const ColPartition & | part | ) | const |
Definition at line 2270 of file colpartition.cpp.
|
inline |
Definition at line 349 of file colpartition.h.
bool tesseract::ColPartition::IsLegal | ( | ) |
Definition at line 364 of file colpartition.cpp.
|
inline |
Definition at line 425 of file colpartition.h.
|
inline |
Definition at line 437 of file colpartition.h.
|
inline |
Definition at line 361 of file colpartition.h.
|
inline |
Definition at line 433 of file colpartition.h.
|
inline |
Definition at line 449 of file colpartition.h.
|
inline |
Definition at line 454 of file colpartition.h.
|
inline |
Definition at line 441 of file colpartition.h.
|
inline |
Definition at line 324 of file colpartition.h.
|
inline |
Definition at line 171 of file colpartition.h.
|
inline |
Definition at line 168 of file colpartition.h.
|
inline |
Definition at line 111 of file colpartition.h.
|
inline |
Definition at line 340 of file colpartition.h.
int tesseract::ColPartition::LeftBlobRule | ( | ) | const |
Definition at line 580 of file colpartition.cpp.
|
static |
Definition at line 1473 of file colpartition.cpp.
|
inline |
Definition at line 198 of file colpartition.h.
|
static |
Definition at line 129 of file colpartition.cpp.
|
static |
Definition at line 1697 of file colpartition.cpp.
|
static |
Constructs a fake ColPartition with no BLOBNBOXes to represent a horizontal or vertical line, given a type and a bounding box.
Definition at line 161 of file colpartition.cpp.
TO_ROW * tesseract::ColPartition::MakeToRow | ( | ) |
Definition at line 1784 of file colpartition.cpp.
|
static |
Definition at line 1757 of file colpartition.cpp.
bool tesseract::ColPartition::MarkAsLeaderIfMonospaced | ( | ) |
Definition at line 1131 of file colpartition.cpp.
bool tesseract::ColPartition::MatchingColumns | ( | const ColPartition & | other | ) | const |
Definition at line 392 of file colpartition.cpp.
bool tesseract::ColPartition::MatchingSizes | ( | const ColPartition & | other | ) | const |
Definition at line 428 of file colpartition.cpp.
bool tesseract::ColPartition::MatchingStrokeWidth | ( | const ColPartition & | other, |
double | fractional_tolerance, | ||
double | constant_tolerance | ||
) | const |
Definition at line 458 of file colpartition.cpp.
bool tesseract::ColPartition::MatchingTextColor | ( | const ColPartition & | other | ) | const |
Definition at line 406 of file colpartition.cpp.
|
inline |
Definition at line 126 of file colpartition.h.
|
inline |
Definition at line 135 of file colpartition.h.
|
inline |
Definition at line 129 of file colpartition.h.
|
inline |
Definition at line 132 of file colpartition.h.
|
inline |
Definition at line 123 of file colpartition.h.
|
inline |
Definition at line 141 of file colpartition.h.
|
inline |
Definition at line 308 of file colpartition.h.
|
inline |
Definition at line 312 of file colpartition.h.
|
inline |
Definition at line 304 of file colpartition.h.
|
inline |
Definition at line 249 of file colpartition.h.
|
inline |
Definition at line 255 of file colpartition.h.
bool tesseract::ColPartition::OKDiacriticMerge | ( | const ColPartition & | candidate, |
bool | debug | ||
) | const |
Definition at line 486 of file colpartition.cpp.
bool tesseract::ColPartition::OKMergeOverlap | ( | const ColPartition & | merge1, |
const ColPartition & | merge2, | ||
int | ok_box_overlap, | ||
bool | debug | ||
) |
Definition at line 773 of file colpartition.cpp.
Definition at line 808 of file colpartition.cpp.
|
inline |
Definition at line 291 of file colpartition.h.
PolyBlockType tesseract::ColPartition::PartitionType | ( | ColumnSpanningType | flow | ) | const |
Definition at line 1056 of file colpartition.cpp.
void tesseract::ColPartition::Print | ( | ) | const |
Definition at line 1862 of file colpartition.cpp.
void tesseract::ColPartition::PrintColors | ( | ) |
Definition at line 1879 of file colpartition.cpp.
void tesseract::ColPartition::RefinePartners | ( | PolyBlockType | type, |
bool | get_desperate, | ||
ColPartitionGrid * | grid | ||
) |
Definition at line 1956 of file colpartition.cpp.
void tesseract::ColPartition::ReflectInYAxis | ( | ) |
Definition at line 342 of file colpartition.cpp.
bool tesseract::ColPartition::ReleaseNonLeaderBoxes | ( | ) |
Definition at line 306 of file colpartition.cpp.
void tesseract::ColPartition::RemoveBox | ( | BLOBNBOX * | box | ) |
Definition at line 216 of file colpartition.cpp.
void tesseract::ColPartition::RemovePartner | ( | bool | upper, |
ColPartition * | partner | ||
) |
Definition at line 653 of file colpartition.cpp.
|
inline |
Definition at line 177 of file colpartition.h.
|
inline |
Definition at line 174 of file colpartition.h.
|
inline |
Definition at line 117 of file colpartition.h.
|
inline |
Definition at line 344 of file colpartition.h.
int tesseract::ColPartition::RightBlobRule | ( | ) | const |
Definition at line 585 of file colpartition.cpp.
|
inline |
Definition at line 150 of file colpartition.h.
|
inline |
Definition at line 207 of file colpartition.h.
|
inline |
Definition at line 222 of file colpartition.h.
|
inline |
Definition at line 729 of file colpartition.h.
|
inline |
Definition at line 156 of file colpartition.h.
|
inline |
Definition at line 246 of file colpartition.h.
|
inline |
Definition at line 732 of file colpartition.h.
|
inline |
Definition at line 114 of file colpartition.h.
|
inline |
Definition at line 138 of file colpartition.h.
|
inline |
Definition at line 144 of file colpartition.h.
|
inline |
Definition at line 252 of file colpartition.h.
|
inline |
Definition at line 258 of file colpartition.h.
|
inline |
Definition at line 294 of file colpartition.h.
|
inline |
Definition at line 120 of file colpartition.h.
|
inline |
Definition at line 216 of file colpartition.h.
|
inline |
Definition at line 264 of file colpartition.h.
|
inline |
Definition at line 270 of file colpartition.h.
|
inline |
Definition at line 276 of file colpartition.h.
|
inline |
Definition at line 282 of file colpartition.h.
|
inline |
Definition at line 232 of file colpartition.h.
|
inline |
Definition at line 228 of file colpartition.h.
|
inline |
Definition at line 183 of file colpartition.h.
|
inline |
Definition at line 192 of file colpartition.h.
|
inline |
Definition at line 201 of file colpartition.h.
void tesseract::ColPartition::SetBlobTypes | ( | ) |
Definition at line 1326 of file colpartition.cpp.
void tesseract::ColPartition::SetColumnGoodness | ( | const WidthCallback & | cb | ) |
void tesseract::ColPartition::SetLeftTab | ( | const TabVector * | tab_vector | ) |
Definition at line 525 of file colpartition.cpp.
void tesseract::ColPartition::SetPartitionType | ( | int | resolution, |
ColPartitionSet * | columns | ||
) |
Definition at line 1024 of file colpartition.cpp.
void tesseract::ColPartition::SetRegionAndFlowTypesFromProjectionValue | ( | int | value | ) |
Definition at line 1241 of file colpartition.cpp.
void tesseract::ColPartition::SetRightTab | ( | const TabVector * | tab_vector | ) |
Definition at line 538 of file colpartition.cpp.
void tesseract::ColPartition::SetSpecialBlobsDensity | ( | const BlobSpecialTextType | type, |
const float | density | ||
) |
Definition at line 611 of file colpartition.cpp.
ColPartition * tesseract::ColPartition::ShallowCopy | ( | ) | const |
Definition at line 1808 of file colpartition.cpp.
ColPartition * tesseract::ColPartition::SingletonPartner | ( | bool | upper | ) |
Definition at line 664 of file colpartition.cpp.
void tesseract::ColPartition::SmoothPartnerRun | ( | int | working_set_count | ) |
Definition at line 1886 of file colpartition.cpp.
|
inlinestatic |
Definition at line 712 of file colpartition.h.
|
inline |
Definition at line 316 of file colpartition.h.
|
inline |
Definition at line 261 of file colpartition.h.
|
inline |
Definition at line 267 of file colpartition.h.
|
inline |
Definition at line 273 of file colpartition.h.
|
inline |
Definition at line 279 of file colpartition.h.
int tesseract::ColPartition::SpecialBlobsCount | ( | const BlobSpecialTextType | type | ) |
Definition at line 596 of file colpartition.cpp.
float tesseract::ColPartition::SpecialBlobsDensity | ( | const BlobSpecialTextType | type | ) | const |
Definition at line 591 of file colpartition.cpp.
ColPartition * tesseract::ColPartition::SplitAt | ( | int | split_x | ) |
Definition at line 865 of file colpartition.cpp.
ColPartition * tesseract::ColPartition::SplitAtBlob | ( | BLOBNBOX * | split_blob | ) |
Definition at line 828 of file colpartition.cpp.
|
inline |
Definition at line 225 of file colpartition.h.
|
inline |
Definition at line 180 of file colpartition.h.
|
inlinestatic |
Definition at line 412 of file colpartition.h.
|
inline |
Definition at line 409 of file colpartition.h.
|
inlinestatic |
Definition at line 418 of file colpartition.h.
|
inline |
Definition at line 195 of file colpartition.h.
|
inline |
Definition at line 375 of file colpartition.h.
|
inline |
Definition at line 370 of file colpartition.h.
|
inline |
Definition at line 390 of file colpartition.h.
|
inline |
Definition at line 401 of file colpartition.h.
|
inline |
Definition at line 320 of file colpartition.h.