# Performance Analysis of Otsu-Based Thresholding Algorithms: A Comparative Study

Authors: Qinglin Cao; Letu Qingge; Pei Yang
Journal: Journal of Sensors
 (2021)

---

## Abstract

Image thresholding is a widely used technology for a lot of computer vision applications, and among various global thresholding algorithms, Otsu-based approaches are very popular due to their simplicity and effectiveness. While the usage of Otsu-based thresholding methods is well discussed, the performance analyses of these methods are rather limited. In this paper, we first review nine Otsu-based approaches and categorize them based on their objective functions, preprocessing, and postprocessing strategies. Second, we conduct several experiments to analyze the model characteristics using different scene parameters both on synthetic images and real-world cell images. We put more attention to examine the variance of foreground object and the effect of the distance between mean values of foreground and background. Third, we explore the robustness of algorithms by introducing two typical kinds of noises under different intensities and compare the running time of each method. Experimental results show that NVE, WOV, and Xing’s methods are more robust to the distance of mean values of foreground and background. The large foreground variance will cause a larger threshold value. Experiments on cell images show that foreground miss detection becomes serious when the intensities of foreground pixels change drastically. We conclude that almost all algorithms are significantly affected by Salt&Pepper and Gaussian noises. Interestingly, we find that ME increases almost linearly with the intensity of Salt&Pepper noise. In terms of algorithms’ time cost, methods with no preprocessing and postprocessing steps have more advantages. All these findings can serve as a guideline for image thresholding when using Otsu-based thresholding approaches.


---

## Body

## 1. Introduction

