loop snakesiv05

6

Click here to load reader

Upload: saulloribeiro

Post on 21-May-2015

356 views

Category:

Technology


2 download

DESCRIPTION

The topologically adaptable snake model, or simply Tsnakes,is a useful tool for automatically identifyingmultiple segments in an image. Recently, in [4], a novelapproach for controlling the topology of a T- snake wasintroduced. That approach focuses on the loops formedby the projected curve which is obtained at every stageof the snake evolution. The idea is to make that curve theimage of a piecewise linear mapping of an adequateclass. Then, with the help of an additional structure, theloop-tree, it is possible to decide in O(1) time whetherthe region delimited by each loop has already beenexplored by the snake. In the original proposal of theLoop Snakes model, the snake evolution is limited tocontraction and there is only one T-snake that contractsand splits during evolution. In this paper we generalizethe original model by allowing the contraction as well asthe expansion of several T-Snakes.

TRANSCRIPT

Page 1: Loop snakesiv05

Loop Snakes: The Generalized Model

ANTONIO OLIVEIRA1, SAULO RIBEIRO1, CLÁUDIO ESPERANÇA1, GILSON GIRALDI2

1Dept. of Syst. Eng. and Comp. Sciences -COPPE/Federal Univ. of Rio de Janeiro, Brazil 2 National Laboratory of Scientific Computation – Petrópolis, Brazil

oliveira,saulo,[email protected]; [email protected]

AbstractThe topologically adaptable snake model, or simply T-

snakes, is a useful tool for automatically identifying multiple segments in an image. Recently, in [4], a novel

approach for controlling the topology of a T- snake was

introduced. That approach focuses on the loops formed by the projected curve which is obtained at every stage

of the snake evolution. The idea is to make that curve the image of a piecewise linear mapping of an adequate

class. Then, with the help of an additional structure, the

loop-tree, it is possible to decide in O(1) time whether the region delimited by each loop has already been

explored by the snake. In the original proposal of the

Loop Snakes model, the snake evolution is limited to contraction and there is only one T-snake that contracts

and splits during evolution. In this paper we generalize

the original model by allowing the contraction as well as the expansion of several T-Snakes.

1. Introduction

Parametric Snake models are deformable models proposed by Kass at al. [2] which have been successfully applied in a variety of problems in computer vision and image analysis [3]. Its mathematical formulation makes easier to integrate, in a single extraction process, image data, an initial estimation, desired contour properties and knowledge based constraints. In comparison to other methodologies to segment an image, they have the appreciable property of producing a closed polygonal curve at any iteration while some classical gradient based approaches only get that at the end of a sequence of different processes. The updating procedure performed at each step is usually computationally lighter than those employed in relaxation methods and the interaction between snaxels serves to obtain smoother border approximations while other simple alternatives – like thresholding – may require a post-processing specifically for that. Despite of their capabilities, a known limitation of most snake methods is that the topology of the structures of interest must be known in advance since the mathematical model cannot deal with topological

changes without adding extra machinery. Among the proposed works to address this limitation, the T-snakes model has the advantage of being a general one. The T-snakes have the ability of changing their topology either by splits or merges allowing the recovery of more than one segment in the target image. The basic idea is to embed a discrete deformable model within the framework of a triangulation of the image domain. The Characteristic Function of the set of points already visited by the snake is, then, sampled at the nodes of that triangular grid. Placing a snaxel on every edge where that characteristic function changes value and linking those placed on adjacent edges, we have a simple way of evolving a snake which is able to perform topological changes.In the Loop Snakes model proposed in [4], the decomposition framework consists of a mesh of square cells which is the easiest way of avoiding the well known direction bias that original T-snakes have. The Characteristic Function sampled at the grid nodes is replaced by a matrix of flags indicating for each cell whether it has been visited earlier by the projected curve – PC – of the current iteration. The fact that it, essentially, uses only data produced in the current step is a noticeable difference which makes it easier refining the mesh or making a snake move backwards. Topological changes are performed based on the loops formed by that projected curve. The regions delimited by some of these loops – which are named closed – have already been totally explored, while those encircled by others – called open loops – have not been visited yet. While closed loops must be discarded, the open ones are made the snakes of the next stage and for that reason, we choose to call them loop snakes. Figure 1 pictures this idea. It shows a step of a snake evolution with the arrows indicating the displacement applied to the snaxels in the step. In the projected curve of that step some self-intersection points happen. These points define closed loops– those enclosing regions that have already been doubly swept by the snake – and open loops delimiting regions yet to be explored. When a loop L is formed, its label – closed or open – can be found in O(1) time, either by considering the label of the loops adjacent to L that have been found earlier or

