DOI QR코드

DOI QR Code

An Experimental Study of Image Thresholding Based on Refined Histogram using Distinction Neighborhood Metrics

  • Sengee, Nyamlkhagva (Department of Information and Computer Sciences, School of Engineering and Applied Sciences, National University of Mongolia) ;
  • Purevsuren, Dalaijargal (Department of Information and Computer Sciences, School of Engineering and Applied Sciences, National University of Mongolia) ;
  • tumurbaatar, Tserennadmid (Department of Information and Computer Sciences, School of Engineering and Applied Sciences, National University of Mongolia)
  • Received : 2022.05.18
  • Accepted : 2022.06.01
  • Published : 2022.06.30

Abstract

In this study, we aimed to illustrate that the thresholding method gives different results when tested on the original and the refined histograms. We use the global thresholding method, the well-known image segmentation method for separating objects and background from the image, and the refined histogram is created by the neighborhood distinction metric. If the original histogram of an image has some large bins which occupy the most density of whole intensity distribution, it is a problem for global methods such as segmentation and contrast enhancement. We refined the histogram to overcome the big bin problem in which sub-bins are created from big bins based on distinction metric. We suggest the refined histogram for preprocessing of thresholding in order to reduce the big bin problem. In the test, we use Otsu and median-based thresholding techniques and experimental results prove that their results on the refined histograms are more effective compared with the original ones.

Keywords

I. INTRODUCTION

Within image segmentation techniques, thresholding methods are a simple and effective technique. Thresholding is commonly used to separate the object and background of an image and to distinguish important information in the image. Thresholding techniques do that the images are cut in two based on the selected threshold value in which greater intensities are classified as one and lower of that are into other. Although many segmentation methods are developed to segment the object of the image, thresholding techniques are very low computational cost compared with other methods. As mentioned, the thresholding idea is ob- vious, but the problems are the selection of threshold values. The threshold selection methods are mainly based on a histogram of images, and the techniques are suggested in many research works [1-3]. There are many thresholding techniques such as histogram shape-based, cluster-based, en- tropy-based, spatial-based, network-based, etc [4-5]. In this work, we suggest the refined histogram extension for popular cluster-based methods to order to reduce big bin prob-lems.

Generally, the thresholding techniques are divided into two main groups: global and local thresholding. Global thresholding uses the histogram of the whole image to select the threshold value. In local thresholding, images are separated by different regions and they are independently selected by the threshold values in those regions [6]. If the histogram has some large bins which occupy the most density of whole intensity distribution, it is a problem for global thresholding methods. We refined the histogram to overcome the big bin problem in which sub-bins are created from big-bins based on distinction metric [7]. Median based and Otsu thresholding methods are used in our work, and those thresholding methods [8-9] are common tech- niques. In order to define the threshold value in Otsu thresh- olding, intra-class variances are calculated for every possible deal, and then the threshold value is determined at minimum intra-class variance.

If the histogram of an image has two peaks relating to objects and background, the Otsu thresholding result is much better than others. However, if two peaks of the histogram have some big bins, there is still a problem in selecting the optimal threshold value. Our experimental results show that they work more effectively on the refined histograms.

Our work is organized in the following sections, and thresholding basics are discussed in section II. The refined histogram is described in section III, and Section IV shows some results implemented on original and modified histo- grams. Our conclusions are in Section V.

II. THRESHOLDING TECHNIQUES

Assume that an image f(x, y) has M×N pixels and an intensity range is 0 < f(x, y) ≤ 255, x ∈ [0, M-1], and y ∈ [0, N-1]. A threshold t is used for images into two classes:

       (1)

The histogram intensity levels of the image f (x, y) are (i note 0 < i ≤ L-1), and the histogram denotes h(i).

2.1. Otsu Thresholding

The idea of Otsu thresholding is to find an optimal threshold value based on minimizing intra-class variance which is calculated for every possible threshold value. Variances of two classes are noted by σ2 bg and σ2 fg, and defined by:

where, 𝑁bg and 𝑁fj are numbers of the pixels, and 𝑢bg and 𝑢fg are means of two classes, respectively. Means are calculated by:

