Virtual splicing method and device for thin-wall ancient pottery fragments
Through point cloud data processing and registration technology, virtual splicing of ancient pottery fragments is achieved, solving the problem that ancient pottery fragments are difficult to effectively repair, improving splicing accuracy and efficiency, and protecting the integrity of cultural relics.
Patent Information
- Application Number
- CN202411891781.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-05-02
AI Technical Summary
Due to the lack of complete form and size data, ancient pottery fragments are difficult to effectively explore and interpret, and manual repair is complex and time-consuming, which can easily cause secondary damage to cultural relics.
By obtaining the original point cloud data of ancient pottery fragments, filter out the set of points that can form outline triangles, construct the triangle contour surface and extract the edge contour, perform coarse registration and fine registration, identify and splice adjacent fragments, and realize virtual splicing.
It improves the accuracy and efficiency of splicing of ancient pottery fragments, and is suitable for splicing of ancient pottery fragments of different shapes, sizes and thin-wall types, reducing the time and risk of manual restoration, ensuring the integrity of cultural relics and the retention of historical value.
Smart Images

Figure CN119919284A_ABST
Abstract
Description
Technical Field
[0001] The present invention generally relates to the technical field of point cloud data splicing, and more specifically, to a method and device for virtual splicing of thin-walled ancient pottery fragments. Background Art
[0002] Ancient pottery, as an important material relic of the development of human civilization, is not only an important physical material for studying ancient economy, politics, culture, technology and society, but also an important carrier for protecting and inheriting national culture.
[0003] Due to the inherent fragility of ancient pottery and long-term burial conditions, it is often found in the form of fragments when unearthed, and the quantity is large and complex. Due to the lack of complete morphological and dimensional data, it is difficult to directly conduct effective value excavation and interpretation of ancient pottery fragments. The restoration of broken pottery has become an important task for archaeological staff. At present, the fragments of ancient pottery will be cleaned after excavation and brought back to the room for statistics on quantity, shape, pottery quality, pottery color, etc. After queuing up and sorting, the selected specimens will be matched, glued, matched, colored, inspected and recorded. Only after the restoration of pottery can its historical value and cultural significance be fully displayed.
[0004] However, when faced with a large number of ancient pottery fragments of various shapes, manual restoration is a complex and time-consuming task, which can easily cause secondary damage to the cultural relics and requires the restorer to have a high level of prior knowledge. Summary of the invention
[0005] According to an embodiment of the present invention, a virtual splicing solution for thin-walled ancient pottery fragments is provided. The solution improves the precision and efficiency of splicing ancient pottery fragments and is suitable for splicing ancient pottery fragments of different shapes, sizes and thin-wall types.
[0006] In a first aspect of the present invention, a method for virtual splicing of thin-walled ancient pottery fragments is provided. The method comprises:
[0007] Obtain the original point cloud data of target fragments of thin-walled ancient pottery;
[0008] A point set capable of forming an outline triangle is selected from the original point cloud data, an outline surface of the triangle is constructed, and an edge outline of the triangle is extracted to obtain a fragment set; the fragment set includes a plurality of fragments, each fragment includes an extracted edge outline point cloud and a point cloud within the outline;
[0009] Randomly extract two fragments from the fragment set, perform coarse registration according to the edge contours of the fragments to obtain a coarse registration point cloud, and then perform fine registration on the coarse registration point cloud to identify adjacent fragment pairs;
[0010] The adjacent fragment pairs are spliced and merged to obtain a splicing result of the broken parts of the adjacent fragment pairs;
[0011] Traverse all the fragments in the fragment set and obtain the results of splicing the fractured parts of thin-walled ancient pottery.
[0012] Furthermore, the obtaining of the original point cloud data of the target fragments of thin-walled ancient pottery includes:
[0013] Numbering the target fragments;
[0014] According to the size of the target fragment, a scanning area is set so that the target fragment is located within the scanning area; the scanning area includes a plurality of panes so that a corresponding relationship is generated between the panes and the target fragment;
[0015] Arranging target points on the surface of the target fragment; the target points are located at non-edge positions on the surface of the target fragment;
[0016] The scanning area is scanned to generate original point cloud data.
[0017] Furthermore, the step of selecting a point set capable of forming a contour triangle from the original point cloud data comprises:
[0018] Filtering out triangle vertices on the same sphere from the original point cloud data to form a contour triangle vertex set;
[0019] Traverse each triangle in the contour triangle vertex set, delete the boundary triangles, and get the point set of the contour triangle.
[0020] Furthermore, the step of selecting triangle vertices on the same sphere from the original point cloud data includes:
[0021] Selecting a point data from the original point cloud data as the target point data, and taking the points within the neighborhood range of the target point data as a subset; the neighborhood range is a range that is no more than 2α from the point data, where α is a complexity parameter;
[0022] Adjusting the complexity parameter according to the neighborhood density, and updating the subset using the adjusted complexity parameter;
[0023] Select any two point data other than the target point data from the updated first subset, and calculate the selected three point data;
[0024] Traverse all two-point data combinations except the target point data in the updated first subset to obtain three-point data combinations about the target point data; each set of three-point data can determine two spherical center coordinates;
[0025] Determine whether the spherical center coordinates determined by each set of three-point data meet the angle condition. If so, the triangle formed by the set of three-point data is used as a boundary triangle; otherwise, the triangle formed by the set of three-point data is not a boundary triangle; obtain the triangle vertex combination containing the target point data;
[0026] All point data in the original point cloud data are traversed to obtain a contour triangle vertex set.
[0027] Furthermore, the angle condition is:
[0028] θ<β
[0029] Among them, θ is and The angle of is the Z axis with the sphere center coordinates as the origin, is the normal of the contour triangle; β is the angle threshold.
[0030] Furthermore, the deleting of the boundary triangle to obtain the point set of the outline triangle includes:
[0031] Traverse all boundary triangles and record the number m of contour triangles formed by each vertex. If the m values of the three vertices of a boundary triangle are all less than 3, delete the boundary triangle.
[0032] Extract the vertices of all remaining boundary triangles to obtain the point set of the contour triangle.
[0033] Furthermore, the step of randomly extracting two fragments from the fragment set and performing rough registration according to edge contours of the fragments to obtain a rough registration point cloud includes:
[0034] The two fragments include a target fragment point cloud and a fragment point cloud to be matched; the contour points of the target fragment point cloud are rotated around the origin at a certain angle so that the contour points of the target fragment point cloud are matched with the contour points of the fragment point cloud to be matched in sequence;
[0035] The distance between the two sets of edge points is calculated after each rotation, and the variance of the distance between contour points in each matching is calculated;
[0036] The rotation angle of the 2D edge point cloud around the origin is calculated based on the variance of the distance between the contour points, which corresponds to the rotation angle of the 3D point cloud around the Z axis.
[0037] The target fragment point cloud is rotated around the Z axis according to the rotation angle of the three-dimensional point cloud around the Z axis, and the target fragment point cloud and the fragment point cloud to be matched are roughly aligned to obtain a roughly aligned point cloud.
[0038] Furthermore, the performing fine registration on the coarsely registered point cloud comprises:
[0039] For any point of the coarse registration point cloud, searching for a number of neighboring points in the coarse registration point cloud, and fitting the neighboring points into a fitting plane;
[0040] Get the projection point of the current point in the coarse registration point cloud to the fitting plane, use the projection point as the pseudo corresponding point of the current point in the coarse registration point cloud, iteratively calculate the rigid body transformation matrix, and obtain the adjacent fragment pair.
[0041] Furthermore, the step of splicing and fusing the adjacent fragment pairs comprises:
[0042] Perform rotation and translation transformation on the adjacent fragment pairs so that the two adjacent fragments are in the same coordinate system, and then merge the two groups of point clouds to obtain the merged fragments;
[0043] After edge extraction of the merged fragments, the result of splicing the broken parts of the adjacent fragment pairs is obtained and added to the fragment set, while the two adjacent fragments that have been merged are deleted.
[0044] In a second aspect of the present invention, a device for virtual splicing of thin-walled ancient pottery fragments is provided. The device comprises:
[0045] An acquisition module is used to acquire the original point cloud data of target fragments of thin-walled ancient pottery;
[0046] An extraction module is used to filter out a point set that can form an outline triangle from the original point cloud data, construct a triangular outline surface, and extract an edge outline of the triangle to obtain a fragment set; the fragment set includes a plurality of fragments, each fragment includes an extracted edge outline point cloud and a point cloud within the outline;
[0047] A recognition module is used to randomly extract two fragments from the fragment set, perform coarse registration according to the edge contours of the fragments to obtain a coarse registration point cloud, and then perform fine registration on the coarse registration point cloud to identify adjacent fragment pairs;
[0048] A splicing module, used for splicing and fusing the adjacent fragment pairs to obtain a splicing result of the broken parts of the adjacent fragment pairs;
[0049] The integration module is used to traverse all the fragments in the fragment set and obtain the results of splicing the fractured parts of thin-walled ancient pottery.
[0050] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The above and other features, advantages and aspects of the embodiments of the present invention will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0052] Figure 1 A flowchart of a method for virtually splicing thin-walled ancient pottery fragments according to an embodiment of the present invention is shown;
[0053] Figure 2 A flowchart of obtaining original point cloud data of target fragments according to an embodiment of the present invention is shown;
[0054] Figure 3 A flowchart of screening contour triangle point sets according to an embodiment of the present invention is shown;
[0055] Figure 4 A flowchart of screening triangle vertices according to an embodiment of the present invention is shown;
[0056] Figure 5 A flow chart of coarse registration according to an embodiment of the present invention is shown;
[0057] Figure 6 A flowchart of fine registration according to an embodiment of the present invention is shown;
[0058] Figure 7 A flow chart of splicing and fusion according to an embodiment of the present invention is shown;
[0059] Figure 8 A schematic diagram showing spherical center coordinates according to an embodiment of the present invention is shown;
[0060] Fig. 9 A block diagram of a device for virtually splicing thin-walled ancient pottery fragments according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0062] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0063] In the present invention, the target fragments are collected digitally in batches; the edge contours are extracted by constructing a triangular contour surface to obtain a fragment set; the fragments in the fragment set are roughly and finely registered to identify adjacent fragment pairs; and finally the adjacent fragment pairs are spliced and fused. The present invention can efficiently and accurately restore the original appearance of ancient pottery, and can also perform non-destructive analysis and display on a digital platform.
[0064] Figure 1 A flow chart of a method for virtually splicing thin-walled ancient pottery fragments according to an embodiment of the present invention is shown.
[0065] The method includes:
[0066] S101, such as Figure 2 As shown, the original point cloud data of the target fragments of thin-walled ancient pottery are obtained, including:
[0067] S201: Perform numbering processing on target fragments.
[0068] In this embodiment, the target fragments are numbered using a paint pen, which is the physical number of the target fragments.
[0069] S202: setting a scanning area according to the size of the target fragment so that the target fragment is located within the scanning area; the scanning area includes a plurality of panes so that a corresponding relationship is generated between the panes and the target fragment.
[0070] In this embodiment, the scanning area is set according to the size of the target fragments, including: adjusting the size of the scanning area according to the size and number of the fragments; the background of the scanning area is a solid color; for example: a black light-absorbing photography background cloth can be laid on a 1.0m*1.0m desktop as the scanning area.
[0071] In this embodiment, the pane is formed by laying out horizontal and vertical grid lines of fixed sizes in the scanning area. After the pane is formed, the panes are numbered respectively so that a corresponding relationship is generated between the pane and the target fragment (that is, the number of the pane is the same as the physical number of the target fragment placed in the pane); the size of the pane can be adjusted according to the size of the longest side of the fragment, and the number of the panes can be adjusted according to the size of the scanning area and the size of the pane. For example, grid lines can be laid out at intervals of 20 cm horizontally and vertically in the scanning area to form panes, and the panes are numbered 01 to 25 respectively.
[0072] In this embodiment, the target fragment is located in the scanning area, including: placing the target fragment in the window pane of the scanning area according to the corresponding relationship between the window pane and the target fragment; when placing the target fragment, to ensure the consistency of the placement of the target fragment, the inner surface of the target fragment is facing downward and the outer surface is facing upward; in case the target fragment is uneven after being placed, the target fragment is adjusted so that the high end is facing the same direction. Generally, target fragments with smaller areas have less influence on the restoration of the object.
[0073] S203, arranging target points on the surface of the target fragment; the target points are located at non-edge positions on the surface of the target fragment.
[0074] In this embodiment, the target point should be at least 1 cm away from the edge of the target fragment surface.
[0075] S204: Scan the scanning area to generate original point cloud data.
[0076] In this embodiment, when scanning the scanning area, the scanner should be kept perpendicular to the desktop as much as possible. If one format cannot cover all the target fragments, the zigzag scanning can be performed up and down or left and right in accordance with the background frame to ensure that each piece of pottery is covered. Some fragments (such as fragments with mouths or bottoms) are irregular in shape, and only vertical scanning cannot completely scan the blocked areas such as the neck. At this time, the scanner can be tilted to scan the previously blocked areas one by one. If the local scanning data collects data other than the scanning background, the redundant data needs to be deleted to ensure the independence of the fragment data.
[0077] After the scan is completed, CloudCompare software is used to perform noise filtering on the acquired point cloud data to ensure the cleanliness of the data and the accuracy of subsequent analysis.
[0078] By arranging target points on the surface of the target fragment, the quality of the scanned data can be ensured, the consistency of data acquisition and all fragment data parameters can be achieved, and the subsequent extraction of relevant features can be facilitated.
[0079] The S201-204 method achieves the goal of scanning multiple fragments in a single scan, effectively reducing the interference of background noise on the fragment point cloud data, ensuring that the complete geometric information of multiple fragments can be fully captured in a single scan, and significantly improving the scanning efficiency and accuracy.
[0080] S102. Filter out a point set that can form a contour triangle from the original point cloud data, construct a contour surface of the triangle, and extract the edge contour of the triangle to obtain processed fragment point cloud edge contour data; the data includes a plurality of fragments, each fragment includes an extracted edge contour point cloud and a point cloud within the contour.
[0081] Specifically, the Alpha Shapes algorithm is used to extract the edge contours of the fragments from the original point cloud data in combination with the Alpha judgment strategy and multi-resolution analysis to obtain processed fragment point cloud edge contour data, wherein the data includes a plurality of fragments, each fragment including the extracted edge contour point cloud and the point cloud within the contour.
[0082] In this embodiment, if Figure 3 As shown, the step of selecting a point set capable of forming a contour triangle from the original point cloud data includes:
[0083] S301 , selecting triangle vertices on the same sphere from the original point cloud data to form a contour triangle vertex set.
[0084] like Figure 4 As shown, the specific method is as follows:
[0085] S401. Select a point data from the original point cloud data as the target point data, and use the points within the neighborhood range of the target point data as a subset; the neighborhood range is a range whose distance from the point data is no more than 2α, where α is a complexity parameter (i.e., the average point distance between all point pairs in the subset).
[0086] In this embodiment, the original point cloud data is set to S, which contains N three-dimensional space points, and the complexity parameter is set to α and the angle threshold is set to β (the initial value of β is 90°, which is used to limit the circumscribed sphere). A point data P1 is selected from the original point cloud data S as the target point data, and all points whose distance to P1 is not greater than 2α constitute a subset S1 (that is, the subset S1 is the set of all points within the neighborhood of the point data P1).
[0087] S402: Adjust the complexity parameter according to the neighborhood density, and update the subset using the adjusted complexity parameter.
[0088] In this embodiment, adjusting the complexity parameter according to the neighborhood density includes:
[0089] A ball with a radius of α (i.e., the radius value is equal to the complexity parameter value) is "rolled" on the point set. If the point set cannot allow the α ball to pass through, then the three points that prevent the α ball from passing through constitute a contour triangle of the point set; when the α ball "rolls" to all possible contour triangles, the set of all contour triangles can be determined as the contour surface of the entire point set. During the "rolling" process of the α ball, the α value is dynamically adjusted according to the neighborhood density through an adaptive radius adjustment strategy to optimize the selection of contour triangles; if a triangle is in a boundary area with a sudden change in density, the α value is adjusted through a smooth transition to avoid unreasonable contour breaks or connections.
[0090] Among them, the α value is dynamically adjusted according to the neighborhood density through the adaptive radius adjustment strategy, including:
[0091] Calculate the average of the distances between all point pairs in subset S1, and obtain the average point distance of the point cloud data through the average value, and set the value of the complexity parameter α to 2 times the average point distance.
[0092] The calculation formula for the average point distance is as follows:
[0093]
[0094] T={t(P i ,P j )|i,j∈{1,2,…,N}and i≠j}
[0095]
[0096] Among them, t avg is the average point distance; n is the number of points in subset S1; t is the distance between any pair of points; T is the set of t; t(P i ,P j ) is point P i and P j The Euclidean distance between them; i is the number of the first point; j is the number of the second point; x i is the x-axis coordinate of the first point; j is the x-axis coordinate of the second point; y i is the y-axis coordinate of the first point; j is the y-axis coordinate of the second point; z i is the z-axis coordinate of the first point; j is the z-axis coordinate of the second point.
[0097] S403: Select any two point data except the target point data from the updated first subset, and calculate the selected three point data.
[0098] In this embodiment, two points P2 and P3 are randomly selected in the updated first subset S2, and it is calculated whether a sphere with a radius of α and an angle θ less than an angle threshold β exists through the three points P1, P2, and P3; if it exists, the coordinates of the center of the sphere are recorded as O, and the process jumps to step S404; if it does not exist, two points P2 and P3 are reselected, and step S403 is repeated.
[0099] Specifically, Figure 8 As shown, assuming that the coordinates of three points P1 (x1, y1, z1), P2 (x2, y2, z2), and P3 (x3, y3, z3) and the α value are known, the calculation method of the coordinates O of the center of the sphere is as follows:
[0100] Step 1: Determine the plane π equation passing through points P1, P2, and P3:
[0101] Ax+By+Cz+D=0
[0102] A=(y2-y1)*(z3-z1)-(z2-z1)*(y3-y1)
[0103] B=(x3-x1)*(z2-z1)-(x2-x1)*(z3-z1)
[0104] C=(x2-x1)*(y3-y1)-(x3-x1)*(y2-y1)
[0105] D=-(A*x1+B*y1+C*z1)
[0106] Among them, A is the first normal vector; B is the second normal vector; C is the third normal vector; D is a constant; x is the X-axis coordinate of the point data; y is the Y-axis coordinate of the point data; z is the Z-axis coordinate of the point data.
[0107] Step 2: Find the projection point P(x p ,y p ,z p ) coordinates, column matrix equation:
[0108]
[0109] Step 3: Calculate the distance d between the center of the sphere O and point P:
[0110]
[0111] Where r is the radius of the cross-section circle of the plane π-section a-sphere.
[0112] Step 4: Calculate the coordinates of the center of the sphere O(x o ,y o ,z o ):
[0113]
[0114] in, is the plane normal of the outline triangle, (x o ,y o ,z o ) is the coordinate of the sphere center O, where x o is the X-axis coordinate of the center of the sphere; o is the Y-axis coordinate of the center of the sphere; z o is the Z-axis coordinate of the sphere center.
[0115] S404, traverse all two-point data combinations except the target point data in the updated first subset to obtain three-point data combinations about the target point data; each set of three-point data can determine two sphere center coordinates.
[0116] S405. Determine whether the sphere center coordinates determined by each set of three-point data meet the angle condition. If so, the triangle formed by the set of three-point data is used as a boundary triangle; otherwise, the triangle formed by the set of three-point data is not a boundary triangle; and obtain a triangle vertex combination containing the target point data.
[0117] Specifically, among the two sphere center coordinates determined by each set of three-point data, if one meets the angle condition, the triangle formed by the set of three-point data P1, P2, and P3 is used as a boundary triangle, otherwise the triangle formed by the set of three-point data P1, P2, and P3 is not a boundary triangle.
[0118] In this embodiment, the angle condition is:
[0119] θ<β
[0120] Among them, θ is and The angle of is the Z axis with the sphere center coordinates as the origin, is the normal of the contour triangle; β is the angle threshold.
[0121] Under the condition of known angle, the coordinates of the center of the sphere are uniquely determined, avoiding the problem of multiple solutions, and the calculation process can be simplified through the angle condition.
[0122] S406 , traverse all point data in the original point cloud data to obtain a vertex set of contour triangles.
[0123] The contour triangle vertex set obtained through S401-S406 can be used to describe the contour features of the object, simplifying a large amount of point cloud data into a small number of key points to reduce the amount of data and improve the efficiency of subsequent processing.
[0124] S302, traverse each triangle in the contour triangle vertex set, delete the boundary triangles, and obtain the point set of the contour triangle.
[0125] In this embodiment, deleting the boundary triangle to obtain the point set of the outline triangle includes:
[0126] Traverse all boundary triangles and record the number m of contour triangles formed by each vertex. If the m values of the three vertices of the boundary triangle are all less than 3, delete the boundary triangle; extract the vertices of all remaining boundary triangles to obtain the point set S3 of the contour triangle (i.e., contour point cloud).
[0127] Specifically, if the three vertices of an outer contour triangle are not shared with two or more other triangles, the contour triangle is judged as an outlier triangle and deleted. After deletion, all the vertices of the remaining contour triangles are extracted, and radius filtering is used to filter out sparse outliers on these vertices. After filtering, the remaining point cloud data is output, which is the final point set S3 of the contour triangle.
[0128] By deleting the boundary triangles to obtain the point set of the contour triangle, the noise points can be effectively filtered out, the main contour features can be retained, and the robustness of data processing can be improved.
[0129] In this embodiment, the original point cloud is downsampled at multiple levels to generate point clouds of different resolutions. Steps S301 to 302 are applied to the point cloud of each resolution, the contour result C_r is recorded, the result C_{r-1} at low resolution is used as the prior information for high-resolution analysis, C_{r-1} and C_r are merged to obtain a new contour result C_r', and the merged contour is returned, thereby improving the efficiency and accuracy of contour extraction. After the edge contour is extracted, each contour point cloud and the points within the contour are treated as a segmented block and stored separately to obtain the final point cloud data file of each fragment.
[0130] By selecting the point set that can form the contour triangle from the original point cloud data, it can better process the large data point cloud, effectively compress the data volume, while retaining the main structural information, and more effectively extract the contour features of the point cloud, especially for capturing the details of complex shapes. Low-resolution point clouds are not sensitive to noise and can be used as a stable reference for high-resolution analysis to reduce the interference of noise on contour extraction.
[0131] S103 , randomly extracting two fragments from the fragment set, performing coarse registration according to edge contours of the fragments to obtain a coarse registration point cloud, and then performing fine registration on the coarse registration point cloud to identify adjacent fragment pairs.
[0132] In this embodiment, if Figure 5 As shown, two fragments are randomly selected from the fragment set, and coarse registration is performed according to the edge contours of the fragments to obtain a coarse registration point cloud. The specific method is as follows:
[0133] S501, the two fragments include a target fragment point cloud and a fragment point cloud to be matched; the contour points of the target fragment point cloud are rotated around the origin at a certain angle so that the contour points of the target fragment point cloud are matched with the contour points of the fragment point cloud to be matched in sequence, and the specific steps are as follows:
[0134] Step 1: Contour points C1 and C2 are extracted from the target fragment point cloud F1 and the to-be-matched fragment point cloud F2 respectively through S102.
[0135] Step 2: Select a contour point p from C2 and h contour points q from C1 i (i=1,2,…,h).
[0136] Step 3: Rotate the contour point p around the origin k times in the two-dimensional plane, and the angle of the i-th rotation is θ i , get the rotated contour point p i .
[0137] The rotated contour point p i The calculation formula is as follows:
[0138]
[0139] Among them, θ i is the angle of each rotation.
[0140] Specifically, the above step 3 actually selects l appropriate angles θ for the contour point p of the target fragment point cloud i Rotate around the origin l times in the two-dimensional plane to match the contour point p of the target fragment point cloud with the contour point qi (i=1, 2, ...v) of the fragment point cloud to be matched in sequence. When performing point cloud matching, the centroid points of the two point clouds need to be moved to the same position, and their normal vectors both point to the Z axis of the coordinate system of the point cloud to be matched. Specifically, the rotation angle of the two-dimensional edge point cloud around the origin can correspond to the rotation angle of the three-dimensional point cloud around the Z axis, so that the point clouds can be better aligned and matched.
[0141] S502, calculating the distance between the two groups of edge points after each rotation, and calculating the variance of the distance between the contour points in each matching.
[0142] In this embodiment, the distance between the two sets of edge points is an array of distances from each point on the edge of the target fragment point cloud to the nearest point on the edge of the point cloud fragment to be matched, and the calculation formula is as follows:
[0143] d ij = dist(p i ,q j )
[0144] Among them, d ij is the contour point p of the target fragment point cloud i To the contour point q of the fragment point cloud to be matched j distance.
[0145] Specifically, the calculation formula of the variance is as follows:
[0146]
[0147] in, For all distances d ijThe average value of ; M is the number of points on the edge of the target fragment point cloud; l is a point in M.
[0148] In some optional implementations of this embodiment, minimum variance matching may be performed:
[0149] In k rotations, choose the variance Minimum rotation angle θ min , when the rotation angle is θ min When the contour point p of the target fragment point cloud and the contour point q of the fragment point cloud to be matched are considered i Corresponding contour points.
[0150] Minimum rotation angle θ min The calculation formula is as follows:
[0151]
[0152] S503 , calculating the rotation angle of the two-dimensional edge point cloud around the origin according to the variance of the distance between the contour points, and correspondingly obtaining the rotation angle of the three-dimensional point cloud around the Z axis.
[0153] In this embodiment, in k rotations, if the contour point p of the target fragment point cloud is rotated to p i When the distance variance of the two sets of edge point clouds is the smallest, then it is considered that p and the contour point p i The corresponding contour points are then calculated, and the two-dimensional rotation angle θ corresponds to the three-dimensional rotation angle around the Z axis. The calculation formula is as follows:
[0154] θ={θ i |S i =min(S1,S2,…,S k )}
[0155] Among them, θ i is the angle of the i-th rotation; S i is the rotation angle θ with the i-th i The variance of the minimum distance of correlation; S k is the angle θ with the kth rotation k The variance of the associated distances is used to measure the matching quality for each rotation.
[0156] S504: Rotate the target fragment point cloud around the Z axis according to the rotation angle of the three-dimensional point cloud around the Z axis, complete the rough registration of the target fragment point cloud and the fragment point cloud to be matched, and obtain the rough registration point cloud.
[0157] Specifically, the target fragment point cloud F1 is rotated by an angle θ around the Z axis to obtain the coarse registration point cloud F'2. The calculation formula is as follows:
[0158] F′2={R z (θ)·p2v |v=1,2,…,N2}
[0159] Among them, R z (θ) is the rotation matrix around the Z axis; p 2v is the point coordinate in the target fragment point cloud F2; v is the index of point cloud F2; N2 is the number of points contained in the coarse registration point cloud F2.
[0160] Coarse registration provides a reasonable initial pose estimate for subsequent fine registration and stitching, which helps the fine registration method converge to the correct alignment position faster and ensures that the final point cloud stitching result is more accurate, complete and natural.
[0161] In this embodiment, if Figure 6 As shown, the fine registration of the coarsely registered point cloud includes:
[0162] S601 . For any point in the coarse registration point cloud, search for a number of neighboring points in the coarse registration point cloud, and fit the neighboring points into a fitting plane.
[0163] In this embodiment, for each point f in the coarse registration point cloud F'2 i , use the K-nearest neighbors (KNN) algorithm to select the nearest K neighbors around it, and set the neighborhood point NK i , and then the neighborhood point set NK i Use the least squares method to fit the plane and get the plane equation π i .
[0164] S602, obtaining the projection point of the current point in the coarse registration point cloud to the fitting plane, taking the projection point as the pseudo corresponding point of the current point in the coarse registration point cloud, iteratively calculating the rigid body transformation matrix, and obtaining adjacent fragment pairs.
[0165] In this embodiment, obtaining the projection point of the current point in the coarse registration point cloud to the fitting plane refers to calculating the point f i Projection point f' on plane πi i .
[0166] Specifically, the projection point f' i The coordinate calculation formula is:
[0167]
[0168] Among them, f ccntroid The neighborhood point set NK i The center of mass.
[0169] In this embodiment, the use of the projection point as the pseudo corresponding point of the current point in the rough registration point cloud refers to using the projection point f' i As a pseudo corresponding point fqi , the calculation is shown as follows:
[0170] fq i =(x′ i , y′ i , z i )
[0171] Among them, (x' i ,y' i ,z' i ) is fq i The coordinates of .
[0172] In this embodiment, the iterative calculation of the rigid body transformation matrix is to gradually reduce the error between the two point clouds, gradually optimize the alignment between the point clouds, and achieve more accurate alignment. Specifically, the rigid body transformation matrix uses the singular value decomposition (SVD) method to calculate the rotation matrix R and the translation vector matrix T between F1 and F'2, and the calculation formula is as follows:
[0173]
[0174] The translation vector matrix in the rigid body transformation is:
[0175] T=[t1 t2 t3] T
[0176] The rotation matrix in the rigid body transformation is:
[0177]
[0178] in, is the coordinate of the point after transformation; r ij is an element of the rotation matrix R, which represents the rotation relationship from one coordinate system to another; are the coordinates of the point before transformation; t1 is the translation along the X axis; t2 is the translation along the Y axis; t3 is the translation along the Z axis.
[0179] In this embodiment, the initialization number of iterations n is 0, and the maximum number of iterations is N. max In each iteration, the pseudo corresponding point pf is used i Perform point cloud registration, the specific iterative process is as follows:
[0180] Step 1: Calculate point f i and pseudo corresponding point pf i The error between i =||f i -pf i ||.
[0181] Step 2: Use the least squares method to calculate the rotation matrix R and the translation vector matrix T to minimize the error. The formula is as follows:
[0182]
[0183] Step 3: Update the pose of point cloud F'2 to make it more aligned with F1. The update formula is:
[0184] F′2=RF′2+t
[0185] Step 4: Reselect the neighborhood point NK i And calculate the new pseudo corresponding point pf i .
[0186] Step 5: Determine whether the termination condition (e i ≤ε, such as setting ε=0.001), if the termination condition is met, the iteration ends; otherwise, continue to iterate and execute step 1 until the condition is met.
[0187] In this embodiment, the adjacent fragment pair is the target fragment point cloud F1 and the precise registration point cloud F'2.
[0188] Through fine registration, the geometric alignment between the fragments is ensured to be extremely accurate. Precise alignment enables the restored artifacts to maintain their original shape and structure.
[0189] S104, splicing and fusing the adjacent fragment pairs to obtain a splicing result of the broken parts of the adjacent fragment pairs.
[0190] Specifically, Figure 7 As shown in the figure, the splicing process is to perform a rigid body transformation on two adjacent fragments so that the two fragments at different positions and in different coordinate systems can be spliced at the broken parts, including:
[0191] S701, performing rotation and translation transformation on the adjacent fragment pairs so that the two adjacent fragments are in the same coordinate system, and then merging the two groups of point clouds to obtain merged fragments.
[0192] In this embodiment, it is assumed that the feature point and is the matching point pair on the contour line of the fractured part of the adjacent fragment pair F1 and F'2. When the two fragments are completely joined, the feature point and Coincidence, definition and After the rigid body transformation, the two adjacent fragments can be in the same coordinate system. The two sets of point clouds can be merged to obtain the merged fragment.
[0193] In this embodiment, all the adjacent fragments that can be merged in the fragment data set are traversed until there are no more fragments that can be merged or the maximum number of iterations is reached, and then the merging can be considered to have converged. The method for merging fragments is obtained:
[0194] Step 1: Calculate the error E between F1 and F'2.
[0195] Step 2: If E is less than the preset error threshold ε, F1 and F'2 are regarded as a combination of adjacent fragments, and jump to step 3.
[0196] Step 3: Combine F1 and F'2 into a merged fragment F combined .
[0197] S702: After edge extraction of the merged fragments, the result of splicing the broken parts of the adjacent fragment pairs is obtained, and the result is added to the fragment set, while deleting the two adjacent fragments that have been merged.
[0198] The splicing results of the reconstructed model of ancient pottery fragments are evaluated to ensure that the model restoration is highly accurate. By splicing and fusing adjacent fragments to form a whole, the spliced object looks more natural and close to the original state. By automatically searching for splicing fragments in a loop, it supports batch splicing and fusing of multiple adjacent fragments, further speeding up the splicing speed.
[0199] S105, traverse all the fragments in the fragment set to obtain the result of splicing the fractured parts of thin-walled ancient pottery.
[0200] Specifically, iterative steps S103-S104 are repeated until all fragments in the fragment set are traversed, and the fractured parts of all the connectable fragments of the thin-walled ancient pottery are spliced together to obtain the splicing results.
[0201] According to the embodiments of the present invention, the present invention has the following advantages over the prior art:
[0202] (1) The present invention changes the single scanning of fragments into batch scanning of multiple fragments, and in order to achieve the goal of scanning multiple fragments at a time, the scanning background and scanning process are specially designed and optimized; this method is used to collect pottery fragments broken into 30 and 39 pieces respectively, and the efficiency is about 15 times shorter than that of single-piece scanning.
[0203] (2) The present invention utilizes the Alpha Shapes algorithm and combines the Alpha judgment strategy and multi-resolution analysis to extract the edge contour of the fragment point cloud, and regards each contour point cloud and the points within the contour as a segmented block for separate storage, thereby obtaining the final point cloud data file for each single fragment. This can better solve the problem of low edge extraction accuracy and low efficiency caused by irregular fragment edge shapes, few features in the fractured area, and a large number of fractured areas.
[0204] (3) The present invention optimizes the ICP algorithm through coarse alignment and the introduction of pseudo corresponding points, identifies the optimal combination of adjacent fragments, uses the singular value decomposition method or the principal component analysis method to calculate the rigid body transformation matrix, completes the splicing of ancient pottery fragments, and improves the splicing accuracy and efficiency.
[0205] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0206] The above is an introduction to a method embodiment. The following is a further explanation of the scheme of the present invention through a device embodiment having the same inventive concept as the method in the aforementioned embodiment.
[0207] like Figure 8 As shown, the device 800 includes:
[0208] The acquisition module 810 is used to acquire the original point cloud data of the target fragments of thin-walled ancient pottery.
[0209] The extraction module 820 is used to filter out a point set that can form a contour triangle from the original point cloud data, construct a contour surface of the triangle, and extract the edge contour of the triangle to obtain a fragment set; the fragment set includes a plurality of fragments, each fragment includes an extracted edge contour point cloud and a point cloud within the contour.
[0210] The identification module 830 is used to randomly select two fragments from the fragment set, perform rough registration based on the edge contours of the fragments to obtain an initially registered fragment pair, and then perform fine registration on the fragment pair to identify adjacent fragment pairs.
[0211] The splicing module 840 is used to splice and merge the adjacent fragment pairs to obtain a splicing result of the broken parts of the adjacent fragment pairs.
[0212] The integration module 850 is used to traverse all the fragments in the fragment set to obtain the splicing result of the fractured parts of the thin-walled ancient pottery.
[0213] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0214] In the technical solution of the present invention, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0215] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0216] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A virtual splicing method for thin-walled ancient pottery fragments, characterized in that: include: Obtain the original point cloud data of target fragments of thin-walled ancient pottery; A point set capable of forming an outline triangle is selected from the original point cloud data, an outline surface of the triangle is constructed, and an edge outline of the triangle is extracted to obtain a fragment set; the fragment set includes a plurality of fragments, each fragment includes an extracted edge outline point cloud and a point cloud within the outline; Randomly extract two fragments from the fragment set, perform coarse registration according to the edge contours of the fragments to obtain a coarse registration point cloud, and then perform fine registration on the coarse registration point cloud to identify adjacent fragment pairs; The adjacent fragment pairs are spliced and merged to obtain a splicing result of the broken parts of the adjacent fragment pairs; Traverse all the fragments in the fragment set and obtain the results of splicing the fractured parts of thin-walled ancient pottery.
2. The method according to claim 1, characterized in that The method of obtaining the original point cloud data of the target fragments of thin-walled ancient pottery includes: Numbering the target fragments; According to the size of the target fragment, a scanning area is set so that the target fragment is located within the scanning area; the scanning area includes a plurality of panes so that a corresponding relationship is generated between the panes and the target fragment; Arranging target points on the surface of the target fragment; the target points are located at non-edge positions on the surface of the target fragment; The scanning area is scanned to generate original point cloud data.
3. The method according to claim 1, characterized in that The step of selecting a point set capable of forming a contour triangle from the original point cloud data comprises: Filtering out triangle vertices on the same sphere from the original point cloud data to form a contour triangle vertex set; Traverse each triangle in the contour triangle vertex set, delete the boundary triangles, and get the point set of the contour triangle.
4. The method according to claim 3, characterized in that The step of selecting triangle vertices on the same sphere from the original point cloud data includes: Selecting a point data from the original point cloud data as the target point data, and taking the points within the neighborhood range of the target point data as a subset; the neighborhood range is a range that is no more than 2α from the point data, where α is a complexity parameter; Adjusting the complexity parameter according to the neighborhood density, and updating the subset using the adjusted complexity parameter; Select any two point data other than the target point data from the updated first subset, and calculate the selected three point data; Traverse all two-point data combinations except the target point data in the updated first subset to obtain three-point data combinations about the target point data; each set of three-point data can determine two spherical center coordinates; Determine whether the spherical center coordinates determined by each set of three-point data meet the angle condition. If so, the triangle formed by the set of three-point data is used as a boundary triangle; otherwise, the triangle formed by the set of three-point data is not a boundary triangle; obtain the triangle vertex combination containing the target point data; All point data in the original point cloud data are traversed to obtain a contour triangle vertex set.
5. The method according to claim 4, characterized in that The angle condition is: θ<β Among them, θ is and The angle of is the Z axis with the sphere center coordinates as the origin, is the normal of the contour triangle; β is the angle threshold.
6. The method according to claim 3, characterized in that The step of deleting the boundary triangle to obtain the point set of the outline triangle includes: Traverse all boundary triangles and record the number m of contour triangles formed by each vertex. If the m values of the three vertices of a boundary triangle are all less than 3, delete the boundary triangle. Extract the vertices of all remaining boundary triangles to obtain the point set of the contour triangle.
7. The method according to claim 1, characterized in that The method of randomly extracting two fragments from the fragment set and performing rough registration according to the edge contours of the fragments to obtain a rough registration point cloud includes: The two fragments include a target fragment point cloud and a fragment point cloud to be matched; the contour points of the target fragment point cloud are rotated around the origin at a certain angle so that the contour points of the target fragment point cloud are matched with the contour points of the fragment point cloud to be matched in sequence; The distance between the two sets of edge points is calculated after each rotation, and the variance of the distance between contour points in each matching is calculated; The rotation angle of the 2D edge point cloud around the origin is calculated based on the variance of the distance between the contour points, which corresponds to the rotation angle of the 3D point cloud around the Z axis. The target fragment point cloud is rotated around the Z axis according to the rotation angle of the three-dimensional point cloud around the Z axis, and the target fragment point cloud and the fragment point cloud to be matched are roughly aligned to obtain a roughly aligned point cloud.
8. The method according to claim 7, characterized in that The fine registration of the coarsely registered point cloud comprises: For any point in the coarse registration point cloud, searching for a number of neighboring points in the coarse registration point cloud, and fitting the neighboring points into a fitting plane; Get the projection point of the current point in the coarse registration point cloud to the fitting plane, use the projection point as the pseudo corresponding point of the current point in the coarse registration point cloud, iteratively calculate the rigid body transformation matrix, and obtain the adjacent fragment pair.
9. The method according to claim 1, characterized in that: The step of splicing and fusing the adjacent fragment pairs comprises: Perform rotation and translation transformation on the adjacent fragment pairs so that the two adjacent fragments are in the same coordinate system, and then merge the two groups of point clouds to obtain the merged fragments; After edge extraction of the merged fragments, the result of splicing the broken parts of the adjacent fragment pairs is obtained and added to the fragment set, while the two adjacent fragments that have been merged are deleted.
10. A virtual splicing device for thin-walled ancient pottery fragments, characterized in that: include: An acquisition module is used to acquire the original point cloud data of target fragments of thin-walled ancient pottery; An extraction module is used to filter out a point set that can form an outline triangle from the original point cloud data, construct a triangular outline surface, and extract an edge outline of the triangle to obtain a fragment set; the fragment set includes a plurality of fragments, each fragment includes an extracted edge outline point cloud and a point cloud within the outline; A recognition module is used to randomly extract two fragments from the fragment set, perform coarse registration according to the edge contours of the fragments to obtain a coarse registration point cloud, and then perform fine registration on the coarse registration point cloud to identify adjacent fragment pairs; A splicing module, used for splicing and fusing the adjacent fragment pairs to obtain a splicing result of the broken parts of the adjacent fragment pairs; The integration module is used to traverse all the fragments in the fragment set and obtain the results of splicing the fractured parts of thin-walled ancient pottery.