Thresholding help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Thresholding help

Justin Walker-3
I have a series of images of liquid droplets, which have very poor
contrast with the surrounding phase, due to the similarities in their
index of refraction.  I get enough contrast in my images to clearly see
the droplets, however, I can't pick them out with the threshold because
there is a slight gradient in the brightness of my lighting.  Link to a
sample image is below:

http://www.chejrw.com/forum/test.tif

Does anyone know of a way I can manipulate this image to be able to use
the 'measure particles' plugin to get the droplet sizes?  I can clearly
see the droplets, so surely there must be a way to make the computer see
them.

Thanks everybody

- Justin Walker
Reply | Threaded
Open this post in threaded view
|

Re: Thresholding help

Fabrice Senger
Quoting Justin Walker <[hidden email]>:

> I have a series of images of liquid droplets, which have very poor
> contrast with the surrounding phase, due to the similarities in their
> index of refraction.  I get enough contrast in my images to clearly see
> the droplets, however, I can't pick them out with the threshold because
> there is a slight gradient in the brightness of my lighting.  Link to a
> sample image is below:
>
> http://www.chejrw.com/forum/test.tif
>
> Does anyone know of a way I can manipulate this image to be able to use
> the 'measure particles' plugin to get the droplet sizes?  I can clearly
> see the droplets, so surely there must be a way to make the computer
> see them.
>
> Thanks everybody
>
> - Justin Walker

As far I can see in your images, you can see the "contour" of the droplets.
If you invert your image, this "contour" should appear bright in a  
dark background.

This should help.

Fabrice.
Reply | Threaded
Open this post in threaded view
|

Re: Thresholding help

Justin Walker-3
While inverting it does make the droplets appear bright on a dark
background, it doesn't change the overall contrast, so it really doesn't
help in terms of locating the droplets for thresholding.  I need
something like the 'find edges' plugin, but with a higher sensitivity.

- Justin

Fabrice Senger wrote:

> Quoting Justin Walker <[hidden email]>:
>
>> I have a series of images of liquid droplets, which have very poor
>> contrast with the surrounding phase, due to the similarities in their
>> index of refraction.  I get enough contrast in my images to clearly see
>> the droplets, however, I can't pick them out with the threshold because
>> there is a slight gradient in the brightness of my lighting.  Link to a
>> sample image is below:
>>
>> http://www.chejrw.com/forum/test.tif
>>
>> Does anyone know of a way I can manipulate this image to be able to use
>> the 'measure particles' plugin to get the droplet sizes?  I can clearly
>> see the droplets, so surely there must be a way to make the computer
>> see them.
>>
>> Thanks everybody
>>
>> - Justin Walker
>
> As far I can see in your images, you can see the "contour" of the
> droplets.
> If you invert your image, this "contour" should appear bright in a
> dark background.
>
> This should help.
>
> Fabrice.
Reply | Threaded
Open this post in threaded view
|

Re: Thresholding help

Michael Doube
In reply to this post by Fabrice Senger
Justin:

How about subtracting the background gradient from the image to improve
contrast?

Just take a 'background' image without any droplets and use
Process->Image Calculator, subtracting your background from the
droplets+background image.  I had a quick go on your example and greatly
improved the ability to discriminate the droplet contours.

Mike

Fabrice Senger wrote:

> Quoting Justin Walker <[hidden email]>:
>
>> I have a series of images of liquid droplets, which have very poor
>> contrast with the surrounding phase, due to the similarities in their
>> index of refraction.  I get enough contrast in my images to clearly see
>> the droplets, however, I can't pick them out with the threshold because
>> there is a slight gradient in the brightness of my lighting.  Link to a
>> sample image is below:
>>
>> http://www.chejrw.com/forum/test.tif
>>
>> Does anyone know of a way I can manipulate this image to be able to use
>> the 'measure particles' plugin to get the droplet sizes?  I can clearly
>> see the droplets, so surely there must be a way to make the computer
>> see them.
>>
>> Thanks everybody
>>
>> - Justin Walker
>
> As far I can see in your images, you can see the "contour" of the droplets.
> If you invert your image, this "contour" should appear bright in a dark
> background.
>
> This should help.
>
> Fabrice.
Reply | Threaded
Open this post in threaded view
|

Re: Thresholding help

Michael Schmid
Hi Justin,

the ImageJ built-in "subtract background" command should work well  
with your type of image.

It will be very difficult to extract the weakly visible sides of the  
particles. For a rough size estimate of the circular particles, a way  
out might be checking the width of the rectangular bounding box and  
Feret's diameter - if these sizes agree within reasonable limits,  
they shuld be ok. For the remaining particles you have to do it  
manually.

