They are generally used to remove noise from imperfect segmentation. Morphologicaloperations are especially suited for binary images. So they are performed on output image ofthresholding. Here opening, closing and dilation are performed. Opening and closing is used toremove holes in the detected foreground. Dilation is interaction of structuring element andforeground pixels. The structuring element is nothing but a small binary image. In the process ofdilation the size and shape determination of structuring element is very important. Dilation isperformed before thresholding. Opening and closing are done after thresholding. The results ofthese morphological operations are shown in Figure 4. After this, the selected object pixels areapplied for connected component analysis.