Thresholding
\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 

- 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). (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 and (i.e. m1 and m2) (i.e. m1 and m2)
- The new  value at kth iteration value at kth iteration

- repeat from step 2 until  , where , where 
- OTSU’s method. 
- The aim is to maximize the between-class variance based on the histogram of an image 
- First, calculate the normalized histogram  , with ni is the number of pixels with the intensity level I, and it should satisfy , with ni is the number of pixels with the intensity level I, and it should satisfy

- Let us define the mean intensity of the entire image as 

which is equivalent to


Probability of , given that
, given that  comes from the class
comes from the class 
 (using Bayes’ formula)
 (using Bayes’ formula)
Note: Bayes formula

- * 
- Then, the mean of intensity of class  becomes becomes

- Similarly, the mean of intensity of class  becomes becomes

where  and
 and 
- The cumulative mean intensity from ‘0’ up to level  is defined as is defined as
 //
 // 
- Thus, we can express the total mean intensity as 

since the total mean intensity is 
- To evaluate the ‘goodness’ of the threshold values of  , we can design a score , we can design a score

 is the global variance
is the global variance

 is the between-class variance
is the between-class variance

The further the two means of  and
and  are from each other, the larger
are from each other, the larger  will be
 will be
larger value of η.
To make the calculation simpler, we transform the formula as

The Procedure of Otsu Method

Aim: obtain the maximum  from the calculation of
 from the calculation of  for all values of k
for all values of k
- Apply an image filter prior to thresholding. 
- Compute the normalized histogram  
- Compute the cumulative sum  , , to to 
- Compute the cumulative mean  , , to to 
- Compute the global intensity mean  
- Compute  , for all , for all 
- Find k* at which  is at maximum is at maximum
- Apply threshold at  * *
- 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 

Where  is intensity of the point at step
is intensity of the point at step  in the number of points area in M.A
in the number of points area in M.A 
Use 
See example with text image corrupted by spot shading


Last updated
Was this helpful?