def pyramid_expand(image, upscale=2, sigma=None, order=1, mode='reflect', cval=0):
 _check_factor(upscale)
 image = img_as_float(image)
 rows = image.shape[0]
 cols = image.shape[1]
 out_rows = math.ceil((upscale * rows))
 out_cols = math.ceil((upscale * cols))
 if (sigma is None):
  sigma = ((2 * upscale) / 6.0)
 resized = resize(image, (out_rows, out_cols), order=order, mode=mode, cval=cval)
 out = _smooth(resized, sigma, mode, cval)
 return out

def pyramid_expand ( image , upscale = 2 , sigma = None , order = 1 , mode = 'reflect' , cval = 0 ) : _check_factor ( upscale ) image = img_as_float ( image ) rows = image . shape [ 0 ] cols = image . shape [ 1 ] out_rows = math . ceil ( ( upscale * rows ) ) out_cols = math . ceil ( ( upscale * cols ) ) if ( sigma is None ) : sigma = ( ( 2 * upscale ) / 6.0 ) resized = resize ( image , ( out_rows , out_cols ) , order = order , mode = mode , cval = cval ) out = _smooth ( resized , sigma , mode , cval ) return out
upsample and then smooth image .