Proceedings of the Ninth International Conference on Information Visualisation (IV’05)

1550-6037/05 $20.00 © 2005 IEEE

Page 2: Loop snakesiv05

by simply examining the connection of L with the rest ofthe projected curve.

Figure 1: Original snake and the projected curve of astep.

In [4], the whole image is encircled by a closed snake.During its evolution, that snake is continuouslycontracted and eventually broken into smaller oneswhich are subjected to the same contraction process. In this paper we generalize the loop snakes modelallowing the use of an a initial set of snakes, disjoint toeach other, which may be either contracting or expanding. Those snakes must only comply with the twofollowing simple rules. 1) Every expanding snake isencircled by a contracting one. 2) A contracting snakecannot enclose another. These assumptions avoid thatregions wider than twice the length of a mesh edge, areswept more than once. Two or more expanding snakes can be merged into a single one and the evolution of one of them can generateseveral contracting snakes. Also a contracting and a expanding snake can collide or simply get too close toeach other. In this case, depending on the context, the two snakes are either abandoned or are turned intostandard ones and used as initial solutions of a dualprocess to get a finer approximation of the contour thatpresumably exists between or close to them. Having contracting and expanding snakes, a contour can be approximated both from inside and from outside whichallows to determine it in a more reliable way incomparison to the case where snakes of only one type are used.As the focus of this work is the control of a snake topology, we consider that the physical displacement of a snaxel is computed by a “black-box”. Most of thesecondary rules used in this work are also employed byother approaches: 1) If a cell C is cut by the snakes of acertain number of consecutive steps, the snaxels in C are either frozen or subjected to an artificial force to takethem out of C – that is the way a snake escapes from alocal minimum of energy. 2) The process ends when all snaxels are frozen. This paper is organized as follows. Other models for controlling the topology of a snake are revised on section2 . Loop snakes are described in Sections 3-9 whilesections 10 and 11 are dedicated, respectively, tocomputational results and to conclusions and futureworks.

2. Other models for controlling the topology

The T-Snakes approach is composed basically by four components[3]: (1) a discrete snake model, which takesthe initial snake of a step – S – into the, so called,transformed curve – TC; (2) a simple CF-triangulation of the image domain; (3) A way of projecting thetransformed curve onto the grid edges, obtaining, then,the projected curve – PC; (4) a binary function, calledcharacteristic function, defined on the grid nodes, whichdistinguishes the interior from the exterior of theprojected curve.To clear the idea, consider the characteristic functions (f1

and f2) relative to the regions delimited by the twocontours pictured in Figure 2. These functions aresampled on the vertices of a CF-triangulation of theplane and the T-snakes algorithm marks – or burns –those vertices where max{f1,f2}= 1. The merge of thecurves is, then, obtained by choosing a vertex in everyedge linking a burnt to a non-burnt vertex.Updating the set of burnt vertices at an iteration,however, is not so simple. In [3] it is indicated that 16different cases must be considered to decide whether a vertex must be burnt. Also, in an usual iteration, whereno topological changes occur, it is easy to see that theprojected curve is unnecessarily traversed twice – once for burning nodes and once for choosing a vertex on every transition edge. Moreover, the use of triangularmeshes, necessary to obtain new snakes as level sets in an unambiguous way, determines that grid diagonalsshould be considered. That can enlarge considerably thenumber of crossings between PC and the grid edges besides introducing a directional bias.

Figure 2: Two snakes colliding. Snaxels and grid nodes inside each one of them are marked.

