# HG changeset patch # User fsavard # Date 1265032450 18000 # Node ID a8ac3402eb454cfda9da158bb769bd04c15a65bd # Parent b67d729ebfe3e86faf18d1cdf8463d80827c8eb2 Correction aux distortions élastiques (retourne float32) suite à tests avec testmod.py diff -r b67d729ebfe3 -r a8ac3402eb45 transformations/local_elastic_distortions.py --- a/transformations/local_elastic_distortions.py Fri Jan 29 17:16:04 2010 -0500 +++ b/transformations/local_elastic_distortions.py Mon Feb 01 08:54:10 2010 -0500 @@ -29,7 +29,7 @@ return [[0 for i in range(size[1])] for j in range(size[0])] class ElasticDistortionParams(): - def __init__(self, image_size, alpha=0.0, sigma=0.0): + def __init__(self, image_size=(32,32), alpha=0.0, sigma=0.0): self.image_size = image_size self.alpha = alpha self.sigma = sigma @@ -59,7 +59,7 @@ return [self.alpha, self.sigma] class LocalElasticDistorter(): - def __init__(self, image_size): + def __init__(self, image_size=(32,32)): self.image_size = image_size self.current_complexity = 0.0 @@ -298,7 +298,7 @@ br_pixels = numpy.multiply(br_pixels, p.matrix_br_multiply) # sum to finish bilinear combination - return numpy.sum([tl_pixels,tr_pixels,bl_pixels,br_pixels], axis=0) + return numpy.sum([tl_pixels,tr_pixels,bl_pixels,br_pixels], axis=0).astype(numpy.float32) # TESTS ----------------------------------------------------------------------