0% found this document useful (0 votes)
67 views4 pages

Oversegmentation Avoidance in Watershed-Based Algorithms For Color Images

The document summarizes different techniques for oversegmentation avoidance in watershed-based image segmentation algorithms. The watershed transform often oversegments images by producing too many regions. The document discusses two main approaches to address oversegmentation: 1) image preprocessing before watershed segmentation, such as median filtering, to remove noise and irrelevant local minima, and 2) image postprocessing after watershed segmentation, such as merging similar adjacent regions based on criteria like gradient analysis. The document provides details on specific preprocessing and postprocessing techniques that have been implemented and evaluated for color image segmentation.

Uploaded by

Ashish Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views4 pages

Oversegmentation Avoidance in Watershed-Based Algorithms For Color Images

The document summarizes different techniques for oversegmentation avoidance in watershed-based image segmentation algorithms. The watershed transform often oversegments images by producing too many regions. The document discusses two main approaches to address oversegmentation: 1) image preprocessing before watershed segmentation, such as median filtering, to remove noise and irrelevant local minima, and 2) image postprocessing after watershed segmentation, such as merging similar adjacent regions based on criteria like gradient analysis. The document provides details on specific preprocessing and postprocessing techniques that have been implemented and evaluated for color image segmentation.

Uploaded by

Ashish Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Oversegmentation avoidance

in watershed-based algorithms for color images


Wojciech Bieniecki
Abstract The article presents own implementation of wellknown region-based image segmentation method, the watershed
transform. The implementation was intended for color image
processing. In its original version, the watershed is a parameterfree algorithm, which often performs too accurate segmentation
for a query image. Our modification introduces the second pass
to the method that removes some irrelevant splitting lines and
thus merges the regions. The algorithm was tested on
microscopic histological images for cancer cell detection.
Keywords Region-based segmentation, watershed.

I. INTRODUCTION
The most frequently used definition of the watershedding
operation follows a geographical analogy (Fig. 1). If a
grayscale image is viewed as if high intensity colors were
high ground then the image becomes a 3D landscape. A
minimum is a dip in the ground surrounded by higher land.
The catchment basin of this minimum is the area, where water
falling on the landscape would flow down to the minimum.
The watershed of the image is the set of lines (dams) that
separate the catchment basins on the image.
The height in topographic surface may be any
measurable property of image pixel: lightness, gradient of
lightness, saturation or other. That makes watershed algorithm
useful for color image processing.

Fig. 1. Topographic landscape

The watershed transformation performs very accurate


segmentation, which is beneficial in case when objects
overlap and their borders are hardly detectable.

Wojciech Bieniecki Technical University of Lodz,


Computer Science Dept., al. Politechniki 11, Lodz, POLAND
E-mail: [email protected]

What is more, it splits the image area into disjoint regions


and the watershed lines are closed curves. In its original form
the routine works as a non-parametric algorithm.

II. REVISION OF THE WATERSHED METHODS


The earliest algorithms functioned using operations locally
to each pixel performed in an iterative manner. Beucher and
Lantjoul [BL79] suggested a method that expanded influence
zones around local minima within their grayscale levels via
binary thickenings until idempotence was achieved.
Additionally, they proved that the watershed transform can be
calculated by performing grayscale thinnings on the image
until idempotence.
The sequential methods rely on scanning the pixels in a
predefined order where the new value of each pixel is
immediately taken into account in the processing of
subsequent pixels. Meyer [Mey92] proposed an algorithm
based on horizontal scans. It can be shown that the result of
the transform depends on the pixel scan order [SM02].
Beucher presented the arrowing method [BM90]. It consisted
in generating a directed graph to represent a grayscale image.
Each pixel was represented by a node in the graph that was
connected to neighboring pixels. These directed connections,
arrows, were generated by geodesic dilations of the pixels at
successive gray levels. Iterative procedures were used to
identify those nodes which represent divide points, or
watershed pixels.
The above methods are time consuming and have been
shown to have accuracy problems. Currently, the fastest and
most accurate algorithms base on the flooding analogy. These
algorithms simulate the flooding of the landscape,
propagating flood waters from the minima in height order,
and building watershed lines as dams when floods from
different catchment regions meet. The method was introduced
by Vincent and Soile [VS91]. In the first stage the algorithm
generates a list of all pixels in the image in height order. This
allows the flood waters to rise through the landscape as if it
were being lowered into a lake of water. At each height level
the minima are allowed to spread within the height level.
Pixels belonging to the minimum are labeled with the
minimum identifier and placed into a FIFO queue. Then the
pixel is removed from the queue, and its neighbors are
examined. Those at the current height level are given the label
of the pixel from the queue and placed at the end of the
queue. This is repeated until the queue runs out, once all the
pixels at the current level are labeled. Pixels that have
neighbors with a different minimum identifier as are marked

