Baseline detection: tweak closing amount.
This commit is contained in:
parent
ef6369f10e
commit
b23cba1cd8
1 changed files with 1 additions and 1 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue