# 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
\(F\big{(}p_{i,k}\big{)}\) is the FPFH feature of point \(p_{i}\), as determined in Equation (24):

\[F\big{(}p_{i,k}\big{)}=\text{SPFH}\big{(}p_{i,k}\big{)}+\frac{\sum_{j=1}^{k} \omega_{j}\cdot B\Big{(}p_{i,k}\big{)}}{k}, \tag{24}\]

where, \(B\Big{(}p_{i,k}\big{)}\) is the relative relationship between point \(p_{i}\) and its KNN; \(\omega_{j}\) is the characteristic weighted value of SPFH of point \(j\). **Step 2. ** Similarly, for the reference point cloud \(P^{\prime}\Big{(}p_{1}^{\prime},p_{2}^{\prime},\ldots,p_{n}^{\prime}\Big{)}\), the FPFH is calculated via the normal calculations and a group of points with similar features in the measurement point cloud \(P(p_{1},p_{2},\ldots,p_{n})\) is searched through the FPFH corresponding to the sampling points from the measurement points. **Step 3. ** This step calculates the transformation matrix between the corresponding points and then judges the performance of the current registration transformation by solving the distance error function after the corresponding point transformation. The distance error function here is mostly represented by the Huber penalty function, denoted as:

\[H(\varepsilon_{i})=\left\{ \begin{array}{c}0.5\times\varepsilon_{i}^{2}\;\; \parallel\varepsilon_{i}\parallel<d_{\varepsilon}\\ 0.5\times d_{\varepsilon}(2\parallel\varepsilon_{i}\parallel\
eg d_{ \varepsilon})\;\;\parallel\varepsilon_{i}\parallel\geq\;d_{\varepsilon}\end{array}  \right., \tag{25}\]

where, \(\varepsilon_{i}\) is a preset value and \(d_{\varepsilon}\) is the distance difference after transformation of the point corresponding to the \(i\) th group. **Step 4. ** Returns **Step 1**-**Step 3** until the maximum number of iterations is reached and outputs the transformation matrix and the spatial coordinates after coarse registration. Fine Registration of the PCD

Although many algorithms have been applied in the field of point cloud registration, they all show a strong initial value dependency and easily fall into local optimization [48]. In addition, their convergence speed is slow, among other issues. In this paper, an intelligent optimization algorithm that provides a new technical tool for this kind of nonlinear optimization problem is adopted to solve the issue of point cloud registration problem. The Teaching-learning-based optimization (TLBO) algorithm is a classic intelligent optimization algorithm proposed by [PERSON] in 2012 [50]. The TLBO algorithm has few parameters. Its basic principle is to simulate the communication process of teachers and students in the class. The calculation process of fine registration using TLBO is as follows:

**Step 1. ** Input the PCD \(P(p_{1},p_{2},\ldots,p_{n})\) after coarse registration and CAD model PCD \(P^{\prime}\Big{(}p_{1}^{\prime},p_{2}^{\prime},\ldots,p_{n}^{\prime}\Big{)}\). Then go to **Step 2**. **Step 2. ** Algorithm initialization. Initialize the class of students \(X=(x_{1},x_{2},\ldots,x_{n})\), where \(n\) is the number of students. Student \(x_{i}\) in the class is defined as \(x_{i}=\Big{(}x_{i1},x_{i2},\ldots,x_{ij}\Big{)},j=1,2,\ldots,D,j=1,2\ldots\) where \(x_{ij}\) represents the subject \(j\) learned by student \(i\), \(D\) is the total subjects learned (6 in this paper), the upper and lower limits of each subject are \(U\) and \(L\), the total number of iterations is \(T\) and \(x_{best}\) is the optimal solution. The objective function is shown in Equation (23). The students are randomly generated as shown in Equation (26). Then go to **Step 3**. \[x_{ij}=L+rand\times(U-L), \tag{26}\]

where, \(rand\) is the random number generation function. **Step 3. ** Teaching process. The fitness value is calculated for the students in the class using Equation (23). This process primarily simulates the teaching process of the class from the teacher to the students.