7
Abstract Intelligent Scissors is an interactive image segmentation tool that allows a user to select piece-wise globally optimal contour segments that correspond to a desired object bound- ary. We present a new and faster method of computing the optimal path by over-segmenting the image using toboggan- ing and then imposing a weighted planar graph on top of the resulting region boundaries. The resulting region-based graph is many times smaller than the pixel-based graph used previously, thus providing faster graph searches and immediate user interaction. Further, the region-based graph provides an efficient framework to compute a 4 parameter edge model, allowing subpixel localization as well as a measure of edge blur. 1. Introduction All general purpose image segmentation techniques require some amount of human guidance due to the large variety of image sources, content and complexity. Conse- quently, a goal of any general image segmentation algorithm should be to accurately define the desired object boundary or region with minimal user input. A variety of segmenta- tion tools exist ranging from user intensive lassoing to semi- automatic initialization schemes such as magic wands and active contour models. Unfortunately, lassoing or other primitive manual tracing tools are still widely used when a non-homogeneous image component must be extracted from a complex background. For this reason intelligent seg- mentation tools which exploit high level visual expertise but require minimal user interaction become appealing. Recently, we presented a unique boundary based seg- mentation algorithm called Intelligent Scissors [12,13] which allow a human operator to interactively select an opti- mal boundary segment, called a “live-wire” [11,7], corre- sponding to a portion of the desired object edge. Intelligent Scissors allow objects to be extracted quickly and accurately using simple gesture motions with a mouse. When the mouse position comes in proximity to an object edge, a live- wire boundary “snaps” to, and wraps around the object of interest. This paper presents improvements to our Intelligent Scissors tool based on an oversegmentation method known as tobogganing that allows for faster optimal path computa- tion in the interactive live-wire environment. Further, the toboggan information provides an efficient framework for computing a 4 parameter edge model which provides sub- pixel localization, blur, and foreground/background color. 2. Previous Work Among the boundary based segmentation strategies, active contours or snakes have received considerable atten- tion over the last few years [1,3,8,9,18]. Active contours are initialized with an approximate boundary and then itera- tively minimize the contour’s energy functional to achieve an optimal boundary. The functional combines external forces such as gradient magnitude with internal forces like boundary curvature in an attempt to yield a final smooth contour that conforms to the desired object boundary. Since snakes are typically initialized with an approximate contour, the human operator is often not quite sure what the final boundary will be until the active contour settles into a mini- mum. Some implementations allow the user to interactively modify the energy landscape and thus nudge a snake [3,8], but still the user does not typically know exactly what the final boundary will be during interaction. Intelligent Scissors presents a different approach to the segmentation problem. Rather than optimizing a user-initial- ized approximate contour, we allow the user to interactively select a boundary from a collection of optimal solutions. Thus the user knows exactly what the resulting contour will be during interaction. Intelligent Scissors achieves this goal by interactively computing the optimal path from a user selected “seed” point to all other points in the image. As the cursor moves, the optimal path from the pointer position to the seed point is displayed, allowing the user to select an optimal contour segment which visually corresponds to a portion of the desired object boundary. 3. Toboggan-Based Intelligent Scissors Intelligent Scissors, as presented in [13], formulates the boundary detection problem as a weighted graph search where each pixel is a node and weighted edges are created between each pixel and its 8 neighbors. We continue to fol- low this by first partitioning the image into a collection of regions and then imposing a weighted planar graph onto the resulting region boundaries. This reduces the size of the graph which greatly speeds up the graph search and increases interactive responsiveness. 3.1. Tobogganing Tobogganing, introduced by Fairfield [6] and extended by Yao and Hung [19], oversegments an image into small regions by sliding in the derivative terrain. The basic idea is that given the gradient magnitude of an image, each pixel determines a slide direction by finding the pixel in a neigh- borhood with the lowest gradient magnitude. Obviously, several pixels will represent local minima in the gradient terrain (due to either image features or noise) in that they represent the minimum gradient magnitude within their own neighborhood. Pixels that “slide” to the same local mini- mum are grouped together, thus segmenting the image into a collection of small regions (Fig. 1). The regions produced by tobogganing are effectively identical to the catchment basins produced by applying the popular watershed algorithm to the gradient image[2,14,17]. However, tobogganing is much more computationally effi- cient than the watershed algorithm. Toboggan-Based Intelligent Scissors with a Four Parameter Edge Model Eric N. Mortensen William A. Barrett Brigham Young University

Toboggan-Based Intelligent Scissors with a Four Parameter ... · 3.1.1. Multi-Scale Gradient The gradient magnitude used for tobogganing is com-puted using multi-scale derivatives

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Toboggan-Based Intelligent Scissors with a Four Parameter ... · 3.1.1. Multi-Scale Gradient The gradient magnitude used for tobogganing is com-puted using multi-scale derivatives

AbstractIntelligent Scissors is an interactive image segmentation

