bounds on the elasticity parameters for a snake can be obtained. ... more, it is not unlikely if there exist di erent snake deformations with di erent shapes, but.
Calculating the Bounds on the Optimal Parameters of Elasticity for a Snake Ole Vilhelm Larsen, Petia Radeva Abstract
This paper develops a formalism by which an estimate for the upper and lower bounds on the elasticity parameters for a snake can be obtained. Objects dierent in size and shape give rise to dierent bounds. The bounds can be obtained by analysing the shape of the object of interest. Experiments on synthetic images show a good correlation between the estimated behavior of the snake and the behavior actually observed. Experiments on real x-ray images show that parameters for optimal segmentation lie within the estimated bounds.
Keywords: snakes, parameters of elasticity, model-based segmentation.
1 Introduction Snakes, introduced by Kass et al.[8], can be characterised as a tool for performing model based segmentation. In resent years snakes have attracted much attention due to several advantages compared to traditional segmentation techniques compared to other techniques to nd contours of an object in images [9]. One of them is that the contour can be found even in noisy images and partly occluded objects. This is possible because of implementation of constraints on smoothness of the searched contour. The result of the segmentation process is a snake curve deformation with a predetermine smooth shape and a signi cant rate of coincidence with edge points. Segmentation by snakes is performed by placing an initial snake (normally a closed curve) around the object of interest. Controlled by both external and internal energies the snake starts to deform. The deformation is formulated as an iterative energy minimization which should reach some local minimum when the snake is aligned with the contour of the object. Snakes provide a model based technique since ways exist to incorporate information about the object of interest into the snake formalism. Firstly, an initial snake can be de ned specifying the snake in accordance with the object of interest. Secondly, it is possible by means of controlling the internal energy to constrain the smoothness of the snake. The smoothness required for an accurate segmentation is controlled by the elasticity parameters and is closely related to the shape of the object. 1
Figure 1: Example of circular shapes that can be found by snakes with equal energy
1.1 Parameters of elasticity and snake energy minima
An open question in the snake theory is how to assign the parameters that determine the tolerance between the both constraints (these of smoothness and coincidence). Something more, it is not unlikely if there exist dierent snake deformations with dierent shapes, but with equal internal and external energies, that measure the satisfactions to the smoothness and edge points coincidence constraints. For example, in Fig. 1 one can see that a snake can nd three approximately circular shapes (and so the snake internal energies will be equal). In the smaller and the central circles the amount of edge points is equal and thus the external energies should be equal too. If the external energy is calculated as the rate of found and missing edge points by the snake curve, the larger and the smaller circles will have equal external energies. Naturally, some information about the size of the object we are looking for, will help to solve the ambiguit y of the segmentation process by snakes. It has been thought that the global minimum of the snake total energy corresponds to the correct object's segmentation, but no studies are known to prove it. The segmentation by snakes is undeterministic in sense that we can not be sure that the result of the snake deformation will correspond to the contour we are looking for. It is curious to see that, in fact, any shrinked snake in an edge point has minimal external and internal energies that means that the snake should correspond to the correctly segmented object. This curious fact is valid because in a shrinked snake all the snaxels coincide with edge points (in particular, with one edge point) and the internal energy given by the membrane and the thin-plate energies is vanished. Therefore, we need some more information about the desired nal deformation of the snake before to decide if the segmentation is correct or not. It is necessary to design the snake energy so that its global minimum to correspond to the correct segmentation of the object or to admit that the object contour can be found out by a local minimum of the total energy providing a technique to distinguish this minimum from the remaining minima. We chose the second approach. For this purpose a model-based segmentation by snakes seems many more reliable; information about the possible results of the correct segmentation helps to determine the snake parameters of elasticity and this way the properties of its dynamical behaviour. We would like to note that Kass at el. in their seminal paper on snakes emphasize that high-level knowledge may be implemented in the snake technique in order to improve the segmentation result. There the problem about total energy minimum is not considered. The rstly obtained local minimum of the total snake 2
energy is considered to give us the object's contour. It is easy to see that the length of the snake is directly related to its elastical property (snakes with dierent length and equal elasticity parameters, put in the same potential conditions, have dierent dynamical behaviour). Therefore, we assume we are able to provide an initial snake non shorter than the object contour in the image. It is necessary in order to use the ability of the snake to shrink itself in accordance to its elastical parameters and . Despite the great interest in snakes, estimation of the elasticity parameters has not been given much attention previously. In the known works on snakes these parameters are det ermined empirically or adaptatively in order to assure the slow sliding of the snake. In the work of Samadani [14] the parameters of elasticity are considered. He makes a dynamic estimation and adjustment of the parameters to avoid instability in the deformation proces. Since his estimation is not based on the shape of the object his scope and approach are dierent from the one presented in this paper. We propose to determine them from the information on the models of the objects we are looking for. Thus, dierent parameters of elasticity will provide dierent local energy minima corresponding to the possible objects in the image. We present a new formalism by which the upper and lower bounds on the elasticity parameters for a snake can be obtained through an analysis of the shape of the object. Firstly, the theoretical foundation for the existence of bounds on the parameters is developed independently of the chosen snake implementation. Based on a snake implementation using the Finite Dierence Method (FDM) formulas are then derived for calculating the bounds based on the shape of the object and based on some assumptions about the deformation of a snake. At last experimental results are presented to determine the correlation between the estimated behavior of the snake and the behavior actually observed. By establishing bounds on the parameters the search space for the values giving the best segmentation is limited, and it is the long-term perspective of the work that it should become possible for non-snake experts to determine the correct parameters based on an automatic inspection of the objects of interest.
2 Snake fundamentals A snake is an elastic curve u(s) = (x(s); y(s)), where s is the arc-length of the curve, for which an energy function Esnake is de ned based on an internal energy Eint and an external energy Eext :
Esnake =
Z
0
1
Eint(u(s)) + Eext(u(s)):
The internal energy is given by the sum of the membrane energy and the thin-plate energy:
Eint(u(s)) = Emembrane + Ethin?plate = u0(s) + u00(s) 3
The parameters and are called parameters of elasticity. controls the stretching and the bending of each curve segment. For simplicity the parameters are normally chosen to be temporally and spatially constant. Usually, the external energy is obtained from a potential eld derived from the image. It is typically derived as the image gradient [8] or as a distance map of the edge points [3]. In this work we use the latter de nition leading to the following expression,
Eext(u(s)) = P (x; y) = d(x; y) where d(x; y) is the distance between pixel (x; y) and the closest edge point. In this way the potential eld is constructed so that its valleys correspond to the edge points of the image. Minimizing the snake external energy the snake is attracted towards the edge points of the original image, while minimizing the internal energy smooths the snake shape. The result of the segmentation by snakes is obtained when the snake detects a minimum of the total energy. High values of the parameters of elasticity put great weight on the internal energies and consequently give a smooth curve. In general we want the parameters to be as high as possible as it will decrease the risk of the snake being attracted to spurious noisy edges during its iterations [3]. However, if the parameters become too high problems in terms of surpassing of the contour will occur. Surpassing can be de ned as snake braking through the contour of the object. This can happen on a small part of the contour or on the entire contour. The following de nitions for local and global surpassing and the parameters related to the occurrences can be stated,
De nition 2.1 Let a contour of an object be represented as a valley in a potential eld.
Consider a snake, uc , of length n to be placed in the valley. The area around the valley where a deformed version, ut, of the snake maintain a distance to uc less than n (i.e. jjut ? ucjj < n) is called the -neighborhood of the contour valley. is some predetermined constant.
Note: If we choose the norm to be the rst norm using as a potential eld a distance map (i.e. the potential in each pixel is equal to the distance to an edge), it is easy to see that the distance between a snake in a contour and a snake in the contour neighbourhood is equal to the potential energy of the snake ut: jjut ? ucjj = 1
n X i=0
jP (ut;i) ? P (uc;i)j =
n X i=0
P (ut;i):
It is true because the potential energy of a snake in a potential valley is 0 (P (uc;i) = 0; i n) and the potential energy has a non negative value (P (ut;i) 0).
De nition 2.2 Let there be given a valley corresponding to the object contour and a closed
snake u0 with length n greater or equal to the contour length and positioned around the object. Let the snake shrink to a snake uc positioned in the valley. Local surpassing is when the snake in the process of energy minimization moves one or
4
Figure 2: Three dierent situations for segmentation of a bone structure in an x-ray image. Upper left shows the initial snake and upper right the snake when shrunk to the contour valley. Lower left shows local surpassing (in black) and lower right show global surpassing (in black) by the snake. The contour of the snake is given in white. more snaxels out of the valley. Global surpassing is when the majority of the snaxels move out of the valley and the snake deforms to a snake outside an -neighborhood given a constant .
De nition 2.3 The maximum values of the elasticity parameters and for a snake which do not give rise to any local surpassing are called local optimal parameters. The maximum values that given some do not give rise to any global surpassing are called global optimal parameters. An illustration of local and global surpassing is given in gure 2. For all objects the best overall approximation of their contour by snakes is achieved by allowing some minimal local surpassing at the sharp corners. The local parameters can therefore be seen as the lower bound of the parameter giving an optimal segmentation in the sense that they are the minimal parameters of elasticity which do not allow discontinuities in the snake not proper to the object model. The distinction of surpassing makes sense because in some cases it could be useful to cause a local surpassing, for example, when some parts of the snake must go out from some edge points considered as not belonging to the object contour (see Fig.3). Another utility of the local surpassing could be in veri cation of the segmentation result; the result is correct if, after some local surpassing the snake stabilizes in the same edges location. The global parameters are the maximal values for which the displacement of the snake does not exceed some -neighborhood. The neighborhood is to be determined by the user as the area for which the snake is in uenced by the contour. The point for global parameters therefore determines the upper bound of the parameters of elasticity. The global surpassing deserves to be paid a special attention as this is the case when the snake loses globally the in uence of the correct object contour. This means that after a global surpassing the snake can not recover the edges of the object (see Fig.4). The parameters of elasticity of both kind of surpassing depend on the objects model and the initial snake. The nice fact here is that this dependence is mainly on their length, given 5
Figure 3: Example of a local snake surpassing a potential valley the not strong constraint on the shape of the objects. The constraint is that the objects should not contain corners i.e. each curved place of the object's contour should be well approximating by a circular segment . We would like to note that the independence on the object shape is possible because the snake "knows" until what extent it should admit bending of the initial snake in order to adj ust to the object contour. It is achieved thanks to the optima l parameters of elasticity. Another important thing, that reduces signi cantly the computational cost of the approach proposed here, is that it is sucient to estimate the both pairs of parameters of elasticity using the contour of the object as an initial snake. Afterwards, the dierence in length between any else initial snake and the prototype's contour length is used to compute the optimal parameters of elasticity for the given initial model with respect to the prototypes of certain class. If a snake placed in a contour valley moves outside a neighborhood it is because it can nd an even lower energy outside the neighborhood than in the valley. Based on the properties of the global parameters of elasticity it can be shown that the initial snake is able to shrink itself until it falls into the valley. This paper therefore proposes an approach to determine the parameters of surpassing by considering rst of all the case when the snake coincides with the contour and obtaining the parameters required for the snake to nd an con guration outside the contour neighbourhood with lower energy and afterwards, to generalize the technique for the cases when the initial snake does not coincide with the contour. 1
As pointed by Blake and Zisserman, the availability of corners needs spatially local parameters of elasticity that stays out of the range of our study. 1
6
Figure 4: Example of a global snake surpassing a potential valley
3 Parameters of repulsion and retention Before being able to determine some values for the parameter bounds it is necessary to understand the fundamental relations concerning certain general properties about the parameters of elasticity. It should be emphasized that relations described in this section do not depend on any speci c snake implementation or on any speci c calculation of the potential eld. Let us suppose that given some initial snake with length not smaller than the object contour we are able to determine the parameters of elasticity that will shrink the snake so that in some iteration the snake falls in the potential valley corresponding to the contour.
De nition 3.1 Let uc and ut be two states of a snake deformation in iterations c and t respectively, where the second one is obtained from the rst one. If
t t c c Emembrane + Ethin ?plate Emembrane + Ethin?plate , then the deformation is called a
smoothing deformation.
Lemma 3.1 Let uc and ut are two states of a snake deformation in iterations c and t respectively, where the second one is obtained from the rst one. The snake ut has more t t smooth shape than uc (i.e. the internal energy is reduced: Emembrane + Ethin ?plate c c Emembrane + Ethin?plate), i the parameters of elasticity are not negative ( 0; 0) [15].
Lemma 3.2 If a snake curve ut is obtained from a snake curve uc by a smoothing deformation then: c t a) Emembrane Emembrane ;and c t b) Ethin?plate Ethin?plate : 7
As it was stated previously [8], the parameters of elasticity determine the tolerance between the external and internal forces. More larger the parameters are, more smooth the snake shape is. This means that for two snakes deformed from a same initial snake and with dierent parameters of elasticity the snake with larger parameters will have more smooth shape i.e. will be more shrinked. Obviously if the former snake with the smaller parameters of elasticity displaces in some -distance, the more shrinked snake will displace in at least -distance. The following lemma can be formulated:
Lemma 3.3 Let the snake uc be in a valley of a potential eld corresponding to the object
contour. And let the parameters of elasticity (0 ; 0) be such that the snake leaves the neighborhood of the valley given some epsilon. Then for any greater parameters of elasticity 0 and 0, the snake leaves the -neighborhood.
Corollary 3.1 Let the snake uc be in a valley of a potential eld corresponding to the object
contour. And let the parameters of elasticity (0; 0) be such that there exists t iterations such that the snake repeals from the valley in a distance jjut ? uc jj1 = n. Then for any greater parameters of elasticity 0 and 0, the snake repeals from the valley in t iterations in a distance at least n.
Lemma 3.4 Let the snake uc be in a valley of a potential eld corresponding to the object
contour. And let the parameters of elasticity (0 ; 0) be so that the snake remains in the neighborhood of the valley given some epsilon. Then for any smaller parameters of elasticity 0 and 0, the snake remains in the -neighborhood.
Corollary 3.2 Let the snake uc is in a valley of a potential eld corresponding to the object contour. And let the parameters of elasticity (0 ; 0) be such that the snake retains in the valley. Then for any smaller parameters of elasticity 0 and 0, the snake retains in the valley.
The last two lemmas de ne a kind of monotony of the parameters of elasticity as it shows that for an given parameter setting found to give local or global surpassing any parameter value greater than the one found will also cause surpassing. This monotony is very important as it is no longer necessary to treat each possible parameter combination as a dierent setting with possible dierent eect of the snake. Now an eect found for a speci c setting (0; 0) can be extended to a large range of the possible settings, i.e., 0 and 0.
Theorem 3.1 Let the snake uc is placed in a contour valley. Then the maximal pair of pa-
rameters of elasticity that retain the snake in some -neighbourhood are given by the formula:
Pt ? Pc Pt ? Pc ; = (1) t c t 2(Ethin membrane ? Emembrane ) ?plate ? Ethin?plate ) c c t t t where P c ; Emembrane ; Ethin ?plate ; P ; Emembrane ; and Ethin?plate are energies of snake uc and a snake ut in a distance from the snake uc . = 2(E c
8
Proof: a) Firstly, we shall prove the theorem for a snake ut in a distance at least
from the snake uc. Let us consider the parameter that causes the snake repulsion from the valley given any parameter . Since we consider the case of shrinking i.e. smoothing of the snake then the parameters of elasticity should be non negative (Lemma 1). From Lemma 3 we have that if we nd out a parameter that causes a snake repulsion given = 0, then for any its positive value 0, the parameters (; ) will repeal the snake from the valley. If the snake uc positioned in the valley leaves some -neighborhood of the contour valley deforming into ut then the sum of the internal and external energies outside the neighborhood must be lower than on the contour. Therefore the condition for repulsion for the parameters (; 0) is to exist t0 iterations for the snake so that the snake energy in the valley is greater than the snake energy in the valley neighbourhood in iteration t t0: c t t t c c + Ethin Emembrane ?plate + P > Emembrane + Ethin?plate + P ; or c t Emembrane + P c > Emembrane + P t; given = 0 c t (Emembrane ? Emembrane ) > Pt ? Pc
(2)
Since the external energy is greater than zero the decrease in internal energy must be greater than the increase in the external energy. According to Lemma 1 the reduction can be caused by a reduction in the membrane energy or by a reduction in the thin-plate energy or nally caused by to a combination of reductions of both energies. There will be a large range of combinations giving rise to the required reduction in internal energy. t c 0 from Lemma 2, and from the fact that the potential ? Emembrane Using that Emembrane energy in the neighbourhood of the valley is greater than the potential energy in the valley t c > 0 i.e. the division is straighforward, for the ?t Emembrane (P t > P c ) follows that Emembrane c P ? P : value of we obtain: > Emembrane c t ?Emembrane Since for any greater than the just obtained value and any value of the snake repeals t ?P c P from the contour, it follows that for the parameter = Emembrane there exists a c t ?Emembrane parameter so that the snake retains in the potential valley. The condition for the retention is that the snake energy in the valley is smaller than the snake energy in the neighbourhood of the valley for any iteration t: c c c t t t Emembrane + Ethin ?plate + P Emembrane + Ethin?plate + P : P t ?P ct Substituing = Emembrane c ?Emembrane we obtain = 0. So one pair of parameters of snake t P ?P ct retention is: ( = Emembrane c ?Emembrane ; = 0): P t ?P ct If we choose = Emembrane c ?Emembrane , for the value of the another parameter of elasticity t c P ?P t we obtain: = Ethin . Thus another pair of parameters of snake retention c ?plate?Ethin?plate is: t c Pt ? Pc ( = 2(E c P ??PE t ; = ): c t 2(Ethin membrane membrane ) ?plate ? Ethin?plate ) 2(
2(
)
)
9
Analogously if we like to obtain the parameters so that for any the snake leaves the -neighborhood, we should consider equation 2 setting = 0. For we obtain, t Pc : (3) > Ec P ? t thin?plate ? Ethin?plate Let ust note that if we consider the half of the obtained value for the parameter = P ?P c ), we obtain the same pair of parameters of elasticity of snake retention c t Ethin ?plate?Ethin?plate as in the previous case: t ? Pc t ? Pc P P ; = 2(E c ): (4) ( = 2(E c t t membrane ? Emembrane ) thin?plate ? Ethin?plate ) In summary if the reduction in energy should be distributed evenly to both internal energies it can be shown that the maximal pair of parameters for which the snake remains in the -neighborhood is given by, 2(
2
Pt ? Pc ; t membrane ? Emembrane ) t c = 2(E c P ??PE t thin?plate thin?plate )
= 2(E c
(5)
The obtained this way parameters of elasticity are the parameters of elasticity that do not allow the snake to smooth towards snake ut with potential energy Pt and internal energies: t t Emembrane and Ethin ?plate . Besides, the parameters are the maximal values in sense that xing one of the parameters of elasticity there exists no greater value for the another parameter so that the snake ful lls the condition above. If we consider as deformed snake ut the minimal deformation of the snake from the contour uc, we obtain the maximal parameters of elasticity for which the snake retains in the valley of the contour i.e. the pair of parameters of elasticity are the optimal local parameters of elasticity. If the snake ut is a deformation of the snake uc so that Pt ? Pc = n, where n is the snake length and a predetermined constant, from the monotony property of the parameters of elasticity the obtained parameters are the maximal parameters of elasticity that do not allow a deformation of the snake uc to snake ut with distance jjut ? ucjj = n i.e. the parameters are optimal global parameters of elasticity of the snake. b) We shall show tthatc the theorem is valid for a snake ut int a cdistance from the snake P ?P t P ?P t uc. For Emembrane ), where it should c c ?Emembrane we obtain that Ethin ?plate?Ethin?plate be valid for any ut so that jjut ? ucjj n. Since it should be valid tfor call such snakes ut it P ?P t should be valid also for the snake for which the expression Emembrane c ?Emembrane is minimal. We shell see that this is valid exactly for the snake ut such that jjut ? ucjj = n. If the snake surpasses the -neighbourhood, and the snake iterative movement does not allow large jumps 1
2(
)
2(
)
2(
)
By maximal pair of parameters we denote such pair that xing one of the values there is not greater value for the another parameter that ful ll the condition 2
10
of the snake pixels, such one deformation of the snake uc exists. Let consider the snake ut and jjut0 ? ucjj > n. For this two snakes we consider the and ut0 so that jjut ? ucjj t= n c P ? P expressions: Emembrane . As the snake ut0 is more shrinked than the snake ut, c t ?Emembrane it will stay at distance greater or equal to the distance of the ut until the contour valley. Thus P t ? P c P t0 ? P c . Besides, for the same reason the more shrinked snake will have 0 c t c t less membrane energy i.e. Emembrane ? Emembrane Emembrane ? Emembrane . Therefore, the snake ut has the minimum expression. 2(
)
4 Determination of optimal global parameters of elasticity Given a speci c shape model, the task now becomes one of determining the parameters not giving rise to local and global surpassing with respect to some -neighbourhood of the contour valley. Without loss of generality we will compute the parameters for the snake implementation by Finite Dierence Method and use the fact that the potential is generated as a distance map of the edge points of the original image. We are looking for the parameters for which the decrease in internal energy can not compensate for the increase in external energy. First the case where the initial snake coincides with the contour is considered and the result is then generalized to the situation where the initial snake is greater than the contour. Let u ; uc; ut denote the snake in its initial con guration, when shrinking has moved it into the potential valley and when surpassing has occurred in some -neighbourhood of the contour valley. We will use d ; dc ; dt to denote the average distance between the snaxels of u ; uc; ut. In order to simplify our calculus we ensure that the snake pixels are evenly distributed in each iteration of the snake movement. 0
0
0
4.1 Determination of global optimal parameter
In order to estimate the maximal parameters of elasticity that do not cause a global surpassing with respect to some given constant using the theorem 3.1, we need the energies estimation of a snake ut in a -distance from the contour snake uc.
4.1.1 The initial snake coincides with the object's contour
Let us consider a snake uc that in the initial moment coincides with the contour and compare to the snake ut in the iteration t when it surpasses globally the contour. The rst derivative of the snake curve depends on the distance between the pixels of the curve and not on its shape. Given that the parameter is spatially global along the snake curve, the shrinking eect due to the minimization of the membrane energy is the same for all the pixels. Therefore, because of the global parameter , the snake is in the contour valley and the distance between the pixels is equal, all the pixels feel the same external and internal forces. Thus, the shrinking will be in the same manner as a shrinking in a circle. Thus we can consider the shrinking eect in a circle with length equal to this of the snake 11
i.e. n = 2r. In the next iteration the distance between the pixels is reduced, so that the snaxels move shrinking i.e. the snake forms a circle with radius less than this of the former circle. Let us consider the snake unt after a global surpassing from the valley. In the valley the external energy is zero, P c = P P (uc;i) = 0. If the snake moves out of the -neighbourhood i of the valley the external energy increases. Assuming that each snaxel moves a distance away from the valley, it can be shown that its potential energy P (ut;i) becomes . Thus the total potential energy of the snake will be n. =1
t c gl = 2(E c P ??PE t membrane membrane ) Pn P (u ) ? Pn P (u ) c;i t;i i = i Pn n 2( u0c;i ? P u0t;i) i i n = Pn n 2( u0c;i ? P u0t;i) =1
=1
2
2
=1
=1
2
i=1
2
i=1
(6)
Using the fact that in our implementation the snaxels are evenly distributed on the curve, the internal energy of each snake pixel will be u0c;i = dc = nr . From here we obtain the following relation between the radius and the distance between the pixels in uc: r = ndc . To get a total energy minimization the internal energy must decrease which will cause the snake to shrink. The deformed snake ut will be a circle with smaller radius r ? . We get u0t;i = dt = nr? ; i = 1; : : :; n. By inserting into equation (6) we get: 2
2
2 (
)
gl = 2n(dn? d ) t c = r 2(( n ) ? ( nr? ) ) n = 8 (2 r ? ) n = 8 (2 ndc ? ) n = 8(nd ? ) 2
2
2
2
2 (
) 2
2
2
2
2
2 2
c
(7)
Without loss of generality we choose the initial distance between the pixels dc = 1 and we obtain:
gl = 8(nn? ) 2
12
4.1.2 The initial snake does not coincide with the object's contour
When the initial snake, u does not coincide with the contour, it has by assumption a length longer than the contour and a shrinking process is supposed to move it into the valley. Let k denotes the accumulation rate i.e. k = uuc ; k > 1. For the shrinked snake in the valley the average distance dc will be dc = dk . Substituting in (7) we obtain: 0
0
0
n
gl =
2
8(n dk ? ) = 8(ndkn? k) Without loss of generality we can consider that the initial distance between the snake pixels is 1 obtaining the following formula for the parameter : 0
2
0
gl = 8(nkn? k) 2
4.2 Determination of global optimal parameter
The value of the global parameter depends on the change in external energy and on the thin-plate energy (theorem 3.1). For the latter the shape of the objects becomes important. It is however not possible, in a simple way, to model all the possible dierent shapes. It is known that for a given length a circle will have the lowest energy with respect to any curve shape. We decide to approximate the object shape with a circle and we accept that non-circular objects will create some positively biased estimate. This deviation from the expected result should be computed emipirically.
4.2.1 The initial snake coincides with the object's contour
Choose a circle with radius r such that the perimeter of the circle equals the length n of the contour. If the snake leaves the -neighborhood the snake will have shrunk and there exists an iteration t such that the deformed circular snake will have a smaller radius, r ? . Let the snaxels be moved in distance from the initial position, thus the increase in the external energy becomes n. By inserting the results into equation of theorem 3.1 we get the following expression for gl, t c gl = 2(E c P ??PE t thin?plate thin?plate ) n n P P (u ) ? P P (u ) c;i t;i i = i Pn n 2( u00c;i ? P u00t;i ) =1
=1
i=1
2
13
i=1
2
y
(x ,y ) i+1 i+1
d
r
(x i ,y i )
∆φ φi
(x i-1,yi-1) x
Figure 5: Example of global surpassing =
n n n 00 P 2( uc;i ? P u00t;i ) 2
i=1
2
i=1
The distance between snaxels for the both snakes can be computed as for the parameter. In the Finite Dierence Method snake implementation the second derivative for the i'th snaxels is approximated as u00i ui ? 2ui + ui? . Using the polar representation: x = r cos ; y = r sin , we can compute the expression about the second derivative (Fig. 5): +1
1
xi ? 2xi + xi? = r cos(i + 4) ? 2r cos i + r cos(i ? 4) = 2r cos i(cos 4 ? 1) yi ? 2yi + yi? = r sin(i + 4) ? 2r sin i + r sin(i ? 4) = 2qr sin i(cos 4 ? 1) u00i = (xi ? 2xi + xi? ) + (yi ? 2yi + yi? ) = 2rj cos 4 ? 1j = 2r(1 ? cos 4) (8) From the cosinus Theorem we have: 2r ? 2r cos 4 = d . Substituting in (8) cos 4 = 1 ? dr , we obtain: +1
1
+1
1
+1
1
2
2
+1
2
1
2
2
2
2 2
u00i = dr : 2
From that we get: u00c;i = substituting r = dcn , we get:
d2c r
and u00t;i =
d2t . r?
Developing the formula about gl and
2
gl =
n n n 00 P 2( uc;i ? P u00t;i ) i=1
14
2
i=1
2
n
=
2n( drc ? 4
2
=
(
r )4 n2
?
2
r
d4t r?)2 )
(
2(
r?) )4 n 2
2 (
r?)
(
= 32 (r n ? (r ? ) ) = 32 n (2r ? ) n = 32 (2 dcn ? ) = 32 (dnn ? ) (9) c We assume that the distance between neighbouring pixels in the initial snake coinciding with the object contour is 1, thus we get: 4
4
2
2
4
4
4
4
2 4
3
gl = 32 (nn ? ) 4
3
4.2.2 The initial snake does not coincide with the object's contour
When the initial snake does not coincide with the contour we assume that it is longer than the contour. Shrinking will move the snake to the valley and if the accumulation rate is set to k the distance between snaxels will be dc = dk . Substituting in (9), we get: 0
n d 16 ( k n ? ) = 32 (dnnk? k) 4
gl =
3
0
4
3
0
Assuming d = 1 we obtain: 0
gl = 32 (nn ?k k) 4
3
Corollary 4.1 Between the global optimal parameters and there exists the following relation:
gl = 4n gl: 2
2
15
2
θ
1
r r+ εε
sc st m
Oc
Ot
Figure 6: Dierent displacements of the snake pixels
5 Determination of optimal local parameters of elasticity Assume that the snake, uc, located in the valley is broken down in linear and circular segments. When the snake begins to shrink the circular segments try to move out of the valley to decrease the distance between the snaxels whereas the linear segments remain in the valley. We focus our attention on the segments with maximal curvature since local surpassing will take place here rst. Analogously to the case of the global optimal parameters of elasticity, we are looking for the local parameters and of elasticity by a snake ut with local -displacement in the place of maximum curvature of uc from the snake uc placed in the contour valley.
5.1 Determination of local optimal parameter
Analogously to the global optimal parameters, we consider the both cases of initial snake that coincides or not with the object contour.
5.1.1 The initial snake coincides with the object's contour
Let the segment of uc with maximal curvature, sc, be represented by a segment of a circle with radius r. Obviously, maximum curvature gives rise to a circle with minimal radius. Local surpassing will deform sc into st while keeping the another part of the snake (Fig. 7). If we represent the both snakes as: uc = uc + sc and ut = ut + st this means that uc coincides with ut and so the dierence of the energies in equations of theorem 3.1 will be related only to the pixels from the segments sc and st. Let us suppose that reducing the curvature of the segment sc it transforms to a segment from a circle with radius r + . Therefore, the potential energy of all m pixels from the segment st will be graduated between 0 and some maximum displacement = (r; m; ) depending on the radius, the length of the arc m and the dierence between the both circles (between the both radiuses of the circles) (see Fig. 16
A
B
dc
sc
D
dt
C st E r r+ εε
h
ν
F
Oc µ Ot
Figure 7: Example of local surpassing
17
6). Thus given m points on the arc and maximum displacement the displacement of each pixel will be min( mi ; mm?i ); for even m and min( m?i ; mm??i ); for odd m; i = 1; : : : ; m. The sum of distances (equal to the potential energies in our case) for all the pixels is: 2(
2
)
2(
2
1
8 m? >> P m mi ? i >: 2 P
2
2
=1
1
2
=0
i=1
i m
+ = m ;
2
2
2i m?1
) 1
for even m,
= m ; for odd m. (
+1) 2
Let there are q circular segments with maximal curvature. If the parameter is chosen so that the pixels from one of these segments go out, it follows that the same parameters will make the snake pixels from the segments with the same curvature to go out. Taking into account this fact we obtain: t c loc = 2(E c P ??PE t membrane membrane ) n n P P (u ) ? P P (u ) c;i t;i i = i Pn n 2( u0c;i ? P u0t;i) i i m m P q( P (ut;i) ? P P (uc;i)) i = i P m m 0 2q( uc;i ? P u0t;i) i i me d = P m m 2( u0c;i ? P u0t;i) i i me d = 2m(d ? d ) t c Let us estimate the expression about dt: From triangle EFOt (Fig. 7) by Cosinus Theorem we have: =1
=1
2
2
=1
=1
=1
=1
2
2
=1
=1
2
2
2
=1
=1
2
2
2
h = 2(r + ) (1 ? cos ) => = arccos(1 ? 2(r h+ ) ) 2
2
2
2
(10)
From triangle EFOc (Fig. 7) by Cosinus Theorem we have: h = 2r (1 ? cos ) 2
2
18
(11)
From triangle ABOc (Fig. 7) by Cosinus Theorem we have: dc = 2r (1 ? cos m ) => = m arccos(1 ? 2drc ) 2
2
2
2
(12)
From triangle CDOt (Fig. 7) by Cosinus Theorem we have: ) dt = 2(r + ) (1 ? cos m 2
2
Substituting (10), (11) and (12) we obtain: arccos(1 ? rh ) dt = 2(r + ) (1 ? cos ) m arccos(1 ? r r? ) = 2(r + ) (1 ? cos ) m dc arccos(1 ? r ? mr ? r ) )) = 2(r + ) (1 ? cos( m ? drc ) arccos( r r r m = 2(r + ) (1 ? cos( )) m Developing the expression about loc the following expression is obtained: 2
2
2
2( + )2
2
2 2 (1 cos ) 2( + )2
2 2 (1 cos(
2( + )2
2
(2 + )+ 2 cos(
arccos(1
( + )2
2
2 ))) 2 2
2 )) 2 2
d m e
loc =
2
2m(dc ? 2(r + ) (1 ? In case of distance dc = 1, we obtain: 2
loc =
arccos(1
2
2 (2r+)+r2 cos(m arccos(1? 2drc2 )) ) arccos( (r +)2 ))) cos(
2
2
(14)
m
d m e 2m(1 ? 2(r + ) (1 ? cos(
(13)
arccos(
(2r+)+r2 cos(m arccos(1? 2r12 )) ) (r +)2 )))
m
The displacement in the dierent pixels is dierent. The maximum displacement of the snake pixels from the arc can be estimated as follows. Computing the angles in triangle OcOt F we have:
0 2r cos ?1 (cos ?2 ? 1) > x contradiction s ? => = r cos 2 ? r + r cos ?2 ? r + x From Fig. 7 it can be seen that: 2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2 + 2 cos ( + )2 ( + )2
2
2
2
2
2
2
2
( + )2
2
2
2
2
2
2
2
2
2
2
2
2
2
= r ? (r + ? x) = s x? = r cos ?2 ? r + r cos ?2 ? r + ( + ) v q u u 1 + r ?rr r cos + r r (1 ? cos )(2(r + ) ? r (1 ? cos )) sin t ? cos 2 = 2 2
2 + 2 cos ( + )2 ( + )2
2
2
2
2
( + )2
For example, if = we get: (r ? 1) + 2(2r ? r ? ) + (3r ? r ? 4r ? ) ?2(r + r + r) ? r = 0 2
4
2
3
3
20
4
2
2
2
2
2 2
2
2
Note: In fact it is dicult to compute as a function of . It is easier to estimate the = ():
s = x ? = r + (r + ) ? 2r(r + ) cos ?2 ? 2
2
Using the fact that = () is a monoton function of and knowing the radius we can with a few tests estimate so that the distance not to be too great. As a result we obtain the following formula for the local parameter loc :
loc =
d m e 2
2m(1 ? 2(r + ) (1 ? cos( 2
q
arccos(
(2r+)+r2 cos(m arccos(1? 2r12 )) ) (r +)2 )))
m
where = x ? = r + (r + ) ? 2r(r + ) cos ? ? . 2
2
2
5.1.2 The initial snake does not coincide with the object's contour
Taking into consideration that when the initial snake is larger than the contour, the distance between the snaxels at the time when it has shrunk to the contour will be dc = dk . Then the equation (14) becomes, 0
d m e
loc =
2
2m(( dk ) ? 2(r + ) (1 ? 0
2
2
=
d0 2 (2r+)+r2 cos(m arccos(1? ( 2kr2) )) arccos( ) (r +)2 cos( )))
d m ek 2
2m(d ? 2k (r + ) (1 ? 2 0
2
2
m
2
(d2 (2r+)+r2 cos(m arccos(1? 2k20r2 )) ) arccos( (r +)2 ))) cos(
m
Assuming d = 1 we obtain: 0
loc =
d m ek 2
2m(1 ? 2k (r + ) (1 ? cos( 2
2
2
arccos(
(2r+)+r2 cos(m arccos(1? 2k21r2 )) ) (r +)2 )))
m
5.2 Determination of local optimal parameter
Analogously to the previous case we consider only the circular segment with the largest curvature (i.e. with the smallest radius). 21
5.2.1 The initial snake coincides with the object's contour
We apply the same strategy as for local surpassing caused by the parameter and use the information concerning the second derivative for the circle obtained in the previous section. We suppose that the smoothed circular segment will belong to a circle with radius with more than the radius of the original segment. The following expression is obtained:
loc
t ? Pc P = 2(E c t thin?plate ? Ethin?plate ) Pn P (u ) ? Pn P (u ) c;i t;i i = i Pn n 2( u00 ? P u00 ) =1
=1
2
c;i
i=1
i=1 m P
2
t;i
q( P P (ut;i) ? P (uc;i)) i = i P m 00 m 2q( u ? P u00 ) m
=1
=1
2
=
2
i=1 c;i i=1 t;i d m2 e 4 2m( dr24c ? (r+dt)2 )
d m e
=
2
2m( drc ? 4(r + ) (1 ? cos( 4
2
2
=
arccos(
d m er 2
2m(dc ? 4r (r + ) (1 ? 4
2
2
2 (2r+)+r2 cos(m arccos(1? 2drc2 )) ) (r +)2 ))2)
m
2
(15)
2 (2r+)+r2 cos(m arccos(1? 2drc2 )) ) arccos( (r +)2 cos( ))2)
m
Assuming dc = 1, we obtain:
loc =
d m er 2
2m(1 ? 4r (r + ) (1 ? cos( 2
2
2
arccos(
(2r+)+r2 cos(m arccos(1? 2r12 )) ) (r +)2 ))2)
m
5.2.2 The initial snake does not coincide with the object's contour
Given the accumulation rate k between the initial snake and the snake when it falls in the object contour (i.e. the average distance between the pixels in the later snake is dc = dk ), we compute the optimal local parameter . After considerations similar to those in the previous sections the equation (15) becomes: 0
22
d m er
loc =
2
2m( kd ? 4r (r + ) (1 ? 4 0 4
2
2
2
2 (2r+)+r2 cos(m arccos(1? 2kd20r2 )) ) arccos( (r +)2 cos( ))2)
m
d m er2k4
=
2
2m(d ? 4r k (r + ) (1 ? Given d = 1, we obtain: 4 0
2
4
2
d2 (2r+)+r2 cos(m arccos(1? 2k20r2 )) arccos( ) (r +)2 ))2) cos(
m
0
loc =
d m er k 2
2m(1 ? 4r k (r + ) (1 ? cos( 2
4
2
2
arccos(
4
(2r+)+r2 cos(m arccos(1? 2k21r2 )) ) (r +)2 ))2)
m
6 Results and discussion Two lines of experiments have been conducted. One based on synthetic images with the purpose of analysing the precision of the estimated eect of the parameters in relation to the actually observed eect. Another line includes real x-ray images of bone structures with the purpose of showing the usefulness of the local and global parameters in terms of lower and upper bounds on the snake when used for model-based segmentation.
Test on synthetic images
Six dierent types of objects have been used for the experiments. i.e. circle, octagon, hexagon, square, rectangle, triangle. For each object the optimal values of and according to equation 4, was computed. Firstly an experiment was conducted to show if the precision of the estimated eect would depend on the length of the snake, i.e., the perimeter of the object. 5 scaled versions of each object was produced having length 100, 200... 500 pixels. For each object the initial snake was placed on the boundary of the object (in the potential valley). Using the calculated optimal parameters the snake iteration was started. When the iteration terminated the dierence between the initial snake and the deformed version was measured as the distance between the individual snaxels. The experiments showed no dependence of the precision on the length. Secondly an experiment was conducted in which dierent settings of the parameters and around the calculated optimal setting were used. The results are based on = 1:5. Due to the established independence of length the experiments were conducted on objects of length 300 pixels. The results for the global optimal parameter are shown in gure 2. It can clearly be seen that the dierence between the initial snake and the deformed snake is an monotone increasing function as predicted by Lemma 2 and 3. The optimal values were calculated based on an allowed distance of 1.5 pixels per snaxel, and the graphs show that the majority of the objects lies close to the 1.5 pixel threshold with a tendency to exceed 23
d
20 18 16 14
12 10 8 6 4 2 length 100
200
300
400
500
Figure 8: the threshold. This tendency is due to the fact that since the object is approximated with a circle the calculated values for the parameters will be positively biased meaning that for non-circular objects surpassing might occur for values close to but lower than the estimated optimal values. Nothing conclusive can be said about the relation between dierent shapes and the calculated dierence except that objects with sharp corners, e.g. the triangle give rise to less precise estimates. Even though the test shows a good correlation between the estimated eect of the calculated parameters and the eect observed the test also shows that the distance function does not increase rapidly in the interval closely surrounding the optimal values. This clearly indicates that the calculated optimal values should not be considered the one and only useful value but taken more as an indication of an interval in which similar eects can be achieved. Similar results as the ones shown in gure 2 has been obtained for the local surpassing.
Test on x-ray images
The test on real images had the purpose to show that the optimal parameters of segmentation lie in the intervals determined by the optimal local and global parameters. For each bone we used as an initial snake a model of a bone with similar structure but diering in size. Depending on the dierence between the length of the initial snake and this of the contour in some cases the snake slided correctly to the contour (Figure 3(bottom)). In cases of more dierent initial snake and contour due to attraction by near bones, or edge points caused by the tissue texture of the radiographs, the snake was retained outside of the object contour. (Figure 3(top)). In accordance to our observations about the snake deformation by global optimal parameters of elasticity, these parameters assure us that the snake will surpass the contour going out in some distance with predetermined magnitude. This way any snake detention in a local energy minima before arriving to the contour will be avoided. As it is clearly seen from the 24
d
5 4.5 4 3.5
3 2.5 2 1.5 1 0.5 length 100
200
300
400
500
Figure 9: example images , due to the monotony property of the elasticity parameters, we can state that the parameters of the optimal segmentation belong to the intervals determined by the local and global optimal parameters of elasticity. The overall tendency of the snake deformation by optimal local and global parameters is to surpass in some limits the estimated distance between the contour and the deformed snake when the later surpasses the contour. In the example from Figure 3(bottom) the initial snake has length 296 pixels, the accumulation rate is k = 1:22, the segment with maximal curvature belongs to a circle with radius r = 21:4, the values of the optimal parameters are: loc = 32:4; loc = 3925:84; gl = 35:5953; gl = 78997:9; loc = 1; gl = 15. Since the bone contour has somewhat oval shape, the intervals between the global and local parameters are not very large. In case of shapes with more expressed concavities and convexities larger dierence between the parameters and were observed. The average and normalized by the length of the snake distance between the contour and the deformed snake by local parameters of elasticity is nd = 0:74 and the average and normalized distance between the contour and the deformed snake by global parameters is nd = 18:3. The fact of the exceeding the estimated distance we explain with the in uence of the missing edge points from the contour of the object. Considering the dependence of the missing information in the edge map on the parameter estimation is an object of our current investigation.
7 Conclusion Based on the concept of local and global surpassing we have de ned some local and global optimal parameters which serve as the lower and upper bounds on the elasticity parameters of a snake in terms of segmentation of a given object. Formulas are presented by which an estimate of the parameter bounds can be calculated for a given object model. 25
a
b
Figure 10: Dierent situations where the eect of using local (left) and global (right) optimal
parameters for segmentation of bone structures
Experiments show a good correlation between the estimate and results obtained on synthetic images. The precision is best for near circular objects whereas objects with sharp corners such as a triangle give less precise estimates. Furthermore the experiments show that the precision of the estimate does not depend on the length of the snake. Experiments on real x-ray images show that optimal segmentation is not possible below the lower limit and above the upper limit. The parameters for an optimal segmentation must therefore be within the bounds de ned in this paper. Research concerning the estimation of these parameters based on the bounds is scheduled for the near future.
References [1] A. A. Amini, T. E. Weymouth and R. C. Jain, "Using Dynamic Programming for Solving Variational Problems in Vision", IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 12, No. 9, pp. 855-867, September, 1990. [2] R. Bajcsy and S. Kovacic, "Multiresolution Elastic Matching", Computer Vision, Graphics, and Image Processing, Vol. 46, pp. 1-21, 1989. [3] I. Cohen, L. D. Cohen and N. Ayache, "Using Deformable Surfaces to Segment 3-D Images and Infer Dierential Structures", CVGIP: IMAGE UNDERSTANDING, Vol.56, No.2, September, pp.242-263, 1992. [4] L. D. Cohen, "NOTE On Active Contour Models and Baloons," CVGIP: IMAGE UNDERSTANDING, Vol.53, No.2, March, pp.211-218, 1991. [5] P. Fua and Y. G. Leclerc, "Model Driven Edge Detection," Machine Vision and Applications, Vol. 3, pp. 45-56, 1990. 26
[6] G. C. Gee, M. Reivich and R. Bajcsy, "Quantitative Analysis of Cerebral Images using an Elastically Deformable Atlas: Theory and Validation," SPIE Vol. 1652 Medical Imaging VI: Image Processing, pp.260-270, 1992. [7] P. Karaolani and G. D. Sullivan and K. D. Baker, "Active Contours using Finite Elements to Control Local Shape", in British Machine Vision Conference, 1992. [8] M. Kass and A. Witkin and D. Terzopoulos, "Snakes: Active Contour Models," Proc. of Intern. Conf. on Comp. Vision, pp.259-268, London, 1987. [9] F. Leymarie and M. D. Levine, "Tracking Deformable Objects in the Plane using an Active Contour Model", IEEE Trans. Patt. Anal. Mach. Intell., Vol.15, No.6, 1993. [10] D. Metaxas and E. Koh, "Ecient Shape Representation using Deformable Models with Locally Adaptive Finite Elements", In SPIE Geometric Methods in Computer Vision, Vol. 2031, 1993, pp. 160-171. [11] P. Radeva, "Segmentacion de Imagenes Radiogra cas con Snakes. Aplicacion a la Determinacion de la Madurez Osea", Master Thesis, UPPIA, Universitat Autonoma de Barcelona, September, 1993. [12] N. Roughon and F. Preteux, "Deformable Markers: Mathematical Morphology for Active Contour Models Control", In SPIE Image Algebra and Morph. Im. Processing, 1991. [13] P. Radeva and J. Serrat, "Rubber Snake: Implementation on Signed Distance Potential", In Vision Conference SWISS'93, pp. 187-194, September, 1993. [14] R. Samadani, "Adaptive Snakes: Control of Damping and Material Parameters", in SPIE Geometric Methods in Computer Vision, vol. 1570, 1991. [15] D. Terzopoulos, J. Platt, A. Barr and K. Fleisher, "Elastically Deformable Models", Computer Graphics, Vol. 21, No. 4, July, 1987, pp. 205-214. [16] J. M. Tanner, R. H. Whitehouse, N. Cameron, W. A. Marschall, M. J. R. Healy and H. Goldstein, Assesment of Skeletal Maturity and Prediction of Adult Height (TW2 approach), New York:Academic, 1983. [17] Y. F. Wang and J.-F. Wang, "Surface Reconstruction using Deformable Models with Interior and Boundary Constraints", IEEE Trans. Patt. Anal. Mach. Intell., Vol.14, No.5, pp. 572-579, 1992.
27