Definition at line 31 of file tablerecog_test.cc.
◆ CountHorizontalIntersections()
int tesseract::StructuredTable::CountHorizontalIntersections |
Definition at line 221 of file tablerecog.cpp.
683 horizontal_box.set_top(y + kGridSize);
686 gsearch.SetUniqueMode(
true);
687 gsearch.StartRectSearch(horizontal_box);
688 ColPartition *text =
nullptr;
689 while ((text = gsearch.NextRectSearch()) !=
nullptr) {
690 if (!text->IsTextType()) {
694 const TBOX &box = text->bounding_box();
695 if (box.bottom() < y && y < box.top()) {
GridSearch< ColPartition, ColPartition_CLIST, ColPartition_C_IT > ColPartitionGridSearch
ColPartitionGrid * text_grid_
◆ CountVerticalIntersections()
int tesseract::StructuredTable::CountVerticalIntersections |
Definition at line 220 of file tablerecog.cpp.
656 vertical_box.
set_left(x - kGridSize);
657 vertical_box.set_right(x + kGridSize);
660 gsearch.SetUniqueMode(
true);
661 gsearch.StartRectSearch(vertical_box);
662 ColPartition *text =
nullptr;
663 while ((text = gsearch.NextRectSearch()) !=
nullptr) {
664 if (!text->IsTextType()) {
667 const TBOX &box = text->bounding_box();
668 if (box.left() < x && x < box.right()) {
◆ ExpectCellX()
void tesseract::TestableStructuredTable::ExpectCellX |
( |
int |
x_min, |
|
|
int |
second, |
|
|
int |
add, |
|
|
int |
almost_done, |
|
|
int |
x_max |
|
) |
| |
|
inline |
Definition at line 49 of file tablerecog_test.cc.
50 ASSERT_EQ(0, (almost_done - second) % add);
51 EXPECT_EQ(3 + (almost_done - second) / add,
cell_x_.size());
52 EXPECT_EQ(x_min,
cell_x_.at(0));
54 for (
unsigned i = 1; i <
cell_x_.size() - 1; ++i) {
55 EXPECT_EQ(second + add * (i - 1),
cell_x_.at(i));
std::vector< int > cell_x_
◆ ExpectSortedX()
void tesseract::TestableStructuredTable::ExpectSortedX |
( |
| ) |
|
|
inline |
◆ FindLinedStructure()
bool tesseract::StructuredTable::FindLinedStructure |
Definition at line 105 of file tablerecog.cpp.
141 box_search.SetUniqueMode(
true);
143 ColPartition *line =
nullptr;
145 while ((line = box_search.NextRectSearch()) !=
nullptr) {
146 if (line->IsHorizontalLine()) {
147 cell_y_.push_back(line->MidY());
149 if (line->IsVerticalLine()) {
150 cell_x_.push_back(line->MidX());
TDimension bottom() const
std::vector< int > cell_y_
ColPartitionGrid * line_grid_
bool VerifyLinedTableCells()
◆ FindWhitespacedColumns()
void tesseract::StructuredTable::FindWhitespacedColumns |
Definition at line 160 of file tablerecog.cpp.
364 std::vector<int> left_sides;
365 std::vector<int> right_sides;
371 gsearch.SetUniqueMode(
true);
373 ColPartition *text =
nullptr;
374 while ((text = gsearch.NextRectSearch()) !=
nullptr) {
375 if (!text->IsTextType()) {
379 ASSERT_HOST(text->bounding_box().left() < text->bounding_box().right());
380 int spacing =
static_cast<int>(text->median_width() *
kHorizontalSpacing / 2.0 + 0.5);
381 left_sides.push_back(text->bounding_box().left() - spacing);
382 right_sides.push_back(text->bounding_box().right() + spacing);
385 if (left_sides.empty() || right_sides.empty()) {
390 std::sort(left_sides.begin(), left_sides.end());
391 std::sort(right_sides.begin(), right_sides.end());
const double kHorizontalSpacing
const int kCellSplitColumnThreshold
static void FindCellSplitLocations(const std::vector< int > &min_list, const std::vector< int > &max_list, int max_merged, std::vector< int > *locations)
◆ FindWhitespacedStructure()
bool tesseract::StructuredTable::FindWhitespacedStructure |
Definition at line 110 of file tablerecog.cpp.
void FindWhitespacedRows()
bool VerifyWhitespacedTable()
void FindWhitespacedColumns()
◆ InjectCellX()
void tesseract::TestableStructuredTable::InjectCellX |
( |
int |
x | ) |
|
|
inline |
◆ InjectCellY()
void tesseract::TestableStructuredTable::InjectCellY |
( |
int |
y | ) |
|
|
inline |
◆ VerifyLinedTableCells()
bool tesseract::StructuredTable::VerifyLinedTableCells |
Definition at line 148 of file tablerecog.cpp.
int CountHorizontalIntersections(int y)
int CountVerticalIntersections(int x)
The documentation for this class was generated from the following file: