Re: Automate thresholding on various grayscale images



On Jun 12, 9:16 pm, ImageAnalyst <imageanal...@xxxxxxxxxxxxxx> wrote:
Nathan:
Responding to your comments in order:
I'm sure you can do a web search for Gaussian and find lots of
pictures and explanations.  A skewed one (one with a tail - tail is a
term from statistics) is just one that is not symmetrical - just take
the histogram of your own image if you want an example.
Ah, right, thank you. Gaussian = bell curve (normal distribution).
That clears that up.

The ImageJ multithresholder plug-in athttp://rsb.info.nih.gov/ij/plugins/multi-thresholder.html
has the triangle method as one of its methods.  There are several
methods available to be selected in that program: triangle is one and
maximum entropy is another.  Several of them will give the same or
very close to the same automatically-selected threshold value.
Alright, I have that plugin now. (The one that I had only included 4
different means of thresholding, thanks for the link) I guess all I
need to do is figure a way to incorporate that method into my program
(with some leniency as well). Have you seen any publically available
Triangle algorithms (hopefully in matlab)? I was trying to figure out
how to incorporate the one shown here
http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip-Segmenta.html#Heading118
into matlab, but got lost in its explanation. I understand that the
triangle threshold finds the value (b) the with the distance d as the
greatest, but I don't know how to turn that into matlab code. Any help
here?

Sometimes with an image there just plain isn't any global threshold
that will work.  You can visually verify it by going through every
single level and it's possible that NONE of the will look good.  In
that case, you'll need to employ more sophisticated image analysis
methods than just simple global thresholding.  I've posted some
thresholding demo code many times - just search this newsgroup for
blobMeasurements and you'll find it.
Yeah, I've been reading up more and I guess I was naive to think that
I could find One method that would work for me. I did find a FEX file
(http://www.mathworks.com/matlabcentral/fileexchange/6770) that might
help, except I keep running out of memory. Also, your blobMeasurements
makes me run out of memory as well right after the fourth image in the
figure (during regionprops(), I believe). (How do I allocate more
memory to Matlab? I have 4bg on this computer and I don't think I
should be running out...)

You're welcome.  And you're right - I do have a lot of experience -
over 30 years on a huge variety of images from lots of different
modalities and thousands of different applications.
Well, it's wonderful to see people like you are willing to help others
in any way possible.

After you threshold, you need to call bwlabel() and regionprops().
Example code is in the demo I mentioned two paragraphs above.
Hope this answers your questions.  Ask again if you have any more.
As mentioned before, regionprops() gives me an out of memory error, so
I'm stuck here until I can figure out these memory issues.

When you're doing particle sizing, it's very, very common to see
distributions that look log-normal:http://en.wikipedia.org/wiki/Log_normal
In fact it's way more common than a Gaussian distribution.  Several
years ago when I was browsing through Terrence Allen's particle sizing
textbook (the bible on the subject)http://www.amazon.com/Particle-Size-Measurement-Terence-Allen/dp/0412...
I remember seeing some kind of physical derivation of the reason for
that.  I think that he said that the distributions were Cauchy-Lorentz
or something like that.  Maybe it was log normal - I don't remember
exactly.  But it was encouraging to see that what I was seeing was
normal and expected.  When you're in college, all they ever talk about
is Gaussian distributions and I was wondering why I never saw them in
practice so it was good to know that there was a physical reason for
this.  And the really strange thing is that you get the same shape for
the distributions no matter what distribution you're talking about -
it could be intensity (the histogram), the distribution of areas,
perimeters, equivalent circular diameters, fractal dimension,
practically anything you can think of to measure - they will all have
that skewed Gaussian look to them.  Maybe it has to do with the
fractal nature of things combined with the quantization/digitization
that you do - I don't know, but it is interesting.
Yeah, through my analysis I have been constantly seeing the "log
normal" graphs in my histograms. (They seem to represent the 1/4 and
1/2 graphs in the first image in your link)

If I ever get regionprops working right for me (without the memory
issues), would that solve my bounding box problem? (I noticed a
parameter 'BoundingBox' when looking at the help file and assume that
it is what I am looking for, as long as I get the thresholding down to
what I want)
And again, Thanks for all of your help.
-Nathan

.



Relevant Pages

  • Re: Automate thresholding on various grayscale images
    ... I'm sure you can do a web search for Gaussian and find lots of ... Sometimes with an image there just plain isn't any global threshold ... In fact it's way more common than a Gaussian distribution. ... I think that he said that the distributions were Cauchy-Lorentz ...
    (comp.soft-sys.matlab)
  • Re: Proof for Expected Value Problem
    ... relates to the magnitude of a pair of independent Gaussian distributions ... "Applied Control Theory for Embedded Systems" was written for you. ... Papoulis, Probability, Random Variables and Stochastic ...
    (comp.dsp)
  • Re: Gaussian distribution
    ... Gaussian marginals and not joint distributions. ... Instead of assuming a Gaussian model, ... Much of what is done does NOT depend on normality. ...
    (sci.stat.math)
  • Re: A Gaussian MIXTURE problem for everyone
    ... A linear combination of two Gaussian distributions is Gaussian. ... the pdf of Y, and the resulting distribution will be the convex ...
    (sci.stat.math)
  • Re: Installing SuSE Linux 10 on ancient Pentium system... please help
    ... Going to SUSE 10.0 may require more memory, ... RAM, 64MB was a little too small. ... Graphical install required somewhere ... The "big" name distributions (like SuSE, Fedora/Red Hat, Debian, Ubuntu ...
    (alt.os.linux.suse)