Image segmentation which extracts objects of interest from background is a fundamental technology for various image processing tasks. It has been widely used in various kinds of applications including text detection [1], medical image processing [2], document binarization [3], remote sensing [4], and object detection [5]. Thresholding method is one of the most well-known segmentation algorithms due to its simplicity and effectiveness [6]. The main goal of the image thresholding is to divide the pixels of an image into several subsets by selecting some intensity values. While we can choose more than one threshold values for multilevel segmentation, in this paper, we only focus on a single threshold segmentation which separates the whole image into two parts, and each corresponds to the background and foreground. In the past decades, there were many threshold selection methods presented including histogram shape-based methods [7–9], clustering-based methods [10–12], and entropy-based methods [13, 14]. The thresholding algorithms can be generally categorized into the global thresholding and the local thresholding. In the global thresholding, all pixels of the processed image use the same threshold value. Among all existing global thresholding algorithms, Otsu’s technique [6] which was first proposed by Otsu in 1979 is still one of the most frequently used clustering-based global thresholding methods [15]. Due to simplicity and effectiveness, Otsu’s technique is usually used as the preprocessing step in complex applications [16, 17]. The main idea behind the Otsu’s algorithm is to maximize the between-class variance to determine the optimal threshold value. When meeting the assumption that the gray level distributions of both the foreground and background are Gaussian distributions with equal variance, Otsu’s method can produce satisfactory results on real-world images [18, 19]. However, most real-world images do not satisfy this applicable condition. Therefore, the performance of Otsu’s method may degrade when the gray level histogram of the image is close to unimodal or the variances of the foreground and background are significantly different. Figure 1 shows segmentation results of Otsu’s method on real cell images with a unimodal histogram and large between-class variance.Figure 1
Segmentation results of real-world images which do not meet the applicable conditions of Otsu’s method. (a) Real-world graylevel images. (b) Corresponding histograms. (c) Manually labeled ground truths. (d) Segmentation results of Otsu’s method.
(a)(b)(c)(d)Due to the limitations mentioned above, a lot of research efforts have been put into analyzing and improving the Otsu’s method. Ng [20] introduced a valley emphasis term into the objective function of Otsu’s method and proposed a valley emphasis algorithm (VE) to ensure the threshold value locating at the valley of the histogram. Based on the fact that histogram valley corresponds to a low grayscale probability, Ng took the grayscale probability as the valley metric and demonstrated the effectiveness of Ng’s method on some test images. However, its valley metric does not take the neighborhood information into consideration. Fan and Lei [21] modified the valley metric using smoothed grayscale probability and proposed a new method named NVE to improve Otsu’s method. The valley metrics used in VE and NVE depend on the grayscale probability. To better represent the histogram valley, Xing et al. [22] proposed an improved valley emphasis method using second-order derivative-based valley metric.Hu and Gong [23] proposed a two-stage method to further expand the application scenarios of Otsu’s method. In the first stage, the method detects the peaks of the histogram close to left and right boundary and smooths the image pixels whose intensities are between the corresponding intensities of the two peaks. In the second stage, Otsu’s method is applied on the preprocessed image. The experimental results showed that Hu’s method can provide better segmentation results than Otsu’s algorithm. To better understand the limitations of Otsu’s method, Xu et al. [24] studied its characteristics and proposed a two-round Otsu’s algorithm. The main conclusion of Xu’s work is the threshold value computed using Otsu’s method tends to bias toward the class with a larger within-class variance. Inspired by Xu’s work, Yuan et al. [25] introduced a weighted object variance (WOV) parameter to the Otsu’s objective function and proposed an improved Otsu’s method for detection. Also motivated by Xu’s work, Yang et al. [26] analyzed the relationship between pixel intensity and cumulative pixel number and gave a postadjusting strategy for the threshold value acquired by Otsu’s method. Not only the improved one dimensional Otsu’s methods were developed which mentioned above but also many two-dimensional Otsu’s algorithms have been proposed [27–30]. Cao et al. [31] claimed that the existing improved Otsu’s methods could not process images with a broad histogram or a flat valley. Many of the existing methods, especially two-dimensional Otsu’s methods, are not parameter free. To overcome this challenge, Cao et al. [31] proposed a novel parameter-free method which can achieve a more accurate and robust performance. In addition, there are also studies trying to improve the performance of Otsu’s method in the case of multiple thresholds [32]. A typical way is to use bionic algorithms (e.g., artificial bee colony algorithm [32, 33]) to search optimal multiple thresholds instead of using brute force methods. In this paper, we are mainly focusing on the bilevel image thresholding, and we will not further review the multilevel thresholding methods.While a large number of improved Otsu’s methods have been proposed, there are a few studies focusing on the performance analysis of the algorithms in-depth. Goh et al. [34] studied the performance of Otsu’s technique using Monte Carlo statistical method. However, the performance comparison among different Otsu-based algorithms is still understudied, and also the test images used in existing studies are significantly different. To the best of our knowledge, there is no existing study on the categorization strategy of a various Otsu-based algorithms. In this paper, we first give a categorization method for different Otsu-based methods based on the objective functions, preprocessing, and postprocessing strategies. Second, a real-world image dataset and a Monte Carlo-based image synthetic method are employed for the evaluation of Otsu-based thresholding algorithms. Furthermore, several typical corruptions are adopted to test different algorithms. The main contributions of the paper are as follows:
(1)
We propose a categorization method for different improved Otsu-based algorithms based on their objective functions, preprocessing, and postprocessing strategies(2)
The characteristics of each Otsu-based method are analyzed in-depth. More specifically, the effect of variance and distance between mean values of foreground and background, the ratio of foreground object in the whole image are discussed using a Monte Carlo-based image synthetic method(3)
The robustness of each Otsu-based method to two typical kinds of corruptions is studied on a real-world cell image dataset, and the performance of each algorithm corresponding to different noise intensities is analyzed(4)
We compare the time cost of all test algorithms and find that preprocessing or postprocessing steps may significantly increase algorithm’s consuming time when implementing by Matlab if the preprocessing or postprocessing does not meet the language characteristicsThe remainder of the paper is organized as follows. Section2 introduces the basic principle of Otsu’s method and reviews the recent improved algorithms based on the Otsu’s method using a categorization strategy. Section 3 presents the characteristics and performance analytics for the compared Otsu-based algorithms by conducting experiments on the synthetic images and real-world cell images. Section 4 presents the discussion and conclusion.


## 2. Overview of Otsu-Based Thresholding Methods

