1 Introduction

Filtration is one of the core elements of analysis tools in geometrical metrology. It is the means by which the information of interest is extracted from the measured data for further analysis[1]. For instance, filtration techniques are employed in surface metrology to separate the roughness component from the waviness component and the form component so that suitable characterization parameters can be derived with an aim to control the manufacturing process[2]. They also serve in dimensional metrology for data smoothing. In such a manner, noises are removed by filters before fitting routines are applied to generate the geometry of the measurand. Filtration techniques are progressing along with the advancement of manufacturing technology. Massive functionally and geometrically complicated surfaces emerge as the output of modern product technologies. In response to these new features, filtration techniques are required to be robust against outliers, applicable to surfaces with complex geometry and reliable in whole range of measurement data. These motivations bring out a set of robust filtration techniques, most of which are presented in ISO 16610[3], including the robust Gaussian regression filter, the robust spline filter and morphological filters.

Although these robust filters are detailed in ISO standards and other research literatures, differences in their usages and capabilities are not fully recognized and clearly stated yet. As a result, they are confusing for metrologists and users to choose the correct filter for surface assessment. This paper sets out to carry out a comparison study of robust filtration techniques, which are commonly used in geometrical metrology. The paper is structured in the following fashion. Section 2 presents a brief review of filtration techniques. Section 3 gives an introduction to four specific robust filters, i.e., the two-stage Gaussian filter, the robust Gaussian regression filter, the robust spline filter and morphological filters. A thorough comparison of these filters is conducted in Section 4 in four aspects: functionality, mathematical computation, capability and characterization parameters. Finally Section 5 gives the conclusions.

2 Filtration techniques

ISO 16610[3] presents a category of modern advanced filtration techniques encompassing linear filters, robust filters, morphological filters and segmentation filters. It provides a powerful and useful toolbox of filtration techniques, allowing metrologists to analyze various surface textures. Most of these filters could date back to two traditional filtration systems emerged in 1950s, i.e., the mean-line based system (M-system) and the envelope based system (E-system).

The M-system generates a reference line passing through the measured profile from which the roughness is assessed. As shown in Fig. 1, the reference line is called the mean line due to the fact that the profile portions above and below the reference line are equal in the sum of their areas. The first practical mean-line filter used in surface texture measurement is the analogue filter proposed by Reason[4], which was constructed by a two-resistor-capacity (2RC) network. However, this 2RC filter was suffered by the phase error and profile deformation due to filtering. In 1963, Whitehouse and Reason[5] simulated the 2RC filter digitally. They described the filter using a weighting function that depended on the cut-off wavelength. In 1967, Whitehouse[6] formally introduced the phase-corrected filter and digital filters were also made. The phase-corrected filter was adopted by the international standard and formally referred to as the “standard wave filter”.

Fig. 1
figure 1

The mean-line system

The phase-corrected digital filter still has problems, one is that it badly distorted the profile at the end. Later, the Gaussian filter was chosen as the new filter for separating differing wavelengths[7]. The Gaussian filter is a typical mean-line based filter whose process is a convolution operation of the surface under evaluation and the Gaussian weighting function.

The E-system was initially developed by Von Weingraber[8]. Acting totally differently, the E-system appeared as a large disk rolling across over the profile from above, and the covering envelope formed by the rolling disk followed by the compensation of disk radius is viewed as the reference profile. As shown in Fig. 2, the E-system gains its basis from the simulation of the contact phenomenon of two mating surfaces, whereby peak features of the surface play a dominant role in the interaction operation.

Fig. 2
figure 2

The envelope system[9]

There have been some arguments between these the M-system and the E-system systems in terms of their capability and superiority during the period between 1955 and 1966[10]. At that time, the difficulty appeared in building practical instruments for the E-system as two elements were needed: a spherical skid to approximate the “enveloping circle” and a needle-shaped stylus moving in a diametral hole of the skid to measure the roughness as deviation with respect to the “generated envelope”. The standing objection from Reason was that the choice of the rolling circle radius is as arbitrary as the choice of cut-off in the M-system, and no practical instrument using mechanical filters could be made. However, the facts proved that the M-system and the E-system are complement to each other, rather than compete against each other and none of them can fulfill all the practical demands by themselves alone[11].

Motivated by the advancement of cutting-edge manufacturing technologies and also driven by modern product design intents, modern products and devices are equipped with sophisticated surfaces to achieve desired functions. For instance, in large inertial laser fusion facilities, ultra-precision surfaces of optics not only are incredibly smooth, but also have the specification of surface form at levels approaching atomic magnitude. Similarly, accuracy is also demanded in biotechnology products, e.g., implantable medical devices such as hip and knee joints, where micrometre form and nanometre roughness requirements are specified in order to reduce the generation of wear debris[12]. Freeform surfaces with complex geometry appear in many advanced optic components, e.g., the F-theta lens, where no transitional and rotation symmetry can be observed[13]. In response to these advancements, filtration techniques are motivated to be enhanced in their capability and performance with dealing with functional surfaces.

The M-system was greatly enriched by incorporating advanced mathematical theories. The Gaussian regression filter overcame the problem of end distortion and poor performance of the Gaussian filter in the presence of significant form component[14], while the robust Gaussian regression filter solved the problem of outlier distortion in addition[15,16]. The spline filter is a pure digital filter, more suitable for form measurement[17]. Based on L p norm, the robust spline filter is insensitive with respect to outliers[18, 19].

In the meanwhile, the E-system also experienced significant improvements. By introducing mathematical morphology, morphological filters emerged as the superset of the early envelope filter, but offering more tools and capabilities[20]. The basic variation of morphological filters includes the closing filter and opening filter. They could be combined to achieve superimposed effects, referred as the alternating symmetrical filters (ASF). A sequence of ASFs leads to scale-space techniques[21].

3 Robust filtration techniques

In ISO 16610-21, robustness is defined as the insensitivity of the output data against specific phenomena (outliers, scratches, steps, etc.) in the input data. An example having such kind of data is the inner surface of the cylinder liner which has functional stratified properties. This kind of surfaces is composed of deep valleys superimposed by plateaux. The plateaux supports force bearing and friction, while the valleys serve as lubricant reservoirs and distribution circuits. The standard phase corrected Gaussian filter[7] is unable to generate a reasonable reference line. As illustrated in Fig. 3, the mean line of a cylinder liner profile yielded by the Gaussian filter (cut-off wavelength 0.8 μm) tends to drop down toward the valleys. This subsequently distorts the evaluation of roughness component of the surface texture which could be clearly detected in the figure. Robust filters should overcome this shortcoming.

Fig. 3
figure 3

The reference profile and roughness profile obtained by the standard Gaussian filter

Another noticeable issue concerning with the robust filter, although not stated by ISO standards, is the ability for form measurement. Robust filters should be able to tackle surfaces with large form components. With the enhancement of measurement capability of current instruments, there is a trend that the measured data consists of both the dimensional information (size, form, etc.) and that of the surface texture, which are traditionally measured in a separate manner. Thus, the ability of separating two different components in such a combined data set is of great importance.

3.1 Two-stage Gaussian filter

The two-stage Gaussian filter, presented by ISO 13565[22], is an empirical approach for the analysis of functional stratified surfaces. Fig. 4 illustrates the procedure of two-stage Gaussian filter. At the first stage, a standard Gaussian filter is applied to the measured profile to gain a mean line. All the profile portions that lie under the mean line are removed and replaced by the mean line itself. The modified profile is then filtered by the same Gaussian filter again to obtain the second mean line, which is referred as the final reference line for the assessment of roughness.

Fig. 4
figure 4

The procedure of the two-stage Gaussian filter

Although this method is effective in certain cases, it has a couple of limitations. Firstly, it was derived from empirical foundation with a significant assumption: surface contains a relative small amount of waviness, which is ambiguous and confusing. Secondly, running-in and running-out sections are generated from the Gaussian filter. These sections truncate the profile and only 20%–60% of the measurement data are used in evaluation[23].

3.2 Robust Gaussian regression filter

The traditional standard (linear) Gaussian filter can be described by the following minimization problem:

$$\int_{ - \infty }^{ + \infty } {{{(z(\xi ) - w(x))}^2}s(\xi - x)d\xi \Rightarrow \mathop {\min }\limits_{w(x)} }$$
(1)

where z(x) is the input measured profile, s(x) is the Gaussian weighting function \(\frac{1}{{\alpha {\lambda _c}}}{e^{ - \pi {{\left( {\frac{x}{{\alpha {\lambda _c}}}} \right)}^2}}}\) with λ c as the cutoff wavelength, and w(x) is the output reference profile.

The reference profile w(x) can be solved as

