title: How to make skimage slic return desired number of segments?
body: <p>I am using skimage implementation of slic</p>
  <pre><code>segments = slic(img, n_segments=10)
  </code></pre>
  <p>I execute this for the entire test set of MNIST in order to get Superpixel, 10000 images.</p>
  <p><a href="https://i.stack.imgur.com/SE3QN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SE3QN.png" alt="enter image description here" /></a></p>
  <p>I have checked how many different segments were produced by slic this varies from 2 to 7, however it never got segmented into 10 segments as I have set in the parameter.</p>
  <pre><code>all_segments = []
  for batch_idx, (example_data, example_targets) in enumerate(test_loader):
      segments = slic(example_data.squeeze(), n_segments=10)
      all_segments.append(segments)
  
  print(min([np.max(x) for x in all_segments]))
  print(max([np.max(x) for x in all_segments]))
  </code></pre>
  <p>How can I force slic to return desired number of segments?</p>