CHINESE JOURNAL OF MECHANICAL ENGINEERING ·148· Vol. 28,aNo. 1,a2015

DOI: 10.3901/CJME.2014.1106.163, available online at www.springerlink.com; www.cjmenet.com; www.cjmenet.com.cn

3D Profile Filter Algorithm Based on Parallel Generalized B-spline Approximating Gaussian

REN Zhiying1, 2, GAO Chenghui1, 2, *, and SHEN Ding3

1 School of Mechanical Engineering and Automation, Fuzhou University, Fuzhou 350108, China 2 Tribology Research Institute, Fuzhou University, Fuzhou 350108, China 3 Fujian Institute of Metrology, Fuzhou 35000, China

Received January 24, 2014; revised September 10, 2014; accepted November 6, 2014

Abstract: Currently, the approximation methods of the Gaussian filter by some other spline filters have been developed. However, these methods are only suitable for the study of one-dimensional filtering, when these methods are used for three-dimensional filtering, it is found that a rounding error and quantization error would be passed to the next in every part. In this paper, a new and high-precision implementation approach for Gaussian filter is described, which is suitable for three-dimensional reference filtering. Based on the theory of generalized B-spline function and the variational principle, the transmission characteristics of a digital filter can be changed through the sensitivity of the parameters (t1, t2), and which can also reduce the rounding error and quantization error by the filter in a parallel form instead of the cascade form. Finally, the approximation filter of Gaussian filter is obtained. In order to verify the feasibility of the new algorithm, the reference extraction of the conventional methods are also used and compared. The experiments are conducted on the measured optical surface, and the results show that the total calculation by the new algorithm only requires 0.07 s for 480´480 data points; the amplitude deviation between the reference of the parallel form filter and the Gaussian filter is smaller; the new method is closer to the characteristic of the Gaussian filter through the analysis of three-dimensional roughness parameters, comparing with the cascade generalized B-spline approximating Gaussian. So the new algorithm is also efficient and accurate for the implementation of Gaussian filter in the application of surface roughness measurement.

Keywords: generalized B-spline, Gaussian filter, three-dimensional reference, cascade characteristic, parallel characteristic

spline filter, and so on[2]. The Gaussian filtering algorithm 1 Introduction has been defined as the standard for two-dimensional and three-dimensional filters by ISO 11562[3] and ISO 16610[4] With the development of science and technology, the respectively, because of its superior zero phase and bilinear surface quality requirements have improved from the characteristics. However, there are several deficiencies with macro scale to the micro scale; roughness assessments have the Gaussian filtering, such as border and outlier progressed from the one or two-dimensional era into the era distortions[5]. To solve these problems, ISO 16610-22 of three-dimensions. In the description and evaluation of proposed the standard spline filter[6], but the computational surface features, filtration has always been the basis of the efficiency was low and the application was limited in assessment of 3D surface parameters[1]. The three- industrial engineering[7–8]. In addition, it has been found dimensional profile filter algorithm, compared to the that the results from Gaussian and spline filtering were not one-dimensional filter algorithm, has greater redundancy the same and gave the different roughness assessments for and is a more complicated calculation. Therefore, the same surface, and this resulted in discrepancies in researching a fast and highly accurate algorithm is very practical situations. A significant amount of research has meaningful. Currently, there are many established been done to try to unify the two[9]. traditional methods, such as the 2RC filter, Gaussian filter, The approximation of the Gaussian filter by some other spline filters has also been discussed[10–11]. Using the spline principle, the boundary distortion problem of Gaussian was * Corresponding author. E-mail: [email protected] [12] Supported by National Natural Science Foundation of China (Grant Nos. restrained ; by adding a corresponding smoothing 51175085, 51375094), Fujian Provincial Education Department algorithm, the redundancy of the computation was greatly Foundation of China (Grant No. JA13059), Open Fund of State Key reduced[13], and using a cascade characteristic Laboratory of Tribology of Tsinghua University, China (Grant No. [14] SKLTKF13B02), and Fuzhou Science and Technology plan Fund of China approximation of the standard Gaussian filter , a high (Grant No. 2014-G-74) precision of filtering was achieved. However, these © Chinese Mechanical Engineering Society and Springer-Verlag Berlin Heidelberg 2015

