11.07.2015 Views

An exact method for computing the area moments of ... - IEEE Xplore

An exact method for computing the area moments of ... - IEEE Xplore

An exact method for computing the area moments of ... - IEEE Xplore

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>IEEE</strong> TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 23, NO. 6, JUNE 2001 633<strong>An</strong> Exact Method <strong>for</strong> Computing <strong>the</strong> AreaMoments <strong>of</strong> Wavelet and Spline CurvesMa<strong>the</strong>ws Jacob, Student Member, <strong>IEEE</strong>, Thierry Blu, Member, <strong>IEEE</strong>, andMichael Unser, Fellow, <strong>IEEE</strong>AbstractÐWe present a <strong>method</strong> <strong>for</strong> <strong>the</strong> <strong>exact</strong> computation <strong>of</strong> <strong>the</strong> <strong>moments</strong> <strong>of</strong> a region bounded by a curve represented by a scalingfunction or wavelet basis. Using Green's Theorem, we show that <strong>the</strong> computation <strong>of</strong> <strong>the</strong> <strong>area</strong> <strong>moments</strong> is equivalent to applying asuitable multidimensional filter on <strong>the</strong> coefficients <strong>of</strong> <strong>the</strong> curve and <strong>the</strong>reafter <strong>computing</strong> a scalar product. The multidimensional filtercoefficients are precomputed <strong>exact</strong>ly as <strong>the</strong> solution <strong>of</strong> a two-scale relation. To demonstrate <strong>the</strong> per<strong>for</strong>mance improvement <strong>of</strong> <strong>the</strong> new<strong>method</strong>, we compare it with existing <strong>method</strong>s such as pixel-based approaches and approximation <strong>of</strong> <strong>the</strong> region by a polygon. We alsopropose an alternate scheme when <strong>the</strong> scaling function is sinc…x†.Index TermsÐArea <strong>moments</strong>, curves, splines, wavelets, Fourier, two-scale relation, box splines, wavelet-Galerkin integrals.æ1 INTRODUCTIONMOMENTS are standard descriptors <strong>of</strong> <strong>the</strong> shape <strong>of</strong> anobject [1], [2], [3]; <strong>the</strong>y easily yield features that areinvariant to translation and rotation [4] or, more generally,to affine trans<strong>for</strong>mations, which makes <strong>the</strong>m useful tools<strong>for</strong> pattern recognition. In <strong>the</strong> standard <strong>for</strong>mulation, <strong>the</strong>yare computed as surface integrals which requires rasterscanning through <strong>the</strong> image. However, <strong>the</strong>re are manyinstances where <strong>the</strong> boundaries <strong>of</strong> objects are described byparametric curves. This is <strong>the</strong> case, <strong>for</strong> example, when <strong>the</strong>objects are detected using parametric snakes which arerepresented using B-spline [5], [6], [7], [8] or wavelet basisfunctions [9], [10]. <strong>An</strong>o<strong>the</strong>r simple case is when <strong>the</strong> region isdescribed as a polygon [11].In this paper, we address <strong>the</strong> problem <strong>of</strong> <strong>computing</strong> <strong>the</strong><strong>area</strong> <strong>moments</strong> <strong>of</strong> objects described by such parametriccurves when <strong>the</strong> basis functions are scaling functions. Thepopular wavelet curve descriptors also fall into this class.The originality <strong>of</strong> our approach is that <strong>the</strong> computation is<strong>exact</strong> and also more direct than <strong>the</strong> conventional pixelbased<strong>method</strong> which requires an explicit labeling <strong>of</strong> <strong>the</strong>inner region <strong>of</strong> <strong>the</strong> curve prior to computation. Moreover,<strong>the</strong> pixel-based schemes suffer a low accuracy due to <strong>the</strong>loss <strong>of</strong> subpixel details in <strong>the</strong> rasterizing process. Also, <strong>the</strong>error in <strong>the</strong> <strong>area</strong>-based computation <strong>of</strong> <strong>moments</strong> isdependent on <strong>the</strong> orientation <strong>of</strong> <strong>the</strong> shape.Since a polygon can be represented in terms <strong>of</strong> linearsplines, <strong>the</strong> computation <strong>of</strong> <strong>moments</strong> by approximating <strong>the</strong>shape as a polygon [11], [12], [13] is a particular case <strong>of</strong> ourapproach. While <strong>the</strong> polygon <strong>method</strong> can be made asaccurate as desired by increasing <strong>the</strong> number <strong>of</strong> segments,<strong>the</strong> convergence is slow because <strong>of</strong> <strong>the</strong> low approximation. The authors are with <strong>the</strong> Biomedical Imaging Group, Swiss FederalInstitute <strong>of</strong> Technology, Lausanne, CH-1015 Lausanne, EPFL, Switzerland.E-mail: {ma<strong>the</strong>ws.jacob, thierry.blu, michael.unser}@epfl.ch.Manuscript received 7 June 2000; revised 6 Feb. 2001; accepted 2 Mar. 2001.Recommended <strong>for</strong> acceptance by S. Sarkar.For in<strong>for</strong>mation on obtaining reprints <strong>of</strong> this article, please send e-mail to:tpami@computer.org, and reference <strong>IEEE</strong>CS Log Number 112243.order <strong>of</strong> linear splines. Moreover, it is not suitable <strong>for</strong><strong>computing</strong> <strong>the</strong> curvature, which is an interesting shapefeature as it is invariant to rotation and translations, and canbe easily normalized to scale changes. This motivates us toinvestigate higher order schemes where <strong>the</strong> curve isrepresented by smoo<strong>the</strong>r basis functions such as B-splinesand o<strong>the</strong>r scaling functions that appear in wavelet <strong>the</strong>ory[14], [15]. These type <strong>of</strong> basis functions also occur naturallywhen one seeks multiresolution representation <strong>of</strong> curveswhich are well suited <strong>for</strong> pattern recognition and shapesimplification [16], [10].The paper is organized as follows: In Section 2, we showhow Green's Theorem can be used <strong>for</strong> <strong>the</strong> computation <strong>of</strong><strong>the</strong> <strong>area</strong> <strong>moments</strong> <strong>of</strong> a parametric curve. In Section 3, weconsider <strong>the</strong> computation <strong>of</strong> <strong>the</strong> <strong>moments</strong> <strong>of</strong> such a curverepresented in spline or wavelet bases. Here, we alsodiscuss <strong>the</strong> properties <strong>of</strong> <strong>the</strong> multidimensional kernel usedin <strong>the</strong> computation <strong>of</strong> <strong>moments</strong>. In Section 4, we give <strong>the</strong>implementation details <strong>of</strong> <strong>the</strong> moment computation. In <strong>the</strong>following section, we deal with <strong>the</strong> precomputation <strong>of</strong> <strong>the</strong>kernel. In Section 6, we present an alternate implementationthat works <strong>for</strong> any order <strong>moments</strong>, but it is rigorously <strong>exact</strong>only when <strong>the</strong> scaling function is sinc…x†. This is especiallyinteresting because it makes our <strong>method</strong> applicable to <strong>the</strong>Fourier representation <strong>of</strong> curves as well. In <strong>the</strong> last section,we compare <strong>the</strong> new <strong>method</strong> with <strong>the</strong> existing schemessuch as approximation using polygons and rasterizing.2 PRELIMINARIES2.1 Computation <strong>of</strong> Moments UsingGreen's TheoremGreen's Theorem relates <strong>the</strong> volume integral <strong>of</strong> <strong>the</strong>divergence <strong>of</strong> a vector field in a closed region to <strong>the</strong>integral <strong>of</strong> <strong>the</strong> field over <strong>the</strong> surface enclosing it. In thissection, we show how it can be used to compute <strong>the</strong><strong>moments</strong> <strong>of</strong> an <strong>area</strong> enclosed by a curve.0162-8828/01/$10.00 ß 2001 <strong>IEEE</strong>


