A three-dimensional grid-based model cutting method, system and electronic equipment
By using symmetry to obtain the intermediate surface and generating two-dimensional concave clamping in the three-dimensional grid model, the problem of inefficiency in the existing technology is solved, and efficient and accurate three-dimensional grid model clamping is achieved.
Patent Information
- Application Number
- CN201910826863.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-31
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2039-08-31
AI Technical Summary
The existing three-dimensional grid model cutting methods are inefficient and ineffective, especially when removing redundant parts, the symmetrical characteristics of the object are not fully utilized.
By obtaining the three-dimensional point cloud and mesh of symmetric objects, using symmetry to obtain the intermediate surface, project the three-dimensional point cloud and mesh onto the intermediate surface, generate a two-dimensional concave packet for cropping, and restore the cropped two-dimensional mesh to a three-dimensional mesh, and finally merge it into a symmetric object model.
This improves the model cropping efficiency, reduces the calculation amount of direct cropping of three-dimensional grids, and maintains high accuracy and good imaging effects.
Smart Images

Figure CN110544292B_ABST
Abstract
Description
Technical field
[0001] The present invention relates to the field of three-dimensional grid model reconstruction, and in particular to a three-dimensional grid-based model clipping method, system and electronic equipment. [Background Technology]
[0002] Three-dimensional model reconstruction is the process of reconstructing a three-dimensional object based on sampling data. For example, three-dimensional point cloud and three-dimensional mesh data are collected through laser scanning equipment, and a computer three-dimensional model is reconstructed based on the measurement data. This is of great significance in medicine, customized production and other fields.
[0003] Existing model reconstruction methods typically include watertight reconstruction algorithms (such as Poisson surface reconstruction algorithms). These methods reconstruct models with high accuracy. However, these models automatically reconstruct closed surfaces, resulting in a large amount of redundancy. Existing methods for removing redundancy are generally based on the 3D convex or concave hull. However, these methods have low cropping efficiency, poor cropping results, and fail to fully utilize the object's symmetry. [Summary of the invention]
[0004] In order to overcome the problem of insufficient efficiency of existing three-dimensional grid-based model clipping, the present invention provides a three-dimensional grid-based model clipping method, system and electronic equipment.
[0005] In order to solve the above technical problems, the present invention provides a technical solution as follows: a model clipping method based on three-dimensional grid, comprising the following steps: step S1: obtaining a three-dimensional point cloud and a corresponding three-dimensional grid of a symmetrical object; step S2: obtaining an intermediate surface based on the coordinates of multiple points in the three-dimensional point cloud, wherein the intermediate surface divides the three-dimensional point cloud and the three-dimensional grid into two symmetrical parts; step S3: projecting the three-dimensional point cloud and the three-dimensional grid corresponding to each part onto the intermediate surface, obtaining the corresponding symmetrical left two-dimensional point cloud and right two-dimensional point cloud, the left two-dimensional grid and the right two-dimensional grid, and calculating the corresponding concave hull in the left two-dimensional point cloud and the right two-dimensional point cloud; step S4: based on the concave hull, clipping the left two-dimensional grid and the right two-dimensional grid according to the boundaries of the corresponding concave hull in the left two-dimensional point cloud and the right two-dimensional point cloud, and obtaining the left clipped two-dimensional grid and the right clipped two-dimensional grid after removing the redundant parts; and step S5: restoring each of the clipped two-dimensional grids to the corresponding clipped three-dimensional grid, and merging all the clipped three-dimensional grids according to the intermediate surface to obtain the clipped three-dimensional grid corresponding to the symmetrical object model; the above steps S 5. Merging all the cropped three-dimensional meshes according to the intermediate surface comprises the following steps: removing the intermediate surface to obtain a final object model; the above-mentioned step S2 specifically comprises the following steps: step S21: obtaining key point coordinates corresponding to multiple key points of the symmetrical object in the three-dimensional point cloud; step S22: based on the key point coordinates corresponding to multiple symmetrical groups of key points, obtaining at least three center coordinates located between the multiple groups of key points and / or directly obtaining the center coordinates; and step S23: based on the at least three center coordinates, establishing an intermediate surface, wherein the intermediate surface divides the three-dimensional point cloud and the three-dimensional mesh into two symmetrical parts.
[0006] Preferably, the three-dimensional grid in the above step S1 is obtained based on a watertight reconstruction algorithm.
[0007] Preferably, the above step S5 further includes: step S6: smoothing the edges of the cropped three-dimensional mesh to obtain a final three-dimensional mesh.
[0008] Preferably, the concave hull is a minimum polygon containing all points in the two-dimensional point cloud, and all points in the two-dimensional point cloud are located in the concave hull or on the edge of the concave hull.
[0009] Preferably, in the above step S21, the key points are located at the boundary of the symmetrical object, and the key points are symmetrical to each other, and each key point has a unique position coordinate.
[0010] Preferably, in the above step S2, the intermediate surface does not cut or separate the three-dimensional point cloud and the three-dimensional mesh.
[0011] Preferably, the above-mentioned step S5 specifically includes the following steps: step S51: obtaining the three-dimensional coordinates corresponding to each vertex in the three-dimensional mesh, and obtaining the two-dimensional coordinates corresponding to each vertex in the left-cropped two-dimensional mesh and the right-cropped two-dimensional mesh; step S52: replacing the two-dimensional coordinates of each vertex with the corresponding three-dimensional coordinates to obtain the corresponding left-cropped three-dimensional mesh and the right-cropped three-dimensional mesh; and step S53: removing the intermediate surface to obtain the final object model.
[0012] The present invention also provides a model clipping system based on a three-dimensional grid, comprising: a point cloud and grid acquisition unit, used to acquire a three-dimensional point cloud and a corresponding three-dimensional grid of a symmetrical object; an intermediate surface acquisition unit, used to acquire an intermediate surface based on the coordinates of multiple points in the three-dimensional point cloud, wherein the intermediate surface divides the three-dimensional point cloud and the three-dimensional grid into two symmetrical parts; a concave hull calculation unit, used to project the three-dimensional point cloud and the three-dimensional grid corresponding to each part onto the intermediate surface, obtain the corresponding two-dimensional point cloud and the two-dimensional grid, and calculate the concave hull in the two-dimensional point cloud corresponding to each part; a segmentation unit, used to segment the two-dimensional grid of the corresponding part based on the concave hull, and obtain a clipped two-dimensional grid; and a model acquisition unit, used to restore each of the clipped two-dimensional grids to the corresponding clipped three-dimensional grid, and merge all the clipped three-dimensional grids according to the intermediate surface to obtain a clipped three-dimensional grid corresponding to the symmetrical object model.
[0013] Preferably, the method further comprises: an edge processing unit for smoothing the edges of the cropped three-dimensional grid to obtain a final three-dimensional grid.
[0014] The present invention also provides an electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and the computer program is configured to execute any of the three-dimensional grid-based model clipping methods described above when running; and the processor is configured to execute any of the three-dimensional grid-based model clipping methods described above through the computer program.
[0015] Compared with the prior art, the present invention provides a three-dimensional grid-based model clipping method, system, and electronic device, which have the following advantages:
[0016] 1. Obtain the 3D point cloud and 3D mesh corresponding to a symmetrical object, and based on the symmetry of the symmetrical object, obtain an intermediate surface. The 3D point cloud and 3D mesh are projected onto the intermediate surface. A concave hull is generated from the projected 2D point cloud. The 2D mesh is then clipped based on the concave hull. Finally, the clipped 2D mesh is restored to a 3D mesh to obtain the final object model. Clipping the 2D mesh based on the concave hull avoids direct clipping of the 3D mesh, reducing the computational effort required for direct clipping and improving mesh model clipping efficiency.
[0017] 2. The three-dimensional mesh is obtained by a watertight reconstruction algorithm, so that the three-dimensional mesh corresponding to the symmetrical object has a high accuracy and a good degree of restoration.
[0018] 3. Smoothing the edges of the cropped three-dimensional grid to achieve better imaging effects.
[0019] 4. By obtaining multiple key points and obtaining at least three intermediate points based on the center coordinates of every two symmetrical key points, this method can obtain the intermediate surface based on the at least three intermediate points, and divide the three-dimensional point cloud and the three-dimensional mesh into two symmetrical parts.
[0020] 5. By projecting the three-dimensional point cloud and three-dimensional mesh corresponding to each part onto the intermediate surface based on the intermediate surface, the three-dimensional point cloud and three-dimensional mesh are converted into two-dimensional point cloud and two-dimensional mesh, and the concave hull can be generated based on the two-dimensional space, thereby reducing the amount of calculation for generating the concave hull in the three-dimensional space and improving the calculation efficiency.
Brief Description of the Drawings
[0021] Figure 1 This is an overall flow chart of a three-dimensional grid-based model clipping method provided by the first embodiment of the present invention.
[0022] Figure 2 This is a flowchart of a variation of a three-dimensional grid-based model clipping method provided in the first embodiment of the present invention.
[0023] Figure 3 This is a detailed flowchart of step S2 in a three-dimensional grid-based model clipping method provided in the first embodiment of the present invention.
[0024] Figure 4 This is a schematic diagram of the implementation process of step S2 in a three-dimensional grid-based model clipping method provided by the first embodiment of the present invention.
[0025] Figure 5 This is a detailed flowchart of step S3 in a three-dimensional grid-based model clipping method provided in the first embodiment of the present invention.
[0026] Figure 6 This is a schematic diagram of the left two-dimensional point cloud in step S31 of the three-dimensional grid-based model clipping method provided by the first embodiment of the present invention.
[0027] Figure 7 This is a schematic diagram of the left two-dimensional grid in step S31 of the three-dimensional grid-based model clipping method provided by the first embodiment of the present invention.
[0028] Figure 8This is a schematic diagram of generating a concave hull from a left two-dimensional point cloud in step S32 of a three-dimensional grid-based model clipping method provided in the first embodiment of the present invention.
[0029] Figure 9 This is a schematic diagram of generating a concave hull from a left two-dimensional grid in step S4 of a three-dimensional grid-based model clipping method provided by the first embodiment of the present invention.
[0030] Figure 10 This is a schematic diagram of the left two-dimensional grid after concave hull clipping in step S4 of a three-dimensional grid-based model clipping method provided by the first embodiment of the present invention.
[0031] Figure 11 This is a detailed flow chart of step S5 in a three-dimensional grid-based model clipping method provided in the first embodiment of the present invention.
[0032] Figure 12 This is a schematic diagram of the final object model obtained in step S53 of the three-dimensional grid-based model clipping method provided by the first embodiment of the present invention.
[0033] Figure 13 A module diagram of a three-dimensional grid-based model clipping system provided in the second embodiment of the present invention.
[0034] Figure 14 This is a module diagram of an electronic device provided in the third embodiment of the present invention.
[0035] Description of reference numerals:
[0036] 1. Point cloud and mesh acquisition unit; 2. Intermediate surface acquisition unit; 3. Concave hull calculation unit; 4. Segmentation unit; 5. Model acquisition unit; 6. Edge processing unit;
[0037] 10. Memory; 20. Processor;
[0038] 100, face model; 101, left face; 102, right face; 103, left 2D point cloud; 104, left 2D mesh; 105, cropped 2D mesh;
[0039] 200, concave hull; 300, final object model;
[0040] a, corner of the eye; b, corner of the eye; c, tip of the nose; d, chin; e, midpoint of the corner of the eye; f, redundant part; p, midplane. [Specific implementation method]
[0041] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and implementation examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0042] See also Figure 1 A first embodiment of the present invention provides a three-dimensional grid-based model clipping method, comprising the following steps:
[0043] Step S1: Obtain a 3D point cloud and a corresponding 3D mesh of a symmetrical object.
[0044] It can be understood that the symmetrical object is a three-dimensional object with symmetry, such as a human face, a display screen, a bottle or other objects with high symmetry. In this embodiment, the human face is used as an example for description, but it is not intended to limit the present invention.
[0045] It can be understood that in step S1, a three-dimensional point cloud of a symmetrical object can be obtained based on laser scanning. The three-dimensional point cloud is a set of multiple points with depth data, and each point corresponds to a position coordinate on the object (that is, a three-dimensional coordinate), and the position coordinate includes a two-dimensional coordinate and a corresponding depth coordinate.
[0046] It can be understood that the three-dimensional grid can be obtained by reconstructing the symmetrical object based on a watertight reconstruction algorithm. Each grid has a plurality of vertices, and each vertex has a position coordinate.
[0047] It can be understood that the watertight reconstruction algorithm includes but is not limited to the Poisson surface reconstruction algorithm or the radial basis function (Radial Basis Function). In this embodiment, the Poisson surface reconstruction algorithm is taken as an example, but it is not intended to limit this solution.
[0048] Step S2: obtaining an intermediate surface based on the coordinates of multiple points in the three-dimensional point cloud, wherein the intermediate surface divides the three-dimensional point cloud and the three-dimensional mesh into two symmetrical parts;
[0049] Step S3: Project the 3D point cloud and 3D mesh corresponding to each part onto the intermediate surface to obtain the corresponding 2D point cloud and 2D mesh, and calculate the concave hull in the 2D point cloud corresponding to each part.
[0050] It can be understood that the concave hull is the minimum polygon that contains all points in a point set. In this embodiment, the concave hull is the minimum polygon that contains all points in the two-dimensional point cloud, and all points in the two-dimensional point cloud are located in the concave hull or on the edge of the concave hull.
[0051] Step S4: Segment the corresponding portion of the two-dimensional grid based on the concave hull to obtain a cropped two-dimensional grid.
[0052] It can be understood that in step S4, the two-dimensional grid is segmented based on the concave hull to obtain a clipped two-dimensional grid with the concave hull as the edge.
[0053] Step S5: Restoring each of the cropped two-dimensional meshes to a corresponding cropped three-dimensional mesh, and merging all the cropped three-dimensional meshes according to the intermediate surface to obtain a cropped three-dimensional mesh corresponding to the symmetrical object model.
[0054] See also Figure 2 , after step S5, further comprising:
[0055] Step S6: Smoothing the edges of the cropped three-dimensional mesh to obtain a final three-dimensional mesh.
[0056] It can be understood that in step S6, the edge of the cropped 3D mesh obtained in step S5 has jagged edges due to the segmentation of the concave hull (that is, multiple vertices in the edge of the cropped 3D mesh are not continuous), and the edge of the cropped 3D mesh needs to be smoothed to achieve better imaging effects.
[0057] It can be understood that the smoothing process includes but is not limited to any one of Laplacian smoothing and linear interpolation.
[0058] See also Figure 3 Step S2: Based on the coordinates of multiple points in the 3D point cloud, an intermediate surface is obtained, wherein the intermediate surface divides the 3D point cloud and the 3D mesh into two symmetrical parts. Step S2 specifically includes steps S21 to S23:
[0059] Step S21: obtaining key point coordinates corresponding to multiple key points of a symmetrical object in a three-dimensional point cloud;
[0060] Step S22: based on the key point coordinates corresponding to the multiple symmetrical groups of key points, obtaining at least three center coordinates between the multiple groups of key points and / or directly obtaining the center coordinates; and
[0061] Step S23: establishing an intermediate surface based on the at least three center coordinates, wherein the intermediate surface divides the three-dimensional point cloud and the three-dimensional mesh into two symmetrical parts.
[0062] Specifically, in step S21, multiple key points of the symmetrical object are identified based on the key points of the three-dimensional image, and multiple key points located at the boundary of the symmetrical object can be identified, for example, Figure 4As shown, in the face model 100, the key points include symmetrical eye corners a and b, nose tip c, and chin d, and the identified key points all have unique position coordinates.
[0063] It can be understood that the multiple key points of the symmetrical object can be obtained based on pre-training or extracted from an open source library (such as the dlib open source database) by finding the key points through the texture map corresponding to the point cloud, which will not be repeated here.
[0064] In step S22 and step S23, the center coordinates corresponding to the center point between the two symmetrical key points are calculated by using the two symmetrical key points, and the three center points corresponding to the three groups of key points are calculated in sequence. An intermediate surface is established based on the three center points, and the intermediate surface divides the symmetrical object into two symmetrical parts. Of course, the center point can also be obtained directly, for example, Figure 4 As shown in FIG, the eye corners a and b are selected as two key points, and the nose tip c and chin d are directly obtained as center points. The eye corner midpoint e can be calculated based on the eye corner a and the eye corner b. The intermediate plane p is established by the eye corner midpoint e, the nose tip c, and the chin d. The intermediate plane p divides the face model 100 into the left face 101 and the right face 102. As long as the intermediate plane can be established by the center coordinates of at least three center points, there is no limitation here.
[0065] It can be understood that steps S21 to S23 are only one implementation of this embodiment, and the implementation is not limited to steps S21 to S23.
[0066] See also Figure 5 Step S3: Project the 3D point cloud and 3D mesh corresponding to each part onto the intermediate surface to obtain the corresponding 2D point cloud and 2D mesh, and calculate the concave hull in the 2D point cloud corresponding to each part. Step S3 specifically includes steps S31 to S32:
[0067] Step S31: Projecting the 3D point cloud and 3D mesh corresponding to each part onto the middle plane to obtain symmetrical left and right 2D point clouds, and left and right 2D meshes; and
[0068] Step S32: Based on a preset concave hull algorithm, obtain the corresponding concave hulls in the left two-dimensional point cloud and the right two-dimensional point cloud.
[0069] In step S31, the three-dimensional point clouds and three-dimensional meshes corresponding to the two sides of the middle surface are projected onto the middle surface to obtain two-dimensional point clouds and meshes. For example, taking the left two-dimensional point cloud and left two-dimensional mesh as an example, Figure 6 and Figure 7 , which is a projection result diagram of the left two-dimensional point cloud 103 and the left two-dimensional grid 104 on the middle surface p.
[0070] In step S32, the preset concave hull algorithm may be used to calculate the concave hull corresponding to the input two-dimensional point cloud based on the input two-dimensional point cloud. The preset concave hull algorithm includes but is not limited to Alpha Shape.
[0071] It can be understood that the concave hull is the smallest polygon that contains all the points in the point set, for example, Figure 8 As shown in , taking the left two-dimensional point cloud 103 as an example, the concave hull 200 surrounds all points in the left two-dimensional point cloud 103 and connects the outermost points one by one to form a minimum polygon.
[0072] It can be understood that the concave hull is generated on the left two-dimensional point cloud and the right two-dimensional point cloud respectively. The processing steps for the left two-dimensional point cloud and the right two-dimensional point cloud are the same. In this embodiment, only the left two-dimensional point cloud is used for illustration.
[0073] It can be understood that steps S 31 - S 32 are only one implementation of this embodiment, and the implementation is not limited to steps S 31 - S 32.
[0074] Please combine Figure 9 and Figure 10 , step S4: segmenting the corresponding part of the two-dimensional grid based on the concave hull to obtain a cropped two-dimensional grid.
[0075] It can be understood that in step S4, the corresponding two-dimensional grid can be clipped based on the concave hull. For example, the left two-dimensional grid 104 is used as an example. Figure 9 and Figure 10 As shown, the concave hull 200 is generated on the left two-dimensional grid 104 to divide the left two-dimensional grid 104 into a redundant part f and a clipping two-dimensional grid 105. The Figure 10 The cropped two-dimensional grid 105 in.
[0076] See also Figure 11 Step S5: restore each of the cropped two-dimensional meshes to a corresponding cropped three-dimensional mesh, and merge all the cropped three-dimensional meshes according to the intermediate surface to obtain a cropped three-dimensional mesh corresponding to the symmetrical object model. Step S3 specifically includes steps S51 to S53:
[0077] Step S51: Obtain the 3D coordinates corresponding to each vertex in the 3D mesh, and obtain the 2D coordinates corresponding to each vertex in the left-clipped 2D mesh and the right-clipped 2D mesh;
[0078] Step S52: Replace the two-dimensional coordinates of each vertex with the corresponding three-dimensional coordinates to obtain the corresponding left-cropped three-dimensional mesh and right-cropped three-dimensional mesh; and
[0079] Step S53: remove the intermediate surface to obtain the final object model.
[0080] In step S51, the position coordinates (i.e., three-dimensional coordinates) of each vertex in the three-dimensional grid can be obtained through the three-dimensional grid in step S1, and the two-dimensional coordinates corresponding to the vertices in the left-cropped two-dimensional grid and the right-cropped two-dimensional grid are obtained at the same time.
[0081] In step S52 , the left-cropped 2D mesh and the right-cropped 2D mesh are restored to the corresponding left-cropped 3D mesh and the right-cropped 3D mesh by replacing the 2D coordinates of each vertex in the mesh with 3D coordinates.
[0082] In step S53, after obtaining the left cropped 3D mesh and the right cropped 3D mesh, the intermediate surface is removed to obtain the final object model. Figure 12 As shown in , after removing the intermediate surface, a final object model 300 is obtained.
[0083] It can be understood that the intermediate surface is a plane obtained through calculation, which divides the symmetrical object into two relative parts, so as to facilitate the conversion of the three-dimensional point cloud and the three-dimensional mesh into two-dimensional point clouds and two-dimensional meshes of the two relative parts. However, the intermediate surface does not cut and separate the three-dimensional point cloud and the three-dimensional mesh, that is, the three-dimensional point cloud and the three-dimensional mesh of the two relative parts are always connected. Therefore, after removing the intermediate surface, the final object model can be formed.
[0084] It can be understood that steps S51 to S53 are only one implementation of this embodiment, and the implementation is not limited to steps S51 to S53.
[0085] See also Figure 13 The second embodiment of the present invention further provides a three-dimensional grid-based model clipping system. The three-dimensional grid-based model clipping system may include:
[0086] Point cloud and mesh acquisition unit 1, used to acquire a 3D point cloud and a corresponding 3D mesh of a symmetrical object;
[0087] An intermediate surface acquisition unit 2 is configured to acquire an intermediate surface based on the coordinates of a plurality of points in the three-dimensional point cloud, wherein the intermediate surface divides the three-dimensional point cloud and the three-dimensional mesh into two symmetrical parts;
[0088] a concave hull calculation unit 3, configured to project the three-dimensional point cloud and the three-dimensional grid corresponding to each part onto the intermediate surface to obtain the corresponding two-dimensional point cloud and the two-dimensional grid, and calculate the concave hull in the two-dimensional point cloud corresponding to each part;
[0089] a segmentation unit 4, configured to segment the corresponding portion of the two-dimensional grid based on the concave hull to obtain a cropped two-dimensional grid; and
[0090] The model acquisition unit 5 is used to restore each of the cropped two-dimensional grids to a corresponding cropped three-dimensional grid, and merge all the cropped three-dimensional grids according to the intermediate surface to obtain a cropped three-dimensional grid corresponding to the symmetrical object model.
[0091] Please continue reading Figure 13 The three-dimensional grid-based model clipping system provided in the second embodiment of the present invention further includes:
[0092] The edge processing unit 6 is used to smooth the edges of the cropped three-dimensional mesh to obtain a final three-dimensional mesh.
[0093] It can be understood that the three-dimensional grid-based model clipping system provided in the second embodiment of the present invention is suitable for the grid clipping system of the three-dimensional object reconstruction model with a high degree of symmetry, and is particularly suitable for the grid edge clipping system based on the three-dimensional face reconstruction model. The system can perform model clipping on the three-dimensional grid of the model obtained based on the watertight reconstruction algorithm, and convert it into a three-dimensional grid after performing model clipping in two-dimensional space, thereby reducing the computational complexity of direct clipping on the three-dimensional grid and improving the efficiency of model clipping.
[0094] See also Figure 14 A third embodiment of the present invention provides an electronic device for implementing the above-mentioned three-dimensional mesh-based model clipping method. The electronic device includes a memory 10 and a processor 20. The memory 10 stores a computer program. The computer program is configured to execute the steps of any of the above-mentioned three-dimensional mesh-based model clipping method embodiments when executed. The processor 20 is configured to execute the steps of any of the above-mentioned three-dimensional mesh-based model clipping method embodiments via the computer program.
[0095] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0096] Specifically, the electronic device is suitable for a mesh clipping device for reconstructing a three-dimensional object model with a high degree of symmetry, and is particularly suitable for a mesh edge clipping device based on a three-dimensional face reconstruction model. The device can perform model clipping on the three-dimensional mesh of the model obtained based on a watertight reconstruction algorithm. By converting the model into a three-dimensional mesh after clipping in two-dimensional space, the amount of calculation for direct clipping of the three-dimensional mesh is reduced, thereby improving the efficiency of model clipping.
[0097] Compared with the prior art, the present invention provides a three-dimensional grid-based model clipping method, system, and electronic device, which have the following advantages:
[0098] 1. Obtain the 3D point cloud and 3D mesh corresponding to a symmetrical object, and based on the symmetry of the symmetrical object, obtain an intermediate surface. The 3D point cloud and 3D mesh are projected onto the intermediate surface. A concave hull is generated from the projected 2D point cloud. The 2D mesh is then clipped based on the concave hull. Finally, the clipped 2D mesh is restored to a 3D mesh to obtain the final object model. Clipping the 2D mesh based on the concave hull avoids direct clipping of the 3D mesh, reducing the computational effort required for direct clipping and improving mesh model clipping efficiency.
[0099] 2. The three-dimensional mesh is obtained by a watertight reconstruction algorithm, so that the three-dimensional mesh corresponding to the symmetrical object has a high accuracy and a good degree of restoration.
[0100] 3. Smoothing the edges of the cropped three-dimensional grid to achieve better imaging effects.
[0101] 4. By obtaining multiple key points and obtaining at least three intermediate points based on the center coordinates of every two symmetrical key points, this method can obtain the intermediate surface based on the at least three intermediate points, and divide the three-dimensional point cloud and the three-dimensional mesh into two symmetrical parts.
[0102] 5. By projecting the three-dimensional point cloud and three-dimensional mesh corresponding to each part onto the intermediate surface based on the intermediate surface, the three-dimensional point cloud and three-dimensional mesh are converted into two-dimensional point cloud and two-dimensional mesh, and the concave hull can be generated based on the two-dimensional space, thereby reducing the amount of calculation for generating the concave hull in the three-dimensional space and improving the calculation efficiency.
[0103] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including program code for executing the methods shown in the flowcharts.
[0104] When the computer program is executed by the processor, the above functions defined in the method of this application are performed. It should be noted that the computer memory described in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above. The computer memory can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above.
[0105] More specific examples of computer memory may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including, but not limited to, wireless, wire, optical cable, RF, or any suitable combination thereof.
[0106] Computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0107] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0108] The units involved in the embodiments described in this application can be implemented by software or hardware. The units described can also be set in a processor. For example, they can be described as: a processor including a point cloud and mesh acquisition unit, an intermediate surface acquisition unit, a concave hull calculation unit, a segmentation unit, and a model acquisition unit. The names of these units do not constitute a limitation on the units themselves in some cases. For example, the cutting unit can also be described as "a unit that segments the corresponding part of the two-dimensional mesh based on the concave hull to obtain a clipped two-dimensional mesh."
[0109] As another aspect, the present application further provides a computer memory, which may be included in the device described in the above embodiment; or may exist independently and not be assembled into the device. The computer memory carries one or more programs, and when the one or more programs are executed by the device, the device causes the device to: obtain a three-dimensional point cloud and a corresponding three-dimensional mesh of a symmetrical object; obtain an intermediate surface based on the coordinates of multiple points in the three-dimensional point cloud, wherein the intermediate surface divides the three-dimensional point cloud and the three-dimensional mesh into two symmetrical parts; project the three-dimensional point cloud and the three-dimensional mesh corresponding to each part onto the intermediate surface to obtain a corresponding two-dimensional point cloud and two-dimensional mesh, and calculate the concave hull in the two-dimensional point cloud corresponding to each part; segment the two-dimensional mesh of the corresponding part based on the concave hull to obtain a cropped two-dimensional mesh; and restore each cropped two-dimensional mesh to a corresponding cropped three-dimensional mesh, and merge all the cropped three-dimensional meshes according to the intermediate surface to obtain a cropped three-dimensional mesh corresponding to the symmetrical object model.
[0110] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A model clipping method based on a three-dimensional grid, characterized by: The process includes the following steps: Step S1: Obtain a 3D point cloud and a corresponding 3D mesh of a symmetrical object; Step S2: obtaining an intermediate surface based on the coordinates of multiple points in the three-dimensional point cloud, wherein the intermediate surface divides the three-dimensional point cloud and the three-dimensional mesh into two symmetrical parts; Step S3: Projecting the 3D point cloud and 3D mesh corresponding to each part onto the intermediate surface to obtain corresponding symmetrical left and right 2D point clouds, left and right 2D meshes, and calculating the corresponding concave hulls in the left and right 2D point clouds; Step S4: Based on the concave hull, the left two-dimensional grid and the right two-dimensional grid are clipped according to the boundaries of the corresponding concave hulls in the left two-dimensional point cloud and the right two-dimensional point cloud, respectively, and after removing redundant parts, a left clipped two-dimensional grid and a right clipped two-dimensional grid are obtained; and Step S5: restoring each of the cropped two-dimensional meshes to a corresponding cropped three-dimensional mesh, and merging all the cropped three-dimensional meshes according to the intermediate surface to obtain a cropped three-dimensional mesh corresponding to the symmetrical object model; The above step S5 of merging all the clipped three-dimensional meshes according to the intermediate surface includes the following steps: removing the intermediate surface to obtain a final object model; The above step S2 specifically includes the following steps: Step S21: obtaining key point coordinates corresponding to multiple key points of a symmetrical object in a three-dimensional point cloud; Step S22: based on the key point coordinates corresponding to the multiple symmetrical groups of key points, obtaining at least three center coordinates located between the multiple groups of key points and / or directly obtaining the center coordinates; and Step S23: establishing an intermediate surface based on the at least three center coordinates, wherein the intermediate surface divides the three-dimensional point cloud and the three-dimensional mesh into two symmetrical parts.
2. The three-dimensional grid-based model clipping method according to claim 1, characterized in that: The three-dimensional grid in the above step S1 is obtained based on a watertight reconstruction algorithm.
3. The three-dimensional grid-based model clipping method according to claim 1, characterized in that: After the above step S5, the following steps are further performed: Step S6: Smoothing the edges of the cropped three-dimensional mesh to obtain a final three-dimensional mesh.
4. The three-dimensional grid-based model clipping method according to claim 1, wherein: The concave hull is the smallest polygon that contains all points in the two-dimensional point cloud, and all points in the two-dimensional point cloud are located in the concave hull or on the edge of the concave hull.
5. The three-dimensional grid-based model clipping method according to claim 1, characterized in that: In the above step S21, the key points are located at the boundary of the symmetrical object, and the key points are symmetrical to each other, and each key point has a unique position coordinate.
6. The three-dimensional grid-based model clipping method according to claim 5, characterized in that: In the above step S2, the intermediate surface does not cut or separate the three-dimensional point cloud and the three-dimensional mesh.
7. The three-dimensional grid-based model clipping method according to claim 1, characterized in that: The above step S5 specifically includes the following steps: Step S51: Obtain the 3D coordinates corresponding to each vertex in the 3D mesh, and obtain the 2D coordinates corresponding to each vertex in the left-clipped 2D mesh and the right-clipped 2D mesh; Step S52: Replace the two-dimensional coordinates of each vertex with the corresponding three-dimensional coordinates to obtain the corresponding left-cropped three-dimensional mesh and right-cropped three-dimensional mesh; and Step S53: remove the intermediate surface to obtain the final object model.
8. A model clipping system based on three-dimensional grid, characterized in that: include: A point cloud and mesh acquisition unit, configured to acquire a three-dimensional point cloud and a corresponding three-dimensional mesh of a symmetrical object; an intermediate surface acquisition unit, configured to acquire an intermediate surface based on coordinates of a plurality of points in the three-dimensional point cloud, wherein the intermediate surface divides the three-dimensional point cloud and the three-dimensional mesh into two symmetrical parts; a concave hull calculation unit, configured to project the three-dimensional point cloud and the three-dimensional grid corresponding to each part onto the intermediate surface to obtain the corresponding two-dimensional point cloud and the two-dimensional grid, and calculate the concave hull in the two-dimensional point cloud corresponding to each part; a segmentation unit, configured to segment the corresponding portion of the two-dimensional grid based on the concave hull to obtain a cropped two-dimensional grid; and The model acquisition unit is used to restore each of the cropped two-dimensional grids to a corresponding cropped three-dimensional grid, and merge all the cropped three-dimensional grids according to the intermediate surface to obtain a cropped three-dimensional grid corresponding to the symmetrical object model.
9. The three-dimensional grid-based model clipping system as claimed in claim 8, characterized in that: Also includes: The edge processing unit is used to smooth the edges of the cropped three-dimensional grid to obtain a final three-dimensional grid.
10. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the computer program is configured to execute the three-dimensional grid-based model clipping method according to any one of claims 1 to 7 when running; The processor is configured to execute the three-dimensional grid-based model clipping method according to any one of claims 1 to 7 through the computer program.
Citation Information
Patent Citations
Tree segmentation method based on laser radar point cloud and single tree extraction method based on laser radar point cloud
CN106815847A
High-precision three-dimensional reconstruction method and system based on binary surface structured light
CN107945268A
3D face authentication and recognition based on bilateral symmetry analysis
US20060078172A1