def smooth_image(img, sigma = 1.0): if sigma is not None: return filters.gaussian_filter(np.asarray(img, float), sigma); else: return img;