634 <strong>IEEE</strong> TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 23, NO. 6, JUNE 2001Consider a closed region V, bounded by a surface S.Green's Theorem states that, <strong>for</strong> any vector field F,ZZ…r:F† dV ˆ F:dS;…1†Vwhere dS is <strong>the</strong> unit vector pointing out <strong>of</strong> <strong>the</strong> surface S.Assuming <strong>the</strong> volume has a constant cross-section boundedby <strong>the</strong> curve C and that <strong>the</strong> variation <strong>of</strong> <strong>the</strong> field along <strong>the</strong>z-direction is zero, we can restrict <strong>the</strong> <strong>the</strong>orem to twodimensions as,Z @F xS @x ‡ @F Iydxdy ˆ …F y dx F x dy†: …2†@yCThe first integral is evaluated over <strong>the</strong> <strong>area</strong> S enclosed by<strong>the</strong> curve and <strong>the</strong> second one along <strong>the</strong> curve C in <strong>the</strong>clockwise direction. The computation <strong>of</strong> <strong>the</strong> <strong>moments</strong>involves <strong>the</strong> evaluation <strong>of</strong> <strong>the</strong> integral R S xm :y n :dxdy on <strong>the</strong>surface bounded by <strong>the</strong> curve. This, by (2), is equivalent toII m;n ˆCSx m y n‡1n ‡ 1 dx;with F ˆ e y … xm y n‡1n‡1 †; e y denotes <strong>the</strong> unit vector along <strong>the</strong>y direction. Note that <strong>the</strong> choice <strong>of</strong> F is not unique. Wechoose <strong>the</strong> vector field F that makes <strong>the</strong> computationsimple. <strong>An</strong>o<strong>the</strong>r possible choice that has <strong>the</strong> same computationalcomplexity is F ˆe x … xm‡1 y nm‡1 †.2.2 Parametric Representation <strong>of</strong> a CurveA curve in <strong>the</strong> x Ð y plane can be represented in terms <strong>of</strong> anarbitrary parameter t as r…t† ˆ…x…t†;y…t††. If <strong>the</strong> curve isclosed, as discussed in <strong>the</strong> paper, <strong>the</strong> functions x…t† and y…t†are periodic.When <strong>the</strong> curve C is represented as above, r…t† can beapproximated efficiently as linear combinations <strong>of</strong> somebasis functions, which makes <strong>the</strong> representation compactand easy to handle.In this paper, we mainly focus on <strong>the</strong> representation <strong>of</strong><strong>the</strong> function vector r…t† in a scaling function basis asr…t† ˆ X1kˆ1b k '…t k†:Here, b k denotes <strong>the</strong> sequence <strong>of</strong> vector coefficients givenby b k ˆ…c k ;d k †. If <strong>the</strong> period, M, is an integer, we haveb k ˆ b k‡M . This reduces <strong>the</strong> infinite summations towherer…t† ˆXM1kˆ0' p …t† ˆ X1kˆ1b k ' p …t k†;'…t k:M†:In <strong>the</strong> context <strong>of</strong> wavelets, ' is called <strong>the</strong> scaling function; itsatisfies <strong>the</strong> two-scale difference equation'…t† ˆXh…k†'…2t k†;…7†k…3†…4†…5†…6†Fig. 1. Example: A polygon and its parametric representation.where h…k† is <strong>the</strong> mask <strong>of</strong> <strong>the</strong> corresponding refinementfilter [14]. The scaling function representation enables us tohave local control <strong>of</strong> <strong>the</strong> contour, which is desirable in manyapplications. It also permits a multiresolution representation<strong>of</strong> <strong>the</strong> curve [9], [17]. Moreover, <strong>the</strong> scaling functionrepresentation is affine-invariant; an affine trans<strong>for</strong>mation<strong>of</strong> <strong>the</strong> curve is achieved simply by trans<strong>for</strong>ming <strong>the</strong>coefficient vector b k ;kˆ 0; 1; ...;M 1. This is because <strong>of</strong><strong>the</strong> linearity <strong>of</strong> <strong>the</strong> representation and <strong>the</strong> partition <strong>of</strong> unitycondition:X 1kˆ1'…t k† ˆ1;which is satisfied by all valid scaling functions in wavelet<strong>the</strong>ory. Among <strong>the</strong> scaling functions, a case <strong>of</strong> specialinterest is ' ˆ n , where n is <strong>the</strong> causal B-spline <strong>of</strong> degree n[18] defined by its Fourier trans<strong>for</strong>m^ s …!† ˆ 1 s‡1 ej!: …9†j!This yields spline curves which are frequently used incomputer graphics [19] and computer vision [6], [20], [21].We now consider a simple example to illustrate this kind<strong>of</strong> curve representation. Given in Fig. 1 is a polygon and itsparametric representation. The dotted lines show <strong>the</strong> linear…8†


JACOB ET AL.: AN EXACT METHOD FOR COMPUTING THE AREA MOMENTS OF WAVELET AND SPLINE CURVES 635B-spline basis functions, 1 …t k† (tent function), multipliedby <strong>the</strong> corresponding coefficients.The description <strong>of</strong> C in <strong>the</strong> scaling function basis isequivalent to a periodized wavelet representation [9]. Thisimplies that, if we have a wavelet description <strong>of</strong> <strong>the</strong> curve,<strong>the</strong> scaling function coefficients at any scale can be obtainedfrom <strong>the</strong> wavelet coefficients using <strong>the</strong> fast reconstructionequation described in [22]. Hence, <strong>the</strong> <strong>the</strong>ory is sufficientlygeneral to include <strong>the</strong> wavelet curve descriptors as well.The representation <strong>of</strong> <strong>the</strong> curves in a sinc basis also fallsin this class, as sinc is a valid scaling function. Thedescription <strong>of</strong> <strong>the</strong> curve in <strong>the</strong> sinc basis as (5) is notefficient, as sinc has an infinite mask unlike most <strong>of</strong> <strong>the</strong>widely used scaling functions. It is well known (c.f. [23])that <strong>the</strong> sinc interpolation <strong>of</strong> a periodic signal can be<strong>for</strong>mulated into a numerically stable and efficient expressionasr…t† ˆ XLkˆLb k expj2kt ; …10†Mwhere 2L ‡ 1 ˆ M, assuming M to be odd. A similarexpression is obtained <strong>for</strong> even M as well. Here, b k is <strong>the</strong>discrete Fourier trans<strong>for</strong>m <strong>of</strong> <strong>the</strong> vector sequence r…k†. Notethat (10) provides <strong>the</strong> Fourier series description <strong>of</strong> <strong>the</strong>curve, which is frequently used <strong>for</strong> <strong>the</strong> representation <strong>of</strong>closed curves [24], [25].2.3 Differentiation <strong>of</strong> Scaling FunctionsWe will use <strong>the</strong> property that <strong>the</strong> kth derivative <strong>of</strong> a scalingfunction ' can be expressed as [26]' …k† …x† ˆ k ' fkg …x†;…11†where ' fkg …x† denotes <strong>the</strong> scaling function whose mask isgiven by H fkg 2 k…z† ˆ1 ‡ z 1 H…z†;H…z† is <strong>the</strong> mask <strong>of</strong> '. denotes <strong>the</strong> backward differenceoperator, defined as …x† ˆ…x†…x 1†.The relation (11) follows from <strong>the</strong> fact that any mth orderscaling function can be written as^'…!† ˆ 1 mej!^…!†;j!|‚‚‚‚‚‚‚‚{z‚‚‚‚‚‚‚‚}^ m1 …!†where is a refinable distribution which doesnot satisfy<strong>the</strong>mHpartition <strong>of</strong>unity.The mask <strong>of</strong> ' is H…z† ˆ 1‡z12…z†.m1‡zNote that12 is <strong>the</strong> mask <strong>of</strong> m1 and H <strong>the</strong> mask <strong>of</strong> .Differentiating ' with respect to x, k number <strong>of</strong> times(k m) yields' …k† …x† ! F … j! † k ^'…!† ˆ 1 e j! k 1 e j! mk^…!†j!|‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚{z‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚}^' fkg …!†!F 1 k ' fkg …x†: …12†Thus, <strong>the</strong> mask <strong>of</strong> ' fkg …x† isH fkg …z† ˆ 1 ‡ mk z12 kH …z† ˆ21 ‡ z 1 H…z†:3 COMPUTATION OF THE MOMENTS OF AN AREABOUNDED BY A PARAMETRIZED CURVETo facilitate <strong>the</strong> understanding <strong>of</strong> our <strong>method</strong>, we first givea detailed derivation <strong>of</strong> <strong>the</strong> <strong>for</strong>mula <strong>for</strong> <strong>the</strong> <strong>area</strong> <strong>of</strong> <strong>the</strong>region bounded by <strong>the</strong> curve. We <strong>the</strong>n extend our<strong>for</strong>mulation to <strong>the</strong> general case.3.1 Computation <strong>of</strong> <strong>the</strong> AreaFor <strong>the</strong> parametric representation <strong>of</strong> <strong>the</strong> curve, <strong>the</strong> <strong>area</strong> <strong>of</strong><strong>the</strong> region is given byZ MI 0;0 ˆ y…t† dx…t† dt:…13†0 dtWhen <strong>the</strong> curve is described in a scaling function basis as in(5), we havewhereXM1 Z MI 0;0 ˆ d i c ji;jˆ00' p …t i†' 0 p …t j†dt; …14†' 0 p …t† ˆd' p…t†:dtSubstituting <strong>for</strong> ' 0 p…t† from (6), we getXM1 Z 1I 0;0 ˆ d i c j ' p …t i†' 0 …t j†dt;i;jˆ0which is equivalent to1…15†XM1 Z 1I 0;0 ˆ d i c j ' p …t i ‡ j†' 0 …t†dti;jˆ0 1|‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚{z‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚}g p 0 …ij† : …16†Again, substituting <strong>for</strong> ' p from (6), we get <strong>the</strong> kernel g p 0…l† as<strong>the</strong> M periodized version <strong>of</strong>g 0 …l† ˆZ 11' 0 …t†'…t l†dt…17†as g p 0…l† ˆP1kˆ1 g 0…l ‡ k:M†. With <strong>the</strong> simplification (11),<strong>the</strong> above equation becomesandf 0 …x† ˆg 0 …l† ˆf 0 …l†;Z 11' f1g …t†'…t x†dt:…18†…19†Note that, if '…t† ˆ'… t†, <strong>the</strong>n f 0 …x† can be written as <strong>the</strong> convolution ' f1g ' … ‡ x†. We prefer to represent <strong>the</strong>kernel g p in terms <strong>of</strong> f due to its nice properties, discussedlater.


