In the image in the following link link text
How to clean the outer contour for text , i need to remove the small added pixles , the condition for removing the pixles is that the added pixles width is less than 3 pixles ,so remove pieces which have width one or two pixles only.
the red arrows is pointing to some pixles i need to remove from the contour i do not want to add or remove other pixles on the contour , because the geometric of the text will change , the resulted image will be passed to OCR module.
any help is appreciated