Re: Automate thresholding on various grayscale images
- From: Nathan <ngreco32@xxxxxxxxx>
- Date: Fri, 12 Jun 2009 15:25:38 -0700 (PDT)
On Jun 12, 2:10 pm, ImageAnalyst <imageanal...@xxxxxxxxxxxxxx> wrote:
---------------------------------------------------------------------------------------------------------------Yeah, I've seen worse, but each of mine vary which makes this process
Nathan:
The image you posted isn't bad as far as non-uniform background goes.
(seem) harder for me.
It could maybe be improved (like maybe dividing the image by theI'm somewhat new to matlab, and even newer to image processing. What's
morphological closing of the image). I see this shape of histogram a
lot. Basically it's a Gaussian with a little tail on one side.
this "Gaussian with a little tail"?
Usually the best threshold is right where the tail seems to stick intoActually, ImageJ is the program I've most recently used to try to find
the Gaussian. I find the best method for auto thresholding that is
the triangle method. Here's a reference (ImageJ source code):http://rsb.info.nih.gov/ij/plugins/download/AutoThresholder.java
a nice, clean threshold (or some other means of finding these soot
particles). Does ImageJ have this Triangle method readily available?
If so, how do I use it (or find it)? If not, how do I get it?
(I've read something about being able to incorporate ImageJ code with
Matlab code, but have yet to figure it out)
Look near the end of the page for "triangle"I think I'm still lost with that Gaussian term. I've heard it many
It works like this: Draw a line from the highest peak of the Gaussian
to last bin in the side you want to threshold, for example a line
going from about bin 190 to bin 100 or so. Now, take lines
perpendicular to that line that point to your histogram (the pair of
these lines now form a "T" shape). The selected threshold will be the
bin that has the longest perpendicular line (around 174 for your
image). Basically it finds the "corner" of your histogram on the tail
side of it.
times, but it just confuses me. How would I go about doing these
instructions? (And is this the same as ImageJ's "Maximum Entropy"
threshold under "MultiThresholder"? This gives about the same
threshold value.)
I'll continue to look through this for more help as well, thanks for
Check out section 8.3 here for more methods:http://www.visionbib.com/bibliography/contentssegment.html#2-D%20Regi...
the link.
How would I do this programatically, rather than manually?
There are other ways to find the particles that are robust to slowly
changing background levels. For example, you could use a variance
filter. High variance areas will be where your soot is and low
variance will be where you background is. You could take the variance
of the image (in a sliding window sort of fashion) and then threshold
that. Or maybe filter it with something like a morphological closing
or a median filter and subtract that from the image (background will
vanish even if it varies locally), and threshold the result.
Yeah, I've noticed this even with manually doing the thresholding.
Bottom line, it will take a little bit of experimentation to come up
with the best method.
I've yet to find one method that works best for me. However, although
I can do this all manually, what I really want to know is how could I
do it through Matlab code? Currently, my image analysis process is
extremely slow because I have to manually find each aggregate's area
before any calculations can be done.
Good luck,
ImageAnalyst
Thanks for you help. Reading through your posts, you obviously know
what you are doing and have plenty of experience.
There's another thing I'm trying to figure out that somewhat coincides
with this thresholding problem.
After thresholding (if I ever find the way that suits me best), I need
to be able to locate these regions through my program, which searches
for enclosed areas (being rectangles or ellipses).
(My program takes in three images: the original TEM image, a black and
white "PERIMETER" image, which is the thresholded image, and a black
and white "BOXED" image, which consists of boxes surrounding the areas
where the aggregates should be. The boxes are white-bordered, with
everything else being black.)
So, I also need some way to do this programatically, rather than
manually.
This is probably too much in one thread, but again, any help is
appreciated.
-Nathan
.
- Follow-Ups:
- Re: Automate thresholding on various grayscale images
- From: ImageAnalyst
- Re: Automate thresholding on various grayscale images
- References:
- Automate thresholding on various grayscale images
- From: Nathan
- Re: Automate thresholding on various grayscale images
- From: ImageAnalyst
- Automate thresholding on various grayscale images
- Prev by Date: Returning 2d int array in mex
- Next by Date: Data Smoothing selected indices in a Matrix
- Previous by thread: Re: Automate thresholding on various grayscale images
- Next by thread: Re: Automate thresholding on various grayscale images
- Index(es):
Relevant Pages
|
Loading