Correction method, electronic device and storage medium
By obtaining standard edge lines and projecting the edge vertices of the grid, the problem of insufficient edge accuracy in three-dimensional scanning is solved, and higher boundary accuracy and edge information accuracy are achieved.
Patent Information
- Application Number
- CN202110785049.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-12
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2041-07-12
AI Technical Summary
In three-dimensional scanning, the edges behind the holes, boundaries and gaps at the edges are not smooth enough, resulting in the accuracy not meeting the requirements.
By obtaining the standard edge line, determine the grid edge vertex adjacent to the standard edge line and project it onto the standard edge line to correct the grid vertex, and then determine the corrected edge line in the 3D mesh model.
It realizes more accurately determining the edge information of the scanned object, and improves the boundary accuracy of the three-dimensional scanning.
Smart Images

Figure CN113593010B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of three-dimensional scanning, and in particular to a correction method, an electronic device and a storage medium. Background Art
[0002] 3D scanning is a high-tech technology that integrates optical, mechanical, electrical and computer technologies. It is mainly used to scan the spatial shape, structure and color of an object to obtain the spatial coordinates of the object's surface. When encountering edges during 3D scanning, such as holes, boundaries, gaps, etc., the same scanning method as scanning ordinary objects is generally adopted, which will result in the edges being not smooth enough and the edges obtained being jagged.
[0003] In order to make the edges clearer, existing solutions usually encrypt the edges. Although the boundaries will be clearer, the scanned edges will be jagged, and the accuracy cannot meet the requirements. Summary of the invention
[0004] In this embodiment, a correction method, an electronic device and a storage medium are provided to solve the problem in the related art that the boundary accuracy of three-dimensional scanning cannot meet the requirements.
[0005] In a first aspect, a correction method is provided in this embodiment, including:
[0006] Get the standard margin line;
[0007] Determine each mesh edge vertex adjacent to the standard edge line;
[0008] Determine the projection of each mesh edge vertex on the standard edge line as the corresponding corrected mesh vertex;
[0009] According to each of the corrected mesh vertices, a corrected edge line in the three-dimensional mesh model is determined.
[0010] In some embodiments, determining each mesh edge vertex adjacent to the edge line includes:
[0011] Each mesh edge vertex adjacent to the standard edge line is determined by sampling the standard edge line or according to the distance from each mesh vertex in the three-dimensional mesh model to the standard edge line.
[0012] In some embodiments, sampling the standard edge line to determine each mesh edge vertex adjacent to the edge line specifically includes:
[0013] The standard edge line is sampled at equal distances to obtain sampling points;
[0014] Each mesh edge vertex adjacent to the edge line is determined according to each sampling point.
[0015] In some embodiments, determining each mesh edge vertex adjacent to the edge line according to each sampling point includes:
[0016] Determine, according to the spatial data structure, adjacent vertices of each of the sampling points, wherein the number of the adjacent vertices is greater than or equal to 1;
[0017] According to each of the adjacent vertices, each mesh edge vertex adjacent to the edge line is determined.
[0018] In some embodiments, the edge line is sampled at equal distances to obtain sampling points including:
[0019] Determining a sampling distance according to a resolution of the three-dimensional grid model;
[0020] The edge line is sampled at equal distances according to the sampling distance to obtain sampling points.
[0021] In some embodiments, the method further comprises:
[0022] Determine, according to each of the mesh edge vertices, a boundary edge having each of the mesh edge vertices as a vertex;
[0023] If the length of the boundary edge is greater than or equal to a first threshold, use more than one segmentation point to segment the boundary edge;
[0024] Projecting each of the segmentation points onto the edge line to obtain each newly added mesh vertex;
[0025] The determining of the corrected edge line specifically includes: determining the corrected edge line in the three-dimensional mesh model according to each of the corrected mesh vertices and each of the newly added mesh vertices.
[0026] In some embodiments, after determining the corrected edge line, the method further includes:
[0027] Based on the mesh topology of the three-dimensional mesh model, determining adjacent mesh vertices of each of the corrected mesh vertices;
[0028] The neighboring mesh vertices are filtered.
[0029] In a second aspect, a correction method is provided in this embodiment for a three-dimensional scanning system, comprising:
[0030] Obtaining the standard edge line of the hole to be repaired;
[0031] Filling the hole to be repaired to obtain filled three-dimensional grid data;
[0032] Projecting the standard edge line of the hole to be repaired onto the three-dimensional mesh data to determine the three-dimensional mesh data within the hole to be repaired;
[0033] In the filled three-dimensional mesh data, the three-dimensional mesh data in the hole to be repaired is deleted to obtain the repaired edge line of the hole to be repaired.
[0034] In some embodiments, before filling the hole to be repaired to obtain the filled three-dimensional mesh data, the method includes:
[0035] The position information of the hole to be repaired is determined according to the standard edge line of the hole to be repaired.
[0036] In some embodiments, projecting the standard edge line of the hole to be repaired onto the three-dimensional mesh data to determine the three-dimensional mesh data within the hole to be repaired specifically includes:
[0037] Projecting the standard edge line of the hole to be repaired onto the three-dimensional mesh data, determining each first face patch and each second face patch, wherein the first face patch is a face patch intersecting with the standard edge line of the hole to be repaired, and the second face patch is a face patch within the hole to be repaired and not intersecting with the standard edge line of the hole to be repaired;
[0038] Determine each third surface patch according to each first surface patch and the standard edge line position of the hole to be repaired, wherein the third surface patch is located inside the hole to be repaired;
[0039] The three-dimensional mesh data in the hole to be repaired is determined according to each of the second surface patches and each of the third surface patches.
[0040] In some embodiments, determining each third facet according to each first facet and the standard edge line position of the hole to be repaired includes:
[0041] Segment each of the first face patches according to the standard edge line position of the hole to be repaired to obtain a fourth face patch set;
[0042] The third face patches are determined according to the face patches in the fourth face patch set that are located inside the hole to be repaired.
[0043] In some embodiments, filling the hole to be repaired to obtain the filled three-dimensional mesh data includes:
[0044] Obtaining the size parameters of the hole to be repaired;
[0045] Expanding the area of the hole to be repaired according to the size parameter to obtain an expanded hole to be repaired;
[0046] In the three-dimensional mesh model, the expanded holes to be repaired are filled according to the positions of the expanded holes to be repaired, so as to obtain filled three-dimensional mesh data.
[0047] In a third aspect, an electronic device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the correction method described in the first and second aspects above when executing the computer program.
[0048] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the correction method described in the first and second aspects above is implemented.
[0049] Compared with the related art, the correction method, electronic device and storage medium provided in this embodiment determine the projection of each mesh edge vertex on the standard edge line as the corresponding corrected mesh vertices; based on each corrected mesh vertex, the corrected edge line in the three-dimensional mesh model is determined, thereby solving the problem that the boundary accuracy of three-dimensional scanning cannot meet the requirements and achieving more accurate determination of the edge information of the scanned object.
[0050] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0052] Figure 1 is a hardware structure block diagram of an application terminal of the correction method according to an embodiment of the present application;
[0053] Figure 2 The process of the correction method according to the embodiment of the present application is Figure 1 ;
[0054] Figure 3 is a schematic diagram of a closed boundary line of a scanned object according to an embodiment of the present application;
[0055] Figure 4 is a schematic diagram of a non-closed boundary line of a scanned object according to an embodiment of the present application;
[0056] Figure 5 is a schematic diagram of a gap of a scanned object according to an embodiment of the present application;
[0057] Figure 6is a schematic diagram of projections of mesh edge vertices adjacent to a standard edge line according to an embodiment of the present application;
[0058] Figure 7 The process of the correction method according to the embodiment of the present application is Figure 2 ;
[0059] Figure 8 The process of the correction method according to the embodiment of the present application is Figure 3 ;
[0060] Fig. 9 is a schematic diagram of three-dimensional grid data in a hole to be repaired according to an embodiment of the present application;
[0061] Fig.10 is a schematic diagram of segmenting a first face piece according to a standard edge line position of a hole to be repaired according to an embodiment of the present application;
[0062] Fig.11 The process of the correction method according to the embodiment of the present application is Figure 4 ;
[0063] Fig.12 The process of the correction method according to the embodiment of the present application is Figure 5 ;
[0064] Fig.13 is a schematic diagram of splitting an adjacent triangle into multiple triangles according to an embodiment of the present application;
[0065] Fig.14 The process of the correction method according to the embodiment of the present application is Figure 6 . DETAILED DESCRIPTION
[0066] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0067] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0068] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 is a hardware structure block diagram of an application terminal according to the correction method of an embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0069] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the correction method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0070] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0071] In this embodiment, a correction method is provided. Figure 2 The process of the correction method according to the embodiment of the present application is Figure 1 ,like Figure 2 As shown, the process includes the following steps:
[0072] Step S201, obtaining a standard edge line.
[0073] In this embodiment, the standard edge line can be obtained through binocular reconstruction, that is, cameras at two different positions take two or more images of the scanned object, and the standard edge line of the scanned object is obtained based on the two or more images of the scanned object. However, it is not limited to the above method. Any method that can obtain the standard edge line is within the protection scope of this application, for example, directly obtaining the standard edge line through photogrammetry or through light pen hard detection.
[0074] Step S202, determining each mesh edge vertex adjacent to the standard edge line.
[0075] Step S203: determining the projections of the mesh edge vertices on the standard edge line as the corresponding corrected mesh vertices.
[0076] Step S204: determining a corrected edge line in the three-dimensional mesh model according to each corrected mesh vertex.
[0077] In this embodiment, the edge line includes the boundary line of the scanned object and the gap of the scanned object in the three-dimensional grid model, wherein the boundary line of the scanned object includes a closed boundary line and a non-closed boundary line, see Figure 3 , Figure 4 and Figure 5 , Figure 3 is a schematic diagram of a closed boundary line of a scanned object according to an embodiment of the present application, Figure 4 is a schematic diagram of a non-closed boundary line of a scanned object according to an embodiment of the present application, Figure 5 Schematic diagram of a gap in a scanned object according to an embodiment of the present application.
[0078] Figure 6 is a schematic diagram of projections of mesh edge vertices adjacent to the standard edge line according to an embodiment of the present application, such as Figure 6 As shown, the mesh edge vertices adjacent to the standard edge line include B1, C1, E1, H1, I1 and K1, the corrected mesh vertices include B2, C2, E2, H2, I2 and K2, and the corrected edge line includes a line segment composed of vertices B2 and C2, a line segment composed of vertices C2 and E2, a line segment composed of vertices E2 and H2, a line segment composed of vertices H2 and I2, and a line segment composed of vertices I2 and K2.
[0079] Through the above steps, the edge lines of the scanned object in the three-dimensional mesh model are corrected according to the acquired standard edge lines, so that the edge information of the scanned object can be determined more accurately, solving the problem that the boundary accuracy of the three-dimensional scanning cannot meet the requirements.
[0080] In some of the embodiments, determining each mesh edge vertex adjacent to the edge line includes:
[0081] Each mesh edge vertex adjacent to the standard edge line is determined by sampling the standard edge line or according to the distance from each mesh vertex in the three-dimensional mesh model to the standard edge line.
[0082] In this embodiment, the distance from each mesh vertex in the three-dimensional mesh model to the standard edge line can be calculated to determine whether the distance from each mesh vertex to the standard edge line is within a set threshold range. If so, the mesh vertex is determined to be a mesh vertex adjacent to the standard edge line. However, the method is not limited to determining each mesh edge vertices adjacent to the quasi-edge line in the above manner. Any method of determining each mesh edge vertices adjacent to the standard edge line based on the distance from each mesh vertex in the three-dimensional mesh model to the standard edge line is within the protection scope of the present application. For example, according to the position of the standard edge line, a first spatial range is determined in the three-dimensional mesh model, and the distance from each mesh vertex to the standard edge is calculated in the first spatial range to determine whether the distance from each mesh vertex to the standard edge line is within a set threshold range. If so, the mesh vertex is determined to be a mesh edge vertex adjacent to the standard edge line.
[0083] In this embodiment, the distance from each mesh vertex to the standard edge line in the three-dimensional mesh model can be calculated based on a fast iteration method based on geometric features, a combination of the golden section method and the quadratic iteration method based on an optimization method, or a grid method, but is not limited to the above-mentioned methods for calculating the distance from each mesh vertex to the standard edge line in the three-dimensional mesh model. This application does not limit how to determine the distance from each mesh vertex to the standard edge line in the three-dimensional mesh model.
[0084] Through the above method, each grid edge vertices adjacent to the standard edge line can be accurately determined. Furthermore, the edge line of the scanned object can be corrected according to each grid edge vertices adjacent to the standard edge line, so that the edge information of the scanned object can be determined more accurately.
[0085] In some of the embodiments, the method of sampling the standard edge line to determine each mesh edge vertex adjacent to the edge line specifically includes:
[0086] The standard edge line is sampled at equal distances to obtain various sampling points;
[0087] Each mesh edge vertex adjacent to the edge line is determined according to each sampling point.
[0088] Furthermore, the standard edge line can be sampled at equal distances, so that when sampling, there is no need to distinguish the sampling distance according to the curvature size, which can greatly improve the efficiency of obtaining sampling points.
[0089] In some of the embodiments, determining each mesh edge vertex adjacent to the edge line according to each sampling point includes:
[0090] According to the spatial data structure, determine the neighboring vertices of each sampling point, wherein the number of the neighboring vertices is greater than or equal to 1;
[0091] According to each adjacent vertex, each mesh edge vertex adjacent to the edge line is determined.
[0092] In this embodiment, the spatial data structure includes an octree and a KD tree, but is not limited to the above two spatial data structures. No specific limitation is made here on which spatial data structure is used.
[0093] It should be noted that the spatial data structure (Spatial Data Structure) refers to the logical structure of spatial data suitable for computer storage, management, and processing, and is the organization and encoding form of spatial data in the computer.
[0094] It can be understood that in this embodiment, the adjacent vertices of the sampling point can be quickly determined according to the spatial data structure, thereby improving the efficiency of determining the adjacent vertices of the sampling point.
[0095] The larger the sampling distance, the fewer the number of mesh edge vertices adjacent to the standard edge line will be searched, and the search efficiency will be faster, but the search may not be complete. The smaller the sampling distance, the more the number of mesh edge vertices adjacent to the standard edge line will be searched, but the amount of calculation will be greater and the search efficiency will be slower. Therefore, it is necessary to select an appropriate sampling distance.
[0096] In some embodiments, the edge line is sampled at equal distances to obtain sampling points including:
[0097] Determine the sampling distance according to the resolution of the three-dimensional grid model;
[0098] The edge line is sampled at equal distances according to the sampling distance to obtain the sampling points.
[0099] In this embodiment, each mesh edge vertex adjacent to the standard edge line is determined according to each sampling point, and the projection of each mesh edge vertex on the standard edge line is determined as the corresponding corrected mesh vertex; based on each corrected mesh vertex, the corrected edge line in the three-dimensional mesh model is determined; based on each corrected mesh vertex and the corrected edge line, a corrected three-dimensional mesh model is obtained.
[0100] It can be understood that in this embodiment, the sampling distance is determined according to the resolution of the three-dimensional mesh model. The sampling points obtained according to this sampling distance can quickly search for adjacent mesh edge vertices and can more accurately determine the mesh edge vertices adjacent to the standard edge line.
[0101] In some of these embodiments, the method further comprises:
[0102] Determine a boundary edge with each mesh edge vertex as a vertex according to each mesh edge vertex adjacent to the standard edge line;
[0103] If the length of the boundary edge is greater than or equal to the first threshold, use more than one segmentation point to segment the boundary edge;
[0104] Project each segmentation point onto the edge line to obtain each newly added mesh vertex;
[0105] Determining the corrected edge line specifically includes: determining the corrected edge line in the three-dimensional mesh model according to each corrected mesh vertex and each newly added mesh vertex.
[0106] It can be understood that if the length of the boundary edge is greater than or equal to the threshold, it means that the distance between the two mesh edge vertices corresponding to the boundary edge is far. At this time, based on the two mesh edge vertices, the distance between the two corrected mesh vertices is large, that is, the corrected edge line obtained based on the two corrected mesh vertices will not be smooth. In other words, the edge line obtained in this way is not close enough to the real edge line. Therefore, in this embodiment, the boundary edge with a length greater than or equal to the first threshold is segmented, that is, the longer boundary edge is segmented to obtain each newly added mesh vertices, and based on the corrected mesh vertices and each newly added mesh vertices, the corrected edge line in the obtained three-dimensional mesh model will be smoother and closer to the real edge line.
[0107] In some of the embodiments, after determining the corrected edge line, the method further comprises:
[0108] Determine neighboring mesh vertices of each corrected mesh vertex based on a mesh topology structure of the three-dimensional mesh model;
[0109] Filters neighboring mesh vertices.
[0110] In this embodiment, the adjacent mesh vertices may be filtered by a Laplacian operator or a mean curvature method, but the method is not limited to the above methods. Any method capable of filtering the adjacent mesh vertices is within the protection scope of the present application.
[0111] By using the above method, the noise in the adjacent mesh vertices is removed, so that the surface of the modified three-dimensional mesh model can be smoother.
[0112] Figure 7 The process of the correction method according to the embodiment of the present application is Figure 2 ,like Figure 7 As shown, the process includes the following steps:
[0113] Step S701, obtaining a standard edge line.
[0114] Step S702 : determining each mesh edge vertex adjacent to the standard edge line by sampling the standard edge line or according to the distance from each mesh vertex in the three-dimensional mesh model to the standard edge line.
[0115] Step S703: determining the projections of the mesh edge vertices on the standard edge line as the corresponding corrected mesh vertices.
[0116] Step S704, determining a boundary edge with each mesh vertex as a vertex according to each mesh edge vertex adjacent to the standard edge line, if the length of the boundary edge is greater than or equal to the first threshold, using more than one segmentation point to segment the boundary edge, projecting each segmentation point onto the edge line, and obtaining each newly added mesh vertex.
[0117] Step S705 : determining a corrected edge line in the three-dimensional mesh model according to each corrected mesh vertex and each newly added mesh vertex.
[0118] Through the above steps, based on the acquired standard edge line, each mesh edge vertices adjacent to the standard edge line can be determined, and then each mesh edge vertices adjacent to the standard edge line can be projected onto the standard edge line, so that the edge information of the scanned object can be determined more accurately, solving the problem that the boundary accuracy of the three-dimensional scanning cannot meet the requirements. In addition, the boundary edges with a length greater than or equal to the first threshold are segmented, that is, the longer boundary edges are segmented to obtain each newly added mesh vertices, and based on the corrected mesh vertices and the newly added mesh vertices, the corrected edge lines in the obtained three-dimensional mesh model will be smoother.
[0119] This embodiment also provides a correction method. Figure 8 The process of the correction method according to the embodiment of the present application is Figure 3 ,like Figure 8 As shown, the process includes the following steps:
[0120] Step S801, obtaining a standard edge line of the hole to be repaired.
[0121] In this embodiment, the standard edge line of the hole to be repaired can be obtained by binocular reconstruction, that is, cameras at two different positions take two or more images of the hole to be repaired, and the standard edge line of the hole to be repaired is determined based on the two or more images of the hole to be repaired, but is not limited to the above method. Any method that can obtain the standard edge line of the hole to be repaired is within the protection scope of this application, for example, directly obtaining the standard edge line of the hole to be repaired by photogrammetry or by light pen hard detection.
[0122] Step S802, filling the holes to be repaired to obtain filled three-dimensional mesh data.
[0123] In this embodiment, filling the holes to be repaired includes filling the holes to be repaired by radial basis, filling the holes to be repaired by minimum angle wavefront method and filling the holes to be repaired based on Poisson equation, but is not limited to the above-mentioned methods of filling the holes to be repaired. The method of filling the holes to be repaired is not limited here.
[0124] Step S803 , projecting the standard edge line of the hole to be repaired onto the three-dimensional mesh data, and determining the three-dimensional mesh data within the hole to be repaired.
[0125] Step S804: In the filled three-dimensional mesh data, the three-dimensional mesh data in the hole to be repaired is deleted to obtain the edge line of the hole to be repaired.
[0126] Through the above steps, the edge line of the hole to be repaired in the three-dimensional mesh model is corrected according to the obtained standard edge line of the hole to be repaired, so that the edge line information of the hole to be repaired can be determined more accurately, solving the problem that the boundary accuracy of the three-dimensional scanning cannot meet the requirements.
[0127] In some embodiments, obtaining the standard edge line of the hole to be repaired includes:
[0128] Use a fill light to fill in the area near the hole to be repaired, or use an object with reflective material to fill in the hole to be repaired.
[0129] By means of the above method, the contrast between the edge line of the hole to be repaired and the non-hole area is made higher, so that the standard edge line of the hole to be repaired can be obtained more accurately.
[0130] In some embodiments, before filling the hole to be repaired and obtaining the filled three-dimensional mesh data, the method includes:
[0131] According to the standard edge line of the hole to be repaired, the position information of the hole to be repaired is determined.
[0132] It can be understood that in the present embodiment, assuming that the hole to be repaired is a circular hole, the position information of the hole to be repaired can be determined based on the center coordinates and radius of the standard edge line. Furthermore, the hole to be repaired can be filled based on the position information of the hole to be repaired, so that the hole to be repaired can be filled more accurately. If the hole to be repaired is not a circular hole, the position information of the hole to be repaired cannot be determined only based on the center coordinates and radius. For example, if the hole to be repaired is a waist-shaped hole, the position information of the waist-shaped hole needs to be determined based on the center coordinates, major axis and minor axis of the waist-shaped hole.
[0133] In some embodiments, projecting the standard edge line of the hole to be repaired onto the three-dimensional mesh data to determine the three-dimensional mesh data within the hole to be repaired specifically includes:
[0134] Projecting the standard edge line of the hole to be repaired onto the three-dimensional grid data, determining each first face patch and each second face patch, wherein the first face patch is a face patch that intersects with the standard edge line of the hole to be repaired, and the second face patch is a face patch that is within the hole to be repaired and does not intersect with the standard edge line of the hole to be repaired;
[0135] Determine each third surface patch according to each first surface patch and the standard edge line position of the hole to be repaired, wherein the third surface patch is located inside the hole to be repaired;
[0136] According to each second surface patch and each third surface patch, three-dimensional grid data in the hole to be repaired is determined.
[0137] In this example, see Fig. 9 , Fig. 9 is a schematic diagram of three-dimensional grid data in a hole to be repaired according to an embodiment of the present application, such as Fig. 9 As shown, the second face patch includes a triangle composed of vertices D, F, and E, but the second face patch is not limited to the triangle composed of vertices D, F, and E. The third face patch includes a quadrilateral composed of vertices B, D, C, and E, but the third face patch is not limited to the quadrilateral composed of vertices B, D, C, and E. The first face patch includes a triangle composed of vertices A, D, and E, but the first face patch is not limited to the triangle composed of vertices A, D, and E. The edge line of the hole to be repaired after repair includes a line segment composed of vertices B and C, but the edge line of the hole to be repaired after repair is not limited to the line segment composed of vertices B and C.
[0138] Through the above method, based on the obtained standard edge line of the hole to be repaired, the three-dimensional grid data within the hole to be repaired can be determined more accurately. Furthermore, based on the three-dimensional grid data within the hole to be repaired, the edge line information of the hole to be repaired can be determined more accurately, solving the problem that the boundary accuracy of the three-dimensional scanning cannot meet the requirements.
[0139] In some embodiments, determining each third facet according to each first facet and the standard edge line position of the hole to be repaired includes:
[0140] Segment each first face patch according to the standard edge line position of the hole to be repaired to obtain a fourth face patch set;
[0141] The third face patches are determined according to the face patches in the fourth face patch set that are located inside the holes to be repaired.
[0142] In this example, see Fig.10 , Fig.10 is a schematic diagram of segmenting the first face piece according to the standard edge line position of the hole to be repaired according to an embodiment of the present application, such as Fig.10As shown, the first face patch includes a triangle composed of vertices K, J, and G, the fourth face patch set includes a triangle composed of vertices G, H, and I, a triangle composed of H, J, and I, and a triangle composed of J, I, and K, and the third face patch includes a triangle composed of H, J, and I, and a triangle composed of J, I, and K.
[0143] Through the above method, according to the embodiment of the present application, the first face piece is segmented according to the standard edge line position of the hole to be repaired, so that the three-dimensional mesh data within the hole to be repaired can be determined more accurately. Furthermore, based on the three-dimensional mesh data within the hole to be repaired, the edge line information of the hole to be repaired can be determined more accurately, which solves the problem that the boundary accuracy of the three-dimensional scanning cannot meet the requirements.
[0144] In some embodiments, filling the hole to be repaired to obtain the filled three-dimensional mesh data includes:
[0145] Get the size parameters of the hole to be repaired;
[0146] Expanding the area of the hole to be repaired according to the size parameter to obtain an expanded hole to be repaired;
[0147] In the three-dimensional mesh model, the expanded holes to be repaired are filled according to the positions of the expanded holes to be repaired, so as to obtain the filled three-dimensional mesh data.
[0148] It can be understood that because the data near the hole to be repaired is poor, in this embodiment, the area of the hole to be repaired is expanded according to the size parameter to obtain the expanded hole to be repaired, and further, the hole to be repaired is filled according to the position of the expanded hole to be repaired. That is, the present application removes the poor data near the hole to be repaired during the process of filling the hole to be repaired, so that the hole to be repaired can be filled more accurately.
[0149] Fig.11 The process of the correction method according to the embodiment of the present application is Figure 4 ,like Fig.11 As shown, the correction method includes the following steps:
[0150] Step S1101, obtaining a standard edge line of the hole to be repaired.
[0151] Step S1102: determining the position information of the hole to be repaired according to the standard edge line of the hole to be repaired.
[0152] Step S1103, filling the hole to be repaired according to the position information of the hole to be repaired, and obtaining the filled three-dimensional mesh data.
[0153] Step S1104, projecting the standard edge line of the hole to be repaired onto the three-dimensional mesh data, determining each first facet and each second facet, wherein the first facet is a facet that intersects with the standard edge line of the hole to be repaired, and the second facet is a facet that is within the hole to be repaired and does not intersect with the standard edge line of the hole to be repaired.
[0154] Step S1105 , determining each third surface patch according to each first surface patch and the standard edge line position of the hole to be repaired, wherein the third surface patch is located inside the hole to be repaired.
[0155] Step S1106, determining the three-dimensional mesh data in the hole to be repaired according to each second face patch and each third face patch.
[0156] Step S1107 , deleting the three-dimensional mesh data in the hole to be repaired in the filled three-dimensional mesh data, and obtaining the edge line of the hole to be repaired after repair.
[0157] Through the above steps, based on the obtained standard edge line of the hole to be repaired, the three-dimensional grid data within the hole to be repaired can be determined more accurately. Furthermore, based on the three-dimensional grid data within the hole to be repaired, the edge line information of the hole to be repaired can be determined more accurately, solving the problem that the boundary accuracy of the three-dimensional scanning cannot meet the requirements.
[0158] Fig.12 The process of the correction method according to the embodiment of the present application is Figure 5 ,like Fig.12 As shown, the correction method includes the following steps:
[0159] Step S1201, obtaining a standard edge line.
[0160] Step S1202, performing equidistant sampling on the standard edge line to obtain sampling points.
[0161] In this embodiment, the sampling distance may be determined according to the resolution of the three-dimensional grid.
[0162] Step S1203, determining each mesh edge vertex adjacent to each sampling point by brute force traversal, KD tree, octree or hash table.
[0163] Step S1204: In the three-dimensional mesh model, a triangular mesh surface corresponding to each mesh edge vertex adjacent to each sampling point is determined, and an approximate mesh curve is determined in the triangular mesh surface.
[0164] In this embodiment, the approximate mesh curve is a polyline segment composed of boundary edges adjacent to the standard edge line in the triangular mesh surface. Figure 6 ,like Figure 6As shown, the approximate mesh curve includes a line segment formed by vertices B1 and C1, a line segment formed by vertices C1 and E1, a line segment formed by vertices E1 and H1, a line segment formed by vertices H1 and I1, and a line segment formed by vertices I1 and K1.
[0165] If the corrected edge line is a target line feature of the scanned object, wherein the target line feature is a line feature to be corrected in the scanned object, for example, the target line feature is a line feature corresponding to a gap in the scanned object in a three-dimensional grid model, the approximate grid curve of the target line feature is determined in the following manner.
[0166] According to the positions of each mesh edge vertex adjacent to each sampling point, a triangular mesh within a preset range in the three-dimensional mesh model is determined, so that a triangular mesh corresponding to each mesh edge vertex adjacent to each sampling point can be obtained, in the triangular mesh, a corresponding edge is determined according to each mesh vertex, and a dihedral angle between two facets corresponding to the edge is calculated, and if the dihedral angle is less than or equal to a second threshold, the edge is used as a candidate line segment corresponding to the approximate mesh curve, or an average curvature of each mesh vertex in the triangular network model is calculated, mesh vertices greater than the average curvature are used as candidate feature points, and the edges corresponding to each candidate feature point are used as candidate line segments corresponding to the approximate mesh curve;
[0167] Project the candidate line segment onto the standard edge line, obtain the projected line segment on the standard edge line corresponding to the candidate line segment, calculate the angle between the projected line segment and the candidate line segment, and if the angle is greater than a third threshold, remove the candidate line segment to obtain a candidate segment set;
[0168] In the candidate segment set, one or more candidate approximate mesh curves are determined through the network topology structure;
[0169] If there is a candidate approximate grid curve, the candidate approximate grid curve is used as the approximate grid curve of the target line feature.
[0170] If there are more than two candidate approximate mesh curves, the average distance from each mesh vertex in each candidate approximate mesh curve to the standard edge line is calculated, and the candidate approximate mesh curve with the smallest average distance is used as the approximate mesh curve of the target line feature.
[0171] Step S1205: if the boundary edge in the approximate mesh curve is greater than or equal to the set first threshold, the adjacent triangle corresponding to the boundary edge is split into multiple triangles, and the approximate mesh curve is re-determined in the three-dimensional mesh model.
[0172] In this embodiment, after the adjacent triangle corresponding to the boundary edge is split into multiple triangles, the approximate mesh curve is re-determined according to the method of step S1204. Fig.13 , Fig.13is a schematic diagram of splitting an adjacent triangle into multiple triangles according to an embodiment of the present application, such as Fig.13 As shown, the adjacent triangles corresponding to the boundary edge include a triangle composed of vertices G1, G2, and G3, the boundary edge includes a line segment composed of vertices G2 and G3, and the multiple triangles after splitting include a triangle composed of vertices G1, G2, and G4, a triangle composed of vertices G1, G4, and G5, and a triangle composed of vertices G1, G3, and G5.
[0173] Step S1206: Determine the projections of each mesh edge vertex adjacent to each sampling point on the standard edge line as corresponding corrected mesh vertices.
[0174] Step S1207: determining a corrected edge line in the three-dimensional mesh model according to each corrected mesh vertex.
[0175] Step S1208: obtaining a corrected three-dimensional mesh model according to the corrected mesh vertices and the corrected edge lines in the three-dimensional mesh model.
[0176] In this example, see Figure 6 ,like Figure 6 As shown, each mesh edge vertex adjacent to each sampling point in the three-dimensional mesh model includes B1, C1, E1, H1, I1 and K1, each mesh vertex after correction includes B2, C2, E2, H2, I2 and K2, and the three-dimensional mesh model before correction includes a triangular face composed of vertices A1, D1 and B1, a triangular face composed of vertices D1, F1 and C1, a triangular face composed of vertices F1, J1 and E1, a triangular face composed of vertices J1, L1 and H1, and a triangular face composed of vertices L1, M1 and I1 The corrected three-dimensional mesh model includes triangular faces composed of vertices A1, D1, and B2, triangular faces composed of vertices D1, F1, and C2, triangular faces composed of vertices F1, J1, and E2, triangular faces composed of vertices J1, L1, and H2, triangular faces composed of vertices L1, M1, and I2, triangular faces composed of vertices B2, D1, and C2, triangular faces composed of vertices C2, F1, and E2, triangular faces composed of vertices E2, J1, and H2, and triangular faces composed of vertices H2, L1, and I2.
[0177] Through the above steps, the edge line of the hole to be repaired in the three-dimensional mesh model is corrected according to the obtained standard edge line of the hole to be repaired, so that the edge line of the hole to be repaired can be smoother, less noisy, and free of jagged edges, thereby solving the problem that the boundary accuracy of the three-dimensional scanning cannot meet the requirements.
[0178] Fig.14 The process of the correction method according to the embodiment of the present application is Figure 6 ,like Fig.14As shown, the correction method includes the following steps:
[0179] Step S1401, obtaining relevant parameters of the hole to be repaired.
[0180] In this embodiment, the holes to be repaired include circular holes, waist-shaped holes, rectangular holes, polygonal holes and keyholes. Assuming that the hole is a circular hole, the relevant parameters of the hole to be repaired include the hole radius, the normal vector corresponding to the hole and the coordinates of the center point of the hole, but are not limited to the above-mentioned holes to be repaired.
[0181] In this embodiment, the standard edge line of the hole to be repaired can be obtained by binocular reconstruction, that is, cameras at two different positions take two or more images of the hole to be repaired, and the standard edge line of the hole to be repaired is determined based on the two or more images of the hole to be repaired, but is not limited to the above method. Any method that can obtain the standard edge line of the hole to be repaired is within the protection scope of this application, for example, directly obtaining the standard edge line of the hole to be repaired by photogrammetry or by light pen hard detection.
[0182] Step S1402: expanding the area of the hole to be repaired according to relevant parameters of the hole to be repaired to obtain a first hole to be repaired.
[0183] In this embodiment, the position information of the hole to be repaired in the three-dimensional grid model can be determined according to the relevant parameters of the hole to be repaired, and the area of the hole to be repaired can be expanded according to the position information of the hole to be repaired. Assuming that the hole to be repaired is a circular hole, the radius of the circular hole is r, according to the position information of the circular hole, the radius of the circular hole can be expanded to r+n, where n is the expanded radius of the circular hole, and n>0.
[0184] Step S1403: In the three-dimensional mesh model, the three-dimensional mesh data in the first hole to be repaired is deleted to obtain the first hole.
[0185] Step S1404, brute force traverse each mesh vertex in the three-dimensional mesh model to determine the adjacent vertices of the first hole or establish a spatial data structure according to the mesh vertex data in the three-dimensional mesh, and determine the adjacent vertex set of the first hole according to the spatial data structure.
[0186] In this embodiment, the spatial data structure includes a KD tree, an octree and a hash table; the mesh vertices in the three-dimensional mesh model are brute-force traversed, and the mesh vertices inside the first hole are used as the neighboring vertex set of the first hole, or a spatial data structure is established based on all mesh vertex data, and the mesh vertices within a first preset range of the first hole are searched according to the spatial data structure, and the neighboring vertex set of the first hole is filtered out from the mesh vertices within the first preset range.
[0187] Step S1405 , determining a first triangle set according to the adjacent vertex set of the first hole, wherein at least one vertex in the first triangle is an adjacent vertex.
[0188] Step S1406: If the angle between the normal of one or two adjacent vertices in the first triangle and the normal of the first hole is less than 90 degrees, the non-adjacent vertices in the first triangle are retained to obtain a boundary vertex set of the first hole.
[0189] Step S1407: in the three-dimensional mesh model, determine the boundary of the first hole according to the boundary vertex set of the first hole, and fill the first hole according to the boundary of the first hole to obtain the filled three-dimensional mesh data.
[0190] In this embodiment, the boundary edges corresponding to each boundary vertex constitute the boundary of the first hole, and filling the first hole includes filling the first hole by radial basis, filling the first hole by minimum angle wavefront method, and filling the first hole based on Poisson equation, but is not limited to the above-mentioned methods of filling the hole to be repaired, and the method of filling the first hole is not limited here.
[0191] Step S1408 , projecting the hole to be repaired onto the filled three-dimensional mesh data according to relevant parameters of the hole to be repaired, and splitting the triangular mesh intersecting the projection line into more than two triangular facets.
[0192] In this example, see Fig.10 , split the triangular mesh that intersects the projection line into two or more triangular patches.
[0193] Step S1409, deleting all triangular facets in the hole to be repaired, and obtaining a corrected edge line of the hole to be repaired.
[0194] Through the above steps, the edge line of the hole to be repaired in the three-dimensional mesh model is corrected according to the relevant parameters of the hole to be repaired, so that the edge line information of the hole to be repaired can be determined more accurately, solving the problem that the boundary accuracy of the three-dimensional scanning cannot meet the requirements.
[0195] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0196] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0197] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0198] Get the standard margin line.
[0199] Determine each mesh edge vertex adjacent to the standard edge line.
[0200] The projections of the mesh edge vertices on the standard edge line are determined as the corresponding corrected mesh vertices.
[0201] According to each corrected mesh vertex, a corrected edge line in the three-dimensional mesh model is determined.
[0202] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0203] In addition, in combination with the correction method provided in the above embodiments, a storage medium may be provided in this embodiment to implement the correction method. The storage medium stores a computer program; when the computer program is executed by a processor, any correction method in the above embodiments is implemented.
[0204] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0205] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0206] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0207] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A correction method for a three-dimensional scanning system, characterized in that: include: Obtain standard margin lines; Determine each mesh edge vertex adjacent to the standard edge line; Determine the projection of each mesh edge vertex on the standard edge line as the corresponding corrected mesh vertex; According to each of the corrected mesh vertices, a corrected edge line in the three-dimensional mesh model is determined.
2. The correction method according to claim 1, characterized in that: Determining each mesh edge vertex adjacent to the edge line includes: Each mesh edge vertex adjacent to the edge line is determined by sampling the standard edge line or according to the distance from each mesh vertex in the three-dimensional mesh model to the standard edge line.
3. The correction method according to claim 2, characterized in that: The method of sampling the standard edge line to determine each mesh edge vertex adjacent to the edge line specifically includes: The standard edge line is sampled at equal distances to obtain sampling points; Each mesh edge vertex adjacent to the edge line is determined according to each sampling point.
4. The correction method according to claim 3, characterized in that: Determining each mesh edge vertex adjacent to the edge line according to each sampling point includes: Determine, according to the spatial data structure, adjacent vertices of each of the sampling points, wherein the number of the adjacent vertices is greater than or equal to 1; According to each of the adjacent vertices, each mesh edge vertex adjacent to the edge line is determined.
5. The correction method according to claim 3, characterized in that: The edge line is sampled at equal distances to obtain sampling points including: Determining a sampling distance according to a resolution of the three-dimensional grid model; The edge line is sampled at equal distances according to the sampling distance to obtain sampling points.
6. The correction method according to claim 1, characterized in that: The method further comprises: Determine, according to each of the mesh edge vertices, a boundary edge having each of the mesh edge vertices as a vertex; If the length of the boundary edge is greater than or equal to a first threshold, use more than one segmentation point to segment the boundary edge; Projecting each of the segmentation points onto the edge line to obtain each newly added mesh vertex; The determining of the corrected edge line specifically includes: determining the corrected edge line in the three-dimensional mesh model according to each of the corrected mesh vertices and each of the newly added mesh vertices.
7. The correction method according to claim 1, characterized in that: After determining the corrected edge line, the method further includes: Based on the mesh topology of the three-dimensional mesh model, determining adjacent mesh vertices of each of the corrected mesh vertices; The neighboring mesh vertices are filtered.
8. A correction method for a three-dimensional scanning system, characterized in that: include: Obtaining the standard edge line of the hole to be repaired; Filling the hole to be repaired to obtain filled three-dimensional grid data; Projecting the standard edge line of the hole to be repaired onto the three-dimensional mesh data to determine the three-dimensional mesh data within the hole to be repaired, comprises: Projecting the standard edge line of the hole to be repaired onto the three-dimensional mesh data, determining each first face patch and each second face patch, wherein the first face patch is a face patch intersecting with the standard edge line of the hole to be repaired, and the second face patch is a face patch within the hole to be repaired and not intersecting with the standard edge line of the hole to be repaired; Determine each third surface patch according to each first surface patch and the standard edge line position of the hole to be repaired, wherein the third surface patch is located inside the hole to be repaired; Determine three-dimensional mesh data in the hole to be repaired according to each of the second surface patches and each of the third surface patches; In the filled three-dimensional mesh data, the three-dimensional mesh data in the hole to be repaired is deleted to obtain the repaired edge line of the hole to be repaired.
9. The correction method according to claim 8, characterized in that: Filling the hole to be repaired to obtain the filled three-dimensional grid data includes: The position information of the hole to be repaired is determined according to the standard edge line of the hole to be repaired.
10. The correction method according to claim 8, characterized in that: Determining each third surface patch according to each first surface patch and the standard edge line position of the hole to be repaired includes: Segment each of the first face patches according to the standard edge line position of the hole to be repaired to obtain a fourth face patch set; The third face patches are determined according to the face patches in the fourth face patch set that are located inside the hole to be repaired.
11. The correction method according to claim 8, characterized in that: Filling the hole to be repaired to obtain the filled three-dimensional mesh data includes: Obtaining size parameters of the hole to be repaired; Expanding the area of the hole to be repaired according to the size parameter to obtain an expanded hole to be repaired; In the three-dimensional mesh model, the expanded holes to be repaired are filled according to the positions of the expanded holes to be repaired, so as to obtain filled three-dimensional mesh data.
12. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the correction method according to any one of claims 1 to 11.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the correction method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Method for generating real shot image with optimized three-dimensional object edge
CN108182722A
A method for repairing defects and holes in three-dimensional mesh model based on characteristic lines
CN109410334A