# Research on a Bone Stick Fragment Stitching Method Based on Improved Corner Detection
## 2 Improved Corner Detection Method
### Multi-Scale and Multi-Stage Corner Detection Method
#### 2.2.3 Multi-Scale Corner Detection Strategy  
Finally, to overcome the problem that the FAST corner detection algorithm and the Shi-Tomasi corner detection algorithm are not stable at different scales, and to ensure that significant corners are stably detected in complex edges and broken areas, a multi-scale corner detection strategy is used. By constructing an image pyramid, corner detection is repeated for each level of the image, and the corners that are stably detected at multiple scales are retained. Finally, the corners are merged across scales to ensure the stability and distinctiveness of the final corner set, and the maximum outer contour features of the bone stick fragment can be represented by a smaller number of corners that are more evenly distributed. Figure 2 shows the process of the multi-scale and multi-stage corner detection method. The specific steps are as follows:  
1. Image pyramid construction. Starting from the original image, the image is downsampled layer by layer to construct an image pyramid. Before each downsampling, the image is also Gaussian filtered to resist aliasing while retaining sufficiently detailed information. Assuming that the original image is \(I_{0}\), and the resolution of each level \(I_{i}\) is one-half that of the previous level, then: \[I_{i+1}=downsample(I_{i}),\quad i=0,1,\dots,n-1\] (1)  
Figure 2: Flowchart of the multi-scale and multi-stage corner detection method. where \(n\) is the number of pyramid levels, which determines the scale coverage. The resolution downsampling factor is generally 2. This pyramid structure facilitates local corner detection at different scales. 2. Corner detection in the scale. On each scale image \(I_{i}\), the maximum outer contour of the bone stick fragment is successively subjected to Fast corner preliminary detection and Shi-Tomasi corner fine detection to obtain the corner set \(C_{\text{shi},i}\) in this scale: \[C_{\text{shi},i}=\text{Shi-Tomasi}(\text{FAST}(I_{i}))\] (2) where due to the differences in image information at different scales, to make detection consistent across scales, it is usually necessary to appropriately adjust the Shi-Tomasi corner response threshold \(T_{\text{Shi}}\) so that each layer of detection has a similar number of corners and feature distributions. 3. Coordinate mapping and conversion. The coordinates of the detected corner at each scale are based on the coordinate system of the image at that scale. To merge all the corners of all scales on the original image, these coordinates need to be converted back to the original resolution. Assuming that the coordinates of the detected corner at a certain scale \(i\) are \((x_{i},y_{i})\), the coordinates corresponding to this coordinate at the original resolution are: \[(x_{0},y_{0})=(x_{i}\times 2^{i},y_{i}\times 2^{i})\] (3) where \(2^{i}\) is a multiple of the downsampling factor corresponding to the scale. 4. Corner merging rules. During the merging process, if the detected corners are repeated at different scales, it is considered that these corners exhibit consistently significant characteristics at different scales, and therefore are preferentially retained. However, there may be small differences in the coordinates of the same corner after coordinate mapping, so for the judgment of duplicate corners, a distance threshold \(T_{d}\) can be set. If the Euclidean distance between two corners is less than \(T_{d}\), they are considered to be the same corner: \[d=\sqrt{(x_{1}-x_{2})^{2}+(y_{1}-y_{2})^{2}}<T_{d}\] (4)
5. Multi-scale corner merging. The set of detected corners \(C_{\text{shi},i}\) is mapped at all scales \(i\) to the coordinate system of the original image to obtain the multi-scale corner set \(C_{\text{mapped},i}\). Then, the corner set \(C_{\text{mapped},i}\) is merged at each scale, and the maximum number of corners allowed is set to be retained to \(N\).