636 <strong>IEEE</strong> TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 23, NO. 6, JUNE 2001Z 1Substituting <strong>for</strong> ' 0 p …t† from (6), we get Both <strong>the</strong>se properties toge<strong>the</strong>r imply 2……m ‡ n ‡ 1†!†relations, which are used to accelerate <strong>the</strong> computationFor <strong>the</strong> example given in Fig. 1, we haveI m;n ˆ 1 XXc k c ‰mŠ ‰n‡1Ši d j ' p …t i 1 † ...g 0 …l† ˆ 0 1 n ‡ 1…l ‡ 2† ˆ… 2 k2R i2R m‡11…25†j2R†…l ‡ 2†g 0 : …0:5; 0; 0:5†; l 2f1; 0; 1g;' p …t i m †' p …t j 1 † ...' p …t j n‡1 †' 0 …t k†dt:where n is <strong>the</strong> causal B-spline function <strong>of</strong> degree n. The integral in <strong>the</strong> above equation is equivalent toRNow, <strong>for</strong> <strong>the</strong> polygon, c…k† : …1; 1; 6; 8; 7; 4† and d…k† :11 '0 …t†' p …t‡ki 1 †...' p …t‡ki m †' p …t‡kj 1 †...' p …t‡kj n‡1 †dt : …26†|‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚{z‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚‚}…1; 6; 8; 5; 1; 0†. Hence, by (16), we haveg p m‡n …ik;jk†I 0;0 ˆ 1 h…6; 8; 5; 1; 0; 1†; …5; 7; 1; 4; 6; 3†iHence, <strong>the</strong> …m; n†th order moment is2ˆ 42 units:I m;n ˆ 1 XXc k c ‰mŠ i d ‰n‡1Š j g pn ‡ 1m‡n…i k; j k†: …27†k2R i2RHere, hx 1 ;x 2 i stands <strong>for</strong> <strong>the</strong> `2 inner product given byj2RPk x 1…k†x 2 …k†.tu3.2 General FormulaAs in <strong>the</strong> case <strong>of</strong> <strong>the</strong> <strong>area</strong>, <strong>the</strong> kernel g p is obtained by <strong>the</strong>Having shown how to compute <strong>the</strong> <strong>area</strong>, we proceed on to M-periodization <strong>of</strong>Z<strong>the</strong> general case. The <strong>for</strong>mula <strong>for</strong> <strong>the</strong> computation <strong>of</strong> <strong>the</strong>1g m‡n …k† ˆ ' 0 …t†'…t k 1 †::'…t k m‡n‡1 †:dt;general <strong>moments</strong> are given by <strong>the</strong> following <strong>the</strong>orem:1…28†Theorem 1. Let C be a closed curve in <strong>the</strong> x-y plane represented where k 2 Z m‡n‡1 . Expressing ' 0 in terms <strong>of</strong> ' f1g , we getin <strong>the</strong> parametric <strong>for</strong>m in a periodized scaling function basis asg m‡n …k† ˆf m‡n …k†f m‡n …k 1†; …29†(4). Then, <strong>the</strong> …m; n†th order <strong>area</strong> moment <strong>of</strong> <strong>the</strong> region S,wherebounded by <strong>the</strong> curve C, given byZZ1I m;n ˆ x m y n fdxdy <strong>for</strong> m; n 0 …20† m‡n …x† ˆ ' f1g …t†'…t x 1 †::'…t x m‡n‡1 †dt; …30†1Swhere x ˆ…xcan be computed as1 ;x 2 ...;x m‡n‡1 †2 R m‡n‡1 . The kernel f hasmany interesting properties, which are discussed next.I m;n ˆ 1 XXc k c ‰mŠ i d ‰n‡1Š j g pn ‡ 1m‡n…i k; j k†; …21† 3.3 Properties <strong>of</strong> <strong>the</strong> KernelÐfk2R i2R m‡1j2R nwhere R is <strong>the</strong> integer range ‰0...M 1Š. The kernel g p m‡n in(21) isZ 11. Finite Support. As <strong>the</strong> kernel is an integral <strong>of</strong>products <strong>of</strong> <strong>the</strong> translates <strong>of</strong> finitely supportedfunctions, it has a finite support as well. If <strong>the</strong>scaling function is continuous and has a supportg p m‡n…k† ˆ ' 0 …t† ' p …t k 1 † ...' p …t k m‡n‡1 † dt: …22† ‰0;NŠ, <strong>the</strong>n <strong>the</strong> kernel will be supported on <strong>the</strong>1integer points in <strong>the</strong> intervalHere, c ‰mŠ stands <strong>for</strong> <strong>the</strong> m-times tensor product 1 c I ˆ‰N ‡ 1;N 2Š...c ... c and i k denotes <strong>the</strong> sequence‰N ‡ 1;N 2Š‰N ‡ 1;N 2Š:…31†…i 1 k; i 2 k; ...i m‡1 k†:Pro<strong>of</strong>. For a parametric curve, <strong>the</strong> evaluation <strong>of</strong> <strong>the</strong> …m; n†thorder moment given by (20) can be reduced to2. Symmetry. The fact that <strong>the</strong> kernel is obtained from<strong>the</strong> integration <strong>of</strong> similar translated scaling functionsintroduces a lot <strong>of</strong> symmetry. As (30) is symmetricI m;n ˆ 1 Z Mx m …t†y n‡1 …t† dx…t†with respect to <strong>the</strong> parameters k 1 ;k 2 ;::, interchanging<strong>the</strong>m will not affect <strong>the</strong> value <strong>of</strong> <strong>the</strong> kernel. Thisdt …23†n ‡ 1 0dtimpliesby (3). When <strong>the</strong> curve is described in a scaling functionf…k† ˆf… i …k††;…32†basis, we havewhere i indicates all possible …m ‡ n ‡ 1†! permutationoperators. In addition, if <strong>the</strong> scaling functionsI m;n ˆ 1 XXZ Mc k c ‰mŠ ‰n‡1Ši d j ' p …t i 1 † ...n ‡ 1k2R i2R m‡10are symmetric as in <strong>the</strong> case <strong>of</strong> splines, we have…24†j2R n' p …t i m †' p …t j 1 † ...' p …t j n‡1 †' 0 p …t k†dt:f…k† ˆf…k†:…33†1. c ‰0Š is defined as <strong>the</strong> neutral element c ‰0Š c ‰mŠ ˆ c ‰mŠ .<strong>of</strong> <strong>the</strong> kernel as well as <strong>the</strong><strong>moments</strong>.


