Skip to content

Commit

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

from __future__ import print_function

from pylab import find

import argparse
import glob
import os
Expand Down Expand Up @@ -108,7 +106,11 @@ parser.add_argument('files',nargs='+')
args = parser.parse_args()
args.files = ocrolib.glob_all(args.files)


def find(condition):
"Return the indices where ravel(condition) is true"
res, = np.nonzero(np.ravel(condition))
return res

def norm_max(v):
return v/np.amax(v)

Expand Down

0 comments on commit c74d2be

Please sign in to comment.