Anda di halaman 1dari 6

Seminar Nasional Sistem dan Informatika 2006; Bali, November 17, 2006

SNSI06-047

IMAGE SEGMENTATION USING ACTIVE CONTOUR (SNAKE)
Cherry Ballangan1) Rudy Adipranata2) William Nugroho
Informatics Department, Petra Christian University, Surabaya
cherry@peter.petra.ac.id1) rudya@peter.petra.ac.id2)
ABSTRAK
Segmentasi gambar (image segmentation) merupakan salah satu bagian yang penting dalam ilmu pengolahan gambar.
Segmentasi gambar memisahkan bagian-bagian dari sebuah gambar sehingga nantinya analisa gambar dapat dilakukan
bagian demi bagian, tanpa harus memproses bagian-bagian yang tidak diperlukan. Mendisain sebuah metode
segmentasi gambar yang akurat masih merupakan suatu tantangan dan sekaligus juga dorongan bagi para peneliti untuk
mengembangkan metode-metode yang sudah ada dan juga merumuskan metode yang baru. Dalam tulisan ini, active
contour digunakan untuk meningkatkan akurasi pendeteksian pinggiran (boundary) suatu obyek. Active contour, atau
snake, adalah spline yang meminimumkan energi dan dapat digunakan dalam mendeteksi pinggiran suatu obyek.
Segmentasi gambar berdasarkan active contour ini terdiri dari beberapa langkah. Pertama, beberapa pemrosesan awal
dilakukan untuk meningkatkan hasil segmentasi gambar. Setelah itu sebuah kontur/kurva diinisialisasi di luar daerah
yang diinginkan. Kemudian setelah menghitung semua parameter, active contour mulai diproses untuk mendapatkan
pinggiran dari obyek yang diinginkan. Agar dapat mendeteksi pinggiran suatu obyek, turunan pertama dari gambar
input perlu didapatkan. Akhirnya, akibat dari energi eksternal dari snake, kontur akan merayap ke arah yang diinginkan,
sampai kontur tersebut konvergen pada sebuah obyek yang dikehendaki. Beberapa eksperimen telah dilakukan untuk
mengesahkan algoritma image segmentation ini. Percobaan-percobaan tersebut menunjukkan bahwa active contour
dapat menghasilkan image segmentation yang baik. Semakin tinggi nilai parameter alfa dan beta, makin dekat hasil
akhir kontur kepada obyek. Makin tinggi nilai parameter delta, makin cepat kontur bergerak, hanya saja kontur dapat
melewati pinggiran suatu obyek. Nilai delta yang kecil akan menyebabkan kontur bergerak perlahan-lahan tapi tidak
melewati batas pinggiran suatu obyek. Beberapa pemrosesan awal diperlukan untuk memperoleh hasil yang lebih baik.
Kata kunci: Segmentasi Gambar, Active Contour, Pengolahan Gambar Digital.

1.

Introduction

With the advances of digital imaging technologies, the field of computer vision and digital image processing develop
rapidly. Computer vision has contributed significantly to other fields such as robotics, computational intelligence,
entertainment as well as medical imaging. Along with computer vision, digital image processing is often needed to
acquire important information from digital images. One of many important tasks in image processing is image
segmentation.
Image segmentation is a process to separate an object from its background or from other objects in an image. Object
separation is useful when further processes need to be applied to an object, without modifying other parts of the object
such as the background. Since the result of image segmentation will affect the next processes conducted, developing an
accurate image segmentation is a crucial process. There are three types of image segmentation:

Classification-based, segmentation based on similarity of pixels. The easiest way to perform this type of
segmentation is by using a threshold.

Edge-based, segmentation process to obtain a line in an image which is considered as an edge of an object. The
edge will separate an object from its background or from other objects.

Region-based, segmentation is performed based on collection of pixels that have many types of associations
such as texture, color or gray level, and starts from a point within the image to other neighborhood points.
In this paper, an image segmentation system is designed to obtain a good result with a fast process. This segmentation
method employs an active contour which will be described in Section 2. The whole system of the method is presented in
Section 3, followed by the presentation of some experiment results in Section 4 and then concluded in Section 5.

2.

Active Contour

Active contour, also called as snake, is a spline that uses the energy minimization procedure to impose a contour toward a
particular feature. The method was first proposed by Kass et al[2]. Active contour is a popular method in computer vision
as well as digital image processing area[1,3,4,6]. Snake is mathematically represented using the following equation:
1

E snake = ∫ Eint (v( s)) + Eimg (v( s)) + Econ (v( s))ds
s =0

