Komparasi Algoritma Watershed
Komparasi Algoritma Watershed
discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/259476406
CITATIONS READS
0 727
2 authors:
All content following this page was uploaded by Habibur Rahman on 29 December 2013.
Abstract-Finding of semantic regions is the main It bridges the gap between low-level image
objective of segmentation for image understanding. processing and high-level image processing. Finding
Automatic image segmentation is one of the major semantic regions is the main objective of segmentation
difficulties in the field of image processing. The for image understanding. Image segmentation
watershed algorithm has some problems, like over technique can be broadly classified into the following
segmentation, sensitive to noise, and high computational categories as pixel-oriented, region-oriented,
complexity. To overcome these problems, we have
clustering-oriented, contour-oriented, model-oriented,
proposed a Modified Watershed (MWS) algorithm for
color image segmentation by adaptively selecting histogram thresholding, markov random field, edge-
threshold and masking mechanism over each color based, color-oriented and hybrid [4]. Usually,
channel before combining the segmentation from each Segmentation evaluation methods can be divided into
channel into the final one. For qualitative performance, two categories such as supervised and unsupervised.
proposed modified watershed algorithm performance Unsupervised methods are fully automatic and
compare with four modified watershed algorithms. For segment the regions in feature space with high density
quantitative verification, proposed MWS method with [5]. Though, numerous of approaches have been
two modified watershed algorithms in terms of executing
offered to segment images, no one could always work
times. The presented method have compared with FCM,
RG and HKM techniques for color image Segmentation
well for different kind of images. For example, Edge-
in 10 different classes of images with respect to PSNR, based techniques cannot achieve enclosed region
MSE, PSNRRGB, CQM and RFSIM. It is worth noticing boundaries, while the region-oriented algorithm may
that our proposed approach is low computational lead to over-segmentation or under-segmentation
complexity. According to the visual and quantitative difficulties. To achieve satisfying results by applying
verifications, the proposed MWS algorithm is better than different optimization techniques for image
others three algorithms on the segmentation of color segmentation, commonly researchers may need to use
image. a user interaction process or a very time consuming
method [6].
Keywords: Color Image Segmentation, Watershed
The main drawback of watershed transform is
Transform, PSNR, MSE, PSNRRGB, RFSM, CQM, YUV
Transformation. over-segmentation, sensitive to noise and high
computation complexity those make it unsuitable for
1. Introduction real-time process [7]. To overcome over-segmentation
problem, the improved techniques can be divided into
Image Segmentation is a process to divide the digital two main categories, e.g. post-processing and pre-
image into homogeneous and different meaningful processing approaches. In post-processing methods, it
regions. It is a process to separate the desired objects reduces over-segmentation by integrating homogenous
from the original background image [1]. Image regions after watershed transform, but it significantly
segmentation and grouping the similar visual objects increases the computational complexity. It is similar to
has based on some measurements such as grey level, the hybrid method than modified watershed algorithm.
color, intensity, texture, shape, depth or motion from Basically it doesn’t solve over-segmentation problem
the image. It plays a key role in the fields of image [8]. In pre-processing approaches, it commonly
processing, medical research, remote sensing image, recognized by some feature detection algorithm and
pattern recognition, image visualization, image marker-based watershed methods. The feature
retrieval, content-based image compression, computer detection contains local minima, homogeneous
vision and graphic applications. The role of image regions, texture homogeneous regions etc. Though, it
segmentation is vital in most tasks demanding image is hard to extract markers relative to objects
analysis [2] [3]. Segmentation is the first stage in any accurately. Fundamentally, it is a nice idea to solve
effort to analyze or interpret an image automatically. over-segmentation by marker-based watershed
segmentation by comparing local minima depth with a
Md. Habibur Rahman is a MS student of Computer Science constant threshold [9]. But it has particular serious
Department, American International University - Bangladesh
(AIUB), Banani, Dhaka-1213, and Bangladesh. Email: disadvantages as well, where color gradient is
[email protected] calculated in each color channel independently,
Md. Rafiqul Islam is a Professor of Computer Science ignoring the high correlation among the R, G, and B
Department, American International University - Bangladesh components. There haven’t proposed an advisable
(AIUB), Banani, Dhaka 1213, and Bangladesh. E-mail:
[email protected]
algorithm for threshold selection [7].
105
Rahman and Islam: A Version of Watershed Algorithm for Color Image
To overcome these difficulties, we have offered a the watershed ridge edge lines, form closed region
modified watershed algorithm by applying adaptively boundaries (Figure 1) [12] [13].
selecting threshold and masking operation for color
image segmentation. Firstly, we extract RGB image
into three color channels. The N-Dimensional
convolution function has used for smoothing image.
Morphological image processing operation has been
used in our approach.
For experimental evaluations, we have compared
our proposed MWS algorithm with Fuzzy C-Means
(FCM), Region Growing (RG) and Hill-climbing with
K-Means (HKM) along with different classes of
images. We have done experiments on color image
segmentation to compare the performance of our
proposed MWS algorithm along with three different Figure 1: Watershed Transform
algorithms with respect to PSNR (Peak Signal to The benefits of watershed segmentation are
Noise Ratio) and MSE (Mean Square Error), threefold. Initially, the consequences are connected
PSNRRGB, RFSIM (Riesz-transform based Feature regions with enclosed boundaries of single pixel wide,
Similarity Metric) and Color Image Quality Measure different from the traditional edge-based methods
(CQM) based on reversible YUV color generating disconnected contours. Next, the region
transformation.
contours adhere well to the real object boundaries.
Moreover, the combination of regions produced by
2. Review of Watershed Algorithm watershed segmentation is equal to the entire image
The watershed transformation is a powerful tool for [6].
image segmentation based on well-known C. Zhang [14] proposed a marked extraction based
mathematical morphology-based approach [10]. on adaptive color image segmentation algorithm to
Watershed transform has concerned with great improve the watershed algorithm, the traditional
attention in recent years as an efficient morphological marker for the lack of extraction methods, many
image segmentation tool. It treat as a gray-scale image consider the minimum characteristics of properties,
as a 3D visualization of images correspond to and set the adaptive threshold. Their proposed method
geographic altitude, separable regions correspond to performs better than original watershed algorithm,
water basin, and edges between two adjacent regions with a strong anti-noise performance. Several
corresponds to water lines. It is similar to region-based approaches exist to solve the over-segmentation
approach; it begins the growing process from every problem, such as integrated the K-Means clustering
regional minimum point, each of which creates a with marker controlled watershed segmentation[15],
single region after the transform. Watershed algorithm integrating watershed with region merging algorithm
combines both the discontinuity and similarity [16], watershed based on gradient modification and
properties successfully [6]. hierarchical region merging algorithms[17], combined
The fundamental idea underlying this method comes marker-based watershed and region merger[18],
from geography: it is that of a topographic relief which marker-controlled watershed crown segmentation [19],
is flooded by water, watershed lines being the divide morphological gradient applied to new active contour
lines of the domains of attraction of rain falling over model [20], marker-based watershed algorithm [21]
the region. Research study by Vincent and Soille [11] and interactive segmentation by matching attributed
proposed immersion simulation technique based on a relational graphs are based on watershed, graph cuts,
FIFO queue to implement the watershed segmentation, shortest paths (geodesic) and random walker [1].
which has been proven to be the fastest and most
accurate one. If the gray level of an image is 3. Modified Watershed Algorithm
considered as the height of the topographic surface
In this section, we have proposed a modified
then the watershed can be considered as immersing the
method for color image segmentation. It can quickly
image surface in water. Assuming there are holes
calculate the every region of the watershed
pierced in each local minima, catchment basins will
segmentation. It is improved by considering adaptively
fill up with water starting at these local minima, and
selecting threshold, adaptive masking operation, local
dams are built at points where water coming from
minimum information and convolution function for
different basins would meet. When the water level has
smoothing the image. The image segmentation process
touched the highest peak in the surface, the process is
is described following step provided below. The
stopped. The surface is separated into catchment
flowchart of the proposed methodology provided in
basins associated with each minimum by dams. At the
Figure 2.
end of the process, the union of all those dams creates
106
The AIUB Journal of Science and Engineering (AJSE), Vol. 12, No. 1, August 2013
107
Rahman and Islam: A Version of Watershed Algorithm for Color Image
108
The AIUB Journal of Science and Engineering (AJSE), Vol. 12, No. 1, August 2013
realized from RGB to YUV by using an original color separately. Finally, CQM value is calculated using the
image and its segmented color image. A color Eq. 9 as shown below.
PSNRu PSNRv
CQM PSNR y R w
transformation is initially used as a preprocessing step
before intra-component coding in any image Cw 9
2
segmentation application for color images. In YUV
Where, the weighted luminance quality measure
PSNR y Rw and weighted color quality measure
transformation, Y is the luminance component while U
and V are the blue-difference and red-difference
components of the YUV, respectively [29]. PSNRu PSNRv
C w components. CW and RW
A-1. Peak Signal to Noise Ratio (PSNR) 2
mean the weights on the human perception of these
PSNR is the value of the noisy image with respect to cone and rod sensors. Cw is 0.0551 and RW is 0.9449.
that of the original image. PSNR of the color texture
based image segmented can be calculated by using the A-4.Riesz-transform based Feature Similarity
Eq. 6. PSNR range between [0, 1), the higher PSNR Metric
value indicates better image quality [24].
We have used a novel feature based Image quality
10 log s 2
PSNR GI , SI 6 assessment (IQA) model, namely Riesz-transform
MSE GI , SI based Feature Similarity Metric (RFSIM) based on the
human vision system (HVS) perceives an image
A-2. Mean Square Error (MSE) mainly according to its low-level features proposed by
L. Zhang and others [28]. RFSIM range between [0,
MSE is the average squared difference between an
1), the higher RFSIM value indicates better image
original image and a segmented image. Mean Square
quality. It is calculated by comparing the feature maps
Error (MSE) is calculated pixel-by-pixel by adding up
at key locations marked by a feature mask between
the squared differences of all the pixels and dividing
two images. Assume that we are going to compute the
by the total pixel count [24]. MSE of the segmented
similarity between two images f and g. Here, we
image can be calculated by using the Eq. 7. MSE
denote by M1 the result of edge detection performed
ranges between [0, 1], lower is better.
MSE GI , SI
i 0 j 0 GI i, j SI i, j 2
7
on f and M2 the result of edge detection on g. Then,
the feature mask is defined as Eq. 10.
MN M M1 M 2 10
In Eq. 6, S is the maximum fluctuation in the input Where is the logical “OR” operation. In this
image data type. N and M are the number of rows and section, the 1st-order and the 2nd-order Riesz
columns in the input images, respectively. Where GI is transforms can extract some low-level image features
the original image, SI is the segmented image of size effectively and efficiently in a unified theoretic
NxM. For instance, if the input image has a double- framework. The similarity between two feature maps fi
precision floating-point data type, then S is 1. If it has (i = 1~5) and gi at the corresponding location (x, y) is
an 8-bit unsigned integer data type, S is 255, etc. defined as the Hilbert transform of a 1-D function in
A-3. YUV Transformation and Color Image Quality Eq. 11.
2 f i x, y g i x, y c
d i x, y 2 11
Measure (CQM)
Our chosen color transformation is from RGB to f x, y g 2 x, y c
YUV. We estimate CQM based on offered approach Where, c is a small constant value. This naturally
by Y. Yalman and D. Erturk [29]. The CQM ranges leads to the following formula to define the similarity
between [0, 1), CQM value is always higher than between the feature maps fi and gi by considering only
PSNRRGB value. An estimated Reversible YUV Color the key locations marked by mask M and Hilbert
Transformation (RCT) that is created from the transform of a 2-D function provided in Eq. 12.
JPEG2000 standard and called as RCT is given in Eq. d i x, y M x, y
Di 12
M x, y
8 [30][31].
R 2G B
Y R U G Then, we compute the RFSIM index between f and
4
U V g image as Eq. 13 shown below.
U R G G Y 8
13
5
4 RFSIM Di
V B G
B V G i 1
109
Rahman and Islam: A Version of Watershed Algorithm for Color Image
110
The AIUB Journal of Science and Engineering (AJSE), Vol. 12, No. 1, August 2013
5. Conclusions
Automatic image segmentation is one of the major
difficulties in the field of image processing. A
Figure 15: Performance of four algorithms using
modified color image segmentation algorithm is
PSNRRGB
offered by adaptively selecting threshold and masking
From Figure 15-16, we can figure out PNSRRGB operation with watershed algorithm. We have
always lower than CQM. Further, without systematic compared our proposed MWS algorithm with two
111
Rahman and Islam: A Version of Watershed Algorithm for Color Image
other modified watershed algorithms. Similarly, we [13] R. Kodi, K. Madhavi and K. Sudha, "Segmentation of Image
Using Watershed and Wavelet Transform," International
have computed the performance of our MWS method Conference and Workshop on Emerging Trends in
with FCM, RG and HKM segmentation techniques for Technology (ICWET), Mumbai, India, pp. 156-158, 2010.
color image Segmentation in 10 different classes of [14] C. Zhang, S. Zhang, J. Wu, and S. Han, "An improved
images with respect to PSNR, MSE, RFSIM, watershed algorithm for color image segmentation,"
International Conference on Computer Science and
PSNRRGB and CQM. The results achieved using our Electronics Engineering (ICCSEE), 2012, pp. 69-72.
technique ensure accuracy and quality of the image in [15] M. Christ and M. Parvathi, "Segmentation of Medical Image
10 different classes of images. We have noticed that using K-Means Clustering and Marker Controlled Watershed
Algorithm," European Journal of Scientific Research, vol.
qualitatively our proposed MWS algorithm perform 71(2) , pp. 190-194, 2012.
better than four other modified watershed algorithms. [16] S. Li, J. Xu, J. Ren, and T. Xu, "A Color Image Segmentation
Accordingly, the proposed modified watershed Algorithm by Integrating Watershed with Region Merging,"
RSKT, LNAI 7414, pp. 167–173, 2012.
(MWS) method can enhance the image segmentation [17] Z. Jianming, Z. Ju, and W. Juan, "Watershed segmentation
performance. Likewise, it is worth noticing that our algorithm based on gradient modification and region
proposed MWS approach is less computational merging," Journal of Computer Applications 31(2), pp. 369–
371, 2011.
complexity, which makes it appropriate for real-time
[18] Y. Wangsheng, H. Zhiqiang, and S. Jianjun, "Color Image
application. According to the quantitative verification, Segmentation Based on Marked-Watershed and Region-
the proposed watershed algorithm is better than others Merger," Acta Electronica Sinica 39(5), pp. 1007–1012,
two modified algorithms on the segmentation of color 2011.
[19] G. Deng and Z. Li, "The Study of Improved Marker-
image. We assume that our works could give new Controlled Watershed Crown Segmentation Algorithm,"
insights to people who are interested in image Seventh International Conference on Computational
segmentation. Our future work will be focus on more Intelligence and Security, pp. 1576-1579, 2011.
[20] N. Anh, Y. Kim and G. Lee, "Morphological Gradient
robust algorithm for video image segmentation. Applied to New Active Contour Model for Color Image
Segmentation", ICUIMC, Feb. 20–22, 2012.
REFERENCES [21] B. Li, M. Pan, and Z. Wu, "An Improved Segmentation of
High Spatial Resolution Remote Sensing Image using Marker-
[1] A. Noma, A. Graciano, R. Cesar, L. Consularo, I. Bloch, based Watershed Algorithm," 20th International Conference
"Interactive image segmentation by matching attributed on Geoinformatics, Jun. 15-17, 2012.
relational graphs,” Pattern Recognition 45 pp. 1159–1179, [22] J. Fan, G. Zeng, M. Body and M. Hacid, "Seeded region
2012. growing: an extensive and comparative study," Pattern
[2] A. Aly, S. Deris and N. Zaki, "A Novel Image Segmentation Recognition Letters 26, pp. 1139–1156, 2005.
Enhancement Technique based on Active Contour and [23] Z. Ding, J. Jia and D. Li, "Fast Clustering Segmentation
Topological Alignments," Advanced Computing: An Method Combining Hill-climbing for Color Image," Journal
International Journal (ACIJ), Vol. 2(3), May 2011. of Information & Computational Science (JOICS), Vol.
[3] S. Kamdi, R. Krishna, "Image Segmentation and Region 8(14), pp. 2949–2957, 2011.
Growing Algorithm", International Journal of Computer [24] C. Mythili and V. Kavitha, "Color Image Segmentation using
Technology and Electronics Engineering (IJCTEE), Vol. 2, ERKFCM," International Journal of Computer Applications,
Issue 1, pp. 103-107, 2012 Vol. 41(20), pp. 21-28, Mar. 2012.
[4] D. Ghoshal, P. Acharjya, "A Modified Watershed Algorithm [25] Z. Yu, O. Au, R. Zou, W. Yu and J. Tian, "An adaptive
for Stellar Image," International Journal of Computer unsupervised approach toward pixel clustering and color
Applications, Vol. 47, No. 13, pp. 38-42, June 2012. image segmentation," Pattern Recognition 43, pp. 1889–1906,
[5] T. Saikumar, P. Yugander, P. Murthy and B. Smitha, "Colour 2010.
Based Image Segmentation Using Fuzzy C-Means [26] Z. Wang, A. Bovik, H. Sheikh, and E. Simoncelli, “Image
Clustering," International Conference on Computer and quality assessment: from error visibility to structural
Software Modeling IPCSIT, IACSIT Press, Vol. 14, 2011. similarity”, IEEE Transaction on Image Processing, Vol. 13,
[6] X. Han, Y. Fu and H. Zhang, "A Fast Two-Step Marker- pp. 600-612, 2004.
Controlled Watershed Image Segmentation Method," [27] Z. Wang, E. Simoncelli, and A. Bovik, “Multi-scale structural
Proceedings of IEEE International Conference on similarity for image quality assessment,” ACSSC 03, 2003.
Mechatronics and Automation, Aug. 5 - 8, pp. 1375-1380, [28] L. Zhang, L. Zhang, and X. Mou, "RFSIM: A Feature based
2012. image quality assessment metric using Riesz Transforms,"
[7] H. Tan, Z. Hou, X. Li, Rong Liu, and W. Guo, "Improved Image Processing (ICIP), 17th IEEE International Conference,
watershed algorithm for color image segmentation," Proc. of pp. 321-324, 2010.
SPIE Vol. 7495 74952Z-(1-8), 2009. [29] Y. Yalman and Đ. Erturk, "A new color image quality
[8] R. Callaghan and D. Bull, "Combined Morphological-Spectral measure based on yuv transformation and psnr for human
unsupervised image segmentation," IEEE Transactions on vision system," Turkish Journal of Electrical Engineering &
Image processing Vol. 14, Issue. 1, pp. 49-62, 2005. Computer Sciences, in press, 2013
[9] L. Gao, S. Yang, J. Xia, S. Wang, J. Liang, H. Li, "New [30] M. Gormish, E. Schwartz, A. Keith, M. Boliek and A. Zandi,
Marker-Based Watershed Algorithm," Acta Electronica “Lossless and nearly lossless compression of high−quality
Sinica. 11(34), pp. 2018-2023, 2006. images,” SPIE/IS&T Conference on Very High Resolution
[10] S. Xu, H. Liu and E. Song, "Marker-Controlled Watershed for and Imaging II, Vol. 3025, pp. 62-70, Feb. 1997.
Lesion Segmentation in Mammograms," J Digit Imaging [31] A. Mesut, “New methods in data compression,” PhD. Thesis,
(2011). Trakya University, 2006.
[11] L. Vincent, P. Soille, “Watersheds in digital spaces: An [32] D. Martin, C. Fowlkes, D. Tal and J. Malik, "A database of
efficient algorithm based on immersion simulations,” IEEE human segmented natural images and its application to
Trans. Pattern Analysis and Machine Intelligence, Vol. 13(6), evaluating segmentation algorithms and measuring ecological
pp. 583-598, 1991. statistics," in Proc. of IEEE Int. Conf. Computer Vision, Vol.
[12] A. Amankwah and C. Aldrich, "Automatic Ore Image 2, pp. 416-423, Jul. 2001.
Segmentation Using Mean Shift and Watershed Transform,"
Radioelektronika 21st International Conference, 2011.
112
The AIUB Journal of Science and Engineering (AJSE), Vol. 12, No. 1, August 2013
113
Rahman and Islam: A Version of Watershed Algorithm for Color Image
(a) Original image (b) FCM (c) RG (d) HKM (e) Proposed MWS
Figure 20: Color image segmentation by FCM, RG, HKM and proposed MWS algorithms
114
The AIUB Journal of Science and Engineering (AJSE), Vol. 12, No. 1, August 2013
115
Rahman and Islam: A Version of Watershed Algorithm for Color Image
116