24
International Journal of Computer Vision 54(1/2/3), 159–182, 2003 c 2003 Kluwer Academic Publishers. Manufactured in The Netherlands. Euler Spiral for Shape Completion BENJAMIN B. KIMIA, ILANA FRANKEL AND ANA-MARIA POPESCU Division of Engineering, Brown University, Providence, R1 02912, USA Received May 25, 2001; Revised September 20, 2002; Accepted February 3, 2003 Abstract. In this paper we address the curve completion problem, e.g., the geometric continuation of boundaries of objects which are temporarily interrupted by occlusion. Also known as the gap completion or shape completion problem, this problem is a significant element of perceptual grouping of edge elements and has been approached by using cubic splines or biarcs which minimize total curvature squared (elastica), as motivated by a physical analogy. Our approach is motivated by railroad design methods of the early 1900’s which connect two rail segments by “transition curves”, and by the work of Knuth on mathematical typography. We propose that in using an energy minimizing solution completion curves should not penalize curvature as in elastica but curvature variation. The minimization of total curvature variation leads to an Euler Spiral solution, a curve whose curvature varies linearly with arclength. We reduce the construction of this curve from a pair of points and tangents at these points to solving a nonlinear system of equations involving Fresnel Integrals, whose solution relies on optimization from a suitable initial condition constrained to satisfy given boundary conditions. Since the choice of an appropriate initial curve is critical in this optimization, we analytically derive an optimal solution in the class of biarc curves, which is then used as the initial curve. The resulting interpolations yield intuitive interpolation across gaps and occlusions, and are extensible, in contrast to the scale-invariant version of elastica. In addition, Euler Spiral segments can be used in other applications of curve completions, e.g., modeling boundary segments between curvature extrema or modeling skeletal branch geometry. 1. Introduction The human visual system is constantly confronted with complex scenes where objects are partially occluded by others, Fig. 1. Yet, it can effortlessly identify fragments which belong together and construct a complete ob- ject representation from them. Similar phenomena have been observed in completing the trajectory of a moving object which is temporarily occluded. Gestalt psychol- ogists understood the significance of completing con- tours which are interrupted by occlusions and explored it, e.g., in the special case where the occluder blends with the background, thus generating illusory or sub- jective contours, Fig. 1. In computer vision, where re- sults from low-level edge operators need to be grouped into complete object boundaries, e.g., for recognition, a number of approaches have been developed that take advantage of the properties of the completion contour to disambiguate the optimal grouping (Parent and Zucker, 1989; Sha’ashua and Ullman, 1988). The process of completing contours beyond occlu- sions or across gaps, alternatively referred to as the curve completion, gap completion, or shape comple- tion problem, is under-constrained: in completing a missing contour, e.g., the kangaroo’s back across the occlusion in Fig. 1, there exist numerous curves that meet the “boundary conditions” of passing through specified endpoints and tangents. The selection of the optimal completion curve, therefore, has typically re- lied on assumptions regarding on what constitutes the most “likely” curve or the most “pleasing” or the “smoothest” curve (Nitzberg et al., 1993). The explicit recovery of a completion curve is use- ful in a variety of visual tasks, such as the task of disambiguating edge maps in perceptual group- ing, the partitioning of visual form for part-based

Euler Spiral for Shape Completion

  • Upload
    platlas

  • View
    247

  • Download
    1

Embed Size (px)

DESCRIPTION

In this paper we address the curve completion problem, e.g., the geometric continuation of boundaries of objects which are temporarily interrupted by occlusion. Also known as the gap completion or shape completion problem, this problem is a significant element of perceptual grouping of edge elements and has been approached by using cubic splines or biarcs which minimize total curvature squared (elastica), as motivated by a physical analogy. Our approach is motivated by railroad design methods of the early 1900’s which connect two rail segments by “transition curves”, and by the work of Knuth on mathematical typography. We propose that in using an energy minimizing solution completion curves should not penalize curvature as in elastica but curvature variation. The minimization of total curvature variation leads to an Euler Spiral solution, a curve whose curvature varies linearly with arclength. We reduce the construction of this curve from a pair of points and tangents at these points to solving a nonlinear system of equations involving Fresnel Integrals, whose solution relies on optimization from a suitable initial condition constrained to satisfy given boundary conditions. Since the choice of an appropriate initial curve is critical in this optimization, we analytically derive an optimal solution in the class of biarc curves, which is then used as the initial curve. The resulting interpolations yield intuitive interpolation across gaps and occlusions, and are extensible, in contrast to the scale-invariant version of elastica. In addition, Euler Spiral segments can be used in other applications of curve completions, e.g., modeling boundary segments between curvature extrema or modeling skeletal branch geometry.

