# Minimum Error Thresholding Segmentation Algorithm Based on 3D Grayscale Histogram

Authors: Jin Liu; Jianhong Zheng; Quanhua Tang; Weidong Jin
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

Threshold segmentation is a very important technique. The existing threshold algorithms do not work efficiently for noisy grayscale images. This paper proposes a novel algorithm called three-dimensional minimum error thresholding (3D-MET), which is used to solve the problem. The proposed approach is implemented by an optimal threshold discriminant based on the relative entropy theory and the 3D histogram. The histogram is comprised of gray distribution information of pixels and relevant information of neighboring pixels in an image. Moreover, a fast recursive method is proposed to reduce the time complexity of 3D-MET fromO
(
L
6
) to O
(
L
3
), where L stands for gray levels. Experimental results demonstrate that the proposed approach can provide superior segmentation performance compared to other methods for gray image segmentation.


---

## Body

## 1. Introduction

Image segmentation is an essential procedure to analyze the image structure as other processing steps heavily depend on its results, and a wide variety of segmentation techniques have been reported in the last two decades. Some of its applications relate to many fields, such as medical imaging [1, 2], document analysis [3, 4], object recognition [5], and SAR segmentation and quality inspection of materials [6].Image thresholding based on gray level histogram information is an important technique for image segmentation. Most techniques can be roughly categorized into two groups: global thresholding and local thresholding. The former means the process of a whole image with only one threshold, while the latter means that one separates an image into several subimages and then handles each subimage with a selected threshold. Global thresholding is a nonparametric, unsupervised, and self-adapting method. Although the method appears to be simplistic, it is very important and fundamental with wide applicability [7–9]. The classic global thresholding methods are maximum between-cluster variance (Otsu) [10], minimum error thresholding (MET) [11], and maximum entropy method [12]. In [11], appropriate thresholds are selected by a minimum error criterion. This criterion is designed to minimize the classification error probability based on the assumption that histograms are governed by a mixture of Gaussian densities. Its essence is to consider image binarization as a Gaussian distribution fitting problem. In [13], a survey over 40 thresholding techniques by Mehmet Sezgin and Bülent Sankur shows that MET is the best performing thresholding algorithm.Noticeably, all 1D thresholding algorithms only utilize 1D histogram of an image, which only represents the grey-level distribution of the image. Its performance degrades immensely when the difference of grey-level distribution between objects and background is inconspicuous; namely, its segmentation capability significantly degrades when the image is corrupted by strong noise. Therefore many 2D thresholding approaches which employ point pixel information and the local average grey level of the neighbourhood pixels have been proposed in [14–16]. These methods show satisfactory results for Gaussian noise images. However, they are almost useless if the image is degraded with other types of noise or the mixed noise [17].Actually, the more information contained in the image can be utilized to obtain a better segmentation. Studies have shown that the mean filter tends to curb the Gaussian noise, and median filter tends to curb the salt-and-pepper noise. Therefore, in this paper we propose a new algorithm called three-dimensional minimum error threshold (3D-MET), which employs point pixel information, the local average grey level, and median gray level of the neighborhood pixels, to cope with the problem of threshold segmentation for mixed noise image. So, here the “3D” refers to 3 parametric dimensions (pixel gray level, area mean gray level, and area median gray level) instead of 3 spacial dimensions, and threshold is applied along each parametric dimension separately. The choice of the thresholds along the three parametric dimensions is made by finding the threshold triplet that globally optimizes a given criterion. The basic idea of the proposed algorithm is to take into consideration more adequately spatial correlation between image pixels and image segmentation so as to reduce the impact of noise.This paper is organized as follows. In Section2, the 3D histogram is defined. Section 3 gives a detailed description of the proposed 3D-MET. Section 4 describes the fast recursive method of 3D-MET. The experiment results are discussed in Section 5 and Section 6 gives the concluding remarks of this work.


## 2. 3D Histogram

