Skip to content

Commit

Permalink
fixed #251
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesper Zedlitz committed Oct 16, 2017
1 parent d823ba4 commit 20159d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ocropus-gpageseg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

from __future__ import print_function

from pylab import find

import argparse
import glob
import os
Expand Down Expand Up @@ -302,7 +304,7 @@ def compute_line_seeds(binary,bottom,top,colseps,scale):
seeds = np.zeros(binary.shape,'i')
delta = max(3,int(scale/2))
for x in range(bmarked.shape[1]):
transitions = sorted([(y,1) for y in np.where(bmarked[:,x])[0]]+[(y,0) for y in np.where(tmarked[:,x][0])])[::-1]
transitions = sorted([(y,1) for y in find(bmarked[:,x])]+[(y,0) for y in find(tmarked[:,x])])[::-1]
transitions += [(0,0)]
for l in range(len(transitions)-1):
y0,s0 = transitions[l]
Expand Down

0 comments on commit 20159d8

Please sign in to comment.