Skip to main content
Log in

A model for the gray-intensity distribution of historical handwritten documents and its application for binarization

  • Original Paper
  • Published:
International Journal on Document Analysis and Recognition (IJDAR) Aims and scope Submit manuscript

Abstract

In this article, our goal is to describe mathematically and experimentally the gray-intensity distributions of the fore- and background of handwritten historical documents. We propose a local pixel model to explain the observed asymmetrical gray-intensity histograms of the fore- and background. Our pixel model states that, locally, the gray-intensity histogram is the mixture of gray-intensity distributions of three pixel classes. Following our model, we empirically describe the smoothness of the background for different types of images. We show that our model has potential application in binarization. Assuming that the parameters of the gray-intensity distributions are correctly estimated, we show that thresholding methods based on mixtures of lognormal distributions outperform thresholding methods based on mixtures of normal distributions. Our model is supported with experimental tests that are conducted with extracted images from DIBCO 2009 and H-DIBCO 2010 benchmarks. We also report results for all four DIBCO benchmarks.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17

Similar content being viewed by others

Notes

  1. An inverted lognormal is a lognormal distribution that is reflected in a constant; See a formal definition in Appendix 2.

References

  1. Badekas, E., Papamarkos, N.: Estimation of appropriate parameter values for document binarization techniques. Int. J. Robotics Autom. 24(1), 66–78 (2009)

    Google Scholar 

  2. Bar-Yosef, I., Mokeichev, A., Kedem, K., Dinstein, I., Ehrlich, U.: Adaptive shape prior for recognition and variational segmentation of degraded historical characters. Pattern Recognit. 42(12), 3348–3354 (2009). New Frontiers in Handwriting Recognition

    Google Scholar 

  3. Barney Smith, E.H.: An analysis of binarization ground truthing. In: Proceedings of the 9th IAPR International Workshop on Document Analysis Systems, DAS ’10, pp. 27–34. ACM, New York, NY, USA (2010)

  4. Bataineh, B., Abdullah, S.N.H.S., Omar, K.: An adaptive local binarization method for document images based on a novel thresholding method and dynamic windows. Pattern Recognit. Lett. 32(14), 1805–1813 (2011)

    Article  Google Scholar 

  5. Bazi, Y., Bruzzone, L., Melgani, F.: Image thresholding based on the EM algorithm and the generalized gaussian distribution. Pattern Recognit. 40(2), 619–634 (2007)

    Article  MATH  Google Scholar 

  6. Ben Messaoud, I., El Abed, H., Amiri, H., Märgner, V.: New method for the selection of binarization parameters based on noise features of historical documents. In: Proceedings of the 2011 Joint Workshop on Multilingual OCR and Analytics for Noisy Unstructured Text Data, pp. 1:1–1:8. ACM, New York, NY, USA (2011)

  7. Brink, A., Smit, J., Bulacu, M., Schomaker, L.: Writer identification using directional ink-trace width measurements. Pattern Recognit. 45(1), 162–171 (2012)

    Article  Google Scholar 

  8. Çelik, T.: Bayesian change detection based on spatial sampling and gaussian mixture model. Pattern Recognit. Lett. 32(12), 1635–1642 (2011)

    Article  Google Scholar 

  9. Chen, Q., Sun, Q., Ann Heng, P., Xia, D.: A double-threshold image binarization method based on edge detector. Pattern Recognit. 41(4), 1254–1267 (2008)

    Article  Google Scholar 

  10. Chou, C.H., Lin, W.H., Chang, F.: A binarization method with learning-built rules for document images produced by cameras. Pattern Recognit. 43(4), 1518–1530 (2010)

    Article  MATH  Google Scholar 

  11. Chow, C., Kaneko, T.: Boundary detection and volume determination of the left ventricle from a cineangiogram. Comput. Biol. Med. 3(1), 13–16, IN1-IN2, 17–26 (1973). Cardiology and Blood

    Google Scholar 

  12. Elguebaly, T., Bouguila, N.: Bayesian learning of finite generalized gaussian mixture models on images. Signal Process. 91(4), 801–820 (2011)

    Article  MATH  Google Scholar 

  13. Fan, S.K.S., Lin, Y.: A fast estimation method for the generalized gaussian mixture distribution on complex images. Comput. Vis. Image Underst. 113(7), 839–853 (2009)

    Article  Google Scholar 

  14. Fan, S.K.S., Lin, Y., Wu, C.C.: Image thresholding using a novel estimation method in generalized gaussian distribution mixture modeling. Neurocomputing 72(1–3), 500–512 (2008). Machine Learning for Signal Processing (MLSP 2006) / Life System Modelling, Simulation, and Bio-inspired Computing (LSMS 2007)

    Google Scholar 

  15. Gatos, B., Ntirogiannis, K., Pratikakis, I.: ICDAR 2009 document image binarization contest (DIBCO 2009). In: Tenth International Conference on Document Analysis and Recognition, pp. 1375–1382 (2009)

  16. Gatos, B., Ntirogiannis, K., Pratikakis, I.: DIBCO 2009: document image binarization contest. Int. J. Document Anal. Recognit. 14, 35–44 (2011)

    Article  Google Scholar 

  17. Gatos, B., Pratikakis, I., Perantonis, S.: Adaptive degraded document image binarization. Pattern Recognit. 39(3), 317–327 (2006)

    Google Scholar 

  18. Gatos, B., Stamatopoulos, N., Louloudis, G.: ICDAR 2009 handwriting segmentation contest. Int. J. Document Anal. Recognit. 14, 25–33 (2011)

    Article  Google Scholar 

  19. Gonzalez, R.C., Woods, R.E.: Digital Image Processing, 3rd edn. Prentice Hall, Englewood Cliffs, NJ (2007)

    Google Scholar 

  20. Hedjam, R., Moghaddam, R.F., Cheriet, M.: A spatially adaptive statistical method for the binarization of historical manuscripts and degraded document images. Pattern Recognit. 44(9), 2184–2196 (2011)

    Article  Google Scholar 

  21. Howe, N.R.: Document binarization with automatic parameter tuning. Int. J. Document Anal. Recognit. 16, 247–258 (2013)

    Google Scholar 

  22. Huang, Z.K., Chau, K.W.: A new image thresholding method based on Gaussian mixture model. Appl. Math. Comput. 205, 899–907 (2008)

    Article  MATH  MathSciNet  Google Scholar 

  23. Kapur, J.N., Sahoo, P.K., Wong, A.K.C.: A new method for gray-level picture thresholding using the entropy of the histogram. Comput. Vis. Graph. Image Process. 29, 273–285 (1985)

    Article  Google Scholar 

  24. Khosravi, H., Kabir, E.: A blackboard approach towards integrated Farsi OCR system. Int. J. Document Anal. Recognit. 12(1), 21–32 (2009)

    Article  Google Scholar 

  25. Kittler, J., Illingworth, J.: Minimum error thresholding. Pattern Recognit. 19(1), 41–47 (1985)

    Article  Google Scholar 

  26. Kuk, J.G., Cho, N.I., Lee, K.M.: MAP-MRF approach for binarization of degraded document image. In: Proceedings of the 15th International Conference on Image Processing, pp. 2612–2615 (2008)

  27. Lázaro, J., Martín, J.L., Arias, J., Astarloa, A., Cuadrado, C.: Neuro semantic thresholding using OCR software for high precision OCR applications. Image Vis. Comput. 28, 571–578 (2010)

    Article  Google Scholar 

  28. Lee, H., Verma, B.: Binary segmentation algorithm for english cursive handwriting recognition. Pattern Recognit. 45(4), 1306–1317 (2012)

    Article  Google Scholar 

  29. Lelore, T., Bouchara, F.: FAIR: a fast algorithm for document image restoration. IEEE Trans. Pattern Anal. Mach. Intell. 35(8), 2039–2048 (2013)

    Article  Google Scholar 

  30. Louloudis, G.E., Gatos, B.G., Pratikakis, I., Halatsis, C.: Text line detection in handwritten documents. Pattern Recognit. 41, 3758–3772 (2008)

    Article  MATH  Google Scholar 

  31. Lu, S., Su, B., Tan, C.L.: Document image binarization using background estimation and stroke edges. Int. J. Document Anal. Recognit. 13, 303–314 (2010)

    Article  Google Scholar 

  32. Lyon, R.F.: A brief history of pixel. In: IS &T/SPIE Symposium on Electronic, Imaging, pp. 15–19 (2006)

  33. Moghaddam, R.F., Cheriet, M.: A multi-scale framework for adaptive binarization of degraded document images. Pattern Recognit. 43(6), 2186–2198 (2010)

    Article  MATH  Google Scholar 

  34. Moghaddam, R.F., Cheriet, M.: A variational approach to degraded document enhancement. IEEE Trans. Pattern Anal. Mach. Intell. 32, 1347–1361 (2010)

    Article  Google Scholar 

  35. Moghaddam, R.F., Cheriet, M.: Beyond pixels and regions: a non-local patch means (NLPM) method for content-level restoration, enhancement, and reconstruction of degraded document images. Pattern Recognit. 44(2), 363–374 (2011)

    Article  Google Scholar 

  36. Moghaddam, R.F., Cheriet, M.: AdOtsu: an adaptive and parameterless generalization of Otsu’s method for document image binarization. Pattern Recognit. 46(6), 2419–2431 (2012)

    Article  Google Scholar 

  37. Niblack, W.: An Introduction to Digital Image Processing. Prentice Hall, Birkeroed (1985)

    Google Scholar 

  38. Nikolaou, N., Makridis, M., Gatos, B., Stamatopoulos, N., Papamarkos, N.: Segmentation of historical machine-printed documents using adaptive run length smoothing and skeleton segmentation paths. Image Vis. Comput. 28, 590–604 (2010)

    Article  Google Scholar 

  39. Otsu, N.: A threshold selection method from grey-level histograms. IEEE Trans. Syst. Man Cybern. 9(1), 62–66 (1979)

    Article  MathSciNet  Google Scholar 

  40. Pai, Y.T., Chang, Y.F., Ruan, S.J.: Adaptive thresholding algorithm: efficient computation technique based on intelligent block detection for degraded document images. Pattern Recognit. 43(9), 3177–3187 (2010)

    Article  MATH  Google Scholar 

  41. Papavassiliou, V., Stafylakis, T., Katsouros, V., Carayannis, G.: Handwritten document image segmentation into text lines and words. Pattern Recognit. 43(1), 369–377 (2010)

    Article  MATH  Google Scholar 

  42. Pratikakis, I., Gatos, B., Ntirogiannis, K.: H-DIBCO 2010—handwritten document image binarization competition. In: International Conference on Frontiers in Handwriting Recognition, pp. 727–732. IEEE Computer Society, Los Alamitos, CA, USA (2010)

  43. Pratikakis, I., Gatos, B., Ntirogiannis, K.: ICDAR 2011 document image binarization contest (DIBCO 2011). In: 2011 International Conference on Document Analysis and Recognition, pp. 1506–1510. IEEE (2011)

  44. Pratikakis, I., Gatos, B., Ntirogiannis, K.: ICFHR 2012 competition on handwritten document image binarization (H-DIBCO 2012). In: 2012 International Conference on Frontiers in Handwriting Recognition (ICFHR), pp. 813–818 (2012)

  45. Ramírez-Ortegón, M., Tapia, E., Block, M., Rojas, R.: Quantile linear algorithm for robust binarization of digitalized letters. In: Ninth International Conference on Document Analysis and Recognition, vol. 2, pp. 1158–1162 (2007)

  46. Ramírez-Ortegón, M.A., Rojas, R.: Transition thresholds for binarization of historical documents. In: 20th International Conference on Pattern Recognition, pp. 2362–2365. IEEE Computer Society (2010)

  47. Ramírez-Ortegón, M.A., Tapia, E., Ramírez-Ramírez, L.L., Rojas, R., Cuevas, E.: Transition pixel: a concept for binarization based on edge detection and gray-intensity histograms. Pattern Recognit. 43, 1233–1243 (2010)

    Article  MATH  Google Scholar 

  48. Ramírez-Ortegón, M.A., Tapia, E., Rojas, R., Cuevas, E.: Transition thresholds and transition operators for binarization and edge detection. Pattern Recognit. 43(10), 3243–3254 (2010)

    Article  MATH  Google Scholar 

  49. Rivest-Hénault, D., Farrahi Moghaddam, R., Cheriet, M.: A local linear level set method for the binarization of degraded historical document images. Int. J. Document Anal. Recognit. 15, 101–124 (2012)

    Article  Google Scholar 

  50. Sauvola, J., Pietikäinen, M.: Adaptive document image binarization. Pattern Recognit. 33(2), 225–236 (2000)

    Article  Google Scholar 

  51. Shi, J., Ray, N., Zhang, H.: Shape based local thresholding for binarization of document images. Pattern Recognit. Lett. 33(1), 24–32 (2012)

    Article  Google Scholar 

  52. Smith, A.R.: A pixel is not a little square, a pixel is not a little square, a pixel is not a little square! (and a voxel is not a little cube). Tech. rep, Microsoft (1995)

  53. Su, B., Lu, S., Tan, C.L.: Binarization of historical document images using the local maximum and minimum. In: Proceedings of the 9th IAPR International Workshop on Document Analysis Systems, pp. 159–166. ACM (2010)

  54. Tonazzini, A.: Color space transformations for analysis and enhancement of ancient degraded manuscripts. Pattern Recognit. Image Anal. 20, 404–417 (2010)

    Article  Google Scholar 

  55. Valizadeh, M., Kabir, E.: Binarization of degraded document image based on feature space partitioning and classification. Int. J. Document Anal. Recognit. 15(1), 57–69 (2012)

    Article  Google Scholar 

  56. Valizadeh, M., Kabir, E.: An adaptive water flow model for binarization of degraded document images. Int. J. Document Anal. Recognit. 16(2), 165–176 (2013)

    Article  Google Scholar 

  57. Verma, B., Lee, H.: Segment confidence-based binary segmentation (SCBS) for cursive handwritten words. Expert Syst. Appl. 38(9), 11,167–11,175 (2011)

    Article  Google Scholar 

  58. Vonikakis, V., Andreadis, I., Papamarkos, N.: Robust document binarization with OFF center-surround cells. Pattern Anal. Appl. 14, 219–234 (2011)

    Article  MathSciNet  Google Scholar 

  59. Wen, J., Fang, B., Chen, J., Tang, Y., Chen, H.: Fragmented edge structure coding for chinese writer identification. Neurocomputing 86(1), 45–51 (2012)

    Article  Google Scholar 

  60. Wolf, L., Littman, R., Mayer, N., German, T., Dershowitz, N., Shweka, R., Choueka, Y.: Identifying join candidates in the Cairo Genizah. Int. J. Comput. Vis. 94, 1–18 (2010)

    Google Scholar 

  61. Xue, J., Zhang, Y., Lin, X.: Rayleigh-distribution based minimum error thresholding for SAR images. J. Electron. (China) 16, 336–342 (1999)

    Article  Google Scholar 

  62. Xue, J.H., Titterington, D.M.: t-tests, F-tests and Otsu’s methods for image thresholding. IEEE Trans. Image Process. 20(8), 2392–2396 (2011)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgments

We would like to thanks to the Asociación Mexicana de Cultura A.C. We are so grateful to the editor and all the reviewers for their constructive and meticulous comments.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lilia L. Ramírez-Ramírez.

Electronic supplementary material

Appendices

Appendix 1: A Frontier pixel convergence

Let \(X\sim N(\mu _1,\sigma _2),\,Y\sim N(\mu _2,\sigma _2)\) and \(U\sim \hbox {Unif}(0,1)\), all independent. In this section we prove that if \(W\) is defined as \(W:=uX+(1-u)Y\), then

  1. 1.

    If \(U\) is a degenerated random variable with value \(u\), we have that \(W\sim N(u\mu _1+(1-u)\mu _2, \sqrt{u^2\sigma _1^2\!+\!(1\!-\!u)^2\sigma _2^2})\).

  2. 2.

    If \(\sigma _1=\sigma _2=\sigma \) then \(W\) has lighter tails than a random variable that is normally distributed with standard deviation \(\sqrt{3}\sigma \).

  3. 3.

    As \(\sigma _1,\sigma _2 \rightarrow 0\) we have \(W\) tends to be a random variable that is uniform distributed.

Proof of 1: From the properties of the moment generating functions (MGF’s), we have:

$$\begin{aligned} M_{W}(t)=M_{X}(ut)M_{Y}([1-u]t), \end{aligned}$$
(15)

