title: Skimage Blob detection for Text
body: <p>I am following this tutorial of Blob Detection for Text purpose and facing some issues, please check if anyone could help.</p>
  
  <p><strong>How to extract each detected blob in form of image.
  How i can draw a rectangle instead of circle.</strong>  </p>
  
  <pre><code>from math import sqrt
  from skimage import data
  from skimage.feature import blob_dog, blob_log, blob_doh
  from skimage.color import rgb2gray
  import skimage.io as io
  import matplotlib.pyplot as plt
  import matplotlib.patches as patches
  #from imread import imread_from_blob
  
  image = io.imread('5.png')
  
  #image = (data.hubble_deep_field()[0:500, 0:500])
  image_gray = rgb2gray(image)
  
  #blobs_log = blob_log(image_gray, max_sigma=30, num_sigma=10, threshold=.1)
  
  # Compute radii in the 3rd column.
  #blobs_log[:, 2] = blobs_log[:, 2] * sqrt(2)
  
  blobs_dog = blob_dog(image_gray, max_sigma=30, threshold=.1)
  #blobs_dog[:, 2] = blobs_dog[:, 2] * sqrt(2)
  
  #blobs_doh = blob_doh(image_gray, max_sigma=30, threshold=.01)
  
  blobs_list = [ blobs_dog]
  
  colors = ['yellow']
  titles = [ 'Difference of Gaussian']
  sequence = zip(blobs_list, colors, titles)
  
  fig, axes = plt.subplots(1, 3, figsize=(9, 3), sharex=True, sharey=True,
                           subplot_kw={'adjustable': 'box-forced'})
  ax = axes.ravel()
  
  for idx, (blobs, color, title) in enumerate(sequence):
      ax[idx].set_title(title)
      ax[idx].imshow(image, interpolation='nearest')
      for blob in blobs:
          y, x, r = blob
          c = patches.Rectangle((int(x - r),int(y - r)), int(2*r), int(2*r),linewidth=2,edgecolor=color,facecolor='none')
  
          ax[idx].add_patch(c)
      ax[idx].set_axis_off()
      croppedImage = image[int(x-r):int(x+r),int(y-r):int(y+r)]
      if croppedImage.shape[0] &gt; 0 and croppedImage.shape[1] &gt; 0:
          io.imsave('C:/Users/A/Projects/Image/Test/test.png', croppedImage)
  plt.tight_layout()
  plt.show()
  </code></pre>
  
  <p><a href="http://scikit-image.org/docs/dev/auto_examples/features_detection/plot_blob.html" rel="nofollow noreferrer">http://scikit-image.org/docs/dev/auto_examples/features_detection/plot_blob.html</a></p>