You are on page 1of 4

An Evolved Image Segmentation Technique for

Gradient Detection and Outside Markers


Fahad Al Ghazali1
1
Computer Engineering Department, Center for Advanced Studies in Engineering, Pakistan
CASE, G-5/1 , Islamabad
1
fahadghazali@cesat.gov.pk

Abstract— In this paper, an evolved image segmentation smoothed version of the gradient magnitude image (which
technique is presented, which incorporates watershed also makes it usable with colour images). This ends up finding
segmentation and a modified graph based segmentation smooth regions separated by visible (higher gradient)
technique. The presented algorithm successfully solves the boundaries. Since such boundaries are what active contours
inability of watershed transforms to segment regions having
gradually changing gray level shades or segments having
usually follow, pre-computing such a segmentation using
granularity in their outlook. Furthermore, the algorithm also either watershed or the related tobogganing technique is often
paints inside outside markers on most prominent regions which used in active contour algorithms as in [3]. Unfortunately,
reduce over-segmentation, which is another observed problem watershed segmentation associates a unique region with each
with watershed technique. The algorithm has been simulated and local minimum, which can lead to over-segmentation, [4].
tested using MATLAB code and it has been shown in this paper, Watershed segmentation is therefore often used as part of an
that the proposed algorithm reduces the above mentioned interactive system, where the user first marks seed locations
problems in watershed technique. The applications of this (with a click or a short stroke) that correspond to the centres
algorithm can be in all the fields related to image segmentation. of different desired components. Fig. 1 shows the results of
images after going through watershed transformation.
Keywords— Watersheds, Image segmentation, granularity,
gradient, markers

I. INTRODUCTION
Region based segmentation is a very powerful concept for
region based image segmentation.
A. Region Based Segmentation
Region segmentation is the task of finding groups of pixels
that “go together”. In statistics, this problem is known as
cluster analysis and is a widely studied area with hundreds of
different algorithms. In computer vision, image segmentation
is one of the oldest and most widely studied problems. Early
techniques tend to use region splitting or merging, which
Fig. 1 a)The original image of famous cameraman.tif b)The
correspond to divisive and agglomerative algorithms in the cameraman.tif after watershed transformation, it can be observed that it has
clustering literature. More recent algorithms often optimize been over-segmented and the background is not identifiable
some global criterion, such as intra-region consistency and
inter-region boundary lengths or dissimilarity as in [1]. Furthermore, if there is an image region, in which there is
continuous change in shades of gray levels, just like a gradient
B. Watershed textured image, the watershed is observed to be unable to
A technique related to thresholding, since it operates on a detect it as an independent segment. Similarly, as the
grayscale image, is watershed computation [2]. This technique watershed works on immersion of topographic image through
segments an image into several catchment basins, which are water, it is also unable to properly detect the objects, which
the regions of an image (interpreted as a height field or have granulated colour or outlook. It means that, when an
landscape) where rain would flow into the same lake. An object has a colour which has all gray levels randomly
efficient way to compute such regions is to start flooding the distributed over its body, the watershed also finds it hard to
landscape at all of the local minima and to label ridges declare it as an independent region. This remains the case, no
wherever different evolving components meet. The whole matter how much granulated, the coloured object is
algorithm can be implemented using a priority queue of pixels distinguishable from its vicinity through human visual system.
and breadth-first search [2] One way can be to pass the image through the averaging filter,
Since images rarely have dark regions separated by lighter as it would subdue the object’s granular shade. Even after this
ridges, watershed segmentation is usually applied to a modification in procedure, it has been observed that,
watershed technique doesn’t declare it as an independent minimum. b) The catchment basins which are the points at
segment. Fig.2 illustrates this problem. Here we have an which a drop of water, if placed at any of those locations,
image with 3 distinct regions. On the left side, we have a would fall to a single minimum. c) Watershed lines will be
region in which the shade of the region is continuously combination of points at which water will be equally likely to
decreasing. Then, there is a second region in the right, within, fall to more than one such minimum. Once these points are
which there is a region that possesses a shade, which is found, the decisions of regions are made utilizing
continuously and randomly varying. Human visual system computations based on neighbourhood connectivity and
easily distinguishes, that there are three regions in this image, sorting. The mathematical details of this algorithm are
but it has been a great challenge for computer vision provided in [2] & [4].
algorithms.
III. THE PROPOSED ALGORITHM
In this part, the proposed sequence of algorithm is
presented in detail. In the first step, the image I(x,y) is taken
as an input to the algorithm. The image is first passed through
Laplacian and averaging filters. Laplacian filter is a very
efficient technique for edge detection as it highlights and
segments parts which have high gradient. The averaging or
mean filter is applied to reduce noisy part of the image and to
smooth out the parts of the images which have high granular
shade. Then this image ILM(x,y) obtained after passing the
Fig. 2 a) The original showing three distinct regions with one segment original image through laplacian and averaging filters is
having continuous shade, the other with granular shade b)The image after given to watershed transform. The watershed transformed
passing through watershed transformation technique
image is in a form which shows the proposed edges in low
C. Graph-based Segmentation gray scale levels. The watershed transformed image Iw(x,y) is
While many merging algorithms simply apply a fixed rule to then thresholded in order to give clear edge points, i.e. the
group pixels and regions together, [1] present a merging edge points which depict boundaries of objects and have gray
algorithm that uses relative dissimilarities between regions to scale level of zero. This thresholded image is now Iw_th(x,y)
determine which ones should be merged, which produces an The resultant image from the previous transformations
algorithm that provably optimizes a global grouping metric. Iw(x,y) are processed through the proposed algorithm. In this
They start with a pixel-to-pixel dissimilarity measure w(e) algorithm the edge points from Iw_th(x,y)are extracted and
such as intensity differences between N8 neighbors. stored in an array edge_points[n,2], in which n is the number
(Alternatively, they also use the joint feature space distances of edge points and are number of rows in the array. The
introduced by Comaniciu and Meer, [5]). In the proposed second order ‘2’ is the number of columns of the array and
algorithm, this approach of finding relative dissimilarities store x and y coordinates of the edge points. The array
between regions is taken and modified such that it not only edge_points[n,2] is used for the analysis of the original input
counts on dissimilarities, but also on the relative and sufficient image I(x,y) again. From the original image I(x,y), the
similarities of adjacent regions to give finalized version of grayscale levels of the pixel points, pointed by
segmented image. edge_points[n,2] are taken. Finally, the whole of the image is
scanned again at each location pointed by
edge_points[n,2]and a vicinity check is performed. This
II. WATERSHED TRANSFORM CONCEPTS & TERMINOLOGIES vicinity check inspects that whether the pixel points lying
adjacent to the edge_points[n,2], declared by the first part of
In the watershed transform, the starting point of the
the algorithm, have sufficient intensity differences with
algorithm is taken as the topographic interpretation of the
neighbouring pixels or not. For each of the edge_points[i,2],if
image, which is a 3-D graph, with x and y coordinates of the
the difference
image placed on the horizontal plane and in the vertical
direction, corresponding intensity levels of the image are
plotted. In this way, we get an interpretation in which high *edge_points[i(1),i(2)]-*edge_points[i(1)-1,i(2)-1] 
intensity values of the images can be observed in terms of  
peaks. The low intensity values can be observed in terms of
valleys and the pixels with intermediate intensities can be is found to be less than a threshold value, the edge_points[n,2]
viewed as slopes to the peaks. This is quite an efficient way of are modified to new coordinate values. Otherwise, the
observing image such that we can have an idea of the image’s edge_points[n,2]. This process is repeated for every single of
gradients as well. The whole watershed technique is based on the edge points.
the immersion or flooding of this artificial landscape in water,
which is followed by detection of edges and regions which
IV. THE FLOWCHART OF THE ALGORITHM
survive this flooding. Here, the total points can be divided into
three main categories. a)Points belonging to a regional Fig.3 depicts the steps involved in the proposed algorithm
Image Pixel Vales at
Edge Points

