Image segmentation by using thresholding technique in two stages

Image segmentation can be defined as a cutting or segmenting process of the digital image into many useful points which are called segmentation, that includes image elements contribute with certain attributes different form Pixel that constitute other parts. Two phases were followed in image processing by the researcher in this paper. At the beginning, pre-processing image on images was made before the segmentation process through statistical confidence intervals that can be used for estimate of unknown remarks suggested by Acho & Buenestado in 2018. Then, the second phase includes image segmentation process by using "Bernsen's Thresholding Technique" in the first phase. The researcher drew a conclusion that in case of utilizing the statistical confidence intervals beside Bernsen's Thresholding technique it can give better results in image segmentation. This method is characterized with different performance if it is compared with the regular Bernsen's thresholding technique during the direct image segmentation in both cases,namely , in case of natural image status or adding speckle noise perturbation.


Introduction
The image segmentation process [1] is considered one of the main methods in image processing that divides images into correspondent points. The main goal of this process is to transform image into many clear points and more important by extracting the useful and important attributes of the information from the original image [2]. The thresholding [3] is considered one of the image segmentation techniques at the image processing that used a grey scale image or colored image. The thresholding can be used to create a binary image. Through the process of segmentation, the gray image or the color image transfer into binary image. The segmentation process depends on the pixel based-methods, that assigns each pixel based-method at the image in two categories or more [4]. The thresholding technique can be classified into two main categories; global and local thresholding. There are many thresholding techniques depend basically on the histogram, spatial analysis, Entropy, object attribute and clustering [5]. The Bernsen's thresholding technique sample was taken in 1986 in digital image segmentation, which is a technique used to determine the image thresholding of grey level with a determined local interval for each pixel -based methods. The Bernsen's thresholding technique has developed at this paper by adding a statistical method. The statistical confidence intervals were used and suggested by Acho & Buenestado in 2018. They worked together on developing Otsu method [6]. The confidence intervals are the range located at the community parameter and can be identified as estimation. ( ) power endurance [7] The (1-) % can be identified as confidence level which is the confidence intervals that can include the true value for a potential parameter model. When the sample size is big, the estimation will be better to the related community standards [8]. Then, the comparison was made between the two methods, whereas a group of images were taken and segmented by using the two methods above regarding the segmentation results. The noise was added to the images for quality measurement, and comparing the two methods to see which one is better. The novelty of this paper mainly lies in the proposal of two phases were relied in image processing to evolution of a new segment image method, at the beginning, pre-processing image on images was made before the segmentation process through propose statistical confidence intervals that can be used for estimate of unknown parameters suggested by Acho & Buenestado in 2018. Then, the second phase includes image segmentation process by using "Bernsen's thresholding technique" in the first phase. There are some previous studies for the current subject. In 2011, T. Romen Singh, S. Roy and O. Imocha Sinal and others used the Bernsen's technique [9] as one of the segmentation methods by using the locally adaptive thresholding technique through using the local mean and the standard deviation.In (2013) G.Erelin, Sujji.&Y.V.S.Lakshmi.& G.Wiselin, Jiji, [10] applied MRI brain image to efficient image segmentation technique by thresholding to detect the contour of the tumor in brain. In 2014, Ghalib, [11] used a nonparametric method to estimate the thresholding by the kernel of probability density function for Parzen window , we applied this research on the microscopy images of the soil samples, where in 2016, Eyupoglu [12] invented some binary code system techniques . He had executed some of the locally binary adaptive methods for Bernesn's, and tested them on different images which have a grey image measure, also in 2016 Senthilkumaran, N. & Vaithegi, [13] present an efficient implementation for thresholding and give a detailed comparison of Niblack an Sauvola local thresholding algorithm applying in medical image, so in (2018) AL-Rawi,A&Abdul-Wadood,M. [14],introduced Niblack's thresholding , Sauvola's thresholding , Bernesn's thresholding and three proposed methods, applied to satellite image . in (2018) Buenstado & Acho [2] have developed a new method of image segmentation regarding the statistic confidence intervals with the known Otsu technique, where in [15] 2020 Yang, E and others developed the nuclear density-confidence interval (ND-CI) algorithm to determine if an HRME image contains sufficient nuclei for classification, or if a better image is required. The algorithm uses a convolutional neural network to exclude image region without visible nuclei. Then the remaining region are used to estimate a confidence interval for the number of abnormal nuclei per mm -a feature used by a previously developed algorithm (called the ND algorithm)-to classify images as beginning on neoplastic.
Regarding the experiments that made on the image segmentation through using the above techniques, the Bernesn's technique is better in normal conditions than the developed one, while the developed method is characterized with better performance than Bernerson's. This paper aims to find out a proper method of image segmentation for image processing throughout Bernesen's thresholding technique and the developed method by using the statistical confidence intervals in image pre-processing.