JACOB ET AL.: AN EXACT METHOD FOR COMPUTING THE AREA MOMENTS OF WAVELET AND SPLINE CURVES 6373. Two-Scale Relation. We now show that <strong>the</strong> kernelsatisfies a two-scale relation, which is <strong>the</strong> key to ourcomputational approach. This property follows from<strong>the</strong> fact that <strong>the</strong> scaling functions '…t† and ' f1g …t†,from which <strong>the</strong> kernel is derived, satisfy two-scalerelations. If we consider (30) and rewrite <strong>the</strong> ' and' f1gin terms <strong>of</strong> <strong>the</strong> corresponding two-scale relations(cf. (7)), we getf m‡n …k† ˆXl2 Z m‡1 H m‡n …l†:f m‡n …2k l†;…34†where k 2 Z m‡1 . The mask H in <strong>the</strong> above equationisXH m …l 1 ;l 2 ; ::; l m †ˆ1h 1 …k†:h…k l 1 †::h…k l m †:2k…35†The z-trans<strong>for</strong>m <strong>of</strong> <strong>the</strong> mask is given byH m …z 1 ;z 2 ; ::; z m †ˆ12 H 1… Q mkˆ1 z k† Ymkˆ1H…z 1k †: …36†It is this property that enables us to compute <strong>the</strong>kernels <strong>exact</strong>ly, by solving a linear system <strong>of</strong>equations. This technique, which is discussed later,is analogous to <strong>the</strong> computation <strong>of</strong> <strong>the</strong> integer (ordyadic rational) samples <strong>of</strong> a scaling function from<strong>the</strong> transition operator [14].Note that a scaling relation similar to (34) wasalso considered by ma<strong>the</strong>maticians in <strong>the</strong> context <strong>of</strong><strong>the</strong> wavelet-Galerkin <strong>method</strong> <strong>for</strong> <strong>the</strong> computation <strong>of</strong>integrals involving products <strong>of</strong> scaling functions and<strong>the</strong>ir derivatives [27], [28]. The work <strong>of</strong> Dahmen andMiccheli is essentially <strong>the</strong>oritical; Restrepo and Leafconcentrated on numerical issues and proposed asolution which is equivalent to <strong>the</strong> computation <strong>of</strong>our kernel g m instead <strong>of</strong> f m . This slightly complicates<strong>the</strong> approach and also increases <strong>the</strong> dimensionality<strong>of</strong> <strong>the</strong> problem; this issue is discussed fur<strong>the</strong>r inSection 5.1.The above mentioned properties imply that <strong>the</strong> kernelcan be computed <strong>exact</strong>ly <strong>for</strong> any finitely supported scalingfunction, as discussed in Section 5. In <strong>the</strong> next section, wewill give some examples <strong>for</strong> <strong>the</strong> kernels when <strong>the</strong> scalingfunctions are B-splines.3.4 Examples with SplinesSplines possess nice approximation properties. The B-splineshave <strong>the</strong> maximum approximation order among <strong>the</strong> class <strong>of</strong>functions that satisfy a two-scale relation with a givensupport. Hence, <strong>the</strong>y give better local control <strong>of</strong> <strong>the</strong> contour.Moreover, <strong>the</strong>y are symmetric, which facilitates <strong>the</strong> computation<strong>of</strong> <strong>the</strong> kernel and <strong>moments</strong> as discussed be<strong>for</strong>e. So, it isworthwhile to analyze <strong>the</strong> properties <strong>of</strong> <strong>the</strong> kernels <strong>for</strong> aspline representation <strong>of</strong> <strong>the</strong> curve. For <strong>the</strong> results used in thissection, refer to [18].We consider causal B-splines, as <strong>the</strong>y satisfy a two-scalerelation <strong>for</strong> all orders. The refinement filter <strong>for</strong> a B-spline <strong>of</strong>degree n is <strong>the</strong> binomial filterh…k† ˆ 1 n ‡ 12 n : …37†kIf we choose s , a B-spline <strong>of</strong> degree s, as ', <strong>the</strong>n' f1g ˆ s1 ; that is a spline <strong>of</strong> degree s 1. Hence, <strong>the</strong>kernel f as given by (30) is a box spline [29] sampled at <strong>the</strong>integers. In particular,f 0 …k† ˆ 2s …k ‡ s ‡ 1†:…38†The spline functions have a closed-<strong>for</strong>m representation in<strong>the</strong> Fourier domain, which <strong>the</strong> kernels also inherit. Bytaking <strong>the</strong> continuous Fourier trans<strong>for</strong>m <strong>of</strong> (30), when <strong>the</strong>scaling function is a B-spline, we get^f s n …!†; ! 2 Zn ˆ ^ s1 …j!j† Ynkiˆ1^ s …! i †;…39†where j!j stands <strong>for</strong> P njˆ1 ! j. By using Poisson's <strong>for</strong>mulaX^f n s 1 X…! ‡ 2k† ˆ fn s 2…k†e2j!k ; …40†we get <strong>the</strong> discrete Fourier trans<strong>for</strong>m <strong>of</strong> <strong>the</strong> kernel as <strong>the</strong>2-periodized version <strong>of</strong> (39).We give some examples <strong>of</strong> kernels <strong>for</strong> <strong>the</strong> computation <strong>of</strong><strong>the</strong> first three <strong>moments</strong> when we have a linear splinerepresentation. For linear splines, <strong>the</strong> kernel f m1…k 1 ;k 2 ; ...;k m † is supported in <strong>the</strong> interval ‰1; 0Š‰1; 0Š ...‰1; 0Š. The kernels arekf 0 …k 1 †; k 1 2f1; 0g : 1 ‰1 1Š; …41†2f 1 …k 1 ;k 2 †; k 1 ;k 2 2f1; 0g : 1 6 1 2; …42†2 18 f 2 …1;k 2 ;k 3 †; k 2 ;k 3 2f1; 0g : 1 12 1 1>:1 1…43†It is interesting to see that <strong>the</strong> computation <strong>of</strong> <strong>the</strong> <strong>moments</strong>using <strong>the</strong> linear spline kernel is <strong>the</strong> same as when <strong>the</strong>polygon is triangulated in a specified way and <strong>the</strong> <strong>moments</strong><strong>of</strong> individual triangles added up as in [11].We also give <strong>the</strong> kernel f 0 <strong>for</strong> <strong>the</strong> cubic splinerepresentation.1f 0 …k 1 †; k 1 ˆ3; ...2: :‰1; 57; 302; 302; 57; 1Š: …44†720The higher order kernels are omitted due to spaceconstraints. They can be downloaded from http://bigwww.epfl.ch/jacob.4 IMPLEMENTATIONIn this section, we analyze equation (21) and simplify it <strong>for</strong>faster computation. We start with <strong>the</strong> simplest case: <strong>the</strong> <strong>area</strong><strong>of</strong> <strong>the</strong> region.


