From 53b27ee8837c0027b2d2cbe37cc95ce9d173c9fd Mon Sep 17 00:00:00 2001 From: Andrey Golovizin Date: Mon, 25 Aug 2014 17:35:34 +0200 Subject: [PATCH] Use optical distance correction when detecting apostrophes. --- pixelocr/page.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pixelocr/page.py b/pixelocr/page.py index 5c280fd..7d9c45e 100644 --- a/pixelocr/page.py +++ b/pixelocr/page.py @@ -93,7 +93,7 @@ class Page(PageObject): @cached_property @collect_iterable def lines(self): - for line_img in self.image._iter_lines(min_space=2): + for line_img in self.image._iter_lines(min_space=2, min_height=10): yield Line(line_img) @@ -226,7 +226,7 @@ class Glyph(PageObject): self.top - 5, self.right + 5, self.top + 10, - ) and glyph.height > 3: + ) and glyph.height > 3 and self.optical_distance(glyph) < 4: return True # dot in ? and !