# Research on the Visual Guidance System of Zoning Casting Ginding Based on Feature Points
## 3 Zoned Grinding Strategy Based on Feature Point Groups
### Point Cloud Data Processing  
(1)Point cloud preprocessing  
This study separates the entire point cloud into numerous voxels using voxel raster filtering in the pre-processing stage to reduce the number of point clouds and the computation of subsequent processing and to ensure the system's operating speed. A weighted average of the voxel's points is employed to create a single point that will replace them all [15]. The effect is shown in Figure 6a. The region of interest (ROI) is separated initially, and pass-through filtering is then used in the ROI to swiftly remove the environmental data that was acquired by the structured light camera [16]. The effect is shown in Figure 6b. To exclude outliers that do not fit the norm, statistical filtering is performed [17]. Figure 6c displays the outcome following one processing using the aforementioned technique. (2)Point cloud partitioning  
To eliminate part of the environmental information from the inserted castings, the random sample consensus (RANSAC) technique is utilized to calculate the error between the sample locations and the model parameters. As illustrated in Equation (9), the RANSAC algorithm chooses the best model by minimizing the cost function \(J\)[18]. Iteration can be used to find the set of interior points with the greatest number of interior points [19]. Equation (10) provides the expression for the ideal \(k\) number of model iterations [20; 21]:  
\[J=\sum_{d\in D}L(E(d;S)) \tag{9}\]  
Figure 6: Results of different point cloud pretreatment methods. (**a**) Rendering of voxel grid filtering. (**b**) Straight through filtering effect diagram. (**c**) Effect diagram of statistical filtering. \[k=\frac{log(1-p)}{log(1-\omega^{n})} \tag{10}\]  
In Equation (9), \(D\) is the point cloud data set, \(L\) is the loss function, \(E\) is the error function corresponding to the loss function, and \(S\) is the identified model parameters. In Equation (10), \(p\) is the probability of occurrence of valid data, \(\omega\) is the proportion of correct data to the overall data, and \(n\) is the minimum sample data in the point cloud. The inner point set with the highest number of inner points is the environmental information that needs to be fitted to the plane and removed. (3) Point cloud registration  
By figuring out the rigid matrix transformation relationship between the two point cloud images, point cloud registration is the process of aligning two point cloud images with overlapping regions to the same coordinate system [22]. Before converting the latter coordinate system into the former through the transformation matrix, the two-point cloud maps must first be registered. Equation (11) is used to calculate how to change the coordinates of the m points under the coordinate system of the \(n\)th map to the coordinate system of the first map:  
\[\begin{array}  
The local coordinate system is established at the feature point \(P_{s}\), with the normal phase vector \(\overset{\rightarrow}{n_{s}}\) at this point as the \(u\)-axis and the \(w\)-axis are perpendicular to the plane formed by \(\overset{\rightarrow}{n_{s}}\) and \(\overset{\rightarrow}{P_{S}}\)\(P_{t}\). The local coordinate system is established according to Equation (12):  
\[ \begin{cases}\overset{\rightarrow}{u}=\overset{\rightarrow}{n_{s}}\\ \overset{\rightarrow}{v}=\overset{\rightarrow}{n_{s}}\times\frac{\left( \frac{P_{t}-P_{t}}{P_{t}-P_{t}}\right)}{\left\|\overset{\rightarrow}{w}=u \times\overset{\rightarrow}{v}\right\|}\\ \end{cases}  \tag{12}\]  
The angle \(\alpha\) between the normal vector \(\overset{\rightarrow}{n_{t}}\) at point \(P_{t}\) and the \(w\)-axis, the angle \(\varphi\) between \(\overset{\rightarrow}{P_{S}}\)\(P_{t}\) and the \(u\)-axis, the angle \(\theta\) between the normal vector \(\overset{\rightarrow}{n_{t}}\) at \(P_{t}\) and the \(u\)-axis after projection on the uov plane. The Euclidean distance \(d\) between the two points can be calculated according to Equation (13):  
\[