638 <strong>IEEE</strong> TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 23, NO. 6, JUNE 2001The <strong>area</strong> bounded by <strong>the</strong> curve (cf. (15)) is computed asI 0;0 ˆ XM1c p XN2kkˆ0 lˆN‡1d p k‡l g 0…l†;…45†where g 0 is given by (17). The sequences c p k and dp k areM-periodized versions <strong>of</strong> <strong>the</strong> coefficients c k and d k withrespect to <strong>the</strong> period M. This is simply because convolvinga nonperiodized sequence with a periodized kernel isequivalent to convolving a periodized sequence with anonperiodized kernel. We have also reduced <strong>the</strong> range <strong>of</strong>summation <strong>of</strong> <strong>the</strong> inner sum to N ‡ 1 to N 2, which istypically much less than <strong>the</strong> range 0 to M 1. Similarly, <strong>for</strong><strong>the</strong> higher order <strong>moments</strong> all <strong>the</strong> summations, except <strong>the</strong>outer one, are in <strong>the</strong> range N ‡ 1 to N 2.From (45), we see that <strong>the</strong> computation <strong>of</strong> <strong>the</strong> <strong>area</strong>involves just a filtering operation by g…l† ˆg T …l†, followedby an inner product. This can be written as,I 0;0 ˆhc p ;g T 0 dp i;…46†wherePh:; :i stands <strong>for</strong> <strong>the</strong> inner product hc; di ˆM1kˆ0c…k†d…k†. With a similar notation, <strong>the</strong> computation<strong>of</strong> <strong>the</strong> o<strong>the</strong>r <strong>moments</strong> are given asI m;n ˆ hcp ;g T m‡n …cp‰mŠ d p‰n‡1Š †in ‡ 1…47†ˆ hdp ;g T m‡n …cp‰m‡1Š d p‰nŠ †i: …48†m ‡ 1As <strong>the</strong> …m ‡ n ‡ 1†-D sequence is separable, <strong>the</strong> filteringoperation is much simpler than <strong>the</strong> usual …m ‡ n ‡1†-dimensional filtering.The complexity in <strong>the</strong> computation <strong>of</strong> <strong>the</strong> moment I m;n isM:…2N 2† …m‡n‡2† , without taking <strong>the</strong> symmetries intoaccount. Thus, <strong>for</strong> basis functions with small support andreasonable m and n, <strong>the</strong> complexity is quite managable.5 COMPUTATION OF THE KERNELIn this section, we propose two schemes <strong>for</strong> <strong>computing</strong> <strong>the</strong>kernel. <strong>An</strong> <strong>exact</strong> space domain scheme and an approximateone in <strong>the</strong> Fourier domain.5.1 Exact MethodIn this scheme, we compute <strong>the</strong> kernels in space domainmaking use <strong>of</strong> <strong>the</strong> properties <strong>of</strong> kernels discussed be<strong>for</strong>e.We start with <strong>the</strong> computation <strong>of</strong> f 0 and later extend it to<strong>the</strong> general case. Making use <strong>of</strong> <strong>the</strong> finite support property,<strong>the</strong> two-scale relation (34) can be rewritten in <strong>the</strong> matrix<strong>for</strong>m as,A 0 :f 0 ˆ f 0 ;…49†where A 0 is <strong>the</strong> square matrix with coefficients ‰A 0 Š k;l ˆH 0 …2k l† and f 0 is <strong>the</strong> vector whose elements are f 0 …n†. As<strong>the</strong> support <strong>of</strong> f 0 is ‰N ‡ 1;N 2Š, <strong>the</strong> indices <strong>of</strong> A 0 runfrom N ‡ 1 to N 2.It can be seen from (49) that f 0 is an eigen-vector <strong>of</strong> <strong>the</strong>matrix A 0 , with eigen-value 1. Solving <strong>for</strong> f 0 is equivalent tosolving <strong>for</strong> a vector which falls in <strong>the</strong> nullspace <strong>of</strong> …A 0 I†,where I is <strong>the</strong> identity matrix. Since f 0 6ˆ 0, A 0 must have<strong>the</strong> eigen-value 1, which is in general single. This providesf 0 up to a constant which is fur<strong>the</strong>r set by <strong>the</strong> normalizationidentityXf 0 …k† ˆ1;…50†kwhich can be seen from (19). This is because <strong>the</strong> function '…x†has at least an approximation order <strong>of</strong> one [14], which impliesPk '…x ‡ k† ˆ1. One <strong>of</strong> <strong>the</strong> equations in …A 0 I†:f 0 ˆ 0 canbe substituted <strong>for</strong> by <strong>the</strong> (50) to yield <strong>the</strong> system <strong>of</strong> equationsgiven byB:f 0 ˆ y;…51†B is <strong>the</strong> matrix obtained by substituting one <strong>of</strong> <strong>the</strong> rows <strong>of</strong>…A 0 I† with <strong>the</strong> row vector ‰1; 1; ...; 1Š and y is given by‰0; 0; 0...; 0; 0; 1Š T c.f [30]. Now, B is a full rank matrix and,hence, <strong>the</strong> eigen-vector f 0 can be solved by matrix inversion.To represent <strong>the</strong> two-scale relations <strong>of</strong> <strong>the</strong> higher orderkernels in <strong>the</strong> matrix <strong>for</strong>m, we introduce a one-to-onefunction : ‰N ‡ 1;N 2Š m 7!‰0; …2N 2† m 1Š. Usingthis function, (34) can be rewritten asf m … 1 …k†† ˆ…2N2†Xm‡1 1lˆ0 H m 2 1 …k† 1 …l† fm 1 …l† ;which is a linear system <strong>of</strong> equations. This can be written in<strong>the</strong> matrix <strong>for</strong>m asA m f m ˆ f m ;…52†where ‰A m Š i;j ˆ H m … 2 1 …i† 1 …j†† and f m …i† ˆf … 1 …i††.This equation is <strong>of</strong> <strong>the</strong> same <strong>for</strong>m as (49) and can be solvedinP<strong>the</strong> same way, with <strong>the</strong> normalization constrainti f m…i† ˆ1.Let us now compare our computational solution with <strong>the</strong><strong>method</strong> developed <strong>for</strong> <strong>computing</strong> g m in <strong>the</strong> context <strong>of</strong>wavelet-Galerkin approach [27]. For a scaling function <strong>of</strong>support N, <strong>the</strong> kernel g m is zero outside <strong>the</strong> intervalI 0 ˆ‰N ‡ 1;N 1Š...…53†‰N ‡ 1;N 1Š‰N ‡ 1;N 1Š:as compared to f m whose support is given by (31). Thus, <strong>the</strong>direct computation <strong>of</strong> g m involves a linear system with…2N 1† m variables as compared to …2N 2† m <strong>for</strong> f m in ourcase. For 3-dimensional kernels involving cubic splines, weachieve a 40 percent reduction in <strong>the</strong> number <strong>of</strong> equations.As <strong>the</strong> computational complexity in inverting a linearsystem is proportional to <strong>the</strong> third power <strong>of</strong> <strong>the</strong> number <strong>of</strong>equations, this implies a per<strong>for</strong>mance improvement <strong>of</strong>around 5 times. The approach becomes even more rewarding<strong>for</strong> higher order kernels. Moreover, <strong>the</strong> normalizationconstraint (50) that we use to make <strong>the</strong> system full rank ismuch more straight<strong>for</strong>ward than <strong>the</strong> corresponding relation<strong>for</strong> <strong>the</strong> derivative functions.Note that this simplification is covered by Dahmen andMichelli's general <strong>the</strong>ory <strong>for</strong> integrals <strong>of</strong> multidimensionalscaling functions [28]. This is because <strong>the</strong> mask <strong>of</strong> anymth order 1 D scaling function can be always factored asproposed in [28, Corollary 3.3]. In <strong>the</strong> case <strong>of</strong> wavelet-Galerikin integrals, <strong>the</strong> per<strong>for</strong>mance improvement can evenmore substantial depending on <strong>the</strong> number <strong>of</strong> derivatives.