Let the pixels of a given image be represented inL gray levels [
0
,
1
,
…
,
L
-
1
]. The number of pixels at level i is defined by n
i and the total number of pixels by N
=
n
1
+
n
2
+
⋯
+
n
L. Now assume the grey level value at coordinate (x
,
y) in the image is defined by F
(
x
,
y
). The average gray level and median gray level in K
×
K neighborhood of the F
(
x
,
y
) can be defined by G
(
x
,
y
) and H
(
x
,
y
), respectively:
(1)
G
(
x
,
y
)
=
1
K
×
K
∑
i
=
-
(
K
-
1
)
/
2
(
K
-
1
)
/
2
∑
j
=
-
(
K
-
1
)
/
2
(
K
-
1
)
/
2
F
(
x
+
i
,
y
+
j
)
,
H
(
x
,
y
)
=
Med
{
∑
i
=
-
(
K
-
1
)
/
2
(
K
-
1
)
/
2
∑
j
=
-
(
K
-
1
)
/
2
(
K
-
1
)
/
2
F
(
x
+
i
,
y
+
j
)
}
,
where K is neighborhood size and usually takes an odd number. Since 0
≤
F
(
x
,
y
)
≤
L
-
1, it follows that 0
≤
G
(
x
,
y
)
≤
L
-
1, 0
≤
H
(
x
,
y
)
≤
L
-
1.Suppose the frequency of the three-element set (i
,
j
,
k) composed of F
(
x
,
y
), G
(
x
,
y
), and H
(
x
,
y
) is f
i
j
k; then the joint probability density is defined as p
i
j
k:
(2)
p
i
j
k
=
f
i
j
k
N
,
i
,
j
,
k
=
0
,
1
,
2
,
…
,
L
-
1
.The distribution ofp
i
j
k can be summarized in a form of 3D histogram. p
i
j
k is defined as the value of one point in 3D histogram, which represents the probability of the (i
,
j
,
k). The domain of the 3D histogram is shown in Figure 1(a). Assume that the optimal threshold (s
,
t
,
q) divided the 3D histogram into eight subblocks, numbered 0 through 7, respectively, as shown in Figures 1(b) and 1(c). Generally, the gray level of pixels within an object and background region is symmetrical. This means that the probability of object and background almost always happens near the main diagonal of 3D histogram, whereas those off-diagonal subblocks contain the distributions of the edges and noise. Therefore, subblocks 0 and 1 denote the background and object, respectively, while the others, numbered 2 through 7, denote edges and noise. Conventionally we can suppose reasonably that object and background regions hold the absolute majority of 3D histogram; that is to say, the probability of off-diagonal subblocks is nearly zero; that is,
(3)
∑
B
p
i
j
k
≈
0
,
0
≤
i
,
j
,
k
≤
L
-
1
,
B
=
2
,
3
,
…
,
7
.Three-dimensional histogram.
(a)
Domain of 3D histogram
(b)
Threshold (s
,
t
,
q)
(c)
Eight areas zoning by (s
,
t
,
q)


## 3. 3D Minimum Error Thresholding (3D-MET)

