You are on page 1of 6

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882

Volume 3, Issue 3, June 2014

Automatic Image Segmentation Using Graph Cut


Prabhjot Singh1, Er. Deepak Sharma2
1 M.Tech Scholar, Deptt. of ECE, MMEC, Mullana, Ambala.
2 Assistant Professor, Deptt.of ECE, MMEC, Mullana, Ambala

ABSTRACT
Image segmentation is the process of partitioning an
image into multiple segments, so as to change the
representation of an image into something that is more
meaningful and easier to analyze. Several generalpurpose algorithms and techniques have been developed
for image segmentation. Image segmentation refers to
partition of an image into different regions that are
homogenous or similar and inhomogeneous in some
characteristics as the new graph cut approach is an
emerging technique for image segmentation, as it can
minimize an energy function composed of data term
estimated in feature space and smoothness term
estimated in an image domain. Previous approaches
using graph cuts have shown good performance for
image segmentation, they manually obtained prior
information to estimate the data term, thus automatic
image segmentation is one of issues in application using
the graph cuts method. As it requires low computational
complexity and is therefore very feasible for real-time
image segmentation processing. In the experiments, we
investigated problems of previous methods such as
mean shift segmentation, watershed technique and
automatic graph cut based image segmentation As a
result, the graph cut method showed better performance
than previous methods.
Keywords: - Mean Shift, Watershed, Graph Cuts, Edge
Based Segmentation.
1. INTRODUCTION
Image processing refers to processing of a 2D picture
by a computer. An image is defined in the real world
is considered to be a function of two real variables. An
image is an array, or a matrix, of square pixels (picture
elements) arranged in columns and rows, which
identifies a point in the image and the corresponding
matrix element value identifies the gray level at that
point. Image processing is a method to convert an image
into digital form and perform some operations on it, in
order to get an enhanced image or to extract some
useful information from its image domain [1].Image
Segmentation is the process of partitioning a digital
image into multiple regions or sets of pixels. Actually,
partitions are different objects in image which have the
same texture or color. All of the pixels collectively
cover the entire image, or a set of contours to some, or

texture [2]. Generally the image segmentation


algorithms can be generally classified into two Feature
space-based and image domain-based segmentations
[3]. Approaches to feature space-based segmentation
capture the global characteristics of images through
image features expressed in feature space, which are
usually based on the color, texture and the image
features are grouped into compact, but well-separated
clusters by using several clustering algorithm [4].
Although the feature space-based clustering approaches
are efficient in finding salient clusters, there was no
guarantee at all that these regions showed spatial
compactness in an image domain. This means the
feature space-based approaches did not exploit the
important fact that features of same region are spatially
close due to spatial coherence [3]. Therefore,
approaches to image domain-based segmentation have
been utilized due to the need to preserve the spatial
relationship between the features in the image domain.
Although many algorithms, such as watershed
algorithm and mean shift algorithm in image domain,
have been introduced but it may undesirably produce a
very large number of small quasi-homogenous regions,
thus some merging algorithm should be applied to these
region [6].
Recently, a graph cuts method has taking a lot of
attention for image segmentation. The graph cuts
method is one of minimizing energy functions elegantly
expressed as MRF (Markov Random Field), and the
energy function consists of two terms; the first term,
called data term, is to globally capture the
characteristics of an image in feature space, and the
second term, called smoothness term, is to preserve
spatial information in an image domain [1]. Thus, the
graph cuts-based approach can combine above
mentioned two approaches, clustering in feature space
and preserving spatial relationship in image domain [7].
Image segmentation is an extremely important operation
in several applications of image processing and
computer vision, such as object tracking, recognition
and many more. Image, video segmentation is a critical
step of image analysis occupying the middle layer of
image engineering, which means it is influenced not
only from data but also from human factors [2].
The remainder of this paper is organized as follows. The
energy function for image segmentation and the

www.ijsret.org

682

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882
Volume 3, Issue 3, June 2014

previous methods for image segmentation are


