Research Article

Multilevel Thresholding for Image Segmentation Using Mean Gradient

Algorithm 2

Preprocessing pseudocode for DIBCO.
(1)Input: gray scale image , k parameter
(2)Output: preprocessed gray scaled image
(4) //median filtering
(5) //adaptive histogram equalization filtering
(6) //image complement
(8)) //opening with structural element 1
(9) applying equations (8) and (9) on //background and foreground masks
(10)) //mask estimation with structural element 2
(11) //first foreground compensation
(12) //median filtering
(13)) //second compensation
(14) //contrast adjustment
(15) //closing operation