The 3D histogram defined above can be viewed as an estimate of the probability density functionP
i
,
j
,
k
′ of the mixture population:
(4)
P
i
,
j
,
k
′
=
P
0
(
s
,
t
,
q
)
p
(
i
,
j
,
k
∣
0
)
+
P
1
(
s
,
t
,
q
)
p
(
i
,
j
,
k
∣
1
)
,
where P
0
(
s
,
t
,
q
) and P
1
(
s
,
t
,
q
) are prior probability of object and background. p
(
i
,
j
,
k
∣
0
) and  p
(
i
,
j
,
k
∣
1
) are 3D normally distributed with mean μ
1, μ
2, and μ
3, which satisfy
(5)
p
(
i
,
j
,
k
)
=
1
(
2
π
)
3
/
2
|
Σ
|
×
exp
[
-
1
2
(
i
-
μ
1
j
-
μ
2
k
-
μ
3
)
T
Σ
-
1
(
i
-
μ
1
j
-
μ
2
k
-
μ
3
)
]
,
where Σ is the covariance matrix.Now suppose that we dichotomize the pixels into two classesC
0 and C
1 (background and objects or vice versa) by an optimal threshold (s
,
t
,
q). s, t, and q are the segmentation thresholds corresponding to the original image, the mean filtered image, and the median filtered image, respectively. The probabilities of C
0 and C
1 are given by
(6)
P
0
=
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
p
i
j
k
=
P
0
(
s
,
t
,
q
)
,
P
1
=
∑
i
=
s
+
1
l
-
1
∑
j
=
t
+
1
l
-
1
∑
k
=
q
+
1
l
-
1
p
i
j
k
=
P
1
(
s
,
t
,
q
)
and the corresponding class mean levels and variances of C
0 and C
1 are
(7)
μ
0
=
(
μ
0
i
(
s
,
t
,
q
)
,
μ
0
j
(
s
,
t
,
q
)
,
μ
0
k
(
s
,
t
,
q
)
)
T
=
(
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
i
p
i
j
k
P
0
,
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
j
p
i
j
k
P
0
,
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
k
p
i
j
k
P
0
)
T
,
(8)
μ
1
=
(
μ
1
i
(
s
,
t
,
q
)
,
μ
1
j
(
s
,
t
,
q
)
,
μ
1
k
(
s
,
t
,
q
)
)
T
=
(
∑
i
=
s
+
1
L
-
1
∑
j
=
t
+
1
L
-
1
∑
k
=
q
+
1
L
-
1
i
p
i
j
k
P
1
,
∑
i
=
s
+
1
L
-
1
∑
j
=
t
+
1
L
-
1
∑
k
=
q
+
1
L
-
1
j
p
i
j
k
P
1
,
∑
i
=
s
+
1
L
-
1
∑
j
=
t
+
1
L
-
1
∑
k
=
q
+
1
L
-
1
k
p
i
j
k
P
1
)
T
,
(9)
σ
0
2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μ
1
j
(
s
,
t
,
q
)
)
h
h
h
h
h
h
h
h
h
×
(
k
-
μ
1
k
(
s
,
t
,
q
)
)
p
i
j
k
]
∑
i
=
s
+
1
L
-
1

)
h
×
(
P
1
(
s
,
t
,
q
)
)
-
1
∑
i
=
s
+
1
L
-
1

)
×
(
σ
1
j
(
s
,
t
,
q
)
σ
1
k
(
s
,
t
,
q
)
)
-
1
.
The total mean level vector of the 3D histogram is
(17)
μ
=
(
μ
i
,
μ
j
,
μ
k
)
T
=
(
∑
i
=
0
L
-
1
∑
j
=
0
L
-
1
∑
k
=
0
L
-
1
i
p
i
j
k
,
∑
i
=
0
L
-
1
∑
j
=
0
L
-
1
∑
k
=
0
L
-
1
j
p
i
j
k
,
∑
i
=
0
L
-
1
∑
j
=
0
L
-
1
∑
k
=
0
L
-
1
k
p
i
j
k
)
T
.In the following, we introduce the relative entropy theory proposed in [18], which is used to measure the disparity between two distributions. The smallest value of relative entropy means the least disparity. So, we can use relative entropy to calculate the disparity between 3D histogram p
i
j
k and the mixture probability P
i
,
j
,
k
′; that is,
(18)
R
(
s
,
t
,
q
)
=
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
p
i
j
k
ln
p
i
j
k
P
0
p
(
i
,
j
,
k
∣
0
)
+
∑
i
=
s
+
1
L
-
1
∑
j
=
t
+
1
L
-
1
∑
k
=
q
+
1
L
-
1
p
i
j
k
ln
p
i
j
k
P
1
p
(
i
,
j
,
k
∣
1
)
.R
(
s
,
t
,
q
) can be simplified and rewritten as W
(
s
,
t
,
q
) (see proof of the statement in the appendix), as shown in
(19)
W
(
s
,
t
,
q
)
=
P
0
(
s
,
t
,
q
)
ln
σ
0
i
σ
0
j
σ
0
k
+
P
1
(
s
,
t
,
q
)
ln
σ
1
i
σ
1
j
σ
1
k
-
P
0
(
s
,
t
,
q
)
ln
P
0
(
s
,
t
,
q
)
-
P
1
(
s
,
t
,
q
)
ln
P
1
(
s
,
t
,
q
)
.Equation (19) is the criterion function of the proposed 3D-MET. The value of the threshold (
s
,
t
,
q
) yielding the lowest value of criterion W
(
s
,
t
,
q
) will give the best fit model and therefore the optimum minimum error threshold (
s
*
,
t
*
,
q
*
); that is,
(20)
(
s
*
,
t
*
,
q
*
)
=
arg
min
0
≤
s
,
t
,
q
≤
L
-
1
W
(
s
,
t
,
q
)
.


