Computer-aided oracle-bone conjugation method of full-scale contour feature decomposition matrix
Through the full-scale contour feature decomposition matrix, the external contour features of oracle rubbings were extracted and nonlinear transformation was performed, and the impact of boundary defects and defects on oracle conjugation in the prior art was solved, achieving high accuracy, robustness and automation of oracle conjugation effects.
Patent Information
- Application Number
- CN202411435481.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-02-28
AI Technical Summary
The existing computer-assisted oracle conjugation technology is difficult to effectively resist boundary defects and defects, and the edge ballast matching is low, the accuracy and robustness are insufficient, manual calibration is required and the processing efficiency is low.
The full-scale contour feature decomposition matrix is used to extract the external contour features of oracle rubbings through the maximum inter-class variance method and morphological closed operation, and compress and tolerance processing are combined with the nonlinear transformation function to achieve automatic matching and conjugation of oracle rubbings.
It effectively resists boundary defects and defects, improves the fault tolerance and accuracy of edge ballast matching, has translation invariance, rotation invariance, and scale invariance. It supports batch automatic processing without manual calibration and fast conjugation speed.
Smart Images

Figure CN119540580A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the intersection of digital image processing and ancient character information processing, and in particular to a computer-aided oracle bone splicing method of a full-scale contour feature decomposition matrix that can effectively resist boundary flaws and defects, has good edge matching tolerance, high accuracy, good robustness, strong adaptability, does not require manual calibration, and has a fast splicing speed. Background Art
[0002] Computer-assisted oracle bone splicing aims to use oracle bone rubbings as the object and the professional experience of human experts as the guide to model and extract quantitative features suitable for automatic splicing of oracle bone inscriptions, so as to achieve fully automatic or semi-automatic splicing of broken oracle bone fragments. It is expected to break through the limitations of expert dependence, experience and knowledge, time and space, and work efficiency. It has become one of the new directions of oracle bone research and an important way to carry out digitization of oracle bone inscriptions and promote oracle bone research.
[0003] The existing computer-assisted oracle bone splicing technology can be roughly divided into five categories, namely, the splicing method based on digital coding, the splicing method based on corner features, the splicing method based on edge features, the splicing method based on shape features, and the splicing method based on deep learning.
[0004] (1) The splicing method based on digital coding. Zhou et al. determined the splicing rules based on the edges, textures, oracle inscriptions, and other elements of the oracle bone fragments. Then, they digitally encoded each oracle bone fragment and further completed the splicing based on specific coding rules according to the number of the oracle bone fragments in the second edition, the position of the oracle bone fragments on the whole tortoise shell, the size of the oracle bone, the font of the oracle bone inscriptions, and the position of the carvings on the oracle bone fragments. Tong et al. improved the coding splicing method to determine the splicing rules. In addition to adjacent bone plates, more than a quarter of the fragments of each bone plate can be spliced to digitally encode each oracle bone fragment. Similarly, Ge Wenying et al. performed computer oracle bone splicing based on the digital processing of Class A oracle bone fragments. This type of method is convenient for manual identification, but it is relatively labor-intensive and not conducive to automatic processing by computer. In particular, when the information representation of the fragments to be spliced is inaccurate, it will directly affect the accuracy of the matching.
[0005] (2) Methods for splicing based on edge and corner features. Lin et al. extracted the edge features of oracle bone fragment images by using preprocessing operations such as oracle bone edge extraction, edge vectorization, and polygon adjustment. They then analyzed the angular features of oracle bone fragment images in three cases: concave and convex corners, continuous polygonal corners, and 360-degree corners. They then proposed an edge length ratio method and a splicing method for concave and convex corners. They searched for corners that met the square and numerical constraints of the ratio among all candidate oracle bone fragments to achieve splicing of oracle bone fragments. Shi Baozhu et al. obtained an acceptable splicing result of fragment images through rough matching based on angle features, matching based on angle length features, and checking for missing parts in fragment matching. Liu Yongge et al. proposed a two-dimensional fragment contour matching algorithm based on angle sequence to obtain the most likely splicing result between two oracle bone fragments. However, the computational complexity of the above three methods is still relatively large, and for severely worn oracle bone fragments, their boundary flaws and defects often introduce interfering features, which inevitably increases the probability of mismatching.
[0006] (3) Edge feature-based stitching method. Wang et al. calculated the angle formed by the line connecting every three contour sequence points based on the contour sequence points of the oracle bone rubbing image, and used this angle as the image feature of the oracle bone rubbing to match the oracle bone fragment rubbing image; Wang Aimin et al. first extracted the contour of the oracle bone fragment, and calculated the chain code descriptor, Fourier descriptor, b-spline descriptor and other features of the contour to obtain the contour feature vector of the oracle bone fragment. On this basis, a certain distance metric (such as Euclidean distance, similarity distance, etc.) was used to match the contour feature vector of the fragment to be spliced with the contour feature vector of each image in the database, and finally the stitching was completed; Zhang Chongsheng et al. used manual interaction to match the contour feature vector of the fragment to be spliced with the contour feature vector of each image in the database. The method adds edge lines and tangent lines to the oracle bone fragments, and then uses a computer to automatically generate a time series of edge lines. Then, with the help of tangent lines, the oracle bone fragments are incrementally rotated to complete the splicing; Tian et al. extract the boundary features of the corners, edges, shapes, etc. of the oracle bone rubbings, and use curve fitting analysis and Pearson correlation coefficient to select the contour fragments of candidate oracle bone fragment images from the database for comparison; Zhang Chongsheng et al. designed a splicing method based on the sequence matching of the slope change of the edge of the oracle bone fragments, which converts the image matching problem of the broken edge of the oracle bone fragments into a numerical sequence data and sequence similarity comparison problem. However, the threshold selection of this method is more difficult, and it is more sensitive to the distance measurement of edge features. It ignores the convexity and concavity between the oracle bone fragments, resulting in this method only when the oracle bone fracture is highly matched. The fault tolerance of its edge matching is low, and in some cases, it still needs to rely on manual interactive intervention.
[0007] (4) Shape feature-based stitching method. Zhang et al. used boundary supplementation, boundary extraction and other methods to obtain the original boundary of the oracle bone fragments, and then used image geometric operations (such as translation, rotation, etc.) to move the original boundary of the oracle bone fragments to the target boundary, and took the ratio of the maximum boundary matching length to the matching boundary gap area as the similarity measure, and then found the candidate oracle bone fragments with the highest similarity to complete automatic stitching. Zhou Shucheng et al. used the contour curve extraction and filtering algorithm based on triangulation to obtain the contour curve of the two-dimensional image, and proposed a two-dimensional contour matching algorithm with multi-scale adaptive thresholds. Although the stitching method based on the external contour shape feature has achieved certain results, for some severely worn oracle bone fragments, their boundaries often have certain flaws and defects, which cause non-negligible influence and errors on this type of method, and are not easy to stitch and restore.
[0008] (5) Deep learning-based splicing method. Zhang Chongsheng et al. converted the contour points of oracle bone rubbings into time series, and then input them into a generative adversarial network to enhance the ability to distinguish between positive and negative rubbings. They used a twin neural network to achieve retrieval of spliced rubbings images by contrastive learning, and proposed a self-supervised oracle bone fragment splicing network S 3 -Net. Yuan et al. also proposed an oracle bone splicing method based on twin neural networks, using a similar feature fusion module to enhance the backbone network's feature extraction ability for the spliced rubbing images and candidate rubbing images, and then input them into the backbone network and use adaptive average pooling and forward feedback networks to calculate the splicing probability between rubbing images to achieve the splicing of similar rubbing images. Jin Yifan et al. used patch-based neighborhood coding to calculate the contour shape and texture features of oracle bone rubbing images, and then used graph convolutional neural networks to extract local contour features and local texture features of oracle bone rubbing images. On the basis of splicing and fusing these two features, a similarity matrix was calculated for each pair of rubbing images to achieve the measurement of their similarity and rubbing matching. Wang Yuntian et al. used the edge equidistant reconnection method to locate the edge matching position of two oracle bone fragments and cropped the target area image, and then used a convolutional neural network to calculate the texture similarity of the target area image, and then proposed a deep splicing network for oracle bone fragments. Although such methods can avoid the limitations of manually designed splicing features by learning features autonomously, they still have the problem of insufficient generalization due to the limited size of the dataset for splicing oracle bone rubbings. At the same time, existing methods all require oracle bone experts to manually calibrate the contours of the rubbings, which requires a large amount of interactive work and high experience and knowledge. As a result, such methods are still unable to complete the batch automatic splicing of oracle bone rubbings and are inefficient.
[0009] In summary, it is still a very challenging task to realize the computer-assisted splicing of oracle bone fragments. At present, there is no computer-assisted oracle bone splicing method that can effectively resist boundary defects and defects, has good edge matching tolerance, high accuracy, good robustness, strong adaptability, no need for manual calibration, and fast splicing speed. Summary of the invention
[0010] The present invention aims to solve the above-mentioned technical problems existing in the prior art and to provide a computer-aided oracle bone splicing method which can effectively resist boundary defects and defects, has good edge matching tolerance, high accuracy, good robustness, strong adaptability, no need for manual calibration, automatic batch processing, and is based on the full-scale contour feature decomposition matrix.
[0011] The technical solution of the present invention is: a computer-aided oracle bone concatenation method of a full-scale contour feature decomposition matrix, characterized by following the steps:
[0012] Step 1. Input the oracle bone rubbing image I to be matched and the number of candidate oracle bone rubbing images K to be fed back top , and convert the color space of image I from RGB to GRAY to obtain the grayscale image I gray ;
[0013] Step 2: Use the maximum inter-class variance method to gray Perform threshold processing to obtain a binary image I bin ;
[0014] Step 3. Use a matrix of size r1×r1 with all 1s as the structural element and bin Perform morphological closing operation to eliminate I bin The texture information of the image is obtained by retaining only its external contour features. contour , r1 is a preset constant;
[0015] Step 4. Track and find image I in 8-connectivity mode contour The outer edge contour of the foreground area is obtained, and the edge AP with a single pixel width is set to contain L I pixels;
[0016] Step 5. Starting from any point of the AP, read the AP's L in a clockwise direction. I pixels, and get the point set Then store the coordinates of each pixel in APS into the feature sequence list Among them and They represent the horizontal and vertical coordinates of the sth pixel in the point set APS respectively;
[0017] Step 6. Order And create a full-scale contour feature decomposition matrix M of size 60×60×H for the oracle bone rubbing image I I , Indicates floor operation;
[0018] Step 6.1 M I Initialize to a matrix of all 0s, set counters i←1, j←1;
[0019] Step 6.2 APSC from the Feature Sequence List contour Read the coordinates of the i-th pixel and let it be and the coordinates of the jth pixel and let it be
[0020] Step 6.3 Calculate the angle feature θ of the straight line segment with the i-th pixel and the j-th pixel as endpoints according to formula (1): stroke_ang ;
[0021]
[0022] The Round(·) represents a rounding operation based on a rounding method, and arctan(·) represents an inverse tangent function;
[0023] Step 6.4 If θ stroke_ang <0, then let θ stroke_ang ←θ stroke_ang +180, otherwise keep θ stroke_ang The value of remains unchanged;
[0024] Step 6.5 Calculate the distance feature d between the i-th pixel and the j-th pixel according to formula (2): stroke_dis ;
[0025]
[0026] Step 6.6 According to formula (3)-formula (5), the angle feature θ stroke_ang , distance feature d stroke_dis The nonlinear transformation is performed on the endpoints of the straight line segment, thereby compressing and expanding the features at the current scale and processing the tolerance to obtain the transformed angle feature r stroke , distance feature c stroke and endpoint characteristics h stroke ;
[0027]
[0028] Step 6.7 If -1<r stroke <60 and -1<c stroke <60, then let M I (r stroke,c stroke ,h stroke )←M I (r stroke ,c stroke ,h stroke )+1, the M I (r stroke ,c stroke ,h stroke ) represents the matrix M I The center is located at coordinate (r stroke ,c stroke ,h stroke ) at the element;
[0029] Step 6.8 If counter i<L I , then let i←i+1 and return to step 6.2, otherwise go to step 6.9;
[0030] Step 6.9 If counter j < L I , then let j←j+1 and i←1, and return to step 6.2, otherwise go to step 7;
[0031] Step 7. Input N candidate oracle bone rubbing images to form a candidate oracle bone rubbing image dataset B, and create a one-dimensional array SimN with a length of N to store the similarity between each candidate oracle bone rubbing image and image I;
[0032] Step 8. Order And let the counter index←1, the Ω represents the set of oracle bone rubbings that may form a concatenated relationship with the oracle bone rubbing image I;
[0033] Step 9. Take the index-th oracle bone rubbing image from the candidate oracle bone rubbing image dataset B, and let it be J;
[0034] Step 10. Convert the color space of J from RGB to GRAY to obtain the grayscale image J gray ;
[0035] Step 11. Use the maximum between-class variance method to calculate J gray Perform threshold processing to obtain binary image J bin ;
[0036] Step 12. Use a matrix of size r1×r1 with all 1s as the structural element and bin Perform morphological closing operation to eliminate J bin The texture information of the image is obtained by retaining only its external contour features. contour ;
[0037] Step 13. Tracking and finding image J in 8-connectivity mode contourThe outer edge contour of the foreground area is obtained, and the edge BP with a width of one pixel is obtained, and the edge BP contains L J pixels;
[0038] Step 14. Starting from any point of BP, read the L of BP in a clockwise direction. J pixels, and get the point set Then store the coordinates of each pixel in BPS into the feature sequence list Among them and Respectively represent the horizontal and vertical coordinates of the t-th pixel in the point set BPS;
[0039] Step 15. Order And create a full-scale contour feature decomposition matrix M of size 60×60×H′ for the oracle bone rubbing image J J ;
[0040] Step 15.1 M J Initialize to a matrix of all 0s, set counters i′←1, j′←1;
[0041] Step 15.2 BPSC from the feature sequence list contour Read the coordinates of the i′th pixel and set it to and the coordinates of the j′th pixel and let it be
[0042] Step 15.3 Calculate the angle feature θ of the straight line segment with the i′th pixel and the j′th pixel as endpoints according to formula (6): s ' troke_ang ;
[0043]
[0044] Step 15.4 If θ s ' troke_ang <0, then let θ s ' troke_ang ←θ s ' troke_ang +180, otherwise keep θ s ' troke_ang The value of remains unchanged;
[0045] Step 15.5 Calculate the distance feature d between the i′th pixel and the j′th pixel according to formula (7): s ' troke_dis ;
[0046]
[0047] Step 15.6: According to formula (8)-formula (10), the angle feature θs ' troke_ang , distance feature d s ' troke_dis The nonlinear transformation is performed on the endpoints of the straight line segment, thereby compressing and expanding the features at the current scale and processing the tolerance to obtain the transformed angle feature r s ' troke , distance feature c s ' troke and endpoint characteristics h s ' troke ;
[0048]
[0049] Step 15.7 If -1<r s ' troke <60 and -1<c s ' troke <60, then let M J (r s ' troke ,c s ' troke ,h s ' troke )←M J (r s ' troke ,c s ' troke ,h s ' troke )+1, the M J (r s ' troke ,c s ' troke ,h s ' troke ) represents the matrix M J The center is located at coordinate (r s ' troke ,c s ' troke ,h s ' troke ) at the element;
[0050] Step 15.8 If counter i′<L J , then let i′←i′+1 and return to step 15.2, otherwise go to step 15.9;
[0051] Step 15.9 If counter j′<L J , then set j′←j′+1 and i′←1, and return to step 15.2, otherwise go to step 16;
[0052] Step 16. Calculate the matrix M according to formula (11) IWith the matrix M J The minimum depth H between min ;
[0053] H min =min(H,H′) (11)
[0054] The min(·) represents a minimum value function;
[0055] Step 17. Calculate the matrix M according to formula (12) I With the matrix M J The maximum depth between
[0056] H max =max(H,H′) (12)
[0057] The max(·) represents a maximum value function;
[0058] Step 18. Set the counter l←1 and initialize the maximum similarity of the current candidate rubbing image
[0059] Step 19. Create a 60×60×H min The matrix M I ′, and let M I ′←M I (:,:,1:H min ), the M I (:,:,1:H min ) represents the matrix M I The first H after slicing along the third dimension min slices;
[0060] Step 20. Create a 60×60×H min The matrix M′ J , and let M′ J ←M J (:,:,1:H min ), the M J (:,:,1:H min ) represents the matrix M J The first H after slicing along the third dimension min slices;
[0061] Step 21. Calculate the matrix M I The number of non-zero elements in ′, let it be N nonZero ;
[0062] Step 22. Let C′ dif ←M I ′-M′ J , and statistical matrix C′dif The absolute value is not greater than T nonZero Let N be the number of non-zero elements of n ' onZero , and then calculate the matrix M according to formula (13) I With the matrix M J The similarity between curr , the T nonZero is a preset constant;
[0063]
[0064] Step 23. Update the maximum similarity of the current candidate oracle bone rubbing image
[0065] Step 24. If H max =H, then M I Circular shift 1 bit along the third dimension; if H max =H′, then M J Circular shift by 1 bit along the third dimension;
[0066] Step 25. If l<H max , then let l←l+1 and return to step 21, otherwise go to step 26;
[0067] Step 26. Order The SimN(index) represents the value of the index-th element in the array SimN, and is used to store the similarity between the index-th candidate oracle bone rubbing image in the data set B and the image I;
[0068] Step 27. If index < N, set index ← index + 1 and return to step 9, otherwise go to step 28;
[0069] Step 28. Sort the elements in the array SimN in non-ascending order and place the first K top The similarity of the bits and the storage path of the corresponding candidate oracle bone rubbing images are saved in the set Ω;
[0070] Step 29. Write the information of the set Ω into a disk file according to the Office Open XML standard format, and output Ω.
[0071] Compared with the prior art, the present invention has the following advantages: first, the full-scale contour feature separation matrix is used to extract and quantitatively represent the angle features, distance features, and endpoint features of the closed outer contour curve of the oracle bone rubbing at all scales, which is conducive to fully and comprehensively analyzing the edge fractal information of the oracle bone rubbing, especially the rich detail features at the broken slag, and can overcome the mismatch phenomenon caused by the shooting scale differences between the oracle bone rubbings that can be spliced, thereby achieving more accurate oracle bone splicing; second, for the outer contour curve of the oracle bone rubbing containing rich singular points, under large-scale features, the full-scale contour feature separation matrix can effectively suppress the ink rubbing defects, sawtooth burrs and corrosion defects at the boundary of the oracle bone, and improve the fault tolerance and robustness of the splicing process to small disturbances of the edge slag, while under small-scale features, the full-scale contour feature separation matrix can retain the details of the oracle bone rubbing contour, thereby improving the reliability of the edge fractal information in the splicing process. third, the feature representation based on the full-scale contour feature separation matrix is translation invariant, rotation invariant, and scale invariant, which can fundamentally avoid the negative impact of differences in shooting angles, spatial positions, and shooting scales between different oracle bone rubbings on the oracle bone splicing; fourth, the splicing speed is fast and supports batch automatic processing. There is no need for oracle bone experts to manually interact with and annotate the oracle bone rubbings. The slicing operation and circular shift operation of the full-scale contour feature separation matrix can be used to automatically locate the starting point of the candidate splicing segment, and the end point of the splicing segment can be further found in combination with the full-scale features of the rubbing contour, thereby realizing the automatic matching of spliced oracle bone rubbings; fifth, a nonlinear transformation function is designed, which can adaptively compress and expand the edge fractal features at different scales and map them to the three-dimensional matrix space, thereby improving the tolerance and robustness of the similarity measurement function for the edge features of oracle bone rubbings. Therefore, the present invention provides a high-accuracy and high-efficiency technology for oracle bone researchers, especially for oracle bone splicing personnel based on computer vision, which can effectively resist boundary defects and defects, and has the characteristics of good edge matching tolerance, high accuracy, good robustness, strong adaptability, no need for manual calibration, and automatic batch processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 It is a result diagram of computer splicing of the oracle bone rubbing image 1 to be spliced according to the present invention.
[0073] Figure 2 It is a result diagram of computer splicing of the oracle bone rubbing image 2 to be spliced according to the present invention.
[0074] Figure 3 It is a result diagram of computer splicing of the oracle bone rubbing image 3 to be spliced according to the present invention.
[0075] Figure 4It is a result diagram of computer splicing of the oracle bone rubbing image 4 to be spliced according to the present invention.
[0076] Figure 5 It is a result diagram of computer splicing of the oracle bone rubbing image 5 to be spliced according to the present invention. DETAILED DESCRIPTION
[0077] The computer-aided oracle bone concatenation method of the full-scale contour feature decomposition matrix of the present invention is carried out according to the following steps;
[0078] Step 1. Input the oracle bone rubbing image I to be matched and the number of candidate oracle bone rubbing images K to be fed back top , and convert the color space of image I from RGB to GRAY to obtain the grayscale image I gray In this embodiment, let K top =5;
[0079] Step 2: Use the maximum inter-class variance method to gray Perform threshold processing to obtain a binary image I bin ;
[0080] Step 3. Use a matrix of size r1×r1 with all 1s as the structural element and bin Perform morphological closing operation to eliminate I bin The texture information of the image is obtained by retaining only its external contour features. contour , r1 is a preset constant, and in this embodiment, r1=24;
[0081] Step 4. Track and find image I in 8-connectivity mode contour The outer edge contour of the foreground area is obtained, and the edge AP with a single pixel width is set to contain L I pixels;
[0082] Step 5. Starting from any point of the AP, read the AP's L in a clockwise direction. I pixels, and get the point set Then store the coordinates of each pixel in APS into the feature sequence list Among them and They represent the horizontal and vertical coordinates of the sth pixel in the point set APS respectively;
[0083] Step 6. Order And create a full-scale contour feature decomposition matrix M of size 60×60×H for the oracle bone rubbing image I I , Indicates floor operation;
[0084] Step 6.1 MI Initialize to a matrix of all 0s, set counters i←1, j←1;
[0085] Step 6.2 APSC from the Feature Sequence List contour Read the coordinates of the i-th pixel and set it to and the coordinates of the jth pixel and let it be
[0086] Step 6.3 Calculate the angle feature θ of the straight line segment with the i-th pixel and the j-th pixel as endpoints according to formula (1): stroke_ang ;
[0087]
[0088] The Round(·) represents a rounding operation based on a rounding method, and arctan(·) represents an inverse tangent function;
[0089] Step 6.4 If θ stroke_ang <0, then let θ stroke_ang ←θ stroke_ang +180, otherwise keep θ stroke_ang The value of remains unchanged;
[0090] Step 6.5 Calculate the distance feature d between the i-th pixel and the j-th pixel according to formula (2): stroke_dis ;
[0091]
[0092] Step 6.6 According to formula (3)-formula (5), the angle feature θ stroke_ang , distance feature d stroke_dis The nonlinear transformation is performed on the endpoints of the straight line segment, thereby compressing and expanding the features at the current scale and processing the tolerance to obtain the transformed angle feature r stroke , distance feature c stroke and endpoint characteristics h stroke ;
[0093]
[0094] Step 6.7 If -1<r stroke <60 and -1<c stroke <60, then let M I (r stroke ,c stroke ,h stroke )←M I (r stroke ,c stroke ,h stroke )+1, the M I (r stroke,c stroke ,h stroke ) represents the matrix M I The center is located at coordinate (r stroke ,c stroke ,h stroke ) at the element;
[0095] Step 6.8 If counter i<L I , then let i←i+1 and return to step 6.2, otherwise go to step 6.9;
[0096] Step 6.9 If counter j < L I , then let j←j+1 and i←1, and return to step 6.2, otherwise go to step 7;
[0097] Step 7. Input N candidate oracle bone rubbing images to form a candidate oracle bone rubbing image dataset B, and create a one-dimensional array SimN with a length of N to store the similarity between each candidate oracle bone rubbing image and image I;
[0098] Step 8. Order And let the counter index←1, the Ω represents the set of oracle bone rubbings that may form a concatenated relationship with the oracle bone rubbing image I;
[0099] Step 9. Take the index-th oracle bone rubbing image from the candidate oracle bone rubbing image dataset B, and let it be J;
[0100] Step 10. Convert the color space of J from RGB to GRAY to obtain the grayscale image J gray ;
[0101] Step 11. Use the maximum between-class variance method to calculate J gray Perform threshold processing to obtain binary image J bin ;
[0102] Step 12. Use a matrix of size r1×r1 with all 1s as the structural element and bin Perform morphological closing operation to eliminate J bin The texture information of the image is obtained by retaining only its external contour features. contour ;
[0103] Step 13. Tracking and finding image J in 8-connectivity mode contour The outer edge contour of the foreground area is obtained, and the edge BP with a width of one pixel is obtained, and the edge BP contains L J pixels;
[0104] Step 14. Starting from any point of BP, read the L of BP in a clockwise direction. J pixels, and get the point set Then store the coordinates of each pixel in BPS into the feature sequence list Among them and Respectively represent the horizontal and vertical coordinates of the t-th pixel in the point set BPS;
[0105] Step 15. Order And create a full-scale contour feature decomposition matrix M of size 60×60×H′ for the oracle bone rubbing image J J ;
[0106] Step 15.1 M J Initialize to a matrix of all 0s, set counters i′←1, j′←1;
[0107] Step 15.2 BPSC from the feature sequence list contour Read the coordinates of the i′th pixel and set it to and the coordinates of the j′th pixel and let it be
[0108] Step 15.3 Calculate the angle feature θ of the straight line segment with the i′th pixel and the j′th pixel as endpoints according to formula (6): s ' troke_ang ;
[0109]
[0110] Step 15.4 If θ s ' troke_ang <0, then let θ s ' troke_ang ←θ s ' troke_ang +180, otherwise keep θ s ' troke_ang The value of remains unchanged;
[0111] Step 15.5 Calculate the distance feature d between the i′th pixel and the j′th pixel according to formula (7): s ' troke_dis ;
[0112]
[0113] Step 15.6: According to formula (8)-formula (10), the angle feature θ s ' troke_ang , distance feature d s ' troke_dis The nonlinear transformation is performed on the endpoints of the straight line segment, thereby compressing and expanding the features at the current scale and processing the tolerance to obtain the transformed angle feature r s ' troke , distance feature cs ' troke and endpoint characteristics h s ' troke ;
[0114]
[0115] Step 15.7 If -1<r s ' troke <60 and -1<c s ' troke <60, then let M J (r s ' troke ,c s ' troke ,h s ' troke )←M J (r s ' troke ,c s ' troke ,h s ' troke )+1, the M J (r s ' troke ,c s ' troke ,h s ' troke ) represents the matrix M J The center is located at coordinate (r s ' troke ,c s ' troke ,h s ' troke ) at the element;
[0116] Step 15.8 If counter i′<L J , then let i′←i′+1 and return to step 15.2, otherwise go to step 15.9;
[0117] Step 15.9 If counter j′<L J , then set j′←j′+1 and i′←1, and return to step 15.2, otherwise go to step 16;
[0118] Step 16. Calculate the matrix M according to formula (11) I With the matrix M J The minimum depth H between min ;
[0119] H min =min(H,H′) (11)
[0120] The min(·) represents a minimum value function;
[0121] Step 17. Calculate the matrix M according to formula (12) I With the matrix M J The maximum depth between
[0122] H max =max(H,H′) (12)
[0123] The max(·) represents a maximum value function;
[0124] Step 18. Set the counter l←1 and initialize the maximum similarity of the current candidate rubbing image
[0125] Step 19. Create a 60×60×H min The matrix M I ′, and let M I ′←M I (:,:,1:H min ), the M I (:,:,1:H min ) represents the matrix M I The first H after slicing along the third dimension min slices;
[0126] Step 20. Create a 60×60×H min The matrix M′ J , and let M′ J ←M J (:,:,1:H min ), the M J (:,:,1:H min ) represents the matrix M J The first H after slicing along the third dimension min slices;
[0127] Step 21. Calculate the matrix M I The number of non-zero elements in ′, let it be N nonZero ;
[0128] Step 22. Let C′ dif ←M I ′-M′ J , and statistical matrix C′ dif The absolute value is not greater than T nonZero Let N be the number of non-zero elements of n ' onZero , and then calculate the matrix M according to formula (13) I With the matrix M J The similarity between curr , the TnonZero is a preset constant. In this embodiment, T nonZero =5;
[0129]
[0130] Step 23. Update the maximum similarity of the current candidate oracle bone rubbing image
[0131] Step 24. If H max =H, then M I Circular shift 1 bit along the third dimension; if H max =H′, then M J Circular shift by 1 bit along the third dimension;
[0132] Step 25. If l<H max , then let l←l+1 and return to step 21, otherwise go to step 26;
[0133] Step 26. Order The SimN(index) represents the value of the index-th element in the array SimN, and is used to store the similarity between the index-th candidate oracle bone rubbing image in the data set B and the image I;
[0134] Step 27. If index < N, set index ← index + 1 and return to step 9, otherwise go to step 28;
[0135] Step 28. Sort the elements in the array SimN in non-ascending order and place the first K top The similarity of the bits and the storage path of the corresponding candidate oracle bone rubbing images are saved in the set Ω;
[0136] Step 29. Write the information of the set Ω into a disk file according to the Office Open XML standard format, and output Ω.
[0137] A total of 2859 oracle bone rubbings images were selected from the "Oracle Bone Collection" to form an oracle bone rubbing splicing dataset, of which 1192 images had splicing relationships. A computer-assisted oracle bone rubbing splicing experiment was conducted, and the objective evaluation indicator was the recall rate based on Top-K. Figure 1 to Figure 5 The conjugation results when K = 5 are given in Table 1. Figure 1 to Figure 5 The similarity between each candidate oracle bone rubbing image and the oracle bone rubbing image to be joined. Figure 1 (a) is the original oracle bone rubbing image 1 to be joined, Figure 1 (b)~ Figure 1 (f) is the information retrieved from the 2859 oracle bone rubbings image dataset by the present invention. Figure 1(a) The top five candidate oracle bone rubbing images with the highest similarity, Figure 1 (b) is related to Figure 1 (a) The rubbing images with true concatenation relationship have a similarity of 0.1467; Figure 2 (a) is the original oracle bone rubbing image 2 to be joined, Figure 2 (b)~ Figure 2 (f) is the oracle bone rubbings image data set retrieved by the present invention. Figure 2 (a) The top five candidate oracle bone rubbing images with the highest similarity, Figure 2 (b) is related to Figure 2 (a) The rubbing images with true concatenation relationship have a similarity of 0.5318; Figure 3 (a) is the original oracle bone rubbing image 3 to be joined, Figure 3 (b)~ Figure 3 (f) is the oracle bone rubbings image data set retrieved by the present invention. Figure 3 (a) The top five candidate oracle bone rubbing images with the highest similarity. Figure 3 (d) is related to Figure 3 (a) The rubbing images with true concatenation relationship have a similarity of 0.1261; Figure 4 (a) is the original oracle bone rubbing image 4 to be joined, Figure 4 (b)~ Figure 4 (f) is the oracle bone rubbings image data set retrieved by the present invention. Figure 4 (a) The top five candidate oracle bone rubbing images with the highest similarity, Figure 4 (b) is related to Figure 4 (a) The rubbing images with true concatenation relationship have a similarity of 0.1488; Figure 5 (a) is the original oracle bone rubbing image 5 to be joined, Figure 5 (b)~ Figure 5 (f) is the oracle bone rubbings image data set retrieved by the present invention. Figure 5 (a) The top five candidate oracle bone rubbing images with the highest similarity, Figure 5 (f) is Figure 5 (a) The similarity between the rubbing images with a true concatenation relationship is 0.1317. From the above results, it can be seen that the present invention effectively resists the interference of point noise, flaky patterns and inherent texture of oracle bones, and can effectively search for the best concatenated oracle bone rubbings in a certain scale of data set, providing a collection of concatenated rubbings for oracle bone experts.
[0138] At the same time, the present invention also achieved the best conjugation performance on the public dataset OB-Rejoin of oracle bone rubbing conjugation. The OB-Rejoin dataset has a total of 1083 oracle bone rubbing images, of which 290 oracle bone rubbing images have conjugation relationships. Table 2 shows the performance of the present invention compared with the DTW method, Drop-DTW method, DTWNet method, DTWNet2 method, S 3 -Net BCE Methods, S 3 -Net FOCAL Comparison of the conjugation performance of the methods on the OB-Rejoin dataset. It should be noted that only the present invention does not require manual interaction during the conjugation process, while the other six methods all require oracle bone experts to mark the possible conjugated rubbing contour segments in advance. As can be seen from Table 2, without the need for manual annotation, the present invention has achieved the highest splicing accuracy in Top-1, Top-3, and Top-5 indicators, indicating that the full-scale contour feature separation matrix proposed in the present invention can effectively extract the edge fractal features of the oracle bone rubbings, especially the broken slag, and suppress the ink rubbing defects, sawtooth burrs, corrosion defects and small disturbances of the slag at the boundaries of the oracle bones, thereby improving the robustness of oracle bone splicing; at the same time, the translation invariance, rotation invariance, and scale invariance of the full-scale contour feature separation matrix ensure the positioning accuracy of the matrix slicing operation and the cyclic shift operation for the spliced slag fragments, so that even without manual interaction, the present invention can still effectively search for the spliced slag position, and the precision rate is better than the other 6 comparison methods; in terms of Top-10 and Top-15 indicators, the accuracy of the present invention is only slightly lower than that of S 3 -Net FOCAL method, which is still higher than DTW method, Drop-DTW method, DTWNet method, DTWNet2 method, S 3 -Net BCE However, the performance gains of these six comparison methods mostly come from the manual annotation of oracle bone experts. Therefore, the recall rate of the present invention without manual annotation is still better than that of the other six comparison methods.
[0139] Table 1 Similarity results of the present invention for the oracle bone rubbing images to be combined in the accompanying drawings
[0140] Figure Number Sub-figure (b) Sub-image (c) Sub-graph (d) Sub-graph (e) Subgraph (f) Figure 1 0.1467 0.1435 0.1370 0.1352 0.1346 Figure 2 0.5318 0.1412 0.1210 0.1171 0.1147 Figure 3 0.1326 0.1263 0.1261 0.1207 0.1193 Figure 4 0.1488 0.1227 0.1224 0.1219 0.1207 Figure 5 0.3930 0.1452 0.1371 0.1331 0.1317
[0141] Table 2 Comparison of oracle bone rubbing concatenation accuracy of different methods on the OB-Rejoin dataset
[0142] method Top-1 Top-3 Top-5 Top-10 Top-15 DTW 0.3333 0.4699 0.5582 0.6586 0.7229 DTWNet 0.3855 0.5542 0.6546 0.7430 0.8313 DTWNet2 0.4699 0.6466 0.7430 0.8273 0.8594 Drop-DTW 0.4699 0.6466 0.7430 0.8273 0.8594 <![CDATA[S 3 -Net BCE ]]> 0.5181 0.7149 0.8032 0.8715 0.9157 <![CDATA[S 3 -Net FOCAL ]]> 0.5622 0.7751 0.8313 0.9116 0.9277 The present invention 0.6691 0.7914 0.8489 0.9065 0.9209
[0143] In summary, the present invention provides a practical computer-assisted oracle bone splicing technology for oracle bone researchers, which can effectively resist boundary defects and defects, and has the characteristics of good edge matching tolerance, high accuracy, good robustness, strong adaptability, no need for manual calibration, and automatic batch processing.
Claims
1. A computer-aided oracle bone conjugation method based on a full-scale contour feature decomposition matrix, characterized in that Follow these steps: Step 1. Input the oracle bone rubbing image I to be matched and the number of candidate oracle bone rubbing images K to be fed back top , and convert the color space of image I from RGB to GRAY to obtain the grayscale image I gray ; Step 2: Use the maximum inter-class variance method to gray Perform threshold processing to obtain a binary image I bin ; Step 3. Use a matrix of size r1×r1 with all 1s as the structural element and bin Perform morphological closing operation to eliminate I bin The texture information of the image is only retained by its external contour features. Get image I contour , r1 is a preset constant; Step 4. Track and find image I in 8-connectivity mode contour The outer edge contour of the foreground area is obtained, and the edge AP with a single pixel width is set to contain L I pixels; Step 5. Starting from any point of the AP, read the AP's L in a clockwise direction. I pixels, and get the point set Then store the coordinates of each pixel in APS into the feature sequence list Among them and They represent the horizontal and vertical coordinates of the sth pixel in the point set APS respectively; Step 6. Order And create a full-scale contour feature decomposition matrix M of size 60×60×H for the oracle bone rubbing image I I , Indicates floor operation; Step 6.1 M I Initialize to a matrix of all 0s, set counters i←1, j←1; Step 6.2 APSC from the Feature Sequence List contour Read the coordinates of the i-th pixel and set it to and the coordinates of the jth pixel and let it be Step 6.3 Calculate the angle feature θ of the straight line segment with the i-th pixel and the j-th pixel as endpoints according to formula (1): stroke_ang ; The Round(·) represents a rounding operation based on a rounding method, and arctan(·) represents an inverse tangent function; Step 6.4 If θ stroke_ang <0, then let θ stroke_ang ←θ stroke_ang +180, otherwise keep θ stroke_ang The value of remains unchanged; Step 6.5 Calculate the distance feature d between the i-th pixel and the j-th pixel according to formula (2): stroke_dis ; Step 6.6 According to formula (3)-formula (5), the angle feature θ stroke_ang , distance feature d stroke_dis The nonlinear transformation is performed on the endpoints of the straight line segment, thereby compressing and expanding the features at the current scale and processing the tolerance to obtain the transformed angle feature r stroke , distance feature c stroke and endpoint characteristics h stroke ; Step 6.7 If -1<r stroke <60 and -1<c stroke <60, then let M I (r stroke ,c stroke ,h stroke )←M I (r stroke ,c stroke ,h stroke )+1, the M I (r stroke ,c stroke ,h stroke ) represents the matrix M I The center is located at coordinate (r stroke ,c stroke ,h stroke ) at the element; Step 6.8 If counter i<L I , then let i←i+1 and return to step 6.2, otherwise go to step 6.9; Step 6.9 If counter j < L I , then let j←j+1 and i←1, and return to step 6.2, otherwise go to step 7; Step 7. Input N candidate oracle bone rubbing images to form a candidate oracle bone rubbing image dataset B, and create a one-dimensional array SimN with a length of N to store the similarity between each candidate oracle bone rubbing image and image I; Step 8. Order And let the counter index←1, the Ω represents the set of oracle bone rubbings that may form a concatenated relationship with the oracle bone rubbing image I; Step 9. Take the index-th oracle bone rubbing image from the candidate oracle bone rubbing image dataset B, and let it be J; Step 10. Convert the color space of J from RGB to GRAY to obtain the grayscale image J gray ; Step 11. Use the maximum between-class variance method to calculate J gray Perform threshold processing to obtain binary image J bin ; Step 12. Use a matrix of size r1×r1 with all 1s as the structural element and bin Perform morphological closing operation to eliminate J bin The texture information of the image is obtained by retaining only its external contour features. contour ; Step 13. Tracking and finding image J in 8-connectivity mode contour The outer edge contour of the foreground area is obtained, and the edge BP with a width of one pixel is obtained, and the edge BP contains L J pixels; Step 14. Starting from any point of BP, read the L of BP in a clockwise direction. J pixels, and get the point set Then store the coordinates of each pixel in BPS into the feature sequence list Among them and Respectively represent the horizontal and vertical coordinates of the t-th pixel in the point set BPS; Step 15. Order And create a full-scale contour feature decomposition matrix M of size 60×60×H′ for the oracle bone rubbing image J J ; Step 15.1 M J Initialize to a matrix of all 0s, set counters i′←1, j′←1; Step 15.2 BPSC from the feature sequence list contour Read the coordinates of the i′th pixel and set it to And the coordinates of the j′th pixel and let it be Step 15.3 Calculate the angle feature θ of the straight line segment with the i′th pixel and the j′th pixel as endpoints according to formula (6): s ' troke_ang ; Step 15.4 If θ s ' troke_ang <0, then let θ s ' troke_ang ←θ s ' troke_ang +180, otherwise keep θ s ' troke_ang The value of remains unchanged; Step 15.5 Calculate the distance feature d between the i′th pixel and the j′th pixel according to formula (7): s ' troke_dis ; Step 15.6: According to formula (8)-formula (10), the angle feature θ s ' troke_ang , distance feature d s ' troke_dis The nonlinear transformation is performed on the endpoints of the straight line segment, thereby compressing and expanding the features at the current scale and processing the tolerance to obtain the transformed angle feature r s ' troke , distance feature c s ' troke and endpoint characteristics h s ' troke ; Step 15.7 If -1<r s ' troke <60 and -1<c s ' troke <60, then let M J (r s ' troke ,c s ' troke ,h s ' troke )←M J (r s ' troke ,c s ' troke ,h s ' troke )+1, the M J (r s ' troke ,c s ' troke ,h s ' troke ) represents the matrix M J The center is located at coordinate (r s ' troke ,c s ' troke ,h s ' troke ) at the element; Step 15.8 If counter i′<L J , then let i′←i′+1 and return to step 15.2, otherwise go to step 15.9; Step 15.9 If counter j′<L J , then set j′←j′+1 and i′←1, and return to step 15.2, otherwise go to step 16; Step 16. Calculate the matrix M according to formula (11) I With the matrix M J The minimum depth H between min ; H min =min(H,H′) (11) The min(·) represents a minimum value function; Step 17. Calculate the matrix M according to formula (12) I With the matrix M J The maximum depth between H max =max(H,H′) (12) The max(·) represents a maximum value function; Step 18. Set the counter l←1 and initialize the maximum similarity of the current candidate rubbing image Step 19. Create a 60×60×H min The matrix M I ′, and let M I ′←M I (:,:,1:Hmin), the M I (:,:,1:H min ) represents the matrix M I The first H after slicing along the third dimension min slices; Step 20. Create a 60×60×H min The matrix M′ J , and let M′ J ←M J (:,:,1:Hmin), the M J (:,:,1:H min ) represents the matrix M J The first H after slicing along the third dimension min slices; Step 21. Calculate the matrix M I The number of non-zero elements in ′, let it be N nonZero ; Step 22. Let C′ dif ←M I ′-M′ J , and statistical matrix C′ dif The absolute value is not greater than T nonZero Let N be the number of non-zero elements of n ' onZero , and then calculate the matrix M according to formula (13) I With the matrix M J The similarity between curr , the T nonZero is a preset constant; Step 23. Update the maximum similarity of the current candidate oracle bone rubbing image Step 24. If H max =H, then M I Circular shift 1 bit along the third dimension; if H max =H′, then M J Circular shift by 1 bit along the third dimension; Step 25. If l<H max , then let l←l+1 and return to step 21, otherwise go to step 26; Step 26. Order The SimN(index) represents the value of the index-th element in the array SimN, and is used to store the similarity between the index-th candidate oracle bone rubbing image in the data set B and the image I; Step 27. If index < N, set index ← index + 1 and return to step 9, otherwise go to step 28; Step 28. Sort the elements in the array SimN in non-ascending order and place the first K top The similarity of the bits and the storage path of the corresponding candidate oracle bone rubbing images are saved in the set Ω; Step 29. Write the information of the set Ω into a disk file according to the Office Open XML standard format, and output Ω.