# Automatic Measurement of Inclination Angle of Utility Poles Using 2D Image and 3D Point Cloud
## 2 The Proposed Method
### Utility Pole Point Cloud Segmentation  
#### 2.4.1 Preprocessing  
The frustum point cloud obtained by the 3D reconstruction still contains some background interference points. Before the point cloud segmentation, preprocessing is performed to remove noise and enhance features for the segmentation. The processing method is as follows.  
(1) Because the statistical filter has a better effect on the removal of outliers with large density differences, the statistical filter is used to filter the frustum point cloud. The principle of the statistical filter is as follows. Calculate the average distance \(d_{i}\) from each point to the \(k\) points in the neighborhood. The average distance of all point clouds conforms to the Gaussian distribution. A distance threshold \(d_{max}\) is set by the mean \(\upmu\) and standard \(\sigma\) deviation of the Gaussian distribution. Points whose average distance exceeds the distance threshold are defined as outliers \(\textit{outlier}_{i}\). The statistical filter can be written as  
\[d_{i}=\frac{1}{k}\sum_{j=1}^{k}\sqrt{\big{(}x_{ij}-x_{i}\big{)}^{2}+\big{(}y_ {ij}-y_{i}\big{)}^{2}+\big{(}z_{ij}-z_{i}\big{)}^{2}} \tag{8}\]  
\[\upmu=\frac{1}{n}\sum_{i=1}^{n}d_{i} \tag{9}\]  
Figure 10: 3D reconstruction results.  
\[\sigma=\sqrt{\frac{1}{n}\sum_{1}^{n}(d_{i}-\mu)^{2}} \tag{10}\]  
\[d_{max}=\mu\pm\alpha\cdot\sigma \tag{11}\]  
\[outlier_{i}=\left\{\begin{array}{cc}true,&d_{i}>d_{max}\\ false,&others\end{array}\right. \tag{12}\]  
where, \(\left(x_{i}\,y_{i}\,z_{i}\right)\) represents the coordinate of any point in the point cloud, \(\left(x_{ij}\,y_{ij}\,z_{ij}\right)\) represents the coordinate of any adjacent point among the \(k\) points in the neighborhood, \(n\) represents the number of point clouds, and \(\alpha\) represents the standard deviation coefficient.  
(2) The visible point is determined from the viewpoint position, and the color is added to the visible point, which can not only increase the color feature of the pole and improve the point cloud recognition rate, but also distinguish the pole and the noise point, which is conducive to the point cloud labeling.  
(3) The down sampling process can reduce the density of the point cloud. In order to ensure that the point cloud after down sampling maintains the original structure as much as possible, a uniform down sampling method is used. The number of frustum point clouds varies, which is inconvenient as an input sample for the PointNet model. Randomly select \(N\) point from the point cloud for a fixed number, and repeat the selection when the number of point clouds is less than \(N\).  
(4) Normalization can accelerate the convergence speed of the model. The frustum point cloud contains 6 dimensions (\(x,y,z,r,g,b\)), and the point cloud is normalized using Equation (13).  
\[\left\{\begin{array}{cc}x_{1}=\frac{x_{0}-\mu}{\sigma}\\ c_{1}=c_{0}/255\end{array}\right. \tag{13}\]  
where, \(x_{0}\) represents the position (\(x,y,z\)) data of the original coordinate point, \(x_{1}\) represents the position data of the normalized coordinate point, \(\mu\) is the mean of the original coordinate point position data, \(\sigma\) is the variance of the original coordinate point position, \(c_{0}\) represents the color of the original coordinate point (\(r,g,b\)) data, \(c_{1}\) representing normalized color data.  
Here, \(k\) is set to 20, and \(\alpha\) is set to 2. The down sampling multiple is 5. After down sampling, the original point cloud of about 25 k is reduced to about 5 k. \(N\) = 4096 is selected as the fixed number of point clouds. Figure 11 shows the intermediate process of preprocessing.  
Figure 11: Point cloud preprocessing. (**a**) The frustum generated by the mask and depth map, where the pole points are in the red dot line box; (**b**) The illustration of the noise filter processing. In this case, the red points are noise; (**c**) Adding color (blue) from viewpoint direction.