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

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