comparison transformations/affine_transform.py @ 73:859ebd7f8754

fixed float32 return on affine_transform
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Wed, 10 Feb 2010 13:02:05 -0500
parents d9d836d3c625
children 5e00ed18ae32
comparison
equal deleted inserted replaced
72:af2f9252dd14 73:859ebd7f8754
59 59
60 im = Image.fromarray( \ 60 im = Image.fromarray( \
61 numpy.asarray(\ 61 numpy.asarray(\
62 NIST_image.reshape(self.shape)*255.0, dtype='uint8')) 62 NIST_image.reshape(self.shape)*255.0, dtype='uint8'))
63 nwim = im.transform( (32,32), Image.AFFINE, [self.a,self.b,self.c,self.d,self.e,self.f]) 63 nwim = im.transform( (32,32), Image.AFFINE, [self.a,self.b,self.c,self.d,self.e,self.f])
64 return numpy.asarray(nwim)/255.0 64 return numpy.asarray(numpy.asarray(nwim)/255.0,dtype='float32')
65 65
66 66
67 67
68 if __name__ =='__main__': 68 if __name__ =='__main__':
69 print 'random test' 69 print 'random test'