[Numpy-discussion] finding connected areas?

Charles R Harris charlesr.harris at gmail.com
Tue Jun 13 01:17:44 EDT 2006


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.


On 6/12/06, stephen emslie <stephenemslie at gmail.com> 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?
> Thanks
> Stephen Emslie
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20060612/78a3e3fc/attachment-0001.html>

More information about the NumPy-Discussion mailing list