Methods and Approaches 2.1. Bernsen's thresholding technique
The Bernsen's thresholding technique [9] [12] uses the local gray range technique. The extent that can be used between the maximum and the minimum to the gray pixel's extent inside the local window to determine the thresholding value as follow: Whereas + is the maximum and the minimum grey level value at wxw window that centered at (x, y) consecutively . The thresholding relied on the local contrast value, then can be expressed as below: If the contrast measure is the adjacent contrast is consisted of one category or class, foreground or background. In addition to that, the value of L and we are different relying on the images and used areas.

Statistical confidence intervals technique
The statistical confidence intervals technique is considered one of the modern methods in image segmentation. This technique presents a better performance than the standard processing. The confidence intervals may give the mean value to the existed group at the area. It can be found through the math interpretation as below [8]: Throughout simplifying the probability period, we can get:

Image segmentation based on modified statistical confidence interval algorithm
The proceures are as follows: -Step 1: Enter the image that needs to be transferred to an image with gray measure and count the criterion deviation ( ) with considering the intensity of each image unit (pixel) (x,y) as a numerical point.

Results and discussion
On this side, the application was made on three images, two colored images and one gray image. The segmentation process was mad on the image by using Bernsen's thresholding technique and the developed one, and the comparison between the two cases was completed. The first case is to make segmentation on the original images as they are, and in the second case, the noise was added to the images. The three below images cases (A, B and C) are to apply the techniques and the Algorithm. The original image represents the scenes of Al-Kut dam (the 1 st image), and the second image represents the scene of solar eclipse while the third image represents corona Virus-19 under telescope. . Figure 15. The pre-processed on (B5) image by using confidence intervals Algorithm with histogram (B6)  Regarding the results above and after the using of the two techniques with Matlab , the first image at the first case will be entered without noise addition then transformed to grey color and making the pre-processing by using the confidence Intervals Algorithm, so the Bernsen's thresholding technique will be used. The resulted images and the images of (C4, B4, A4) are compared to the segmented images directly on the original image by using Bernsen's thresholding technique, the resulted image are (C3, B3, A3). In order to measure the similarity between the original image and the segmented one, the Jaccard [16] was used, which is the division result of intersection between the two images and the union of the two images, and their value is between zero and one. It is one of the measures of images segmentation, and transformed both to a binary image. In case of the value is one or close to one, it means there is a similarity between the two images, and if the value is zero or close to zero, it means that the two images are different. Also, we can see the values are clear in table (1). It is remarkable that the developed technique has great value than the Jaccard's value between the original image and the images that had segmented by Bernsen's thresholding technique, so it is less in value than the developed technique. The evaluation of both techniques can be made through the self-assesment, regarding our style and experience it presents an acceptable performance. We have remarked, that Bernsen's thresholding technique gives all the existed parameters in the image unlike the developed technique that clarify only the prominent parameters, which is more clear. At the second case, and after adding the noisy, the image will be changed to grey color and making the preprocessed by using the confidence Intervals Algorithm, then the image segmentation process was made using Bernsen's thresholding process. The images at the figures (1,2,3), and the images are (C8, B8, A8) compared to the segmented images by using directly Bernsen's thresholding technique on the original noisy images, the result were the images of (C5, B5, A5). During the use of Jaccard measure, the values showed up at the table (1). It is remarkable that the developed technique has a great value that Jaccard value between the original image and the image that has segmented by using Bernsen's thresholding technique, which is less than the developed technique value. It is remarkable to say even in the time of using that measure which is used widely in most of the researches that gives a satisfaction results in image segmentation, we can evaluate the two techniques performance through self-assessment. The researchers style and the experiment, it presents an acceptable performance. regarding the images and their transformation into gray images and making the preprocessed with confidence intervals Algorithm, we noticed that it has remove the noisy from the image and gives a good image, the image segmentation was made that gives a clear remark. During the segmentation process on the noisy image, we notice that Bernsen's thresholding technique gives a segmented image unclear remarks.

Conclusion
During the results interpretation, we drew on the following conclusions:  Throughout the suggested confidence intervals Algorithm which is the novelty of this paper and proposing of two phases were relied in image processing to evolution of a new segment image method, that can be used for estimate of unknown parameters suggested by Acho & Buenestado in 2018 to improve the image without noise, we have concluded that the Bernsen's thresholding technique results make the remarks clearer.  In case of the images being noisy that is due to the use of speckle noise with pre-processing procedure, the confidence of intervals Algorithm will remove the noise from the image. So, during the process of image segmentation with using Bernsen's thresholding technique, it will give more clear remarks than if the segmentation on the noisy image was directly use of Bernsen's thresholding technique.  During the use of Jaccard's measure, we have remarked that the value of this measure is greater during pre-processing procedure on the image by using the confidence intervals Algorithm in case of adding noisy or without.