# 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
Although the direction estimated by the point cloud has a certain randomness, the surface fitting result will divide the normal vector into two directions inside and outside, meaning that the same surface normal cannot be unified and affecting subsequent analyses. However, it can be corrected with an algorithm [38], as shown in Equation (9). \[l^{\prime}=\left\{ \begin{array}{c}l\,l(v-p)\geq 0\\ -l\,l(v-p)<0\end{array} \right., \tag{9}\]

where, \(l\) is the normal vector and \(v\) is the viewpoint direction. Curvature Estimation of the PCD

The curvature information of the point also reflects the degree of bending deformation in the point position. In general, the characteristic value can be obtained by the covariance matrix of the local point cloud by PCA. Then, the characteristic value can be estimated by the eigenvalues. Because the normal vector was adjusted by PCA in Equation (9). The eigenvalues change accordingly. On the other hand, the accurate point cloud normal vector provides parameter information for the local surfaces in Equations (7), (8) and (9). Based on the above analysis and discussion, this paper uses the move least square method (MLSM) [39] to calculate the point cloud curvature. The calculation process is as follows. **Step 1. ** Input the point cloud coordinate \(p_{i}(x_{i},y_{i},z_{i})\) and the normal vector \(l(i,j,k)\);

**Step 2. ** Establish a surface implicit function that enables the local energy function E(x) to be minimal in the \(n\)-direction vector field as shown in Equations (A3) and (A4);

**Step 3. ** Further calculations can obtain Gaussian curvature, as shown in Equation (10):

\[\text{GC}=-\frac{\det\left[ \begin{array}{cc}\
abla(\
abla f(x))&\
abla^{T}f( x)\\ \
abla f(x)&0\end{array} \right]}{\left\|\
abla f(x)\right\|\,\|^{\ast}4} \tag{10}\]

The mean curvature is shown in Equation (11):

\[\text{MC}=\frac{\left\|\,\
abla f(x)\,\right\|^{2}\!tr\
abla-\
abla f(x)\
abla (\
abla f(x))\
abla^{T}\!f(x)}{\left\|\,\
abla f(x)\,\right\|^{\ast}3}, \tag{11}\]

where \(\
abla\) is the gradient operator and \(\
abla(f(x))\) is the black plug matrix. In this paper, the average curvature is taken as the calculation parameter of the curvature of the point cloud. Point Cloud Density Calculation

The density of the point cloud is also an important parameter to measure the location of the point cloud. There are many ways to estimate the density of the point cloud. In this paper, the reciprocal of the average distance between the point and the neighborhood point \(k\) is taken as the density parameter \(\rho_{i}\) of point \(p_{i}\), as shown in Equation (12):

\[\rho_{i}=\frac{1}{\frac{1}{k}\sum_{i=1}^{i=n}\sum_{j=1}^{j=k}d_{ij}}, \tag{12}\]

where \(\rho_{i}\) is the density parameter of point \(p_{i}\). Feature Retention Point Cloud Simplification Algorithm Based on Fuzzy C-Means (FCM)

At present, the clustering algorithm is one of the important methods for data classification. In this paper, the point cloud is segmented by clustering and then different regions are simplified to achieve point cloud sampling. Unlike a traditional hard clustering algorithm which is represented by \(K\)-means clustering [40], FCM [41] adopts a soft partition method. Similarly, unlike traditional deterministic sets, the data ownership of fuzzy sets is uncertain and the degree of data ownership is measured by the degree of data membership. For point set \(p=\{p_{1},p_{2},\ldots,p_{n}\}\), combining the point cloud coordinate data and point cloud geometric information calculated, point cloud data set is expanded from three-dimensional coordinate data \(p_{i}(x,y,z)\) to eight-dimensional data \(p_{i}(x,y,z,i,j,k,MC_{i},\rho_{i})\). Then, data set \(p\) is divided into \(c\) classes by clustering segmentation. The subsample data is \(p_{c}=\left\{p_{c,1},p_{c,2},\ldots,p_{c,i}\right\}\), where the membership function of the fuzzy set is \(F(p_{c})\). The closer \(F(p_{c})\) is to 1, the greater the degree that it belongs to the same set and vice versa.