Application of
Laplacian and Subtraction of the pixel
Averaging Filter values at edge points and
the pixel values at their
neighbouring pixels
Watershed
Transformation

Thresholding of Difference
>Threshold
the Watershed Value
Fig. 5 a) Image b) After Watershed c) After Proposed
Transformed algorithm
No
image Yes
Similarly, the proposed algorithm performs in the same
Maintain Edge Points manner with the cameraman.tif shown in Fig.1. Fig. 6 depicts
Edge Points that how the proposed algorithm is able to distinguish the
Update Edge Points camera rods, along with the background and sketches a
marker around the boundary of the cameraman.

Fig. 3 The Flowchart of the algorithm

V. RESULTS
The results show that the proposed algorithm is able to
detect distinct segments of images which have grayscale
levels which are constantly and continuously changing, as
well as those which have granular colours. Moreover, the
proposed algorithm reduces the effect of over segmentation
such that the resultant image possesses a distinct marker like
structure around prominent and foreground objects. Fig. 4 Fig. 6 a) The cameraman Image b) After processing
shows the results of the image shown in fig. 2 after processed through the proposed algorithm
by the proposed algorithm. It can be observed that the
algorithm successfully differentiates the three segments in the VI. CONCLUSIONS
image. The algorithm presented in this paper gives the intended
results quite efficiently, however, the algorithm is to be tested
with large number of images to prove its use for medical
images as well. Further changes in the algorithm on hit and
trial basis can be performed to remove tiny grains from the
result images which appear around the judged edges.

REFERENCES
[1] “Felzenszwalb, P. F. and Huttenlocher, D. P. (2004b). Efficient graph-
based image segmentation. International Journal of Computer Vision,
59(2), 167–181.”
[2] (“Vincent, L. and Soille, P. (1991). Watersheds in digital spaces: An
Fig. 4 a) The original image b) The image after going through the efficient algorithm based on immersion simulations. IEEE
proposed algorithm Transactions on Pattern Analysis and Machine Intelligence, 13(6),
583–596.”)
Fig. 5 depicts the image of a person in which watershed [3] Mortensen, E. N. and Barrett, W. A. (1999). Toboggan-based
segmentation is unable to clearly segment all the parts of the intelligent scissors with a four parameter edge model. In IEEE
image. The proposed algorithm differentiates the major Computer Society Conference on Computer Vision and Pattern
segments and also creates the marker like structure around the Recognition (CVPR’99), pages 452–458, Fort Collins.
[4] Beare, R. (2006). A locally constrained watershed transform. IEEE
edge of the face of the man. Transactions on Pattern Analysis and Machine Intelligence, 28(7),
1063–1074.
[5] Comaniciu, D. and Meer, P. (2002). Mean shift: A robust approach
toward feature space analysis. IEEE Transactions on Pattern Analysis
and Machine Intelligence, 24(5), 603–619.

You might also like