where:



E snake is the energy function of the active contour from which an object is detected.
v(s ) is the contour (curve).
Eint is the internal energy of the active contour affecting the motion of the contour.
Eimg is energy from the input image including low level features such as edge points.
296

(1)

and A is a penta-diagonal matrix having the following pattern: 0 . . Segmentation Method The proposed image segmentation method consists of four main steps: preprocessing. Depending on the nature of the input image. in that the detail of the image is kept while the noise is reduced... a s −1 bs −1 c s −1 d s −1  d .299R + 0. Gray scaling is a process to convert a colored image. The y position of the contour points can be obtained in similar way using the following equation: −1  1   1 (i )  ( i +1) (6) y = A+ I  y + f y ( x... Eint is given by: Eint = α ( s ) dv ( s ) 2 + β (s) ds 2 d v(s) ds 2 2 (2) where: • The derivative dv ( s ) / ds calculates the energy affecting the elasticity of the contour. Blurring in this preprocessing is performed to thicken the edge of an object. into a gray level image. and contour deformation .. . The active contour formula shown in Equation 1 is further expressed numerically using the following equation[5]: Ax = f x ( x ...Seminar Nasional Sistem dan Informatika 2006. In this paper. . .The flowchart of the system is presented in Figure 1. There are many different approaches to perform this conversion.. the following formula is used to obtain the gray level of each pixel: 0... a 2   2 c 2 d 2 e2  a3 b3 c3 d 3 0 .. xi+1 is the new x position of the contour.. y )   ∆  ∆  where I is an identity matrix.   . as bs c s   s es 0 The values of a. d and e can be obtained by using the following equations: as = (3) β s −1 h 4 bs = − (4) 2( β s + β s −1 ) α s β β β α α 2( β s +1 + β s ) α s +1 β − 2 c s = s +1 4s s −1 + s +12 s d s = − − 2 e s = s4+1 4 4 h h h h h h h where s represents the index of the contour points and h is the space between points in the contour. Gaussian blur is used.114B.. RGB image. 2006 • SNSI06-047 E con is the external constraint imposed by either users or high level processes.g. In this experiment. Gaussian is one of many powerful smoothing filters.... y ) where f x ( x. .    e s −1 0 . .. a1 b1   c1 d1 e1 b 0 .... e.587G + 0. This step consists of four tasks: gray scaling.... 3.. and delta is a step size. y ) is the edge magnitude of the image..1 Preprocessing Preprocessing is an optional step and aims to produce a better segmentation.. b..  e3   A =  0 . y )   ∆  ∆  3... each process can be chosen to enhance the result. initialization. 2 2 • The second derivative d v ( s ) / ds calculates the energy affecting the curvature of the contour • β (s ) is the parameter for curvature.... An iterative solution can then be formulated as follows: −1 1   1 (i )  ( i +1)  (5) x =A+ I  x + f x ( x.. ... . blurring. 297 .. • α (s ) is the parameter for elasticity. . Bali. November 17. . parameter calculation. c. color inversion and threshold. .

and Figure 6.4 Snake deformation After all the elements of the active contour formula are calculated. Different values of alpha. beta = 0. see Equation 4). The closer the initial contour to the desired boundary. Alpha and beta are part of the internal force. The first result that will be presented here has been pre-processed using all the preprocessing option as described in Section 3. The flowchart of this step is given in Figure 2. 3. The result of this experiment is shown in Figure 3. Bali. The result of this process is known as negative images. The number of points of the initial contour also affects the size of matrix A. beta and delta have been observed as well. 3. the contour can be deformed by calculating the x and y position of each iteration.0. for various values of beta. and setting alpha = 1. beta and delta. Result and Discussion The method has been implemented into segmentation software to validate the proposed method. Figure 5. until it stops when it converges to the desired boundary.3 Parameter Calculation As described in Section 2. This includes the initialization of the active contour (initial contour) and also the initialization of the matrix that is needed to deform the contour (matrix A. active contour is influenced by three parameters: alpha. This is done by using the formula in Equations 5 and 6. 298 . 4. Both alpha and beta have values in the range of 0 and 1 whereas delta can be any value greater than 0. The experiments were performed on the same image. 2006 SNSI06-047 Figure 1. The results of these experiments are presented in Figure 4. for various values of delta.7 and delta = 12. and will be used to calculate matrix A. 3. for various values of alpha.2 Initialization The initialization step is an important step as it affects the success of the process of active contour. whereas delta is used to process matrix I and also affects vector x and y which are the x and y position of the contour points. Flowchart of the Image Segmentation System The color inversion process is a simple process that changes the low value pixel into high value and vice versa. the more success is the segmentation. with size 170 × 194 pixels and used the gray scaling and threshold preprocessing. Threshold is a process to convert a gray level image into a binary image with a threshold value as a limit that determines whether a gray level pixel will be converted into 0 (black) or 255 (white). November 17.Seminar Nasional Sistem dan Informatika 2006.0.

Contour Deformation Input image with initial contour Active contour after converged Segmentation result. Segmentation Result Using Alpha = 1. it determines the shape of the contour. Bali. 299 . However.7 and Delta = 12. the closer the contour converges to the object. Figure 6 shows that if the value of delta is big.Seminar Nasional Sistem dan Informatika 2006. 2006 SNSI06-047 Figure 2. November 17. the converged contour is closer to the desired object. after cropped Figure 3. Figure 5 shows that the variation of beta values does not significantly effect the convergence process.0 It can be seen in Figure 4 that the bigger the value of alpha.0. Beta = 0.

5.Seminar Nasional Sistem dan Informatika 2006. Figure 8 illustrates this problem.5 Beta 0. The experiment results are presented in Figure 7 for the preprocessing invert process and in Figure for the threshold process.1 Beta 0. Segmentation Result Using Different Values Of Beta.1 Alpha 0. Segmentation Result Using Different Values Of Beta. Alpha Is Set To 1. 300 . Alpha Is Set To 0.5 And Delta To 8. Beta Is Set To 0.7 And Delta To 8. Beta 0. Bali.9 Alpha 1 Figure 4. thus will help the contour to detect the edge.9 Beta 1 Figure 5.7 Alpha 0. 2006 Alpha 0. Delta 4 Delta 5 Delta 6 Delta 7 Delta 8 Delta 9 Figure 6.3 SNSI06-047 Alpha 0. Preprocessing invert is important when the gray value of the object is greater than the gray value of the background.0 And Beta 0. Segmentation Results Using Different Values Of Alpha. in this case. will change the edge value of the image. Inversion. November 17.7 Beta 0.0. Some experiments to analyze the effect of preprocessing have also been carried out.3 Beta 0. Preprocessing threshold is essential to omit unnecessary edges so that it would not interfere the segmentation process.5 Alpha 0.0.

Beta = 0.. An Active Contour Model for Mapping the Cortex. A. K. B. Chwa. (1995). Nixon. Shin. 439-448. 1. Wang. IEEE Transactions on Image Processing. Feature Extraction and Image Processing. 302 . the faster the contour moves to the desired object. Oxford: Newnes.. M. S. In addition. International Journal of Computer Vision. The higher the value of alpha and beta. The Segmentation Result of Inverted Images Using Alpha = 1. A.. In 17th IEEE Symposium on Computer-Based Medical Systems.0. Beta = 0. P. 321-331. S. (1995). although the value of beta is not as significant as the value of alpha.8 and Delta = 8. November 17..Seminar Nasional Sistem dan Informatika 2006. & Terzopoulos. M. 292-297). & Prince. Witkin. 9(2). The experiment results show that active contour can be well used for image segmentation. Bali. 65-80. An Automated. Y. G. S. Geometric active deformable models in shape modeling. H. some preprocessing may improve the performance of the segmentation. The Segmentation Result of Threshold Using Alpha = 1.. Lee. The greater the value of delta. B.308. L. IEEE Transactions on Medical Imaging. & Wolberg.-Y.-Y. Bibliography [1] [2] [3] [4] [5] [6] Davatzikos. & Nutter. King... Mitra. 2006 SNSI06-047 Original Image With Initial Contour Inverted Image Original Image with Converged Contour (fail to detect the edge) Inverted Image with Converged Contour Figure 7. Proceedings (pp.0 Original Image with Initial Contour Threshold Image Original Image with Converged Contour (fail to detect the edge) Threshold Image with Converged Contour Figure 8. Segmentation-Based. Snakes: Active Contour Models.. D. 14(1). 5. C. Kass. Conclusion An image segmentation system using active contour have been designed and implemented. Image Metamorphosis Using Snakes and Free-Form Deformations. ACM. A. Choices of parameter values might affect the result of the segmentation. the closer the converged contour to the object. & Aguado.. (1988). & Ghosh. (2004).. (2000). (2002).8 And Delta = 8. Rigid Registration System For Cervigram/Spl Trade/ Images Utilizing Simple Clustering and Active Contour Techniques. 301 . J.