# An Advanced Vehicle Body Part Inspection Scheme Based on Scattered Point Cloud Data
## 3 Materials and Methods
### Methods
#### 3.2.2 Denoising of PCD Based on a Hybrid Filtering Algorithm
\[d_{ij}=\sqrt{\left(p_{i,x}-p_{j,x```
Begin 1. Input \(P_{i}(p_{1},p_{2},\dots,p_{n})\); 2. Initialization Parameter \(k\), \(\sigma\), \(x_{init}\), \(y_{min}\), \(z_{min}\), \(x_{max}\), \(y_{max}\), \(z_{max}\); 3. Denoise point data according to Equation (1); Output \(P_{i}(p_{1},p_{2},\dots,p_{n^{\prime}})\); 4. Create \(k\)-\(d\) tree For\(i=1\) to \(n^{\prime}\) Build all point \(k\)-\(d\) tree; End; 5. Create \(K\)NN For\(i=1\) to \(n^{\prime}\) Build all point \(kd\)-tree; End; 6. Statistical filter For\(i=1\) to \(n^{\prime}\) Calculate point KNN mean distance \(\overline{d_{i}}\) according to Equations (2) and (3); Calculate mean value \(\overline{d}\) and standard deviation \(d_{std}\) of all \(\overline{d_{i}}\) according to Equations (4) and (5); Determine whether point \(p_{i}\) is a noise point according to the Equation (6); End; Output \(P_{i}(p_{1},p_{2},\dots,p_{n^{\prime}})\); End
```

**Algorithm 1** Pseudocode of hybrid denoising algorithm

Based on the above discussion, this paper uses the measured part data and related denoising algorithm to verify the hybrid denoising method. The experimental results are shown in Figure 5.

From the experimental results, in the results of Figure 5b, the Laplace denoising effect is poor. Figure 5c present the neighborhood filter and Figure 5d shows the statistical filtering denoising results.

Figure 5: Point cloud denoising experiment. (**a**) is the initial point cloud data, (**b**) is the calculation result of Laplace filtering, (**c**) is the calculation result of neighborhood filtering, (**d**) is the calculation result of statistical filtering, (**e**) is the calculation result of straight- through filtering, and (**f**) is the calculation result of hybrid filtering in this paper.

Here, the external data noise density distribution characteristics are similar to those of the target point cloud and the area is larger. The two algorithms with good performance in the random denoising process cannot effectively remove the noise and invalid points outside the target point cloud. Therefore, it is necessary to adopt different strategies to remove different types of noise data from the point cloud. It can be seen from the experimental results in Figure 5e that the straight-through filtering algorithm can effectively filter invalid point cloud data. As shown in Figure 5f, the hybrid algorithm can remove large-scale noise points and outliers from the initial point cloud. The new algorithm can ensure the precision and accuracy of denoising for the vehicle point cloud data measured in this paper.

#### 3.2.3 Simplification of PCD Based on FCM

Initial point cloud data usually feature a large amount of data, which will greatly affect the efficiency of subsequent point cloud analyses. To simplify the point cloud data, this paper designs a point cloud simplification algorithm based on feature retention. The specific calculation process is as follows.

Normal Vector Estimation of PCD

Principal component analysis (PCA) [38] is a dimensionality reduction algorithm for data analysis without parameter limitations. The normal vector of a point is estimated by fitting the neighborhood of that point into a plane. For a point cloud \(P=\left(p_{1},p_{2},\ldots p_{k}\right)^{T}\) with a certain point \(p_{i}\) first build a \(k\)-d tree and \(K\)NN; then, constructs the local plane \(E\) by using a fitting process for these points, as shown in Equations (A1), (A2), (7) and (8).

\[C_{0}=\frac{C}{n}=\frac{1}{n}\sum_{i=1}^{n}(p_{i}-\overline{p})^{T}(p_{i}- \overline{p}) \tag{7}\]

\[C_{0}e_{m}=\gamma_{m}e_{m}, \tag{8}\]

where \(C_{0}\) is a symmetric semidefinite matrix; eigenvalues \(\gamma_{0}\),\(\gamma_{1}\),\(\gamma_{2}\) which satisfy that \(\gamma_{0}\leq\gamma_{1}\leq\gamma_{2}\) and the three eigenvalues are non-negative real numbers. The eigenvector corresponding to the minimum eigenvalue is a normal vector \(l(i,j,k)\) of the least-squares fitting plane required.