JACOB ET AL.: AN EXACT METHOD FOR COMPUTING THE AREA MOMENTS OF WAVELET AND SPLINE CURVES 6395.2 Approximate Method <strong>for</strong> SplinesBecause <strong>the</strong> spline kernel has a closed-<strong>for</strong>m expression in<strong>the</strong> frequency domain, <strong>the</strong> kernel can be obtained by taking<strong>the</strong> inverse DFT <strong>of</strong> <strong>the</strong> above mentioned Fourier trans<strong>for</strong>m(40) sampled at an appropriate rate; we make use <strong>of</strong> <strong>the</strong>finite support property <strong>of</strong> <strong>the</strong> kernel. As sinc is a decayingfunction, <strong>the</strong> periodization <strong>of</strong> <strong>the</strong> Fourier trans<strong>for</strong>m may beapproximated with an appropriately truncated sum toachieve any desired accuracy. This is because we can havean upper bound <strong>for</strong> <strong>the</strong> error that is a decreasing function <strong>of</strong><strong>the</strong> summation range. Moreover, <strong>the</strong> symmetries <strong>of</strong> <strong>the</strong>kernel discussed be<strong>for</strong>e may be used <strong>for</strong> <strong>the</strong> efficientcomputation <strong>of</strong> <strong>the</strong> box spline kernels as in [31].However, this technique, besides being approximate, canbe used only <strong>for</strong> scaling functions that have a closed <strong>for</strong>mexpression in <strong>the</strong> frequency domain, i.e., splines in practice.This scheme may be useful to precompute <strong>the</strong> spline kernels<strong>for</strong> very high order <strong>moments</strong>, where <strong>the</strong> <strong>exact</strong> scheme canbe computationally expensive.6 COMPUTATION OF THE AREA MOMENTS USINGRIEMANN SUMS<strong>An</strong> alternate approach to compute <strong>the</strong> <strong>moments</strong> is toapproximate <strong>the</strong> integral (3) by a Riemann sum:1MP1I m;n ˆ…n ‡ 1†P : X‰x int …l=P †Š m :‰y int …l=P †Š n‡1 :‰x 0 int …l=P †Š;lˆ0…54†where P is an appropriate oversampling factor. We show inthis section that this quadrature <strong>for</strong>mula is <strong>exact</strong> when <strong>the</strong>curves are described in a sinc basis. For o<strong>the</strong>r representations,it can be used <strong>for</strong> <strong>the</strong> approximate computation <strong>of</strong>higher order <strong>moments</strong>.6.1 Sinc Representation <strong>of</strong> <strong>the</strong> CurveA curve represented in a sinc basis also falls into <strong>the</strong>framework <strong>of</strong> Theorem 1 because sinc…x† is a valid scalingfunction. However, <strong>computing</strong> <strong>the</strong> <strong>moments</strong> as described inSection 4 is expensive as <strong>the</strong> mask <strong>of</strong> <strong>the</strong> sinc function is notfinitely supported. We remind <strong>the</strong> reader that <strong>the</strong> representation<strong>of</strong> a periodic signal in <strong>the</strong> sinc basis is equivalentto <strong>the</strong> Fourier representation as seen in (10).In this particular case, <strong>the</strong> <strong>moments</strong> can be computed<strong>exact</strong>ly and more efficiently using (54), where <strong>the</strong> oversamplingfactor, P , is any integer greater than m‡n‡22.Proposition 1. The quadrature <strong>for</strong>mula (54) is <strong>exact</strong> <strong>for</strong> <strong>the</strong> sincrepresentation provided that P d m‡n‡22e.The continuously defined functions x int …t† and y int …t† areobtained by interpolating <strong>the</strong> sample values <strong>of</strong> <strong>the</strong> curve at<strong>the</strong> integers, using <strong>the</strong> periodized sinc function. Thecomputation is <strong>exact</strong> because we implicitly assume that<strong>the</strong> functions x…t† and y…t† are bandlimited functions, withbandwidth B ˆ 2.Pro<strong>of</strong>. The integral (3) can be considered as an L 2 …0;M† innerproduct <strong>of</strong> two functions, which are d m‡n‡22e and b m‡n‡22cfold 2 products <strong>of</strong> <strong>the</strong> corresponding band-limited2. bxc and dxe denote <strong>the</strong> floor and <strong>the</strong> ceil operators, operating on afraction x to yield <strong>the</strong> lower and upper integers that bound x.functions. Hence, <strong>the</strong>y are bandlimited by B 0 ˆBd m‡n‡22e and B 00 ˆ Bb m‡n‡22c, respectively. So, <strong>the</strong>sefunctions are <strong>exact</strong>ly represented in <strong>the</strong> basis fsinc…Pxk†; 8k 2 Zg, where 2P B 0 . Because <strong>the</strong> sinc basis isorthogonal, <strong>the</strong> L 2 …0;M† inner product is equivalent to <strong>the</strong>`2 …0;MP1† inner product. Hence, it is sufficient tocompute <strong>the</strong> discrete summation instead <strong>of</strong> <strong>the</strong> integral.Finally, <strong>the</strong> sinc function is interpolating, so that <strong>the</strong>coefficients <strong>of</strong> <strong>the</strong> basis functions are <strong>the</strong> resampledcurve values and, hence, <strong>the</strong> result (54).tuUsing <strong>the</strong> equivalence <strong>of</strong> <strong>the</strong> sinc and <strong>the</strong> Fourierrepresentations, we can compute <strong>the</strong> interpolated samplesefficiently with a MP point inverse FFT <strong>of</strong> <strong>the</strong> Fouriercoefficients c k and d k .We will compare <strong>the</strong> sinc moment estimator with <strong>the</strong>scaling-function-based moment estimator in <strong>the</strong> next section.One disadvantage <strong>of</strong> <strong>the</strong> Fourier(sinc) representation<strong>of</strong> curves is <strong>the</strong> loss <strong>of</strong> local control property that we werehaving with <strong>the</strong> finitely supported scaling functions.The complexity in <strong>the</strong> computation <strong>of</strong> <strong>the</strong> <strong>moments</strong>in this scheme is MP…3 log…MP†‡…m ‡ n ‡ 2††. Here,3MP log…MP† is <strong>the</strong> cost <strong>of</strong> <strong>the</strong> inverse FFT <strong>of</strong> <strong>the</strong>sequences c k , d k , and k:c k , and …m ‡ n ‡ 2†MP correspondsto <strong>the</strong> multiplications.6.2 Spline Representation <strong>of</strong> <strong>the</strong> CurveThe quadrature <strong>for</strong>mula (54) is also applicable to <strong>the</strong> splinerepresentation, provided that <strong>the</strong> functions x int …t† and y int …t†are obtained by interpolating <strong>the</strong> integer sample values,using <strong>the</strong> corresponding B-spline functions. This scheme isno longer <strong>exact</strong>, but it may be a viable alternative <strong>for</strong><strong>computing</strong> <strong>the</strong> higher order <strong>moments</strong>. The necessarycondition <strong>for</strong> <strong>the</strong> computation to be reliable is that <strong>the</strong>Fourier trans<strong>for</strong>m <strong>of</strong> <strong>the</strong> B-spline function is essentiallybandlimited to 2P, where P is <strong>the</strong> oversampling factor.The error in <strong>the</strong> <strong>moments</strong> computed with <strong>the</strong> approximate<strong>method</strong> is, thus, proportional to <strong>the</strong> residual energy <strong>of</strong> <strong>the</strong>B-spline function in <strong>the</strong> corresponding outband. As <strong>the</strong>Fourier trans<strong>for</strong>m <strong>of</strong> <strong>the</strong> B-spline is a decaying function <strong>of</strong><strong>the</strong> frequency, <strong>the</strong> error will be a decaying function <strong>of</strong> P aswell. Thus, any desirable accuracy may be achieved bychoosing P sufficiently large.The complexity <strong>of</strong> <strong>the</strong> spline quadrature <strong>for</strong>mula is O…M…m ‡ n ‡ 2†…m ‡ n ‡ 2 ‡ 3N†P†, where M…m ‡ n ‡ 2†P is<strong>the</strong> total number <strong>of</strong> resampled points. The evaluation <strong>of</strong> <strong>the</strong>spline representation requires N multiplications to obtainone resampled point from <strong>the</strong> corresponding B-splinerepresentation. Then, <strong>the</strong> computation <strong>of</strong> <strong>the</strong> discrete sumcosts m ‡ n ‡ 2 multiplications per resampled point. Interestingly,<strong>the</strong> approximate scheme will give better results <strong>for</strong>higher order splines as <strong>the</strong>se functions will becomebandlimited as <strong>the</strong> order tends to infinity [32].7 EXPERIMENTS AND RESULTSIn this section, we compare <strong>the</strong> new technique with <strong>the</strong>existing ones: approximation using polygons and rasterizing.We first consider <strong>the</strong> <strong>exact</strong> scheme proposed inSection 4. We try to estimate <strong>the</strong> parameters <strong>of</strong> a known


640 <strong>IEEE</strong> TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 23, NO. 6, JUNE 2001Fig. 2. Comparison <strong>of</strong> moment estimators.ellipse and choose <strong>the</strong> relative error in <strong>the</strong> parameters as <strong>the</strong>criterion <strong>of</strong> comparison.Our preferred choice is to represent <strong>the</strong> curve in a cubicB-spline basis due to its nice approximation properties andminimum curvature properties. To compare it with <strong>the</strong>approximation <strong>of</strong> <strong>the</strong> region as a polygon, <strong>the</strong> ellipse issampled uni<strong>for</strong>mly and <strong>the</strong> samples are interpolated using<strong>the</strong> two techniques (linear and cubic splines). The averagerelative error in <strong>the</strong> three centered second order <strong>moments</strong>versus <strong>the</strong> number or samples are plotted in Fig. 2. It can beseen that <strong>the</strong> relative error is much smaller <strong>for</strong> <strong>the</strong> cubicspline interpolation even at low sampling rates and that itexhibits a faster decay.In <strong>the</strong> traditional scanning approach, <strong>the</strong> ellipse isscanned along <strong>the</strong> x and y axes with a step size and <strong>the</strong>monomials are computed at <strong>the</strong> grid points assigned to <strong>the</strong>interior <strong>of</strong> <strong>the</strong> curve. Fig. 3 shows <strong>the</strong> pdecay <strong>of</strong> <strong>the</strong> averageArearelative error <strong>for</strong> an ellipse versus <strong>for</strong> three different4. Estimated ellipse <strong>for</strong> a real image.orientations. The plot clearly shows <strong>the</strong> dependence <strong>of</strong> <strong>the</strong>accuracy on <strong>the</strong> orientation <strong>of</strong> <strong>the</strong> ellipse.It can be seen that to achieve a relative error <strong>of</strong>0:1 percent <strong>the</strong> interior <strong>of</strong> <strong>the</strong> ellipse has to be sampled atabout 3,600 points, whereas to achieve <strong>the</strong> same error using<strong>the</strong> cubic spline interpolation we need only around ninepoints on <strong>the</strong> curve. In comparison, <strong>the</strong> polygon <strong>method</strong>(linear spline) requires more than 40 samples to have asimilar error. More interesting is <strong>the</strong> case when <strong>the</strong> interior<strong>of</strong> <strong>the</strong> ellipse has to be sampled at about 2:5 10 5 points toachieve an error <strong>of</strong> 0:002 percent while <strong>the</strong> cubic splinesrequire only 25 samples to achieve <strong>the</strong> same accuracy. InFig. 4, we show <strong>the</strong> ellipse corresponding to <strong>the</strong> secondorder <strong>moments</strong> <strong>of</strong> <strong>the</strong> central structure in <strong>the</strong> image. Thecontour <strong>of</strong> <strong>the</strong> object was estimated using a snake where<strong>the</strong> curve was represented parametrically in terms <strong>of</strong> cubicB-splines; <strong>the</strong> <strong>moments</strong> are computed using our algorithm.Note that <strong>the</strong> fit is astonishingly good.Fig.Fig. 3. Variation <strong>of</strong> error versus 1 in a raster scan moment estimator.Fig. 5. Shape <strong>of</strong> corpus callosum represented using a cubic B-splinecurve with 20 knot points.


JACOB ET AL.: AN EXACT METHOD FOR COMPUTING THE AREA MOMENTS OF WAVELET AND SPLINE CURVES 641Fig. 6. Comparison <strong>of</strong> Fourier Estimator with cubic spline estimator.Having observed that <strong>the</strong> cubic spline estimator per<strong>for</strong>msbetter than <strong>the</strong> polygon <strong>method</strong>, we now compare itwith <strong>the</strong> Fourier (sinc) technique proposed in Section 6. It isnot fair to use <strong>the</strong> ellipse as we did be<strong>for</strong>e because it can berepresented <strong>exact</strong>ly in a Fourier series representation withL ˆ 2. So, we choose <strong>the</strong> real shape <strong>of</strong> corpus callosumshown in Fig. 5, represented in a linear spline basis with39 knot points as <strong>the</strong> reference shape. This shape wasresampled at different rates and <strong>the</strong>se points were interpolatedusing cubic B-spline and Fourier representations,respectively. The <strong>moments</strong> <strong>of</strong> <strong>the</strong> corresponding curveswere calculated using <strong>the</strong> respective algorithms discussedbe<strong>for</strong>e. Fig. 6 shows <strong>the</strong> decay <strong>of</strong> <strong>the</strong> relative error with <strong>the</strong>resampling rate <strong>for</strong> both representations. We observe that<strong>the</strong> spline estimator is better than <strong>the</strong> Fourier estimator <strong>for</strong>small sampling rates, while <strong>the</strong> Fourier estimator per<strong>for</strong>msbetter at very high sampling rates (typically more than eighttimes <strong>the</strong> number <strong>of</strong> points used <strong>for</strong> <strong>the</strong> description <strong>of</strong> C). In<strong>the</strong> example considered, <strong>the</strong> Fourier <strong>method</strong> per<strong>for</strong>msbetter when <strong>the</strong> shape <strong>of</strong> corpus callosum is representedwith around 312 samples.To evaluate <strong>the</strong> per<strong>for</strong>mance <strong>of</strong> <strong>the</strong> approximate schemeintroduced in Section 6.2, we now consider <strong>the</strong> case where<strong>the</strong> corpus callosum is represented by a cubic B-spline curvewith 20 knot points. The relative error in <strong>the</strong> computation <strong>of</strong><strong>the</strong> second order <strong>moments</strong> by <strong>the</strong> quadrature <strong>for</strong>mula as afunction <strong>of</strong> its relative computational complexity (proportionalto P) is shown in Fig. 7; here, <strong>the</strong> reference <strong>method</strong> is<strong>the</strong> kernel-based computation, which is <strong>exact</strong>. Our resultsindicate that, <strong>for</strong> <strong>the</strong> second order <strong>moments</strong>, <strong>the</strong> error <strong>of</strong> <strong>the</strong>quadrature <strong>for</strong>mula is quite substantial (e.g., 9.4 percent).Thus, it is not advantageous <strong>for</strong> <strong>computing</strong> <strong>the</strong> lower order<strong>moments</strong>. However, <strong>the</strong> quadrature <strong>for</strong>mula will eventuallystart to pay <strong>of</strong>f <strong>for</strong> higher order <strong>moments</strong>, because its costincreases only quadratically with <strong>the</strong> degree as compared toexponentially <strong>for</strong> <strong>the</strong> kernel-based <strong>method</strong>.8 CONCLUSIONIn this paper, we have presented a new approach <strong>for</strong> <strong>the</strong>computation <strong>of</strong> <strong>the</strong> <strong>moments</strong> <strong>of</strong> a curve described in awavelet or scaling function basis. It is especially useful<strong>for</strong> objects detected using parametric snakes. The mainFig. 7. Relative error versus relative computational complexity.advantages <strong>of</strong> <strong>the</strong> proposed scheme over <strong>the</strong> conventional<strong>method</strong>s are:. <strong>the</strong> <strong>exact</strong>ness <strong>of</strong> <strong>the</strong> computation,. its independence <strong>of</strong> <strong>the</strong> orientation <strong>of</strong> <strong>the</strong> shape, and. <strong>the</strong> consistency with <strong>the</strong> snake model and <strong>the</strong> factthat it is <strong>the</strong> most direct <strong>method</strong> available.In addition, <strong>the</strong> <strong>method</strong> is reasonably fast and easy toimplement.We recommend using our <strong>exact</strong> kernel-based approach<strong>for</strong> <strong>computing</strong> <strong>the</strong> lower order <strong>moments</strong> (typicallym ‡ n 2) <strong>for</strong> which <strong>the</strong> kernels are available. For higherorder <strong>moments</strong>, we have proposed a quadrature <strong>for</strong>mulathat approximates <strong>the</strong> continuous integrals with Riemannsums. The latter <strong>method</strong> is <strong>exact</strong> <strong>for</strong> <strong>the</strong> sinc basis functions;o<strong>the</strong>rwise, it can be made as accurate as desirable byresampling <strong>the</strong> model at a finer rate (P sufficiently large).ACKNOWLEDGMENTSThe authors would like to thank <strong>the</strong> anonymousreviewer <strong>for</strong> pointing us to references [28] and [27] on<strong>the</strong> wavelet-Galerkin <strong>method</strong> which deal with <strong>the</strong>computation <strong>of</strong> wavelet related integrals. This workwas supported by <strong>the</strong> Swiss National Science Foundationunder grant 2100-053540.REFERENCES[1] S. Rad, K.C. Smith, and B. Benhabib, ªApplication <strong>of</strong> Moment andFourier Descriptors to <strong>the</strong> Accurate Estimation <strong>of</strong> Elliptical ShapeParameters,º Proc. <strong>IEEE</strong> Int'l Conf. Acoustics, Speech, Signal Process,vol. 4, pp. 2465±2468, 1991.[2] R. Desai, R. Cheng, and H.D. Cheng, ªPattern Recognition byLocal Radial Moments,º Proc. 12th IAPR Int'l Conf. PatternRecognition, 1994.[3] K. Tsirikolias and B.G. Mertzios, ªStatistical Pattern RecognitionUsing Efficient Two-Dimensional Moments with Applications toCharacter Recognition,º Pattern-Recognition, vol. vol. 26, pp. 877±882, 1993.[4] L.X. Shen and Y.L. Sheng, ªNoncentral Image Moments <strong>for</strong>Invariant Pattern Recognition,º Optical Eng., vol. 34, no. 11,pp. 3181±3186, 1995.[5] P. Brigger, J. Hoeg, and M. Unser, ªB-Spline Snakes: A FlexibleTool <strong>for</strong> Parametric Contour Detection,º <strong>IEEE</strong> Trans. Image Process,vol. 9, pp. 1484±1496, Sept. 2000.


642 <strong>IEEE</strong> TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 23, NO. 6, JUNE 2001[6] J.Y. Wang and F.S. Cohen, ª3D Object Recognition and ShapeEstimation from Image Contours Using B-Splines, UnwarpingTechniques and Neural Network,º Proc. <strong>IEEE</strong> Int'l Joint Conf.Neural Networks, 1991.[7] M. Flickner, H. Sawhney, D. Pryor, and J. Lotspeich, ªIntelligentInteractive Image Outlining Using Spline Snakes,º Proc. 28thAsilomar Conf. Signals, Systems, and Computers, 1994.[8] M. Figueiredo, J. Leitao, and A.K. Jain, ªUnsupervised ContourRepresentation and Estimation Using B-Splines and a MinimumDescription Length Criterion,º <strong>IEEE</strong> Trans. Image Process, vol. 9,pp. 1075±1087, 2000.[9] G.C.H. Chuang and J. Kuo, ªWavelet Descriptor <strong>of</strong> Planar Curves:Theory and Applications,º <strong>IEEE</strong> Trans. Image Process, vol. 5, pp. 56±70, 1996.[10] Y. Wang, S.L. Lee, and K. Toraichi, ªMultiscale Curvature BasedShape Representation Using Bspline Wavelets,º <strong>IEEE</strong> Trans. ImageProcess, vol. 8, pp. 1586±1592, 1999.[11] M. Singer, ªA General Approach to Moment Calculation <strong>for</strong>Polygons and Line Segments,º Pattern Recognition, vol. 26,pp. 1019±1028, Jan. 1993.[12] S.F. Bockman, ªGeneralising <strong>the</strong> Formula <strong>for</strong> Areas <strong>of</strong> Polygons toMoments,º Am. Math. Monthly, vol. 96, pp. 131±133, Feb. 1989.[13] N.J.C. Strachan, P. Nesvadba, and A.R. Allan, ªA Method <strong>for</strong>Working Out <strong>the</strong> Moments <strong>of</strong> a Polygon Using an IntegrationTechnique,º Pattern Recognition Letters, vol. 11, pp. 351±354, May1990.[14] G. Strang and T.Q. Nguyen, Wavelets and Filter Banks. Wellesley-Cambridge Press, 1996.[15] M. Vetterli and J. Kovacevic, Wavelets and Subband Coding. PrenticeHall, 1995.[16] C. Fermuller and W. Kropatsch, ªHierarchical Curve Representation,ºProc. 11th IAPR Int'l Conf. Pattern Recognition, 1992.[17] J.P. <strong>An</strong>toine, D. Barache, R.M. Cesar Jr., and L.da. Fontoura Costa,ªShape Characterisation with <strong>the</strong> Wavelet Trans<strong>for</strong>m,º SignalProcessing, vol. 62, pp. 265±290, 1997.[18] M. Unser, ªSplines: A Perfect Fit <strong>for</strong> Signal and Image Processing,º<strong>IEEE</strong> Signal Processing Magazine, vol. 16, pp. 22±38, 1999.[19] R.H. Bartels, J.C. Beatty, and B.A. Barsky, <strong>An</strong> Introduction to Splines<strong>for</strong> Use in Computer Graphics and Geometric Modeling. MorganKauffmann, 1987.[20] Z. Huang and F.S. Cohen, ªAffine-Invariant B-Spline Moments <strong>for</strong>Curve Matching,º <strong>IEEE</strong> Trans. Image Process, vol. 5, pp. 1473±1480,1996.[21] F.S. Cohen and J.Y. Wang, ªModeling Image Curves UsingInvariant 3-D Object Curve Models, a Path to 3-D Recognitionand Shape Estimation from Image Contours, Part 1,º <strong>IEEE</strong> Trans.Pattern <strong>An</strong>alysis and Machine Intelligence, vol. 16, pp. 1±12, 1994.[22] S. Mallat, ªA Theory <strong>for</strong> Multiresolution Signal Decomposition:<strong>the</strong> Wavelet Representation,º <strong>IEEE</strong> Trans. Pattern <strong>An</strong>alysis andMachine Intelligence, vol. 11, pp. 674±693, 1989.[23] F. Candocia and J.C. Prince, ªComments in Sinc Interpolation <strong>of</strong>Discrete Periodic Signals,º <strong>IEEE</strong> Trans. Signal Process, vol. 46,pp. 2044±2047, 1998.[24] A. Chakraborthy, L.H. Staib, and J.S. Duncan, ªDe<strong>for</strong>mableBoundary Finding in Medical Images by Integrating Gradientand Region In<strong>for</strong>mation,º <strong>IEEE</strong> Trans. Pattern <strong>An</strong>alysis and MachineIntelligence, vol. 15, pp. 859±870, 1996.[25] L.H. Staib and J.S. Duncan, ªBoundary Finding with ParametricallyDe<strong>for</strong>mable Models,º <strong>IEEE</strong> Trans. Pattern <strong>An</strong>alysis andMachine Intelligence, vol. 14, pp. 1061±1075, 1992.[26] T. Blu, ªIterated Filter Banks with Rational Rate ChangesConnection with Discrete Wavelet Trans<strong>for</strong>ms,º <strong>IEEE</strong> Trans.Signal Process, vol. 41, pp. 3232±3244, Dec. 1993.[27] J.M. Restrepo and G.K. Leaf, ªInner Product Computations UsingPeriodized Daubechies Wavelets,º Int'l J. Numerical Method inEng., vol. 40, pp. 3557±3578, 1997.[28] W. Dahmen and C.A. Micchelli, ªUsing <strong>the</strong> Refinement Equation<strong>for</strong> Evaluating Integrals <strong>of</strong> Wavelets,º SIAM J. Numerical <strong>An</strong>alysis,vol. 30, pp. 507±537, 1993.[29] C. de Boor, K. Hollog, and S. Riemenschneider, Box Splines.Springer-Verlag, 1998.[30] T. Blu and M. Unser, ªQuantitative Fourier <strong>An</strong>alysis <strong>of</strong> Approx-Imation Techniques: Part IIÐWavelets,º <strong>IEEE</strong> Trans. SignalProcessing, vol. 47, pp. 2796±2806, Oct. 1999.[31] M.D. McCool, ªOptimised Evaluation <strong>of</strong> Box Splines via <strong>the</strong>Inverse fft,º Graphics Interface, 1995.[32] A. Aldroubi, M. Unser, and M. Eden, ªCardinal Spline Filters:Stability and Convergence to <strong>the</strong> Ideal Sinc Interpolator,º SignalProcessing, vol. 28, pp. 127±138, 1992.Ma<strong>the</strong>ws Jacob received <strong>the</strong> ME degree insignal processing from <strong>the</strong> Indian Institute <strong>of</strong>Science, Bangalore in 1999. Currently, he is aresearch assistant at <strong>the</strong> Biomedical ImagingGroup at EPFL (Swiss Federal Institute <strong>of</strong>Technology), Lausanne, Switzerland. His researchinterests include image processing,active contour models, sampling <strong>the</strong>ory, etc.He is a student member <strong>of</strong> <strong>the</strong> <strong>IEEE</strong>.Thierry Blu graduated from Ecole Polytechnique,France, in 1986 and from Telecom Paris(ENST), France, in 1988. In 1996, he received<strong>the</strong> PhD degree in electrical engineering fromENST <strong>for</strong> a study on iterated rational filter banksapplied to wide band audio coding. He iscurrently with <strong>the</strong> Biomedical Imaging Group atEPFL (Swiss Federal Institute <strong>of</strong> Technology),Lausanne, Switzerland, on leave from FranceTelecom CNET (National Center <strong>for</strong> TelecommunicationsStudies), Issy-les-Moulineaux,France. His research interests include (multi-) wavelets, multiresolutionanalysis, multirate filter banks, approximation, and sampling <strong>the</strong>ory,psychoacoustics. He is a member <strong>of</strong> <strong>the</strong> <strong>IEEE</strong>.Michael Unser (M'89-SM'94-F'99) received <strong>the</strong>MS (summa cum laude) and PhD degrees inelectrical engineering in 1981 and 1984, respectively,from <strong>the</strong> Swiss Federal Institute <strong>of</strong>Technology in Lausanne, Switzerland. From1985 to 1997, he was with <strong>the</strong> BiomedicalEngineering and Instrumentation Program, NationalInstitutes <strong>of</strong> Health, Be<strong>the</strong>sda, where hewas heading <strong>the</strong> Image Processing Group. He isnow a pr<strong>of</strong>essor and head <strong>of</strong> <strong>the</strong> BiomedicalImaging Group at <strong>the</strong> Swiss Federal Institute <strong>of</strong>Technology in Lausanne, Switzerland. His main research <strong>area</strong> isbiomedical image processing. He has a strong interest in sampling<strong>the</strong>ories, multiresolution algorithms, wavelets, and <strong>the</strong> use <strong>of</strong> splines <strong>for</strong>image processing. He is <strong>the</strong> author <strong>of</strong> more than 80 published journalpapers in <strong>the</strong>se <strong>area</strong>s. Dr. Unser is an associate editor <strong>for</strong> <strong>the</strong> <strong>IEEE</strong>Transactions on Medical Imaging; he is on <strong>the</strong> editorial boards <strong>of</strong> SignalProcessing, <strong>the</strong> Journal <strong>of</strong> Visual Communication and Image Representation,and Pattern Recognition. He was a <strong>for</strong>mer associate editor <strong>for</strong><strong>the</strong> <strong>IEEE</strong> Transactions on Image Processing (1992-1995), <strong>the</strong> <strong>IEEE</strong>Signal Processing Letters (1994-1998), and was a member <strong>of</strong> <strong>the</strong>IMDSP Committee <strong>of</strong> <strong>the</strong> <strong>IEEE</strong> Signal Processing Society (1993-1999).He serves as regular chair <strong>for</strong> <strong>the</strong> SPIE conference on waveletapplications in signal and image processing, which has been heldannually since 1993. He received <strong>the</strong> Dommer prize <strong>for</strong> excellence from<strong>the</strong> Swiss Federal Institute <strong>of</strong> Technology in 1981, <strong>the</strong> research prize <strong>of</strong><strong>the</strong> Brown-Boveri Corporation (Switzerland) <strong>for</strong> his <strong>the</strong>sis in 1984, and<strong>the</strong> <strong>IEEE</strong> Signal Processing Society's 1995 best paper award. InJanuary, 1999, he was elected fellow <strong>of</strong> <strong>the</strong> <strong>IEEE</strong> with <strong>the</strong> citation: ª<strong>for</strong>contributions to <strong>the</strong> <strong>the</strong>ory and practice <strong>of</strong> splines in signal processing.º. For fur<strong>the</strong>r in<strong>for</strong>mation on this or any <strong>computing</strong> topic, pleasevisit our Digital Library at http://computer.org/publications/dlib.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!