code: def _generate_segments(im_orig, scale, sigma, min_size):
      
  
      # open the Image
      im_mask = skimage.segmentation.felzenszwalb(
          skimage.util.img_as_float(im_orig), scale=scale, sigma=sigma,
          min_size=min_size)
  
      # merge mask channel to the image as a 4th channel
      im_orig = numpy.append(
          im_orig, numpy.zeros(im_orig.shape[:2])[:, :, numpy.newaxis], axis=2)
      im_orig[:, :, 3] = im_mask
  
      return im_orig
docs: segment smallest regions by the algorithm of Felzenswalb and
          Huttenlocher