In contrast to classical area based segmentation, the watershed segmentation is executed on the gradient image which
can be regarded as the topography with boundaries between regions. However, the over-segmentation phenomenon inev-
itably comes out due to the fact that the gradient image exhibits too many minima. To avoid severe over-segmentation,
marker-controlled watershed segmentation was proposed which is normally implemented by region growing based on a
set of markers [13]. The fundamental idea is to filter out the undesired minima of the gradient image according to the
markers. Certain desired local minima are selected as markers, and then geodesic reconstruction is applied to fill the other
minima to non-minimum plateaus. The marker image used for watershed segmentation is a binary image consisting of
marker regions where each marker is placed inside an object (either a foreground object or a background object). Each ini-
tial marker has a one-to-one relationship to a specific watershed region, thus the number of markers will equal the final
number of watershed regions. After segmentation, the boundaries of the watershed regions are arranged on the desired
ridges, thus separating each object from its neighbors [14]. The markers can be manually or automatically selected; in this
paper, we proposed automatically creating marker for leaf images based on pre-segmentation results and the prior shape
information.
Although thresholding methods could not give satisfying results while segmenting the leaf images with complicated
background, it can still provide some useful information for the automatic marker creation. In this paper, we choose the Otsu
thresholding method [15] to construct the preliminary marker image. Otsu thresholding method belongs to global threshold-
ing algorithms which assume that image is bimodal. The basic idea is that if a certain threshold t can minimizes the weighted
within-class variance
r
W
among all the possible values, the threshold t is the one with which target and background can be
divided. Here, the weighted within-class variance
r
W
is represented as follows:
r
2
W
ðtÞ¼q
1
ðtÞ
r
2
1
ðtÞþq
2
ðtÞ
r
2
2
ðtÞ; ð1Þ
where the class probabilities are estimated as
q
1
ðtÞ¼
X
t
i¼1
P ðiÞ q
2
ðtÞ¼
X
I
i¼tþ1
P ðiÞ; ð2Þ
and the class means are given by
l
1
ðtÞ¼
X
t
i¼1
iPðiÞ
q
1
ðtÞ
l
2
ðtÞ¼
X
I
i¼tþ1
iPðiÞ
q
2
ðtÞ
: ð3Þ
Finally, the individual class variances are
r
2
1
ðtÞ¼
X
t
i¼1
½i
l
1
ðtÞ
2
P ðiÞ
q
1
ðtÞ
r
2
2
ðtÞ¼
X
I
i¼tþ1
½i
l
2
ðtÞ
2
P ðiÞ
q
2
ðtÞ
: ð4Þ
For gray-scale image,
r
W
is computed through the full range of t values [1,256] and the t value that minimizes
r
W
is se-
lected as threshold.
After segmenting leaf images using Otsu thresholding method, binary images can be obtained where foreground parts are
numerically displayed with 1(white) and background is 0(black). Here, segmented foreground objects are usually partial part
of target leaf and other interferents due to the complicated background. Even so, it does not influence the effect of marker
creation since those isolated foreground parts can represent corresponding objects perfectly. Correspondingly, each isolated
foreground part can be regarded as the marker which acts as a specific watershed region. Note that some interferents such as
branches and non-target leaves may touch or be covered by target leaf in some leaf images with complicated background.
After segmentation, the overlapping phenomenon still exists in obtained binary images, i.e., certain foreground part may
both contain the target leaf and touching interferents. If this foreground part is directly regarded as the marker for watershed
segmentation, the target leaf can hardly be segmented like other traditional methods. So, binary images obtained from Otsu
thresholding method are only preliminary marker images and need to be further processed to avoid overlapping
phenomenon.
According to our observations to original leaf images, most of overlapping phenomena are due to that target leaves touch
or partially cover the interferents including non-target leaves on the same branch of target leaf, neighboring ruderals, etc.
The shapes of target leaves are usually maintained completely, and concave angles exist between target leaves and interf-
erents. These attributes are approximately maintained in binary images (preliminary marker images). Thus, we consider
applying morphological operator, more precisely, erosion to binary image to separate marker corresponding to target leaf
from that corresponding to touching or covered interferents. Usually, the basic effect of the erosion operation for a binary
image is to erode away the boundaries of foreground parts. Thus, foreground parts shrink in size, and holes within those
parts become larger. The mathematical definition of erosion for binary images is as follows:
Suppose that X is the set of Euclidean coordinates corresponding to the input binary image, and K is the set of coordinates
for the structuring element. Let (K)
x
denotes the translation of K so that its origin is at x. Then the erosion of X by K is simply
the set of all points x such that (K)
x
is a subset of X, i.e.,
XHK ¼fxjðKÞ
x
# Xg: ð5Þ
918 X.-F. Wang et al. / Applied Mathematics and Computation 205 (2008) 916–926