[Insight-users] Circle detection in itk
Richard Beare
richard.beare at gmail.com
Mon Jan 8 17:40:54 EST 2007
Hi,
If those pictures are examples of what you are expecting then you can
probably proceed as follows:
1) Simple threshold - use a manually selected threshold -
itkBinaryThresholdImageFilter
2) Label the results so that each blob has a different number -
itkConnectedComponentImageFilter. (Note that the default itk version
doesn't produce consecutive labels - I've put a version on the insight
journal that does)
3) Here's where things get a little speculative. If the blobs are as
small as you say then you are almost certainly going to need to do
some model fitting to each labelled region to get what you want, and
you may need to write some special code to do it. The
itkLabelStatisticsImageFilter might be a good model on which to start.
At the end of the labelling stage you can collect a set of pixel
locations and values for each blob - fit the model you are interested
to these values. There are probably some useful support routines in
itk that will help with the model fitting - I'm not so familiar with
this side of things, but perhaps Luis can provide advice.
If the thresholding step is unreliable then you could do a peak
detection step instead - look at my paper on regional extrema on the
insight journal.
On 1/8/07, Ali - <saveez at hotmail.com> wrote:
>
> Richard and Gaëtan,
>
> Thanks for the useful comments. Here are some sample images:
>
> http://www.photogrammetry.ethz.ch/research/ptv/ptv.html
> http://www.me.cmu.edu/faculty1/higgs/images/gran6-balls2.jpg
> http://www.cvgpr.uni-mannheim.de/ruhnau/pivresearch.html
>
> As I described before, the images can be assumed as an ensemble of randomly
> distributed Gaussian profiles. They are actually images of sphere particles
> which are, in principle, in the form of airy disks, however, a Gaussian
> profile makes life easier by approximating the Bessel function in the Airy
> disks.
>
> All I want to find from these images are (1) position and (2) diameter of
> each particle-image. If would be more useful if the comment are less
> abstract, ie, which itk filter to use in practice.
>
>
> Thanks
>
>
> ________________________________
> > Date: Mon, 8 Jan 2007 09:12:19 +1100
> > From: richard.beare at gmail.com
> > To: gaetan.lehmann at jouy.inra.fr
> > Subject: Re: [Insight-users] Circle detection in itk
> > CC: saveez at hotmail.com; luis.ibanez at kitware.com; insight-users at itk.org
>
> >
> > Hi everyone,
> >
> > I think Gaetan is likely to be right, but it would be good to see an
> > example image. When you are dealing with small objects, such as 3-10
> > pixel radii, it is often not very useful to assume too much about the
> > shape - basically every natural object of that size will look like a
> > circle to a human observer until they zoom in.
> >
> > The critical issues I'd want to know about before tackling the problem
> are:
> > 1) What do you want to measure - do you want to count the particles,
> > measure their brightness, look at spatial distribution or something
> > else entirely. If you only want to count them then you could think
> > about stereological approaches that are very fast. If you want spatial
> > distribution then you could look at peaks. If you want brightness
> > information then you need to segment them and use a method that
> > corresponds well enough with what an expert observer would do.
> >
> > 2) How well controlled is the problem? Is there a nice clean
> > background or are there other objects that you want to ignore? Do the
> > objects cluster together in groups that will make separating them
> > necessary. These factors are extremely critical - people are really
> > good at ignoring distractors but it is often much harder to design
> > procedures that deal with such problems.
> >
> > 3) Don't worry too much about speed, especially when getting started.
> > In most cases the performance will depend on the image size and
> > possibly the size of filter kernels, rather than the number of items
> > in the image.
> >
> > If the background is smooth, and there are no distractors or problems
> > with touching objects then Gaetan's suggestions are definitely a good
> > way to start.
> >
> >
> > On 1/7/07, Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr> wrote:
> > >
> > > Hi Ali,
> > > Hi Luis,
> > >
> > > I guess this mail reply to some of the question I wanted to ask after
> your
> > > last mail about particle detection - great :-)
> > >
> > > Le Sat, 06 Jan 2007 14:10:53 +0100, Ali - <saveez at hotmail.com> a écrit:
> > >
> > > > Hi Luis,
> > > > Thanks for the reply, I thought the itk community was dead in the new
> > > > year.
> > >
> > > some of us may have survived to their holidays ;-)
> > >
> > > > I need to detect the position and diameter of randomly distributed
> > > > particle-images where it is assumed each particle-image has a Gaussian
> > > > profile. > 1) How fast do you need the circle detection to be ?
> > > > The circle detection algorithm must be fast, it is applied to an
> > > > ensemble of particle-images with Gaussian profile. Each image may
> > > > contain tens to hundreds of particle-images.
> > >
> > > Are there only circluar particles in your image or also other shapes ?
> > > In the case there are only circular particules, a simple thresholding
> and
> > > a labelisation of the connected components may be enough. If the
> particles
> > > are on a non uniform background, you can first apply a top-hat to remove
> > > it. If the intensity of the particules is not uniform from image to
> image,
> > > it may be difficult to find a good threshold value, but some automatic
> > > thresholding methods may give good results.
> > > If there are other shapes, what are they ? How big are they compared to
> > > the particules ?
> > > It would help if you can give a link to an example.
> > >
> > > Gaetan
> > >
> > >
> > >
> > > >> 2) How big are your images ?
> > > > About 1k X 1k. Each particle-image could have a diameter from 3 to 10
> > > > pixels.
> > > >> 3) Are you looking for full circles ?> or only for circumferences ?
> > > > The circle (particle-image) centre and diameter (Gaussian profile
> > > > diameter) are desirable to be detected.
> > > >> > 4) Do you expect to find multiple circles per image ?
> > > > As described, yes.
> > > >> > 5) Do you have any priori information about the circle ?> (eg.
> > > >> expected positions, expected radius, expected> intensities)
> > > > Positions are random, diameters are variable (3 to 10 pixels) the
> > > > intensities are variable too. The only prior knowledge could be the
> > > > assumed Gaussian profile of each particle-image. Correlation-based
> > > > methods may work, but I am sure there are faster methods around. The
> use
> > > > of the existing code in the library is preferred.
> > > >>> 6) Have you profiled the time that it takes to run the> Hough circle
> > > >>> detection in a release (optimized) build ?>
> > > > No, but the following is a quote from 'Practical Algorithms for Image
> > > > Processing', Seul et al, Cambridge University Press 2000, 4.10.2:
> > > > '..., and it is for this reason that the Hough transform is far less
> > > > popular for geometrical objects than the line'.
> > > >
> _________________________________________________________________
> > > > Be one of the first to try Windows Live Mail.
> > > >
> http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
> > >
> > >
> > >
> > > --
> > > Gaëtan Lehmann
> > > Biologie du Développement et de la Reproduction
> > > INRA de Jouy-en-Josas (France)
> > > tel: +33 1 34 65 29 66 fax: 01 34 65 29 09
> > > http://voxel.jouy.inra.fr
> > > _______________________________________________
> > > Insight-users mailing list
> > > Insight-users at itk.org
> > > http://www.itk.org/mailman/listinfo/insight-users
> > >
>
> ________________________________
> Be one of the first to try Windows Live Mail.
More information about the Insight-users
mailing list