Rectangular bounding box around blobs in a monochrome image using python
I have a few monochrome images (black and white not greyscale) with a few weirdly shaped objects. I'm trying to extract each object using python27, PIL, scipy & numpy and the following method:

 1. Fit a bounding box around each joined-up object
 2. "Extract" each object as an array - for each object / bounding box

I've had a look at http://www.scipy.org/Cookbook/Watershed and http://scikits-image.org/docs/dev/auto_examples/plot_contours.html and these do work, but I'm particularly keen to have the bounding box be rectangular to make sure that any "slightly disconnected" bits get included in the bounding box. Ideally to deal with the disconnected bits (e.g. bottom right blobs) I'd have some kind of threshold control. Any ideas on what toolbox would best suit this?

![unbounded image][1]
![example of image bounds][2]

  [1]: http://i.stack.imgur.com/ueOHC.png
  [2]: http://i.stack.imgur.com/X97Pm.png
Rectangular bounding box around blobs in a monochrome image using python
===

I have a few monochrome images (black and white not greyscale) with a few weirdly shaped objects. I'm trying to extract each object using python27, PIL, scipy & numpy and the following method:

 1. Fit a bounding box around each joined-up object
 2. "Extract" each object as an array - for each object / bounding box

I've had a look at http://www.scipy.org/Cookbook/Watershed and http://scikits-image.org/docs/dev/auto_examples/plot_contours.html and these do work, but I'm particularly keen to have the bounding box be rectangular to make sure that any "slightly disconnected" bits get included in the bounding box. Ideally to deal with the disconnected bits (e.g. bottom right blobs) I'd have some kind of threshold control. Any ideas on what toolbox would best suit this?

![unbounded image][1]
![example of image bounds][2]

  [1]: http://i.stack.imgur.com/ueOHC.png
  [2]: http://i.stack.imgur.com/X97Pm.png