Citation preview

  • International Journal of Computer Vision 54(1/2/3), 159182, 2003c 2003 Kluwer Academic Publishers. Manufactured in The Netherlands.

    Euler Spiral for Shape Completion

    BENJAMIN B. KIMIA, ILANA FRANKEL AND ANA-MARIA POPESCUDivision of Engineering, Brown University, Providence, R1 02912, USA

    Received May 25, 2001; Revised September 20, 2002; Accepted February 3, 2003

    Abstract. In this paper we address the curve completion problem, e.g., the geometric continuation of boundariesof objects which are temporarily interrupted by occlusion. Also known as the gap completion or shape completionproblem, this problem is a significant element of perceptual grouping of edge elements and has been approached byusing cubic splines or biarcs which minimize total curvature squared (elastica), as motivated by a physical analogy.Our approach is motivated by railroad design methods of the early 1900s which connect two rail segments bytransition curves, and by the work of Knuth on mathematical typography. We propose that in using an energyminimizing solution completion curves should not penalize curvature as in elastica but curvature variation. Theminimization of total curvature variation leads to an Euler Spiral solution, a curve whose curvature varies linearlywith arclength. We reduce the construction of this curve from a pair of points and tangents at these points to solvinga nonlinear system of equations involving Fresnel Integrals, whose solution relies on optimization from a suitableinitial condition constrained to satisfy given boundary conditions. Since the choice of an appropriate initial curveis critical in this optimization, we analytically derive an optimal solution in the class of biarc curves, which is thenused as the initial curve. The resulting interpolations yield intuitive interpolation across gaps and occlusions, andare extensible, in contrast to the scale-invariant version of elastica. In addition, Euler Spiral segments can be used inother applications of curve completions, e.g., modeling boundary segments between curvature extrema or modelingskeletal branch geometry.

    1. Introduction

    The human visual system is constantly confronted withcomplex scenes where objects are partially occluded byothers, Fig. 1. Yet, it can effortlessly identify fragmentswhich belong together and construct a complete ob-ject representation from them. Similar phenomena havebeen observed in completing the trajectory of a movingobject which is temporarily occluded. Gestalt psychol-ogists understood the significance of completing con-tours which are interrupted by occlusions and exploredit, e.g., in the special case where the occluder blendswith the background, thus generating illusory or sub-jective contours, Fig. 1. In computer vision, where re-sults from low-level edge operators need to be groupedinto complete object boundaries, e.g., for recognition,a number of approaches have been developed that takeadvantage of the properties of the completion contour to

    disambiguate the optimal grouping (Parent and Zucker,1989; Shaashua and Ullman, 1988).

    The process of completing contours beyond occlu-sions or across gaps, alternatively referred to as thecurve completion, gap completion, or shape comple-tion problem, is under-constrained: in completing amissing contour, e.g., the kangaroos back across theocclusion in Fig. 1, there exist numerous curves thatmeet the boundary conditions of passing throughspecified endpoints and tangents. The selection of theoptimal completion curve, therefore, has typically re-lied on assumptions regarding on what constitutes themost likely curve or the most pleasing or thesmoothest curve (Nitzberg et al., 1993).

    The explicit recovery of a completion curve is use-ful in a variety of visual tasks, such as the taskof disambiguating edge maps in perceptual group-ing, the partitioning of visual form for part-based

  • 160 Kimia, Frankel and Popescu

    Figure 1. (a) Branches of a tree occlude each other, but each branch maintains its identity across such occlusions. (b) The same idea isillustrated for an occluded kangaroo where the continuity between the two separated segments is maintained. In addition, note that in mentallyremoving a part, e.g., the front paw, we are able to continue the main body outline. (c) Illusory contours arise from an occluder that blends withthe background.

    object representation and recognition, and for filling-in tasks in the reconstruction of occluded areasin figure-ground segregation. First, Fig. 2(a) depicts aseries of edges which sample an object boundary, butwith missing gaps and embedded in a set of spuriousedges. In perceptual grouping tasks, spurious edgesmust be identified and removed, while gaps must befilled in. Williams and Thornber (1999) describe andcompare a class of such approaches where an affin-ity measure is first computed for each pair of edges todescribe the likelihood that they belong to the sameboundary. This is then followed by an optimizationover groupings of a larger set of edges, or curve hy-potheses, to determine the saliency of each edge el-ement. The properties of the completion curve, suchas total curvature, have been used as the affinity mea-sure, some of which require an explicit recovery of thecompletion curve. Second, the completion curve hasbeen used as the break curve in partitioning shapes,where the properties of the completion curve are usedto disambiguate conflicting part hypotheses, Fig. 2(b)(Dhandapani and Kimia, 2002; Siddiqi and Kimia,1995). Third, in visual tasks emulating the filling-in

    Figure 2. The Euler spiral completion curve is particularly useful in (a) disambiguating perceptual grouping of edge maps, (b) resolving conflictsamong break curves in partitioning tasks, and (c) in augmenting the current inpainting techniques to avoid diffusion across missing boundaries.

    phenomenon and in inpainting, the presence of recon-structed contours allows for proper filling-in of the in-ternal regions, thus avoiding diffusion in the missingcontour areas, Fig. 2(c).

    Curve Completion in Other Domains: The problem ofselecting an optimal visual interpolation across miss-ing boundaries is not unique to vision. In design,mechanical engineers have used French Curves,a template consisting of a large number of smoothcurves, to complete the partially specified surfaceof ships, aircraft fuselage, etc. (Farin, 1996), Fig. 3.Similarly, in computerized typography, where fontsneed to be specified in a formal scalable language,partially specified letters and symbols need to besmoothly interpolated (Knuth, 1979). In compress-ing shapes for example, retaining a sampling ofcurvature extrema with their tangent is an efficientrepresentation of the shape if appropriate contourcompletion algorithms are available. In civil engi-neering, this geometric interpolation problem arisesin highway turn-out design, railroad construction,e.g., between two specified tunnel entrances, and the

  • Euler Spiral for Shape Completion 161

    Figure 3. (a) The use of French Curves in the field of mechanicaldesign employs was common place for drawing smooth curves ofa range of curvatures (Weisstein, 1998). (b) We suggest here thatsegments of the Euler Spiral can serve this purpose well.

    resulting curve is known as a transition or ease-ment curve (Higgins, 1921; Kurtz, 1945; Talbot,1927). More modern applications include the designof roller-coasters and bike tracks, Fig. 4. Finally inour own quotidian lives, we confront various formsof this problem, e.g., in parking and other drivingscenarios.

    In this paper, we assume that a pair of point-tangent pairs are under consideration, e.g., a can-didate pair of T-junctions or curve endpoints. Theproperties of the optimal completion curve such assmoothness, length, etc. (Shaashua and Ullman,1988) as well as its spatial interaction with exist-ing curves and completion contours will be crucialin identifying the optimal grouping of point-tangentpairs. Thus, the problem we address can be formu-lated as:

    Problem Statement: Given a pair of points A0(x0, y0)and A2(x2, y2), with associated unit tangent vectors,T0(cos 0, sin 0) and T2(cos 2, sin 2), find the mostpleasing curve which passes through both pointsat their respective tangents.1

    Despite the appeal of our visual intuition for the ex-istence of a solution, this problem is under-specified

    Figure 4. (a) In this Vekoma roller coaster, Jokers Revenge, the train runs backward; amusement-seekers leave the station with no view ofwhere they are headed. In fact, they are about to loop a teardrop-shaped loop which is composed of a circular upper arc joined to lower EulerSpiral arcs (Baldwin, 1996). (b) The Velodrome at Stone Mountain Park, the Cycling Venue for the 1996 Olympic Games, is the first in a newgeneration of high-performance bike tracks these tracks are partially designed based on the Eulers spiral (http://www.kd3bj.ampr.org/track/).

    and has been the topic of numerous formalizations, es-pecially in the context of subjective contours (Kanizsa,1979). Ullman (1976) suggests that the interpolatedcurve C, which should depend only on the relative ge-ometry of the point-tangent pairs, must satisfy the fol-lowing axioms:

    1. C is invariant to rotations and translations (isotropy).2. C is at least differentiable once (smoothness).3. C minimizes total curvatureusing the thin beam

    analogy (minimum total curvature).4. C is extensible (originally referred to as locality); as

    defined below.

    Definition. An interpolation C between A0(x0, y0,0)2 and A2(x2, y2, 2) is extensible if for any A1(x1,y1, 1) on C the interpolation between A0 and A1 andthat between A1 and A2 both coincide with C.

    While Ullman hints at the doubly cantilever-ed beamand the related cubic spline approximation as the loci ofminimum curvature (Ahlberg et al., 1967; Sokolnikoff,1956), he proposes a completion curve consisting oftwo circular arcs, one tangent at one point edge and theother tangent to the other edge, and both tangent to eachother. Since there exist multiple biarc solutions, theminimum total curvature property is used to select theoptimal biarc. He then suggests a three-layer networkwith local connections to achieve this. As we shall see,the computation of a biarc solution is also integral tothe approach here, but one which minimizes curvaturedifference not total curvature.

    Rutkowski (1979) analyzes the minimum total cur-vature biarc construction of Ullman, describes a numer-ical method for computing it, and compares the results

  • 162 Kimia, Frankel and Popescu

    to cubic polynomial completions. He concludes that itappears that, in many cases, the cubic polynomial com-pletions have a more pleasing appearance than the twocircle completions. Brady and Grimson (1980) statethat Ullmans biarc completion curve is, in fact, notextensible. They instead follow Knuths approach (de-scribed below) of giving up on the extensibility axiomand support the use of cubic splines. Specifically, theypropose to search in the space of cubic polynomial forthe completion curve which minimizes a curve-relatedenergy.

    Consider the approach to the construction of a com-pletion curve in typography where the shape of symbolsis only partially specified by a collection of points, andneeds to be completed in the most pleasing manner(Knuth, 1979). The fundamental problem underlyingthe mathematically rigorous design of these shapesirrespective of style or sizecan be posed as: given asequence of points in the plane, what is the most pleas-ing curve that connects them? (Knuth, 1979). Thisproblem, therefore, is similar (and later shown to beequivalent) to our geometric interpolation in that it re-quires the selection of an optimal curve which adheresto our traditional sense of aesthetic, axiomatizes thebeauty of letters, and captures how pleasing the re-sulting interpolation is.3 In light of this, and to allowfor a certain degree of freedom in the interpolation,Knuth defines the most pleasing curve through a setof points z1, . . . , zn , as the closed curve C which sat-isfies a set of axioms, somewhat similar to Ullmansaxioms. Specifically, they require

    1. C is invariant to translation, rotation, and scaling;2. C is invariant to cyclic permutation or reversal of

    order of traversal (symmetry);3. Adding a new point already on C to the list does not

    change this solution (extensibility);4. C is locally constructed; i.e., each segment of the

    most pleasing curve between zk and zk+1 dependsonly on (zk1, zk, zk+1, and zk+2) (locality);

    5. C has no sharp corners (smoothness); and,6. If C interpolates four consecutive points lying on a

    circle, then C is a circle (roundedness).

    Knuth then shows that these axioms in conjunction im-ply that: (i) the direction of the tangent to the mostpleasing curve at zk depends only on (zk1, zk, zk+1);(ii) this tangent must be tangent to the circle passingthrough (zk1, zk, zk+1); and, (iii) this tangent dependsonly on zk+1, zk , and the tangent at zk1. However,the latter implication violates the previous ones. Thus,

    Knuth concludes that axioms 3, 4, 5, and 6 cannot be si-multaneously satisfied, and remarks that although thelocality property is the most suspicious one, he doesnot want to give it up; hence he concludes that theextensibility property has to go. The remaining ax-ioms suggest a cubic spline interpolation for any in-terval (zk, zk+1) with known tangent-directions (com-puted from a local neighborhood based on the aboveconclusions) at these pointswhich is precisely thecurve completion problem. Note, however, that the cu-bic spline interpolation does not satisfy axiom 6 sincesuch an interpolation can only approximate a circle.Observe that due to the invariance axiom 1, we cangenerally state the final interpolation between any twopoint-tangent pairs as the cubic spline interpolationbetween (0, 0, 0) and (1, 0, 2) which is, in complexnumber notation:

    z(s) = 3s2 2s3 + r0ei0 s(1 s)2 r2ei2 s2(1 s), (1)

    where

    r0 = max(

    12,

    4 sin 2(1 + cos ( 0+22 ) sin ( 0+22 )))

    ,

    r2 = max(

    12,

    4 sin 0(1 + cos ( 0+22 ) sin ( 0+22 )))

    .

    The results of this interpolation, with and withoutthe maximum operation specifying r0 and r2, areshown in Fig. 5. The application of this to type designgave rise to Knuths METAFONT system whichhas been largely successful in the modern LaTeXcomputerized typesetting.4

    Elastica: Horn argues that since the total energy storedin a thin beam (Horn, 1983) is proportional to the inte-gral of the square of curvature, the curve which mini-mizes

    2d S where is curvature and ds is arc-length,

    and which satisfies the given point-tangent bound-ary condition, represents the smoothest completion

    Figure 5. (a) The result of the interpolation without the maximumoperation specifying r0 and r2 for a range of tangents. (b) The resultof the interpolation with the maximum operation specifying r0 andr2, taken from Knuth (1979).

  • Euler Spiral for Shape Completion 163

    shape. He derives differential equations for this curveboth in terms of elliptic integrals and Cartesian coordi-nates. It is then shown that this completion curve is ex-tensible. In relation to minimum total curvature biarcsof Ullman (1976), he also examines the optimal multi-arc approximations, and observes that in this multi-arcsolution arcs tend to be of equal length while curvatureincreases more or less linearly along the curve. Interest-ingly, this property implicitly points to the Euler Spiralpresented here; however, he finds that the latter curvehas higher total squared curvature than the multi-arc so-lution with a sufficient number of segments. Thus, theEuler Spiral is not seen to be an appropriate candidatefor shape completion.5

    More recently, Mumford (1994) notes the historicalrole of elastica in obtaining the optimal curve throughtwo specified points with specified orientations (Euler,1744; Love, 1927; Bryant and Griffiths, 1986), i.e., thecurve which minimizes

    (2 + ) ds, (2)

    where , are constants. Mumford interprets theseelastica from the Bayesian view as the mode of theprobability distribution underlying a certain stochas-tic process restricted to curves with prescribed bound-ary behavior (Mumford, 1994), Fig. 6. Similarly,Williams and Jacobs (1995, 1997) model the comple-tion shapes as the most likely one in a family of curves,and like Mumford, model this by a random walk inthe space of positions and orientations, leading to astochastic completion field. An extensive model hasbeen developed on this idea for disambiguation of edgemaps and perceptual grouping (Williams and Jacobs,1995, 1997; Williams and Thornber, 1998).

    The major shortcomings of the elastica are that (i)they are not scale-invariant, (ii) they are computation-ally expensive to derive, and (iii) they do not lead to cir-cular completion curves when the point-tangent pairsare, in fact, co-circular (i.e., both lie on the same cir-cle). Scale-invariance is necessary since these curvesare used to model completion say gap completion, ina world where the distance from the observer to theimaged object varies constantly, yet the gaps must be

    Figure 6. Examples of elastica from Mumford (1994).

    completed consistently. Even when = 0, the en-ergy of the curve, and thus its salience, varies withscale (distance between points) relative to competinghypotheses. This has prompted an approach whereinthe elastica energy is scaled by total length (Sharonet al., 2000; Weiss, 1988; Onn and Bruckstein, 1990).But this implies that the computation of the completioncurve becomes global, and thus is not extensible: givenany point on a completion curve C, the two comple-tion sub-problems do not necessarily coincide with thesame C.

    Sharon et al. (2000) address the computational as-pects of finding the optimal completion curve and pro-pose analytic expressions for approximating it. Basedon the assumption that the deviation angle of the tan-gents from the line connecting the endpoints is small,they derive cubic Hermite spline approximations. Asecond expression in terms of these deviation anglesis then shown to be accurate even when the above as-sumption is not valid. The result is a numerical methodwhich is accurate and relatively fast.

    We now motivate a new approach by first consid-ering the third difficulty, namely, that elastica, leastenergy curves minimizing

    2, do not lead to circular

    interpolations (Sharon et al., 2000). The intuition thattwo (co-circular (Parent and Zucker, 1989)) edge ele-ments with equal angles to the line connecting themshould be completed via a circular arc regardless ofcurvature thus argues for minimizing not total curva-ture but total change in curvature. We propose that theenergy functional which properly captures the elusivenature of the most pleasing curve penalizes change incurvature, but not necessarily curvature proper. Thus,we seek the curve specified with the curvature function(s), s [0, L] and with arc-length L which minimizes

    E[] = L

    02s ds, (3)

    subject to the boundary conditions (x0, y0, 0),(x2, y2, 2). Using calculus of variation the correspond-ing Euler-Lagrange equation is ss = 0, for which thegeneral solution is the linear curvature curve (s) = s +0, with two arbitrary parameters 0 and . How-ever, we have yet to satisfy the boundary constraints inthis optimization. Observe that in the case of elasticathe unconstrained Euler-Lagrange equation for

    2 ds

    leads to = 0, which generally cannot satisfy endpointconstraints.6 In our case, these endpoint constraints canbe satisfied for the general class of curves described by

  • 164 Kimia, Frankel and Popescu

    ss = 0that is, the class of curves described by linearcurvature profiles, otherwise known, in the mathemat-ical literature, as the Euler Spiral, the Cornu Spiral orthe clothoids, and, in civil engineering, as the RailroadSpiral or the Transition Curve.

    The paper is organized as follows. In Section 2 wewill examine equations for the construction of the Eulerspiral and identify parameters needed to specify it in aform that is suitable for this problem. In Section 3, wewill address the question of finding parameters suchthat the Euler Spiral segment meets the end-points withspecified tangents, thus solving the curve completionproblem. We reduce this to solving a system of non-linear equations in two unknowns which we then solveby numerical optimization from a closeby initial curveestimate. We rely on a biarc initial estimate whichminimizes total squared curvature change, as opposedto Ullmans biarc which minimizes total curvaturesquared. Towards this end, Section 4 examines thespace of biarcs which meet the end-points at specifiedtangents and analytically derives the optimal biarcin the sense of the minimal curvature change. Thisbiarc, with a piecewise constant curvature profile, isin fact geometrically close to the Euler spiral whichhas a linear curvature profile and is used as the initialestimate to derive the optimization. Section 5 presentsexamples of the Euler spiral interpolation for syn-thetic and realistic solutions, which are intuitive andextensible.

    2. Eulers Spiral

    The Euler Spiral was considered by Euler in connec-tion to his investigation of a freely coiled up elasticspring held taut horizontally by a weight at its ex-tremity (Euler, 1744). In its natural, relaxed position,the spring satisfies = 1

    a2s, where a is a constant,

    s is arc-length, and is curvature. By a simple inte-gration of curvature and then the tangent angle (s)we obtain the equations for the curve C(s) = (x(s),y(s)),

    (s) = s2

    2a2, C(s) =

    s0

    ei2

    2a2 d. (4)

    This set of integrals came to be known as the Fresnels(17881827) integrals in connection with his model of

    the intensity of the illumination of a diffraction patternas the sum of squares of each such integral (Eulers,1918), C2(s) + S2(s), where C and S are the FresnelIntegral,

    (C(s), S(s))

    :=( s

    0cos

    (

    2 2

    )d,

    s0

    sin(

    2 2

    )d

    ),

    F(s) = C(s) + i S(s), (5)

    which are typically either calculated and readily avail-able from tables originally created by Fresnel, ex-panded in terms of the spherical Bessel Functions(Abramowitz and Stegun, 1972; Leonard, 1988; Presset al., 1993; Spanier and Oldham, 1987), or com-puted by integrating the Taylor expansion term byterm (Abramowitz and Stegun, 1972; Press et al.,1993):

    C(s) =

    n=0

    (1)n(2 )2n(2n)!(4n + 1) s

    4n+1,

    S(s) =

    n=0

    (1)n(2 )2n+1(2n + 1)!(4n + 3) s

    4n+3.

    Then, in 1874, Cornu plotted the Eulers Spiralaccurately (Cornu, 1874); the curve thus acquiredanother name: Cornus Spiral. And Cesaro, upon study-ing the curve and establishing a number of its prop-erties, dubbed it the clothoid from the Greek wordmeaning to twist by spinning (Cesaro, 1886). Notethat we henceforth refer to this curve as the EulersSpiral in connection with Eulers investigations ofit.

    It is immediately apparent that the computation andvisualization of the Euler Spiral relies on the Fres-nel integrals. The following proposition states the gen-eral form of the Euler spiral with a specified boundarycondition.

    Proposition 1. The general form of the Euler SpiralC(s), which passes through C0(x0, y0) at tangent angle0, with curvature 0, and a rate of change of curvature

  • Euler Spiral for Shape Completion 165

    , can be written as

    C0 + ei0 s = 0, 0 = 0C0 + e

    i0

    0(sin(0s) + i(1 cos(0s)) = 0, 0 = 0

    C0 +

    | | ei(

    0202

    )

    [sign( )

    (C

    (0 + s

    | |

    ) C

    (0 | |

    ))+ i

    (S(

    0 + s | |

    ) S

    (0 | |

    ))], = 0

    (6)and (s) = 12 s2 + 0s + 0 in all cases.

    Proof: The Euler spiral C(s) is obtained by integrat-ing (s) = s + 0 using Eq. (4), giving

    (s) = 12 s2 + 0s + 0,

    C(s) = C0 + s

    0e

    i(

    12

    2+0+0)

    d.(7)

    First, if = 0 and 0 = 0, it is straightforward toderive the first expression in Eq. (6), which gives astraight line. Second, if = 0 and 0 = 0, then

    C(s) = C0 + ei0 s

    0ei0 d

    = C0 + i ei0

    0(1 ei0s), (8)

    leading to the second expression in Eq. (6), which givesa circle. Finally, when = 0, consider first > 0. Wecomplete the square term in the exponent in Eq. (7) andusing the substitution

    2 +

    2

    02 =

    2 , obtain

    C(s) = C0 + s

    0e

    i((

    2 +

    2

    02

    )2+0

    20

    2

    )d, (9)

    = C0 + ei(0

    20

    2

    )

    2

    (0+ s)

    0

    ei2

    2 d. (10)

    which gives,

    C(s) = C0 +

    e

    i(0

    20

    2

    )[(C

    (0 + s

    )

    C(

    0

    ))+ i

    (S(

    0 + s

    )

    S(

    0

    ))]. (11)

    For < 0, the computations are similar, exceptthat

    is used instead, leading to the term inEq. (6).

    Thus, given (x0, y0, 0), two free parameters 0 and must be obtained in order to define the spiral. An ad-ditional parameter L is needed to delineate a segmentof the spiral by its total length; so six parameters intotal, (x0, y0, 0) and (0, , L), are required in orderto define an Euler Spiral segment, the canonical geo-metrical element which we later use to solve the curvecompletion problem. The spirals in Fig. 7 illustrate theeffect of varying 0 and for fixed L .

    3. Eulers Spiral for Curve Completion

    We now examine how the Euler Spiral segmentcan be used for the geometric interpolation of twopoint-tangent pairs for curve completion.

    Proposition 2. Consider the Euler Spiral C(s)satisfying end-point conditions C0(x0, y0) with

    Figure 7. An Euler spiral segment starting at the origin and tangentto the x-axis of a given length is shown by varying initial curvature0 and rate of change of curvature of the Euler Spiral.

  • 166 Kimia, Frankel and Popescu

    tangent T 0(cos 0, sin 0), and C2(x2, y2) with tangentT 2(cos 2, sin 2), which is identified by six parameters(x0, y0, 0, 0, , L). Let C2 C0 = L0ei . Then,if the point-tangent pairs are cocircular, i.e., if = 2+02 , then = 0, 0 = 2 = 2L0 sin(

    022 ) and

    L = L0(0+2)4 sin( 0+22 )

    . Otherwise, if = 2+02 , then

    = 22 20

    2(2 0) ,

    L = 2(2 0)2 + 0 ,

    (12)

    where 0 and 2 satisfy

    C2 C0

    =

    2

    2 022 20ei

    (022 220

    22 20

    )

    [

    sign(

    22 202 0

    )[C

    (2

    2 022 202

    )

    C(

    2

    2 022 200

    )]

    + i[

    S(

    2

    2 022 202

    )

    S(

    2

    2 022 200

    )]]

    Proof: Observe that the input is specified throughsix known variables (x0, y0, 0; x2, y2, 2). The descrip-tion of the Euler Spiral also requires six parameters,(x0, y0, 0; 0, , L), which explicitly include parame-ters defining C0 and T 0, namely, (x0, y0, 0). Thus, weneed to compute (0, , L) such that the spiral segmentends at C2 with tangent T 2. This gives two constraints,

    { C(L) = C2, (L) = 2,

    (13)

    where C and are specified in Proposition 1. This givesthree equations for the three unknowns (0, , L), interms of the known parameters (x0, y0, 0; x2, y2, 2).Note that the equation for 2 can be used effectively toreduce the parameter search by one.7 Consider 0 and2, the curvatures at C0 and C2, respectively, as a setof free parameter, i.e., 2 rewrite , L in terms of 0

    and 2.

    2 = L + 0,2 = 12 L

    2 + 0L + 0,(14)

    and simplifying 2 = 12 (2 0)L + 0L + 0 =2+0

    2 L + 0, results in Eq. (12) for L . In other words,the length of a spiral segment is the change in ori-entation (2 0) divided by its average curvature( 2+02 ). In addition, note that if 0 = 2 we deriveexpressions

    | | =

    2

    2 022 20,

    0 20

    2= 0 20

    (2 022 20

    )

    = 022 220

    22 20,

    0 + L | | = 2

    2

    2 022 20, (15)

    which are needed to simplify Eq. (13) in terms of twounknowns (0, 2). If = 0+22 , the two point-tangentpairs are cocircular. with 0 = 2 = 2L0 sin

    0+22 , L =L0(0+2

    4 sin( 0+22 ). Obviously, a circular arc is an Euler Spiral

    segment with = 0, so that it solves the geometricinterpolation problem. On the other hand, if = 0+22 ,then 0 = 2, = 0, and we have

    C2 = C0 +

    | |ei(0

    20

    2

    )[sign( )

    [C

    (0 + L

    | |)

    C(

    0 | |

    )]+ i

    [S(

    0 + L | |

    )

    S(

    0 | |

    )]]

    = C0 +

    2

    2 022 20ei

    (022 220

    22 20

    )

    [

    sign(

    22 202 0

    )[C

    (2

    2 022 202

    )

    C(

    2

    2 022 200

    )]

  • Euler Spiral for Shape Completion 167

    Figure 8. Given a pair of points-tangent pairs specified by, (x0, y0, 0; x2, y2, 2), multiple solutions can be obtained as the Euler Spiral canreach the same angle infinitely many times due to its winding nature, as illustrated above. We seek the shortest solution which do not wind morethan 2 .

    + i[

    S(

    2

    2 022 202

    )

    S(

    2

    2 022 200

    )]], (16)

    a system of two equations in two unknowns (0, 2).

    Since there is no known direct analytic solution forthis nonlinear set of equations, we employ numericaloptimization, i.e., a gradient descent approach, start-ing from a suitable initial estimate, such that the ini-tial estimate is evolved until the final Euler spiral so-lution is reached. Due to its spiral nature, the EulerSpiral reaches the same angle infinitely many times,Fig. 8. We are, however, only interested in the shortestsolutionthus the overall range of (s) is restrictedto 2 . In consideration of this constraint, the selectionof an appropriate initial estimate (the biarc approxi-mation) and the use of explicit constraints in the nu-merical optimization become critical, as discussed inSection 4. We first show that the Euler spiral has therequired properties of visual interpolation for shapecompletion.

    Proposition 3. The Euler Spiral ES passing through(x0, y0, 0) and (x2, y2, 2) satisfies the visual interpo-lations required property of invariance to translation,rotation and scaling. That is, the ES interpolations oftranslated, rotated, scaled boundary conditions datais the translation, rotation, or scaling of the ES inter-polation of the initial boundary conditions.

    Proof: The proof for translation and rotation is triv-ial since Eq. (13) contains relative terms C2 C0 and

    2 0. To show scale invariance, we have to show thatparameters pertaining to a scaled Euler Spiral satisfyEq. (13) for scaled parameters. A scaling by a factorof scales C2 C0 by this factor, but does not affect2 0. A scaling of the Euler Spiral, on the other hand,scales its curvature by 1

    and its rate of change of cur-

    vature by 12

    . Thus, it must be shown that 0 = 0 ,2 = 2 , and = 12 satisfy Eq. (13) for (C2 C0),i.e., that the right hand side is scaled by , which isevident by a term by term examination.

    Proposition 4. The Euler Spiral interpolation be-tween C0(x0, y0, 0) and C(x2, y2, 2) is extensible.

    Proof: The proof is rather straightforward. LetC1(x1, y1, 1) be an arbitrary point on the Eu-ler Spiral interpolation between C0(x0, y0, 0) andC2(x2, y2, 2), specified by (x0, y0, 0, 0, 2, ) as de-fined in Proposition 3, where i is the tangent of theEuler spiral at (xi , yi ). Let L1 and 1 be the length pa-rameter and curvature of the Euler Spiral at C1, respec-tively. SinceC1(x1, y1, 1) is a point of the interpolation,we have

    C1 = C0 +

    | |ei(0

    20

    2

    )[sign( )

    (C(

    0 + L1 | |

    )

    C(

    0 | |

    ))+ i

    (S(

    0 + L1 | |

    )(17)

    S(

    0 | |

    ))]

    1 = 12 L21 + 0L1 + 0,

  • 168 Kimia, Frankel and Popescu

    where 1 = 0 + L1. We now seek the interpolationbetween C1 and C2 as the solution (0, , L) of

    C2 = C1 +

    | |ei(

    0 20

    2

    ) [sign( )

    (C(

    0 + L | |

    )

    C(

    0 | |

    ))+ i

    (S(

    0 + L | |

    )(18)

    S(

    0 | |

    ))]

    2 = 12 L2 + 0 L + 1.

    We need to show that the previous Euler spiral is thesolution here, i.e., the Euler spiral with = , 0 =1 = 0 + L1 and L = L L1 solves the aboveequations. In this case, the right hand side of the secondequation in (18) is

    12 L2 + 0 L + 1

    = 12 (L L1)2 + 1(L L1) + 1, (19)

    which after expanding the first two terms and simpli-fying the resulting expression, yields 2. Similarly, weshow the correctness of the first equation in (18) bysimplifying the right hand side

    RHS = C1 +

    | |ei(

    12 L

    21+0 L1+0 (0+ L1)

    22

    )

    [

    sign( )(

    C(

    0 + L1 + (L L1) | |

    )

    C(

    0 + L1 | |

    ))

    + i(

    S(

    0 + L1 + (L L1) | |

    )

    S(

    0 + L1 | |

    ))]

    = C1 +

    | |ei(0

    20

    2

    )[sign( )

    (C

    (0 + L

    | |)

    C(

    0 + L1 | |

    ))+ i

    (S(

    0 + L | |

    )

    S(

    0 + L1 | |

    ))]

    = C0 +

    | |ei(0

    20

    2

    )[sign( )

    (C

    (0 + L

    | |)

    C(

    0 | |

    ))+ i

    (S(

    0 + L | |

    )

    S(

    0 | |

    ))]= C2 = LHS. (20)

    This implies that the Euler spiral interpolation betweenC1 and C2 coincides with that between C0 and C2. Asimilar result holds for the interpolation between C0and C1.

    Consider now Euler Spirals Cn(s), where n is theiteration number and where each spiral is describedby its initial point-tangent pair (x0, y0, 0) and, its twofree parameters (n0 , n2 ) as described in Proposition 2.Note thatCn(L) does not necessarily meetC2, but its endtangent n(L) = 2 is correct by construction. Now, weseek a sequence {(00 , 02 ), (10 , 12 ), . . . , (n0 , n2 ), . . .}where the distance between the second point C2 and theend point of the spiral Cn(L) is decreasing, i.e., wherethe sequence C2 Cn(L)2 converges to zero. Notethat E = 0 if and only if the interpolating Euler Spiralis obtained. In Section 4, we analytically obtain a biarcinterpolant which gives the initial conditions (00 , 02 ).Since the biarc is a close approximation of the EulerSpiral, in practice only a few iterations are necessaryfor convergence.

    4. Biarc Construction and Interpolation

    We now examine a solution of the geometric interpola-tion between two point-tangent pairs in terms of biarcs.The curvature of a biarc is piecewise constant and assuch it is an approximation to the linear curvature vari-ations of the Euler Spiral. In fact we shall see that thebiarc which minimizes curvature variation, i.e., cur-vature difference between its arcs while satisfying theboundary conditions is a rather close approximationof the Euler Spiral. The analytic formulas we derivehere enable it to be used as an initial condition for thederivation of the Euler Spiral in a numerical scheme.

    Specifically, consider that the construction of a biarcrequires seven parameters: an initial point-tangent pairas well as the curvature and lengths of each arc con-strains the parameters of the biarc so that it passesthrough two points with prescribed tangents, consumessix degrees of freedom, giving rise to a one parameterfamily of biarcs which interpolate two point-tangentpairs. We will then analytically derive the biarc with

  • Euler Spiral for Shape Completion 169

    Figure 9. This figure illustrates the biarc interpolation between thepoint-tangent pair (C0(x0, y0), 0) and (C2(x2, y2), 2). The pointwhere the two arcs come together is not specified appriori.

    minimum total curvature variation and use it as the ini-tial estimate for the Euler spiral.

    4.1. Biarc Construction

    Consider the construction of a biarc given an initialpoint and orientation (x0, y0, 0) and the curvatures andlengths corresponding to the two circular arcs fromwhich a biarc is composed (1, L1, 2, L2), Fig. 9. Lets denote arclength. Assuming 1 = 0, the first arc isconstructed by means of:

    x(s) = x0 + 11

    (sin(1s + 0) sin 0)

    y(s) = y0 11

    (cos(1s + 0) cos 0)for 0 s L1,

    (21)

    and similarly assuming that 2 = 0, the second arcusing the end point of the first arc,

    x(s) =(

    x0 + 11

    (sin(1L1 + 0) sin 0))

    + 12

    (sin(2(s L1) + 1) sin 1)

    for L1 s L1 + L2,

    y(s) =(

    y0 11

    (cos(1L1 + 0) cos 0))

    12

    (cos(2(s L1) + 1) cos 1)(22)

    where 1 is the tangent angle at the join between thebiarcs constituent circular arcs. This angle can be de-

    rived using the formula for the tangent angle at an ar-bitrary point on the biarc:

    { (s) = 1s + 0, for 0 s L1, (s) = 2(s L1) + 1, for L1 s L1 + L2.

    (23)

    Thus, 1 =2 1L1 + 0, where =2 denotes equalitymodulo 2 . Note that as 1 approaches 0, Eq. (21) inthe limit is simplified as

    {x(s) = x0 + s cos 0y(s) = y0 + s sin 0,

    i.e., the equation for a line. Similarly, as 2 approaches0, Eq. (22) is rewritten as

    x(s) =(

    x0 + 11 (sin(1L1 + 0) sin 0))

    + (s L1) cos 1

    y(s) =(

    y0 11 (cos(1L1 + 0) cos 0))

    + (s L1) sin 1

    for L1 s L1 + L2.

    This is the complete specification of a biarc using sevenparameters (x0, y0, 0, 1, L1, 2, L2). Note that L1 >0 and L2 > 0 while curvatures 1 and 2 can take anyfinite value.

    4.2. A Family of Biarc Interpolants

    We now identify the biarcs which satisfy the boundaryconditions, i.e., pass through a pair of points withspecified tangents. Since there are six constraints andseven variables, multiple biarcs can possibly satisfythese conditions. Thus, we characterize the set ofsolutions as a (one-parameter) family and then usethe minimum curvature variation criterion to find theoptimal biarc interpolation.

    Problem Statement: Given two point-tangent pairs,C0(x0, y0, 0) and C2(x2, y2, 2),8 find the smoothestbiarc (x0, y0, 0, 1, L1, 2, L2) which passes throughsaid points at their respective tangents.

    Proposition 5. Consider two endpoints with associ-ated tangents C0(x0, y0, 0) and C2(x2, y2, 2), and de-note C2 C0 = L0ei as before. Then, the set of biarcs

  • 170 Kimia, Frankel and Popescu

    which satisfy these boundary conditions can be param-eterized by the curvature of the first arc, 1, where theremaining parameters (2, L1, L2) are analytically de-rived separately for four conditions:

    (i) 1 = 2 = 0; this happens only if 0 = 2 = and L = L1 + L2 = L0;

    (ii) 1 = 0, 2 = 0. In this case, 0 = 2, 0 = , and

    2 = 2L0sin2

    (20

    2)

    sin(0 ) ,

    L1 = L0sin

    (2+0

    2 )

    sin(

    022

    ) (24)L2 = 2 0

    2+ 2n,

    where n is chosen to give the smallest positive L2;(iii) 1 = 0, 2 = 0; we have 0 = 2, 2 = and

    1 =2 sin2

    (20

    2)

    sin(2 )L1 = 2 0

    1+ 2n, (25)

    L2 = L0sin

    (2+0

    2 )

    sin(

    022

    ) ,where n is chosen to give the smallest positive L1.

    (iv) 1 = 0 and 2 = 0; In this case, if 1 = 2, thennot all 0, 2, are equal and

    2 = 2L02 sin2 ( 202 ) + 1L0 sin(2 )

    2 sin(0 ) + 1L0 ,

    L1 = 1 0 + 2n11

    , (26)

    L2 = 2 1 + 2n22

    ,

    where n1 and n2 are chosen to give the smallestpositive L1 and L2, respectively, and where 1 isdefined as:

    sin 1 = 12 (x2 x0) + 2 sin 0 1 sin 22 1

    cos 1 = 12 (y2 y0) + 2 cos 0 1 cos 22 1 .

    (27)

    On the other hand, if 1 = 2, then 0 = 2, =0+2

    2 and the biarc degenerates to a single arc withcurvature and length

    1 = 2 = 2L0 sin(

    2 02

    ),

    L = L1 + L2 = L0(

    202

    )sin

    (20

    2) . (28)

    Proof: Since the constraints pertaining to the initialoriented point C0 are implicitly satisfied by the forwardconstruction of the biarc, those pertaining to C2 aresatisfied when the coordinates defined by Eq. (22) at Lare (x2, y2) and the tangent angle defined by Eq. (23)at L = L1 + L2 is 2. First, when 1 = 0 and 2 = 0

    x2 = x0 + 11

    (sin(1L1 + 0) sin 0)

    + 12

    (sin 2 sin(1L1 + 0))

    y2 = y0 11

    (cos(1L1 + 0) cos 0)

    12

    (cos 2 cos(1L1 + 0))2 =2 2L2 + 1L1 + 0.

    (29)

    The set of three equations in Eq. (29) constrains thefour unknowns (1, L1, 2, L2) but lacks one equationto solve for them. However, the set of solutions canbe characterized by parameterizing them in terms ofsome variable. Observe an interesting asymmetry inthe relationships among 1, L1, 2, L2, namely, that 1and 2 correlate independently of L1 and L2. Assuming1 = 2,

    (x2 x0) +(

    11

    sin 0 12

    sin 2)

    =(

    11

    12

    )sin 1

    (y2 y0) (

    11

    cos 0 12

    cos 2

    )

    = (

    11

    12

    )cos 1.

    (30)

    In the general case when 1 = 0, 2 = 0, and 1 = 2,1 can be chosen as the independent parameter, and2, L1, L2 can be found as functions of1. Special caseswhich violate one or more of these conditions are alsohandled after considering the general case.

  • Euler Spiral for Shape Completion 171

    First, in the general case 1 can be eliminated fromEq. (30)

    ((x2 x0) +

    (11

    sin 0 12

    sin 2))2

    +(

    (y2 y0) (

    11

    cos 0 12

    cos 2

    ))2

    =(

    11

    12

    )2.

    Expanding, and using x2 x0 = L0 cos and y2 y0 = L0 sin , we solve for 2 in terms of 0,

    2 = 2L02 sin2 ( 202 ) + 1L0 sin(2 )

    2 sin(0 ) + 1L0 (31)

    Thus, 2 is computable in terms of 1 independent of L1or L2. Note that when 1 = 2L0 sin(0 ), |2| = .Equation (30) also solves for 1, in terms of 1

    sin 1 = 12 (x2 x0) + 2 sin 0 1 sin 22 1

    cos 1 = 12 (y2 y0) + 2 cos 0 1 cos 22 1 ,

    (32)

    Since 1 = 1L1 + 0 + 2n1 , multiple solutions arepossible corresponding to arcs which wind more than2 . We seek the smallest positive L1 by selecting n1as follows,

    n1 = 0 1 0 > 0 and 1 > 0n1 = +1 1 0 > 0 and 1 < 0n1 = 1 1 0 < 0 and 1 > 0n1 = 0 1 0 < 0 and 1 < 0.

    (33)

    Similarly,

    L2 = 2 1 + 2n22

    , (34)

    which solves for L2 in the manner described above. Insummary, Eqs. (31) through 34 solve for 2, L1, L2 interms of 1, when 1 = 0, 2 = 0 and 1 = 2, andensure that all the constraints in Eq. (29) are met.

    We now consider a special case where 1 = 2 = 0.From Eq. (29) we have

    x2 x0 = ( sin 0 + sin 2) 12

    y2 y0 = (cos 0 cos 2) 12

    (35)

    Note that this implies 0 = 2, since the points C0and C2 are distinct. Recall that (x2 x0, y2 y0) =L0(cos , sin ), so that Eq. (35) can be rewritten as

    L0 cos = 22

    sin(

    2 02

    )cos

    (2 + 0

    2

    )

    L0 sin = 22

    sin(

    2 02

    )sin

    (2 + 0

    2

    ) (36)

    or, equivalently, tan = tan 2+02 . It follows that tohave equal curvatures 1 and 2, i.e, when the biarcdegenerates to a circular arc, we must have = 0+22 +n . Note that when 0 + 2 = , the same relationshipholds. Substituting back into Eq. (36) gives:

    (1)n L0 cos(

    0 + 22

    )

    = 22

    sin(

    2 02

    )cos

    (0 + 2

    2

    )

    (1)n L0 sin(

    0 + 22

    )

    = 22

    sin(

    2 02

    )sin

    (0 + 2

    2

    )(37)

    Thus,

    1 = 2 = (1)n 2L0 sin(

    2 02

    ), (38)

    where n is decided from the relationship between and 0+22 . The lengths are obtained from Eq. (29),

    2 = 1(L1 + L2) + 0= (1)n 2

    L0sin

    (2 0

    2

    )(L1 + L2) + 0.

    Thus, the total length is

    L = L1 + L2 = L02(1)n( 202 )

    sin(

    202

    ) . (39)

  • 172 Kimia, Frankel and Popescu

    Since L must be positive, this further constrains therequired relationship among , 0 and 2 when curva-tures are equal, namely n = 0:

    (i) if 2 0 > 0 then 0 < 202 < and20

    2sin 202

    > 0requiring n = 0;

    (ii) if 2 0 < 0 then < 202 < 0 and202

    sin 202> 0 requiring n = 0.

    Hence, = 0+22 , and 1 = 2 = 2L0 sin20

    2 , L =L02

    202

    sin 202.

    Note, further, that in the limit as 2 = 0, then 2 =1 = 0 (straight line) and L1 + L2 = L0, as expected.This completes the proof of case (iv).

    Lets now consider the special case (ii) when 1 = 0,2 = 0. Equation (29) gives

    x2 = x0 + L1 cos 0 + sin 2 sin 0

    2

    y2 = y0 + L1 sin 0 cos 2 cos 02

    ,

    (40)

    which gives two equations in two unknowns L1 and 2.If 2 = 0, this equation requires = 0, which forces1 = 2 = 0, thus violating this cases assumption.Thus, 2 = 0. Similarly, = 0 leads to 2 = 0, sothis is also not possible. Eliminating 2 from Eq. (40)and solving for L leads to

    L1 = L0sin

    (0+2

    2 )

    sin(

    202

    ) . (41)The expression for 2 is then either derived from thelimiting case of Eq. (31) or directly by eliminating L1in Eq. (40) as:

    2 = 2L0sin2

    (20

    2)

    sin(0 ) . (42)

    The third case (iii) is handled similarly. Finally, incase (i), when 1 = 2 = 0, the biarc degeneratesto a single line requiring 0 = 2 = . In this case,L = L1 + L2 = L0. This completes the proof in allcases.

    Corollary 1. Given the conditions of Proposition 4,we have the following cases:(a) if 0 = 2 = then 0 = 2 = 0 and L = L0;(b) if 0 = 2 = then only case (iv) applies with

    0 = 2.

    (c) if 0 = 2 and = 0+22 , then the biarc degener-ates to an arc, 1 = 2 and Eq. (28) of case (iv)applies;

    (d) if 0 = 2 and = 0+22 + n, then(d.1) if = 0, cases (iii) and (iv) are possible,(d.2) if = 2, cases (ii) and (iv) are both

    possible, and(d.3) if = 0 and = 2, then cases (ii), (iii)

    and (iv) are all possible.

    4.3. Optimal Biarc Interpolation

    Proposition 4 characterizes the set of biarcs satisfyingthe point-tangent boundary conditions. The selectionof the optimal biarc requires an additional constraint.In contrast to Ullmans constraint of minimizing totalsquared curvature, we will use the constraint of mini-mizing the total curvature variation, Eq. (3). Since thecircular arcs themselves have no curvature variation,minimizing the integral in Eq. (3) is tantamount to min-imizing the difference in arc curvatures (2 1)2 atthe point joining them.

    Proposition 6. The optimal biarc, i.e., the biarc min-imizing total curvature variation E = (2 1)2, andsatisfying endpoint tangent conditions C0(x0, y0, 0)and C2(x2, y2, 2) is specified as follows:(a) if = 0+22 then the optimal biarc degenerates to

    a circular arc

    1 = 2 = 2L0 sin2 0

    2, (43)

    with E = 0. The approximation for L when 0 =2, is

    L = L1 + L2 = L020

    2

    sin(

    202

    ) , (44)while, if 0 = 2, then L = L0.

    (b) if = 0+22 and 0 = 2, then two extremal solu-tions exist. When |2 0| > the solution is

    1 = 4L0 sin(

    30 + 24

    )

    cos

    (2 0

    4

    )

    2 = 4L0 sin(

    0 + 324

    )

    cos

    (2 0

    4

    ),

    (45)

  • Euler Spiral for Shape Completion 173

    with E1 = 64L20 cos4( 204 ) sin2( 0+22 ), and with

    L1 and L2 specified by Eq. (26). When 0 < |2 0| <

    1 = 4L0 cos(

    30 + 24

    )

    sin(

    2 04

    )

    2 = 4L0 cos(

    0 + 324

    )

    sin(

    2 04

    ),

    (46)

    with E2 = 64L20 sin4( 204 ) sin2( (0+2)2 ), and with

    L1 and L2 obtained from Eq. (26).(c) if = 0+22 and 0 = 2, then the solution is an

    S-curve,

    1 = 4L0 sin(0 )

    2 = 4L0 sin(0 ),(47)

    with E = 64L20 sin2(0 ).

    Proof: First, in case(a) where = 0+22 , from Propo-sition 3 cases (i) and the second part of (iv) are valid,and the family of biarcs degenerates to a single arc so-lution: if 0 = 2 this is a straight line 1 = 2 = 0;otherwise, if 0 = 2, curvatures of the arc are obtainedfrom Eq. (28). Thus the optimal biarc is the only biarc.

    Second, consider the case where = 0+22 . Then,curvature 2 can be written as in Eq. (26) covering notonly the first part of case (iv) but also cases (ii) and(iii) as special cases. Note that in all cases 1 = 2.Analytically, optimizing E = (2 1)2 requires thatd Ed1 = 0, or 2(2 1) dd1 (2 1) = 0 which canhappen only if d2d1 = 1,

    d2d1

    = 2L0

    1(2 sin(0 ) + 1L0)2 L0 sin(2 )

    (2 sin(0 ) + 1L0) L0(1 + cos(2 0) + 1L0 sin(2 ))

    = 2(2 sin(0 ) + 1L0)2 (2 sin(2 ) sin(0 )+ 1 cos(2 0))

    =( 2 sin( 0+22 )

    2 sin(0 ) + 1L0

    )2, (48)

    leading to two solutions

    2 sin(

    0+22

    )2 sin(0 ) + 1L0 = 1. (49)

    The first solution corresponding to the negative sign is

    1 = 2L0

    (sin

    (0 + 2

    2

    )+ sin(0 )

    )

    = 4L0

    sin(

    30 + 24

    )

    cos

    (2 0

    4

    )(50)

    From this value for 1 and from Eq. (31), and somemore manipulation,

    2 = 4L0 sin(

    0 + 324

    )

    cos

    (2 0

    4

    ). (51)

    Note that in this case

    2 1 = 8L0 cos2(

    2 04

    )sin

    (0 + 2

    2

    ).

    (52)

    Similarly, the second solution corresponding to the pos-itive sign in Eq. (49) gives

    1 = 4L0 cos(

    30 + 24

    )

    sin(

    2 04

    ),

    2 = 4L0 cos(

    0 + 324

    )

    sin(

    2 04

    ).

    (53)

    For this second solution,

    2 1 = 8L0 sin2(

    2 04

    )sin

    (0 + 2

    2

    ).

    (54)

    Having characterized the only two solutions at whichthe derivative of E is zero, we now examine whetherthese extrema are minima, by verifying that d E2d12 > 0.Since

    d2 Ed21

    = 2(

    d2d1

    1)2

    + 2(2 1)d22

    d21, (55)

    = 2(2 1)d22

    d21. (56)

  • 174 Kimia, Frankel and Popescu

    Taking second derivatives using Eq. (48) and then usingEq. (49),

    d22d21

    = 2L04sin2

    (0+2

    2 )

    (2 sin(0 ) + 1L0)3

    = L0sin

    (0+2

    2 ) . (57)

    Now for the first solution, we obtain d2 Ed21 =16cos2( 204 ) while for the second solution d

    2 Ed21 =

    16 sin2( 204 ).We conclude that the solutions are local minima, ex-

    cept possibly for the second solution when 0 = 2.This special case is considered below. The global min-imum is the choice between the two with a lowerE = (21)2. Thus, when |20| < , sin2( 204 ) , the first solution isthe better one.

    Finally, consider the special case when 0 = 2. Thefirst solution corresponding to the negative sign is

    1 = 4L0 sin(0 ), (58)2 = 4L0 sin(0 ),

    which corresponds to an S-shaped curve biarc con-sisting of two identical arcs of equal curvature but op-posite sign. In this case

    2 1 = 8L0 sin(0 ). (59)

    The second solution gives 1 = 0 and 2 = 0, butthe latter violates the assumption that 1 = 2.9

    Corollary 2. The optimal biarc interpolating be-tween C0(x0, y0, 0) and C2(x2, y2, 2) degenerates toa circular arc if and only if the point-tangent pairs areco-circular.

    Proof: When two tangents lie on a circle, = 0 +20

    2 = 2+02 , and we have a single arc. We can alsocheck the limiting case of the solution as 0+22

    1 = 4L0 sin(

    30 + 24

    2 + 02

    )cos

    (2 0

    4

    )

    = 2L0

    sin(2 0)

    2.

    A similar argument for 2 shows that the limit of2 is the limit of 1. On the other hand, if 1 =2, suppose = 0+22 . Then, for the first solution2 sin( 0+22 ) cos( 204 ) = 0. Since both 0 and 2are in the range [0, 2 ), the only term which can bezero is sin( 0+22 ), and therefore = 2+02 + n .In order to have positive length, n must be zero. Asimilar argument holds for the second solution. Thus, = 2+02 , a contradiction, and the tangents must beco-circular.

    The pseudocode for biarc interpolation is describedin Appendix A.1.

    5. Examples

    In this section we examine the Euler spiral comple-tion curve for a variety of point-tangent configurations,probe the extensibility property of the Euler Spiral, andapply the results to the examples presented in the in-troduction, Fig. 1. We will then describe how this ap-proach may be used in several computer vision tasks,specifically, disambiguating edge maps in perceptualgrouping, partitioning visual form, and the filling-in ofoccluded areas.

    The completion curve is derived by analytically find-ing the optimal biarc as described in Section 4, and thenusing gradient descent using the biarc as the initial con-dition to solve the nonlinear optimization described inSection 2 (see also Appendix A.2), as demonstrated inFig. 10.

    The completion curve is shown for a variety of point-tangent pair configurations in Fig. 11. A subjective ex-amination reveals that the completion curve is intuitiveand natural. Figure 12 shows this completion curvewhen overlayed on synthetic occluders; both the fi-nal Euler spiral and the intermediate biarc are shown;observe that the biarc is a good approximation of theEuler spiral. Figure 13 shows the completion curve forthe Kanizsa illusory contour, the occluded kangaroo,and for other shapes.

    The extensibility property of the completion curve isexamined in Fig. 14. Observe that the numerically de-rived completion curve satisfies the extensibility prop-erty as predicted by the theoretical results. Extensibilityof the completion contour is critical in the completionof a boundary behind an occluder, i.e., the comple-tion curve remains stable with changes in the extentof the occlusion. Note that elastica are extensible, but

  • Euler Spiral for Shape Completion 175

    Figure 10. Two examples of how the initial biarc (in cyan andmagenta), gives rise to a series of Euler Spirals which converge tothe Euler Spiral (in blue) using gradient descent. The intermediatespirals are in red.

    are not stable with changes in scale. In contrast, scale-invariant version of elastica are stable with change inscale, but are not extensible. The Euler Spiral solutionis stable with changes in the extent of occlusion andextensible with changes in scale.

    The question naturally arises that while these com-pletions appear intuitive, what role if any can they canpotentially play in actual computations required forvarious computer vision tasks. We now describe threepotential uses of the Euler spiral completion curves inthis context. First, consider the task of disambiguating

    6 8 10 12 14 16 18 20 22

    91011

    12

    1314

    15

    1617

    1819

    6 8 10 12 14 16 18 20 22

    6

    8

    10

    12

    14

    16

    18

    206 8 10 12 14 16 18 20 22

    8

    10

    12

    14

    16

    18

    20

    6

    8

    10

    12

    14

    16

    18

    20

    6

    8

    10

    12

    14

    16

    18

    20 6 8 10 12 14 16 18 20 226 8 10 12 14 16 18 20 226 8 10 12 14 16 18 20 22

    2

    4

    6

    8

    10

    12

    14

    16

    18

    20

    Figure 11. The interpolation of a pair of point-tangent pairs by the Euler Spiral. The first point and its tangent are held constant for each graphwhile varying the position and tangent at the second point. Note that the entire space of variations can be described by two parameters, i.e., theangle of each tangent with respect to the line connecting them. However, we show examples in this extrinsic setting as the variation at end pointsis exactly what arises in visual situations. Observe that the completions are visually intuitive.

    edge maps in perceptual grouping. Since edge detectionalgorithms often result in imperfect edge maps con-taining numerous gaps, spurious edges, etc., percep-tual grouping is required to disambiguate the edgemap by taking into account structural saliency. Thereare a large number of approaches for accomplishingthis. Williams and Thornber (1999) note that in gen-eral these approaches involve two steps of first com-puting a local affinity measure for a pair of edges,and then computing a global saliency measure byoptimizing support over various curve hypotheses(Guy and Medioni, 1992; Herault and Horaud, 1993;Parent and Zucker, 1989; Sarkar and Boyer, 1992;Sharon et al., to appear; Williams and Jacobs, 1997;Williams and Thornber, 1999). While previous ap-proaches have used cocircularity (Parent and Zucker,1989), and the total curvature of elastical completioncurves, we propose that the local affinity measure caninstead be based on the properties of the Euler spi-ral, as used in Johannes et al. (2001) and depicted inFig. 15.

    While all the information pertaining to these prop-erties is already implicit in the part-tangent pairs, thecomputation of the completion curve properties e.g.,

  • 176 Kimia, Frankel and Popescu

    Figure 12. From left to right, original image, occluded object, biarc completion of the simulated occlusion, Euler spiral refinement of the biarccompletion.

    Figure 13. The completion curve for several examples including two of the examples presented in Fig. 1.

    of curvature variation , currently requires the explicitreconstruction of the Euler spiral through the biarcas described in Section 4. Furthermore, in connectingtwo edges, one must verify that the completion curvedoes not intersect with the existing edges or previouslyestablished completion contours, thus arguing for theexplicit reconstruction of the Euler spiral, rather thanjust deriving these properties from the point-tangentpairs.

    Second, consider the task of partitioning visual form.While boundary-based approaches partition the silhou-ettes based on salient features such as negative cur-vature extrema (Hoffman and Richards, 1985), someregion-based schemes look for the suitability of actualbreak curves through the shape which are anchoredat these salient features (Siddiqi and Kimia, 1995).Specifically, ambiguous partitioning hypotheses can bedisambiguated using a measure of part-curve saliency,

  • Euler Spiral for Shape Completion 177

    Figure 14. Two examples illustrating that the Euler Spiral is extensible. The blue portion is the interpolation starting with the middle point.Extensibility is critical since the interpolation must be stable with changes in the extent of occlusion.

    Figure 15. A circular shape is embedded among spurious edges. The sequence of operations that either removes an edge or groups it withothers is generated by a gradient descent on an energy functional which is based on the energy of the Euler Spiral interpolation betweenneighboring edge elements (Johannes et al., 2001). The additional curves are the medial axis which indicate which pairs of point-tangent pairsshould be considered at each step.

    Fig. 16. While the original approach used part-lines totest the inclusion of the break curves inside the shapeand splines to measure the total curvature, the Eulerspiral completions are more appropriate to use in bothtasks (Dhandapani and Kimia, 2002). Again, in analogyto the edge map disambiguation, while this informationis implicit in the point-tangent pairs, its computationrequires an explicit reconstruction to check that hy-pothesized break-curves do not intersect the boundaryof the shape.

    The third example is based on object completionbehind an occluder, e.g., as required in in-painting.The current approach to in-painting interpolates in-tensities in the missing region, thus effectively diffus-ing boundary intensities within that region. This ap-proach, however, will fail when the missing regioncontains boundaries, as in Fig. 17, where diffusion-based inpainting smears two different regions together,Fig. 17(c). The explicit reconstruction of the missingboundary prior to the diffusion process, however, pre-vents this, Fig. 17(d).

    6. Summary and Discussion

    The class of curves which interpolate two point-tangentpairs, i.e., by passing through each point with specifiedtangents, is rather large. Thus, some criterion is re-quired to pick the most suitable curve to interpolatebetween them. Previously, several measures of opti-mality have been proposed that attempt to capture oursense of aesthetics and how pleasing the interpolationcurve appears. In addition, in previous approaches re-stricted classes of curves such as biarcs or cubic splineshave been identified that render the optimizationpractical.

    Despite such ambiguity and the apparent lack ofguidelines in the selection of an optimality measureand an appropriate class of curves, the problem is con-strained by several required properties of visual in-terpolation. These properties were partially identifiedby Ullman (1976) as axioms, and more completelyby Knuth (1979). Unfortunately, the latter set of pro-posed axioms is not consistent. Knuth, given the choice

  • 178 Kimia, Frankel and Popescu

    Figure 16. This figure from (Siddiqi and Kimia, 1995) illustrates how stable partitioning can arise from disambiguating competing part-curvehypotheses. (a) original shape; (b) all part-curve hypotheses; (c) disambiguation using the saliency of the part-curve; (d) partitioning results.The Euler Spiral provides a better break curve and a better saliency measure (Dhandapani and Kimia, 2002).

    between locality and extensibility, to make this set con-sistent, reluctantly drops extensibility. This solution vi-olates roundedness. On the other hand, in this paperwe examine the implications of retaining extensibilityand dropping locality instead. This allows us to main-tain roundedness, i.e., circular interpolations of pointtangent pairs that are indeed on a circle. This in turnleads to an energy functional which penalizes curvaturevariation, but not curvature proper. The solution yieldsinterpolations which are segments of the Euler Spiral,i.e., curves where curvature varies linearly with ar-clength. The rest of the paper deals with the derivationof analytic formulas for computing this curve using abiarc approximation which can then be refined to obtainthe Euler spiral by solving a nonlinear system of twoequations in two unknowns involving Fresnel Integrals.

    The practical advantages of using an Euler spi-ral interpolation are: (i) fast and reliable completioncurve computation; (ii) natural and intuitive comple-tion curves; (iii) robustness to changes in the extentof occlusion: extensibility ensures that as a portion ofthe occluded contour modeled by an Euler spiral is re-vealed the interpolation does not change. This propertyis not true of the Ullmans biarc or our biarcs, nor of thescale-invariant elastica (regular elastica are extensiblebut change with scale); (iv) the Euler Spiral interpolates

    Figure 17. (a) The original image, (b) The gap (in brown), (c) Inpainting using a conventional diffusion based technique, and (d) Inpaintingusing the Euler Spiral (in red) as the completion contour of the occluded object.

    over a complete range and combinations of boundarydata; (v) the internal parameters of the interpolant aregeometrically meaningful and thus can be used as an in-dicator to dis-ambiguate edges in perceptual grouping,as suggested in (Guy and Medioni, 1992; Parent andZucker, 1989; Shaashua and Ullman, 1988; Williamsand Jacobs, 1995). Thus, it provides a suitable solutionto the gap completion and boundary modeling prob-lems as used in the context of perceptual grouping ofedge maps, partitioning visual form, and filling-in ofoccluded objects among others.

    Appendix A: Algorithm

    We now describe the algorithms in pseudocode for-mat for computing the parameters of the biarc, whichhas minimum total curvature derivative variation, andfor computing the parameters of the Euler Spiral. Let(x0, y0, 0) and (x2, y2, 2) denote the initial and finalcoordinate-tangent angle pairs. The biarc algorithm re-turns K1, L1, K2, L2, the curvature and length of eacharc as well as the total curvature variation E . The EulerSpiral algorithm returns the initial and final curvatureK0, K2, the length L , the rate of change of curvature , and the total curvature derivative variation E .

  • Euler Spiral for Shape Completion 179

    A.1. Pseudocode for Biarc Implementation

    COMPUTEBIARCSOLUTION(x0, y0, x2, y2, 0, 2)12 L

    (x1 x0)2 + (y1 y0)2

    3 AngleOfVector(x2 x0, y2 y0)4 smallAngle 0.0015 smallCurvature 0.0016 biarcflag 07 L1 108 L2 109 if ( ( (2+0)2 )mod = 0)

    10 then if 0 = 011 then12 1 013 2 114 L1 L/215 L2 L11617 else18 1 2L sin 20219 2 120 L1 |0 L sin /20sin(20) |21 L2 L12223 join 224 estimateK 125 estimateL L1 + L22627 else28 biarcflag 129 1 4L sin( 30+24 ) cos( 204 )30 2 4L sin( 0+324 ) cos( 204 )31 join ComputeJoinTheta32 (x0, y0, 0, x2, y2, 2, 1, 2)33 if 1 == 034 then L1 L (sin((2+0)/2)sin((02)/2))3536 else37 L1 ComputeArclength(0, join, 1)3839 if 2 == 040 then L2 L sin((2+0)/2)sin((02)/2)4142 else43 L2 ComputeArclength( join, 2, 2)4445 3 4L cos( 30+24 ) sin( 204 )46 4 4L cos( 0+324 ) sin( 204 )47 if (3 == 0)and(4 == 0)48 then Both curvatures are 0e-approximations49 needed50 else51 if (3 = 4)52 then53 join ComputeJoinTheta54 (x0, y0, 0, x2, y2, 2, 3, 4)55 if 3 == 056 then57 L3 L sin((2+0)/2)sin((20)/2)

    5859 else60 L3 ComputeArclength61 (0, join, 3)6263 if 4 == 064 then65 L4 L sin((2+0)/2)sin((02)/2)6667 else68 L4 ComputeArclength69 ( join, 2, 4)70717273 E1 (2 1)(2 1)74 E2 (3 4)(3 4)75 estimateL , estimateK to be computed according76 to correct criteria for choosing one of the two solutions77 if L1 + L2 < L3 + L478 then79 estimateL L1 + L280 estimateK 181 else82 estimateL L3 + L483 estimateK 384 return estimateK , estimateL85

    ANGLEOFVECTOR(X, Y )12 valangle = arctan2 YX3 if valangle < 04 then5 valangle (valangle + 2 )67 return valangle

    COMPUTEJOINTHETA(x0, y0, 0, x2, y2, 2, 1, 2)1 sin(Join) 12(x2x0)+2 sin(0)1 sin(2)212 cos(Join) 12(y2y0)+2 cos(0)1 cos(2)213 Join AngleOfVector(sin(Join), cos(Join))4 return Join

    COMPUTEARCLENGTH(0, 1, k)1 numerator 1 02 if (k < 0)and((1 0) > 0)3 then numerator (numerator 2 )45 else if (k > 0)and((1 0) < 0)6 then numerator (numerator + 2 )78 return numeratork9

  • 180 Kimia, Frankel and Popescu

    A.2. Pseudocode for the Euler spiral

    SOLVEEULER(x0, y0, 0, x2, y2, 2, i ternum )1 estKinit, estLinit ComputeInitialEstimates2 (x0, y0, 0, x2, y2, 2)3 fin, Lfin SolveIteratively4 (x0, y0, 0, x2, y2, 2, estKinit, estLinit, iternum)5 2 20( f in L f in )L f in ,26 return fin, Lfin,

    COMPUTEINITIALESTIMATES(x0, y0, 0, x2, y2, 2)1 estKinit, estLinit ComputeBiarcSolution2 (x0, y0, 0, x2, y2, 2)3 return estKinit, estLinit4

    SOLVEITERATIVELY(x0, y0, 0, x1, y1, 2, estKinit, estLinit, iternum)1 error computeError2 (x0, y0, 0, x1, y1, 2, estKinit, estLinit)3 prevError 10004 errorStep 0.15 epsilon 0.000016 epsilonError 0.17 curEstK estKinit8 curEstL estLinit9 for i 0 to iternum

    10 do11 if (error < epsilon)or(i == iternum 1)12 then13 return curEstL, curEstK1415 else16 error0 computerror17 (x0, y0, 0, x1, y1, 2, (curEstK + errorStep), curEstL)18 error1 computeError19 (x0, y0, 0, x1, y1, 2, (curEstK errorStep), curEstL)20 error2 computeError21 (x0, y0, 0, x1, y1, 2, curEstK, (curEstL + errorStep))22 if estL > errorStep23 then24 est L (curEstL errorStep)25 error3 computeError26 (x0, y0, 0, x1, y1, 2, curEstK, estL)27 error min(error0, error1, error2, error3)28 if error >= prevError29 then errorStep errorStep23031 else if error == error032 then33 curEstK (curEstK + errorStep)3435 else if error == error136 then37 curEstK (curEstK errorStep)3839 else if error == error240 then

    41 curEstL (curEstL + errorStep)4243 else if curEstL > errorStep44 then45 curEstL (curEstL errorStep)4647 prevError error

    COMPUTEERROR(x0, y0, 0, x2, y2, 2, , L)1 2 20(L)L22 X, Y EulerSpiralEndPoint(x0, y0, 0, , , L)3 error =

    (X x2)2 + (Y y2)2

    4 return error

    EULERSPIRALENDPOINT(a, b, , , , s)1 = 0.000000012 if ( > 0and < )or ( < 0and > )3 then4 05 if > 06 then7 first fresnel( +( s)( ) )8 second fresnel( ( ) )9 A first[0] second[0]

    10 B f irst[1] second[1]11 cosTerm cos( 22 )12 sinTerm sin( 22 )13 constTerm = (

    )

    14 X a + (constTerm)(cosTermA sinTermB)15 Y b + (constTerm) (sinTermA + cosTermB)16 if < 017 then18 f irst fresnel( +( s)( ) )19 second f resnel( ( ) )20 A first[0] second[0]21 B (first[1] second[1])22 constTerm (

    )23 cosTerm = cos( (2)/(2 ))24 sinTerm = sin( (2)/(2 ))25 X a + (constTerm)(cosTermA sinTermB)26 Y b + (constTerm)(sinTermA + cosTermB)2728 if = 029 then30 if = 031 then32 X a + scos( )33 Y b + ssin( )3435 else constTerm 1.0kappa36 X a + (constTerm)(sin(s + ) sin( ))37 Y b + (constTerm)(cos(s + ) cos( ))38 return X, Y

  • Euler Spiral for Shape Completion 181

    Acknowledgments

    This material is based upon work supported by theNational Science Foundation under grant 0083231.Any opinions, findings, and conclusions or recommen-dations expressed are those of the authors and do notnecessarily reflect the views of the National ScienceFoundation.

    Notes

    1. The main reason for using (0, 2) is to facilitate the use of anintermediate point (index 1).

    2. The notation (x0, y0, 0) denotes that the interpolation passesthrough (x0, y0) at tangent angle 0.

    3. According to Knuth, prior attempts at laying a scientific foun-dation for calligraphy and mathematical typography, e.g., thoseof Feliciano (1460), Pacivoli (1509), Torriello (1517), Palatino(1574), Tory (1579) and Maxon (1676), relied on rigid rulerand compass methods and, were aesthetic failures, deprived ofcalligraphic grace.

    4. It is curious that, in actual applications of this curve completionsolution, the resulting curve does not, unlike Renaissance geome-ters, describe the boundary of a symbol; rather, it describes thecentral curve of the symbol and, as such, allows the shape ofthe pen to vary. This is precisely a description of shape as the ge-ometry of the medial axis curve as well as the radial or dynamicchanges as a point moves along this axis (Knuth, 1979).

    5. It should also be noted that Grossberg and Mingolla (1985) pro-pose a cooperative-competitive framework consisting of itera-tive nonlinear convolutions to complete illusory contours, amongother tasks.

    6. The curvature of an elastic curve meeting these end conditions(but with free length) satisfies (Birkhoff and Boor, 1965)

    ss + 12 3 = 0.

    7. If we posit 0 and L as the free parameters, can be eliminatedby = 2 (10)0 LL2 , in Eq. (3), leading to two equations and twounknowns. However, numerical experience with these geometricinterpolants shows that another set of free parameters, namely,0 and 2 (initial and final curvatures), is better suited to therecovery of the Euler spiral. In other words, we use an alternate,more symmetric, yet equivalent, description of each Euler Spiralsegment in terms (x0, y0, 0) and (0, 2, )

    8. We use subscript two to allow for the intermediate point(x1, y1, 1) which joins two biarcs.

    9. It is instructive to consider the limiting case of the second solutionas 2 0; let 2 = 0 + where is a small number. The secondsolution implies very small and close curvatures, correspondingto a biarc consisting of very large circles. In the limit, the biarcconsists of two infinite length line segments joining at infinity.Note also that by taking arbitrarily small, the second solutioncan be made to have smaller |2 1| but at the expense of arbi-trarily enlarging its length. Since the Euler spiral correspondingto one extreme biarc may be better than another, even when thecorresponding biarcs hold the opposite relationship, we considerboth extremal solution to generate the Euler spiral.

    References

    Abramowitz, M. and Stegun, I.A. (eds.) 1972. Handbook of Math-ematical Functions with Formulas, Graphics, and MathematicalTables. National Bureau of Standards, New York.

    Ahlberg, J., Nilson, E., and Walsh, J. 1967. The Theory of Splinesand their applications. New York, Academic Press.

    Baldwin, A. 1996. Teardrop & clothoid loops. www.demon.co.uk/arvis/wwg/tech/phtd.html.

    Birkhoff, G. and Boor, C.D. 1965. Piecewise polynomial interpola-tion and approximation. Approximations of Functions.

    Brady, M. and Grimson, W. 1980. Shape encoding and subjectivecontours. In Proc. 1st Annual National Conf. on Artif. Intel.,pp. 1517.

    Bryant, R. and Griffiths, P. 1986. Reduction for constrained varia-tional problems and

    22 ds. American Journal of Mathematics,

    108:525570.Cesaro, E. 1886. Les lignes barycentriques. Nouvelles annales de

    mathematiques, 3(5):511520.Cornu, A. 1874. Methode nouvelle pour la discussion des proble`mes

    de diffraction. Journal physique theorique et appliquee.Dhandapani, R. and Kimia, B.B. Role of scale in partitioning shape.

    In Proceedings of the IEEE International Conference on ImageProcessing, Rochester, New York, IEEE Computer Society Press(Accepted).

    Euler, L. 1744. Methodus inveniendi lineas curvas maximi minimiveproprietate gaudentes. Lausanne.

    Eulers integrals and Eulers spiral. 1918. American Math Monthly,Vol. 25(8).

    Farin, G.E. 1996. Curves and Surfaces for Computer-Aided Geomet-ric Design: A Practical Guide (Computer Science and ScientificComputing Series), 4th ed. Academic Press.

    Grossberg, S. and Mingolla, E. 1985. Neural dynamics ofform perception: Boundary completion, illusory figures, andneon color spreading. Psychological Review, 92(2):173211.

    Guy, G. and Medioni, G. Perceptual grouping using global saliency-enhancing operators. In International Conference on PatternRecognition, The Hague, Netherlands, August 30September 3,1992. Computer Society Press, pp. I:99103.

    Herault, L. and Horaud, R. 1993. Figure-ground discrimination: Acombinatorial approach. PAMI, 15(9):899914.

    Higgins, A. 1921. The Transition Spiral and its Introduction to Rail-way Curves. Constable, London.

    Hoffman, D.D. and Richards, W.A. 1985. Parts of recognition. Cog-nition, 18:6596.

    Horn, B.K.P. 1983. The curve of least energy. ACM Trans. Math.Softw., 9(4):442460.

    Johannes, M.S., Sebastian, T.B., Tek, H., and Kimia, B.B. 2001.Perceptual organization as object recognition divided by two. InWorkshop on Perceptual Organization in Computer Vision, pp. 4146.

    Kanizsa, G. 1979. Organization in Vision: Essays on Gestalt Percep-tion. Praeger.

    Knuth, D.E. 1979. Mathematical typography. Bulletin (new series)of the American mathematical Society, 1(2):337372.

    Kurtz, C. 1945. Track and Turnout Engineering. Simmons-Boardman Publishing Corporation, New York.

    Leonard, I. 1988. More on Fresnel integrals. American MathematicalMonthly, 95:431433.

  • 182 Kimia, Frankel and Popescu

    Love, A. 1927. A Treatise on the Mathematical Theory of Elasticity,4th ed. Cambridge University Press, Cambridge.

    Mumford, D. 1994. Elastica and computer vision. In Algebraic Ge-ometry and Its Applications, Springer-Verlag, pp. 491506.

    Nitzberg, M., Mumford, D., and Shiota, T. 1993. Filtering, Segmen-tation and Depth. Springer-Verlag.

    Onn, R. and Bruckstein, A. 1990. Integrability disambiguates surfacerecovery in two-image photometric stereo. International Journalof Computer Vision, 5:1:105113.

    Parent, P. and Zucker, S.W. 1989. Trace inference, curvature consis-tency and curve detection. PAMI, 11(8):823839.

    Press, W., Flannery, B., Teukolsky, S., and Vetterling, W. 1993. Nu-merical Recipes in C: The Art of Scientific Computing, 2nd ed.,Fresnel Integrals, Cosine and Sine Integrals. Cambridge Univer-sity Press, Cambridge, England.

    Rutkowski, W.S. 1979. Shape completion. Computer Graphics andImage Processing, 9:89101.

    Sarkar, S. and Boyer, K. 1992. Perceptual organization usingBayesian networks. In CVPR92, pp. 251256.

    Shaashua, A. and Ullman, S. 1988. Structural saliency: The de-tection of globally salient structures using a locally connectednetwork. In Second International Conference on Computer Vi-sion (Tampa,, FL, December 58, 1988), Washington, DC, IEEEComputer Society Press.

    Sharon, E., Brandt, A., and Basri, R. Completion energies and scale.IEEE Transactions on Pattern Analysis and Machine Intelligence22(10):11171131, October 2000.

    Siddiqi, K. and Kimia, B.B. 1995. Parts of visual form: Computa-tional aspects. PAMI, 17(3):239251.

    Sokolnikoff, J. 1956. Mathematical Theory of Elasticity. New York.Spanier, J. and Oldham, K. 1987. An Atlas of Functions. Hemisphere,

    Washington, DC.Talbot, A.N. 1927. The Railway Transition Spiral, 6th ed. McGraw-

    Hill Book Company, Inc., New York and London.Ullman, S. 1976. Filling-in the gaps: The shape of subjective contours

    and a model for their generation, 25:16.Weiss, I. 1988. 3D shape representation by contours. Computer Vi-

    sion, Graphics, and Image Processing, 41:80100.Weisstein, E.W. 1998. French curve. www.astro.virginia.edu/

    eww6n/math/FrenchCurve.html.Williams, L. and Jacobs, D. 1997. Local parallel computation

    of stochastic completion fields. Neural Computation, 9(4):837858.

    Williams, L. and Thornber, K. 1998. A comparison of measuresfor detecting natural shapes in cluttered backgrounds. ECCV98,1407(2):432448.

    Williams, L. and Thornber, K. 1999. A comparison of measuresfor detecting natural shapes in cluttered backgrounds. IJCV,34(2/3):8196.

    Williams, L.R. and Jacobs, D.W. 1995. Stochastic completion fields:A neural model of illusory contour shape and salience. In Proceed-ings of the Fifth International Conference on Computer Vision,Boston, Massachusetts, IEEE Computer Society Press, pp. 408415.