Baseline detection: tweak closing amount.

This commit is contained in:
Andrey Golovizin 2014-08-26 22:54:09 +02:00
parent ef6369f10e
commit b23cba1cd8

View file

@ -161,7 +161,7 @@ class Line(PageObject):
"""Detect baseline height, relative to the top."""
skip = self.height // 2
bitmap = self.image.bitmap[skip:, :]
bitmap = grey_closing(bitmap, (0, 10), mode='constant')
bitmap = grey_closing(bitmap, (0, 4), mode='constant')
histogram = bitmap.sum(axis=1)
gradient = list(filters.correlate1d(histogram, [-1, 1], axis=0, mode='constant'))
gradient[0] = histogram[0]