Mercurial > ift6266
diff transformations/affine_transform.py @ 56:d9d836d3c625
Change in affine_transform to handle float images
author | Xavier Glorot <glorotxa@iro.umontreal.ca> |
---|---|
date | Sun, 07 Feb 2010 23:09:56 -0500 |
parents | 81b9567ec4ae |
children | 859ebd7f8754 |
line wrap: on
line diff
--- a/transformations/affine_transform.py Fri Feb 05 14:16:33 2010 -0500 +++ b/transformations/affine_transform.py Sun Feb 07 23:09:56 2010 -0500 @@ -27,8 +27,8 @@ self.f = params[5]*8.*complexity - def _get_current_paramteres(self): - return [self.a, self.b, self.c, self.d, self.e, self.g] + def _get_current_parameters(self): + return [self.a, self.b, self.c, self.d, self.e, self.f] def get_settings_names(self): return ['a','b','c','d','e','f'] @@ -59,9 +59,9 @@ im = Image.fromarray( \ numpy.asarray(\ - NIST_image.reshape(self.shape), dtype='uint8')) + NIST_image.reshape(self.shape)*255.0, dtype='uint8')) nwim = im.transform( (32,32), Image.AFFINE, [self.a,self.b,self.c,self.d,self.e,self.f]) - return numpy.asarray(nwim) + return numpy.asarray(nwim)/255.0