Getting started with grain size analysis -

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

Getting started with grain size analysis -

Václav Šmilauer
Hi everybody,

I am new to the list and have close to no experience with ImageJ (or
image analysis) but have a solid background in physics and programming.
I am facing the task of determining grain size distribution in photos
from industrial camera. A typical image is like this:
http://i.imgur.com/lwuOBeh.jpg (the diagonal separates two types of
material which has different reflecitivity). The eventual goal is an
unattended analysis under controlled conditions (same lighting,
resolution etc). I have some issues getting a reasonable result with
ImageJ and I would appreciate some help on how to move forward. Could
someone suggest a way I could try?

1. As far as I understood, simple methods like water-shedding are not
suitable since particles overlap each other, foreground/background
distinction makes only little sense (there is no threshold to say what
is what)?

2. The image has a lighter region in the middle (that's lighting
artifact), is there some function (filter) to even out the luminosity
over the area of the image?

3. I tried the graph-cut segmentation plugin; one single segment over
the whole image is always produced, no matter how I set the parameters
(foreground bias, smoothness and so on).

I am using ImageJ 1.50g (FiJi distribution) on Linux & OpenJDK 8 JRE.

Cheers, Vaclav

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Getting started with grain size analysis -

Gabriel Landini
On Sunday 27 Mar 2016 20:14:53 you wrote:

> I am new to the list and have close to no experience with ImageJ (or
> image analysis) but have a solid background in physics and programming.
> I am facing the task of determining grain size distribution in photos
> from industrial camera. A typical image is like this:
> http://i.imgur.com/lwuOBeh.jpg (the diagonal separates two types of
> material which has different reflecitivity). The eventual goal is an
> unattended analysis under controlled conditions (same lighting,
> resolution etc). I have some issues getting a reasonable result with
> ImageJ and I would appreciate some help on how to move forward. Could
> someone suggest a way I could try?

The image you posted has too many issues and I doubt that you would be able
the analysis you want accurately without redesigning your setup.

The first problem is the overlapping. You would do much better if your
particles were on a single layer on a contrasted background. maybe you can get
some surface with wells where each grain sits in one of those.That would also
help with identifying the individual objects.

You should aim to reduce the uneven illumination. I would suggest that you try
to resolve this issue before image capture, as doing it programatically tends
to create new artefacts. Have you tried a light diffuser? or several light
sources?

Also note that JPEG images are not good for imaging. They are lossy
compressed, which add image artefacts which further interfere with the
subsequent processing. Better save your data in TIFF or PNG formats. Saving a
JPEG to TIFF to PNG does not resolve anything as the artifacts are already
there.

Hope this helps
Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Getting started with grain size analysis -

robert atwood
Dear
Could the focal depth-of-field be made smaller such that the edges of particle that are in the layer below are out of focus --  so only the edges of the top particles are in focus?

Uneven illumination looks like it should be so  easy ,  since the brain has great 'algorithms' for interpreting it -- yet is so much of a problem to deal with. As Gabriel already suggested, any improvement in the set-up to reduce this would help much more than algorithms.

However, if in the end there is some impossible to remove un-evenness, I have used  --

-- Fourier filter high pass method (Imagej FFT 'bandwith' filter , with something like 'small features = 3  , large features=100 ' or play around , depends on the total pixel-size of the image and size of particles,
-- Successive blurring and subtraction e.g use Mean  or Gaussian blur filter with largest kernel , repeating a few times, then subtract this from the original,
-- ImageJ has a 'rolling ball' called 'remove background' with several options.
-- This article: http://hdl.handle.net/10380/3133 describes implementation of applying Otsu's threshold to uneven image by applying to a set of small neighbourhoods and then splining the respective background levels.

But, as Gabriel suggests, I think none of these will work very well for your case, without some initial improvement of the extreme degree of unevenness. The upper-right particles appear to saturate the intensity.  
Good luck
Robert




> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Gabriel Landini
> Sent: 28 March 2016 10:44
> To: [hidden email]
> Subject: Re: Getting started with grain size analysis -
>
> On Sunday 27 Mar 2016 20:14:53 you wrote:
> > I am new to the list and have close to no experience with ImageJ (or
> > image analysis) but have a solid background in physics and programming.
> > I am facing the task of determining grain size distribution in photos
> > from industrial camera. A typical image is like this:
> > http://i.imgur.com/lwuOBeh.jpg (the diagonal separates two types of
> > material which has different reflecitivity). The eventual goal is an
> > unattended analysis under controlled conditions (same lighting,
> > resolution etc). I have some issues getting a reasonable result with
> > ImageJ and I would appreciate some help on how to move forward. Could
> > someone suggest a way I could try?
>
> The image you posted has too many issues and I doubt that you would be able
> the analysis you want accurately without redesigning your setup.
>
> The first problem is the overlapping. You would do much better if your
> particles were on a single layer on a contrasted background. maybe you can
> get some surface with wells where each grain sits in one of those.That would
> also help with identifying the individual objects.
>
> You should aim to reduce the uneven illumination. I would suggest that you try
> to resolve this issue before image capture, as doing it programatically tends to
> create new artefacts. Have you tried a light diffuser? or several light sources?
>
> Also note that JPEG images are not good for imaging. They are lossy
> compressed, which add image artefacts which further interfere with the
> subsequent processing. Better save your data in TIFF or PNG formats. Saving a
> JPEG to TIFF to PNG does not resolve anything as the artifacts are already
> there.
>
> Hope this helps
> Gabriel
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Getting started with grain size analysis -

