Commit bf47c269 authored by Philipp Zumstein's avatar Philipp Zumstein
Browse files

Fix imports according to Travis check

parent 8d378ab0
......@@ -7,6 +7,7 @@ import argparse
import sys
import numpy as np
from scipy.misc import imsave
import ocrolib
from ocrolib import lineest
......@@ -45,7 +46,7 @@ for fname in inputs:
line = ocrolib.read_image_gray(fname)
lnorm.measure(np.amax(line)-line)
line = lnorm.normalize(line,cval=np.amax(line))
scipy.misc.imsave(base+".dew.png",line)
imsave(base+".dew.png",line)
except Exception as e:
print("ERROR", e)
continue
......@@ -127,7 +127,7 @@ def rgeometry(image,eps=0.03,delta=0.3):
m = np.array([[1+eps*np.random.randn(),0.0],[eps*np.random.randn(),1.0+eps*np.random.randn()]])
w,h = image.shape
c = np.array([w/2.0,h/2])
d = c-dot(m,c)+np.array([np.random.randn()*delta,np.random.randn()*delta])
d = c-np.dot(m,c)+np.array([np.random.randn()*delta,np.random.randn()*delta])
return interpolation.affine_transform(image,m,offset=d,order=1,mode='constant',cval=image[0,0])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment