Research Article

Multilevel Thresholding for Image Segmentation Using Mean Gradient

Algorithm 1

Pseudocode for global and bilevel thresholding.
(1)Input: image, bilevel
(2)Output:
(3)If is RGB //RGB to gray conversion
(4)else
(5) //arithmetic mean //mean of gradient vector
(8) //first threshold
(9) //second threshold
(10)If bilevel is true:
(11)
(12)
(13)
(14)Else//global thresholding
   //compute probability distribution function
(15) If
(16)
(17)
(18)
(19)Else
(20)
(21)
(22)