## 4. Fast Recursive Implementation of the 3D-MET

The advocated 3D-MET searches the optimum threshold exhaustively in 3D space, and each search has to start from (0,0,0). It is clear that this exhaustive search for the threshold vector(
s
*
,
t
*
,
q
*
) that satisfies (20) is time consuming. In order to compute the value of each (
s
,
t
,
q
), its computation time is O
(
L
3
). To find out the lowest value of (
s
,
t
,
q
), the count of (
s
,
t
,
q
) that we must compute is L
3. So the total computation time for threshold is O
(
L
6
). In the following we propose a fast recursive method for 3D-MET to reduce its algorithm complexity. The method can be briefly stated as follows.Step 1.
Denote the zeroth-order cumulative moments of the 3D histogram byP
0, the first-order cumulative moments by X
1, Y
1, and Z
1, and second-order cumulative moments by X
2, Y
2, and Z
2; that is,
(21)
P
0
=
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
p
i
j
k
,
X
1
=
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
i
p
i
j
k
,
Y
1
=
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
j
p
i
j
k
,
Z
1
=
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
k
p
i
j
k
,
X
2
=
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
i
2
p
i
j
k
,
Y
2
=
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
j
2
p
i
j
k
,
Z
2
=
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
k
2
p
i
j
k
.Step 2.
Represent each component of mean levels and variances in (7) through (10) as a function of P
0, X
1,Y
1, Z
1, X
2, Y
2, or Z
2:
(22)
μ
0
i
(
s
,
t
,
q
)
=
∑
i
=
0
s
∑
j
=
0
t
∑
k
=
0
q
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
-
1
,
r
)
+
X
2
(
m
,
n
,
r
-
1
)
-
X
2
(
m
-
1
,
n
-
1
,
r
)
-
X
2
(
m
,
n
-
1
,
r
-
1
)
-
X
2
(
m
-
1
,
n
,
r
-
1
)
+
X
2
(
m
-
1
,
n
-
1
,
r
-
1
)
+
m
2
×
P
m
n
r
,
Y
2
(
m
,
n
,
r
)
=
Y
2
(
m
-
1
,
n
,
r
)
+
Y
2
(
m
,
n
-
1
,
r
)
+
Y
2
(
m
,
n
,
r
-
1
)
-
Y
2
(
m
-
1
,
n
-
1
,
r
)
-
Y
2
(
m
,
n
-
1
,
r
-
1
)
-
Y
2
(
m
-
1
,
n
,
r
-
1
)
+
Y
2
(
m
-
1
,
n
-
1
,
r
-
1
)
+
n
2
×
P
m
n
r
,
Z
2
(
m
,
n
,
r
)
=
Z
2
(
m
-
1
,
n
,
r
)
+
Z
2
(
m
,
n
-
1
,
r
)
+
Z
2
(
m
,
n
,
r
-
1
)
-
Z
2
(
m
-
1
,
n
-
1
,
r
)
-
Z
2
(
m
,
n
-
1
,
r
-
1
)
-
Z
2
(
m
-
1
,
n
,
r
-
1
)
+
Z
2
(
m
-
1
,
n
-
1
,
r
-
1
)
+
r
2
×
P
m
n
r
.Step 5.
For each recursive result in Step4, calculate once (19), until finding out the threshold (m
,
n
,
r) which minimizes W
(
s
,
t
,
q
).
While calculating the probabilities of class occurrence and variances of (s
,
t
,
q) in Step 4, the accumulation of frequencies is obtained by summing up only several datum terms. Therefore for each (s
,
t
,
q), the computation complexity is decreased from O
(
L
3
) to O
(
L
0
), and the computation complexity of 3D-MET is decreased from O
(
L
6
) to O
(
L
3
).


## 5. Experimental Results and Discussion