introduced in section 2, and section 3 automatic obtain
the prior information for each class using graph cut.
Experimental results are presented in section 4, and the
final conclusions are given in section 5.
Energy Function for Image Segmentation for labeling
problems solving the pixel labeling problem is one of
the most frequent applications of energy minimization
in Computer Vision. Through pixel labeling problems
image restoration, segmentation, problems as stereo and
motion are generalized. In general energy functions like
E are non convex functions in large dimension spaces
and hence very difficult to minimize. However, when
these energy functions have special characteristics, it is
possible to find their exact minimum using dynamic
programming [8-9]. A property of a graph cut C is that
it can be related to a labeling f, mapping the set of
vertices V{s, t} of a graph G to the set {0, 1}, where
f(v) = 0, if v S, and f(v) = 1, if v T. A labeling
problem is specified in terms of a set of site S and a set
of label L. Consider a random field consisting of a set of
discrete random variable F = {F1,F2,,Fn} defined on
the set S, such that each variable Fs takes one of labels
fs in L, where s is index of the set of sites. For a discrete
label set L, the probability that random variable Fs takes
the value fs is denoted P(fs), and the joint probability is
denoted P(f), where f = {f1,f2,,fn}. Here, f is a
configuration of F, corresponding to a realization of the
field [7].

2. PREVIOUS APPROACHES
Mean shift method
Its a non-parametric feature-space analysis technique, a
so-called mode seeking algorithm. Mean shift is a
procedure for locating the maxima of a density function
given discrete data sampled from that function. It is
useful for detecting the modes of this density. This is an
iterative method, and we start with an initial estimate x.
Let a kernel function ( )be given. This function
determines the weight of nearby points for re-estimation
of the mean [10]. Typically Gaussian kernel on the
distance to the current estimate is used, ( ) =

. The weighted mean of the density in the


window determined by k is:
( )=

( )

( )

(1)

Where ( )is the neighborhood of x, a set of points for


which k(x) 0. The MS algorithm is a robust featurespace analysis approach which can be applied to
discontinuity preserving smoothing and image

segmentation problems. It can significantly reduce the


number of basic image entities, and due to the good
discontinuity preserving filtering characteristic, the
salient features of the overall image are retained. The
latter property is particularly important in the
partitioning of natural images, in which only several
distinct regions are used in representing different scenes
such as sky, lake, sand beach, person, and animal,
where as other information within a region is often less
important and can be neglected. However, it is difficult
to partition a natural image into significative regions to
represent distinct scenes, depending only on the MS
segmentation algorithm. The main reason is that the MS
algorithm is an unsupervised clustering-based
segmentation method, where the number and the shape
of the data cluster are unknown a priori. Moreover, the
termination of the segmentation process is based on
some region-merging strategy applied to the filtered
image result, and the number of regions in the
segmented image is mainly determined by the minimum
number of pixels in a region, which is denoted as M (i.e.
regions containing less than M pixels will be eliminated
and merged into its neighboring region) [10]. Mean
Shift is considered a robust technique used for image
segmentation, visual tracking etc. Mean shift method is
an iterative mode detection algorithm in the density
distribution space or a tool for finding modes in a set of
data samples. Mean shift procedure is as follows:
1. Find a window around each data point.
2. Compute the mean of data within the window.
3. Translate density estimation window.
4. Shift the window to the mean and repeat till
convergence [11].
Watershed technique
A grey-level image may be seen as a topographic relief,
where the grey level of a pixel is interpreted as its
altitude in the relief. A drop of water falling on a
topographic relief flows along a path to finally reach a
local minimum. Intuitively, the watershed of a relief
corresponds to the limits of the adjacent catchment
basins of the drops of water. In image processing,
different watershed lines may be computed. In graphs,
some may be defined on the nodes, on the edges, or
hybrid lines on both nodes and edges. Watersheds may
also be defined in the continuous domain. There are also
many different algorithms to compute watersheds. For a
segmentation purpose, the gradient magnitude (i.e., the
length of the gradient vectors) is interpreted as elevation
information. Watershed transformation also called, as
watershed method is a powerful mathematical
morphological tool for the image segmentation. It is
more popular in the fields like biomedical and medical

www.ijsret.org

683

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882
Volume 3, Issue 3, June 2014

image processing, and computer vision [12]. In