Otsu’s method is one of the most frequently used automatic thresholding algorithms. In this section, we introduce the basic principle of Otsu’s algorithm and give a brief review of recently improved Otsu-based thresholding methods.SupposeI is a grayscale image of size m∗n, and the intensities of pixels of I are ranging from 0 to L−1. All pixels of I can be divided into two sets C0 and C1 when giving a specific intensity value t as a threshold. If the mean intensity of C0 and C1 is denoted as μ0t and μ1t, and the probability of C0 and C1 are denoted as P0t and P1t, the between class variance of Otsu’s method can be defined as:
(1)P0t=∑i=0tpi,(2)P1t=∑i=t+1L−1pi=1−P0t,(3)σt=P0t·μ0t−μ2+P1t·μ1t−μ2,where pi is the probability of intensity i, which can be described as pi=fi/m∗n if fi represents the number of pixels with intensity i. μ is the mean intensity of the whole image I, which can be expressed as μ=P0t·μ0t+P1t·μ1t.With the above definitions, we can compute the optimal thresholdt∗ of Otsu’s method by solving the following optimization problem:
(4)t∗=argmaxtσt=argmaxtP0t·μ0t−μ2+P1t·μ1t−μ2.The objective function described in equation (4) indicates that the best threshold of Otsu’s method maximizes the weighted sum of the square of distance between mean intensity of foreground and the whole image and the square of distance between mean intensity of background and the whole image, which is also known as the interclass variance.There are two main improvement strategies for the original Otsu’s method. One is to modify the objective function to make the threshold value more reasonable, and the other is to add preprocessing and/or postprocessing steps. Table1 lists algorithms and their corresponding objective functions for the performance comparison purpose in this paper. Following the two main improvement strategies, we can roughly divide the eight methods in Table 1 into two categories. Methods including VE [20], NVE [21], Xing’s, WOV, and Cao’s are only focusing on improving the objective function, and Hu’s, Xu’s, and Yang’s methods introduce preprocessing and/or postprocessing steps. In the following, we will give a brief introduction to the other eight Otsu-based algorithms.Table 1
A description of each Otsu-based algorithm discussed in this paper.
MethodObjective functionPreprocessingPostprocessingOtsu’s [6]σt——VE [20]σt·wvt——NVE [21]σt·wvt——Xing’s [22]σt·wvt——WOV [25]P0t·P0t·μ0t−μt2+P1t·μ1t−μt2——Cao’s [31]P0t·P1t·μ0t−μ1t2+μ0t−μt2+μ1t−μt2——Hu’s [23]σt√—Xu’s [24]σt√—Yang’s [26]σt—√As described in Table1, the first improved algorithm VE modified the objective function of Otsu’s method by adding a new valley metric term wvt to ensure the selected threshold value is more likely located at the valley of the histogram. The valley metric used in VE algorithm is defined as below:
(5)wvt=1−pt,where pt represents the probability of occurrence of pixels with intensity t. The valley metric does not take neighborhood information into consideration, and in NVE the metric is modified as:
(6)wvt=1−p¯t,where p¯t=∑i=−mmpt+i and the value of m is suggested to be 5 according to Fan and Lei’s study [21].A new second-order derivative based valley metric was proposed by Xing et al. [22] in which the valley metric proposed was defined as equation (7) below:
(7)wvx=△2px−min△2p·max△2p·−min△2p·,where p· represents the probability of all useable gray levels.Besides the three valley emphasis methods above, Cao’s method and WOV algorithm also belong to the first category which are focusing on modifying the objective function. In WOV, the influence of the foreground variance is increased, and the weight of the first term of Otsu’s method is changed fromP0t to P0t·P0t. To maximize the distance between mean values of foreground and background, Cao et al. added a distance term into the objective function, which is defined as:
(8)μ0t−μ1t2.The second category is based on adding preprocessing and/or postprocessing steps. In Hu’s study, a preprocessing scheme is applied on the processed gray level image before implementing standard Otsu’s method. The image preprocessing can be described as:(9)Ix,y=0.25∗Ix−1,y−Ix,y+Ix+1,y−Ix,y+Ix,y−1−Ix,y+Ix,y+1−Ix,y+Ix,yIx,y>T0andIx,y<T1Ix,yothers,where Ix,y represents the pixel intensity at x,y, T0 and T1 are gray levels corresponding to the first and last peaks of the histogram. The main idea of formula (9) is to take neighborhood information into consideration for pixels whose intensities belong to T0,T1, and then the Otsu’s method is implemented on the smoothed image.Different from Hu’s preprocessing strategy, Xu et al. proposed a two-round Otsu’s method which applied a preprocessing step on intensity probability of the processed gray image. Xu et al. assumed that the pixel intensity of foreground in an image is larger than background, the interclass variance of foreground is significantly large, and the real optimal threshold value should be smaller than Otsu’s result. To make the threshold value sounder, Xu et al. proposed to apply the following preprocessing strategy on pixel intensity probability and calculate the optimal threshold value using Otsu’s algorithm based on new pixel intensity probabilities in.(10)P0t=∑i=0tpi∑i=0Tpi,P1t=∑i=t+1Tpi∑i=0Tpi,μ0t=∑i=0ti∗pi∑i=0Tpi,μ1t=∑i=t+1Ti∗pi∑i=0Tpi.Yang et al. also proposed a postprocessing strategy for threshold tuning based on the relationship betweenPT and Pt defined as below:
(11)PT=∑i=0Tpi,Pt=∑i=0tpiμ<T,PT=∑i=T+1L−1pi,Pt=∑i=tL−1piμ≥T,where T represents the threshold value obtained by Otsu’s method, L and μ are gray levels and mean intensity of the whole image defined as above. For a given threshold value β, the new optimal threshold value can be described as the solution of the following optimization problem.
(12)t∗=argmintabsPtPT−β.As we discussed, two different improvement ideas are employed in the eight improved Otsu’s methods. The first category of improved Otsu’s methods is aimed at forming a more suitable objection function by adding various kinds of constraint components, which provides some helpful clues for the optimal threshold value searching. Another kind of improved algorithms does preprocessing or postprocessing either on the input image or on its histogram instead of directly modifying the objection function, which, as a matter of fact, is a hybrid technology. In the following sections, experiments will be conducted to compare the performance of each algorithm introduced above.


