Sunteți pe pagina 1din 8

Active contour model

From Wikipedia, the free encyclopedia

Active contour model, also called snakes, is a framework for delineating an object outline from a possibly noisy 2D image. This framework attempts to minimize an energy associated to the current contour as a sum of an internal and external energy: The external energy is supposed to be minimal when the snake is at the object boundary position. The most straightforward approach consists in giving low values when the regularized gradient around the contour position reaches its peak value. The internal energy is supposed to be minimal when the snake has a shape which is supposed to be relevant considering the shape of the sought object. The most straightforward approach grants high energy to elongated contours (elastic force) and to bended/high curvature contours (rigid force), considering the shape should be as regular and smooth as possible. The snakes model is popular in computer vision, and led to several developments in 2D and 3D. In two dimensions, the active shape model represents a discrete version of this approach, taking advantage of the point distribution model to restrict the shape range to an explicit domain learned from a training set.

Snakes active deformable models

Contents
1 Introduction 2 Energy function 2.1 Internal energy 2.2 Image forces 2.2.1 Line functional 2.2.2 Edge functional 2.2.3 Scale space 2.2.4 Termination functional

2.3 Constraint energy 3 Implementation 3.1 Pseudo code 4 Advantages and drawbacks 5 Other implementations of snakes 5.1 GVF active contours 5.2 Balloon snake 5.3 Diffusion snakes 6 Sample code 7 See also 8 References

Introduction
Snake is an energy minimizing, deformable spline influenced by constraint and image forces that pull it towards object contours. Snakes are greatly used in applications like object tracking, shape recognition, segmentation, edge detection, stereo matching. Snakes may be understood as a special case of general technique of matching a deformable model to an image by means of energy minimization.[1] Snake is an active model as it always minimizes its energy functional and therefore exhibits dynamic behavior. A simple elastic snake is thus defined by a set of n points an internal elastic energy term an external edge based energy term One may visualize the snake as a rubber band of arbitrary shape that is deforming with time trying to get as close as possible to the object contour. Snakes do not solve the entire problem of finding contours in images, but rather, they depend on other mechanisms like interaction with a user, interaction with some higher level image understanding process, or information from image data adjacent in time or space. In general, Snake is placed near the object contour. It will dynamically move towards object contour by minimizing its energy iteratively.

Energy function
In Snakes, we use the technique of matching a deformable model to an image by means of energy minimization. A snake initialized near the target gets refined iteratively and is attracted towards the salient contour. A snake in the image can be represented as a set of n points.

where We can write its energy function as

Eexternal = Eimage + Econ


where Einternal represents the internal energy of the spline (snake) due to bending, Eimage denotes the image forces acting on spline and Econ serves as external constraint forces introduced by user. The combination of Eimage and Econ can be represented as Eexternal, that denote the external energy acting on the spline.

Internal energy
Internal Energy of the snake is Einternal =

Econt + Ecurv [2]

where Econt denotes the energy of the snake contour and Ecurv denotes the energy of the spline curvature.

The first-order term makes the snake act like a membrane and second-order term makes it act like a thin plate. Large values of (s) will increase the internal energy of the snake as it stretches more and more, where as small values of (s) will make the energy function insensitive to the amount of stretch. Similarly, large values of (s) will increase the internal energy of the snake as it develops more curves, whereas small values of (s) will make the energy function insensitive to curves in the snake. Smaller values of both (s) and (s) will place fewer constraints on the size and shape of the snake.

Image forces
Further, Eimage has three components: Lines Edges Terminations The energies can be represented as follows:

Eimage = wlineEline + wedgeEedge + wtermEterm


Adjusting the weights in the image will determine salient features in the image which will be considered by the snake. Line functional A line functional is nothing but the intensity of the image, which can be represented as

Eline = I(x,y)
Depending on the sign of wline, the line will be attracted to either dark lines or light lines. Edge functional Edges in the image can be found by the following energy function which will make the snake attract towards contours with large image gradients.

Scale space It is rather common that a snake started far from the object converges to the desired object contour. If a part of the snake finds a low energy feature, it pulls the other parts of the snake to continue to the contour. Scale Space continuation can be used in order to achieve desired results. One can allow the snake to come to equilibrium on a blurry energy edge functional and reduce the blurring as the calculation progresses. The energy functional is

Where G is a Gaussian standard deviation minima of this functional lie on zero-crossings of which define edges in Marr-Hildreth Theory. Thus the snake gets attracted towards zero-crossing constrained by its own smoothness. Termination functional Curvature of level lines in a slightly smoothed image is used to detect corners and terminations in an image. Let C(x,y) = be the gradient angle. And let be unit vectors along and perpendicular to the gradient direction. The termination functional of energy can be represented as

G * I(x,y) be a slightly smoothed version of the image.Let

Constraint energy
Some systems, including the original snakes implementation, allowed for user interaction to guide the snakes, not only in initial placement but also in their energy terms. Such constraint energy Econ can be used to interactively guide the snakes towards or away from particular features.

Implementation

Gradient-descent minimization [3] is one of the simple optimization which can be used to minimize snake energy. For example, lets consider a function of only one variable. If we have a starting guess at the value of the solution,we can look at the slope at that point and decide to increment our solution (negative slope) or decrement our solution (positive slope). Notice the negation there: if the slope is positive, downhill is backwards; and if the slope is negative, downhill is forwards. We can thus implement gradient-descent minimization as and Where controls the size of the step at each iteration. Vector representation: We can approximate the energy function of the snake by using the discrete points on the snake.

