From 2a68e1b221881c1598864c719fe583d3b00a227c Mon Sep 17 00:00:00 2001 From: llocarnini Date: Fri, 18 Feb 2022 16:36:25 +0100 Subject: [PATCH] kernel size for morphology ex set bit higher, so less non-table structure are detected. Reduced the kernel size of the directional motion blurr and increased the treshold a little bit so narrow cells wont be split up. Problem with the cell filtering for certain scanned pdfs detected. --- vidocp/utils/post_processing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vidocp/utils/post_processing.py b/vidocp/utils/post_processing.py index 79626d2..a3a04b1 100644 --- a/vidocp/utils/post_processing.py +++ b/vidocp/utils/post_processing.py @@ -43,6 +43,7 @@ def adjacent(a, b): """ def adjacent2d(g, h, i, j, k, l): + #print(adjacent1d(g, h) and any(k <= p <= l for p in [i, j])) return adjacent1d(g, h) and any(k <= p <= l for p in [i, j]) if any(x is None for x in (a, b)): @@ -78,6 +79,7 @@ def __remove_isolated_unsorted(rectangles): def __remove_isolated_sorted(rectangles): def is_connected(left, center, right): + # print(left,center,right, list(starmap(adjacent, [(left, center), (center, right)]))) return any(starmap(adjacent, [(left, center), (center, right)])) rectangles = list(map(xywh_to_vec_rect, rectangles))