## 3. Performance Analysis of Otsu-Based Thresholding Methods

In this section, the performance of each Otsu-based algorithm will be evaluated. All experiments are implemented using Matlab R2012b on a PC with Windows 7. The experiments are conducted on two kinds of images which are synthetic images and real world images. The following influenced factors will be discussed on synthetic images and real world images:(1)
Variance and Distance between Mean Values of Foreground and Background. We will generate different synthetic images whose pixel intensity distributions of foreground and background are approximately normal distribution, and the effect of variance and distance between mean values will be discussed(2)
The Ratio of Foreground Object in the Whole Image. The foreground object size is another important factor that will influence the thresholding results. Images with different foreground ratios will be generated and used to study the effect of foreground ratio on segmentation results(3)
Image corruption noises including Salt&Pepper noise and Gaussian noise are applied to test the robustness of each algorithm


### 3.1. Testing on Synthetic Images

In this section, we will study the relationship between algorithms’ performance and variances and distance of mean values of foreground and background. The segmentation ratio measurement is adopted as the evaluation metric [34], which is defined as:
(13)ζ=no.ofsegmentedobjectpixelno.oftrueobjectpixel.From the definition, it is obvious that if the segmentation is completely correct, the segmentation ratio will be 1, other values are corresponding to under segmentationζ<1 and oversegmentation ζ<1, respectively.To study the first two items of the above three affecting factors, we generate appropriate images using different parameters. The intensities of foreground and background of the generated images are all approximately normally distributed as follows:(14)Ix,y∼Nμ1,σ12,Ix,y∈background,Ix,y∼Nμ2,σ22,Ix,y∈foreground,where μ1,μ2 are mean values of background and foreground, and σ12,σ22 denote their respective variances. For an image with m rows and n columns, we denote the ratio of foreground object in the whole image as γ, which is defined as:
(15)γ=no.offoregroundpixelm∗n.Figure2 shows the binarization results of each algorithm on two synthetic images with different parameters. The foreground ratios of the two images are both 20%, and the variances of foreground and background are fixed as 10. The first synthetic image is almost bimodal, and the foreground and background distributions of the second synthetic image are significantly overlapped. From Figure 2, we can see that most methods obtain good segmentation results on the first synthetic image except Xing’s, Xu’s, and Yang’s. However, the segmentation results become worse on the second synthetic image. The segmentation results indicate that the distance of mean values of foreground and background will significantly affect the algorithms’ performance, and more details will be discussed next.Figure 2
Segmentation results of each algorithm on synthetic images. (a) and (l) are synthetic images using different parameters; (b) and (m) are histograms of (a) and (l), respectively; (c) and (n) are results of Otsu’s method; (d) and (o) are results of Cao’s method; (e) and (p) are results of VE; (f) and (q) are results of NVE; (g) and (r) are results of WOV; (h) and (s) are results of Xing’s method; (i) and (u) are results of Xu’s method; (j) and (v) are results of Hu’s method; (k) and (w) are results of Yang’s method.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)Figure3 demonstrates the relationship between ζ and η which is defined as formula (16), where η represents the distance between mean values of foreground and background. The trend is obvious that a small η will result in a larger segmentation ratio and lead to a more serious over-segmentation as shown in Figure 2. Combining the results of Figures 2 and 3, we conclude that distance between foreground and background is an import factor that affects the segmentation results. Among all the compared algorithms, Xing’s method seems more robust, and VE is the most influenced scheme.
(16)η=μ2−μ1.Figure 3
Relationship between segmentation ratio and distance between mean values of foreground and background.To test the influence of foreground object size, we further conduct experiments to verify the performance of algorithms on synthetic images with different foreground ratioγ defined as formula (13). Through this experiment, we fix μ1=30,μ2=150 and σ12=σ22=10. Figure 4 shows the segmentation ratio of each algorithm on four synthetic images with foreground ratio ranging from 0.2 to 0.8 with step length of 0.2. From Figure 4, we can see that the segmentation ratio of most algorithms except Xing’s and Xu’s methods are stable, which means the foreground object ratio has little influence on the segmentation results. Xing’s and Xu’s methods tend to oversegment according to the value of ζ (where ζ>1 indicates oversegmentation as described above). However, the foreground seems to be properly segmented when γ is large enough, which may indicate that a larger foreground ratio seems to reduce the difficulty of the segmentation task.Figure 4
Segmentation ratio of each algorithm under different foreground ratio.In this part, synthetic images with different foreground variances are generated and tested to verify the influence of different foreground variances. The mean values of foreground and background are set asμ1=30,μ2=150, respectively, and the background variance is fixed as σ12=10. The generated images and their corresponding histograms are shown in Figure 5. As introduced above, the part of histogram corresponding to the background of each synthetic image is extremely similar to each other, and the part corresponding to the foreground becomes more flat as σ22 increases from 10 to 50.Figure 5
Synthetic images with different foreground variances, the first row is synthetic images, and second row is corresponding histograms.Table2 illustrates the threshold values of each algorithm on synthetic images as shown in Figure 5. From Table 2, we find that the threshold value increases as the foreground variance increases for most algorithms, which is consistent with the conclusion in Xu’s work that the threshold value tends to be close to the class with larger variance.Table 2
Threshold values of each algorithm on different synthetic images.
σ22OtsuCao’sVENVEWOVXing’sXu’sHu’sYang’s10929190929146369053209397888994453690543094988990941193790654096101969397443890855099106969610058399089Figure6 demonstrates the segmentation ratio of each method under different foreground variances on synthetic images. Although the foreground variance can influence the threshold value, it seems the segmentation ratio is not affected for most algorithms. One reason could be the distance between the mean values of foreground and background is large enough.Figure 6
Segmentation ratio of each algorithm under different foreground variance.