as watershed pixels. The propagation step is repeated at


increasing heights until the entire image is flooded.
Meyer in his research used an ordered queue (OQ) that was
an array of FIFO queues. Any incoming pixel is placed at
the back of the queue that corresponds to the pixels height.
Pixels are removed from the front of the lowest queue still
containing pixels. Initially the OQ is seeded with the pixels of
all the minima on the image. The first pixel of the OQ is
removed and its neighbors are given its label and placed in the
appropriate places in the OQ, unless they are already labeled.
This continues until the OQ is empty. This version of the
algorithm produces a tessellation of the image into catchment
regions; a second scan of the image is required to draw lines
between the regions. The second version of the algorithm
draws the lines in the propagation stage; however the
watershed lines can dam off areas of the image preventing
them from being processed. An extension to the algorithm
detects such cases and prevents this possibility.
The watershed has been extended to color images in
Meyers works [Mey92]: he proposed an algorithm similar to
a region growing. The measure used to give the aggregating
probability of a pixel to a region is given according to a
similarity measure between a pixel and a neighbor region.

III. OVERSEGMENTATION SUPPRESSION


BY IMAGE PREPROCESSING

The watershed produces an oversegmentation of the image,


but always contains contours that appear to be correct. The
main problem is to make a proper choice and select the
relevant lines only. There are several techniques based on
image preprocessing and postprocessing. Now we proceed to
the preprocessing techniques.
Image preprocessing includes noise removal, because raw
watershed algorithms are extremely vulnerable to noisy
pictures. Simply each local minimum becomes a seed of a
new region, but this minimum is not necessarily a point inside
a candidate region. In our research we have tested the
following methods:
Median Filter. The advantage of the median filter is that it
preserves the borders of the segments, which is beneficial to
proper shape extraction. The median filter removes the
impulsive noise from the image which prevents
oversegmentation. For color images we use so called Vector
Median Filter [VAT01] improved in our recent research
[GB03].
Color morphology. The morphology operations include image
erosion and dilation. The description of the algorithms for
color images can be found in [HS01]. The operations may be
applied sequentially to achieve image opening, image closing
and top hat transform. The choice of combination depends of
the image content. We used image closing, because the
content of our image was dark oval objects on the light
background. The color morphology operators may change a
bit the shape of the objects to be segmented. To reduce this
effect it is important to select a proper structuring element.
Nevertheless, the morphology filtering smoothes the interior

of the objects which prevents splitting them by watershed


lines.
Other smoothing filters. The aim of these filters is to get rid of
irrelevant local minima. As the filters eliminate the high
frequency from the image, they usually do not preserve
borders of the objects. We considered low-pass filter and
gaussian filter applied as convolution masks [RW01].
Most efficient preprocessing techniques base on markers.
Markers are artificially generated starting points for the
watershed procedure. In fact they are seed points of the
catchments. That guarantees that during the immersion
process each marker point will grow to one region. The
marker technique was introduced by Meyer [BM90]. Actually
marker points are implemented as points of the zero value
(deepest), and that makes them be starting points. The marker
points can be obtained manually or by another segmentation
algorithm (e.g. thresholding). The technique is convenient for
semiautomatic segmentation. In our research we did not
consider this method as our task was to establish the number
of objects in view area in unattended process.

IV. OVERSEGMENTATION SUPPRESSION


AS THE IMAGE POSTPROCESSING PHASE

The task of oversegmentation reduction for image


segmentation can be formulated as a postprocessing phase.
The watershed transform applied on the original image allows
accurate object borders detection.
Postprocessing consist in merging some of the basins in a
proper way by removing irrelevant watershed lines. Various
approaches of accomplishing this task may be found in
literature: gradient watersheds on graphs [VS91], basin
dynamics [NS96], inclusionary and exclusionary cues
[HO93], image component labeling [MG97] and multiscale
gradient analysis [Jac95]. Most of these approaches define
appropriate merging criteria based on the basins using the
information about the gradient image. In practice it is difficult
to define proper criteria for all objects in the image. A novel
method was introduced by Stoev and Strasser [SS00]. They
overcome the problem of oversegmentation by using the
combination of four criteria depending on the image content.