CHINESE JOURNAL OF MECHANICAL ENGINEERING ·149·

n methods are only suitable for the study of one-dimensional where s ()xi is the interpolation function. Cx()i is the filtering, not three-dimensional filtering. When these interpolation coefficient. It is found that the measured methods were used for three-dimensional filtering, it was signal can be represented by a linear series of generalized 3r found that in every part a rounding error and quantization B-spline basis functions 1 ()()ikkZ-Îin Eq. (3). error would be passed to the next. In Ref. [15], the B-spline When f ()i is the measured signal, the process which filter was used to achieve the approximation of a Gaussian determines the actual decomposition coefficients Ci()is filter, in which each part of the smoothing filter was broken called a direct B-spline transformation, (()fi ( B31r ()) z - l down into two second-order IIR filters in series form. Ci()); and the process that represents the measured signal However, when used for the three-dimensional filtering, f ()i by the generalized B-spline basis function is known because of its redundancy, computational complexity and as an indirect B-spline transformation, ( fi() 3r calculated dimension, it would result in errors of Bl ()zCi ()). accumulation, and ultimately would affect the accuracy of the approximation. On the other hand, compared to the 2.2 Two-dimensional Gaussian filter discussed spline filters, the generalized B-spline smoothing According to the ISO 11562[3], two-dimensional filter could simplify the calculation and improve its Gaussian filtering weights function as follows: efficiency as well as its strong versatility when extracting [16] the reference and waviness . æöéù2 2 ç æöæöt ÷ 1 ç êúç tx ÷ ç y ÷ ÷ To solve this problem, this paper proposes a 3D profile gt(, t )=-+= expç π êúç ÷ ç ÷ ÷ xy 2 ç ç ÷ ç ÷ ÷ a  ç êúèøçaacxèøç cy ÷ ÷ fast filter algorithm based on the parallel generalized cx cy çèøëûêú÷ B-spline of a three order approximating Gaussian filter. The æö2 æö2 ç æö÷ ç æöt ÷ results show that the new approximation filter is efficient 1 ç ç tx ÷ ÷ ç ç y ÷ ÷ expç--πç ÷ ÷  expç πç ÷ ÷, (4) a2 ç çaa÷ ÷ç ççç ç ÷ ÷ and accurate for the implementation of Gaussian filter in cx cy èøç èøcx÷ èøç èø cy ÷ the application of surface roughness measurement.

tt, are respectively the independent variables in 2 Materials Used in Analysis where xy the directions of x, y ;  ,  are respectively the cut-off cx cy wavelengths in the directions of x, y; 2.1 Generalized B-spline filter a ==ln 2 π 0.469 7; and when tt== ,  the Using a linear differential equation, the generalized xcxycy nr [16] transmission efficiency of the filter is 50%. According to B-spline function m ()x , is given as : the separability of the , the Gaussian n+1 weight function can be split into the right hand part of Eq. nr nr mjmjj()x =--HLgxxUxxå ()(), (1) (4). The two-dimensional Gaussian filtering process can be j=0 written as follows:

nr where H is the constant for normalized B-spline, gm ()x ¥¥ is the (piecewise interpolant) B-spline generating function yn(,xy n )=--=åågn(x m xy , n m y )(, xm x m y ) of order n and type r expanded by an integer factor of mmxy=-¥ =-¥ m , Ux()is the unit step function and L is the constant of æöéù2 2 j ¥¥ ç æöæönm- ÷ 1 ç êúçnmxx- ÷ ç yy÷ ÷ multiplication in the jth segment of the B-spline. The expç-+π êúç ÷ ç ÷ ÷  åå2 ç ç ÷ ç ÷ ÷ =-¥ =-¥ a  ç êúèøaacxèøç cy ÷ ÷ Laplace transform of the basis function g()x must have mmxy cx cy çèøëûêú÷ four-quadrant symmetry when the sampling interval is xm(, m ), (5) identical. Nine different types of third degree generalized xy B-splines functions can be obtained by self- of g()x . In general, the of the three orders of where x(,mmxy )is the measured data and yn(,xy n ) is generalized B-spline can be defined as follows [17–18]: the filtered reference. The transfer function of the filter is obtained by the Z-translation of the Gaussian weight ztz-1 ++ function: Bz3r ()=Î+¥2 , tt , (0, ). (2) 112t 1 = Gz(,xy z ) g xxyy () z g (), z (6) Actually, the generalized B-spline filtering process is an ¥ approximation of interpolation. The generalized B-spline 1 2 where g ()zn=- expéùπ()a  z-n , function can construct a series of functions to approximate xcx11å ëûêú n=-¥ acx the objective function within a given range [,x x ]. ¥ 0 n 2 [17] 1 éù-n B-spline interpolation is redefined as follows : gzycy()22=- expêúπ()na  z . å a ëû n=-¥ cy n nr3 It was supposed that the cutoff angle- frequencies s ()xCxxxjnjiji=-Îå ()1 ( ),[] 0,, (3) i=0 wxwycx ==2π cx,2 cy π cy and zzxy, was replaced

·150· Y REN Zhiying, et al: 3D Profile Filter Algorithm Based on Parallel Generalized B-spline Approximating Gaussian by exp(jwwxy ), exp(j ). The corresponding frequency where yx()is the measured data; s()x is the filtered data; domain function of the standard Gaussian function can be  is the Lagrange constant; ||¶¶22s (xx ) || is the norm of obtained, as follows: curve bending energy; ¶¶s()xxiiis the velocity item of the approximation function; and is the adjustment parameter. éù2 2 æöæöaw Johannes found that the approximation was best in both the êúçawx ÷ ç y ÷ [19] Gw(, w )exp=+=êúç ÷ ç ÷ time domain and frequency domain when  =1  . xy ç ÷ ç ÷ êúèøwwcxçèø cy ÷ ëûêúSchoenberg certified that Eq. (8) is at the minimum when [20] 2 éù2 the spline function is three orders . éùæö æöaw êúawx ÷ êúç y ÷ exp --πç ÷  exp êúπç ÷ . (7) According to the indirect B-spline transformation, the êúç ÷ ç ÷ êúèøç wwcxêúèøç cy ÷ ëûëûêú final filtered data s()x is obtained by substituting Eq. (3) into Eq. (8) and adding the first-order differential operator, (1) =- For the three-dimensional Gaussian, the filter weights (()()()),dxioioi x x-1 and the second-order (2) =-+ distribution are shown in Fig. 1 and the corresponding differential operator, (()()2()()).dxioioioi x+-11 x x frequency domain function is in Fig. 2. From this, the reference data s()xi can be inferred as:

3r sx()iii== cx ()1 () x  3r ()x 1 i ´ 32T21T1r (x )++é ( dxdx ( )) ( )ùé  ( dxdx ( )) ( ) ù 1 iiiiiëê ûëúê ûú 3r yx()= f ()(). xii yx (9)

Finally, the z transformation of the smoothing filter 3r f ()xi should be considered:

ztz-1 ++ Fz3r ()= 2  t 1 -1 é 2 ù Fig. 1. Filter weights distribution of three-dimensional Gaussian ê ztz++2 --11ú ê +-++-+-()zz22.() zzú (10) ëê t1 ûú

3r In general, F ()z could be decomposed into cascade form[15]:

AAztz-1 ++ 3r = 2 Fz () --12 2 , 11--bz12 bz -- bz 12 bz t1 (11)