### 3.2. Testing on Real-World Images

In this section, common corruption factors are tested on a real world cell image dataset. The dataset is proposed by Xing et al. [22], which contains 22 cell images with manually labeled ground truth. Besides qualitatively evaluation, misclassification error (ME) is adopted as a quantitative evaluation metric which is defined as follows:
(17)ME=1−Fo∩FT+Bo∩BTBT+FT,where Fo and Bo are pixel sets of foreground and background segmented by automatic thresholding method, and FT, BT are manually labeled foreground and background pixel sets which serve as a ground truth.Table3 shows the average ME values of each algorithm on 22 cell images, from which we find that Xing’s method can reach the best average ME value. The advantage of Xing’s method on cell images can also be found in Figure 7. Xing’s method and WOV get absolute better segmentation results than other methods, especially on the second and third cell images. When the intensities of foreground object pixels change drastically as in the second and third cell images in Figure 7, foreground miss detection of most algorithms may become more serious.Table 3
Average ME of each method on all cell images.
MethodMEMethodMEMethodMEOtsu0.1639Cao’s0.1639VE0.1611NVE0.1626WOV0.2165Xing’s0.1457Xu’s0.2492Hu’s0.1659Yang’s0.1612Figure 7
Segmentation results of each algorithm on three cell images.Next, two kinds of noises are tested. First one is Salt&Pepper noise which is one of the most common noises. We test the influence of Salt&Pepper noise on each method on cell images. The ME values are calculated on original images and noise corrupted images with the noise intensity ranging from 0.1 to 0.7, and the relationship between average ME value of each algorithm and noise intensity can be found in Figure8. It is obvious that all algorithms are significantly affected by Salt&Pepper noise, and the ME value grows almost linearly with increasing noise intensity δ. Since Salt&Pepper noise can be effectively removed by using median filter, it is necessary to add a filtering step before applying thresholding algorithms.Figure 8
Relationship between ME and noise intensityδ.Gaussian noise is another type of common noise. In this study, we evaluate the performance of all methods on Gaussian corrupted cell images. The mean value of Gaussian is always set to 0 in this section, and the variance changes from 0 to 0.1. Figure9 shows the relation curves between ME and δ2 of each algorithm. Unlike Salt&Pepper noise, the ME values grow quickly if we add Gaussian noise with a small variance. However, the influence of noise decreases rapidly with the increase of variance. Among all methods, Xu’s method performs best on Gaussian noise.Figure 9
Relationship between ME and noise varianceδ2.