$$w(x) = \int_{ - \infty }^{ + \infty } {(z(\xi )s(x - \xi )d\xi = z(x) \otimes s(x)}$$
(2)

which in essence is a convolution operation over the interval −∞ ≤ x ≤ +∞. The Gaussian weighting function has the same shape at each data point.

For the linear second order Gaussian regression filter, the minimization problem is given by

$$\begin{array}{*{20}{c}} {\int_0^l {{{(z(\xi ) - {\beta _1}(x)(\xi - x) - {\beta _2}(x){{(\xi - x)}^2} - w(x))}^2}.} } \\ {s(\xi - x)d\xi \Rightarrow \mathop {\min }\limits_{w(x),{\beta _1}(x),{\beta _2}(x)} } \end{array}$$
(3)

where a second order polynomial curve β 1 x + β 2 x 2 + w is employed in order to remove the form component of the measured profile z(x) with β 1 and β 2 being the polynomial coefficients. This procedure is evaluated at each sampling point over the whole length of the measured profile [0, l].

For the robust (non-linear) second order Gaussian regression filter, a robust statistical estimator ρ(x) is employed as the vertical weighting function aiming to eliminate the distortion caused by the outliers and abrupt features. Then the minimization problem changes to

$$\begin{array}{*{20}{c}} {\int_0^l {\rho {{(z(\xi ) - {\beta _1}(x)(\xi - x) - {\beta _2}(x){{(\xi - x)}^2} - w(x))}^2}.} } \\ {s(\xi - x)d\xi \Rightarrow \mathop {\min }\limits_{w(x),{\beta _1}(x),{\beta _2}(x)} } \end{array}$$
(4)

where ρ(x) is also called as the error metric function. A commonly used error metric function is the Tukey estimator:

$$\rho (x)\left\{ {\begin{array}{*{20}{c}} {\frac{{{c^2}}}{6}\left( {1 - {{\left( {1 - {{\left( {\frac{x}{c}} \right)}^2}} \right)}^3}} \right),\,\,\,\,\,if|x| \leqslant c} \\ {\frac{{{c^2}}}{6}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,if|x| > c} \end{array}} \right.$$
(5)

where c is a constant equal to 4.4478 × median (|z − w|). The computation is an iterative procedure which will terminate when the deviation of c is within the given tolerance.

Fig. 5 presents an example of applying the second order Gaussian regression filter on the cylinder liner profile with cut-off wavelength 0.8 μm. The Tukey function is used as the robust estimator. The reference profile is subtracted from the raw measured profile to generate the roughness profile.

Fig. 5
figure 5

The reference profile and roughness profile obtained by the robust Gaussian regression filter

3.3 Robust spline filter

In contrast to the Gaussian filter, the spline filter is a pure digital filter. It is specified by the filtration equation instead of the weighting function. The reference line resulted from the filter is a spline which could be described by a constrained optimization problem: finding w(x) minimizing the square of residual errors:

$$e = \sum\limits_{i = 1}^n {{{({z_i} - w({x_i}))}^2}}$$
(6)

under the condition of minimizing the bending energy of the spline[24]:

$$f = \int_{{x_1}}^{{x_n}} {{{\left( {\frac{{{d^2}w(x)}}{{d{x^2}}}} \right)}^2}dx} $$
(7)
$$i.e,\sum\limits_{i = 1}^n {{{({z_i} - w({x_i}))}^2} + \mu \int_{{x_1}}^{{x_n}} {{{\left( {\frac{{{d^2}w(x)}}{{d{x^2}}}} \right)}^2}dx \to \mathop {\min }\limits_{w(x),\mu } } } $$
(8)

with μ as the Lagrange coefficient.

The solution of this optimization problem leads to the filtration equation:

$$(I + {\alpha ^4}Q)w = z$$
(9)

where

figure Equ10
$$\alpha = \frac{1}{{2\sin \left( {\frac{{\pi \Delta x}}{{{\lambda _c}}}} \right)}}$$
(11)

with ∆x as sampling interval and I as the identity matrix.

Similar to the robust Gaussian filter, the robust spline filter integrates the robust statistic estimate function ρ(x), e.g., the Tukey function, thus the optimization problem of the spline filter turns to

$$\sum\limits_{i = 1}^n {\rho ({z_i} - w({x_i})) + \mu \int_{{x_1}}^{{x_n}} {{{\left( {\frac{{{d^2}w(x)}}{{d{x^2}}}} \right)}^2}dx \to \mathop {\min }\limits_{w(x)} } } $$
(12)

which afterwards leads to the filtration equation

$$(\Delta + {\alpha ^1}Q)w = \Delta z$$
(13)

where ∆ is the diagonal matrix of vertical weights.

Fig. 6 demonstrates the reference line generated by the robust spline filter with applying on the cylinder liner profile employed in the aforementioned example. The cut-off wavelength is also 0.8 μm. The Tukey function is employed as the robust estimator.

Fig. 6
figure 6

The reference profile and roughness profile obtained by the robust spline filter

3.4 Morphological filter

The closing filter and opening filter are two primary types of morphological filters. As illustrated in Fig. 7, the closing filter is obtained by placing an infinite number of identical disks in contact with the profile from above along entire profile and taking the lower boundary of the disks[21]. On the contrary, the opening filter is achieved by placing an infinite number of identical disks in contact with the profile from below along all the profile and taking the upper boundary of the disks. Alternating symmetrical filters are the combination of openings and closings with the same structuring element, which will suppress both peaks and valleys.

Fig. 7
figure 7

Morphological envelope obtained by rolling a disk over the profile

The traditional implementation of morphological filters follows the definition of morphological operations. Fig. 8 presents a basic method to compute the dilation operation of profile data with the disk structuring element[25]. The coordinates are sampled from the disk centre to the two ends with the same sampling interval to that of the profile. These disk ordinates are placed to overlap the profile ordinates with the disk centre located at the target profile point. The ordinate where the mapping pair of the profile ordinate and the disk ordinate gives the maximum value in height determines the height of the disk centre. This procedure is repeated for all the profile ordinates to obtain the whole dilation envelope. The erosion envelope can be easily obtained by first flipping the original profile followed by flipping its dilation envelope. Combining dilation and erosion operations in sequence will yield closing and opening envelopes.

Fig. 8
figure 8

Computation of the profile dilation envelope

Nevertheless there are more capable and efficient computational methods available for the filtration of complex surfaces[26,27]. For instance, the geometrical method based on the convex hull differs from the traditional approach in that the algorithm sets out to compute the contact points as the disk is rolling over the profile. The method relies on the link between the convex hull and morphological envelopes that the convex hull could be viewed as a specific morphological envelope generated by an infinitely large disk. As shown in Fig. 9, the Graham scan algorithm, originally developed to compute the convex hull of the planar point set is adopted and modified to compute the morphological envelopes. The algorithm handles the points in an incremental manner and a stack structure is maintained to hold the contact points by evaluating the coming measured point with those in the stack. To correct the end effect of filtration on the open profile, two ends of the profile are padded by reflection before the filtering process. At the final stage of computation, the stack contains all the contact points and the envelope ordinates are archived by interpolating points on the arcs determined by the adjacent contact point pairs. In comparison to the traditional approach, the geometrical method is more efficient in performance and applicable to non-uniform sampled date set.

Fig. 9
figure 9

Pivoting an infinitely large disk around the point set yields the convex hull

Fig. 10 presents the reference line obtained by applying the alternating symmetrical filter with disk radius of 5 mm on the cylinder liner profile data. It should be mentioned that the closing operation is applied before the opening operation. The resulting reference profile basically follows the form of the closing envelope. Thus, it suits for surfaces where valley features play a dominant role.

Fig. 10
figure 10

The reference profile and roughness profile obtained by the morphological alternating symmetrical filter

4 Comparison study

4.1 Functionality

From a functionality oriented point of view, the Gaussian filter and the spline filter are more suitable for monitoring the manufacturing condition. They are specified by the cut-off wavelength. Analyzing frequency contents of the measured data is reasonable because the vibration of the machine and the tool wear will cause the corresponding frequency changes in surface textures. The robust variation of these filters provides more powerful tools in analyzing complex surfaces. In contrast, morphological filters are believed to give better results in the functional prediction in that they are more relevant to geometrical properties of the surface itself which is critical in contact phenomenon and optical reflection. However, the above statement is not absolute. Malburg[28] presented a good example whereby the spline filter and the morphological closing filter are employed to simulate the conformable interface of two surfaces of a solid block and a sealing soft gasket, respectively.

4.2 Mathematical computation

The standard Gaussian filter is a convolution operation of the input surface and the Gaussian weighting function. The robust Gaussian regression filter enhances it in three aspects. Firstly, it incorporates the robust statistical estimator as the vertical weighting function, supplementing the Gaussian weighting function in the horizontal direction. Secondly, a polynomial function with certain order is introduced to approximate the form component of the surface under evaluation. It could eliminate the distortion of the standard Gaussian filter of which the polynomial curve is zero order, namely the surface is planar. Finally, the weight in both horizontal and vertical directions are normalized, which means the convolution operation at end regions could be calculated without padding extra zeros or truncating the surface.

In contrast to the Gaussian filter, the spline filter is a purely digital filter specified by the filtration equation instead of the weighting function. It is a constrained optimization problem, which could be switched to an unconstrained problem by means of the Lagrange method. In a similar way to the robust Gaussian filter, the robust statistical estimate techniques could be employed to offer the ability to deal with outliers in the data.

Morphological filters lay their basis on mathematical morphology. Morphological operation is the convolution of the sets[20], i.e., the input set and the structuring element set. The traditional algorithm, acting in a similar manner to image processing, is implemented on the basis of the set convolution[29], whereas faster and more powerful geometrical approaches are developed recently.

4.3 Capability

Aiming to thoroughly evaluate the capability of these robust filters, they are examined in terms of the following five factors: end distortion, robustness to outliers, form filtering, non-uniform sampling data filtering and roundness (closed profile) filtering, shown as in Table 1. In terms of end distortion in the filtration of open surfaces, the two-stage Gaussian filter suffers from data truncation at two ends of the profile in each filtering process, while the robust Gaussian regression filter and the robust spline filter behave well in this aspect. Morphological filters experience the end distortion to some degree, but are not as serious as the Gaussian filter. The two-stage Gaussian filter is an empirical method to handle the data with outliers. However, strictly, the two-stage Gaussian filter is not a real robust filter since it relies on the standard Gaussian filter and therefore inherits its shortcomings. The robust Gaussian filter, as the enhanced version of the standard Gaussian filter by embedding the statistical weighting function in vertical direction, is robust against outliers. Same is true for the robust spline filter. As to morphological filters, the primary filters (the closing filter and opening filter) are partially robust against outliers in that the closing filter only suppresses valley features and the opening filter only removes peak features. Alternating symmetrical filters, being the combination of the closing filter and opening filter, are naturally robust against both valleys and peaks.

Table 1 Capability comparison

The other three factors are concerned with the dimensional measurement. The two-stage Gaussian filter, based on the traditional Gaussian filter, is not suitable for form filtering because its reference line will be distorted by the large form component. The Gaussian regression filter could approximate the form component using the high order polynomial fitting in the least square sense. However, it is still unsuitable for filtering complex surfaces where the polynomial approximation is unable. The spline filter originates from the form of a flexible natural cubic spline under the load of the measured profile[17]. Therefore, it could handle most of surfaces in form measurement. Morphological filters are more straightforward in this aspect since it simulates rolling a ball over the surface without considering whatever the surface being rolled is. With respect to non-uniform sampling data, there is no evidence showing the Gaussian filter and the robust Gaussian version are able to deal with this kind of data. On the contrary, the spline filter and morphological filters are capable if the appropriate algorithms are taken[24,26]. The standard and robust Gaussian filter could be modified to handle the roundness data[30]. The spline filter and its robust version apply to the roundness data as well. Theoretically, morphological filters are applicable to the roundness data. However, traditional methods are restricted to planar surfaces. Recently, a novel implementation of morphological filters based on the alpha shape algorithm offers the possibility of dealing with roundness data[26].

4.4 Parameters

It is of interest to compare the results of characterization parameters of various robust filtration techniques. Fig. 11 presents the superposition of three reference profiles generated by the robust Gaussian regression filter, the robust spline filter and the morphological alternating symmetrical filter. Table 2 lists the arithmetical mean deviation R a and the root mean square deviation R q of roughness profiles respectively. It is evident that these obtained results differ in their values, which seems to be confusing. However, it is the change of these values, not their absolute values, which reflects the changes in manufacturing process. Thus, the best filter is the one which is most accurate in capturing the change of manufacturing condition.

Fig. 11
figure 11

The reference profiles and roughness profiles obtained by three robust filters

Table 2 Parameter comparison

There is an extra merit brought by morphological filters. The morphological closing envelope and opening envelope with the flat square structuring element can help to compute the fractal dimension, which can serve as an indicator of the geometric complexity or intricacy components of a fractal or partially fractal surface[31].

5 Conclusions

Filtration techniques are motivated by the demands in analyzing modern complicated surfaces produced by cutting-edge manufacturing technologies. The advanced robust filters are superior over their predecessors with more capabilities and better performances. This paper presents a comparison study on existing popular robust filters, consisting of the two-stage Gaussian filter, the robust Gaussian regression filter, the robust spline filter and morphological filters. The mechanisms of these filters are discussed in a brief manner, while more work dedicates to the comparison of these filters in terms of functionality, mathematical computation, capability and characterization parameters. As a result, it offers metrologists a guideline to choose the appropriate filter for various applications. It could be foreseen that more filtration techniques will appear by incorporating advanced mathematical tools as required by modern manufacturing technologies, metrologists should more carefully compare the usages of these analysis tools and choose the right candidate for surface filtration.