Use optical distance correction when detecting apostrophes.

This commit is contained in:
Andrey Golovizin 2014-08-25 17:35:34 +02:00
parent fac5d738a7
commit 53b27ee883

View file

@ -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 !