EVERYTHING YOU ALWAYS WANTED TO KNOW ABOUT SNAKES (BUT WERE AFRAID TO ASK) Jim Ivins & John Porrill


 Hope Davis
 1 years ago
 Views:
Transcription
1 EVERYTHING YOU ALWAYS WANTED TO KNOW ABOUT SNAKES (BUT WERE AFRAID TO ASK) Jim Ivins & John Porri AIVRU Technica Memo #86, Juy 993 (Revised June 995; March 2000) Artificia Inteigence Vision Research Unit University Of Sheffied Engand S0 2TP Reeing and Writhing, of course, to egin with, the Mock Turte repied; and then the different ranches of Arithmetic Amition, Distraction, Ugification, and Derision. Aice s Adventures In Wonderand, y Lewis Carro Pease send feedack and corrections regarding this document to Jim Ivins. Emai:
2 ABSTRACT Active contour modes known cooquiay as snakes are energyminimising curves that deform to fit image features. Snakes ock on to neary minima in the potentia energy generated y processing an image. (This energy is minimised y iterative gradient descent according to forces derived using variationa cacuus and EuerLagrange Theory.) In addition, interna (smoothing) forces produce tension and stiffness that constrain the ehaviour of the modes; externa forces may e specified y a supervising process or a human user. As is characteristic of gradient descent, the energy minimisation process is unfortunatey prone to osciation uness precautions typicay the use of sma time steps are taken. Active contour modes provide a unified soution to severa image processing proems such as the detection of ight and dark ines, edges, and terminations; they can aso e used in stereo matching, and for segmenting spatia and tempora image sequences. Snakes have often een used in medica research appications; for exampe, in reconstructing threedimensiona features from panar sices of voume data such as NMR or CT images. In addition, many motion tracking systems use snakes to mode moving ojects. The main imitations of the modes are (i) that they usuay ony incorporate edge information (ignoring other image characteristics) possiy comined with some prior expectation of shape; and (ii) that they must e initiaised cose to the feature of interest if they are to avoid eing trapped y other oca minima. KEY WORDS k Cacuus Of Variations k EuerLagrange Theory k Gradient Descent k Snakes: Active Contour Modes LICENSE Copyright (C) Jim Ivins & John Porri AIVRU, University of Sheffied, Engand S0 2TP. Veratim copying and distriution of this entire document is permitted in any medium, provided this notice is preserved, ut changing it is not aowed. Page 2
3 INTRODUCTION Loweve visua tasks such as edge detection and stereo matching are often treated as autonomous ottomup processes. However, this sequentia approach propagates mistakes to higher processes without providing opportunities for correction. A more attainae goa for oweve processing is to provide severa interpretations of the image data, from which higher processes or a human user may choose. Active contour modes first descried y Kass et a (987; 988) provide one possie method for generating these aternative interpretations. Active contour modes are often caed snakes ecause they appear to sither across images (a phenomenon known as hysteresis); they are one exampe of the genera technique of matching a deformae mode to an image using energy minimisation. From any starting point, suject to certain constraints, a snake wi deform into aignment with the nearest saient feature in a suitay processed image; such features correspond to oca minima in the energy generated y processing the image. Snakes thus provide a oweve mechanism that seeks appropriate oca minima rather than searching for a goa soution. In addition, higheve mechanisms can interact with snakes for exampe, to guide them towards features of interest. Unike most other techniques for finding image features, snakes are aways minimising their energy. Changes in higheve interpretation can therefore affect a snake during the minimisation process, and even in the asence of such changes the mode wi sti exhiit hysteresis in response to a moving stimuus. Snakes do not try to sove the entire proem of finding saient image features; they rey on other mechanisms to pace them somewhere near a desired soution. For exampe, automatic initiaisation procedures can use standard image processing techniques to ocate features of interest that are then refined using snakes. Even in cases where automatic initiaisation is not possie, however, active contour modes can sti e used for image interpretation. An expert user need ony push a snake towards an image feature, and the energy minimisation process wi fit the mode to the data. This ehaviour has een expoited in numerous interactive image processing systems for exampe, see Kass et a (987; 988); Hi et a (992); Porri and Ivins (994). A snake is typicay driven y a potentia energy generated y processing the underying image data. For exampe, Gaussian smoothing foowed y convoution with a Scott (987) is critica of this phiosophy ecause the unspecified higheve process rarey materiaise except in human form! Page 3
4 gradientsquared operator generates a potentia in which extrema correspond to edges in the origina image. Over a series of iterations the force generated y this energy drives the snake into aignment with the nearest saient edge. However, the snake must aso satisfy some interna constraints for exampe, it must e smooth and continuous in outine. Sometimes the user imposes additiona externa constraints such as attraction or repusion. Current Snake (Time t): New Snake (Time t+): Movement: Edge: Figure : A Cosed Active Contour Mode. This diagram shows a snake with its ends joined so that it forms a cosed oop. Over a series of time steps the snake moves into aignment with the nearest saient feature (in this case an edge). Both interna and externa energy constraints are discussed in Section 2; potentia energy is discussed in Section 3. Section 4 uses these energy terms to derive expicit forces that can e used to drive active contour modes to minimise their energy y iterative gradient descent. The origina (semiimpicit) method proposed y Kass et a (987), which is reated to the expicit use of forces, is then descried in the next two sections. First, the cacuus of variations is used to derive the EuerLagrange equation in Section 5; this equation is then used to find the minimum energy condition for an active contour mode. Section 6 expains how to sove the minimum energy equation using a semiimpicit reaxation method ased on a fast matrix inversion agorithm. (Both the expicit and semiimpicit methods use finite differences to compute derivatives as descried in Appendix A; Appendix B contains six mathematica notes that provide simpe ackground information.) Osciation, the main drawack of reaxation methods, is discussed in Section 7. Finay, Section 8 considers the use of intersnake energy terms in three of the most common appications stereo matching, and segmentation of spatia and tempora image sequences. Page 4
5 2 SNAKE ENERGY FUNCTIONALS A snake is a parametric contour that deforms over a series of iterations (time steps). Each eement x aong the contour therefore depends on two parameters: s = space (curve) parameter x(s, t) t = time (iteration) parameter The contour is infuenced y interna and externa constraints, and y image forces, as outined eow. k Interna forces. Interna constraints give the mode tension and stiffness. k Externa forces. Externa constraints come from higheve sources such as human operators or automatic initiaisation procedures. k Image forces. Image energy is used to drive the mode towards saient features such as ight and dark regions, edges, and terminations. Representing a snake parametricay as expained in Mathematica Note, x(s) = ( x(s), y(s) ) where s is usuay taken to vary etween 0 and. The tota energy of the mode E snake is given y the sum of the energy for the individua snake eements: E snake = 0 Eeement ( x(s) ) ds (2.) The integra notation used in this section impies an openended snake; however, joining the first and ast eements makes the snake into a cosed oop as shown in Figure. Equation 2. can e rewritten in terms of three asic energy functionas: E snake = 0 Eintern (x) ds + 0 Eextern (x) ds + 0 Eimage (x) ds (2.2) The curve parameter s is omitted where no amiguity arises. The gradients of the three energy functionas in Equation 2.2 correspond to the three forces isted aove. The interna and externa energy functionas are considered in more detai eow; image (potentia) energy is deat with in the next section. To impement an active contour mode in computer software the continuous representation is approximated discretey y N snake eements; however, continuous notation is used wherever possie ecause of its greater mathematica eegance. A functiona is a function of one or more functions, giving a scaar resut. Page 5
6 2. INTERNAL (INTRASNAKE) ENERGY Using suscripts to indicate derivatives, the interna energy of a snake eement is defined as: E intern (x) = a(s) x s (s) 2 + (s) x ss (s) 2 (2.3) Tension Stiffness This energy contains a firstorder term controed y α(s), and a secondorder term controed y β(s). The firstorder term makes the snake contract ike an eastic and y introducing tension; the secondorder term makes it resist ending y producing stiffness. In other words, the parametric curve is predisposed to have constant (preferay zero) veocity and acceeration with respect to its parameter. In the asence of other constraints, an active contour mode simpy coapses to a point ike a strip of infiniteyeastic materia; however, if the ends of the mode are anchored then it forms a straight ine aong which the eements are eveny spaced. Adjusting the weights α(s) and β(s) contros the reative importance of the tension and stiffness terms. For exampe, setting β(s) = 0 in one part of the mode aows it to ecome secondorder discontinuous and deveop a corner. For simpicity, the tension and stiffness weightings are assumed to e uniform throughout the remainder of this document, so that α(s) = α and β(s) = β. 2.2 EXTERNAL (EXTRASNAKE) ENERGY Both automatic and manua supervision can e used to contro attraction and repusion forces that drive active contour modes to or from specified features. For exampe, a springike attractive force can e generated etween a snake eement and a point i in an image using the foowing externa energy term: E extern (x) = k i x 2 (2.4) This energy is minima (zero) when x = i, and it takes the vaue of k when i x = ± as shown in Figure 2. Mathematica Note 2 reviews the properties of extrema in functions. An externa energy term E extern can aso e used to make part of an image repe an active contour mode: E extern (x) = k i x 2 (2.5) This energy is maxima (infinite) when x = i; it is unity when i x = ± k. Because of the singuarity, the repusion term must e cipped as the denominator approaches zero. Page 6
7 Negating the (positive) constant k in these equations converts attraction to pseudorepusion, and repusion to pseudoattraction; however, these pseudo energy terms are unusae ecause their minima are infinite. (During energy minimisation, the singuarities competey dominate the ehaviour of an active contour mode, at the expense of a other energy terms.) The forces produced y these energy terms are easiy found y differentiation. (a) Attractive Energy () Repusive Energy E E k 0 + i x k 0 +k i x Figure 2: Attraction And Repusion Energy. These graphs show the attractive and repusive energy terms. Both functionas have maxima vaues that are infinite; the minima are zero. Page 7
8 3 IMAGE (POTENTIAL) ENERGY FUNCTIONALS The potentia energy P generated y processing an image I(x, y) produces a force that can e used to drive snakes towards features of interest. Three different potentia (image) energy functionas are descried eow; these attract snakes to ines, edges, and terminations. The tota potentia energy can e expressed as a weighted comination of these functionas: P = E image = w ine E ine + w edge E edge + w term E term (3.) The nearest oca minimum the potentia energy can e found using gradient descent as descried in Section 4: x d x + dx (3.2) The image forces δx produced y each of the terms in Equation 3. are derived eow, in advance of the main discussion of energy minimisation and forces in Sections 4 6. If just a sma portion of an active contour mode finds a owenergy image feature then the interna constraints wi pu neighouring eements towards that feature. This effect can e enhanced y spatiay smoothing the potentia energy fied. Typicay, a snake is first aowed to reach equiirium on a very smooth potentia; the urring is then graduay reduced see Witkin et a (986). At very coarse scaes the snake does a poor jo of ocaising features, and fine detai is ost; however, it is attracted to oca minima from far away. Reducing the amount of urring aows the snake to form a more accurate mode of the underying image. 3. REGION FUNCTIONAL The simpest potentia energy is the unprocessed image intensity so that P(x) = I(x): E ine = 0 I ( x(s) ) ds (3.3) According to the sign of w ine in Equation 3., the snake wi e attracted either to ight or dark regions of the image. Using to indicate image gradient, the corresponding image force δx is given y: dx œ žp = ži = I(x) Loca minima in the image intensity can therefore e found y taking sma steps in x: x d x t I(x) (3.4) The positive time step τ is chosen to suit the proem domain; however, it is amost invariay one or two orders of magnitude ess than unity to prevent osciation (see Section 7). For an Page 8
9 extension of this idea for segmenting textures and coours see the work on active region modes y Ivins and Porri (995). 3.2 EDGE FUNCTIONAL By far the most common use for active contour modes is as semigoa edgedetectors that minimise a potentia energy in which minima correspond to strong edges see Figure 3. (a) Unprocessed Image () Potentia (Edge) Energy Figure 3: Potentia (Edge) Energy. (a) An unprocessed 256y256 pixe NMR image. () The potentia energy generated y smoothing the image, convoving it with a simpe gradient operator, and negating the resut (the image has een rescaed for dispay). Strong edges produce correspondingy ow (dark) oca minima; however, fine detai is ost during the smoothing process, which is necessary to eiminate noise and spread out egitimate edges. Edges can e found with a gradientased potentia energy functiona such as: 2 E edge = ži 0 ds (3.5) For exampe, consider a snake eement x = (x, y) with potentia energy P(x) = I(x) 2 ; the image force acting on this eement is given y: dx œ žp = ž ( I 2 ) = 2 I(x) I(x) The term I(x) is the Hessian matrix of secondorder image derivatives. Strong edges can therefore e found using: x d x + t I(x) I(x) (3.6) Page 9
10 3.3 TERMINATION FUNCTIONAL The ends of ine segments, and therefore corners, can e found using an energy term ased on the curvature of ines in a sighty smoothed image C(x, y) = G σ (x, y) * I(x, y). If the gradient direction is given y θ = tan (C y / C x ) then the unit vectors aong, and perpendicuar to, the image gradient are given y: Tangent: n = cos h sin h Norma: n z = sin h cos h The curvature of a contour in C(x, y) can e written: E term = žh ž 0 ds = žn z 2 2 C/žn z 0 žc/žn Expanding the derivatives: ds (3.7) E term = 0 C yy C x 2 + C xx C y 2 2C xy C x C y C x 2 + C y 2 3/2 ds (3.8) This energy formua provides a simpe means for attracting snakes towards corners and terminations. Page 0
11 4 GRADIENT DESCENT USING FORCES The previous two sections can e summarised y stating that, at its simpest, the energy E of an active contour mode x(s) is defined as: E( x(s) ) = P(x(s)) ds + 0 Potentia a (s) 2 žs 0 Tension 2 ds + ž 2 x(s) 2 žs 0 2 Stiffness 2 ds (4.) This section considers the task of minimising these energy functionas. First, the genera technique of minimisation y iterative gradient descent is introduced; an equation is then derived to descrie the energy changes that occur when an active contour mode is moved, and this equation is used to cacuate forces for energy minimisation y gradient descent. 4. CONJUGATE GRADIENT DESCENT In genera, an energy function E(x) can e minimised y atering each variae according some sma quantity δx that is guaranteed to reduce the vaue of the function: x x + dx Loca inear approximation gives an expression for the new energy: (4.2) E(x + dx) E(x) + že (4.3) $ dx Ceary, δx must e chosen so that the energy decreases at each iteration. The gradient descent rue is ased on the fact that steps down an energy hypersurface (see Figure 4) can e guaranteed y making sma changes in the direction of the negated gradient: dx œ že The new vaue of the energy function is given y: E(x + dx) E(x) t že 2 (4.4) (4.5) The negative sign and square power (dot product) in this equation guarantee that E wi decrease at each iteration unti the minimum is reached; however, the (sma) time step τ must e chosen carefuy to avoid osciation (see Section 7) and is amost invariae ess than unity. Conjugate gradient descent, as iustrated in Figure 4, finds the nearest oca minimum in an energy hypersuface, with no consideration of goa properties. Unfortunatey, this For simpicity, externa constraints are omitted from the remainder of this document. Page
12 simpicity can ead to proems when there are severa minima cose together ecause a snake can e attracted to a feature (energy minimum) other than that intended y the user. E (a) Energy Hypersurface x2 () Energy Contours x2 High Energy Low Energy x x Figure 4: Conjugate Gradient Descent. This figure shows four aternative paths down a threedimensiona energy surface. At each iteration the gradient descent agorithm moves the energy vaue towards the nearest oca minimum y making a sma change in the direction given y the negated energy gradient (orthogona to the oca energy contours). The process is repeated unti this gradient (force) is zero, at which point none of the variaes can e atered without increasing the energy. 4.2 ENERGY GRADIENT FOR AN ACTIVE CONTOUR MODEL Before gradient descent can e used to minimise the energy of an active contour mode it is necessary to otain an expression for the corresponding energy gradient which determines the changes that are made to the mode (forces) at each iteration. From Equation 4. the asic energy of a cosed active contour mode is given y: E(x) = Á P(x) ds + a 2 Á x 2 ds + 2 Á x 2 ds x h x(s) x h /žs x h ž 2 x/žs 2 (4.6) Note the use of dashes to indicate derivatives. The ends of this mode are joined so that it forms a cosed oop; in the discrete approximation to this equation, the first and ast of the N snake eements are consecutive so that x(0) x(n). The energy functionas in this version of the equation are integrated around a cosed snake as shown y the integra signs; this removes the need to specify imits. Page 2
13 If the snake changes sighty then the tota energy of the new configuration is: E(x + dx) = Á P(x + dx) ds + a Á 2 x + dx 2 ds + This equation can e simpified using the foowing approximations: P(x + dx) = P(x) + dp(x) P(x) + Á 2 x žp $ dx + dx 2 ds (4.7) x + dx 2 = x$x + 2x$dx + Equation 4.7 therefore simpifies to: dx $ dx x 2 + 2x$dx Negigie E + de Á P(x) + žp $ dx ds (4.8) + a 2 Áx 2 + 2x $ dx ds + 2 Áx 2 + 2x Sutracting 4.6 from 4.8 gives an approximation for the energy change that arises from a sma adjustment to the configuration of the snake: de = Á žp $ dx ds + a Áx $ dx ds + Áx $ dx ds (4.9) This approximation is simpified using integration y parts (see Mathematica Note 5) to eiminate δx and δx : de = Á žp (4.0) $ dx ds a Áx $ dx ds + Áx $ dx ds Equation 4.0 can e factorised to give a simpe expression that incudes the energy gradient: de = Á žp a x + x $ dx ds (4.) Negating this expression gives the oca direction of steepest descent down the energy hypersurface; however, it does not indicate how far to move and must e treated with caution since it is ony a oca description of the surface. $ dx ds 4.3 FORCES Assuming it is not aready at a minimum, the energy of a snake wi decreases at each iteration if δx is a negated fraction (the time step δt, which must e positive) of the energy gradient given y Equation 4.: dx = dt žp a x + x (4.2) Page 3
14 Sustituting this expression ack into Equation 4. gives: de = dt Á žp 2 a x + x The iterative rue for conjugate gradient descent is therefore: x x + dx At the imit of infinitesima steps: žt = a ž2 x žs 2 Tension Force dx dt = že ž4 x žs 4 Stiffness Force ds = a x x dp dx žp Image Force (4.3) (4.4) (4.5) The energy of an active contour mode can therefore e minimised y cacuating this resutant force for, and appying it to, each snake eement in turn. Note that in mechanica systems, force is the product of mass and acceeration: f = m ž2 x žt 2 However, in Equation 4.5 force and veocity are equivaent: f = An active contour mode driven using this equation therefore ehaves as though traveing in a viscous medium such that inertia is negigie and movement with constant veocity requires a constant force to e appied. žt (a) Initia Snake () Fina Snake Figure 5: An Active Contour Mode. This figure shows two views of an MR image (the potentia energy generated y smoothing the image and convoving it with a simpe gradient Page 4
15 operator is shown in Figure 3). (a) An initia snake configuration marked y the user. () The fina snake configuration after energy minimisation y gradient descent; the snake is modeing the skin over the sku. (Note that the snake has een reparameterised during energy minimisation; this process is not discussed further in this document.) Gradient descent using expicit forces is not the ony way to minimise the energy of an active contour mode. For exampe, dynamic programming was proposed y Amini et a (988) as a method for finding minima that are guaranteed to e goa within some predetermined search range; however, this method suffers from increased computationa compexity and wi not e discussed further in this document. The semiimpicit method originay used y Kass et a (987) is a faster aternative that reies on an efficient matrix inversion agorithm to sove a set of simutaneous equations y reaxation; the soutions to these equations descrie the minimum energy state of an active contour mode. The semiimpicit method is descried in the next two sections. Page 5
16 5 CALCULUS OF VARIATIONS This section uses variationa cacuus to derive the EuerLagrange equation, which descries extrema in functionas; this equation is then used to otain an equation that descries the minimum energy condition of an active contour mode. 5. THE EULERLAGRANGE EQUATION Consider the proem of minimising (or maximising) a functiona E such as: E(y) = a F ( x, y(x), y (x) ) dx (5.) (The independent variae x can e omitted where there is no amiguity). Making a sma change δy to the vaue of the function y generates a corresponding change in E: E(y + dy) = a F ( x, y + dy, y + dy ) dx (5.2) Using the Tayor expansion (see Mathematica Notes 3 and 4) and ignoring terms aove first order: E + de a F + žy dy + dy dx žy Sutracting 5. from 5.3 gives: de a žy dy + dy dx žy Eiminating δy using integration y parts as descried in Mathematica Note 5: de a žy dy d dx žy dy dx At extrema in E a sma change in y produces amost no change in the vaue of the functiona: a žy d dx žy dy dx 0 (5.3) (5.4) (5.5) (5.6) As δy is known to e nonzero, Equation 5.6 gives rise to the EuerLagrange Equation which is satisfied at extrema in F: žy d dx žy = 0 (5.7) Of course, the extremum descried y the EuerLagrange equation coud e a maximum or a point of infection rather than a minimum. If necessary, the secondorder partia derivative (which wi e positive at minima, negative at maxima, and zero at points of infection) can sometimes e cacuated to resove the amiguity. Page 6
17 To summarise, for a sma change δy to a functiona F(x, y, y ): de = a de dy(x) dy dx de dy(x) The first variation δ / δy(x) pays the equivaent roe for functionas that the first derivative d / dx pays for functions, so that δe / δy(x) = 0 at extrema; it can therefore e used to find the minimum energy condition for a snake. = žy d dx žy 5.2 MINIMA IN SNAKE ENERGY FUNCTIONALS From Equation 4. the asic energy of an active contour mode is given y: E( x(s) ) = 0 F ( s, x(s), x (s), x (s) ) ds Consider the effect of a sma change in the vector x: x h x(s) x h /žs x h ž 2 x/žs 2 E(x + dx) = 0 F (x + dx, x + dx, x + dx ) ds (5.8) (5.9) Using the Tayor expansion: E + de 0 F + $ dx + $ dx + Sutracting 5.8 from 5.0: $ dx ds de 0 $ dx + $ dx + $ dx ds Terms in δx and δx are eiminated using integration y parts: de 0 $ dx d ds Factorising: $ dx + de 0 d + d 2 ds ds 2 This yieds the EuerLagrange equation for extrema in E: d ds + d 2 ds 2 d 2 ds 2 $ dx ds $ dx ds = 0 (5.0) (5.) (5.2) (5.3) (5.4) Again, this equation descries a types of extrema, not just minima. Fortunatey, when minimising the energy of a snake the amiguity is easiy resoved y changing the sign of each term in the equations of motion. then: If the functiona F is to represent the potentia energy, tension and stiffness of a snake F = P(x) + a 2 x x 2 (5.5) Page 7
18 Assuming α and β are constants, the partia derivatives for Equation 5.4 are as foows: = žp = a x = x Comining 5.4 and 5.5 gives the minima energy condition for a snake: žp a x + x = 0 Energy Gradient (5.6) Unfortunatey, these equations are difficut to sove anayticay ecause x must e known efore P/ x can e found. However, the equations can e soved using semiimpicit reaxation methods as descried in Section 6. Page 8
19 6 SEMIIMPLICIT MINIMISATION Section 5 showed that, at equiirium, each eement in a snake satisfies a vector equation which states that it does not move during time steps: žt = a ž2 x žs 2 ž4 x žs 4 žp = 0 (6.) The energy of the mode can therefore e minimised y soving a of these equations simutaneousy using semiimpicit reaxation methods. The vector terms in Equation 6. are separae into x and y components. Writing u j where j = 0,, N as a discrete approximation for x(s) or y(s), and using superscript t to denote iteration, Equation 6. ecomes: žu j t žt = a ž2 t u j žs 2 ž4 t u j žs 4 žp žu j t (6.2) t+ 4 4 Fourth 6 Order t t+ t 2 j 2 j j j+ j+2 Second Order Figure 6: Approximating Derivatives With Finite Differences. The secondorder derivative (tension force) is approximated over three eements; the fourthorder derivative (stiffness force) is approximated over five eements. In the semiimpicit method these derivatives are regarded as estimates for the next time step. The derivatives in Equation 6.2 are estimated using finite differences as shown in Figure 6 and Appendix A: žu žt d u j t+ u j t dt ž 2 u žs 2 d u j+ t+ + u t+ t+ j 2u j ds 2 ž 4 u žs 4 d u j+2 t+ 4u t+ j+ + 6u t+ j 4u t+ t+ j + u j 2 ds 4 Page 9
20 Note that the second and fourth derivatives are estimated as though at the next time step (t+). Comining these approximations gives the finite difference equation: u j t+ t u j dt = a ds 2 u t+ j+ + u t+ t+ j 2u j ds 4 u j+2 t+ 4u t+ j+ + 6u t+ j 4u t+ t+ j + u j 2 Moving terms that cannot e estimated at time t over to the LHS gives: žp žu j t t+ t+ t+ t+ t+ u j+2 (a + 4)u j+ + ( + 2a + 6)u j (a + 4)u j + u j 2 (6.3) = u j t + dt žp žu j t Note: a h adt/ds2 h dt/ds 4 The RHS of Equation 6.4 can e evauated using the potentia energy at time t: pu t+ j+2 + qu t+ j+ + ru t+ j + qu t+ t+ t+ j + pu j 2 = ũ j ũ j t+ = u j t + dt žp žu j t p h q h a 4 r h + 2a + 6 (6.4) (6.5) This equation eads to a set of 2N simutaneous inear equations (for the x and y coordinates of each eement in the snake) that can e written in standard matrix form. r q p p q q r q p p p q r q p p q r q p p p q r q q p p q r t+ u 0 t+ u t+ u 2 t+ u N 3 t+ u N 2 t+ u N = t+ ũ 0 t+ ũ t+ ũ 2 t+ ũ N 3 t+ ũ N 2 t+ ũ N (6.6) M u t+ = ũ t+ The constant vaues making up the matrix M are as foows: p h dt ds 4 q h a dt ds 2 4 dt ds 4 r h + 2a dt ds dt ds 4 This mathematica trick produces a set of equations that descrie the ehaviour of the mode over time. The idea is to move the snake according to the image forces at the current time step, and then to smooth the resuting mode immediatey at the start of the next iteration. At equiirium these processes cance out. Page 20
21 Each row of the matrix can e thought of as a convoution mask for evauating the derivatives; the vectors represent the positions of the snake eements, oth efore and after adjustment to conform with the interna forces. Mutipying oth sides of Equation 6.6 y the inverse of M gives the fina soution (see Mathematica Note 6): u t+ = M u t + dt žp žu t (6.7) Note that M is a cycic symmetric pentadiagona anded matrix which can e inverted using the agorithm descried y Benson and Evans (973; 977) making the soution of Equation 6.7 an O(N) process rather than O(N 3 ). If the tension and stiffness parameters and the numer of eements are constant then the inverse matrix need ony e cacuated once. #define N const apha=.0, eta=0.5; // tension, stiffness const ds=.0, ds2=ds*ds, dt=0.05; // space, time doue x[n], y[n]; // snake // code to create snake here do { // externa step for(int j=0; j<n; j++) { x[j] += dt * fx(x[j], y[j]); // image force y[j] += dt * fy(x[j], y[j]); } // interna step a=apha*dt/ds2; =eta*dt/ds2 // NB: constants? p=; q=a4; r=+2a+6; pentadiagona_sove(p, q, r, x, n); pentadiagona_sove(p, q, r, y, n); } whie(!equiirium); Agorithm : SemiImpicit Energy Minimisation. This Cstye pseudocode outines the semiimpicit agorithm for minimising the energy of an active contour mode. The coordinates of the N snake eements are specified y the arrays x[s] and y[s]. The externa step moves each eement according to the image forces computed using the (undefined) functions fx() and fy(). The interna step then smoothes the mode y soving a set of equations in the form of a pentadiagona anded matrix (see Equation 6.6). The process is repeated unti equiirium is detected in some way. (The effects of the interna and externa steps cance out at equiirium.) Page 2
22 The semiimpicit energy minimisation process is summarised in Agorithm. Each iteration takes impicit Euer steps with respect to the interna energy, and expicit Euer steps with respect to the externa and image energy. The minimisation process is therefore stae in the presence of very high tension and stiffness. Furthermore, with ordinary reaxation methods the propagation of forces aong a snake is sow; however, the semiimpicit procedure aows forces to trave aritrary distances in a singe O(N) iteration. Page 22
On the relationship between radiance and irradiance: determining the illumination from images of a convex Lambertian object
2448 J. Opt. Soc. Am. A/ Vo. 18, No. 10/ October 2001 R. Ramamoorthi and P. Hanrahan On the reationship between radiance and irradiance: determining the iumination from images of a convex Lambertian object
More informationUse R! Series Editors: Robert Gentleman Kurt Hornik Giovanni G. Parmigiani. For further volumes: http://www.springer.
Use R! Series Editors: Robert Genteman Kurt Hornik Giovanni G. Parmigiani For further voumes: http://www.springer.com/series/6991 Graham Wiiams Data Mining with Ratte and R The Art of Excavating Data
More informationHealth Literacy Online
Heath Literacy Onine A guide to writing and designing easytouse heath Web sites Strategies Actions Testing Methods Resources HEALTH OF & HUMAN SERVICES USA U.S. Department of Heath and Human Services
More informationOPINION Two cheers for Pvalues?
Journa of Epidemioogy and Biostatistics (2001) Vo. 6, No. 2, 193 204 OPINION Two cheers for Pvaues? S SENN Department of Epidemioogy and Pubic Heath, Department of Statistica Science, University Coege
More informationThe IBM System/38. 8.1 Introduction
8 The IBM System/38 8.1 Introduction IBM s capabiitybased System38 [Berstis 80a, Houdek 81, IBM Sa, IBM 82b], announced in 1978 and deivered in 1980, is an outgrowth of work that began in the ate sixties
More informationDistinctive Image Features from ScaleInvariant Keypoints
Distinctive Image Features from ScaleInvariant Keypoints David G. Lowe Computer Science Department University of British Columbia Vancouver, B.C., Canada lowe@cs.ubc.ca January 5, 2004 Abstract This paper
More informationAll Aspects. of a...business...industry...company. Planning. Management. Finance. An Information. Technical Skills. Technology.
A Aspects Panning of a...business...industry...company Management Finance Technica Skis Technoogy Labor Issues An Information Sourcebook Community Issues Heath & Safety Persona Work Habits Acknowedgement
More informationTHE PROBLEM OF finding localized energy solutions
600 IEEE TRANSACTIONS ON SIGNAL PROCESSING, VOL. 45, NO. 3, MARCH 1997 Sparse Signal Reconstruction from Limited Data Using FOCUSS: A Reweighted Minimum Norm Algorithm Irina F. Gorodnitsky, Member, IEEE,
More informationAre Health Problems Systemic?
Document de travai Working paper Are Heath Probems Systemic? Poitics of Access and Choice under Beveridge and Bismarck Systems Zeynep Or (Irdes) Chanta Cases (Irdes) Meanie Lisac (Bertesmann Stiftung)
More informationModelling with Implicit Surfaces that Interpolate
Modelling with Implicit Surfaces that Interpolate Greg Turk GVU Center, College of Computing Georgia Institute of Technology James F O Brien EECS, Computer Science Division University of California, Berkeley
More informationSecuring the future of excellent patient care. Final report of the independent review Led by Professor David Greenaway
Securing the future of exceent patient care Fina report of the independent review Led by Professor David Greenaway Contents Foreword 3 Executive summary 4 Training structure for the future 6 Recommendations
More informationHow to Make Adoption an Affordable Option
How to Make Adoption an Affordabe Option How to Make Adoption an Affordabe Option 2015 Nationa Endowment for Financia Education. A rights reserved. The content areas in this materia are beieved to be current
More informationThe Backpropagation Algorithm
7 The Backpropagation Algorithm 7. Learning as gradient descent We saw in the last chapter that multilayered networks are capable of computing a wider range of Boolean functions than networks with a single
More informationFeature Detection with Automatic Scale Selection
Feature Detection with Automatic Scale Selection Tony Lindeberg Computational Vision and Active Perception Laboratory (CVAP) Department of Numerical Analysis and Computing Science KTH (Royal Institute
More informationOptimization by Direct Search: New Perspectives on Some Classical and Modern Methods
SIAM REVIEW Vol. 45,No. 3,pp. 385 482 c 2003 Society for Industrial and Applied Mathematics Optimization by Direct Search: New Perspectives on Some Classical and Modern Methods Tamara G. Kolda Robert Michael
More informationON THE DISTRIBUTION OF SPACINGS BETWEEN ZEROS OF THE ZETA FUNCTION. A. M. Odlyzko AT&T Bell Laboratories Murray Hill, New Jersey ABSTRACT
ON THE DISTRIBUTION OF SPACINGS BETWEEN ZEROS OF THE ZETA FUNCTION A. M. Odlyzko AT&T Bell Laboratories Murray Hill, New Jersey ABSTRACT A numerical study of the distribution of spacings between zeros
More informationShape from Shading: A Survey Ruo Zhang, PingSing Tsai, James Edwin Cryer and Mubarak Shah Computer Vision Lab School of Computer Science University of Central Florida Orlando, FL 32816 shah@cs.ucf.edu
More informationIntroduction to Differential Calculus. Christopher Thomas
Mathematics Learning Centre Introduction to Differential Calculus Christopher Thomas c 1997 University of Sydney Acknowledgements Some parts of this booklet appeared in a similar form in the booklet Review
More informationRelationship Between the Retirement, Disability, and Unemployment Insurance Programs: The U.S. Experience
Reationship Between the Retirement, Disabiity, and Unempoyment Insurance Programs The US Experience by Virginia P Reno and Danie N, Price* This artice was prepared initiay for an internationa conference
More informationWho to Follow and Why: Link Prediction with Explanations
Who to Foow and Why: Lin rediction with Expanations Nicoa Barbieri Yahoo Labs Barceona, Spain barbieri@yahooinc.com Francesco Bonchi Yahoo Labs Barceona, Spain bonchi@yahooinc.com Giuseppe Manco ICARCNR
More informationYOUR GUIDE TO Healthy Sleep
YOUR GUIDE TO Heathy Seep Your Guide to Heathy Seep NIH Pubication No. 115271 Originay printed November 2005 Revised August 2011 Contents Introduction...1 What Is Seep?...4 What Makes You Seep?...7
More informationUnderstanding the FiniteDifference TimeDomain Method. John B. Schneider
Understanding the FiniteDifference TimeDomain Method John B. Schneider June, 015 ii Contents 1 Numeric Artifacts 7 1.1 Introduction...................................... 7 1. Finite Precision....................................
More informationLTM9001Ax/LTM9001Bx. 16Bit IF/Baseband Receiver Subsystem FEATURES DESCRIPTION APPLICATIONS TYPICAL APPLICATION
FEATURES n Integrated 16Bit, HighSpeed ADC, Passive Fiter and Fixed Gain Differentia Ampifi er n Up to 3MHz IF Range Lowpass and Bandpass Fiter Versions n Low Noise, Low Distortion Ampifi ers Fixed Gain:
More informationAn Introduction to Tensors for Students of Physics and Engineering
NASA/TM 2002211716 An Introduction to Tensors for Students of Physics and Engineering Joseph C. Kolecki Glenn Research Center, Cleveland, Ohio September 2002 The NASA STI Program Office... in Profile
More informationSteering User Behavior with Badges
Steering User Behavior with Badges Ashton Anderson Daniel Huttenlocher Jon Kleinberg Jure Leskovec Stanford University Cornell University Cornell University Stanford University ashton@cs.stanford.edu {dph,
More informationIndexing by Latent Semantic Analysis. Scott Deerwester Graduate Library School University of Chicago Chicago, IL 60637
Indexing by Latent Semantic Analysis Scott Deerwester Graduate Library School University of Chicago Chicago, IL 60637 Susan T. Dumais George W. Furnas Thomas K. Landauer Bell Communications Research 435
More informationLearning Deep Architectures for AI. Contents
Foundations and Trends R in Machine Learning Vol. 2, No. 1 (2009) 1 127 c 2009 Y. Bengio DOI: 10.1561/2200000006 Learning Deep Architectures for AI By Yoshua Bengio Contents 1 Introduction 2 1.1 How do
More informationMinimum Required Payment and Supplemental Information Disclosure Effects on Consumer Debt Repayment Decisions
DANIEL NAVARROMARTINEZ, LINDA COURT SALISBURY, KATHERINE N. LEMON, NEIL STEWART, WILLIAM J. MATTHEWS, and ADAM J.L. HARRIS Repayment decisions ow muc of te oan to repay and wen to make te payments directy
More informationAn Experimental Comparison of MinCut/MaxFlow Algorithms for Energy Minimization in Vision
In IEEE Transactions on PAMI, Vol. 26, No. 9, pp. 11241137, Sept. 2004 p.1 An Experimental Comparison of MinCut/MaxFlow Algorithms for Energy Minimization in Vision Yuri Boykov and Vladimir Kolmogorov
More informationOnedimensional modelling of a vascular network in spacetime variables
Onedimensional modelling of a vascular network in spacetime variables S.J. Sherwin, V. Franke, J. Peiró Department of Aeronautics, South Kensington Campus, Imperial College London, London, SW7 2AZ, UK
More information