Intra-class variance is computed by

where wbg and wfg are the weight of two classes and computed by:   

To find the optimal threshold value, the Otsu algorithm is expressed by that we do the following steps for each threshold value, iteratively (step 1 to step 4):

1. Divide into two classes based on the threshold value t.

2. Calculate the weights of each class (equation 5).

3. Estimate the means of each class (equation 3).

4. Compute the intra-class variance of two classes (equa- tion 4).

5. Select the optimal threshold based on minimizing intraclass variances.

III. REFINED HISTOGRAM

3.1. Distinction Neighborhood Metric

In order to provide neighborhoods of all pixels of f(x, y), let g(x, y) be the extended image that is surrounded m times by zero intensities:

  

We proposed the distinction metric in our previous work [8] and the distinction metric is computed by the cumulative difference between current pixel intensity and its neighboring pixel’s intensities. It is expressed by the following for- mula:

where D is the distinction metric computed by equation (7) and Rm(x, y) is a local square in the m by m square neighborhood centered on f(x, y).

Based on the distinction metric, we can divide one big bin into many sub-bins. For instance, in Fig. 1, we can see that the intensity (i=30) of the image occurs in high density in its histogram. However, they may have different neigh- bors. Fig. 1 shows the demonstration of the big bin dividing into the sub-bins process.

Fig. 1. Demonstration of the idea of dividing one big bin into many sub-bins. (a) and (b) show the original image and its his- togram; (c) and (d) show the original image and one big bin (i=30) divided into sub-bins.

IV. EXPERIMENTAL RESULTS

This work aimed to show that one thresholding method gives different results when tested on the original and the refined histograms. In the experimental, we used six images: two images are chosen from the Brodatz texture dataset [10], both of them are selected from DIBCO (2019) datasets [11], and others are used [12]. All selected image histograms have some big bins in which the densities of the histogram are high. Otsu and median threshold selections are used for segmenting foreground from background in those images for comparison.

In order to evaluate effectiveness, we use intersection over union (IoU) criteria, and it is expressed by the follow- ing:

where, A is the resulting image and B is the correctly binarized image (ground truth).

The experimental results show that the segmentation result used in the refined histogram is much better than that of the original. In Table 1, we can see more detailed pieces of information on the comparison.

Table 1. Original and refined histograms bin sizes and select ed threshold values of them by thresholding methods, and I oU criteria values are shown.

In Table. 1, we can see histogram bin sizes and temporary bin sizes of refined histograms in the Bin number rows. Threshold (T=) row shows selected thresholding values of the original and refined histograms for each method, re- spectively. IoU row is their values of evaluation metric.

Fig. 2 shows the results of median thresholding on two test images in track A of the DIBCO-2019 dataset, and their ground truth mask images are shown in Fig. 2(c) and (d). In Fig. 2(e) and (f) result images are tested on the original his- tograms, and (h) and (i) result images are tested on the refined histograms. In Fig. 2(e), the texts are not clearly shown while the texts are clearly shown in (h). By contrast, background texts are more segmented with proposed texts on the original histogram in Fig. 2(f), and it was reduced on the refined histogram in Fig. 2(i).

Fig. 2. (a) and (b) are two images of DIBCO (2019) dataset; (c) and (d) are ground truth of them; (e) and (f) are result images of median-based thresholding on the original histogram; (h) and (i) are result images of median-based thresholding on the refined histogram.

In Fig. 3, two sample images (D34&D42) of the Brodatz dataset are thresholded by the Otsu method on their original and refined histograms. The images are in Fig. 3(a) and (b) and its ground truth masks are illustrated in Fig. 3(c) and (d).

Fig. 3. (a) and (b) are two images (D34 & D42) of Brodatz dataset; (c) and (d) are ground truth of them; (e) and (f) are result images of Otsu thresholding on the original histogram; (h) and (i) are result images of Otsu thresholding on the refined histogram.

