[SciPy-User] Finding islands and centroids

Martin van Leeuwen vanleeuwen.martin at gmail.com
Wed Apr 20 16:08:35 EDT 2011


Hi Chris,

You can also compute this from a stack of incrementally thresholded
images. If a pixel is a local maximum it would have no blobs above it
and be contained in a blob below. This is described in:

Ying, H. , Zhou, F. , Shields, A. F. , Muzik, O. , Wu, D. and Heath,
E. I. (2004) A novel computerized approach to enhancing lung tumor
detection in whole-body PET images. Proceedings of the 26th Annual
International Conference of the IEEE EMBS San Francisco, CA IEEE EMBS
Electronic Resource Piscataway, NJ

and I also used it (and had written it in IDL at the time):

Van Leeuwen, M., Coops, N.C., Wulder, M.A. (2010) Canopy Surface
Reconstruction from a LiDAR point cloud Using Hough Transform. Remote
Sensing Letters 1: 125 – 132, doi: 10.1080/01431161003649339

Hope that is useful enough, unfortunately I don't have any python code
for this so that I could share.

Martin.




2011/4/20 Chris Weisiger <cweisiger at msg.ucsf.edu>:
> Wow, for some reason I didn't get any of these emails until just now. You
> all have given me plenty of avenues to investigate. Thanks!
>
> -Chris
>
> On Wed, Apr 20, 2011 at 5:52 AM, Luis Pedro Coelho <luis at luispedro.org>
> wrote:
>>
>> On Monday, April 18, 2011 06:37:51 pm Chris Weisiger wrote:
>> > I can hack something together to do this easily enough, where I find a
>> > pixel in one of the islands, flood-fill out to get all connected pixels,
>> > calculate the centroid, flip the pixels to 0, and repeat until all
>> > islands
>> > are gone. This isn't exactly very speedy though. What's the efficient
>> > way
>> > to do this? Is there one? Is there a better approach I should be taking?
>> > The image processing class I dimly remember taking years ago didn't
>> > cover
>> > this kind of thing, so I'm lacking even the basic vocabulary needed to
>> > search for algorithms.
>>
>> You can probably do it in one go:
>>
>> 1) convolve with a Gaussian of roughly the size you expect the PFS of the
>> beads to be.
>>
>> 2) threshold to get the beads. You can probably use a method like
>> mahotas.threshold.otsu to do this automatically
>>
>> 3) scipy.ndimage.label to label the binary image
>>
>> 4, optional) remove noise by removing detections that are too small
>>
>> 5) find centroids of the remaining areas.
>>
>> HTH
>> Luis
>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>



More information about the SciPy-User mailing list