IV. EVALUATION OF THE METHODS


Color image preprocessing. For color images it is essential to
transform the color vector space into one scalar measure
preserving most of the input data. The first possibility is to
transform the image into grayscale by averaging the R,G,B
values of each pixel as shown in the Eq. (1)
gray (R, G, B ) := 0.3 R + 0.59 G + 0.11 B

(1)

This operation may destroy the content of the image,


especially, when the contrast is low and objects may be
distinguished only by different colors.

For most of the operations we have chosen the HSI (hue,


saturation and intensity) color space, which sounds reasonable
as the space reflect human vision more accurately. Both for
color morphology operations and watershed transform we
define the relation > for colors c1(H1, S1, Ii) and
c2(H2, S2, I2) in the following way:

c1 > c 2

if

I 1 > I 2 or

or
I 1 = I 2 and S1 < S 2
I = I and S = S H H < H H
2
1
2
1
0
2
0
1

(2)

Let B1...Bn be the set of adjacent basins (usually n=2 but up


to 4), v1 ... vn the values of seed points for these basins and vw
the value of the watershed dam point. Then the point height is
h(vW ) := inf (vW vi )

(4)

i =1..n

For each dam line which is a set of watershed points W1 ... Wm


we define the height as:

( )

h(W ) := inf W j
i =1..m

(5)

where
H H0
for H i H 0 0

H i H 0 := o i
(
)
H
H
360
+

i
0 for H i H 0 < 0

(3)

For evaluation of the segmentation we took into account the


immersion based watershed method with image preprocessing
(dilation and erosion operations) and postprocessing (region
merging). The segmentation is performed on microscopic
images of breast cancer tissue (Fig. 2). Main goal of the task
is to segment the cell nuclei of two different colors. The
nuclei may overlap; sometimes borders of the objects are
blurred. The complete process of image analysis is presented
in our previous papers [BGS03], and in this article we
concentrate on the oversegmentation problem.

Now we set the threshold value T, which is global to whole


image, and merge the adjacent regions by removing the dam
lines, which are lower than T. In fact the action does not
complete the merging process, which is illustrated in Fig. 3b.

a)

c)

b)

d)
Fig. 3. The process of irrelevant watershed dams removal:
oversegmented image extract (a), thresholding of dams (b);
if both dams W1,3 and W2,3 are removed,
W1,3 also has to be deleted (c), final effect (d)

The operation requires adjacency graph modification and


removing the dams that do not split the regions anymore. The
results of the segmentation are presented in Table I.
Fig. 2. The picture to be segmented.
The expert distinguished 62 cancer cell nuclei.

Criteria of region merging. We use two region merging


criteria. The first one is the height of the watershed dam. Lets
assume, that the watershed has been imposed on the image.
Each pixel of the image has been assigned with the region
number it belongs to, and watershed pixels have been marked
with number 0. Additionally the list of adjacent region
number has been created and each node of the list contains the
coordinates of the splitting watershed line.
For each point assigned as the watershed point we calculate
the height. It is in fact a minimal depth of the adjacent basins.
To be accurate we define it as follows:

TABLE I
SEGMENTATION RESULTS FOR DAM HEIGHT THRESHOLDING
Method
image sample:
Human segmentation
by expert
Raw
watershed
Watershed with
preprocessing
Postprocessing
dam threshold 12
Postprocessing
dam threshold 7

1
62

Number of regions
2
3
88
38

4
53

2222

10484

12473

11984

1060

1352

1378

1287

79

84

31

53

68

95

44

66

The combination of watershed and pixel classification.


Watershed methods can work very efficiently if they are
supported by other segmentation techniques. In our research
we use the pixel classification based on Nearest Neighbor
Classifier (k-NN) applied to the color components. Such a
kind of segmentation works similarly to lightness
thresholding, but it is more accurate and operates in the color
space. In the application to cancer nuclei detection the
algorithm classifies image pixels to one of three classes:
pixels of the background, pixels of the bluish nuclei and
pixels of the brownish nuclei. In fact, when the nuclei
overlap, pixel classification has to be aided with watershed.
The first idea consists in performing pixel classification and
watershed classification independently. All the pixels, that
have been assigned as watershed dams become the
background pixels. The segmentation result is presented in
Fig. 4.

