# Research on a Bone Stick Fragment Stitching Method Based on Improved Corner Detection
## 2 Improved Corner Detection Method
### Corner Screening  
To make full use of the characteristics of the broken edges of bone stick fragments, combined with the specific research samples of bone stick fragments and the actual needs of stitching, a double screening strategy based on local templates and sliding window density analysis is adopted. The corner set is optimized by combining weights, and significant corners at the broken edges are preferentially retained. The corner screening method used mainly analyses the local curvature and corner density together to ensure that the final set of corners retained not only has significant features but also better highlights the fracture edge features of the bone stick fragments, thereby improving the priority and success rate of subsequent matching and stitching of the bone stick fragments. The specific steps of this method are as follows:  
1. Local curvature screening. For each corner \(p\) in the corner set \(C_{\text{multi}}\) obtained by multi-scale corner detection, a fixed window centered at \(p\) is set, and the significance of the corner is measured by calculating the curvature change within the window. The curvature \(k\) is calculated as follows: \[k=\frac{|x^{\prime}y^{\prime\prime}-y^{\prime}x^{\prime\prime}|}{\left(x^{ \prime 2}+y^{\prime 2}\right)^{3/2}}\] (7) where \(x^{\prime}\) and \(y^{\prime}\) represent the first derivative of the curve, and \(x^{\prime\prime}\) and \(y^{\prime\prime}\) represent the second derivative of the curve. The curve can be obtained by approximating the contour points adjacent to the point using the difference method. A threshold \(k_{th}\) for the significance of the curvature is also set. If the curvature value \(k\) of a corner point is less than \(k_{th}\), the corner point can be considered insignificant. 2. The sliding window calculates the corner density. The length of the sliding window \(w\) is set to 0.1 times the length of the maximum outer contour \(L\), i.e., \(w=0.1\times L\), and the window movement step is set as follows \(\Delta w=0.5\times w\). Then, starting with the initial contour point of the maximum outer contour as the center, the sliding window \(W_{i}\) is moved clockwise and the number of corners \(N_{i}\) are calculated in each window. The corner density function \(D(W_{i})\) is then: \[D(W_{i})=\frac{N_{i}}{|W_{i}|}\] (8) where the sliding window is square, with \(|W_{i}|\) as the window size and a value of \(w^{2}\), which prevents corners from being missed. The initial window center point is the point closest to the \((0,0)\) point on the largest outer contour. Figure 3 shows the sliding process of the sliding window on the maximum outer contour, where black represents the maximum outer contour of the bone stick fragment, red dots represent the corner marks on the maximum outer contour before screening, green squares and blue squares represent the movement trajectory of the sliding window, and arrows indicate the sliding direction is clockwise. The density threshold \(T_{\text{density}}\) is also set. If the corner density in the window satisfies \(D(W_{i})>T_{\text{density}}\), the area is considered to have a high corner density and is a possible broken edge area. 3. Joint screening. To ensure that the final set of corners accurately reflects the characteristics of the broken edges, each corner needs to be jointly screened. For each corner \(p\), if the curvature value \(k<k_{th}\), but the corner is located in a window with higher density, that is, if \(D(W_{i})>T_{\text{density}}\), then the corner is retained; otherwise, it is removed. This combined corner screening ensures that, as far as possible, corners on broken edges are retained preferentially, while corners on other edges with lower curvature values are eliminated. At the same time, regions with a higher density are identified, and all corners in these regions are marked as broken edge corners to form the broken edge set \(E_{\text{break}}\). 4. Determine the final set of corners.