def pyramid_gaussian(image, max_layer=(-1), downscale=2, sigma=None, order=1, mode='reflect', cval=0):
 _check_factor(downscale)
 image = img_as_float(image)
 layer = 0
 rows = image.shape[0]
 cols = image.shape[1]
 prev_layer_image = image
 (yield image)
 while (layer != max_layer):
  layer += 1
  layer_image = pyramid_reduce(prev_layer_image, downscale, sigma, order, mode, cval)
  prev_rows = rows
  prev_cols = cols
  prev_layer_image = layer_image
  rows = layer_image.shape[0]
  cols = layer_image.shape[1]
  if ((prev_rows == rows) and (prev_cols == cols)):
   break
  (yield layer_image)

def pyramid_gaussian ( image , max_layer = ( - 1 ) , downscale = 2 , sigma = None , order = 1 , mode = 'reflect' , cval = 0 ) : _check_factor ( downscale ) image = img_as_float ( image ) layer = 0 rows = image . shape [ 0 ] cols = image . shape [ 1 ] prev_layer_image = image ( yield image ) while ( layer != max_layer ) : layer += 1 layer_image = pyramid_reduce ( prev_layer_image , downscale , sigma , order , mode , cval ) prev_rows = rows prev_cols = cols prev_layer_image = layer_image rows = layer_image . shape [ 0 ] cols = layer_image . shape [ 1 ] if ( ( prev_rows == rows ) and ( prev_cols == cols ) ) : break ( yield layer_image )
yield images of the gaussian pyramid formed by the input image .