# Feature Point Identification in Filtel Weld Joints Using an Improved CPDA Method
## 3 Feature Points Extraction Method in Fillet Welding
### Improved CPDA Corner Detection Method  
After obtaining the contour-like laser center line, the subsequent crucial step involves identifying the feature corner points while they are directly related to the 3D location of the weld seam. In the literature, various methods for detecting corners and/or interest-points have been proposed, primarily falling into two categories: image intensity-based and contour-based methods. In intensity-based corner detection methods, it is necessary to evaluate the grayscale gradient at each pixel within its local neighborhood. A point is deemed a candidate corner point when the grayscale exhibits significant variations in all directions within the local region. Examples of such methods include BRISK (binary robust invariant scalable keypoints) [27] and SIFT (scale-invariant feature transform) [28] detectors. However, in filled welding applications, the grayscale variance within the laser line is typically small (as illustrated in Figure 2b), while the edge contour is quite obvious. Consequently, the contour-based algorithm is better suited for identifying corner feature points in the weld seam. The contour-based CPDA (chord-to-point distance accumulation) algorithm [29] was originally introduced in 2008 for discrete curvature estimation. As an enhancement of the CSS (curvature scale-space) [30] algorithm, which identifies corners as the points with maximum curvature along the contour, the CPDA method calculates the Euclidean distance accumulation instead. This approach avoids the need for calculating first and second derivatives, thereby improving the robustness and computational efficiency of the corner feature point. The principles underlying the CPDA technique are illustrated in Figure 3.  
In Figure 3, \(P_{1}\), \(P_{2}\), \(P_{3}\),..., \(P_{n}\) are points on a curve \(P\). Point \(P_{1}\) signifies the starting point of curve \(P\), while \(P_{n}\) marks its end point. In the CPDA algorithm, a chord is moved along the curve \(P\) and the perpendicular distances between each point \(P_{i}\) on the curve to the chord \(d_{ij}\) is summed up to represent the curvature at that specific point. The computation diagram for the corresponding value of corner point \(P_{i}\) is detailed as follows:  
* First, a reference chord-of-length \(L\) was defined. In Figure 3, for instance, the value of \(L\) value has been set to 10. * For each detected point \(P_{i}\) on the curve \(P\), the point \(P_{i-L+1}\) was taken as \((L-1)\) distance backward while \(P_{i+1}\) was taken as 1 distance forward. So, a chord \(C_{L}\) between these two points can be obtained. * We calculated the distance from \(P_{i}\) to chord \(C_{L}\), denoted as \(d_{i,i-L+1}\). * We moved the chord \(C_{L}\) on each side of \(P_{i}\) one pixel in the same direction along the curve \(P\) while maintaining the length of the \(C_{L}\) value as \(L\). Then, similarly, calculate the distance from each point to the chord. * We repeated the former operation until one of the points on the chord was \(P_{i}\). Then, the calculation was stopped. The chord-to-point distances were accumulated as: \[h_{L}(i)=\sum_{j=i-L+1}^{i-1}d_{i,j}\] (10) where \(d_{i,j}\) is chord-to-point distance as each point \(P_{i}\). \(h_{L}\) is the chord-to-point accumulation value with the chord-of-length of \(L\). The algorithm described above includes the calculation of the distance between two points and the computation of the chord-to-point distance. These distances are calculated using the following formulas, respectively. \[C_{L}=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}} \tag{11}\]  
\[d_{i}=\frac{\left|Ax_{i}+By_{i}+C\right|}{\sqrt{A^{2}+B^{2}}} \tag{12}\]  
Figure 3: Schematic diagram of CPDA calculation of point–chord distance. where \((x_{1},y_{1})\) and \((x_{2},y_{2})\) are coordinates of two points, respectively. \(d_{i}\) is the distance from point \((x_{i},y_{i})\) to line \(Ax+By+C=0\). Directly applying the CPDA algorithm with the above formulas may yield incorrect feature points.