where \(M_W(t):=E(\exp \{tW\})\).

Since the MGF of a normal random variable with parameters \((\mu , \sigma )\) is

$$\begin{aligned} \exp \left( \mu t+\frac{\sigma ^2t^2}{2}\right) \!, \end{aligned}$$
(16)

then (15) is equal to

$$\begin{aligned} M_{W}(t)&= \exp \left( \mu _1 tu+\frac{\sigma _1^2t^2u^2}{2}\right) \nonumber \\&\times \exp \left( \mu _2 t(1-u)+\frac{\sigma _2^2t^2(1-u)^2}{2}\right) \end{aligned}$$
(17)
$$\begin{aligned}&= \exp \left( t\left( u\mu _1+(1-u)\mu _2\right) \right. \nonumber \\&\left. +\frac{t^2}{2} \left( u^2\sigma _1^2+(1-u)^2\sigma _2^2\right) \right) \!, \end{aligned}$$
(18)

that corresponds to a random variable that is normally distributed with the specified parameters.

Proof of 2: From the properties of MGF’s, we have:

$$\begin{aligned} M_{W|u}(t)=M_{X|u}(ut)M_{Y|u}([1-u]t), \end{aligned}$$
(19)

where the function \(M_{W|u}(t)\) denotes the moment generating function of \(W\) with respect to the conditional density \(f_{X,Y|U}(x,y|u)\).

