Stephen,<br><br>I don't know of a data structure in numpy or scipy that does this. To do this myself I use a modified union/find (equivalence relation) algorithm interfaced to python using boost/python. The same algorithm is also useful for connecting points on the basis of equivalence relations other than distance. If there is much interest I could make a standard C version sometime, but the interface needs some thinking about.
<br><br>Chuck <br><br><div><span class="gmail_quote">On 6/12/06, <b class="gmail_sendername">stephen emslie</b> <<a href="mailto:stephenemslie@gmail.com">stephenemslie@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have used adaptive thresholding to turn an image into a binary image<br>so that I can locate a particularly large bright spot. However, now<br>that I have the binary image I need to be able to group connected<br>cell's together and determine their relative sizes. Matlab has a
<br>function called bwlabel (<a href="http://tinyurl.com/fcnvd">http://tinyurl.com/fcnvd</a>) that labels<br>connected objects in a matrix. That seems like a good way to start,<br>and I'm sure there is a way for me to do something similar in numpy,
<br>but how?<br><br>Thanks<br>Stephen Emslie<br><br><br>_______________________________________________<br>Numpy-discussion mailing list<br><a href="mailto:Numpy-discussion@lists.sourceforge.net">Numpy-discussion@lists.sourceforge.net
</a><br><a href="https://lists.sourceforge.net/lists/listinfo/numpy-discussion">https://lists.sourceforge.net/lists/listinfo/numpy-discussion</a><br></blockquote></div><br>