ImagePro>Re: IPP's thresholding algorithm
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ImagePro>Re: IPP's thresholding algorithm
- To: <imagepro-users[at]lists.mediacy.com> (Image-Pro Plus Users Email List)
- Subject: ImagePro>Re: IPP's thresholding algorithm
- From: "Kevin Ryan" <kevin[at]mediacy.com>
- Date: Tue, 18 Dec 2001 10:42:47 -0500
- List-Archive: <http://lists.mediacy.com:80/Lists/imagepro-users/List.html>
- List-Unsubscribe: <mailto:imagepro-users-off@lists.mediacy.com>
- Reply-To: <imagepro-users[at]lists.mediacy.com> (Image-Pro Plus Users Email List)
- Sender: <imagepro-users[at]lists.mediacy.com> (Image-Pro Plus Users Email List)
This question comes up every once in a while - I think we may put the answer
into the FAQ at some point.
>From the author of the thresholding code:
----------------------
Notes from Jean-Paul Martin, 2/6/01:
IPP's Auto-threshold is an iterative method. It assumes that the gray level
histogram is the sum of two normal intensity distributions (two classes):
Foreground pixels and background pixels. The threshold is usually not
obvious because the two distributions overlap. Using this model, finding the
threshold is equivalent to finding where the two distributions intersect
(Which is not necessarily at the bottom of the valley that, in the best
case, separate the two distributions).
For each gray level (t) along the histogram h(t), the algorithm calculates
the variance of the two portions of the histogram lying on each side of t,
v1(t) and v2(t). It picks the gray level (threshold) that minimizes the sum
of the two normalized variances. This variance is sometimes called the
"within-class" variance, and can be expressed as:
vw(t) = s1(t).v1(t)/S + s2(t).v2(t)/S
where:
s1(t) = Sum{h(i), i=1->t},
s2(t) = Sum{h(i), i=t+1->n},
S = Sum{h(i), i = 1->n},
n = size of histogram.
Calculating vw(t) for every t is fairly time consuming so we derive a
second formula from vw(t) that's much faster to iterate through. I will not
go into details other than saying that the second formula involves
maximizing what's often called the "between-class" variance.
I've seen image-processing papers refer to this method as the Otsu
threshold, although it's a fairly generic way to handle bimodal normal
distributions in statistics.
----------------------
There are numerous ways of automatically choosing a threshold - we've found
that the above algorithm works reasonably well in the vast majority of
cases.
-- Kevin Ryan
kevin@mediacy.com
-----Original Message-----
From: Image-Pro Plus Users Email List
[mailto:imagepro-users@lists.mediacy.com]On Behalf Of John McLaughlin
Sent: Monday, December 17, 2001 6:05 PM
To: Image-Pro Plus Users Email List
Subject: ImagePro>IPP's thresholding algorithm
Hi,
I was wondering if I could get an explanation of how IPP sets
it's threshold when performing a Count/Size function on bright objects.
I searched the IPP manuals and the email archive but couldn't find anything
that specifically answers my question.
thanks,
John McLaughlin
Rigel, Inc.
240 East Grand Avenue
South San Francisco, CA
94080
***********************************************************
Need an Image-Pro macro or driver? Find it at http://www.Solutions-Zone.com
Got an Image-Pro macro or driver? Add it to http://www.Solutions-Zone.com
***********************************************************
This message is sent to you because you are subscribed to <imagepro-users@lists.mediacy.com>.
To unsubscribe, email to: <imagepro-users-off@lists.mediacy.com>
To switch to the DIGEST mode, email to <imagepro-users-digest@lists.mediacy.com>
To switch to the INDEX mode, email to <imagepro-users-index@lists.mediacy.com>
Send administrative queries to <imagepro-users-request@lists.mediacy.com>
To subscribe or unsubscribe visit http://www.solutions-zone.com/ipednld/subscriber.asp