Then the conditional MGF in (19) is equal to

$$\begin{aligned} M_{W|u}(t)&= \exp \left( t\left( u\mu _1+(1-u)\mu _2\right) \right. \nonumber \\&\left. + \frac{t^2\sigma ^2}{2}\left( u^2+(1-u)^2\right) \right) \!. \end{aligned}$$
(20)

Without loss of generality assume that \(\mu _1>\mu _2\). To obtain unconditional MGF of \(W\) we integrate the last expression over the \(U\)’s domain as following:

$$\begin{aligned} M_{W}(t)&= \int \limits _0^1 M_{W|u}(t)\hbox {d}u \end{aligned}$$
(21)
$$\begin{aligned}&= \int \limits _{0}^{1} c \cdot \exp \left( tu(\mu _1-\mu _2)+t^2\sigma ^2(u(u-1))\right) \hbox {d}u \nonumber \\ \end{aligned}$$
(22)
$$\begin{aligned}&= c \cdot \int \limits _{0}^{1} \exp \left( tu(\mu _1-\mu _2)+t^2\sigma ^2(u(u-1))\right) \hbox {d}u, \nonumber \\ \end{aligned}$$
(23)

where

$$\begin{aligned} c = \exp \left( t\mu _1+\frac{t^2\sigma ^2}{2}\right) \!. \end{aligned}$$
(24)