tool that allows a user to select piece-wise globally optimalcontour segments that correspond to a desired object bound-ary. We present a new and faster method of computing theoptimal path by over-segmenting the image using toboggan-ing and then imposing a weighted planar graph on top of theresulting region boundaries. The resulting region-basedgraph is many times smaller than the pixel-based graphused previously, thus providing faster graph searches andimmediate user interaction. Further, the region-based graphprovides an efficient framework to compute a 4 parameteredge model, allowing subpixel localization as well as ameasure of edge blur.

1. IntroductionAll general purpose image segmentation techniques

require some amount of human guidance due to the largevariety of image sources, content and complexity. Conse-quently, a goal of any general image segmentation algorithmshould be to accurately define the desired object boundaryor region with minimal user input. A variety of segmenta-tion tools exist ranging from user intensive lassoing to semi-automatic initialization schemes such as magic wands andactive contour models. Unfortunately, lassoing or otherprimitive manual tracing tools are still widely used when anon-homogeneous image component must be extractedfrom a complex background. For this reason intelligent seg-mentation tools which exploit high level visual expertise butrequire minimal user interaction become appealing.

Recently, we presented a unique boundary based seg-mentation algorithm called Intelligent Scissors [12,13]which allow a human operator to interactively select an opti-mal boundary segment, called a “live-wire” [11,7], corre-sponding to a portion of the desired object edge. IntelligentScissors allow objects to be extracted quickly and accuratelyusing simple gesture motions with a mouse. When themouse position comes in proximity to an object edge, a live-wire boundary “snaps” to, and wraps around the object ofinterest.

This paper presents improvements to our IntelligentScissors tool based on an oversegmentation method knownas tobogganing that allows for faster optimal path computa-tion in the interactive live-wire environment. Further, thetoboggan information provides an efficient framework forcomputing a 4 parameter edge model which provides sub-pixel localization, blur, and foreground/background color.

2. Previous WorkAmong the boundary based segmentation strategies,

active contours or snakes have received considerable atten-tion over the last few years [1,3,8,9,18]. Active contours areinitialized with an approximate boundary and then itera-

tively minimize the contour’s energy functional to achievean optimal boundary. The functional combines externalforces such as gradient magnitude with internal forces likeboundary curvature in an attempt to yield a final smoothcontour that conforms to the desired object boundary. Sincesnakes are typically initialized with an approximate contour,the human operator is often not quite sure what the finalboundary will be until the active contour settles into a mini-mum. Some implementations allow the user to interactivelymodify the energy landscape and thus nudge a snake [3,8],but still the user does not typically know exactly what thefinal boundary will be during interaction.

Intelligent Scissors presents a different approach to thesegmentation problem. Rather than optimizing a user-initial-ized approximate contour, we allow the user to interactivelyselect a boundary from a collection of optimal solutions.Thus the user knows exactly what the resulting contour willbe during interaction. Intelligent Scissors achieves this goalby interactively computing the optimal path from a userselected “seed” point to all other points in the image. As thecursor moves, the optimal path from the pointer position tothe seed point is displayed, allowing the user to select anoptimal contour segment which visually corresponds to aportion of the desired object boundary.

3. Toboggan-Based Intelligent ScissorsIntelligent Scissors, as presented in [13], formulates the

boundary detection problem as a weighted graph searchwhere each pixel is a node and weighted edges are createdbetween each pixel and its 8 neighbors. We continue to fol-low this by first partitioning the image into a collection ofregions and then imposing a weighted planar graph onto theresulting region boundaries. This reduces the size of thegraph which greatly speeds up the graph search andincreases interactive responsiveness.

3.1. TobogganingTobogganing, introduced by Fairfield [6] and extended

by Yao and Hung [19], oversegments an image into smallregions by sliding in the derivative terrain. The basic idea isthat given the gradient magnitude of an image, each pixeldetermines a slide direction by finding the pixel in a neigh-borhood with the lowest gradient magnitude. Obviously,several pixels will represent local minima in the gradientterrain (due to either image features or noise) in that theyrepresent the minimum gradient magnitude within their ownneighborhood. Pixels that “slide” to the same local mini-mum are grouped together, thus segmenting the image into acollection of small regions (Fig. 1).

The regions produced by tobogganing are effectivelyidentical to the catchment basins produced by applying thepopular watershed algorithm to the gradient image[2,14,17].However, tobogganing is much more computationally effi-cient than the watershed algorithm.

Toboggan-Based Intelligent Scissors with a Four Parameter Edge Model

Eric N. Mortensen William A. BarrettBrigham Young University

Page 2: Toboggan-Based Intelligent Scissors with a Four Parameter ... · 3.1.1. Multi-Scale Gradient The gradient magnitude used for tobogganing is com-puted using multi-scale derivatives

3.1.1. Multi-Scale GradientThe gradient magnitude used for tobogganing is com-

puted using multi-scale derivatives of Gaussian kernels. If

(1)

