code: def test_grey():
      # very weak tests.
      img = np.zeros((20, 21))
      img[:10, 10:] = 0.2
      img[10:, :10] = 0.4
      img[10:, 10:] = 0.6
      seg = felzenszwalb(img, sigma=0)
      # we expect 4 segments:
      assert_equal(len(np.unique(seg)), 4)
      # that mostly respect the 4 regions:
      for i in range(4):
          hist = np.histogram(
              img[seg == i], bins=[0, 0.1, 0.3, 0.5, 1]
          )[0]
          assert_greater(hist[i], 40)
  
file_path: scikit-image/skimage/segmentation/tests/test_felzenszwalb.py
imports: import numpy
  from skimage import data
  from skimage.segmentation import felzenszwalb
  from skimage._shared import testing
  from skimage._shared.testing import assert_greater, run_in_parallel, assert_equal, assert_array_equal, assert_warns, assert_no_warnings
label_desc: Use image node_id 1 for calling a global function with example usage: test_grey() without return types