If \(t>0\), then (23) is smaller than or equal to

$$\begin{aligned}&\le \exp \left( t\mu _1+\frac{t^2\sigma ^2}{2}\right) \exp \left( t(\mu _1-\mu _2)+\frac{t^2\sigma ^2}{4}\right) \end{aligned}$$
(25)
$$\begin{aligned}&= \exp \left( t\mu _1+\frac{t^23\sigma ^2}{2}\right) \!. \end{aligned}$$
(26)

Similarly, if \(t<0\) then (23) is smaller than or equal to

$$\begin{aligned} \exp \left( t\mu _2+\frac{t^23\sigma ^2}{2}\right) \!. \end{aligned}$$
(27)

Since in both cases, the moment generating function is dominated by a MGF of a random variable with Normal distribution and variance \(3\sigma ^2\), the conclusion follows.

Proof of 3: Based on (20) we have that

$$\begin{aligned} M_{W|u}(t)\rightarrow \exp \left( \mu _1tu+\mu _2t(1-u)\right) \!, \end{aligned}$$
(28)

as \(\sigma _1,\sigma _2 \rightarrow 0\).

To obtain the MGF of \(W\) we integrate \(M_{W|u}(t)\) as

$$\begin{aligned} M_{W}(t)&= \int \limits _0^1\exp \left( \mu _1tu+\mu _2t(1-u) \right) \hbox {d}u\end{aligned}$$
(29)
$$\begin{aligned}&= \exp \left( \mu _2t\right) \int \limits _0^1\exp \left( u(\mu _1t-\mu _2t)\right) \hbox {d}u\end{aligned}$$
(30)
$$\begin{aligned}&= \frac{\exp \left( \mu _1t\right) -\exp \left( \mu _2t\right) }{t(\mu _1-\mu _2)}, \end{aligned}$$
(31)