In the approach described in[1] a snaxel is displaced only along the grid edge – e – where it is. If a vertex – v – of that edge is reached, the snaxel is exploded into three – one on each edge adjacent to v different from e. This methodology determines that the transformed curve isalways simple and that its vertices are already on grid edges. On the one hand, this method has none of thedrawbacks of the original T-snakes model mentionedabove. On the other hand, it has its own disadvantageslike complicating the way of displacing snaxels and either reducing the time lag or provoking the alignmentof snaxels, facts that can slow the snake evolution.

Proceedings of the Ninth International Conference on Information Visualisation (IV’05)

1550-6037/05 $20.00 © 2005 IEEE

Page 3: Loop snakesiv05

Loop-snakes is an alternative to avoid the difficulties of both that last method and the original T-snakes model.The price to be paid for that is to complicate the process that makes a topological change. However, consideringthat: i) The process that must be executed at a general snaxel to keep topology under control, is extremelysimple, in the case of the loop-snakes; ii) The number of topological changes is only a small fraction of thenumber of snaxels that is generated; it can be concludedthat Loop snakes are really a valid option to implementtopologically adaptable snakes.

3. Loop Snakes

Let S j= [sk, k=1,...,K(j)] , j=1,...J , be the snakes that must be transformed at a certain stage. TC j = [t,k = T(sk),k=1,...,K(j)] and PC j = [s',m, m=1,...,M(j)] will be,respectively, the transformed and projected curve obtained from S j. Also let TC and PC be the union of allTC j and and PC j, respectively.The Loop-snakes approach is based in the followingreasoning:1) At first we enforce that every PC j is the result ofapplying a mapping of a special class to a dilated versionof the snake S j. That curve and the mapping will becharacterized in section 5. The use of CEP coordinates,given in section 4, makes it simpler to assure that PC j

has the property above . 2) If PC j has the property given in 1, then the label of a loop L can be obtained in a straightforward way fromthat of any loop adjacent to it that has been found earlier. If no such a loop exists, the label of L can be determined by looking into its connection with theremainder of PC. Finally, if PC j, itself, is a loop, itslabel will be found by verifying the position of its first vertices in relation to S j and the other snakes of thestage. The whole labeling process is described in section7. Part of that process is based on the concept of Loop-Tree of a curve, which is precisely characterized in section 6. 3) Splits – treated in section 8 – must be made before themerges– focused in section 9. While splitting does notpresent any special difficulty, merging requires a moreelaborate approach by the following simple fact: If PC j

has the property indicated in 1, only a merge can change the contour of an open loop after its determination. Thecomplexity of the specific processes of the mergingphase, however, depends only on the number of loopsgenerated at a stage. This makes the time spent by themnegligible in comparison to that required by processingthe usually much larger number of snaxels generatedduring the whole evolution process.

4. Regular Curves and CEP coordinates

Hereafter, will refer to the mesh employed to partitionthe image domain. We call a -curve any polygonal linesuch that: (a) Its vertices are the points where it intersectsthe mesh edges. (b) No vertex of the curve coincides with any vertex of the mesh. A regular -curve is one

which is simple and has a single vertex on every meshedge crossed by it. PC curves are only -curves while topological snakes must be regular ones . Two -curvescrossing the same sequence of mesh edges are said to beequivalent and a -intersection between two -curves is one which cannot be removed by replacing the curves byequivalent ones. To represent a -curve S = [si; i= 0 ... I-1] it suffices torepresent points in the relative interior of the grid edges.

Here we will use the Cell - Edge of the cell - Point of the

edge (CEP) system where each si is represented by: (a) The cell coordinate C(si) indicating the cell containing[si , si+1]; (b) The edge coordinate E(si) indicating whichof the four edges of C(si) contains si (the left, top, rightand bottom edges are numbered 0, 1, 2 and 3,respectively); (c) p(si), the distance between si; and itsburnt-vertex expressed in pixels. The use of CEPcoordinates makes it easier not only to enforce that theprojected curve has appropriate properties but, also, todetect and treat loops.If S is an evolving snake the burnt-vertex of si, termed ui

is the vertex of the mesh edge containing si which is on the side of S that has already been explored.

The -Dilation of S – D(S) – is the curve obtained byreplacing every si by wi = ui + (si – ui), where is a small positive number. The idea is to obtain a -curveequivalent to S that passes very close to the burnt-vertices of si; i= 0 ... I-1.

