[SciPy-User] Finding islands and centroids
Chris Weisiger
cweisiger at msg.ucsf.edu
Mon Apr 18 18:37:51 EDT 2011
(As you may recall from previous threads, my current project involves
aligning two arrays of pixel data that were taken from slightly different
perspectives)
In an attempt to quantify the accuracy of the alignment I've obtained, I
want to do some centroid analysis. The images I'm working with are of
"beads" (very small fluorescent blobs), thus each 512x512 image is of a
number of more-or-less circular islands each on the order of 50 pixels or
so. I figure that I can threshold each image, identify distinct islands, get
their centroids, map those to centroids in the other wavelength, and thus
get the distance between centroids, which should be a good absolute measure
of alignment quality.
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.
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20110418/52508d3e/attachment.html>
More information about the SciPy-User
mailing list