2 2 where A =-12cospwp + ,bpw1 = 2cos,bp2 =- , pw, are respectively the amplitude and phase angle of the minimum conjugating complex roots of the characteristic polynomial F 3r ()z ; t , t can be optimized at different Fig. 2. Corresponding frequency domain function of Fig. 1  1 2 cutoff angular frequencies. From Eq. (11) it is clear that the approximation is achieved through two IIR filters and a 2.3 Parallel generalized B-spline approximating FIR filter in series. However, in the actual operation Gaussian process, word length of the digital system is always limited, In the one-dimensional filtering process, a rapid so the accuracy of the filter coefficient is limited. This implementation of the standard Gaussian filtering process means that the quantization error of each part and the could be achieved by the generalized B-spline smoothing rounding error of the multiplier are accumulated in the method [17]. The following formula is its principle: output and carried to the next level of the filtering process. The actual approximation between the smoothing filter and 2 N ïì 2 Gaussian filter will be directly affected by the output error ï 2 ¶ sx()i =-++í[(yx ) sx ( )] so that it becomes less accurate. Especially for åï ii ¶2 x i=1 îï i three-dimensional filtering, where the quantization and 2 ü ¶sx()ï rounding errors of the entire system will impact the  i ýï  min, (8) ï filtering results, it is more significant because of the ¶xi ï þï distribution dimensions of the data and the large

CHINESE JOURNAL OF MECHANICAL ENGINEERING ·151· computation. In order to improve this situation, Eq. (10) Gaussian function Eq. (6). Finally, the following form can was changed into the parallel form (seen in Eq. (12)). In the be achieved: parallel structure, each subsystem is mutually independent, which means it cannot be affected by the quantization and 33rr YzzgzgzFzFz(,xy )=» xx () yy () () x () y = multiplication rounding errors from other parts that finally éC++ Bz--12 Az C ++ Bz Az 2ù reduce the system sensitivity. ê xx+´ xxú ê --12 2ú ëê 11--bz12xx bz -- bz 12 xx bz ûú --12 2 --12 2 3r C++ Bz Az C ++ Bz Az é ++ ++ù Fz()=+, (12) êúC Bzyy Az C Bz yy Az  --12 2 += êú--12 2(,zzx y ).(13) 11--bz12 bz -- bz 12 bz -- -- êúë 11bz12yy bz bz 12 yy bz û

where 2.4 Transmission characteristics of 3D profile fast

T filter algorithm [ABC ABC] = To illustrate the feasibility of this algorithm, its