5. PC as the image of an adequate mapping

We will consider that the projected curve obtained byevolving a topological snake Sj is the image of amapping applied to the -Dilation of that snake. Making the domain of be D(Sj), instead of Sj, reduces the effort to make that mapping have some desirableproperties.Those properties must include that is a continuousorder-preserving piecewise linear mapping whichassociates points close to each other. To establish this last requirement in a more formal way and to avoid that a snake gets back to a cell it has already totally swept, werequire that for every vertex – ui , ; i= 0 ... I-1 – of D(S),

D(S)

S

Figure 3: (A) Elements used in the CEP system.(B) A -curve and its -dilation.

(B)

E(s)i =1si

2

si+1C(s)i0

3

(A)

Proceedings of the Ninth International Conference on Information Visualisation (IV’05)

1550-6037/05 $20.00 © 2005 IEEE

Page 4: Loop snakesiv05

( ui) is in one of the 4 cells which are adjacent to the other node of the mesh edge containing it.To characterize a last attribute that must have, somedefinitions are necessary :1)A mapping *: D(S) 2 is said to be equivalent to

if its image is a -curve PC* = [ s*j , j= 0 ... J-1] suchthat:1) s*j and s’j are on the same mesh edge. 2) -1( s’j )and ( *)-1(s*j) are on the same edge of D(S).2) Let z and z' be two points on the same edge of D(S)such that *(z) and *(z') are in the same mesh cell.The quadrilateral [z, z', *(z'), *(z)] is called a sweeping quadrilateral of *.3) * is said to be direct if none of its sweepingquadrilaterals is reverse. Figure 4 illustrates this concept.

Figure 4 - Non-Direct (a-b) and Direct Mappings(c-d).

The last requirement on is exactly, that it is equivalentto a direct mapping *. If satisfies all the requisitesindicated above it is called adequate and has thefollowing good features: 1) The border of the stripcovered by the sweeping quadrilaterals of is formed by

D(S j) and a set of loops of PC j. 2) A series of results,given in Section 7 can be explored to label these loops.The main result of the theory supporting the Loop-snakes approach states that will be equivalent to a direct mapping, iff we manage to avoid the twoundesirable configurations involving snaxels of S j and vertices of PC j , which are depicted in figures 5-A and 5-B. In the configuration of figure 5-A, PC j crosses

D(Sj) which makes not monotonous. Thatconfiguration is characterized by the fact that snaxels si

and si+1 of S j and vertices s'j and s'j+1 of PC j lay on the 4 edges adjacent to the burnt node of si . If such a configuration is detected, the intersection between PC j

and D(S j) is eliminated by replacing s'j-1 and s'j by si-1

and si, respectively.

Figure 5- Undesirable configurations

The second configuration to be avoided concerns to theexistence of reverse sweeping quadrilaterals. It is shown in Figure 5(B), where: i) The snaxels si and si+1 of S j and vertices s'j and s'j+1 of PC j lay on the 4 edges adjacent to the non-burnt node of si . ii)The pairs (s'j ,si) and (s'j+1,si+1) lay on edges with the same direction. iii) [s'j , s'j+1][ti-1, ti]. The occurrence of that configuration makes itimpossible to define in a way that it has no reversesweeping quadrilaterals. The correction, in this case,consists, merely, of replacing ti by s'j.Both cases are simultaneously handled by the proceduregiven below which must be applied at the creation ofevery new vertex of PC j. The following notation is used:s, s' and t will refer to the current vertex of S j, PC j and TC j, respectively. x.prev indicates the antecessor of vertex x on the polygonal line where it is. c is the last cell that has been crossed by PC j and t(c) is the finalvertex of the last edge of TC j already generated, whichintersects the cell c.

Procedure Making Adequate