### 3.3. Algorithm Time Cost Testing

In this section, we compare the time cost of all tested algorithms. Following the analysis method introduced in Xing’s study [22], it is not difficult for us to draw a conclusion that the time complexity of all test methods in this work is On, where n represents the number of pixels of the image. However, it is important to note that we need to pay attention to the influence of the characteristics of the Matlab language on algorithm time cost. Taking Hu’s method as an example, it is difficult to write the preprocessing step (defined as equation (9)) in matrix form, and this will result in an increase in algorithm’s execution time. To compare the actual execution time of each algorithm, we conduct experiments using Matlab R2012b on a PC with Intel Core 2.30 GHz CPU and 8.0 GB memory.Figure10 shows the relationship between the consuming time of each method and the image size, and the results are the average of ten runs. It is obvious that the consuming time of methods with no preprocessing and postprocessing changes slowly with increasing image size. On the other hand, Hu’s, Xu’s, and Yang’s methods consume more time than other methods, and this becomes increasing significant with the increase of image size. As each algorithm has the same time complexity, the significant difference in time cost is related to whether the implementation code meets the language characteristics of Matlab.Figure 10
Relationship between the consuming time of each algorithm and the image size.


## 3.1. Testing on Synthetic Images

In this section, we will study the relationship between algorithms’ performance and variances and distance of mean values of foreground and background. The segmentation ratio measurement is adopted as the evaluation metric [34], which is defined as:
(13)ζ=no.ofsegmentedobjectpixelno.oftrueobjectpixel.From the definition, it is obvious that if the segmentation is completely correct, the segmentation ratio will be 1, other values are corresponding to under segmentationζ<1 and oversegmentation ζ<1, respectively.To study the first two items of the above three affecting factors, we generate appropriate images using different parameters. The intensities of foreground and background of the generated images are all approximately normally distributed as follows:(14)Ix,y∼Nμ1,σ12,Ix,y∈background,Ix,y∼Nμ2,σ22,Ix,y∈foreground,where μ1,μ2 are mean values of background and foreground, and σ12,σ22 denote their respective variances. For an image with m rows and n columns, we denote the ratio of foreground object in the whole image as γ, which is defined as:
(15)γ=no.offoregroundpixelm∗n.Figure2 shows the binarization results of each algorithm on two synthetic images with different parameters. The foreground ratios of the two images are both 20%, and the variances of foreground and background are fixed as 10. The first synthetic image is almost bimodal, and the foreground and background distributions of the second synthetic image are significantly overlapped. From Figure 2, we can see that most methods obtain good segmentation results on the first synthetic image except Xing’s, Xu’s, and Yang’s. However, the segmentation results become worse on the second synthetic image. The segmentation results indicate that the distance of mean values of foreground and background will significantly affect the algorithms’ performance, and more details will be discussed next.Figure 2
Segmentation results of each algorithm on synthetic images. (a) and (l) are synthetic images using different parameters; (b) and (m) are histograms of (a) and (l), respectively; (c) and (n) are results of Otsu’s method; (d) and (o) are results of Cao’s method; (e) and (p) are results of VE; (f) and (q) are results of NVE; (g) and (r) are results of WOV; (h) and (s) are results of Xing’s method; (i) and (u) are results of Xu’s method; (j) and (v) are results of Hu’s method; (k) and (w) are results of Yang’s method.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)Figure3 demonstrates the relationship between ζ and η which is defined as formula (16), where η represents the distance between mean values of foreground and background. The trend is obvious that a small η will result in a larger segmentation ratio and lead to a more serious over-segmentation as shown in Figure 2. Combining the results of Figures 2 and 3, we conclude that distance between foreground and background is an import factor that affects the segmentation results. Among all the compared algorithms, Xing’s method seems more robust, and VE is the most influenced scheme.
(16)η=μ2−μ1.Figure 3
Relationship between segmentation ratio and distance between mean values of foreground and background.To test the influence of foreground object size, we further conduct experiments to verify the performance of algorithms on synthetic images with different foreground ratioγ defined as formula (13). Through this experiment, we fix μ1=30,μ2=150 and σ12=σ22=10. Figure 4 shows the segmentation ratio of each algorithm on four synthetic images with foreground ratio ranging from 0.2 to 0.8 with step length of 0.2. From Figure 4, we can see that the segmentation ratio of most algorithms except Xing’s and Xu’s methods are stable, which means the foreground object ratio has little influence on the segmentation results. Xing’s and Xu’s methods tend to oversegment according to the value of ζ (where ζ>1 indicates oversegmentation as described above). However, the foreground seems to be properly segmented when γ is large enough, which may indicate that a larger foreground ratio seems to reduce the difficulty of the segmentation task.Figure 4
Segmentation ratio of each algorithm under different foreground ratio.In this part, synthetic images with different foreground variances are generated and tested to verify the influence of different foreground variances. The mean values of foreground and background are set asμ1=30,μ2=150, respectively, and the background variance is fixed as σ12=10. The generated images and their corresponding histograms are shown in Figure 5. As introduced above, the part of histogram corresponding to the background of each synthetic image is extremely similar to each other, and the part corresponding to the foreground becomes more flat as σ22 increases from 10 to 50.Figure 5
Synthetic images with different foreground variances, the first row is synthetic images, and second row is corresponding histograms.Table2 illustrates the threshold values of each algorithm on synthetic images as shown in Figure 5. From Table 2, we find that the threshold value increases as the foreground variance increases for most algorithms, which is consistent with the conclusion in Xu’s work that the threshold value tends to be close to the class with larger variance.Table 2
Threshold values of each algorithm on different synthetic images.
σ22OtsuCao’sVENVEWOVXing’sXu’sHu’sYang’s10929190929146369053209397888994453690543094988990941193790654096101969397443890855099106969610058399089Figure6 demonstrates the segmentation ratio of each method under different foreground variances on synthetic images. Although the foreground variance can influence the threshold value, it seems the segmentation ratio is not affected for most algorithms. One reason could be the distance between the mean values of foreground and background is large enough.Figure 6
Segmentation ratio of each algorithm under different foreground variance.


