Niblack algorithm for Document binarization
Asked Answered
B

4

13

i've this photo :

enter image description here

and i'm trying to make Document binarization using niblack algorithm i've implemented the simple Niblack algorithm

T = mean + K* standardDiviation

and that was it's result:

enter image description here

the problem is there's some parts of the image in which the window doesn't contain any objects so it detects the noise as objects and elaborates them .

i tried to apply blurring filter then global thresholding that was the result :

enter image description here

which wont be solved by any other filter i guess the only solution is preventing the algorithm from detecting global noise if the window i free from object

i'm interested to do this using niblack algorithm not using other algorithm so any suggestions ?

Betrothal answered 18/4, 2012 at 9:20 Comment(1)
See also: liris.cnrs.fr/christian.wolf/software/binarizeCoeval
B
11

i tried sauvola algorithm in this paper Adaptive document image binarization J. Sauvola*, M. PietikaKinen section 3.3

it's a modified version of niblack algorithm which uses a modified equation of niblack enter image description here

which returned a pretty good answers : enter image description here

as well as i tried another modification of Niblack which is implemented in this paper in the 5.5 Algorithm No. 9a: Université de Lyon, INSA, France (C. Wolf, J-M Jolion)

which returned a good results as well :

enter image description here

Betrothal answered 19/4, 2012 at 23:22 Comment(0)
W
4

Did you look here: https://mcmap.net/q/906470/-niblack-thresholding

local_mean = imfilter(X, filt, 'symmetric');
local_std = sqrt(imfilter(X .^ 2, filt, 'symmetric'));
X_bin = X >= (local_mean + k_threshold * local_std);

I don't see many options here if you insist to use niblack. You can change the size and type of the filter, and the threshold.

BTW, it seems that your original image has colors. This information can significantly improve black text detection.

Wimple answered 18/4, 2012 at 14:8 Comment(0)
S
2

There are range of methods that can help in this situation:

  1. Of course, you can change algorithm it self =)
  2. Also it is possible just apply morphology filters: first you apply maximum in the window, and after - minimum. You should tune windows size to achieve a better result, see wiki.
  3. You can choose the hardest but the better way and try to improve Niblack's scheme. It is necessary to increase Niblack's windows size if standard deviation is smaller than some fixed number (should be tuned).
Statist answered 19/12, 2016 at 17:27 Comment(0)
H
-1

i tried the niblack algorithm with k=-0.99 and windows=990 using optimisation:

Shafait – “Efficient Implementation of Local Adaptive Thresholding Techniques Using Integral Images”, 2008

with : T = mean + K* standardDiviation; i have this result :

enter image description here

the implementation of algorithm is taken here

Hydrogenous answered 14/10, 2020 at 20:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.