Experiments are implemented in Visual C++ 6.0 language under a personal computer with microdevices (Intel Core 2 Duo) 1.83 GHz CPU, 1 G RAM in Windows XP system. Test images are two synthetic aperture radar (SAR) images and two license plate images. Performance is compared in segmentation quality and algorithm efficiency. In this section, the experimental results of our algorithm will be compared to 2D Otsu, 2D maximum entropy, and 2D-MET. For comparison purposes, all above algorithms are implemented recursively and the size of the neighborhood windowK is set to 3.


### 5.1. Segmentation Results of Different Noise Images

Figure2(a) is a SAR image with 2% Gaussian noise, named “SAR1.” The 1D histogram of SAR1 is unimodal. The absence of an internal minimum is indicative of a unimodal histogram, which would correspond to a homogeneous image, as shown in Figure 2(b). Figures 2(c) and 2(d) show the segmentation results of 2D Otsu and 2D maximum entropy. Obviously, neither 2D Otsu nor 2D maximum entropy gets meaningful results; namely, the river is not separated from test image. Figure 2(e) is the result of 2D-MET and it shows that the river is separated from the test image successfully, but its visual effect is not good as Figure 2(f). That is to say, 3D-MET obtains the best segmentation performance.The segmented results of SAR1.
(a)
SAR1
(b)
1D histogram of SAR1
(c)
2D Otsu
(d)
2D maximum entropy
(e)
2D-MET
(f)
Our methodFigure3(a) shows the other SAR image with 2% Gaussian noise and 2% salt-and-pepper noise. Due to the interference of mixed noise, the 1D histogram of SAR2 shown in Figure 3(b) is approximated as a normal distribution, and there is an extremely small peak near the coordinate origin. The gray distribution between the river and the land of the SAR2 has biggish diversity. For such kind of image, the goal of segmentation is to separate rivers from the image. Figures 3(c) and 3(d) show that neither 2D Otsu method nor 2D maximum entropy separates the river from background. Figure 3(e) is the result of 2D-MET with threshold (102, 93), which separates rivers from background successfully, but it cannot eliminate salt-and-pepper noise. Owing to the utilization of mean levels and median levels of the neighbourhood pixels, 3D-MET gets the best segmentation result. Figure 3(f) shows that 3D-MET not only separates rivers from background successfully but also eliminates the mixed noise effectively.The segmented results of SAR2.
(a)
SAR2
(b)
1D histogram of SAR2
(c)
2D Otsu
(d)
2D maximum entropy
(e)
2D-MET
(f)
Our method


### 5.2. Segmentation Results of Images Disturbed by Nonuniform Illumination

Figure4(a) is a poorly illuminated license plate image, named “License 1.” From Figures 4(c) and 4(d), we can see that 2D Otsu and 2D maximum entropy suffered from nonuniform illumination too much to separate the license number from background. Figures 4(e) and 4(f) are the results of 2D-MET and 3D-MET with thresholds (31, 47) and (53, 77, 61), respectively. Obviously, both of them separated the license number from background clearly. But the result of the latter is better than the former.The segmented results of License 1.
(a)
License 1
(b)
1D histogram of License 1
(c)
2D Otsu
(d)
2D maximum entropy
(e)
2D-MET
(f)
Our methodIn order to compare the performance of each thresholding in the mixed interference environment, Figure5(a) is the other license plate image influenced by nonuniform illumination and 2% salt-and-pepper noise, named “License 2.” Figure 5(b) is the 1D histogram of License 2. Figure 5(c) shows the worst result of 2D Otsu with threshold (71, 75). The 2D maximum entropy separated the numbers from the license plate, but it cannot effectively curb the noise in the image, as shown in Figure 5(d). Figures 5(e) and 5(f) show the results of 2D-MET and 3D-MET. Both of the METs completely separated the license numbers; moreover, the border of the license plate and the number “5” in the bottom right corner of the image are clearly separated. By comparing Figures 5(e) and 5(f), it is easy to see that 2D-MET also cannot curb the salt-and-pepper noise and the proposed 3D-MET curbed the noise very well and got the best segmentation performance.The segmented results of License 2.
(a)
License 2
(b)
1D histogram of License 2
(c)
2D Otsu
(d)
2D maximum entropy
(e)
2D-MET
(f)
Our method


### 5.3. Evaluation of Segmentation Quality