## 3.2. Testing on Real-World Images

In this section, common corruption factors are tested on a real world cell image dataset. The dataset is proposed by Xing et al. [22], which contains 22 cell images with manually labeled ground truth. Besides qualitatively evaluation, misclassification error (ME) is adopted as a quantitative evaluation metric which is defined as follows:
(17)ME=1−Fo∩FT+Bo∩BTBT+FT,where Fo and Bo are pixel sets of foreground and background segmented by automatic thresholding method, and FT, BT are manually labeled foreground and background pixel sets which serve as a ground truth.Table3 shows the average ME values of each algorithm on 22 cell images, from which we find that Xing’s method can reach the best average ME value. The advantage of Xing’s method on cell images can also be found in Figure 7. Xing’s method and WOV get absolute better segmentation results than other methods, especially on the second and third cell images. When the intensities of foreground object pixels change drastically as in the second and third cell images in Figure 7, foreground miss detection of most algorithms may become more serious.Table 3
Average ME of each method on all cell images.
MethodMEMethodMEMethodMEOtsu0.1639Cao’s0.1639VE0.1611NVE0.1626WOV0.2165Xing’s0.1457Xu’s0.2492Hu’s0.1659Yang’s0.1612Figure 7
Segmentation results of each algorithm on three cell images.Next, two kinds of noises are tested. First one is Salt&Pepper noise which is one of the most common noises. We test the influence of Salt&Pepper noise on each method on cell images. The ME values are calculated on original images and noise corrupted images with the noise intensity ranging from 0.1 to 0.7, and the relationship between average ME value of each algorithm and noise intensity can be found in Figure8. It is obvious that all algorithms are significantly affected by Salt&Pepper noise, and the ME value grows almost linearly with increasing noise intensity δ. Since Salt&Pepper noise can be effectively removed by using median filter, it is necessary to add a filtering step before applying thresholding algorithms.Figure 8
Relationship between ME and noise intensityδ.Gaussian noise is another type of common noise. In this study, we evaluate the performance of all methods on Gaussian corrupted cell images. The mean value of Gaussian is always set to 0 in this section, and the variance changes from 0 to 0.1. Figure9 shows the relation curves between ME and δ2 of each algorithm. Unlike Salt&Pepper noise, the ME values grow quickly if we add Gaussian noise with a small variance. However, the influence of noise decreases rapidly with the increase of variance. Among all methods, Xu’s method performs best on Gaussian noise.Figure 9
Relationship between ME and noise varianceδ2.