that is the MGF of an uniform distributed random variables with lower and upper limits equal to \(\min \{\mu _1,\mu _2\}\) and \(\max \{\mu _1,\mu _2\}\), respectively.

Appendix 2: Quasi-thresholding methods

To simplify our notation, the subindexes \(f,\,b,\,if,\,of,\,ib\), and \(ob\) abbreviate the foreground, background, inner foreground, outer foreground, inner background, and outer background sets, respectively. Furthermore, we also simplify our notation of the means and variances of gray intensities of a set \(\mathcal{A }\) by

$$\begin{aligned} \hat{\mu }_{\mathcal{A }}&= \frac{1}{| \mathcal{A } |} \sum _{\varvec{p} \in \mathcal{A } } I(\varvec{p} )\quad \text { and} \end{aligned}$$
(32)
$$\begin{aligned} \hat{\sigma }^{2}_{\mathcal{A }}&= \frac{1}{| \mathcal{A } |} \sum _{\varvec{p} \in } \left[ I(\varvec{p} ) - \hat{\mu }_{\mathcal{A }} \right] ^{2}. \end{aligned}$$
(33)

1.1 Quasi-threshold \(LI\)

The mixture \(LI\) models the gray-intensity histogram as the mixture of two distributions: Lognormal for the foreground and inverted lognormal for the background. Formally, its threshold is defined by Bayes rule as the value \(x\) that satisfies:

$$\begin{aligned} w_{f}\lambda (x;\tilde{\mu }_{f},\tilde{\sigma }_{f}) = w_{b}\tilde{\lambda }(x;c_{b},\tilde{\tilde{\mu }}_{b},\tilde{\sigma }_{b}) \end{aligned}$$
(34)

such that \(\hat{\mu }_{f} < x < \hat{\mu }_{b}\), where

$$\begin{aligned} w_{f} = \frac{ | \mathcal{F }|}{| \mathcal{P } |}, \quad w_{b} = \frac{ | \mathcal{B }|}{| \mathcal{P } |}, \end{aligned}$$
(35)

