## 2 Development of the System for Point-Data Pre-Processing
### Module 3--Cross-Sectional Filtering/Smoothing of Point Data  
The function of this module is two-fold: filtering and smoothing of point data in cross-sections (scanned lines). It is dedicated to elimination of errors left after 3D filtering, as well as elimination of noise which affects the quality of the resulting surface model. The module is based on four tools:  
* Elimination of points at the ends of scanned curves;
* Filtering by the angle method;
* Filtering/smoothing by the method of median;
* Smoothing by the method of mean.  
The first tool (a) is dedicated to elimination of points at the ends of scanned curves. These points are often problematic because they are the result of unwanted contacts between the sensor and the fixture, measurement table and similar objects, but were not eliminated in the process of 3D filtering. User is called to define the number of points that should be eliminated at the ends.  
The angle method (b) is dedicated to elimination of outliers, _i.e._, impulse noise, and the principle is presented in Figure 4(a). The pre-defined angle value in SyPreF is \(\alpha=10^{\circ}\), and it can be optionally changed according to user's needs.  
The principle of the method of median is mathematically defined as:  
\[y(i)=\mathrm{Med}[x(i-N),x(i+N)] \tag{1}\]  
Figure 4: Principles and effects of methods for cross-sectional filtering/smoothing. **(a)** Method of angle. **(b)** Elimination of impulse noise by method of median. **(c)** Point data smoothing by median filter in cases of stepped increments. **(d)** Point data smoothing by mean filter in cases of stepped increments.  
where \(x(i)\) is input data, \(y(i)\) output data, and \(N\) is a half width of the filter window (the number of points which is considered on one side of the analyzed point) [40].  
The principle of the method of mean is based on statistical mean of the specified data array \(x(i-N,...,i+N)\) defined, as in median filter, by the filter window width (\(N\)):  
\[y(i)=\text{Mean}[x(i-N),x(i+N)] \tag{2}\]  
The method of median can also be used for elimination of outliers as well as for point data smoothing, while the method of mean is exclusively used for smoothing [21]. As presented in Figure 4(b), the median filter can be useful in elimination of impulse noise. In contrast to the angular filter, this filter retains the analyzed point in the array, but it changes the \(y\)-coordinate. Therefore, its use may make more sense in cases of lower density point data from geometrically more complex objects.  
Moreover, the median filter tends to preserve the shape even in cases of stepped increments (Figure 4(c)). This is its main advantage compared to the mean filter (Figure 4(d)), which is very rarely used, and mainly in cases of noisy point data for shape refinement. However, as the effects of this two filters' application are strongly dependant on filter window's width (\(N\)), it must be considered very seriously in order to avoid unwanted filtering actions, above all the shape modification. It is important to note that larger value of \(N\) with median filter, in general, decreases the possibility of the mentioned unwanted filtering actions.  
Figure 5: Algorithm of module for cross-sectional filtering/smoothing.  
Figure 5 presents the algorithm of the module's software implementation. Each tool is applied on user's request with the option of accepting/changing pre-defined parameter values. The process is infinitely iterative and reversible, _i.e._,--results of tools' application that are graphically presented, can be cancelled by the user.