The derivative of above sum is nothing but the sum of derivatives.

Now we should iteratively adjust the points vector

by using gradient descent minimization.

Applying the derivative to energy function gives

Derivative of internal Energy of the image can be solved as

These can be approximated using finite differencesthe second derivative w.r.t. s can be calculated using three adjacent points on the snake, and the fourth derivative w.r.t. s can be calculated using five adjacent points. It also helps to separate the x and y components. Final equations are

Where

Eexternal = Eimage + Econ


Pseudo code
1. Before entering the iteration calculate 2. At the start of the iteration, calculate and the derivatives of this w.r.t. x and y separately. and using the three adjacent points and

using five adjacent points. 3. Then, calculate change in x and y for each point in Use the precalculated .

Advantages and drawbacks


Snakes have multiple advantages over classical feature attraction techniques. 1. Snakes are autonomous and self-adapting in their search for a minimal energy state. 2. They can be easily manipulated using external image forces. 3. They can be made sensitive to image scale by incorporating Gaussian smoothing in the image energy function. 4. They can be used to track dynamic objects in temporal as well as the spatial dimensions. The key drawbacks of the traditional snakes are 1. They can often get stuck in local minima states; this may be overcome by using simulated annealing techniques at the expense of longer computation times. 2. They often overlook minute features in the process of minimizing the energy over the entire path of their contours. 3. Their accuracy is governed by the convergence criteria used in the energy minimization technique; higher accuracies require tighter convergence criteria and hence, longer computation times [4].

Other implementations of snakes


GVF active contours
The snake is developed based on new type of external field,called Gradient Vector Flow, or GVF. This computation causes diffuse forces to exist far from the object, and crisp force vectors near the edges. Combining these forces with the usual internal forces yields a powerful computational object: the GVF snake (2D), or the GVF deformable model (N-D). Even though this snake is started far from the object, it

still gets attracted towards the object[5]. Especially, GVF active contours can handle broken object edges and subjective contours[5].

Balloon snake
In this case,snake behaves like a balloon which is blown up. When it passes by edges, it is stopped if the contour is strong,or passes through if the contour is too weak. Thus, the initial snake need not be too close to the solution(object) to converge. This approach modifies the definition external forces (derived from gradient of the image) presented in traditional snake (Kass et al). A new pressure force is introduced which makes the curve behave like a balloon [6].

Diffusion snakes
The diffusion snake is a modification of the Mumford-Shah functional for spline contours. A modification of the Mumford-Shah functional and its cartoon limit is used to incorporate statistical prior on the shape of the segmenting contour.By minimizing a single energy functional, we obtain a segmentation process which maximizes both the Grey value homogeneity in the separated regions and the similarity of the contour with respect to a set of training shapes [7].

Sample code
1. Practical examples of different snakes developed by Prince and Xu (http://www.icaen.uiowa.edu/~image/Prince-snakes/) 2. Basic tool to play with snakes (active contour models) from Tim Cootes,University of Manchester (http://www.isbe.man.ac.uk/~bim/software/qsnake_demo/qsnake_demo.html) 3. Matlab implementation of 2D and 3D snake including GVF and balloon force (http://www.mathworks.com/matlabcentral/fileexchange/28149) 4. Matlab Snake Demo by Chris Bregler and Malcom Slaney,Interval Research Corporation. (http://www.slaney.org/malcolm/pubs.html) 5. A Demonstration Using Java (http://www.markschulze.net/snakes/)

See also
1. Young, March 1995 (http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/YOUNG/vision7.html,David) 2. Snakes: Active Contours,CVOnline (http://homepages.inf.ed.ac.uk/cgi/rbf/CVONLINE/entries.pl? TAG709) 3. ICBE,University of Manchester (http://www.isbe.man.ac.uk/courses/Computer_Vision/downloads/L11_Snakes.pdf)

References
1. ^ Snakes: Active Contour Models, M Kass, A Witkin, D Terzopoulos, http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.124.5318&rep=rep1&type=pdf 2. ^ Dr. George Bebis,University of Nevada,http://www.cse.unr.edu/~bebis/CS791E/Notes/DeformableContours.pdf 3. ^ Image Understanding,Bryan S. Morse,Brigham Young University,1998-2000

3. ^ Image Understanding,Bryan S. Morse,Brigham Young University,1998-2000 http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MORSE/iu.pdf 4. ^ Snakes: an active model,Ramani Pichumani,http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/RAMANI1/node31.html 5. ^ a b Chenyang Xu and Jerry L. Prince,IACL,http://www.iacl.ece.jhu.edu/static/gvf/ 6. ^ On Active Contour Models, Laurent D. COHEN,http://hal.archives-ouvertes.fr/docs/00/07/54/84/PDF/RR1075.pdf 7. ^ Diffusion Snakes: Statistical Shape Knowledge in Mumford-Shah Based Segmentation,Daniel Cremers, Christoph Schnrr and Joachim Weickert http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/CREMERS2/

Retrieved from "http://en.wikipedia.org/wiki/Active_contour_model" Categories: Computer vision This page was last modified on 5 May 2011 at 13:00. Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. See Terms of Use for details. Wikipedia is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.

S-ar putea să vă placă și