Thresholding
Last updated
Last updated
\begin{equation}{\label{eq.1}} F=\alpha A+\beta W=\beta(\frac{\alpha}{\beta}A+W) \end{equation},
A Short Summary of Thresholding Algorithm
The basic concept of thresholding: to segment objects from the background based on intensity values.
A simple method is making the output result as a binary image as
Multiple thresholding
OTSU’s method.
The aim is to maximize the between-class variance based on the histogram of an image
Let us define the mean intensity of the entire image as
which is equivalent to
Note: Bayes formula
*
Thus, we can express the total mean intensity as
larger value of η.
To make the calculation simpler, we transform the formula as
The Procedure of Otsu Method
Apply an image filter prior to thresholding.
Local thresholding
Method 1. Image partitioning
Subdivide an image into non overlapping rectangles. Apply otsu threshold in each sub division.
Works well when the objects and background occupy reasonably comparable size.
But fails if either object or background is small.
Method 2. Based on local image property
preferable if background is nearly uniform.
Method 3. Moving average.
Scan line by line in zigzag to reduce illumination effect
See example with text image corrupted by spot shading
Analyze the intensity histogram and select the initial estimation of (usually the mean of the image intensity). Let the intensity of the input image is defined as g(x,y).
Segment the image by two groups on the histogram using the value of
Find the mean of and (i.e. m1 and m2)
The new value at kth iteration
repeat from step 2 until , where
First, calculate the normalized histogram , with ni is the number of pixels with the intensity level I, and it should satisfy
Probability of, given that comes from the class
(using Bayes’ formula)
Then, the mean of intensity of class becomes
Similarly, the mean of intensity of class becomes
where and
The cumulative mean intensity from ‘0’ up to level is defined as
//
since the total mean intensity is
To evaluate the ‘goodness’ of the threshold values of , we can design a score
is the global variance
is the between-class variance
The further the two means of and are from each other, the larger will be
Aim: obtain the maximum from the calculation of for all values of k
Compute the normalized histogram
Compute the cumulative sum , to
Compute the cumulative mean , to
Compute the global intensity mean
Compute , for all
Find k* at which is at maximum
Apply threshold at *
Where is intensity of the point at step in the number of points area in M.A
Use