Does anybody knows about post-processing algorithms to remove ghost objects from binarized image? The problem: When I binarize image using for example niblack method or bernsen, it produces many noise. I red book or internet articles about binarization, and they all say that the post-processing step is needed in Niblack and other's binarization method, But they don't say what is it, post-processing operation. So please, if someone knows, tel me. EDIT: Original image:
Bernsen threshold winsize 31, contrast difference 15:
Bernsen threshold winsize 31, contrast difference 31:
Niblack method window size-15, k_value 0.2:
Niblack method window size-31, k_value 0.2:
EDIT2: As you see, the Niblack threshold is making many noise. And if I make the window size less, the black squares became a little white inside. The Bernsen is better - less noise, but even if I make the contrast difference bigger, but there is one problem, I just can't produce image right now, in words, the problem: if image contains some objects with color close to white color, and the background is white, so if there is a region (for examle line) with black color, then this method ignores the objects and result is wrong. That is because Bernsen method use this formula: at each pixel calculate the contrast difference diff = maximum_grayscale_value - minimum_grayscale_value and then the diff is used to calculate threshold value, but in the case that I wrote above, we have maximum value of 255 and minimum value of 0. So threshold will be 128, But actual object color is above the 128 (near white color).
So I need to use some post-processing operations to make binarization correctly. Any thoughts?