Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix separator line detector #3082

Merged
merged 3 commits into from
Aug 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/textord/alignedblob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

INT_VAR(textord_debug_tabfind, 0, "Debug tab finding");
INT_VAR(textord_debug_bugs, 0, "Turn on output related to bugs in tab finding");
static INT_VAR(textord_testregion_left, -1, "Left edge of debug reporting rectangle");
static INT_VAR(textord_testregion_top, -1, "Top edge of debug reporting rectangle");
static INT_VAR(textord_testregion_right, INT32_MAX, "Right edge of debug rectangle");
static INT_VAR(textord_testregion_bottom, INT32_MAX, "Bottom edge of debug rectangle");
static INT_VAR(textord_testregion_left, -1, "Left edge of debug reporting rectangle in Leptonica coords (bottom=0/top=height), with horizontal lines x/y-flipped");
static INT_VAR(textord_testregion_top, INT32_MAX, "Top edge of debug reporting rectangle in Leptonica coords (bottom=0/top=height), with horizontal lines x/y-flipped");
static INT_VAR(textord_testregion_right, INT32_MAX, "Right edge of debug rectangle in Leptonica coords (bottom=0/top=height), with horizontal lines x/y-flipped");
static INT_VAR(textord_testregion_bottom, -1, "Bottom edge of debug rectangle in Leptonica coords (bottom=0/top=height), with horizontal lines x/y-flipped");
BOOL_VAR(textord_debug_printable, false, "Make debug windows printable");

namespace tesseract {
Expand All @@ -53,7 +53,7 @@ const int kMinRaggedTabs = 5;
// Min number of points to accept for an aligned tab stop.
const int kMinAlignedTabs = 4;
// Constant number of pixels minimum height of a vertical line.
const int kVLineMinLength = 500;
const int kVLineMinLength = 300;
// Minimum gradient for a vertical tab vector. Used to prune away junk
// tab vectors with what would be a ridiculously large skew angle.
// Value corresponds to tan(90 - max allowed skew angle)
Expand Down
4 changes: 3 additions & 1 deletion src/textord/colfind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,9 @@ void ColumnFinder::GridRemoveUnderlinePartitions() {
if (line_box.bottom() <= text_bottom && text_bottom <= search_box.top())
touched_text = true;
} else if (covered->blob_type() == BRT_HLINE &&
line_box.contains(covered->bounding_box())) {
line_box.contains(covered->bounding_box()) &&
// not if same instance (identical to hline)
!TBOX(covered->bounding_box()).contains(line_box)) {
line_part = covered;
}
}
Expand Down