[Numpy-discussion] finding connected areas?

Alexandre Fayolle alexandre.fayolle at logilab.fr
Tue Jun 13 03:31:54 EDT 2006

On Tue, Jun 13, 2006 at 01:41:17AM +0100, stephen emslie wrote:
> I have used adaptive thresholding to turn an image into a binary image
> so that I can locate a particularly large bright spot. However, now
> that I have the binary image I need to be able to group connected
> cell's together and determine their relative sizes. Matlab has a
> function called bwlabel (http://tinyurl.com/fcnvd) that labels
> connected objects in a matrix. That seems like a good way to start,
> and I'm sure there is a way for me to do something similar in numpy,
> but how?

You will get this in numarray.nd_image, the function is
called label. It is also available in recent versions of scipy, in
module scipy.ndimage. 

Alexandre Fayolle                              LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Informatique scientifique:               http://www.logilab.fr/science
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 481 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20060613/5691ae59/attachment.sig>

More information about the NumPy-Discussion mailing list