geography, watershed means the ridge that divides areas
drained by different river systems. If image is viewed as
geological landscape, the watershed lines determine
boundaries which separate image regions. The
watershed transform computes catchment basins and
ridgelines (also known as watershed lines), where
catchment basins corresponding to image regions and
ridgelines relating to region boundaries [13].
Segmentation by watershed embodies many of the
concepts of the three techniques such as threshold
based, edge based and region based segmentation.

3. GRAPH CUT METHOD


Image segmentation relates basically background and
object which can be employed as binary labeling
problem. Boykov et al. [14] mentioned the
segmentation of a monochrome image that solves a two
labels problem in the graph cut method. Considering a
set of labels L and a set of sites S, the labeling problem
can be assigned as a label
and each of the
site . The label set L= {0, 1} where 0 indicates
background and 1 indicates object. For a labeling
problem if f= | for all pixels, the energy
minimization Markov Random Field (MRF) equation
[10] can be written as:
( )=

{ , }

).

)
(2)
In the energy minimization equation, the first term
called as data term consists of constraints from the
observed data and measures how the labels are
assigned. Label fp fits with site p and is measured by
Dp. The second term which is the smoothness term
measures to what extent f is not piecewise smooth. N
represents the neighborhood system like 4 or 8connected system. If f = f , T(f f )becomes 0 and
1 otherwise. In image segmentation it is expected the
boundary to be positioned on the edges. Hence the
typical selection of
is:
=

Graph cuts method has attracted a lot of attention for


image segmentation. The graph cuts method is one of
minimizing energy functions elegantly expressed as
MRF (Markov random field), Such energy
minimizations problems can be reduced to instances of
the maximum flow problem in a graph (and thus, by the
max-flow min-cut theorem, define a minimal cut of the
graph). Under most formulations of such problems in
computer vision, the minimum energy solution
corresponds to the maximum a posteriori estimate of a
solution. Although many computer vision algorithms
involve cutting a graph (e.g. normalized cuts), the term
"graph cuts" is applied specifically to those models
which employ a max-flow/min-cut optimization (other
graph cutting algorithms may be considered as graph
partitioning algorithms)."Binary" problems (such as
denoising a binary image) can be solved exactly using
this approach; problems where pixels can be labelled
with more than two different labels (such as stereo
correspondence, or denoising of a grayscale image)
cannot be solved exactly, but solutions produced are
usually near the global optimum.
In the Bayesian statistical context of smoothing noisy
(or corrupted) images, they showed how the maximum
a posteriori estimate of a binary image can be obtained
exactly by maximizing the flow through an associated
image network, involving the introduction of a source
and sink, using min cut max flow algorithm [8].

1
( , )

(3)

Color values of Sites p and q are represented by Ip and


Iq along with distance between p and q is presented by
dist (p,q). Level of variation between neighboring sites
is expressed by the parameter . The relative
importance of the data term versus smoothness term is
revealed by the parameter [14].

Fig.1: Graph cut for image segmentation (source and


sink) [8].
Notations:
Image: { , , }
Output: Segmentation (also called opacity)
S {R}
(soft segmentation). For hard
segmentation
S { 0 for background , 1 for foreground/
object to be detected }
Energy function: ( , , , )where C is the
color parameter and is the coherence
parameter.
( , , , )=

+
Optimization: The segmentation can be estimated as a
( , , , ) [7].
global minimum over :

www.ijsret.org

684

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882
Volume 3, Issue 3, June 2014

4. EXPERIMENTS RESULTS
To verify the effectiveness of the proposed graph cut
method, quantitative evaluation was tested with natural
color and the real MRI brain images, and for
comparison, two methods were applied to the same test.
The performance of image segmentation on the test set
was evaluated in terms of visually and the subjective
parameters such as PSNR, MSE and the computational
TIME.
Table 1 shows list the PSNR, MSE and TIME on the
test set. The proposed method outperformed the
previous two methods on the test set, and it was closer
to human segmentation than other algorithms. The
problems of previous two methods for image
segmentation are as follows the result of The MS
undesirably produced a very large number of small but
quasi-homogeneous regions as shown in figure shown.
This is equal to the problem of the image domain-based
segmentation, as the mean shift procedure is performed
only in an image domain. Thus, the MS is sensitive to
noises, as affected by edge information. Therefore, the
gradient based method (watershed technique) is also not
found suitable as these are observed that they are highly
sensitive to noise and not segmenting the discontinuities
in the image, only identifies the outer boundaries so this
is a major drawback of the watershed algorithm.

