Xanpng Huang, Qng Tan, Janfe Mao, L Jang, Ronghua Lang The Theory and Applcaton of an Adaptve Movng Least Squares for Non-unform Samples Xanpng Huang, Qng Tan, Janfe Mao*, L Jang, Ronghua Lang College of Computer Scence and Technology Zhejang Unversty of Technology Hangzhou, 3003, P. R. Chna Correspondng author: Janfe Mao mjf@zjut.edu.cn http://www.zjut.edu.cn Abstract: - Movng least squares (MLS) has wde applcatons n scatterng ponts approxmaton fttng and nterpolaton. In ths paper, we mprove a novel MLS approach, adaptve MLS, for non-unform sample ponts fttng. The sze of radus for MLS can be adaptvely adjusted accordng to the consstency of the sampled data ponts. Experments demonstrate that our method can produce hgher qualty approxmaton fttng results than the MLS. Key-Words: - MLS; Sample Ponts; Non-unform; Ponts Set; Approxmaton Fttng; Interpolaton Introducton A curve or surface can be easly drawn f we know ts explct representaton. However, n most engneerng applcaton, an explct formaton can not be provde for such curve or surface. So, we often need to have a dataset of ponts that sampled n a specfc scope [][][3], wth whch the curve or the surface can be represented by nterpolaton or fttng. The basc dea of nterpolaton s to do an approxmate estmaton to unknown ponts wth the gven dscrete ponts, then connect these dscrete ponts to obtan the entre curve (curved surface). Although the whole smoothness of nterpolaton s good enough, n the boundary of the ponts set, the potental error of nterpolaton s greater. Thus fttng s more frequently used, such as the reconstructon of curves. Classcal fttng methods nclude Radal Bass Functon (RBF) method[4], Least-squares method[5], and the Movng Least Squares wth superor property developed from Least-squares method(movng Least Squares, herenafter referred to as MLS)[5-]. In recent years, MLS has attracted great attenton, and now s becomng a hot focus n related researchng felds. A major factor that affects the qualty of fttng n MLS s the selecton of the radus of nfluence doman. In order to obtan hgh-qualty fttng, many approaches were presented. In lterature [][][3] heurstc algorthm was used, for nstance, weght space[4] ball whch contans k-nearest neghbors and Vorono trangularzaton[5] can be used to search the nfluence doman of beng ftted ponts. But the lmtaton of the above method s that only when the dscrete ponts are dstrbuted regularly or the densty of the sampled ponts s bascally constant, can t be effectve. When t comes to non-unform dstrbuton of sampled ponts, t would be qute dffcult to get the fttng detals by MLS, even hardly can t be realzed when t comes to larger convex (concave) hull, and stll, the fttng error s stll relatvely huge. We present an adaptve movng least squares n ths paper, n whch the radus of nfluence doman ISSN: 09-750 686 Issue 7, Volume 9, July 00
Xanpng Huang, Qng Tan, Janfe Mao, L Jang, Ronghua Lang s adjusted dynamcally accordng to the densty of the sampled ponts. Ths new method could do superor fttng than classcal MLS for ether dense or sparse sampled ponts. Moreover, when the bass functon takes the second bass or hgher, the smoothness of fttng wll be better. The Movng Least Square Algorthm Accordng to fttng regon, fttng functon f(x) s fgured as: m f ( x T ) = ( x ) ( x ) = p ( x ) a ( x ) () = a p In above functon, a(x) = [a (x), a (x),, a m (x)] T s the coeffcent of the fttng functon f(x), In the process of calculaton, a(x) dynamcally changes along wth the beng ftted ponts. p(x) = [p(x), p(x),..., pm(x)] s the base functon whch s a base-order complete polynomal. In order to let the fttng functon f(x) close n upon the true value u(x) better, at each pont x of the fttng area, smlar to the least-squares prncple, the value of J n formula () should be as small as possble. n J T = w (( x ) / R )[ p ( ) a ( x ) u ( x )] () = x x Formula () also can be wrtten n matrx form as J= ( pa u) T w( x)( pa u) (3) And p p x p x p x p p p ( ) ( ) ( ) ( x ) ( x ) ( ) x ( x ) ( x ) ( x ) m m = p p p n n m n x x w( ) 0 0 0 w( ) 0 w( x) x x = (5) 0 0 w( x x n ) where n represents the number of sampled ponts n the fttng regon. R s the radus of nfluence, and (4) w(x) s the weght functon. Accordng to mathematcal knowledge, J takes the dervatve on a(x) to zero, then Eqs.(3) and (4) are gotten as J = A( x) a( x) B( x) u = 0 (6) a Formula (6) also can be wrtten n matrx form as ( p, p ) ( p, p ) ( p, pm) a ( x) ( p, u ) ( p, p ) ( p, p ) ( p, pm) a ( x) ( p, u ) = ( p, p) ( p, p ) ( p, p ) a ( x) ( p, u) m m m m m m Where A ( p, p ) ( p, p ) ( p, pm) ( p, p ) ( p, p ) ( p, p ) ( pm, p ) ( pm, p ) ( pm, pm) m = B( x) u ( p, u ) ( p, u ) ( pm, u ) = a( x) A ( x) B( x) u where u u u= u (7) (8) (9) = (0) n Va Eqs. () and (0), usng an approprate sub-base functon accordng to the actual needs, you can obtan the approxmate value of beng ftted pont. All above s the basc prncple of the movng least squares(mls). Takng the fttng accuracy, smoothness, calculatonal amount and so on nto account, n practcal applcaton, or tmes s usually chosen for the bass functon. Weght functon usually s splne functon as () and (), Gaussan functon as (3) or exponental functon as ISSN: 09-750 687 Issue 7, Volume 9, July 00
Xanpng Huang, Qng Tan, Janfe Mao, L Jang, Ronghua Lang (4) n whch the symbol β s the fgure parameter. 4 4 3 x x x 0.5 + 3 4 4 w x x x x x 3 3 0 x> 3 ( ) = 4 + 4 0.5 3 4 6x + 8x 3x x w( x) = 0 x > x β β e e x β w( x) = e 0 x> () () (3) ( x/ β ) e x w( x) = (4) 0 x> But, accordng to a latest lterature[6] n MLS, the weght functon should be defned as Eq.(5) whch has been mproved by us through experment 4 ( x) (+ x) (0 x ) w( x ) = (5) 0 ( x > or x < 0) The result of fttng wll be better when the weght functon w(x) defned as Eq.(5) rather than splne functon, and n order to cut down the fttng tme, n ths paper, we take Eq.(5) as the weght functon rather than Gaussan functon acquescently. the radus of nfluence doman adjusts dynamcally, Vsr represents the ftted values of V ponts by tradtonal MLS method. dr represents the radus of nfluence doman obtaned whle fttng dynamcally, and sr represents the radus of nfluence doman n tradtonal MLS at pont V, n order to make sure matrx A(x) reversble n Eq.(4) and the fttng smooth, R wll make the pont to be ftted contans too many sampled ponts n t s nfluence doman, whch wll result n the fttng value far more less than the real. But actually, V s proper radus of nfluence s less than R. If we let the radus of nfluence doman be dr, the ftted value Vdr would be qute closed to the real value. Vdr s really more accurate than Vsr. Thus, the whole fttng effect would be mproved very much f we could adjust the radus of nfluence doman accordng to the densty of the sampled ponts dynamcally. (a)the radus of dense sampled ponts (b) The radus of sparse sampled ponts 3 Adaptve MLS Algorthm 3. The Shortcomng of Movng Least Squares n Non-unform Ponts Set Fttng When the sampled ponts whch are beng ftted by tradtonal MLS are non-unform, the radus R of the nfluence doman of pont to be ftted (.e., compact support doman) usually depends on the densty of the sparse sampled area. As shown n Fg., symbol V_true represents the true value of pont V, Vdr represents the ftted value of pont V as (c) Fttng dagram Fg. The relatonshp between the radus of nfluence and the fttng ISSN: 09-750 688 Issue 7, Volume 9, July 00
Xanpng Huang, Qng Tan, Janfe Mao, L Jang, Ronghua Lang 3. An Adaptve MLS The local shape n some one of the non-unform ponts s relatve to the neghbors merely, so before fttng, we need to fnd the effectve sampled ponts for current pont marked V fttng, and ths can be done by seekng the k-nearest neghbor ponts of V. In ths paper, we present an adaptve MLS to do non-unform ponts set fttng betterly. The matrx A - (x) must exst before usng the adaptve MLS to do fttng, Ths could be fulflled by searchng V s k-nearest neghbors whch contans k sampled ponts not all n the same lne. The process of the adaptve MLS fttng s as follows: ()Assumng the doman to be ftted be n x[x mn, x max ], y[y mn, y max ]. Dvde the fttng area wth squares of whch sde length s L, and k α L = α ( x m ax + x m n )( y m a x + y m n ) n, denotes regulatng factor of L. Accordng to lterature[7], We let t equal.. k represents the k-nearest neghbors, and the n s the number of sampled ponts. ()To current pont V(x, y ) comng to be ftted, calculate the square S[ x '/ L ][ y '/ L ] α where t les accordng to the square sde length L got from Eq.() (. expresses the floorng operaton). (3)To the sampled ponts n square S[ x '/ L ][ y '/ L ], sort the ponts from small to large accordng to the eucldean dstance to the V. If the current square S [ x '/ L ][ y '/ L ] contans less than k sampled ponts or the eucldean dstance of the j th (j<=k) nearest sampled pont to V D sk s larger than D mn (D mn s the shortest dstance of the current beng ftted pont to the four sdes of S), go to step 4; else consder the dstance of the k th nearest sampled pont to V as the radus of nfluence doman and these sampled ponts are lnearly ndependent. Else fnd out the k+-nearest(=,, ), untl n whch there are k sampled ponts lnearly ndependent n the current V s k+-nearest ponts or havng consdered all the sampled ponts n the current S, less than k lnearly ndependental sampled ponts are found, then go to step 4. All these could be shown as Fg.. (4)If there are dvded squares besdes the square [ '/ ][ '/ ] S x L y L n t s four drectons, then take these sampled ponts nto current squares account together and let current D mn and L treble, then go to step (3); else make the pont who has the furthest dstance wthn the sampled ponts of current S to V as the sze of radus of nfluence doman. Just here, the whole algorthm s over. (a) The number of the sampled ponts s less than k n S (b) The dstance from k- nearest neghbors of V to V D sk >D mn ISSN: 09-750 689 Issue 7, Volume 9, July 00
Xanpng Huang, Qng Tan, Janfe Mao, L Jang, Ronghua Lang nfluence doman obtaned through above steps of the adaptve MLS, the fttng could be carred out fnally as shown n Fg.3. 4 Experment Evaluaton and Results (c) The dstance from S s less than k neghbors of V to V D sk <=D mn Fg. The dstrbuton map about the dstance from sorted sampled pont n S to V 4. Curve Fttng Select two representatve formulas (6) and (7), wth non-unform sampled ponts as [-.9 - -. -0.8-0.7-0.45 0 0.5.8..7] n the nterval x [ 3,3], to make curve fttng respectvely on the frst base functon p(x) = [ x] and the second base functon p(x) = [ x x ] ( the results are smlar when the base of the p(x) takes thrd or larger tmes): (9 x 5) (9 x ) (9 x+ 5) (9 x+ ) 6 96 6 4 F = 8e + 7e + 6e 3e (6) x ( + cos( x) ) F = xsn( x) + (7) x e The fttng results are shown as Fgs.4 and 5. We can see from the Fgs. that the fttng when the adaptve MLS takes the second base functon s closer to the real results more. In Fg. 4 and 5, the graphs drawn wth sold lnes ndcate the correspondng real graph, and the ones wth broken lnes are the graphs by the MLS or the adaptve MLS. x (a) MLS frst base fttng (R=) (b) MLS second base fttng (R=.4) Fg. 3 The fttng flow chart of Adaptve MLS At each pont to be ftted, wth the radus R of the (c) Adaptve MLS frst (d) Adaptve MLS second base fttng base fttng Fg. 4 The comparatve experment results of functon F x fttng ISSN: 09-750 690 Issue 7, Volume 9, July 00
Xanpng Huang, Qng Tan, Janfe Mao, L Jang, Ronghua Lang (9x 5) + (9y+ 5) (9x ) 9y (9x+ 5) + (9y 3) (9x+ ) + (9y+ 5) + 6 9 0 6 4 F= 8e + 7e + 5e e [8] (8) m x + y + x + y + F m = sn sn 8 8 The fttng results are shown as Fgs. 7-8 (9) (a) MLS frst base fttng(r=) (b) MLS second base fttng(r=.4) (a) The orgnal graph (c) Adaptve MLS (d) Adaptve MLS frst base fttng second base fttng Fg. 5 The comparatve experment results of functon F x fttng 4. Surface Fttng Select two representatve formulas (8) and (9), n the nterval x [ 3, 3] y [ 3,3] shown n Fg. 6 about 36 non-unform sampled ponts, to do the surface fttng on the frst base functon p(x) = [ x y] and second base functon p(x) = [ x y x xy y ] respectvely (the results are smlar when the base of the p(x) takes thrd or larger tmes): (b) MLS frst base fttng (R=.5) (c) MLS second base fttng (R=3.5) (d) Adaptve MLS frst (e) Adaptve MLS second base fttng base fttng Fg. 7 The comparatve experment results of functon F m fttng Fg. 6 The dstrbuton of 36 sampled ponts ISSN: 09-750 69 Issue 7, Volume 9, July 00
Xanpng Huang, Qng Tan, Janfe Mao, L Jang, Ronghua Lang (a) The orgnal graph Q method = N j= t ( ) N *00% () When the method s the adaptve MLS n formula(), f formula() satsfes that B(j)>0, t s valued, else t s valued 0; when the method s MLS, f formula() satsfes that B(j)<0, t s valued, else t s valued 0. N s the number of ponts have been ftted. Accordng to the crteron gven by formula(0) and (), do error dfference analyss to the result Fgs. 4 and 5 of functons F x and F x obtaned by MLS and the adaptve MLS fttng and result Fgs. 7 and 8 of functons F m and F m, we can come to see the percent of error done by the adaptve MLS (b) MLS frst base fttng (R=.5) (c) MLS second base fttng (R=3.5) fttng n all the fttng area to F x F x F m and F m s less than all that of MLS, whch s shown n the followng table. Table. The whole fttng regon Adaptve MLS fttng error s less than that of MLS ftted functon F x F x F m F m tmes of base functon frst base functon 83% 80% 7% 70% second base functon 8% 84% 78% 69% (d) Adaptve MLS frst base fttng (e) Adaptve MLS second base fttng Fg. 8 The comparatve experment results of functon F m fttng 4. 3 Results Analyss Based on the curve fttng and surface fttng experment obtaned by tradtonal MLS and the adaptve MLS presented n ths paper respectvely, we do error analyss about the fttng results. We take B() and Q method as the fttng error dfference functon and fttng performance functon B( j) = F F F F (j=,,n) (0) MLS _ j j RSRMLS _ j j From the error comparng analyss between MLS and the adaptve MLS n curve and surface fttng, we can easly reach the concluson that the fttng error s less when usng the adaptve MLS ths paper presented compared wth that obtaned by tradtonal MLS based on the same sampled ponts. After the detal comparsons of Fgs. 4 and 5 and Fgs. 7 and 8, we also fnd the effect of adaptve MLS s much better than that of tradtonal MLS n detal fttng. Especally, the fttng of typcal complex functon F x n Fg. 4, the result graph obtaned by adaptve MLS fttng almost completely overlap wth the real graph n condton that sampled ponts spread non-unformly. And the result s even better when base functon p(x) s lnear, whle MLS only could gve a generally trend. Functon F m has 3 polar ISSN: 09-750 69 Issue 7, Volume 9, July 00
Xanpng Huang, Qng Tan, Janfe Mao, L Jang, Ronghua Lang peaks as shown n Fg. 7(a). And they all haven been ftted nearly by the adaptve MLS, whle the largest polar peak gotten by tradtonal MLS. In Fg. 8, functon F m has two not very clear polar peaks. They were both ftted obvously by adaptve MLS, whle nether of them gotten by tradtonal MLS. In addton, n dealng wth more complex functons, more realstc functon trends could be ftted better by adaptve MLS compared wth the tradtonal MLS even the sampled ponts very sparse. Above all, the fttng performance of the adaptve MLS s better than that of tradtonal one. shown n Fg. 9 5 Deformaton Based on the Adaptve (a) Orgnal graphcs MLS Besdes fttng, the Adaptve MLS also could be used n D or 3D graphcs deformaton wth excellent performance. Now we assume set of control ponts and p be the q the deformed new postons of the control ponts, and then we need to fnd an approprate affne functon g ( p ) wth v whch the new q could be calculated, and the deformaton at the other ponts n the graphcs could be calculated accordng to the control ponts as formula() [9] mn ω (( v p ) / R) g ( p ) q () v (a) (b) Non-unform control ponts Where, ω s the weght functon, R the radus of nfluence, and the nearer dstance from v to p, the less value of weght functon. What s more, the R could be adjusted dynamcally accordng to the densty of neghborng control ponts. In order to obtan the affne functon g ( p ), we v must mnmze formula(), whch could be fulflled va mathematcal theores. And wth the presented adaptve MLS we could deform the graphcs wth some non-unform control ponts to new shape as (c) Deformaton ISSN: 09-750 693 Issue 7, Volume 9, July 00
Xanpng Huang, Qng Tan, Janfe Mao, L Jang, Ronghua Lang of Zhejang Provnce Natural Foundaton under grant No.Z090630, project from Scence and Technology Department of Zhejang Provnce under grant No.009C33043 and the Nature Scence Foundaton of Zhejang Provnce of Chna under grant No.Y090335. (d) Deformaton Fg. 9 The deformaton based on the adaptve MLS Fg. 9 The deformaton based on the adaptve MLS As shown n Fg. 9, we could see that the deformaton performance of the adaptve MLS s excellent, especally the Fg. 9(c) and Fg. 9(d) whch are vvd. 6 Concluson In ths paper, we presented an adaptve MLS, n whch k-nearest neghbor theory was adopted to select approprate sampled ponts to ft current unknown pont. By ths way, the radus of nfluence doman can be adjusted dynamcally accordng to the densty of the surroundng sampled ponts, and the curve or surface can be reconstructed va the presented adaptve MLS. Through experment we can draw a concluson that the fttng performance of the adaptve MLS s superor compared wth tradtonal MLS algorthm. Besdes fttng, the presented adaptve MLS also could be used n graphcs deformaton wth excellent performance. Furtherly, the adaptve MLS could be appled n massve 3D dscrete sampled data recovery, or fttng sampled ponts n vsualzaton etc. Acknowledgment Ths work was partly supported by Major Program References: [] Hoppe H., Derose T., Duchamp T., et al. Surface Reconstructon from Unorganzed Ponts. Computer Graphcs, 99, 6():7-78. [] Alexa M., Behr J., Cohen-or D., et al. Pont Set Surfaces. In Proceedngs of IEEE Vsualzaton 0, 00: -8. [3] Ohtake Y., Belyaey A., Alexa M., et al. Mult-level Partton of Unty Implcts[J]. ACM Trans. Graph, 003, (3):463-470. [4] Carr J. C., Beaton R. K., Cherre J. B., et al. Reconstructon and Representaton of 3D Objects wth Radal Bass Functons. ACM SIGGRAPH, 00: 67-76. [5] Nealen A., An As-Short-As-Possble Introducton to the Least Squares, Weghted Least Squares and Movng Least Squares Methods for Scattered Data Approxmaton and Interpolaton. Tech. Rep., TU Darmstadt, 004. [6] L J. F., Wang R. F., Robust Denosng of Pont-sampled Surfaces. WSEAS Trans. on Com. 009,8():53-6. [7] Yaghmae M., Nae M. H., Nonlnear Bendng of Functonally Graded Thck Crcular Plates by Usng Element Free Galerkn Method. Proceedngs of the 3 rd IASME/WSEAS Int. Con. on Contnuum Mechancs, 007:37-45. [8] Kuragano T., Yamaguch A., Nurbs Curve Shape Modfcaton and Farness Evaluaton for Computer Aded Aesthetc Desgn. WSEAS Transactons on Computers, 008,7(4):74-83. [9] Kuragano T., Kasono K., Curve Generaton and Modfcaton Based on Radus of Curvature Smoothng. Proceedngs of the 0 th WSEAS Int. Conf. on Mathematcal and Computatonal ISSN: 09-750 694 Issue 7, Volume 9, July 00
Xanpng Huang, Qng Tan, Janfe Mao, L Jang, Ronghua Lang methods n scence and engneerng, 009:80-87. [0] Levn D., The Approxmaton Power of Movng Least-squares. Mathematcs Computng, 998, 4(67):57-53. [] Lpman Y., Cohen-or D., Levn D., Data-dependent MLS for Fathful Surface Approxmaton. Eurographcs Symposum on Geometry Processng, 007. [] Pauly M., Gross M., Kobbelt L. P., Effcent Smplfcaton of Pont-sampled Surfaces. In VIS 0: Proceedngs of the conference on Vsualzaton 0 (Washngton, DC, USA), IEEE Computer Socety, 00: 63 70. [3] Pauly M., Keser R., Kobbelt L. P., et al. Shape Modelng wth Pont-sampled Geometry. ACM Trans. Graph, 003, (3) :64 650. [4] We W., Zhang L. Y., Zhou L. S., A Spatal Sphere Algorthm for Searchng k-nearest Neghbors of Massve Scattered Ponts. Acta aeronautca et astronautca snca, 006, 5(7):944-948. [5] Floater M. S., Remers M., Meshless Parameterzaton and Surface Reconstructon, Comput. Aded Geom. 00, 8():77 9. [6] Cheng Z. Q., Wang Y. Z., L B., et al. A Survey of Methods for Movng Least Squares Surfaces, IEEE/EG Symposum on Volume and Pont-Based Graphcs, 008. [7] Xong B. S., He M. Y., Yu H. J., Algorthm for Fndng K-Nearest Neghbors of Scattered Ponts n Three Dmensons. Journal of Computer Aded Desgn & Computer Graphcs. 004, 6(7):909-97. [8] Lpman Y., Cohen-or D., Levn D., Error Bounds and Optmal Neghborhoods for MLS Approxmaton. Eurographcs Symposum on Geometry Processng, 006. [9] Schaefer S., MacPhal T., Warren J., Image Deformaton Usng Movng Least Squares. ACM Transactons on Graphcs, 006, 5(3):533-540. ISSN: 09-750 695 Issue 7, Volume 9, July 00