Here is a macro for the first steps:
   run("32-bit");
   run("Smooth");
   run("Subtract Background...", "rolling=100 light sliding");
   setThreshold(-9999, -10);
   run("Set Measurements...", "  bounding feret's redirect=None  
decimal=3");
   run("Analyze Particles...", "size=10-Infinity  
circularity=0.00-1.00 show=[Nothing] display include record");

If this is not enough, you need either better illumination or a  
plugin that fits full circles into the arcs (I am not aware of any,  
you might have to write it yourself).

Michael
________________________________________________________________
Michael Schmid                    email: [hidden email]
Institut fuer Allgemeine Physik, Technische Universitaet Wien
Wiedner Hauptstr. 8-10/134, A 1040 Wien, Austria
Tel. +43 1 58801-13452 or -13453, Fax +43 1 58801 13499
________________________________________________________________

On 29 Oct 2008, at 22:02, Michael Doube wrote:

> Justin:
>
> How about subtracting the background gradient from the image to  
> improve contrast?
>
> Just take a 'background' image without any droplets and use Process-
> >Image Calculator, subtracting your background from the droplets
> +background image.  I had a quick go on your example and greatly  
> improved the ability to discriminate the droplet contours.
>
> Mike
>
> Fabrice Senger wrote:
>> Quoting Justin Walker <[hidden email]>:
>>> I have a series of images of liquid droplets, which have very poor
>>> contrast with the surrounding phase, due to the similarities in  
>>> their
>>> index of refraction.  I get enough contrast in my images to  
>>> clearly see
>>> the droplets, however, I can't pick them out with the threshold  
>>> because
>>> there is a slight gradient in the brightness of my lighting.  
>>> Link to a
>>> sample image is below:
>>>
>>> http://www.chejrw.com/forum/test.tif
>>>
>>> Does anyone know of a way I can manipulate this image to be able  
>>> to use
>>> the 'measure particles' plugin to get the droplet sizes?  I can  
>>> clearly
>>> see the droplets, so surely there must be a way to make the computer
>>> see them.
>>>
>>> Thanks everybody
>>>
>>> - Justin Walker
>> As far I can see in your images, you can see the "contour" of the  
>> droplets.
>> If you invert your image, this "contour" should appear bright in a  
>> dark background.
>> This should help.
>> Fabrice.
Reply | Threaded
Open this post in threaded view
|

Re: Thresholding help

Gabriel Landini
On Thursday 30 October 2008 12:04:42 Michael Schmid wrote:
> If this is not enough, you need either better illumination or a
> plugin that fits full circles into the arcs (I am not aware of any,
> you might have to write it yourself).

The Hough Transform does it.

Cheers

G.
Reply | Threaded
Open this post in threaded view
|

Re: Thresholding help

Joel Sheffield
In reply to this post by Justin Walker-3
Justin,

Actually, you have two problems.  The first is the uneven
illumination.  You can remove this quite easily by using the FFT
bandwidth filter (process, FFT, bandwidth).  If you assume that the
gradient of illumination is a large period wave function, then you
can choose a relatively large number for the upper bandwidth and set
the filter not to remove any small details (set the minimum value to
0).  I'll send you a copy of the results of this treatment offline.

The more significant problem is that the illumination looks rather
like a DIC or Hoffman image, in which one side of the droplet has
different contrast from the other side.  Probably, the only way to
modify this is to change your optics.  I doubt that this is possible.
 Alternatively, you might work with the Process>Filters>convolve
configurations to flatten the image.

However, it occurs to me that you can set a threshold that will
select the arcs of each droplet and then use the "Analyze Particles"
routine to count the particles and measure the Perimeter of the arcs.
 Depending on the degree of accuracy you need, these perimeters would
be in proportion (although I don't know the exact relationship) to
the size of the droplets. It might be sufficient.   Again, I'll send
you the data offline.

Joel


> I have a series of images of liquid droplets, which have very poor
> contrast with the surrounding phase, due to the similarities in their
> index of refraction.  I get enough contrast in my images to clearly see
> the droplets, however, I can't pick them out with the threshold because
> there is a slight gradient in the brightness of my lighting.  Link to a
> sample image is below:
>
> http://www.chejrw.com/forum/test.tif
>
> Does anyone know of a way I can manipulate this image to be able to use
> the 'measure particles' plugin to get the droplet sizes?  I can clearly
> see the droplets, so surely there must be a way to make the computer see
> them.
>
> Thanks everybody
>
> - Justin Walker


--
Joel B. Sheffield, Ph.D.
Biology Department, Temple University
1900 North 12th Street
Philadelphia, PA 19122
[hidden email]  
(215) 204 8839, fax (215) 204 0486
http://astro.temple.edu/~jbs