is a two-dimensional normal distribution with a standarddeviation ofσ, the multi-scale gradient magnitude is givenby

(2)

where

(3)

is the squared gradient magnitude summed over each colorband (Ib) of the original imageI as computed by convolvingeachIb with a derivative of Gaussian kernel of scaleσ.

3.1.2. Sliding and GroupingGiven a gradient magnitude image, we next segment the

image into regions by sliding in the gradient terrain. Pixelsthat slide into the same local minimum are efficientlygrouped into regions by assigning them a unique label. Theimage is scanned in row major order. If a pixel is notlabelled, its four-connected neighborhood is checked todetermine which neighboring pixel has the smallest gradientmagnitude. The pixel then “slides” to the minimum gradientneighbor by setting a slide direction and moving to thatneighbor. The process is repeated until it slides into a pixelthat is already labelled or until it slides into a local mini-mum. If sliding reaches an unlabeled local minimum, thatminimum is assigned a unique label. Now that a region labelis known, unlabeled pixels encountered during sliding arelabelled. Thus, the tobogganing algorithm is as follows:

Algorithm 1: Toboggan Segmentation.

Input:G(p) {Gradient magnitude at pixel position vectorp.}

Data Structures:N( p) {4 connected neighborhood ofp.}

Output:T( p) {Toboggan direction vector atp.}L( p) {Region label atp (initialized to nil for allp).}