\(\lambda (x;\tilde{\mu }_{f},\tilde{\sigma }_{f})\) and \(\tilde{\lambda }(x;c_{b},\tilde{\tilde{\mu }}_{b},\tilde{\sigma }_{b})\) denote the probability distribution functions of the lognormal and inverted lognormal distributions. These functions are given by:

  1. (1)

    Lognormal:

    $$\begin{aligned} \lambda (x;\tilde{\mu }_{f},\tilde{\sigma }_{f}) = \frac{1}{x\tilde{\sigma }_{f}\sqrt{2\pi }} \exp \left( -\frac{ (\ln (x) - \tilde{\mu }_{f} )^{2} }{2\tilde{\sigma }^{2}_{f}} \right) \!,\nonumber \\ \end{aligned}$$
    (36)

    where

    $$\begin{aligned} \tilde{\mu }_{f}&= \ln (\hat{\mu }_{f}) - \frac{1}{2}\ln \left( 1 + \frac{\hat{\sigma }^{2}_{f}}{\hat{\mu }^{2}_{f}} \right) \quad \text { and } \end{aligned}$$
    (37)
    $$\begin{aligned} \tilde{\sigma }^{2}_{f}&= \frac{1}{2}\ln \left( 1 + \frac{\hat{\sigma }^{2}_{f}}{\hat{\mu }^{2}_{f}} \right) \!. \end{aligned}$$
    (38)
  2. (2)

    Inverted lognormal:

    $$\begin{aligned} \tilde{\lambda }(x;c_{b},\tilde{\tilde{\mu }}_{b},\tilde{\sigma }_{b}) = \lambda (c_{b} - x;\tilde{\tilde{\mu }}_{b},\tilde{\sigma }_{b}), \end{aligned}$$
    (39)

    where \(\tilde{\sigma }_{b}\) is computed in an analogous manner as \(\tilde{\sigma }_{f}\),

    $$\begin{aligned} \tilde{\tilde{\mu }}_{b}&= \ln (c_{b} - \hat{\mu }_{f}) - \frac{1}{2}\ln \left( 1 + \frac{\hat{\sigma }^{2}_{f}}{[c_{b} - \hat{\mu }_{f}]^{2}} \right) \!,\quad \text { and } \nonumber \\ \end{aligned}$$
    (40)
    $$\begin{aligned} c_{b}&= \underset{ \varvec{p} \in \mathcal{B } }{\max } \, \left( I(\varvec{p} ) \right) + 1. \end{aligned}$$
    (41)

1.2 Quasi-thresholding \(NLIN\)

The mixture \(NLIN\) models the gray-intensity histogram as the mixture of the gray-intensity distributions of the inner foreground, outer foreground, inner background, and outer background. Such sets are estimated as:

$$\begin{aligned} \hat{\mathcal{F }}^{*}&= \mathcal{F }\setminus \mathcal{E }, \quad \hat{\mathcal{F }}^{\circ }= \mathcal{F }\cap \mathcal{E }, \quad \hat{\mathcal{B }}^{*}= \mathcal{B }\setminus \mathcal{E }, \quad \text {and} \nonumber \\&\hat{\mathcal{B }}^{\circ }= \mathcal{B }\cap \mathcal{E }, \end{aligned}$$
(42)

where \(\mathcal{E }\) denotes the set of 8-edge pixels:

$$\begin{aligned} \mathcal{E }= \left\{ \varvec{p} \in \mathcal{P } \, \text {such that} \, \mathcal{F }_{1}(\varvec{p} ) \not = \emptyset \, \text {and} \, \mathcal{B }_{1}(\varvec{p} ) \not = \emptyset \right\} \end{aligned}$$
(43)

Once the frontier pixels are estimated, the gray-intensity distribution of the foreground is modeled as the mixture of a normal distribution (corresponding to the inner foreground) and a lognormal distribution (corresponding to the outer foreground). On the other hand, the gray-intensity distribution of the background is modeled as the mixture of a normal distribution (corresponding to the inner background) and an inverted lognormal distribution (corresponding to the outer background).

Formally, the threshold of \(NLIN\) is defined by Bayes rule as the value \(x\) that satisfies:

$$\begin{aligned} M_{f}(x) = M_{b}(x) \end{aligned}$$
(44)

such that \(\hat{\mu }_{f} < x < \hat{\mu }_{b}\), where

