Better results with Canny/Hough for circular particles

Adam Hughes hughesadam87 at gmail.com
Fri Dec 13 18:09:02 EST 2013


I'm trying multiple methods for isolating nanoparticles for a paper in
which the purpose will be to contextualize a lot of available image
processing workflows best suited for sizing, separating and counting
nanoparticles.  The idea is that imaging nanoparticles is becomes a widely
standard necessity, and so I want to present an overview of the availble
methods and workflows for best processing images, as well best practices
for obtaining high quality images in the lab via SEM/AFM.

I've already covered approaches via auto thresholding, with optionally
applying watersheding to find particle boundaries.

IMO, Canny, Hough, Sobel etc... give another approach; whereby, one finds
and deals directly with the particle boundaries/outlines.  The advantage of
this approach is that it lends finer control over the particle boundaries,
which are often hazy in SEM images.  I think that there are some use cases
for this approach.  For example, I've observed that canny edge detection
gives a great fit to particles that have a halo effect, and so I'm pretty
confident that, if we could fill all of the edges, that we'd be sizing the
particles very nicely.  It's easier to assess the "goodness of fit" looking
at just the edges, but obviously it introduces more work.  I at least had
hoped to present a bit of this edge --> filter ---> fill approach in the
paper to complement the threshold approaches to segmentation.

I tried the morphological operators (open, close, dilation, edge), but they
are a bit restrictive.  I'd need something that has a variable structure
parameter, as Dan mentioned sort of is builtin to canny (ie, it's smart
about how it closes the regions).  I'll probably just leave it at "the
input parameters are crucial for getting closed regions" instead of
focusing on how to connect the regions after the fact.

PS, is anyone familiar with a function in scikit or ndimage to give the
perimeter/outline of a filled region?

Thanks

On Fri, Dec 13, 2013 at 4:32 PM, Johannes Schönberger <jsch at demuc.de> wrote:

> Hi,
>
> do you really need the edges or what is the actual purpose? Maybe there
> are better methods other than canny to achieve it...
>
> Am 13.12.2013 um 21:25 schrieb Adam Hughes <hughesadam87 at gmail.com>:
>
> > Hi Dan,
> >
> > Thanks for the quick reply.
> >
> > I think that I can get better results if I tweak the parameters.  The
> threshold parameter intuitively makes sense, but I'll have to read a bit to
> get familiar with sigma and the algorithm in general.  Thanks for the
> explanation; it really helped.  I will try out the erosion as well.
> >
> > PS, do you have any feelings towards the applicability of circular hough
> to my image?
> >
> > On Friday, December 13, 2013 3:03:30 PM UTC-5, Dan Farmer wrote:
> > Hi Adam,
> >
> > This can be the worst part of image processing, but I'm curious how
> > much you played with the parameters to Canny? You probably know this,
> > but canny already tries to close gaps (hysteresis thresholding). What
> > you want to do is try to lower the low_threshold parameter (values
> > above the high threshold value get initially labeled as edges, then it
> > looks for pixels that are connected to edge pixels and whose value is
> > > low_threshold to link the edges).
> >
> > An easy/basic way to get rid of small fragments would be to start with
> > morphological erosion.
> >
> > -Dan
> >
> > On Fri, Dec 13, 2013 at 11:47 AM, Adam Hughes <hughes... at gmail.com>
> wrote:
> > > Hi,
> > >
> > > I have several images of circular particles (see attached for an
> example)
> > > and I've been experimenting with automatic routines to find edges.
> > >
> > > I've found that with Canny, I can get really nice edges, but the edges
> are
> > > not always connected.  Thus, when I do fill-binary, many of my
> particles are
> > > not painted in due to slight breaks in the border returned by canny.
>  Is
> > > there an ideal way to fix this, either by connecting "almost" connected
> > > canny edges?  Additionally, what is the best way to filter out small
> > > fragments and/or non-circular edges?
> > >
> > > I've attached an image of the canny outlines; you can see that I
> obviously
> > > want to get rid some of the regions that aren't associated with any
> > > particles.  PS, the coloring of the outlines are based on the
> brightness of
> > > the image at that point underneath it, which has been hidden.  (Would
> be
> > > happy to share the function if anyone wants it).
> > >
> > > Lastly, I tried adapting the circular hough transform example:
> > >
> > >
> http://scikit-image.org/docs/dev/auto_examples/plot_circular_elliptical_hough_transform.html
> > >
> > > But struggled with setting it up, due to a naive understanding of the
> > > algorithm.  Given that my image has thousands of particles, but I know
> > > roughly the size distribution, would the circular hough transform be
> useful
> > > to me?
> > >
> > > Thanks
> > >
> > >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "scikit-image" group.
> > > To unsubscribe from this group and stop receiving emails from it, send
> an
> > > email to scikit-image... at googlegroups.com.
> > > For more options, visit https://groups.google.com/groups/opt_out.
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "scikit-image" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to scikit-image+unsubscribe at googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "scikit-image" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/scikit-image/9U46IbLV90A/unsubscribe.
> To unsubscribe from this group and all of its topics, send an email to
> scikit-image+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20131213/5fcc90d3/attachment.html>


More information about the scikit-image mailing list