According to the availability of a segmented image reference, all evaluation criteria can be classified into two categories: supervised or unsupervised evaluation [19]. The 3D-MET proposed in this paper is a nonparametric and unsupervised method, and no reference segmented image is available. Therefore, three criteria belonging to unsupervised evaluation are used in this paper: interregion contrast (IRC), intraregion uniformity (IRU), and inter-intra-criterion (IIC). Based on these normalized criteria, the higher their values within 0 and 1, the better the segmentation.IRC and IRU introduced by Levine and Nazif are defined by the following expressions, respectively [20]:
(26)
IRC
=
∑
R
i
A
i
C
i
∑
R
i
A
i
,
IRU
=
1
-
2
(
N
-
1
)
A
(
g
max
-
g
min
)
2
∑
k
=
1
N
∑
i
∈
R
k
(
g
i
-
m
k
)
2
.IIC proposed by Rosenberger is the mean of IRC and IRU [21]. By using IIC, it will remove any irresolution during the comparison between two segmentations. The IIC is defined by the following expression:
(27)
IIC
=
IRC
+
IRU
2
.Table1 summarizes the results of the evaluation criteria obtained with different methods. We can see that the value of IIC is the highest with our method. A visual inspection shows that the discrimination between the regions is better ensured with our method. In addition, for License 1, the values of IRC and IRU of 2D Otsu are higher than those provided by 2D Maximum entropy, but for License 2 the positions are reversed.Table 1
Measures of the unsupervised evaluation criteria.
2D Otsu
2D maximum entropy
2D-MET
3D-MET
SAR1
IRC
0.375
0.43
0.617
0.662
IRU
0.671
0.715
0.977
0.993
IIC
0.523
0.573
0.797
0.828
SAR2
IRC
0.358
0.418
0.589
0.671
IRU
0.629
0.694
0.898
0.989
IIC
0.494
0.524
0.744
0.83
License 1
IRC
0.427
0.323
0.603
0.615
IRU
0.751
0.573
0.937
0.991
IIC
0.589
0.448
0.77
0.803
License 2
IRC
0.311
0.512
0.581
0.631
IRU
0.341
0.764
0.881
0.988
IIC
0.336
0.638
0.731
0.81


### 5.4. Comparison of Algorithm Efficiency

In the following we compare the thresholds and computation time of each algorithm for the above four images. In this paper, the resolution of SAR1, SAR2, License 1, and License 2 is 486 × 411, 771 × 740, 293 × 250, and 272 × 133, respectively. The gray level of all test images is 256. The detected thresholds and computation time of the algorithms are reported in Table2. The segmentation performance of the 3D-MET is much better than others, but its recursive search in a 3D space costs more time than the 2D thresholding, as shown in Table 2. For most applications, the proposed method is competent in practical engineering. And for the large SAR images or remote sensing images, the process takes a longer time and it is not suitable for real-time systems.Table 2
Comparison of thresholds and time cost (second).
2D Otsu
2D maximum entropy
2D-MET
3D-MET
Threshold
Time
Threshold
Time
Threshold
Time
Threshold
Time
SAR1
(106, 127)
1.45
(89, 134)
2.18
(45, 68)
2.36
(92, 124, 113)
3.71
SAR2
(166, 202)
3.95
(202, 192)
4.64
(102, 93)
4.46
(109, 102, 152)
9.42
License 1
(103, 217)
0.36
(205, 108)
1.38
(31, 47)
1.41
(53, 77, 61)
2.67
License 2
(71, 75)
0.40
(131, 133)
1.59
(42, 48)
1.68
(63, 57, 91)
3.18Table3 shows the space cost of 3D-MET in different gray levels. The space size is in relation to the count of the gray level. The recursive implementation of 3D-MET needs to store additional four lookup tables, but this is only a small overhead relative to nowadays’ computer memory.Table 3
Space cost (byte).
Grayscale
64
128
256
512
1024
Space cost
5
×
64
3
5
×
128
3
5
×
256
3
5
×
512
3
5
×
1024
3


## 5.1. Segmentation Results of Different Noise Images

