tesseract
4.0.0-1-g2a2b
|
#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, 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 (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) |
Public Member Functions inherited from ELIST2_LINK | |
ELIST2_LINK () | |
ELIST2_LINK (const ELIST2_LINK &) | |
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 68 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 81 of file colpartition.cpp.
tesseract::ColPartition::~ColPartition | ( | ) |
Definition at line 143 of file colpartition.cpp.
void tesseract::ColPartition::Absorb | ( | ColPartition * | other, |
WidthCallback * | cb | ||
) |
Definition at line 648 of file colpartition.cpp.
void tesseract::ColPartition::AddBox | ( | BLOBNBOX * | box | ) |
Definition at line 179 of file colpartition.cpp.
void tesseract::ColPartition::AddPartner | ( | bool | upper, |
ColPartition * | partner | ||
) |
Definition at line 613 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 1358 of file colpartition.cpp.
BLOBNBOX * tesseract::ColPartition::BiggestBox | ( | ) |
Definition at line 225 of file colpartition.cpp.
|
inline |
Definition at line 149 of file colpartition.h.
|
inline |
Definition at line 206 of file colpartition.h.
|
inline |
Definition at line 221 of file colpartition.h.
|
inline |
Definition at line 110 of file colpartition.h.
Definition at line 244 of file colpartition.cpp.
ScrollView::Color tesseract::ColPartition::BoxColor | ( | ) | const |
Definition at line 1782 of file colpartition.cpp.
|
inline |
Definition at line 188 of file colpartition.h.
|
inline |
Definition at line 191 of file colpartition.h.
|
inline |
Definition at line 333 of file colpartition.h.
|
inline |
Definition at line 337 of file colpartition.h.
void tesseract::ColPartition::ClaimBoxes | ( | ) |
Definition at line 257 of file colpartition.cpp.
|
inline |
Definition at line 240 of file colpartition.h.
|
inline |
Definition at line 286 of file colpartition.h.
|
inline |
Definition at line 289 of file colpartition.h.
|
inline |
Definition at line 215 of file colpartition.h.
|
inline |
Definition at line 354 of file colpartition.h.
void tesseract::ColPartition::ColumnRange | ( | int | resolution, |
ColPartitionSet * | columns, | ||
int * | first_col, | ||
int * | last_col | ||
) |
Definition at line 1066 of file colpartition.cpp.
|
inline |
Definition at line 329 of file colpartition.h.
void tesseract::ColPartition::ComputeLimits | ( | ) |
Definition at line 871 of file colpartition.cpp.
void tesseract::ColPartition::ComputeSpecialBlobsDensity | ( | ) |
Definition at line 592 of file colpartition.cpp.
bool tesseract::ColPartition::ConfirmNoTabViolation | ( | const ColPartition & | other | ) | const |
Definition at line 423 of file colpartition.cpp.
ColPartition * tesseract::ColPartition::CopyButDontOwnBlobs | ( | ) |
Definition at line 1769 of file colpartition.cpp.
void tesseract::ColPartition::CopyLeftTab | ( | const ColPartition & | src, |
bool | take_box | ||
) |
Definition at line 529 of file colpartition.cpp.
void tesseract::ColPartition::CopyRightTab | ( | const ColPartition & | src, |
bool | take_box | ||
) |
Definition at line 542 of file colpartition.cpp.
int tesseract::ColPartition::CountOverlappingBoxes | ( | const TBOX & | box | ) |
Definition at line 970 of file colpartition.cpp.
void tesseract::ColPartition::DeleteBoxes | ( | ) |
Definition at line 315 of file colpartition.cpp.
|
inline |
Definition at line 212 of file colpartition.h.
void tesseract::ColPartition::DisownBoxes | ( | ) |
Definition at line 273 of file colpartition.cpp.
void tesseract::ColPartition::DisownBoxesNoAssert | ( | ) |
Definition at line 286 of file colpartition.cpp.
|
static |
Definition at line 105 of file colpartition.cpp.
|
inline |
Definition at line 155 of file colpartition.h.
|
inline |
Definition at line 161 of file colpartition.h.
|
inline |
Definition at line 167 of file colpartition.h.
|
inline |
Definition at line 164 of file colpartition.h.
bool tesseract::ColPartition::HasGoodBaseline | ( | ) |
Definition at line 1291 of file colpartition.cpp.
|
inline |
Definition at line 385 of file colpartition.h.
|
inline |
Definition at line 366 of file colpartition.h.
|
inline |
Definition at line 244 of file colpartition.h.
|
inline |
Definition at line 358 of file colpartition.h.
|
inline |
Definition at line 460 of file colpartition.h.
|
inline |
Definition at line 446 of file colpartition.h.
|
inline |
Definition at line 430 of file colpartition.h.
bool tesseract::ColPartition::IsInSameColumnAs | ( | const ColPartition & | part | ) | const |
Definition at line 2186 of file colpartition.cpp.
|
inline |
Definition at line 350 of file colpartition.h.
bool tesseract::ColPartition::IsLegal | ( | ) |
Definition at line 352 of file colpartition.cpp.
|
inline |
Definition at line 426 of file colpartition.h.
|
inline |
Definition at line 438 of file colpartition.h.
|
inline |
Definition at line 362 of file colpartition.h.
|
inline |
Definition at line 434 of file colpartition.h.
|
inline |
Definition at line 450 of file colpartition.h.
|
inline |
Definition at line 455 of file colpartition.h.
|
inline |
Definition at line 442 of file colpartition.h.
|
inline |
Definition at line 325 of file colpartition.h.
|
inline |
Definition at line 173 of file colpartition.h.
|
inline |
Definition at line 170 of file colpartition.h.
|
inline |
Definition at line 113 of file colpartition.h.
|
inline |
Definition at line 341 of file colpartition.h.
int tesseract::ColPartition::LeftBlobRule | ( | ) | const |
Definition at line 555 of file colpartition.cpp.
|
static |
Definition at line 1418 of file colpartition.cpp.
|
inline |
Definition at line 200 of file colpartition.h.
|
static |
Definition at line 126 of file colpartition.cpp.
|
static |
Definition at line 1634 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 158 of file colpartition.cpp.
TO_ROW * tesseract::ColPartition::MakeToRow | ( | ) |
Definition at line 1717 of file colpartition.cpp.
|
static |
Definition at line 1691 of file colpartition.cpp.
bool tesseract::ColPartition::MarkAsLeaderIfMonospaced | ( | ) |
Definition at line 1093 of file colpartition.cpp.
bool tesseract::ColPartition::MatchingColumns | ( | const ColPartition & | other | ) | const |
Definition at line 380 of file colpartition.cpp.
bool tesseract::ColPartition::MatchingSizes | ( | const ColPartition & | other | ) | const |
Definition at line 415 of file colpartition.cpp.
bool tesseract::ColPartition::MatchingStrokeWidth | ( | const ColPartition & | other, |
double | fractional_tolerance, | ||
double | constant_tolerance | ||
) | const |
Definition at line 440 of file colpartition.cpp.
bool tesseract::ColPartition::MatchingTextColor | ( | const ColPartition & | other | ) | const |
Definition at line 392 of file colpartition.cpp.
|
inline |
Definition at line 128 of file colpartition.h.
|
inline |
Definition at line 137 of file colpartition.h.
|
inline |
Definition at line 131 of file colpartition.h.
|
inline |
Definition at line 134 of file colpartition.h.
|
inline |
Definition at line 125 of file colpartition.h.
|
inline |
Definition at line 143 of file colpartition.h.
|
inline |
Definition at line 309 of file colpartition.h.
|
inline |
Definition at line 313 of file colpartition.h.
|
inline |
Definition at line 305 of file colpartition.h.
|
inline |
Definition at line 250 of file colpartition.h.
|
inline |
Definition at line 256 of file colpartition.h.
bool tesseract::ColPartition::OKDiacriticMerge | ( | const ColPartition & | candidate, |
bool | debug | ||
) | const |
Definition at line 468 of file colpartition.cpp.
bool tesseract::ColPartition::OKMergeOverlap | ( | const ColPartition & | merge1, |
const ColPartition & | merge2, | ||
int | ok_box_overlap, | ||
bool | debug | ||
) |
Definition at line 746 of file colpartition.cpp.
Definition at line 779 of file colpartition.cpp.
|
inline |
Definition at line 292 of file colpartition.h.
PolyBlockType tesseract::ColPartition::PartitionType | ( | ColumnSpanningType | flow | ) | const |
Definition at line 1016 of file colpartition.cpp.
void tesseract::ColPartition::Print | ( | ) | const |
Definition at line 1793 of file colpartition.cpp.
void tesseract::ColPartition::PrintColors | ( | ) |
Definition at line 1811 of file colpartition.cpp.
void tesseract::ColPartition::RefinePartners | ( | PolyBlockType | type, |
bool | get_desperate, | ||
ColPartitionGrid * | grid | ||
) |
Definition at line 1888 of file colpartition.cpp.
void tesseract::ColPartition::ReflectInYAxis | ( | ) |
Definition at line 330 of file colpartition.cpp.
bool tesseract::ColPartition::ReleaseNonLeaderBoxes | ( | ) |
Definition at line 299 of file colpartition.cpp.
void tesseract::ColPartition::RemoveBox | ( | BLOBNBOX * | box | ) |
Definition at line 212 of file colpartition.cpp.
void tesseract::ColPartition::RemovePartner | ( | bool | upper, |
ColPartition * | partner | ||
) |
Definition at line 628 of file colpartition.cpp.
|
inline |
Definition at line 179 of file colpartition.h.
|
inline |
Definition at line 176 of file colpartition.h.
|
inline |
Definition at line 119 of file colpartition.h.
|
inline |
Definition at line 345 of file colpartition.h.
int tesseract::ColPartition::RightBlobRule | ( | ) | const |
Definition at line 560 of file colpartition.cpp.
|
inline |
Definition at line 152 of file colpartition.h.
|
inline |
Definition at line 209 of file colpartition.h.
|
inline |
Definition at line 224 of file colpartition.h.
|
inline |
Definition at line 732 of file colpartition.h.
|
inline |
Definition at line 158 of file colpartition.h.
|
inline |
Definition at line 247 of file colpartition.h.
|
inline |
Definition at line 735 of file colpartition.h.
|
inline |
Definition at line 116 of file colpartition.h.
|
inline |
Definition at line 140 of file colpartition.h.
|
inline |
Definition at line 146 of file colpartition.h.
|
inline |
Definition at line 253 of file colpartition.h.
|
inline |
Definition at line 259 of file colpartition.h.
|
inline |
Definition at line 295 of file colpartition.h.
|
inline |
Definition at line 122 of file colpartition.h.
|
inline |
Definition at line 218 of file colpartition.h.
|
inline |
Definition at line 265 of file colpartition.h.
|
inline |
Definition at line 271 of file colpartition.h.
|
inline |
Definition at line 277 of file colpartition.h.
|
inline |
Definition at line 283 of file colpartition.h.
|
inline |
Definition at line 234 of file colpartition.h.
|
inline |
Definition at line 230 of file colpartition.h.
|
inline |
Definition at line 185 of file colpartition.h.
|
inline |
Definition at line 194 of file colpartition.h.
|
inline |
Definition at line 203 of file colpartition.h.
void tesseract::ColPartition::SetBlobTypes | ( | ) |
Definition at line 1276 of file colpartition.cpp.
void tesseract::ColPartition::SetColumnGoodness | ( | WidthCallback * | cb | ) |
Definition at line 1080 of file colpartition.cpp.
void tesseract::ColPartition::SetLeftTab | ( | const TabVector * | tab_vector | ) |
Definition at line 504 of file colpartition.cpp.
void tesseract::ColPartition::SetPartitionType | ( | int | resolution, |
ColPartitionSet * | columns | ||
) |
Definition at line 983 of file colpartition.cpp.
void tesseract::ColPartition::SetRegionAndFlowTypesFromProjectionValue | ( | int | value | ) |
Definition at line 1202 of file colpartition.cpp.
void tesseract::ColPartition::SetRightTab | ( | const TabVector * | tab_vector | ) |
Definition at line 516 of file colpartition.cpp.
void tesseract::ColPartition::SetSpecialBlobsDensity | ( | const BlobSpecialTextType | type, |
const float | density | ||
) |
Definition at line 586 of file colpartition.cpp.
ColPartition * tesseract::ColPartition::ShallowCopy | ( | ) | const |
Definition at line 1742 of file colpartition.cpp.
ColPartition * tesseract::ColPartition::SingletonPartner | ( | bool | upper | ) |
Definition at line 639 of file colpartition.cpp.
void tesseract::ColPartition::SmoothPartnerRun | ( | int | working_set_count | ) |
Definition at line 1819 of file colpartition.cpp.
|
inlinestatic |
Definition at line 715 of file colpartition.h.
|
inline |
Definition at line 317 of file colpartition.h.
|
inline |
Definition at line 262 of file colpartition.h.
|
inline |
Definition at line 268 of file colpartition.h.
|
inline |
Definition at line 274 of file colpartition.h.
|
inline |
Definition at line 280 of file colpartition.h.
int tesseract::ColPartition::SpecialBlobsCount | ( | const BlobSpecialTextType | type | ) |
Definition at line 571 of file colpartition.cpp.
float tesseract::ColPartition::SpecialBlobsDensity | ( | const BlobSpecialTextType | type | ) | const |
Definition at line 566 of file colpartition.cpp.
ColPartition * tesseract::ColPartition::SplitAt | ( | int | split_x | ) |
Definition at line 833 of file colpartition.cpp.
ColPartition * tesseract::ColPartition::SplitAtBlob | ( | BLOBNBOX * | split_blob | ) |
Definition at line 797 of file colpartition.cpp.
|
inline |
Definition at line 227 of file colpartition.h.
|
inline |
Definition at line 182 of file colpartition.h.
|
inline |
Definition at line 410 of file colpartition.h.
|
inlinestatic |
Definition at line 413 of file colpartition.h.
|
inlinestatic |
Definition at line 419 of file colpartition.h.
|
inline |
Definition at line 197 of file colpartition.h.
|
inline |
Definition at line 376 of file colpartition.h.
|
inline |
Definition at line 371 of file colpartition.h.
|
inline |
Definition at line 391 of file colpartition.h.
|
inline |
Definition at line 402 of file colpartition.h.
|
inline |
Definition at line 321 of file colpartition.h.