T1T- T transmission characteristics were analyzed by the ()KK K[ 01//1/0,ttt121 t 1 ] Fourier-translation of F 3r ()z and F 3r ()z . Now Z is  x  y replaced with (exp(- jw ) in Eq. (10), and the transmission and K is the coefficient matrix: characteristic function is obtained:

é100--bb12 ê 3r tw2··+ 2cos ê ---bbb10 Fw (exp(-= j· )) ê 112 t ê 1· K = ----bbbb21121 ê étw+ 2cos ù ê 0 --bb ê 2··+-+-(2cosww 2)2 (2 2cos )ú , ê 21 ê ·· · ·ú (14) ê ë t1· û ëê 00-b2

00-b ù 2 ú where • denotes x or y. It is known that the transmission of 0 --bbú the filter is 50% when  =  , from ISO 11562[3]. 21ú c ú According to this requirement and  =/2πx w (x is ----bbbb2112ú.1 ú the sample interval), the expression of parameter  is ---bbb11210ú ú deduced: 100--bb 12 ûú

-+1 1 + 4(twt21··· + 2cosc ) / The parallel algorithm is shown in the form of a block  = (15) · 2(2- 2cosw ) diagram in Fig. 3. Where A, B, C are the parameters in Eq. c· (12) and can be calculated; KT is the matrix transpose of the Then, the transmission characteristics of the 3D filter matrix K; and the definitions of b1, b2 are the same as that in Eq. (11). from the Fourier-translation of (,zzxy ) is obtained. To facilitate discussion, it is assumed that wwcx== cy 1 (  = 2πx ). When tt12==1.84, 8.15, the smoothing filter can achieve a high-precision approximation of the Gaussian filter by PSO. A comparison of their transmission characteristics is given in Figs. 4 and 5.

Fig. 3. Algorithm structure

When used for the three-dimensional filtering, it is possible to realize that the x-direction and y-direction of the 3r B-spline smoothing transfer functions F ()zx and 3r F ()zy replace the direction transfer functions gxx()z and gyy()z , respectively, due to the separability of the Fig. 4. Transmission characteristics of the Gaussian filter

·152· Y REN Zhiying, et al: 3D Profile Filter Algorithm Based on Parallel Generalized B-spline Approximating Gaussian

deviation between the reference of the cascade structure filter and Gaussian filter, which means that the parallel structure of the filter can more accurately approximate the Gaussian filter. The total calculation only required 0.07 s for 480´ 480 data points using a PC (computer configuration: Intel Core i5-processor and 2 GB RAM), but if the Gaussian filter had been used, the total calculation would require 2.76 s (where A =-0.007 2, B = 0.033 8,

C = 0.035 6, bb12==-0.990 9, 0.320 6 ).

Fig. 5. Transmission characteristics of the smoothing filter

The smoothing and standard Gaussian filters are very similar; the maximum deviation is only about 0.8% (Fig. 6). However, the smoothing filter can reach high-precision approximation results through only one whole cycle while meeting ISO11562, which means it could greatly improve the efficiency of the filter and realize savings in computing time.

Fig. 7. Measured 3D optical surface

Fig. 6. Maximum deviation between the smoothing filter and the standard Gaussian filtering Fig. 8. Reference of the standard Gaussian filter

3 Case Studies on the Extraction of Reference of Three-dimensional Optical Surface

Fig. 7 shows the measured optical surface obtained by sampled 480´480 points with the interval of 0.4 m, and the cut-off wavelength of 2.5 m. The reference extracted by Gaussian filtering is shown in Fig. 8, which has removed the boundary distortion to effectively compare with other methods. Figs. 9 and 10 are respectively the cascade and parallel structure of the filter, which are difficult to distinguish. According to Figs. 11 and 12, the amplitude deviation between the reference of the parallel structure filter and the Gaussian filter is smaller than the amplitude of the Fig. 9. Reference of the cascade generalized B-spline

CHINESE JOURNAL OF MECHANICAL ENGINEERING ·153·

generalized B-spline and standard Gaussian filter.

Table 1. Comparison of roughness parameters

Generalized Generalized Standard B-spline B-spline 3D roughness parameter Gaussian filtering filtering filter (cascade) (parallel) 6.490 9 7.063 1 Rms deviation Sq/nm 6.861 2 (5.39%) (3.66%) 84.681 99.602 2 Ten point height Sz/nm 95.867 4 (11.67%) (3.9%) 3.939 3 4.371 9 Skewness Ssk 4.241 2 (7.12%) (3.08%) Fig. 10. Reference of the parallel generalized B-spline 74.759 9 79.107 4 Hump degrees Sku 80.695 8 (7.36%) (1.97%) 0.168 4 0.168 2 Surface peaks density Str 0.168 2 (0.12%) (0%)

4 Conclusions

In this paper, a 3D profile fast filter algorithm is constructed using the parallel generalized B-spline to realize a Gaussian filter. (1) This filter not only accords with the transmission characteristics of ISO, but also restrains the end distortion of the data sequence. (2) This filter not only improves filtering speed by Fig. 11. Amplitude deviation between the reference cascade adding the transmission characteristics of the digital filter structure filter and the Gaussian filter to the sensitivity of the parameters ( tt, ), but also reduces 12 the rounding and quantization errors of each level due to its parallel form. (3) The total calculation only requires 0.07 s for 480´480 data points, which is approximately only one-fortieth of the time spent by the standard Gaussian filter. (4) In a word, the new approximation filter has been shown to be efficient and accurate when implemented as a Gaussian filter to determine surface roughness measurements.

References

[1] ZENG Wenhan. Tree complex surface analysis model and Fig. 12. Amplitude deviation between the reference of the the process morphology identification method research[D]. Wuhan: parallel structure filter and the Gaussian filter Huazhong University of Science and Technology, 2005. [2] CHEN Qinghu, LI Zhu. The surface roughness wavelet assessed The optical surface is formed by machining, so the three- baseline[J]. Acta Metrologica Sinica, 1998, 19 (4): 254–257. dimensional characterizing parameters choose from ISO [3] ISO11562-1996 Geometrical product specification (GPS)-surface 25178-2 in 2012[21]. texture: profile method-metrological characteristics of phase correct filters[S]. International Organization for Standardization, 1996. Table 1 displays the 3D parametric evaluation of the [4] ISO16610-21-2011 Geometrical product specifications (GPS)- measured optical surface obtained by the different methods, filtration: linear profile filters: Gaussian filters[S]. International and the data in parentheses represents the difference of the Organization for Standardization, 2011. three-dimensional parameters between the generalized [5] NUMADA M, NOMURA T, KAZUHIDE K, et al. Filter with B-spline filter and the standard Gaussian filter, the data in variable nan8mission characteristics for determination of brackets shows the relative deviation of the 3D parametric three-dimensional roughness[J]. Precision Engineering, 2006, 30(4): 43l–442. between the generalized B-spline filtering and the classical [6] ISO16610-22-2006 Geometrical product specifications (GPS)- Gaussian filtering. There is a smaller difference of the filtration: liner profile filters: spline filters[S]. International three-dimensional parameters between the parallel Organization for Standardization, 2006.

·154· Y REN Zhiying, et al: 3D Profile Filter Algorithm Based on Parallel Generalized B-spline Approximating Gaussian

[7] SCHOENBERG I J. Spline functions and the problem of [19] JOHANNES P F, D’HAEYER. Gaussian filtering of images: A graduation[J]. Proc. Nat. Acad. Sci., 1964, 52: 947–950. regularization approach[J]. , 1989(18): 169–181. [8] UNSER M, ALDROUBI A, EDEM M. B-spline signal process: Part [20] SCHOENBERG I J. Spline function and the problem of I-theory[J]. IEEE Transaction on Signal Processing, 1993, 41(2): graduation[J]. Signal Processing, 1989(18): 168–181. 821–832. [21] ISO 25178-2-2012 Geometrical product specifications (GPS) - [9] ZHANG Hao, YUAN Yibao, PIAO Weiying. The spline filter: A surface texture: areal - Part 2: terms, definitions and surface texture regulation approach for the Gaussian filter[J]. Precision parameters[S]. International Organization for Standardization, 2012. Engineering, 2012(36): 586–592. [10] KRYSTEK M. Discrete L-spline filtering in roundness Biographical notes measurements[J]. Measurement, 1996, 18(2): 129–138. REN Zhiying, born in 1980, is currently a PhD candidate at [11] KRYSTEK M. Form filtering by splines[J]. Measurement, 1996, School of Mechanical Engineering and Automation, Fuzhou 18(1): 9–15. University, China. She received her master degree from Fuzhou [12] GOTO T, MIYAKURA J, UMEDA K. A robust spline filter on the University, China, in 2006. Her research interests include basis of L2-norm[J]. Precision Engineering, 2005, 29(2): 157–161. tribological and signal processing. [13] UNSER M, BLU T. Generalized smoothing splines and the optimal Tel: +86-591-22866261; E-mail: [email protected] discretization of the winer filter[J]. IEEE Transactions on Signal

Processing, 2005, 53(6): 2146–2159. GAO Chenghui, born in 1953, is currently a professor at Fuzhou [14] ZHANG Hao, YUAN Yibao, PIAO Weiying. A universal spline University, China. He received his PhD degree from filter for surface metrology[J]. Measurement, 2010(43): 1575–1582. Mechanical Science Research Institute, China, in 1990. His [15] XU Jingbo, YUAN Yibao. Implementation approach for Gaussian research interests include mechachonics engineering, tribological, filter in surface measurement applying B-spline function[J]. Journal digital design. of Mechanical Engineering, 2009(45): 238–242. Tel: +86-591-87893224; E-mail: [email protected] [16] RUTUPARANA Panda, RATH G S. Generalized B-spline signal processing[J]. Signal Processing, 1996(55): 1–14. [17] UNSER M, ALDROUBI A, EDEN M. B-spline signal processing: SHEN Ding, born in 1988, is currently an engineer at Fujian Part I-Theory[J]. IEEE Transactions on Signal Processing, 1993, Institute of Metrology, China. He received his master degree on 41(2): 821–832. mechanical design and theory from Fuzhou University, China, in [18] UNSER M, ALDROUBI A, EDEN M. B-spline signal processing: 2014. Part II—Efficient design and applications[J]. IEEE Transactions on E-mail: [email protected] Signal Processing, 1993, 41(2): 834–848.