Does anyone know of post-processing algorithms for removing ghost objects from a binarized image? Problem: When I binarize an image using, for example, the niblack or bernsen method, it produces a lot of noise. I’m a red book or an online article about binarization, and they all say that the post-processing step is necessary in Niblack and another binarization method, but they don’t say what it is, a post-processing operation. So please, if someone knows, call me. EDIT: Original image:
alt text http://i.piccy.info/i4/20/63/b970ab2ca66e997f421e969a1657.bmp
Burnson threshold wins 31, contrast 15:
alt text http://i.piccy.info/i4/32/55/2f1e0293311119986bd49529e579.bmp
Burnson threshold wins 31, contrast difference 31:
alt text http://i.piccy.info/i4/2a/13/774508890030b93201458986bbd2.bmp
Niblack method window of size -15, k_value 0.2:
alt text http://i.piccy.info/i4/12/4f/fa6fc09bcba7a7e3245d670cbfa5.bmp
Niblack-31 method window size, k_value 0.2:
alt text http://i.piccy.info/i4/c0/fd/1f190077abba2aeea89398358fc0.bmp
EDIT2: As you can see, the Niblack threshold is causing a lot of noise. And if I reduce the size of the window, the black squares will become a little white inside. Burnsen is better - less noise, but even if I make a contrast difference more, but there is one problem, I just can’t produce the image right now, in words, the problem is: if the image contains some objects with a color close to white, and the background is white, therefore, if there is a region (for the line with the sample) with black color, then this method ignores the objects, and the result is incorrect. This is because the Burnsen method uses this formula: on each pixel, the contrast difference diff = maximum_grayscale_value - minimum_grayscale_value is calculated and then diff is used to calculate the threshold value, but in the case I wrote above, we have a maximum value of 255 and a minimum value of 0. So Thus, the threshold will be 128, but the actual color of the object is higher than 128 (almost white).
Therefore, I need to use some post-processing operations for proper binarization. Any thoughts?