# A Deep Learning-Based Approach for Extraction of Positioning Feature Points in Lifting Holes
## 2 Methods
### The Point Extraction Method Based on Line Features
#### 2.4.2 Clustering Method for Boundary Points  
Different situations call for different methods. If the target region is larger (Figure 7a), it is preferable to utilize the principal components of the boundary points for fitting. This approach allows us to disregard the protruding portion and only utilize the points within the normal range. Due to manufacturing processes and the influence of model segmentation performance, the boundary points of the segmentation results may exhibit situations depicted in Figures 7c and 8b, or even more severe cases. In such cases, fitting the convex hull points of the contour provides better results. Determining the convexity (CX) or concavity (CA) of an image can typically be accomplished using the vector cross-product method, which yields the number of non-convex points and offers excellent scalability. The vector cross-product method involves calculating  
Figure 8: Fitting diagram. (**a**) Schematic diagram of judging CX; (**b**) fitting convex hull; (**c**) cluster results. Figure 7: Existing problems. (**a**) Harris corner detector; (**b**) canny edge detector; (**c**) the impact of segmentation on centroid. the normal vector of a vertex by taking the cross-product of two adjacent edge vectors. Subsequently, the counterclockwise calculation of the normal vector for the polygon is performed. If the direction of the normal vector of a specific point is opposite to the direction of the polygon's normal vector, the vertex is considered concave, as shown in Figure 8a. The specific calculation method is as follows:  
1. For an \(N\)-sided shape, select any point \(P\) as the starting point, and counterclockwise construct an edge vector \(\mathbf{V}_{k}\) from the endpoints of each edge, where \(k\leq N\)
2. For any three adjacent points \(P_{m},P_{t},P_{n}\), with their corresponding edge vectors denoted as \(\mathbf{V}_{m},\mathbf{V}_{n}\), if \(\mathbf{V}_{m}\times\mathbf{V}_{n}\geq 0\), \(P_{t}\) indicates a non-concave point; otherwise, it represents a concave point. The discriminative illustration is shown in Figure 8a, where concave and convex points have normal vectors with different rotational directions. Even if the predicted region appears to be a convex polygon, there may still exist some concave points in certain details. Therefore, we conducted tests on 200 predicted images and found that when the threshold for the number of concave points is set to 3, the algorithm can perfectly determine whether to use boundary points fitting or convex hull points fitting. The boundary points are distributed in a strip shape in the two-dimensional space. For elongated samples with a flattened elliptical distribution (normal distribution ellipse), Gaussian mixture models are well suited for data clustering of this nature. The Gaussian mixture model (GMM) can be used to consider the sample points as a combination of multiple Gaussian distributions (GDs), where each GD corresponds to a cluster in the point set. Since GDs exhibit a bell-shaped curve in space, they can better adapt to the clustering of strip-shaped point sets. For a multivariate random variable following a GD, the expression is as follows:  
\[\mathcal{N}(\mathbf{x}|\mathbf{\mu},\mathbf{\Sigma})=\frac{1}{(2\pi)^{\frac{d}{2}}|\mathbf{ \Sigma}|^{\frac{1}{2}}}\exp\left[-\frac{1}{2}(\mathbf{x}-\mathbf{\mu})^{\mathrm{T}}\bm {\Sigma}^{-1}(\mathbf{x}-\mathbf{\mu})\right] \tag{9}\]  
where \(\mathbf{\mu}\) is the mean vector of dimension \(d\), \(\mathbf{x}\in\mathbf{R}^{\mathrm{d}\times\mathrm{d}}\) is the covariance matrix of dimension, and \(|\mathbf{\Sigma}|\) represents the determinant of matrix \(\sum\). In the GMM, each cluster is represented by a multivariate Gaussian distribution (GD), where \(p(\mathbf{x}_{i}|\theta_{j})=p(\mathbf{x}_{i}|\mathbf{\mu}_{j},\mathbf{\Sigma}_{j})\). Let \(C\) represent the number of clusters. According to the above equation, each point \(\mathbf{x}_{i}\) is a linear combination of \(C\) GDs.