title: How to add text to an image segment
body: <p>I have the following Python code, which adds a bounding box around the detected segments</p>
  
  <pre><code>%matplotlib qt
  fig, ax = plt.subplots(figsize=(10, 6))
  ax.imshow(image_label_overlay)
  for region in regions:
   # take regions with large enough areas
   if region.area &gt;= 100:
      # draw rectangle around segmented coins
      minr, minc, maxr, maxc = region.bbox
      rect = mpatches.Rectangle((minc, minr), maxc - minc, maxr - minr,
                                fill=False, edgecolor='red', linewidth=2)
      ax.add_patch(rect)
  
  
   ax.set_axis_off()
  
   plt.tight_layout()
   plt.show()
  </code></pre>
  
  <p>Instead of drawing a bounding box, I want to number the segments. i.e. I want to add a number at the center of each segment. How can I do this?</p>