Fig. 4. Color segmentation with aid of watershed grid

Contrary, the second idea of this hybrid segmentation bases


on pixel classification of the watershed grid. The 1-NN is
used to remove redundant watershed lines and thus merging
some regions. The criteria is imposed as follows: if all of the
pixels of one watershed dam belong to the same class the
dam is removed, else it is left. The segmentation results for
four different images are presented in Table II.
TABLE II
SEGMENTATION RESULTS FOR WATERSHED AND 1-NN CLASSIFICATION
Method
image sample:
Human segmentation
by expert
1-NN plus
watershed grid
watershed plus 1-NN
dam removal

1
62

Number of regions
2
3
88
38

4
53

57

90

34

49

64

94

38

55

V. CONCLUSION
The watershed transform is in original form a segmentation
tool, that produces oversegmentation, but this drawback can
be extinguished by several methods, especially with aid of
other segmentation technique. As can be deducted from our
results, a fusion of watershed and 1-NN classification is quite
novel and promising approach. In the future we would like to
continue our research over watershed dams classification by
using shape descriptors and other features.

REFERENCES
[BL79] S. BEUCHER, C. LANTUEJOUL, Use of watersheds
in contour detection. International Workshop on image
processing, real-time edge and motion detection
/estimation, Rennes, France, Sept. 1979.
[BM90] S. BEUCHER,
F. MEYER,
Morphological
segmentation. Journal of Visual Communication and
Image Representation, 1, Vol. 1, Oct. 1990.
[VS91] L. VINCENT, P. SOILLE, Watersheds in digital
spaces: An efficient algorithm based on immersion
simulations, IEEE PAMI, 1991, 13(6): 583-598, 1991.
[Mey92] F. MEYER, Color image segmentation. In
Proceedings of the International Conference on Image
Processing and its Applications, pp. 303306, 1992.
[HO93] W. HIGGINS, E. OJARD, Interactive morphological
watershed analysis for 3D medical images. Computerized
Medical Imaging and Graphics, 17(4/5):387395, 1993.
[Mey94] F. MEYER. Topographic distance and watershed
lines, Signal Processing,38(1): 113125, July 1994.
[Jac95] P. T. JACKWAY. Morphological multiscale gradient
watershed image analysis. In G Borgefors, editor 9th SCIA
Scandinavian Conference on Image Analysis, pp. 87-94,
June 1995.
[NS96] L. NAJMAN, M. SCHMITT, Geodesic Saliency of
Watershed Contours and Hierarchical Segmentation, IEEE
Transactions On Pattern Analysis And Machine
Intelligence, December 1996 (Vol. 18, No. 12).
[MG97] A. N. MOGA, M. GABBOUJ.
Parallel
image
component labeling with watershed transformations. IEEE
Transactions on Pattern Analysis an Machine
Intelligence, 19(5):441450, 1997.
[SS00] S. STOEV, W. STRASSER, Extracting regions of
interest applying local watershed transformation, in:
Proceedings of the 11th Annual IEEE Conference on
Visualization (VIS-2000), pp. 2128, ACM Press, 2000.
[HS01] A. G. HANBURY, J. SERRA, Mathematical Morphology in the HLS Colour Space, 12th British Machine
Vision Conference, Manchester, UK, September 2001.
[RW01] G. RITTER, J. WILSON, Handbook of computer
vision and image algebra, CRC Press, London, New
York, Washington D.C., 2001.
[VAT01] M. VARDAVOULIA, I. ANDREADIS, PH. TSALIDES, A New Vector Median Filter for Colour Image
Processing, Pattern Recognition Letters 22, pp. 675689,
2001.
[SM02] D. SANKOWSKI, V. MOSOROV, The analysis of
dependence of watershed transformation of raster-scan
order. In Proc. IEEE TCSET'2002, Lviv, Ukraine, pp.
237238, 2002.
[BGS03] W. BIENIECKI, SZ. GRABOWSKI, J.
SEKULSKA-NALEWAJKO, A system for pathomorphological microscopic image analysis, KOSYR 2003, Poland
pp. 2128.
[GB03] SZ. GRABOWSKI, W. BIENIECKI, A two-pass
median-like filter for impulse noise removal in multichannel images, KOSYR 2003, Poland, pp. 195-200.

You might also like