Václav Šmilauer
In reply to this post by Gabriel Landini
Hi Gabriel, thanks for suggestions.
> The image you posted has too many issues and I doubt that you would be able
> the analysis you want accurately without redesigning your setup.
>
> The first problem is the overlapping. You would do much better if your
> particles were on a single layer on a contrasted background. maybe you can get
> some surface with wells where each grain sits in one of those.That would also
> help with identifying the individual objects.
That is true, and I am aware that the current setup does not simplify
things. Unfortunately it is bulk material on conveyor with the flow in
the order of 100t/h. I will see what could be done.
> You should aim to reduce the uneven illumination. I would suggest that you try
> to resolve this issue before image capture, as doing it programatically tends
> to create new artefacts. Have you tried a light diffuser? or several light
> sources?
The light is ring-shaped LED strobe already diffused with
hemisphe-shaped matte white reflector/diffuser (thus all the light is
reflected). Will try larger diameter of the diffuser, this one is just
about 10cm.
> Also note that JPEG images are not good for imaging. They are lossy
> compressed, which add image artefacts which further interfere with the
> subsequent processing. Better save your data in TIFF or PNG formats. Saving a
> JPEG to TIFF to PNG does not resolve anything as the artifacts are already
> there.
It must have been imgur which serves the image as JPEG, normally it is
obtained uncompressed from GigE camera and stored as PNG.

Cheers, Vaclav

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Getting started with grain size analysis -

robert atwood
In reply to this post by robert atwood
Hi Vaclav,
Using the FFT bandwith filter with the following 'record macro' settings:


run("Bandpass Filter...", "filter_large=40 filter_small=3 suppress=None tolerance=5 autoscale saturate");
Then built-in auto-threshold, results in the following image:
http://imgur.com/7YT9MaA

It might not be such a bad starting point



> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Robert Atwood
> Sent: 29 March 2016 12:29
> To: [hidden email]
> Subject: Re: Getting started with grain size analysis -
>
> Dear
> Could the focal depth-of-field be made smaller such that the edges of particle
> that are in the layer below are out of focus --  so only the edges of the top
> particles are in focus?
>
> Uneven illumination looks like it should be so  easy ,  since the brain has great
> 'algorithms' for interpreting it -- yet is so much of a problem to deal with. As
> Gabriel already suggested, any improvement in the set-up to reduce this
> would help much more than algorithms.
>
> However, if in the end there is some impossible to remove un-evenness, I
> have used  --
>
> -- Fourier filter high pass method (Imagej FFT 'bandwith' filter , with something
> like 'small features = 3  , large features=100 ' or play around , depends on the
> total pixel-size of the image and size of particles,
> -- Successive blurring and subtraction e.g use Mean  or Gaussian blur filter
> with largest kernel , repeating a few times, then subtract this from the original,
> -- ImageJ has a 'rolling ball' called 'remove background' with several options.
> -- This article: http://hdl.handle.net/10380/3133 describes implementation of
> applying Otsu's threshold to uneven image by applying to a set of small
> neighbourhoods and then splining the respective background levels.
>
> But, as Gabriel suggests, I think none of these will work very well for your
> case, without some initial improvement of the extreme degree of
> unevenness. The upper-right particles appear to saturate the intensity.
> Good luck
> Robert
>
>
>
>
> > -----Original Message-----
> > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> > Gabriel Landini
> > Sent: 28 March 2016 10:44
> > To: [hidden email]
> > Subject: Re: Getting started with grain size analysis -
> >
> > On Sunday 27 Mar 2016 20:14:53 you wrote:
> > > I am new to the list and have close to no experience with ImageJ (or
> > > image analysis) but have a solid background in physics and programming.
> > > I am facing the task of determining grain size distribution in
> > > photos from industrial camera. A typical image is like this:
> > > http://i.imgur.com/lwuOBeh.jpg (the diagonal separates two types of
> > > material which has different reflecitivity). The eventual goal is an
> > > unattended analysis under controlled conditions (same lighting,
> > > resolution etc). I have some issues getting a reasonable result with
> > > ImageJ and I would appreciate some help on how to move forward.
> > > Could someone suggest a way I could try?
> >
> > The image you posted has too many issues and I doubt that you would be
> > able the analysis you want accurately without redesigning your setup.
> >
> > The first problem is the overlapping. You would do much better if your
> > particles were on a single layer on a contrasted background. maybe you
> > can get some surface with wells where each grain sits in one of
> > those.That would also help with identifying the individual objects.
> >
> > You should aim to reduce the uneven illumination. I would suggest that
> > you try to resolve this issue before image capture, as doing it
> > programatically tends to create new artefacts. Have you tried a light
> diffuser? or several light sources?
> >
> > Also note that JPEG images are not good for imaging. They are lossy
> > compressed, which add image artefacts which further interfere with the
> > subsequent processing. Better save your data in TIFF or PNG formats.
> > Saving a JPEG to TIFF to PNG does not resolve anything as the
> > artifacts are already there.
> >
> > Hope this helps
> > Gabriel
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> This e-mail and any attachments may contain confidential, copyright and or
> privileged material, and are for the use of the intended addressee only. If you
> are not the intended addressee or an authorised recipient of the addressee
> please notify us of receipt by returning the e-mail and do not use, copy,
> retain, distribute or disclose the information in or attached to the e-mail.
> Any opinions expressed within this e-mail are those of the individual and not
> necessarily of Diamond Light Source Ltd.
> Diamond Light Source Ltd. cannot guarantee that this e-mail or any
> attachments are free from viruses and we cannot accept liability for any
> damage which you may sustain as a result of software viruses which may be
> transmitted in or with the message.
> Diamond Light Source Limited (company no. 4375679). Registered in England
> and Wales with its registered office at Diamond House, Harwell Science and
> Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Getting started with grain size analysis -