## 3.3. Algorithm Time Cost Testing

In this section, we compare the time cost of all tested algorithms. Following the analysis method introduced in Xing’s study [22], it is not difficult for us to draw a conclusion that the time complexity of all test methods in this work is On, where n represents the number of pixels of the image. However, it is important to note that we need to pay attention to the influence of the characteristics of the Matlab language on algorithm time cost. Taking Hu’s method as an example, it is difficult to write the preprocessing step (defined as equation (9)) in matrix form, and this will result in an increase in algorithm’s execution time. To compare the actual execution time of each algorithm, we conduct experiments using Matlab R2012b on a PC with Intel Core 2.30 GHz CPU and 8.0 GB memory.Figure10 shows the relationship between the consuming time of each method and the image size, and the results are the average of ten runs. It is obvious that the consuming time of methods with no preprocessing and postprocessing changes slowly with increasing image size. On the other hand, Hu’s, Xu’s, and Yang’s methods consume more time than other methods, and this becomes increasing significant with the increase of image size. As each algorithm has the same time complexity, the significant difference in time cost is related to whether the implementation code meets the language characteristics of Matlab.Figure 10
Relationship between the consuming time of each algorithm and the image size.


## 4. Conclusion

In this study, the performance of nine Otsu-based thresholding algorithms is analyzed. Experiments on synthetic images indicate that the distance between the mean values of foreground and backgroundη can significantly affect the algorithms’ performance. Among the discussed algorithms above, NVE, WOV, and Xing’s methods are more robust to η. The variance of foreground can also affect the threshold and the segmentation result. The threshold value of almost all Otsu-based algorithms tends to increase when the foreground variance increases. Experimental results on cell images indicate that foreground miss detection becomes serious when the intensity of foreground pixels changes drastically, and all the nine algorithms are not robust enough to both Salt&Pepper and Gaussian noises. In addition, preprocessing or postprocessing steps which do not meet the language characteristics will significantly increase algorithm’s consuming time when implementing the algorithms by Matlab. These facts can serve as a guideline for Otsu-based thresholding applications in the future.



---

*Source: 4896853-2021-10-21.xml*