Figure2(a) is a SAR image with 2% Gaussian noise, named “SAR1.” The 1D histogram of SAR1 is unimodal. The absence of an internal minimum is indicative of a unimodal histogram, which would correspond to a homogeneous image, as shown in Figure 2(b). Figures 2(c) and 2(d) show the segmentation results of 2D Otsu and 2D maximum entropy. Obviously, neither 2D Otsu nor 2D maximum entropy gets meaningful results; namely, the river is not separated from test image. Figure 2(e) is the result of 2D-MET and it shows that the river is separated from the test image successfully, but its visual effect is not good as Figure 2(f). That is to say, 3D-MET obtains the best segmentation performance.The segmented results of SAR1.
(a)
SAR1
(b)
1D histogram of SAR1
(c)
2D Otsu
(d)
2D maximum entropy
(e)
2D-MET
(f)
Our methodFigure3(a) shows the other SAR image with 2% Gaussian noise and 2% salt-and-pepper noise. Due to the interference of mixed noise, the 1D histogram of SAR2 shown in Figure 3(b) is approximated as a normal distribution, and there is an extremely small peak near the coordinate origin. The gray distribution between the river and the land of the SAR2 has biggish diversity. For such kind of image, the goal of segmentation is to separate rivers from the image. Figures 3(c) and 3(d) show that neither 2D Otsu method nor 2D maximum entropy separates the river from background. Figure 3(e) is the result of 2D-MET with threshold (102, 93), which separates rivers from background successfully, but it cannot eliminate salt-and-pepper noise. Owing to the utilization of mean levels and median levels of the neighbourhood pixels, 3D-MET gets the best segmentation result. Figure 3(f) shows that 3D-MET not only separates rivers from background successfully but also eliminates the mixed noise effectively.The segmented results of SAR2.
(a)
SAR2
(b)
1D histogram of SAR2
(c)
2D Otsu
(d)
2D maximum entropy
(e)
2D-MET
(f)
Our method


## 5.2. Segmentation Results of Images Disturbed by Nonuniform Illumination

Figure4(a) is a poorly illuminated license plate image, named “License 1.” From Figures 4(c) and 4(d), we can see that 2D Otsu and 2D maximum entropy suffered from nonuniform illumination too much to separate the license number from background. Figures 4(e) and 4(f) are the results of 2D-MET and 3D-MET with thresholds (31, 47) and (53, 77, 61), respectively. Obviously, both of them separated the license number from background clearly. But the result of the latter is better than the former.The segmented results of License 1.
(a)
License 1
(b)
1D histogram of License 1
(c)
2D Otsu
(d)
2D maximum entropy
(e)
2D-MET
(f)
Our methodIn order to compare the performance of each thresholding in the mixed interference environment, Figure5(a) is the other license plate image influenced by nonuniform illumination and 2% salt-and-pepper noise, named “License 2.” Figure 5(b) is the 1D histogram of License 2. Figure 5(c) shows the worst result of 2D Otsu with threshold (71, 75). The 2D maximum entropy separated the numbers from the license plate, but it cannot effectively curb the noise in the image, as shown in Figure 5(d). Figures 5(e) and 5(f) show the results of 2D-MET and 3D-MET. Both of the METs completely separated the license numbers; moreover, the border of the license plate and the number “5” in the bottom right corner of the image are clearly separated. By comparing Figures 5(e) and 5(f), it is easy to see that 2D-MET also cannot curb the salt-and-pepper noise and the proposed 3D-MET curbed the noise very well and got the best segmentation performance.The segmented results of License 2.
(a)
License 2
(b)
1D histogram of License 2
(c)
2D Otsu
(d)
2D maximum entropy
(e)
2D-MET
(f)
Our method


## 5.3. Evaluation of Segmentation Quality

