# 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
Fuzzy set is closer to a real description of the objective world. The basic calculation process of the point cloud is as follows. **Step 1. ** Input the point data set \(p=\{p_{1},p_{2},\ldots,p_{n}\}\), where \(p_{i}\) is \((x,y,z,i,j,k,MC_{i},\rho_{i})\). Then go to **Step 2;**

**Step 2. ** Parameter initialization. These parameters mainly include the cluster number \(C\), fuzzy index \(m\), iteration termination threshold \(\varepsilon\) and maximum iteration number \(T\). The random initialization membership matrix \(U=\left[u_{ki}\right]_{\mathcal{CN}}\), which satisfies Equation (13). Then, go to **Step 3**;

\[\left\{ \begin{array}{c}u_{ki}\in[0,1],\forall i=1,2,\ldots,n,\forall k=1,2, \ldots,c\\ \sum_{k=1}^{c}u_{ki}=1,\forall i=1,2,\ldots,n\\ 0<\sum_{i=1}^{n}u_{ki}<n,\forall k=1,2,\ldots,c\end{array} \right., \tag{13}\]where \(U=[u_{k}]_{\leq\alpha n}\) is the membership matrix. **Step 3. ** Calculate the clustering center \(c\), as shown in Equation (14). \[c_{i}=\frac{\sum_{j=1}^{n}u_{ij}^{m}x_{i}}{\sum_{j=1}^{n}u_{ij}^{m}}. \tag{14}\]

**Step 4. ** The value of the objective function is calculated according to Equation (15). \[J(U,V)=\sum\
olimits_{k=1}^{c}\sum\
olimits_{i=1}^{n}u_{ki}^{m}\parallel x_{ i}-v_{k}\parallel^{2}. \tag{15}\]

\(c\in[2,n]\) is the clustering number, \(\parallel x_{i}-v_{k}\parallel\) is the Euclidean distance between sample \(i\) to clustering center \(k\) and \(m\in[1,+\infty)\) is the fuzzy index used to control data partitioning. The value of this parameter is generally set as 2. and \(V=\{v_{1},v_{2},\ldots,v_{c}\}\) is the clustering center. **Step 5. ** Calculate the new membership matrix \(J\), as shown in Equation (16). \[u_{ij}=\frac{1}{\sum\
olimits_{k=1}^{c}\left(\frac{d_{ij}}{d_{ij}}\right)^{ \frac{2}{n-1}}}. \tag{16}\]

**Step 6. ** The termination judgment is calculated. When the maximum iteration number meets the requirements or reaches the threshold, the algorithm is terminated and the result is output. If not, return to **Step 2**. until the iteration number meets the requirements. In this article, PCD is clustered by FCM and the feature area and non-feature area of the PCD are divided by the mean curvature of each clustered area. The average curvature \(\overline{MC_{i}}\) of each area is obtained from the above calculation and the overall average curvature of the \(\overline{MC}\) and the standard deviation \(MC_{std}\) can be calculated, as shown in Equations (17) and (18):

\[\overline{MC}=\frac{1}{n}\sum\
olimits_{i=1}^{c}\overline{MC_{i}} \tag{17}\]

\[MC_{std}=\sqrt{\frac{\sum\
olimits_{i=1}^{c}\left(\overline{MC}-MC_{i}\right) ^{2}}{n-1}}. \tag{18}\]

This determines whether the area is a feature part. When \(\overline{MC_{i}}>L\), this area is a feature area and the other area is a non-featured area, as shown in Equation (19):

\[L=\overline{MC}+\sigma\times MC_{std}, \tag{19}\]

where the value of \(\sigma\) is 1 to 5. Considering the above discussion, the calculation process of the new point cloud algorithm based on FCM is shown below. **Step 1. ** Input point cloud data \(P=\left(p_{1},p_{2},\ldots p_{k}\right)^{T}\). Initialize the algorithm parameters and then go to **Step 2**. **Step 2. ** Calculate the normal vector \(l(i,j,k)\) of the PCD using the PCA algorithm and correct the direction of the normal vector, then go to **Step 3**. **Step 3. ** Based on the results in **Step 2** calculate the mean curvature and point density of the point cloud data by MSLM; then, go to **Step 4**. **Step 4. ** Divide the point cloud by the coordinates of the point cloud combined with the vector, the mean curvature and density, then go to **Step 5**. **Step 5. ** The non-feature area simplification of the PCD. The non-feature area point clouds are relatively flat and evenly distributed. It is useful to simplify the distribution of non-featured areas by using the bounding box algorithm [42], which can provide a reliable way to simplify non-feature areas by setting the required simplification parameters. The algorithm flow is as follows:

**Step (1).