{If(t =t(c)) then If (E(s') = (E(s)+2)mod.4) t = s';

Else If (E(s')=(E(s)+1)mod.4 )

If(C(s')=C(s)) {s'.prev= s.prev; s' = s}}

This procedure embodies all that must be done whencomputing a new vertex of PC in order to ensure thatis adequate. As it is shown in section 10 in most of thevertices the first test results false which means thatnothing more has to be done.

6. Loop trees

A Loop-tree of a closed curve C with no multiple self-intersection points, is a graph that can be obtained by thefollowing simple process: Choose a point s in C and a direction D (either clockwise or counter-clockwise).Traverse C in that direction starting at s. Every time a point x is revisited create a node to represent the loopformed by the part of C between the two visits to x,concentrate that loop thoroughly at x and continue thetour. After having completed it, for every loop L1 which has been concentrated on a point of another, L2, create an oriented edge from the node of L1 to the node of L2.A curve and its loop-tree are shown in figure 6.Loop-Trees of different topologies or with the sametopology, but with different loop-node associations can be obtained for the same curve depending on the initialpoint taken and the circulation chosen to traverse thecurve. This could make the snakes of the next stage – which are the open loops of PC j – depend on the vertexat which the construction of PC j starts and on thecirculation chosen to generate that curve. Fortunately, if

is adequate that problem will not exist. In this case, given an open loop L of PC j, in every loop-tree of thatcurve, there is a node representing L or another open loop equivalent to it.

Proceedings of the Ninth International Conference on Information Visualisation (IV’05)

1550-6037/05 $20.00 © 2005 IEEE

Page 5: Loop snakesiv05

Moreover, L is disjoint to the other loops of PC j. This means that, from the moment it is created on, L can only be modified through a merge of PC j with other projectedcurve.

7. Labeling the loops

To simplify the way of labeling the loops, contractingand expanding loop snakes must be traversed in differentdirections so that the region yet to be explored is alwayson the same side of them. Here, we will consider thatcontracting snakes are traversed in the positive directionand expanding ones in the clockwise one. Also, for the sake of concision we will consider in thisarticle that the initial vertex of any loop which is not the root of the loop tree of a connected component of PC,has an antecessor- that is, a vertex generated before – inthat curve1. Considering this assumption, the directionschosen for traversing snakes and the fact that PC j is obtained by applying an adequate mapping to D(S j),then, all non-root loops can be labeled through thefollowing simple rule: Loops whose antecessor of its initial vertex is on its right side are open and need to beexplored. If that antecessor is on the left side the loop isclosed and can be discarded.If the root has children its label can be obtained infunction of the label of any child by employing the four rules below:1)If there is no -intersection separating parent and childat their junction their labels must be the same.2)If there is such an intersection, the parent of an openloop is always closed.3) So does the parent of a closed loop which intersects itout of the junction.4) Finally, if no such an intersection exists the parent of a closed loop is open.

If a connected component of PC has a single loop itmeans that: 1) It has no self-crossings nor intersectionswith other components; 2) It is the result of evolving asingle loop-snake.In view of that isolated loops are labeled as follows:

1 This assumption, however, is not necessary for the loopsnakes model work.

1) When evolving a loop-snake, we check whether thefirst elements of its transformed curve are in cellsalready visited by other loop-snakes or by that samesnake at an earlier steps. If that is true we mark the PC

curve generated from that snake. 2) Unmarked PC curves consisting of an isolated loopare labeled open and those which are marked, closedThis simple process – which is O(1) for loop – avoidsthat a contracting loop snake passes by an expanding one or encloses a region already swept without having itsevolution process stopped.

8. Splitting Phase

To be able to adequately merge PC j with a connected

component CCk of , by only considering the

intersections between PC

1

0

iPCj

i

1

0

iPCj

i

j and the open loops in CCk, it is necessary to process PC j separately – as if it was theonly curve composing PC – identifying all its loops,labeling them and splitting it , if necessary. However , tonot have to traverse PC j a second time, its intersections

with components of are also found during that

process. At the end of it, those intersections which occurwithin a closed loop are discarded. From the remainingones we obtain the loops generated by merges involvingPC j. Figure 7 shows the result of the splitting of anexpanding snake.

figure 6 - A curve and its loop-tree

Figure 7 - The splitting of an expanding snake

9. Merging Phase

The first valid intersection of PCj with a connected

component CCk of – x

1

0

iPCj

i

jk – does not form a loop.

Instead of creating a new loop at that intersection, theprocess appends the loop in CCk where it is, to the part ofPCj generated until xjk. That concatenation must be madein a way that the resulting curve has no self -intersectionat xjk. That is achieved by adequately changing the linksbetween the vertices of the segments of PCj and CCk