According to the availability of a segmented image reference, all evaluation criteria can be classified into two categories: supervised or unsupervised evaluation [19]. The 3D-MET proposed in this paper is a nonparametric and unsupervised method, and no reference segmented image is available. Therefore, three criteria belonging to unsupervised evaluation are used in this paper: interregion contrast (IRC), intraregion uniformity (IRU), and inter-intra-criterion (IIC). Based on these normalized criteria, the higher their values within 0 and 1, the better the segmentation.IRC and IRU introduced by Levine and Nazif are defined by the following expressions, respectively [20]:
(26)
IRC
=
∑
R
i
A
i
C
i
∑
R
i
A
i
,
IRU
=
1
-
2
(
N
-
1
)
A
(
g
max
-
g
min
)
2
∑
k
=
1
N
∑
i
∈
R
k
(
g
i
-
m
k
)
2
.IIC proposed by Rosenberger is the mean of IRC and IRU [21]. By using IIC, it will remove any irresolution during the comparison between two segmentations. The IIC is defined by the following expression:
(27)
IIC
=
IRC
+
IRU
2
.Table1 summarizes the results of the evaluation criteria obtained with different methods. We can see that the value of IIC is the highest with our method. A visual inspection shows that the discrimination between the regions is better ensured with our method. In addition, for License 1, the values of IRC and IRU of 2D Otsu are higher than those provided by 2D Maximum entropy, but for License 2 the positions are reversed.Table 1
Measures of the unsupervised evaluation criteria.
2D Otsu
2D maximum entropy
2D-MET
3D-MET
SAR1
IRC
0.375
0.43
0.617
0.662
IRU
0.671
0.715
0.977
0.993
IIC
0.523
0.573
0.797
0.828
SAR2
IRC
0.358
0.418
0.589
0.671
IRU
0.629
0.694
0.898
0.989
IIC
0.494
0.524
0.744
0.83
License 1
IRC
0.427
0.323
0.603
0.615
IRU
0.751
0.573
0.937
0.991
IIC
0.589
0.448
0.77
0.803
License 2
IRC
0.311
0.512
0.581
0.631
IRU
0.341
0.764
0.881
0.988
IIC
0.336
0.638
0.731
0.81


## 5.4. Comparison of Algorithm Efficiency

In the following we compare the thresholds and computation time of each algorithm for the above four images. In this paper, the resolution of SAR1, SAR2, License 1, and License 2 is 486 × 411, 771 × 740, 293 × 250, and 272 × 133, respectively. The gray level of all test images is 256. The detected thresholds and computation time of the algorithms are reported in Table2. The segmentation performance of the 3D-MET is much better than others, but its recursive search in a 3D space costs more time than the 2D thresholding, as shown in Table 2. For most applications, the proposed method is competent in practical engineering. And for the large SAR images or remote sensing images, the process takes a longer time and it is not suitable for real-time systems.Table 2
Comparison of thresholds and time cost (second).
2D Otsu
2D maximum entropy
2D-MET
3D-MET
Threshold
Time
Threshold
Time
Threshold
Time
Threshold
Time
SAR1
(106, 127)
1.45
(89, 134)
2.18
(45, 68)
2.36
(92, 124, 113)
3.71
SAR2
(166, 202)
3.95
(202, 192)
4.64
(102, 93)
4.46
(109, 102, 152)
9.42
License 1
(103, 217)
0.36
(205, 108)
1.38
(31, 47)
1.41
(53, 77, 61)
2.67
License 2
(71, 75)
0.40
(131, 133)
1.59
(42, 48)
1.68
(63, 57, 91)
3.18Table3 shows the space cost of 3D-MET in different gray levels. The space size is in relation to the count of the gray level. The recursive implementation of 3D-MET needs to store additional four lookup tables, but this is only a small overhead relative to nowadays’ computer memory.Table 3
Space cost (byte).
Grayscale
64
128
256
512
1024
Space cost
5
×
64
3
5
×
128
3
5
×
256
3
5
×
512
3
5
×
1024
3


## 6. Conclusion

Due to the difficulty of the thresholding segmentation of images with mixed noise, we propose a new thresholding algorithm for image segmentation based on 3D histogram and relative entropy theory. Experimental results show that the proposed approach is valid and successful. The quantitative analysis also shows that the proposed method effectively improves the segmentation capability for mixed noise images. And the proposed method can be applied and extended to other classification applications. In addition, it is interesting to point out the following. Firstly, any single algorithm could not be successful for all image types; the combination of more than one thresholding algorithm is worth a try to obtain the robustness. Secondly, the 3D-MET takes more time to locate the optimal threshold than the 2D thresholding. This problem should be solved by processor upgrading or further improvement of the algorithm.


## Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.



---

*Source: 932695-2014-01-14.xml*