Research on a Bone Stick Fragment Stitching Method Based on Improved Corner Detection
Abstract
:1. Introduction
2. Improved Corner Detection Method
2.1. Maximum Outline Acquisition
2.2. Multi-Scale and Multi-Stage Corner Detection Method
2.2.1. FAST Corner Detection
- (1)
- Neighboring pixel selection. For each contour point , a circular area with a radius of 3 centered at this point is selected, containing 16 pixels which are numbered , , … . This selection method helps to quickly determine whether the gray level changes around this point are sufficient to make it a corner.
- (2)
- Gray-scale comparison. The gray value of the central pixel is set to be , and a threshold is defined. Then, for each neighboring pixel , if or is satisfied, it is considered that may be a corner.
- (3)
- Continuity determination. Whether or not there are more than consecutive pixels in the neighborhood that meet the above gray difference conditions is checked. If so, point is marked as a corner. This strategy can quickly screen out significant corners from a large number of points, reducing computational complexity.
- (4)
- Non-maximum suppression. Non-maximum suppression is performed on the detected corners to eliminate redundant corners, retain the corners with the strongest response in a local region, and obtain the initial corner set .
2.2.2. Shi-Tomasi Corner Detection
2.2.3. Multi-Scale Corner Detection Strategy
- (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 , and the resolution of each level is one-half that of the previous level, then:
- (2)
- Corner detection in the scale. On each scale image , 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 in this scale:
- (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 are , the coordinates corresponding to this coordinate at the original resolution are:
- (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 can be set. If the Euclidean distance between two corners is less than , they are considered to be the same corner:
- (5)
- Multi-scale corner merging. The set of detected corners is mapped at all scales to the coordinate system of the original image to obtain the multi-scale corner set . Then, the corner set is merged at each scale, and the maximum number of corners allowed is set to be retained to . Then, the duplicate corners are retained preferentially, and the remaining corners are retained in descending order of the Shi-Tomasi corner response value after the duplicate corners. Finally, the first corners in the merged corner set are used as the multi-scale corner set :
2.3. Corner Screening
- (1)
- Local curvature screening. For each corner in the corner set obtained by multi-scale corner detection, a fixed window centered at is set, and the significance of the corner is measured by calculating the curvature change within the window. The curvature is calculated as follows:
- (2)
- The sliding window calculates the corner density. The length of the sliding window is set to 0.1 times the length of the maximum outer contour , i.e., , and the window movement step is set as follows . Then, starting with the initial contour point of the maximum outer contour as the center, the sliding window is moved clockwise and the number of corners are calculated in each window. The corner density function is then:
- (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 , if the curvature value , but the corner is located in a window with higher density, that is, if , 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 .
- (4)
- Determine the final set of corners. Priority is given to corner set in the broken edge area to ensure that there are as many prominent corners on the broken edge as possible during subsequent stitching. The maximum number of corners to be retained is set as to highlight the corner features of the broken edge, while avoiding the final corner set and the number of corners in the middle being too small, which will affect the subsequent matching process. That is, if the sum of the corners in the broken edge area and the corners retained on other edges is less than , then the corners are selected from the other edges in descending order of curvature to make up the difference, until the maximum number of corners to be retained is reached. If this is the case, the corners are sorted directly according to their curvature values, and the top corners are taken as the final corner set. After the final corner set is determined, the corner density of each window is calculated using a sliding window, and the windows are sorted in descending order of corner density to form a set of broken edge markers . Finally, the final corner set and the set of broken edge markers are output.
3. Corner-Based Bone Stick Fragment Stitching Method
3.1. Maximum Outer Contour Division
- (1)
- The mean and median of the corner coordinates are calculated. For all the corners in the corner set, the mean and median of the abscissa and ordinate are calculated, respectively, denoted as , , and . Then, the corner set is sorted in ascending order of the ordinate , or in ascending order of the abscissa if the ordinates are the same. The formulas for calculating the values are as follows:
- (2)
- The sequence of corner points of the upper contour segment is obtained. The top-left corner of the corner set is used as the initial search point and searching is started to the right. If the ordinate of the current corner point is less than the mean and median , the corner point is added to the upper contour segment corner point sequence and is set as the new search point. Searching to the right continues until no corner point meets the conditions.
- (3)
- The sequence of corner points of the lower contour segment is obtained. The bottom-left corner in the corner set is found to be the initial search point and searching is started to the right. If the ordinate of the current corner point is greater than the mean and median , the corner point is added to the sequence of corner points of the lower contour segment and is set as the new search point. Searching to the right continues until no corner point that meets the conditions remains.
- (4)
- The sequences of corner points of the left and right profile segments are obtained. After obtaining the upper and lower profile segments, their corner points are removed from the original set of corner points, and then the remaining corner points are sorted by the ordinate and the set of remaining corner points are traversed: if the abscissa of the current corner point is less than the mean and median , it is added to the left profile segment corner point sequence ; otherwise, it is added to the right profile segment corner point sequence .
- (5)
- Match priority ranking. The degree of overlap between each contour segment and the corner points of the area with the highest and second-highest concentrations of broken edges is calculated. The contour segment with the highest degree of overlap with the area with the highest concentration is selected as the priority match object, followed by the contour segment with the highest degree of overlap with the area with the second highest concentration, and finally the remaining two contour segments are matched. The degree of overlap calculation formula is:
3.2. Multi-Dimensional Corner Feature Sequence Matching
3.2.1. Multi-Dimensional Corner Feature Sequence Transformation
- (1)
- Normalized chord length. First, the Euclidean distance between adjacent corner points is calculated to obtain a sequence of chord lengths, which is then normalized to minimize the effect of errors during capture. For a contour segment with corner points and an associated sequence of chord lengths, the normalized chord length is:
- (2)
- Adjacent angle. The adjacent angle is used to describe the trend of change between three consecutive corner points. The angle characteristics are obtained by calculating the included angle of the triangle formed by the three corner points. The specific formula is:
- (3)
- Rate of change in distance. The rate of change in distance is used to describe the trend of change between neighboring string lengths and is defined as the ratio of the difference between neighboring string lengths to the original string length:
3.2.2. Longest Common Subsequence Matching Algorithm
- (1)
- Corner feature sequence construction. For the contour segments to be matched, the corner sequences of the contour segments are transformed into multi-dimensional corner feature sequences, including normalized chord length, neighbor angle, and distance change rate, using the method in Section 3.2.1.
- (2)
- LCS matching based on dynamic planning [19]. The different corner feature sequences of the sequence to be matched are computed separately using the dynamic planning method. Firstly, the dynamic planning table is created to store the longest matching length of each stage with size , and are the lengths of the two corner feature sequences, and the boundary value of is set to 0. Then, the dynamic planning table is updated by using the state transfer equation:
- (3)
- Backtracking to find the matching segment. Backtracking starts from the end of the dynamic planning table. If the condition is satisfied, it means that the and features match, so the LCS matching segment is joined, and backtracking moves to the previous row and column; otherwise, the direction that makes the value larger is chosen to backtrack until it returns to the boundary of the dynamic planning table; finally, backtracking is then conducted according to the index of the LCS matching segment to find out the matching segment of the corner sequence and to determine the matching corner pairs.
- (4)
- Merge matching segments. After obtaining the matching segments and matching corner pairs of different feature corner sequences, to better meet the subsequent stitching requirements, the matching segments are merged with the normalized chord length as the main feature, and the adjacency angle and distance change rate as the secondary features. If the matching corner pair that exists in both the adjacency angle and distance change rate matching segment does not exist in the normalized chord length corner sequence matching segment, the corner pair is added into the normalized chord length corner sequence matching segment and the matching corner pair, and the normalized chord length corner sequence matching segment and the matching corner pair at this time is the final result.
3.2.3. Priority Matching Strategy
- (1)
- Priority division of contour segments. For Fragments 1 and 2, the maximum outer contour is divided using the method in Section 3.1, and the four contour segments are sorted into a descending contour segment set according to the degree of overlap with the densest and less dense regions. is the densest segment of the fragment and is matched with priority.
- (2)
- Match the densest segments first. For the densest segments and of Fragments 1 and 2, the LCS algorithm in Section 3.2.2 is used to match them, obtain the matched segment and matched corner pairs, and calculate the proportion of matched points and the average matching rate :
- (3)
- The most intensive segment is matched with the less intensive segment. If and do not meet the matching requirements, and , and , and and are matched, respectively, and their RLs are calculated, respectively. The matching requirements in (2) are verified one by one in descending order. If the current meets the matching requirements, the matching is successful and the matching stops; if not, the next step of matching is performed.
- (4)
- Match other contour segments. The combinations in the contour segments of Fragment 1 and Fragment 2 that have not been matched are matched, their are calculated separately, and it is verified whether the matching requirements in (2) are met in descending order, one by one. If and the current meet the matching requirements, the match is successful; if none of the combinations meet the matching requirements, Fragment 1 and Fragment 2 fail to match.
3.3. Fragment Stitching
- (1)
- A coordinate system is established through matching segments. If fragment and fragment are matched, the relative positional relationship between fragment and fragment can be determined through the outline segment to which the matching segment belongs. For example, if the lower outline segment of fragment matches the upper outline segment of fragment , the original images of fragment and fragment are stitched together, with the fragment remaining unchanged as the standard coordinate system for all points, and the abscissa of all points belonging to fragment remaining unchanged while the ordinate becomes twice as large.
- (2)
- Match the segment alignment by rotating and translating. After the coordinate system is established, assuming that the matching segment starts at point and ends at point on fragment , and starts at point and ends at point on fragment , two vectors can be defined:
- (3)
- Error minimization adjustment. After stitching is complete, a simple error minimization adjustment is used to further improve the stitching accuracy and optimize the stitching result. Assuming that after matching the corner pairs, and are the corresponding corner coordinates in the matching corner pair of the current fragment and fragment , respectively, the error function of the matching segment is defined to represent the sum of the Euclidean distances between all corresponding corner pairs on the matching segment:
4. Experimental Results and Analysis
4.1. Experimental Setup and Evaluation Criteria
4.1.1. Source of Experimental Data
4.1.2. Experimental Platform Configuration
4.1.3. Experimental Evaluation Criteria
4.2. Comparison with Other Corner Detection Algorithms
4.3. Comparison with Other Stitching Algorithms
4.4. Analysis of the Universality of Stitching Methods
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Qi, H. Probe into the Archives of Bone Signet in Han Dynasty. Lantai World Shenyang China 2014, 26, 58–59. [Google Scholar]
- Gao, M. The Bone Sticks of the Weiyang Palace in Chang’an City of Han Dynasty (9 Rules). J. Bohai Univ. (Philos. Soc. Sci. Ed.) 2022, 44, 86–89. [Google Scholar]
- Gao, J. Restudy of the Name and usage of the bone tallies unearthed from the Han period Chang’an city-site. Huaxia Archaeol. 2011, 3, 109–113. [Google Scholar]
- Zhao, J. Analysis of computer image processing and recognition technology. J. Electron. Compon. Inf. Technol. 2022, 6, 168–171. [Google Scholar]
- Zhu, L.; Zhou, Z.; Zhang, J.; Hu, D. A partial curve matching method for automatic reassembly of 2d fragments. In Proceedings of the Intelligent Computing in Signal Processing and Pattern Recognition: International Conference on Intelligent Computing, ICIC 2006, Kunming, China, 16–19 August 2006; pp. 645–650. [Google Scholar]
- Niu, X.; Wang, Q.; Liu, B.; Zhang, J. An automatic chinaware fragments reassembly method framework based on linear feature of fracture surface contour. ACM J. Comput. Cult. Herit. 2022, 16, 1–22. [Google Scholar] [CrossRef]
- Lin, X.; Han, D.; Liu, D. Design of a shape matching based shredded paper splicing system. J. Comput. Knowl. Technol. 2017, 13, 148–150. [Google Scholar]
- Yu, B.; Guo, L.; Zhao, T.; Qian, X. Curve matching method described by Freeman chain code. Comput. Eng. Appl. 2012, 48, 5–8. [Google Scholar]
- Shi, B. Automatic Stitching Algorithm for Irregular Cultural Relic Fragments Based on Corner and Edge Features. Master’s Thesis, Inner Mongolia Agricultural University, Inner Mongolia, China, 2019. [Google Scholar]
- Lin, S.; Wang, D.; Zhong, J.; Zhu, X.; Zhang, S. Method of virtual splicing small bronze fragments using curvature features. Xi’an Dianzi Keji Daxue Xuebao 2016, 43, 141–146. [Google Scholar]
- Lowe, D.G. Distinctive image features from scale-invariant key points. Int. J. Comput. Vis. 2004, 60, 91–110. [Google Scholar] [CrossRef]
- Peng, X.; Luo, X.; Han, B. An improved Shi-Tomasi corner detection method. J. Comput. Appl. Softw. 2022, 39, 241–245. [Google Scholar]
- He, X.C.; Yung, N.H.C. Corner detector based on global and local curvature properties. Opt. Eng. 2008, 47, 057008. [Google Scholar]
- Ma, H. Image mosaic algorithm based on feature matching and its optimization. Acad. J. Comput. Inf. Sci. 2024, 7, 72–77. [Google Scholar]
- Shi, D.; Huang, F.; Yang, J.; Jia, L.; Niu, Y.; Liu, L. Improved Shi-Tomasi sub-pixel corner detection based on super-wide field of view infrared images. Appl. Opt. 2024, 63, 831–837. [Google Scholar] [CrossRef] [PubMed]
- Suzuki, S. Topological structural analysis of digitized binary images by border following. Comput. Vis. Graph. Image Process. 1985, 30, 32–46. [Google Scholar] [CrossRef]
- Xu, Z.; Xu, B.; Wu, G. Canny edge detection based on Open CV. In Proceedings of the 2017 13th IEEE International Conference on Electronic Measurement & Instruments (ICEMI), Yangzhou, China, 20–22 October 2017; pp. 53–56. [Google Scholar]
- Rosten, E.; Drummond, T. Machine Learning for High-Speed Corner Detection. In Proceedings of the Computer Vision-ECCV 2006 pt.1: 9th European Conference on Computer Vision (ECCV 2006) pt.1, Graz, Austria, 7–13 May 2006. [Google Scholar]
- Rodriguez, C.A.; Jenkins, P.R.; Robbins, M.J. Solving the joint military medical evacuation problem via a random forest approximate dynamic programming approach. Expert Syst. Appl. 2023, 221, 119751. [Google Scholar] [CrossRef]
- Dan, L.; Yue, J.; Qian, W. ICP point cloud registration algorithm based on feature points. Gansu J. Sci. 2022, 34, 1–4+19. [Google Scholar]
- Lee, Y.R.; Pustejovsky, J.E. Comparing random effects models, ordinary least squares, or fixed effects with cluster robust standard errors for cross-classified data. Psychol. Methods 2023, 29, 1084–1099. [Google Scholar] [CrossRef] [PubMed]
- Ding, Y.; Wu, J.; Jiang, Y.; Jiexian, Z. A fast image matching algorithm based on improved HU invariant moments. Sens. Microsyst. 2020, 39, 124–127. [Google Scholar]
Serial Number | Before Screening | FECC | After Screening | FECC |
---|---|---|---|---|
1 | 84 | 0.32 | 42 | 0.45 |
2 | 101 | 0.24 | 50 | 0.36 |
3 | 63 | 0.30 | 31 | 0.42 |
4 | 97 | 0.19 | 48 | 0.32 |
Combination Serial Number | Outline Segment Number | Contour Segment Length | Match Segment Length | Matching Corner Points | Percentage of Matching Points | Average Match Rate |
---|---|---|---|---|---|---|
1 | 1-1 | 20 | 18 | 16 | 0.842 | 0.889 |
2-1 | 19 | 18 | ||||
2 | 3-1 | 15 | 11 | 10 | 0.667 | 0.788 |
4-1 | 18 | 15 |
Evaluation Index | Combination Serial Number | The Algorithm in [9] | The Algorithm in [10] | The Algorithm in [12] | The Method in This Paper |
---|---|---|---|---|---|
AS | 1 | 0.77 | 0.73 | 0.84 | 0.98 |
2 | 0.9 | 0.98 | 0.92 | 0.98 | |
COD | 1 | 0.29 | 0.11 | 0.52 | 0.93 |
2 | 0.67 | 0.66 | 0.64 | 0.93 | |
SS | 1 | 0.73 | 0.9 | 0.88 | 0.98 |
2 | 0.69 | 0.81 | 0.9 | 0.97 | |
CWS | 1 | 0.57 | 0.55 | 0.73 | 0.96 |
2 | 0.73 | 0.79 | 0.8 | 0.96 |
Number of Fragment Groups | Evaluation of the Stitching Result | |||
---|---|---|---|---|
CWS < 0.85 | 0.85 ≤ CWS < 0.9 | 0.9 ≤ CWS | Success Rate of Stitching | |
50 | 0 | 4 | 46 | 92% |
100 | 2 | 12 | 86 | 86% |
200 | 9 | 30 | 161 | 80.5% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Liu, J.; Wang, H.; Liu, R.; Wang, K.; Wang, Z.; Wang, T. Research on a Bone Stick Fragment Stitching Method Based on Improved Corner Detection. Appl. Sci. 2025, 15, 4742. https://doi.org/10.3390/app15094742
Liu J, Wang H, Liu R, Wang K, Wang Z, Wang T. Research on a Bone Stick Fragment Stitching Method Based on Improved Corner Detection. Applied Sciences. 2025; 15(9):4742. https://doi.org/10.3390/app15094742
Chicago/Turabian StyleLiu, Jiahuan, Huiqin Wang, Rui Liu, Ke Wang, Zhan Wang, and Ting Wang. 2025. "Research on a Bone Stick Fragment Stitching Method Based on Improved Corner Detection" Applied Sciences 15, no. 9: 4742. https://doi.org/10.3390/app15094742
APA StyleLiu, J., Wang, H., Liu, R., Wang, K., Wang, Z., & Wang, T. (2025). Research on a Bone Stick Fragment Stitching Method Based on Improved Corner Detection. Applied Sciences, 15(9), 4742. https://doi.org/10.3390/app15094742