Michael Schmid
In reply to this post by Václav Šmilauer
Hi Vaclav,

in my view, you definitely need to improve the illumination.
Use diffuse light from all around, without specular reflections (maybe
the LED ring is too small). Also the camera should have a rather large
focal length, so the viewing direction is the same everywhere.

Then maybe try something along these lines:

- 'Subtract background' with small radius (≈3) and 'Sliding Paraboloid'
to get the outlines
- Threshold to get the outlines without breaks (best find a suitable
AutoThreshold method, so it does not depend too much on brightness)
- Skeletonize
- Erode with count=7 and many iterations (≈30) in the Binary Options to
get rid of the short line segments
- Smooth
- Threshold to get lines as background, and the lines thicker than 1 pxl
where they run diagonally (fixed threshold values, no AutoThreshold here)
- Analyze Particles with a rather high minimum circularity (try values
around 0.5-0.8), to avoid getting partially visible beads in the
background. Use one of the 'Show' options to see whether the result is
satisfactory.

It won't be perfectly quantitative, but it will provide an indication if
the grain size changes.

Best wishes,

Michael
________________________________________________________________
On 2016-03-29 14:44, Václav Šmilauer wrote:
 > Hi Gabriel, thanks for suggestions.
 >> The image you posted has too many issues and I doubt that you would be
 >> able
 >> the analysis you want accurately without redesigning your setup.
 >>
 >> The first problem is the overlapping. You would do much better if your
 >> particles were on a single layer on a contrasted background. maybe you
 >> can get
 >> some surface with wells where each grain sits in one of those.That
 >> would also
 >> help with identifying the individual objects.
 > That is true, and I am aware that the current setup does not simplify
 > things. Unfortunately it is bulk material on conveyor with the flow in
 > the order of 100t/h. I will see what could be done.
 >> You should aim to reduce the uneven illumination. I would suggest that
 >> you try
 >> to resolve this issue before image capture, as doing it
 >> programatically tends
 >> to create new artefacts. Have you tried a light diffuser? or several
 >> light
 >> sources?
 > The light is ring-shaped LED strobe already diffused with
 > hemisphe-shaped matte white reflector/diffuser (thus all the light is
 > reflected). Will try larger diameter of the diffuser, this one is just
 > about 10cm.
 >> Also note that JPEG images are not good for imaging. They are lossy
 >> compressed, which add image artefacts which further interfere with the
 >> subsequent processing. Better save your data in TIFF or PNG formats.
 >> Saving a
 >> JPEG to TIFF to PNG does not resolve anything as the artifacts are
 >> already
 >> there.
 > It must have been imgur which serves the image as JPEG, normally it is
 > obtained uncompressed from GigE camera and stored as PNG.
 >
 > Cheers, Vaclav
 >
 > --
 > ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html