showed better performance than other two methods, in


any cases of classes with arbitrary-shapes, then
proposed method is applied to real brain MRI images.
As the PSNR and MSE and TIME of the proposed
method is high, low, less respectively. This makes this
method accurate and efficient for real images.
From figure (a-o) the results obtained by applying the
image segmentation methods on the any of the image
and the real MRI images.
The results are compared visually and using subjective
parameter such as PSNR, MSE and Computational
Time.

Fig. a: shows input and grey


level image

Table 1: Comparison using different parameters


Image Segmentati PSNR MS COMPUTA
on Tech.
E
TION TIME
Mean shift
8.499 929 4.30
3
Watershed
26
162
1.8
Graphcut
26.9
147 5.3
Image (adjacant)
1
Graph cut 26.60 142 5.5
(k-nearest)
7
Mean shift
14.28 230 3.88
Watershed
27.17 0
125 1.6
Image Graph cut
2
(adjacant)
65
120 3.77

Image
3

Graph cut
(k-nearest)
Mean shift
Watershed
Graph cut
(adjacant)
Graph cut
(k-nearest)

Fig. c: shows result for


Watershed

Fig. b: Shows result for


mean shift

Fig. d: shows result for


adjacent neighborhood G.C

28
12
27
28

100
400
0
127
109

3.77
4.32
1.55
1.42

29.5

170

1.5

The proposed method as shown in figure shown have


properly segments the image consist of two outputs
(adjacent neighbourhood and k nearest neighboured),
less sensitive to noises and overcame the problem and

Fig. e: result for k nearest


Fig. f: shows input and grey
Neighborhood graph cut
level image

www.ijsret.org

685

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882
Volume 3, Issue 3, June 2014

Fig. o: result for k nearest Neighborhood graph cut


Fig. g: shows result for mean
shift

Fig. h: shows result for


watershed

80
60
PSNR 40
20
0
image 3 image 4 image 5

Fig. i: shows result for adj


acent neighborhood Graph
cut

Fig. j: shows result for knearest Neighborhood


Graph cut

MEAN SHIFT

WATERSHED

GRAPH CUT(A)

GRAPH CUT(K)

Figure p: Comparison of PSNR for image 1, image 2 and


image 3 with different methods
4000
3000
MSE 2000
1000
0
image 1image 2
2image 3

Fig. k: shows input and grey


level image

Fig. l: result show for mean


shift

MEAN SHIFT

WATERSHED

GRAPH CUT(A)

GRAPH CUT(K)

Figure q: Comparison of MSE for image 1, image 2 and


image 3 with different methods
5
4
3
TIME
2
1
0
image 3 image 4 image 5

Fig. m: shows result for


Watershed

Fig. n: shows result for adj-acent neighborhood graphcut

MEAN SHIFT

WATERSHED

GRAPH CUT(A)

GRAPH CUT(K)

Figure r: Comparison of TIME for image 1, image 2 and


image 3 with different methods

www.ijsret.org

686

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882
Volume 3, Issue 3, June 2014

5. CONCLUSION
From the results obtained, it is evident that the
automatic graph cut method is capable of accurately
segmenting any of the arbitrary shapes at the cost of
computational time, as it overcame the problems from
the graph cut using GMM approach of segmentation
which is only applicable to the hyper-spherical and
hyper-ellipsoidal classes. This technique is also highly
efficient in segmenting the brain tissues and other brain
element in brain MRI images.