In Fig. 4, the Otsu and Median methods are used for seg- menting, and their result and ground truth mask images are 90 shown in Fig. 3(a)-(i), respectively. In Fig .4(e) and (f), both segmented results on original histograms are shown, and Fig. 4(h) and (i) are results of the refined histograms. The fishtail in Fig. 4(h) is the result of Otsu thresholding and it is better segmented in the refined histogram for comparison with the result of the original histogram Fig. 4(e). The screwdriver shown on the right bottom of Fig. 4 (i) is the result of the median-based and it is also better segmented than that of the original histogram Fig. 4 (f).

Fig. 4. (a) fish and (b) screwdriver are original images; (c) and (d) are ground truth of them; (e) and (f) are result images of Otsu and median-based thresholding on the original histogram, respectively; (h) and (i) are result images of Otsu and medianbased thresholding on the refined histogram, respectively.

Our experimental results prove that the results of them on the refined histograms are more effective compared with the original ones.

V. CONCLUSION

We suggest the refined histogram for preprocessing of thresholding in order to reduce the big bin problem. In the work, we use Otsu and median-based thresholding techniques and six test images are chosen from DIBCO (2019) track A, Brodatz dataset, and others.

In order to reduce big-bin problem, we refined the histogram of the image using neighborhood distinction metric. Our experimental results prove that their results on the refined histograms are more effective compared with the original ones.

Further work will be to compare different thresholding methods’ results on a refined histogram using different neighborhood metrics.

References

  1. M. Sezgin and B. Sankur, "Survey over image thresholding techniques and quantitative performance evaluation," Journal of Electronic Imaging, vol. 13, no. 1, pp. 146-165, 2004. https://doi.org/10.1117/1.1631315
  2. N. R. Pal and D. Bhandari, "Image thresholding: Some new techniques," Signal Processing, vol. 33, no. 2, pp.139-158, 1993. https://doi.org/10.1016/0165-1684(93)90107-L
  3. C. A. Glasbey, "An analysis of histogram-based thresholding algorithms," CVGIP: Graphical Models and Image Processing, vol. 55, no. 6, pp. 532-537, 1993. https://doi.org/10.1006/cgip.1993.1040
  4. S. Roy, P. Shivakumara, P. P. Roy, and C. L. Tan, "Wavelet-gradient-fusion for video text binarization," in 21st International Conference on Pattern Recognition (ICPR 2012), Japan, Nov. 2012, pp. 3300-3303.
  5. A. K. Bhunia, A. K. Bhunia, A. Sain, and P. P. Roy, "Improving document binarization via adversarial noisetexture augmentation," in 2019 IEEE International Conference on Image Processing (ICIP), Taiwan, Sep. 2019, pp. 2721-2725.
  6. T. R. Singh, S. Roy, O. I. Singh, T. Sinam, and K. Singh, "A new local adaptive thresholding technique in binarization," IJCSI International Journal of Computer Science Issues, vol. 8, issue 6, no. 2, pp. 271-277, Nov. 2011.
  7. N. Sengee and H. K. Choi, "Contrast enhancement using histogram equalization with a new neighborhood metrics," Journal of Korea Multimedia Society, vol. 11, no. 6, pp. 737-745, Jun. 2008.
  8. J. H. Xue and D. M. Titterington, "Median-based image thresholding," Image and Vision Computing Volume, vol. 29, no. 9, pp. 631-637, Aug. 2011. https://doi.org/10.1016/j.imavis.2011.06.003
  9. N. Otsu, "A threshold selection method from graylevel histograms," IEEE Trans. Systems Man Cybernet, vol. 9, pp. 62-69, 1979. https://doi.org/10.1109/TSMC.1979.4310076
  10. Brodatz Textures, 1999. https://www.ux.uis.no/~tranden/brodatz.html
  11. Track DIBCO-2019, dataset, 2019. https://vc.ee.duth.gr/dibco2019/benchmark/
  12. A. Z. Arifina and A. Asano "Image segmentation by histogram thresholding using hierarchical cluster analysis," Pattern Recognition Letters, vol. 27, no. 13, pp.1515-1521, Oct. 2006. https://doi.org/10.1016/j.patrec.2006.02.022