$$\begin{aligned} M_{f}(x)&= \hat{w}_{if}\phi (x;\hat{\mu }_{if},\hat{\sigma }_{if})\nonumber \\&+ \hat{w}_{of}\lambda (x;\tilde{\mu }_{of},\tilde{\sigma }_{of}),\end{aligned}$$
(45)
$$\begin{aligned} M_{b}(x)&= \hat{w}_{ob}\tilde{\lambda }(x;c_{ob}, \tilde{\tilde{\mu }}_{ob}, \tilde{\sigma }_{ob})\nonumber \\&+ \hat{w}_{ib}\phi (x;\hat{\mu }_{ib},\hat{\sigma }_{ib}),\end{aligned}$$
(46)
$$\begin{aligned} \hat{w}_{if}&= \frac{|\hat{\mathcal{F }}^{*}|}{|\mathcal{P } |}, \quad \hat{w}_{of} = \frac{|\hat{\mathcal{F }}^{\circ }|}{|\mathcal{P } |}, \quad \hat{w}_{ob} = \frac{|\hat{\mathcal{B }}^{\circ }|}{|\mathcal{P } |}, \quad \text {and} \nonumber \\&\hat{w}_{ib} = \frac{|\hat{\mathcal{B }}^{*}|}{|\mathcal{P } |}. \end{aligned}$$
(47)

The functions \(\lambda (x;\tilde{\mu }_{of},\tilde{\sigma }_{of})\) and \(\tilde{\lambda }(x;c_{ob},\tilde{\tilde{\mu }}_{ob},\tilde{\sigma }_{ob})\) are defined in a similar manner as in the section “Quasi-threshold \(LI\)” of Appendix; \(\phi (x;\hat{\mu }_{if},\hat{\sigma }_{if})\) denotes the probability density function of a normal distribution given by:

$$\begin{aligned} \phi (x;\hat{\mu }_{if},\hat{\sigma }_{if}) = \frac{1}{\hat{\sigma }_{if}\sqrt{2\pi }} \exp \left( -\frac{ (x - \hat{\mu }_{if} )^{2} }{2\hat{\sigma }^{2}_{if}} \right) . \end{aligned}$$
(48)

In similar manner, \(\phi (x;\hat{\mu }_{ib},\hat{\sigma }_{ib})\) is defined.

1.3 Quasi-thresholding methods based on normal distributions

We implemented two mixtures based on normal distributions: \(NN\) and \(NNNN\). The former mixes two normal distributions to approximate the gray-intensity distribution, while the latter mixes four normal distributions. Their parameters are estimated in similar manner as in the previous subsections.

The threshold of \(NN\) is defined by Bayes rule as the value \(x\) that satisfies:

$$\begin{aligned} w_{f}\phi (x;\hat{\mu }_{f},\hat{\sigma }_{f}) = w_{b}\phi (x;\hat{\mu }_{b},\hat{\sigma }_{b}) \end{aligned}$$
(49)

such that \(\hat{\mu }_{f} < x < \hat{\mu }_{b}\). Likewise, the threshold of \(NNNN\) is defined as:

$$\begin{aligned} M_{f}(x) = M_{b}(x) \end{aligned}$$
(50)

such that \(\hat{\mu }_{f} < x < \hat{\mu }_{b}\), where

$$\begin{aligned} M_{f}(x) = \hat{w}_{if}\phi (x;\hat{\mu }_{if},\hat{\sigma }_{if}) + \hat{w}_{of}\phi (x;\hat{\mu }_{of},\hat{\sigma }_{of}) \end{aligned}$$
(51)

and

$$\begin{aligned} M_{b}(x) = \hat{w}_{ob}\phi (x;\hat{\mu }_{ob},\hat{\sigma }_{ob}) + \hat{w}_{ib}\phi (x;\hat{\mu }_{ib},\hat{\sigma }_{ib}). \end{aligned}$$
(52)

Rights and permissions

Reprints and permissions

About this article

Cite this article

Ramírez-Ortegón, M.A., Ramírez-Ramírez, L.L., Messaoud, I.B. et al. A model for the gray-intensity distribution of historical handwritten documents and its application for binarization. IJDAR 17, 139–160 (2014). https://doi.org/10.1007/s10032-013-0212-5

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10032-013-0212-5

Keywords

Navigation