Tweak baseline detection: decrease detection height.

This commit is contained in:
Andrey Golovizin 2014-08-28 23:40:33 +02:00
parent a089846a31
commit f7a7fca3ad

View file

@ -172,7 +172,7 @@ class Line(PageObject):
@cached_property @cached_property
def baseline(self): def baseline(self):
"""Detect baseline height, relative to the top.""" """Detect baseline height, relative to the top."""
skip = self.height // 2 skip = self.height * 2 // 3
bitmap = self.image.bitmap[skip:, :] bitmap = self.image.bitmap[skip:, :]
bitmap = grey_closing(bitmap, (0, 4), mode='constant') bitmap = grey_closing(bitmap, (0, 4), mode='constant')
histogram = bitmap.sum(axis=1) histogram = bitmap.sum(axis=1)