Algorithm:regions ←0; {Initialize # of regions.}

for each p do begin {Scan image in row major order.}q←p;repeat {Slide to labelled pixel or local minimum.}

min ←G(q); q´ ←q;for each r ∈N( q) do begin {Find lowest gradient neighbor.}

if G( r ) ≤min then beginmin ←G(r ); q´ ←r ;

endendT( q) ←q´ − q; q←q´; {Set slide direction and slide.}

until L( q) ≠nil or T( q)= 0

if L( q) =nil then begin {If local minimum is unlabeled,}L( q) ←regions; { assign a unique label.}regions ←regions+1;

end

r ←p;repeat {Repeat slide to label unlabeled pixels.}

L( r ) ←L( q); r ←r +T( r );until L( r ) ≠nil

end

Notice that, like [19], sliding continues as long as there is aneighbor with a gradient magnitude less than orequal tothat of the current pixel.

Note also that we use a 4-connected neighborhood asopposed to the 8-connected neighborhood of [6] and [19]. Ithas been our experience that using a 4-connected neighbor-hood, while producing more regions, isolates fine detail bet-ter than tobogganing with an 8-connected neighborhood.Further, 8-connected regions pose more topological prob-lems when mapping region boundaries to a planar graph.

3.2. Weighted GraphHaving partitioned the image into a collection of small

regions, we now convert the tobogganed regions into aweighted planar graph. The resulting graph has weightededges and is used to compute an optimal path correspondingto a lowest cumulative cost boundary segment in the image.

Figure 1: (a) Original image.(b) Expanded section of (a) showingtoboggan region boundaries, slide directions, and local minima. (c) Numer-ical illustration of (b) showing gradient magnitudes, region boundaries(thick lines), slide directions (arrow heads), and local minima (circled).Nodes (shaded circles) are created where 3 or 4 regions meet at a pixel cor-ner while region boundary segments between two nodes become edges. Theshaded pixels show an example gradient index vector (Section 3.2.2).

(a)

(b)

(c)

68 83 146 174 168 145 116 87 58 46 50 64 80 88 99 108

63 130 171 178 162 137 111 89 80 63 68 106 137 164 185 202

117 164 184 177 156 131 108 96 55 113 152 179 202 217 225 227

154 177 177 160 130 94 52 97 147 180 199 208 209 202 191 177

175 180 169 142 98 41 116 163 192 204 202 190 169 145 122 96

183 177 156 117 48 107 159 186 194 186 167 140 109 83 56 63

177 159 126 69 93 151 182 188 177 154 124 91 54 41 95 136

165 134 88 64 138 178 189 179 159 131 104 81 56 94 142 178

143 103 50 120 168 185 179 157 130 103 84 65 87 140 181 203

121 78 108 162 185 182 163 134 108 86 72 75 137 181 205 204

85 96 160 188 189 172 145 116 94 70 64 124 174 203 205 183

82 150 187 192 176 146 115 91 68 48 104 151 188 201 186 150

129 175 193 181 152 119 94 81 47 95 141 178 199 195 166 124

161 189 191 167 134 103 81 33 83 127 168 193 197 175 139 97

182 195 184 150 112 77 42 56 101 146 181 190 177 145 110 80

192 190 163 123 93 67 51 83 132 175 194 186 160 127 101 81

Nσ x y,( ) 1

2 2πσ------------------e

12--- x2 y2+

σ2----------------

=

G x y,( ) max Gσ x y,( )( )=

Gσ I b* x∂∂Nσ

b∑

2

I b* y∂∂Nσ

2

+=

Page 3: Toboggan-Based Intelligent Scissors with a Four Parameter ... · 3.1.1. Multi-Scale Gradient The gradient magnitude used for tobogganing is com-puted using multi-scale derivatives

3.2.1. Graph CreationSince tobogganing produces regions that partition the

image, there are no pixel-based boundaries between neigh-boring regions. Rather, two adjacent regions share a con-nected sequence of one or more “cracks” between two 4-connected pixels. As such, edges map to the boundary seg-ment between two neighboring regions and nodes are cre-ated where three or four regions meet at a pixel corner.

Since nodes occur only at pixel corners, every node isuniquely identified by the pixel whose upper-left corner isthe actual node position. Thus, nodes are specified with apixel position vector1, η, and edges are represented as anordered quadruple, (ηsrc, ηdst, ll, lr), indicating the sourceand destination nodes as well as the region labels on its leftand right side, respectively.

The graph is created by tracking the boundary of eachregion using an “over-the-shoulder” contour following algo-rithm. Given the definitions ofL(p) andN(p) in Algorithm 1and pixelsp andq such that and —i.e., neighboring pixelsp andq span the boundary betweenadjacent regions—then the crack betweenp andq is definedas the ordered pair (p, q) and

(4)

is the crack direction vector pointing clockwise relative top.Thus, if l = L(p), qd = q + dp,q andpd = p + dp,q then

(5)

is the next clockwise pixel crack on the boundary of regionlrelative to the crack (p, q).

Definition: B(l) is the orderedn-tuple, ((p1,q1), (p2,q2),…, (pn,qn)), of pixel cracks that represent, in clockwiseorder, the boundary of a 4-connected region with labellsuch that all of the following properties hold:

1. L(pi) = l for all 1≤ i ≤ n

2. L(qi) ≠ l for all 1≤ i ≤ n

3. (pi+ 1, qi+ 1) = next(pi, qi) for all 1≤ i < n

4. (p1, q1) = next(pn, qn)

5. L(qn) = L(q1) iff L(qi) = L(qj) for all 1≤ i, j ≤ n

Processing each region,l, we note that there is a node onthe boundary wheneverL(qi) ≠ L(qi+1), corresponding to thenode position

(6)

Further, ifL(qj) ≠ L(qj+1) for j > i such thatL(qk) = L(qi+1)for i < k ≤ j then there is an edge,e = (ηi, ηj, L(qj), l), definedbetween nodesηi andηj that separates regionsL(qj) and lwhere ecrack = ((pi+1,qi+1), (pi+2,qi+2), …, (pj,qj)) is theordered sequence of pixel cracks defining the edge.

1. We useη to represent a position vector corresponding to a node in order toavoid confusion with a regular position vector such asp or q.

Fig. 1(c) illustrates how the tobogganed regions form aplanar graph. Graph nodes are indicated with shaded circles,

, while edges, shown as thick lines, correspond to the por-tion of a region boundary connecting two nodes.

3.2.2. Edge WeightsSince region boundaries already localize object edges,

there is no need for the Laplacian zero-crossing cost used in[13]. Rather, edge costs are currently computed using onlythe gradient magnitude in a two step process. The first stepcreates a gradient index vector for each edge and the secondstep computes an edge’s gradient cost by remapping andsumming the index vector. The gradient index, given by

(7)

scales the gradient magnitude to integer values between 0and nG-1 (which is the domain of the remapping functionused in the second step).

Given an edgee such thatecrack = ((p1,q1), (p2,q2), …,(pn,qn)), the gradient index vector ofe, idxG,e = (idxG(r1),idxG(r2), …, idxG(rm)), is an orderedm-tuple of gradientindices wherem ≤ n and (r1, r2, …, rm) is the 8-connectedpixel sequence defined algorithmically as follows:

r prv ←(-1,-1); j ←1; {Init. previous pixel position & j.}for i = 1 to n do begin

if idx G( pi ) > idx G( qi ) then r tmp←pi ; {Set rtmp to crack pixel}else r tmp←qi ; { with largest gradient.}

if r tmp ≠ r prv then begin {If new pixel position, }r j ←r tmp; j ←j+1; r prv ←r tmp; { add it to path.}

endendm←j-1; {Set path length.}

Fig 1(c) highlights, in the upper-left, the gradient indexvector for an example edge. Notice that even though theedge is composed of 5 pixel cracks, its gradient index vectoris only 4 gradient values (since the maximum gradient posi-tions for two of the cracks are identical). Consequently, thegradient index vector for diagonal edges is typically shorterthan the crack count, thus providing a mechanism to scalethe edge cost based on estimated Euclidean length.

As mentioned, an edge’s final cost function is computedby remapping and summing its gradient index vector. Theremapping function is initially defined as

(8)

which is an inverse linear ramp ranging fromM down to 0whereM is the maximum cost per boundary unit.mapG isimplemented as a lookup table in order to adapt dynamicallyand thereby accommodate on-the-fly training (as describedin [13]).

The final edge cost function is given by

(9)

and is simply the summation of the edge’s remapped gradi-ent index vector.

q N p( )∈ L p( ) L q( )≠

dp q,0 1–

1 0p q–( )=

next p q,( )

qd q,( ) if L qd( ); = l

pd qd,( ) if L qd( ) l andL pd( )≠; = l

p pd,( ) otherwise;

=

ηi12--- pi qi dpi qi,

1

1+ + +

=

idxG nG 1–( ) Gmax G( )------------------- 1

2---+=

mapG i( ) 1 inG 1–---------------–

M12---+=

f e( ) mapg idxG r j( )( )j 1=

m

∑=

Page 4: Toboggan-Based Intelligent Scissors with a Four Parameter ... · 3.1.1. Multi-Scale Gradient The gradient magnitude used for tobogganing is com-puted using multi-scale derivatives

3.3. Optimal Graph SearchComputation of optimal paths corresponding to mini-

mum cost contour segments is accomplished using Dijk-stra’s [4] optimal graph search in much that same manner asin [13]. However, graph edges in [13] had unit length costs,thereby bounding the cost range on the “active” list andallowing for an efficient bin sort algorithm. Since graphedges in this paper can be several units long, the active listnow employs an efficient two-level bin sort algorithm toallow for a much wider cost range.

Given a user selected “seed” node,ηs, the optimal graphsearch algorithm is as follows:

Algorithm 2: Optimal Graph Search.

Input:ηs {Seed node.}

Data Structures:L {List of active nodes sorted by total cost (initially empty).}edge ( η) {Edge set containing edges emanating fromη.}done( η) {Boolean function indicating ifη has been expanded.}g( η) {Total cost function fromηs to η.}

Output:opt ( η) {Edge fromη indicating optimal path back toηs.}

Algorithm:g( ηs) ←0; L←ηs; {Initialize active list with zero cost seed node.}while L ≠ ∅ do begin {While still nodes to expand:}

η←min(L); {Remove minimum cost nodeη from active list.}done( η) ←TRUE; {Mark η as expanded (i.e., processed).}for each e ∈ edge ( η) do begin

ηn←edst ( η); {Get neighbor connected to edge.}if not done( ηn) then begin

g’ ←g( η)+f( e); {Compute total cost to neighbor.}if ηn ∈ L and g’ < g( ηn) then {Remove higher cost }

ηn←L; { neighbor from list.}if ηn ∉ L then begin {If neighbor not on list, }

g( ηn) ←g’; opt ( ηn) ←e; { assign total cost, set opt. edge}L←ηn; { and place on (or return to) }

end { active list.}end

endend

While the optimal graph search algorithm presented here issimilar to our previous work in [13], the reduced graph sizeallows this technique to compute optimal paths anywherefrom two to 10 or more times faster, depending on the aver-age size of the tobogganed regions, despite the fact that wenow use a more complex two-level bin sort.

3.4. Four Parameter Edge ModelOne advantage of using toboggan region boundaries as a

basis for the Intelligent Scissors graph search is the abilityfor subpixel localization of an object edge by applying anedge model to the region boundaries. As with [5], weassume that an edge is modeled as a Gaussian blurred stepedge. Ifα is the step amplitude andβ is the base (pedestaloffset), then the preferred edge model is given by

(10)

whereσ is the standard deviation of the Gaussian blur andx0 is the step edge location. Unlike [5], we model edges byextracting profile data for each edge crack and fitting thedata to a model using a modified 4 parameter Marquardt

minimization [15,16]. However, because of the complexityof the partials of Eq. (10), especially when embedded in asummed squared residuals function (i.e., aχ2 function), weapproximate Eq. (10) with a sigmoid—since its partials aremuch more tractable and it very closely approximates theerror function. Thus, the edge model we use is

(11)

wheres is the spread or blur (similar toσ in Eq. (10)).Note that Eq. (11) only models the transition between

two gray levels (or colors). As such, we would like to avoidincluding transition information from edges other than theone being modeled. Since tobogganing tends to slide awayfrom edges and stops sliding before climbing another edge,the slide information provides a reasonable mechanism forextracting transition data.

We extract the edge profile following the slide path fromboth sides of an edge crack and projecting the position andcolor data onto a domain and range vector respectively.Given an edge crack (p,q) we define a slide path forp as

(12)

wherep1 = p, pj+1 = pj + T(pj) for 1 ≤ j < n, pn is the localminima for the tobogganed region, andT(pj) is the tobogganslide direction defined in Algorithm 1. The slide path forq isdefined in like manner and the two slide paths are concate-nated into a profile sample vector

(13)

by reversingslide(p) and appendingslide(q).We define the domain projection vector,vx, with origin,

ox, as the normalized gradient direction vector originating atthe crack (p,q)—the normalized sum of the gradient direc-tion vectors atp andq. Each domain value,xi, is computedby projecting the corresponding relative sample vector,

, onto vx. Thus,xi = (si - ox) · vx. Figure 2 illustratesthe edge model computation for a sample edge crack.

For grayscale images, the obviousyi’s are simply thepixel gray-levels for each correspondingxi (see Fig. 2(b)).However, no such mapping is obvious for color images. Wethus define the range vector,vy = I (qm) - oy, whereI (qm) isthe image color vector at the pixel positionqm andoy = I (pn). Each range value,yi, is then computed in a simi-lar fashion as thexi’s. Specifically,yi = (I (si) - oy) · vy / ||vy||.

As mentioned, we fit the edge model given in Eq. (11) tothe profile data using a Marquardt minimization. Oneadvantage of the Marquardt method is that upon reaching anacceptable minimum, the curvature matrix can be recalcu-lated and used to estimate the covariance matrix of standarderrors in the fitted parameters. The standard errors can beused to evaluate the “reliability” of each parameter. Forexample, we useσ(x0)—the estimated standard deviation inthe fit of x0—to smooth the displayed object path, as notedbelow.

α2--- erf

x x0–

2σ--------------

1+ β+

α

1 ex0 x–( ) s⁄

+------------------------------- β+

slide p( ) p1 p2 … pn, , ,( )=

sample p q,( ) s1 s2 … sn m+, , ,( )=

pn … p2 p1 q1 q2 … qm, , , , , , ,( )=

si ox–

Page 5: Toboggan-Based Intelligent Scissors with a Four Parameter ... · 3.1.1. Multi-Scale Gradient The gradient magnitude used for tobogganing is com-puted using multi-scale derivatives

3.5. Live-Wire Boundary SelectionOnce the optimal path to every node is computed, the

live-wire allows interactive selection of the optimal pathcorresponding to a segment of the desired object boundary.As a pointing device moves, the cursor position is used toselect a node and display the optimal path from that nodeback to the seed node. The optimal path is displayed as apolyline fit to the subpixel midpoints of the path edges. Themidpoint for each edge crack is defined asox + x0vx whereox andvx are the domain origin and vector (as defined previ-ously) andx0 is the subpixel edge position given in Eq. (11).The displayed polyline is fit to the sequence of midpoints byincrementally determining the maximumk such that a linebetween midpointspi andpi+k is at mostc standard devia-tions from all intermediate midpoints. That is, having deter-mined the polyline fit up topi, the next line segment findsthe maximumk such that for all midpointspj, i < j < i+k, theline connectingpi andpi+k is at most a distance ofc⋅σ(x0,j)away from eachpj wherex0,j is the subpixel edge positionfor pj. The smoothing constant,c, can be interactivelyadjusted to allow a tighter or looser fit of the polyline.

Due to the underlying optimal nature of the displayedlive-wire path, as the cursor position moves away from theseed node in proximity to an object edge, the live-wire snapsto the object edge. When further movement of the cursorcauses the live-wire path to depart from the desired objectboundary, placement of a new seed node prior to the point ofdeparture reinitiates the optimal graph search. This allowsthe user to continue defining the object boundary, therebycreating a piece-wise optimal boundary.

Since it is impossible to exactly specify a node locatedon the interpixel grid using a pixel-based pointing device(and since it would be impractical even if it were possible),edge snapping is provided to select the edge that is “nearest”to the current pointer position [10,12,13]. The nearest edgeis determined by computing the weighted Euclidean dis-tance to each edge around the region containing the cursor.An edge’s weight is proportional to the average of theremapped gradient index vector. The edge “nearest” to thecursor is selected and used to select the nearest node.

Since there is only a single optimal path from any givennode back to a seed node, pixel-based Intelligent Scissorsrequires a minimum of two seed points to define a closedboundary. However, the region-based version has the capa-bility of selecting an edge and then displaying the path backto a seed node from both nodes connected by that edge. Ifthe two optimal paths from each node do not overlap, thenthe edge and the two optimal paths define a closed bound-ary. Consequently, in some cases a single seed node is allthat is needed to define the desired closed boundary. Forexample, Figure 3(a) shows the block from Fig. 1(a) and theresulting closed boundary defined with a single seed point.If an image is free of noise, then it is possible to have a sin-gle graph edge that completely encloses an object. In suchcases, the object boundary can be selected without any seednodes. This is demonstrated in Fig. 3(b) where all of theboundaries in this synthetic image are specified without anyseed points since each boundary is completely defined witha single graph edge. The edge that is “nearest” to the cursorposition is displayed even when there is no optimal pathinformation. Thus, any given boundary in Fig. 3(b) can bedefined by moving the cursor closer to it than any otherboundary and specifying that the boundary is complete.

vx

ox p1=p

p2

p3

p4 p5

Figure 2: (a) Expandedview of the upper-left quad-rant of Fig. 1(c) showingthe toboggan path on eachside of an edge crack (p, q).The pixel positions alongeach path project onto thedomain vectorvx, produc-ing the domain values, xi.The range values, yi, are(for this example) simplythe grayscale values ateach corresponding pathposition.(b) The resultingprofile data points and 4parameter fit of Eq. (12)with the parameters indi-cated.

x

y

β

α

x0

4s 4s

q1=q

q2

q3

q4q5q6

(a)

(b)

p5

p4p3

p2

p1

q1

q2

q3 q4 q5q6

α1-e(x -x)/s − β

0

Seed Node

Snapped Cursor Positions

(a)

(b)

Figure 3: (a) Live-wire boundary (in white) defined with only a singleseed point.(b) Boundaries defined without any seed points since eachboundary corresponds to a single graph edge.

Page 6: Toboggan-Based Intelligent Scissors with a Four Parameter ... · 3.1.1. Multi-Scale Gradient The gradient magnitude used for tobogganing is com-puted using multi-scale derivatives

4. Results and DiscussionWe have not yet performed any comprehensive quantita-

tive analysis comparing the accuracy, reproducibility, andboundary definition times between toboggan-based Intelli-gent Scissors and that in [13]. However, as the authors of[13], we have extensive experience and familiarity with bothtechniques and submit the following observations:

• The seed point boundary definition range (i.e., theamount of an object boundary defined with a singleseed point) appears to be nearly identical for both tech-niques. Hence, both methods typically require close tothe same number of seed points (though in some cases,this technique has the advantage of edge selection todefine a boundary with only a single seed point, or insome cases no seed point).

• In general, boundary definition times depend on thetime required to manually position seed points. Sincethe region-based graph search allows for faster optimalpath computation, this version offers better interactiveresponsiveness within the live-wire environment, thuspermitting quicker mouse movements and faster seedpoint positioning. Further, the improved efficiency ofthis technique permits other computations during inter-action, such as computing edge models and fitting mid-points with a polyline.

• Reproducibility seems to be at least as good for thistechnique since errors in reproducibility occur mostlyin the vicinity of seed points.

• We feel, due to the subpixel boundary positioning andbased on visual results, such as those shown here (i.e.,Figures 4, 5(b), and 6(b)), that this technique appears tobe more accurate than [13].

Figure 4 shows the estimated subpixel boundary loca-tions for the block of Fig. 1(a) and the “U” on top of theblock. Also shown are the transition cutoff on either side ofthe block boundary. The cutoff is set at 4s wheres is the

spread or blur parameter in Eq. (11). These boundaries aredrawn with a zero error tolerance, meaning that the smooth-ing factorc is set to zero and no smoothing occurs. Of noteis that the boundaries exhibit reasonable consistency eventhough the edge models are computed independently foreach boundary element. For example, the transition cutofflines indicate that the horizontal point spread of the imagingdevice is larger than the vertical point spread. This is in factthe case with the video camera used to acquire this image.Also note that there are a couple of spots, such as on the ser-ifs of the ‘U’ or near the top corner of the block, where, dueto the proximity of another edge, there was insufficient orunreliable data points for the parameter fit to reliably com-pute x0 and/ors. However, since these values are not reli-able, they will be smoothed out when drawn with a nonzeroerror tolerance (such asc = 1).

Figures 5 and 6 illustrate some simple object boundariesdefined within a couple of seconds2 and requiring only oneor two seed nodes while Fig. 7 shows a more complexboundary requiring several seed nodes. In general, theboundaries correspond well with the desired object edge.

Preprocessing requires approximately 10 seconds for a512x512 grayscale image on a 99 MHz HP 735 workstationand involves computing the image gradient using a multi-scale kernel, tobogganing in the gradient terrain to definethe regions, and transforming the region boundaries into aweighted graph. The edge model computation is performedduring live-wire interaction on an “as need” basis. Also,since we only store cost information for the edges of aregion based graph instead of every pixel, the memoryrequirements are smaller than that of [13].

Finally, the region-based graph provides a framework fora variety of future refinements that would be difficult toachieve with the pixel-based tool. Some of the improve-ments include incorporating reliable region information intothe cost function such as foreground/background color andmultiple path exclusion with contour untangling to facilitatedefinition of long, thin image features (such as hair, sticks,etc.) by allowing the live-wire to snap to the strong side ofsuch objects only once. We are in the process of addingthese refinements and believe they will improve the effec-tiveness of Intelligent Scissors even more.

5. ConclusionsCompared to the original Intelligent Scissors tool, tobog-

gan-based Intelligent Scissors reduces computationalrequirements during the critical interactive optimal bound-ary selection process. Further, the region-based graph pro-vides a framework to compute an edge model, allowing forsubpixel boundary localization and edge blur. In addition tothe improvements mentioned previously, other extensionscould include hierarchical graph construction with dynamicdetail adjustment for improved computational performanceand texture based cost functions.

2.Times stated are for the boundaries shown and are based on the best timeachieved by an experienced user measured from the time the first seed node is placedto completion of boundary definition.

Figure 4: Block in Fig. 1(a) pixel replicated by a factor of 8 to show thezero tolerance subpixel localization of the block and ‘U’ boundaries (black)as well as the transition cutoff (white) of the block boundary.

Page 7: Toboggan-Based Intelligent Scissors with a Four Parameter ... · 3.1.1. Multi-Scale Gradient The gradient magnitude used for tobogganing is com-puted using multi-scale derivatives

6. References[1] A. A. Amini, T. E. Weymouth, and R. C. Jain, “Using Dynamic Pro-

gramming for Solving Variational Problems in Vision,”IEEE PAMI,12(2): 855-866, Sept. 1990.

[2] S. Beucher and C. Lantuéjoul, “Use of Watersheds in Contour Detec-tion,” in Proc. Int. Workshop on Image Processing, Real-Time Edge andMotion Detection/Estimation, Sept. 1979.

[3] D. Daneels, et al., “Interactive Outlining: An Improved ApproachUsing Active Contours,” inSPIE Proc. Storage and Retrieval for Imageand Video Databases, 1908: 226-233, Feb. 1993.

[4] E. W. Dijkstra, “A Note on Two Problems in Connexion with Graphs,”Numerische Mathematik, 1: 269-270, 1959.

[5] J. H. Elder and S. W. Zucker, “Scale Space Localization, Blur, and Con-tour-Based Image Coding,” in CVPR, 27-34, June, 1996.

[6] J. Fairfield, “Toboggan Contrast Enhancement for Contrast Segmenta-tion,” in IEEE Proc. 10th Int. Conf. on Pattern Recog., 1: 712-716, 1990.

[7] A. X. Falcão, et al., “User-Steered Image Segmentation Paradigms:Live Wire and Live Lane,”GMIP, 60(4): 233-260, July 1998.

[8] M. Kass, A. Witkin, and D. Terzopoulos, “Snakes: Active ContourModels,” Int. Journal of Computer Vision, 1(4): 321-331, Jan. 1988.

[9] D. Geiger, A. Gupta, L. A. Costa, and J. Vlontzos, “Dynamic Program-ming for Detecting, Tracking, and Matching Deformable Contours,”IEEE PAMI, 17(3): 294-302, Mar. 1995 (Correction inPAMI, 18(5):575, May 1996)

[10] M. Gleicher, “Image Snapping,” inProc. ACM SIGGRAPH 95: Com-puter Graphics and Interactive Techniques, 183-190, Aug. 1995.

[11] E. N. Mortensen, et al., “Adaptive Boundary Detection Using'Live-Wire' Two-Dimensional Dynamic Programming,” inIEEE Proc.Computers in Cardiology, 635-638, Oct. 1992.

[12] E. N. Mortensen and W. A. Barrett, “Intelligent Scissors for ImageComposition,” inProc. of the ACM SIGGRAPH 95: Computer Graph-ics and Interactive Techniques, pp. 191-198, Aug. 1995.

[13] E. N. Mortensen and W. A. Barrett, “Interactive Segmentation withIntelligent Scissors,”GMIP, 60(5): 349-384, Sept. 1998.

[14] L. Najman and M. Schmitt, “Geodesic Saliency of Watershed Contoursand Hierarchical Segmentation,”IEEE PAMI, 18(12): 1163-1773, Dec.1996.

[15] J. C. Nash,Compact Numerical Methods for Computers, ch. 17: 207-217, Adam Hilger, 1990.

[16] W. H. Press, et al.,Numerical Recipes in C, ch. 15: 681-688, CambridgeUniversity Press, 2nd ed., 1992.

[17] L. Vincent and P. Soille, “Watersheds in Digital Spaces: An EfficientAlgorithm Based on Immersion Simulations,”IEEE PAMI, 13(6): 583-598, June 1991.

[18] D. J. Williams and M. Shah, “A Fast Algorithm for Active Contours andCurvature Estimation,”CVGIP: Image Understanding, 55(1): 14-26,Jan. 1992.

[19] X. Yao and Y. P. Hung, “Fast Image Segmentation by Sliding in theDerivative Terrain,” inSPIE Proc. Intelligent Robots and ComputerVision X: Algorithms and Techniques, 1607: 369-379, Nov. 1991.

Figure 5: Grayscale image of hat. Size: 256x256.(a) Boundary defini-tion: 1.4 seconds with 1 seed node. (b) Magnified section of hat showingzero tolerance (i.e., no smoothing) subpixel boundary localization.

(a)

(b)

(a)

(b) Figure 6: Full color image of a tulip. Size: 256x256.(a) Boundary defi-

nition: 1.6 seconds with 2 seed nodes. (b) Magnified section of tulip showingzero tolerance subpixel boundary localization.

Figure 7: Full color image of a family. Size: 340x560. Boundary defini-tion: 18.5 seconds with several seed nodes.