determining xjk. Figure 8 indicates how this can be done.

The fact that the first intersection of PCj and CCk – which determines that a new merge occur – must bedistinguished from the others determines that every

Proceedings of the Ninth International Conference on Information Visualisation (IV’05)

1550-6037/05 $20.00 © 2005 IEEE

Page 6: Loop snakesiv05

vertex of a projected curve must have an indicator thatallows to identify, directly or indirectly , the connected

component of where it is. As the set of

connected components of PC varies during theconstruction of that curve, keeping those indicatorsupdated is a version of the classical “union-and-find”problem which is only quasi-linear. This non-linearity,however, is not a problem considering that the number ofconnected components is bounded by that of the initial snakes, which is too small in comparison to the numberof snaxels generated in the whole process.

J

i 0

iPC

10. Statistics and Examples of Segmentation

A program for evolving loop-snakes has beenimplemented and applied to a series of test examples.The statistics obtained in these validation tests are thebest argument in favor of the approach introduced here. For better evaluating the overall computational effortrequired by the approach, the vertices of PC have been grouped in the following classes: A) vertices at which thefirst test made by the procedure Making Direct, givenin section 5 results false. B) Vertices at which a curve PCj revisits a cell. Four classes of images have beenconsidered - Synthetized images, Noisy images, Imageswith many segments and Cells images with a texturedbackground. The results obtained are presented in Table1.

Table 1

Images I Images II Images III Images IV A 414.677 1.909.476 822.413 787.013 B 6.359 8.540 12.541 3.805Overall 557.282 2.847.313 1.183.100 1.212.631

It can be observed in that table that the number of mostcostly vertices of PC, that is, those whose cell is beingrevisited, is extremely small in relation to the totalnumber of them, never reaching 1.2%. Moreover, in any case the vertices in group A are less than 64% of theoverall number of them. All the processing, specific ofthe approach described here, which is executed at thecreation of these vertices, resumes to a single test. Thenumbers of Table I attest to the adequacy of the strategy

employed in this work which spends minimum effortwhen processing a plain snaxel and delay all thecomplication to the moment a loop may be found.

Figures 9-A and 9-B represent examples where themethod has been applied.

11. Conclusions and future works

We described a method for controlling the topology of a family of evolving snakes, which can be both contractingand expanding . The whole process can be implementedby examining only contours – without the need ofconsidering their surroundings – and in a form that thecurves relative to a step are traversed only once. As the processing essentially requires only data produced at thecurrent step, it is easier to refine the cells mesh duringthe process, revert the evolution direction of a snake and even incorporate the structure used to control thetopology into the very representation of the curves.Differently from the existing approaches there is no directional bias or need of reducing the time lag for controlling the topology. Finally, in view of the resultsexpressed in Table 1, we can consider that it has acomputational gain in relation to these earlier alternatives.Future work will address , specially, the constructionof models that evolve in 3D-images. 2D models notrequiring the projection of TC onto the grid edges isalso a line to be explored.

References

[1] S. Bischoff and L. Kobbeit; Snakes with topologycontrol, The Visual Computer, 2003.

[2] M. Kass, A. Witkin and D. Terzopoulos - Snakes:Active contour models; Int. J. of Computer Vision, vol. 1, 321-331, 1988.

[3] T. McInerney and D. Terzopoulos, Topologicallyadaptable contour models; Proc. of Int. Conf ofComputer Vision, 840-845, 1995.

[4] A. Oliveira, S. Ribeiro, G. Giraldi, C. Esperança and R. Farias; Loop Snakes: Snakes with enhanced topologycontrol, Proc. of the XVIII Brazilian Symp. on Comp.Graphs. and Image Process, 364-371 ,2004

[5] A. Yuille and A.Black; Active Vision. MIT Press, 1993.

Closed

Loop

First intersection point External open loop (B)(A)CC

k

PCj

Figure 9 - Examples where the method has been applied.

Starting point

of PCj

Figure 8 - How the merge of two snakes is performed.

Proceedings of the Ninth International Conference on Information Visualisation (IV’05)

1550-6037/05 $20.00 © 2005 IEEE