REFRENCES
[1] H.P. Narkhede, Review of Image Segmentation
Techniques International Journal of Science and
Modern Engineering (IJISME) ISSN: 2319-6386, Vol.1,
Issue 8, July, 2013.
[2] S. Tripathi, K. Kumar, B.K.Singh, R.P.Singh,
Image Segmentation: A Review, International Journal
of Computer Science and Management Research, Vol.
1, Issue 4, November, 2012.
[3] L. Lucchese and S.K. Mitra, Color Image
Segmentation: A State-of-the-Art Survey, Proceedings
of the Indian National Science Academy (INSA-A),
67(2): pp. 207221, 2001.
[4] L. Vincent and P. Soille, Watersheds in Digital
Space: An Efficient Algorithm based on Immersion
Simulation, IEEE Transactions on Pattern Analysis
and Machine Intelligence, 13(6): pp. 583597, 1991.
[5] D. Comaniciu and P. Meer, Mean Shift: A Robust
Approach toward Feature Space Analysis, IEEE
Transactions on Pattern Analysis and Machine
Intelligence, 23(5): pp. 603619, 2002.
[6] S. Makrogiannis, G. Economou, and S. Fotopoulos,
A Region Dissimilarity Relation that Combines
Feature-Space and Spatial Information for Color
Segmentation, IEEE Transactions on System, Man,
and Cybernetics, Part B, 35(1): pp. 4453, 2005.
[7] A. Park, J. Kim, S. Min, S. Yun, K. Jung, Graph
Cuts based Automatic Color Image Segmentation using
Mean Shift Analysis IEEE Digital Image Computing:
Techniques and Applications, 2008.
[8] Y. Boykov, V. Kolmogorov, An experimental
comparison of min-cut/max-flow algorithms for energy
minimization in vision, IEEE Trans, Pattern Anal.
Machine Intell., 26, pp. 11241137, 2004.
[9] Geman, S., Geman, D., Stochastic relaxation, gibbs
distributions, and the Bayesian restoration of images,
IEEE Trans, Pattern Anal. Machine Intell, pp. 721741,
1984.
[10]M. Sonka, V. Hlavac and R. Boyle, Image
processing, analysis, and machine vision, Third
edition, Thomson, USA, 2008.

[11] G. kaur Seerha, R. kaur, Review on Recent Image


Segmentation Techniques, International Journal on
Computer Science and Engineering (IJCSE) ISSN:
0975-3397 Vol. 5 No. 02, Feb, 2013.
[12] Md. Shakowat Z. Sarker, T. Wooi Haw and R.
Logeswaran, Morphological based technique for image
segmentation, International Journal of Information
Technology, Vol. 14, No. 1, 2004.
[13] M. Bhagwat, R. K. Krishna and V. Pise,
Simplifed Watershed Transformation, International
Journal of Computer Science and Communication,
Vol.1, No. 1, pp. 175-177, 2010.
[14] Y. Boykov and M. Jolly, Interactive graph cuts for
optimal boundary and region segmentation of objects in
n-d images, Proceedings of ICCV, 2001.
[15] W. Tao, H. Jin, Senior Member, IEEE, and Yimin
Zhang, Senior Member, IEEE, Color Image
Segmentation Based on Mean Shift and Normalized
Cuts IEEE
Transactions on Systems, Man, and
CyberneticsPart B: Cybernetics, Vol. 37, No. 5, pp.
345-354, October 2007.
[16] J. Mo, C. Wang, T. Zhang, H. Yua, Improved
graph-based image segmentation based on Mean Shift
1 Communications and Networking in China, 8th
International ICST Conference on Digital Object
Identifier: 10.1109/ChinaCom.2013.6694680, pp. 685
689, 2013.
[17] W. Ming Chen, S. Hao Jhang, Improving Graph
Cuts algorithm to transform sequence of stereo image to
depth map The Journal of Systems and Software 86,
pp. 198 210, 2013.
[18] Dedic, R. Allili, Madjid, A novel cooperative
approach for cardiac PET image
segmentation
Information Science, Signal Processing and their
Applications (ISSPA), 2012 11th International
Conference
on
Digital
Object
Identifier:
10.1109/ISSPA.2012.6310474 pp. 11 16,2012.
[19] B. Padmapriya, T. Kesavamurthi, H. Wassim
Ferose, Edge Based Image Segmentation Technique
for Detection and Estimation of the Bladder Wall
Thickness Procedia Engineering 30, pp. 828 835,
2012.
[20] C. Ballangan, X. Wang, M. Fulham, S. Eberl, D.
Dagan Feng, lung tumor segmentation in pet images
using graph cuts computer methods and programs in
biomedicine 1 09, pp. 260268, 2013.

www.ijsret.org

687

You might also like