A method for generating real-time mesh of three-dimensional graphics
Through the grid generation method based on implicit function values, the problem of high hardware requirements of CPU and GPU grid algorithms in the prior art is solved, and fast and accurate real-time grid generation and rendering is achieved, which improves scanning accuracy and user experience.
Patent Information
- Application Number
- CN202111663752.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2041-12-30
AI Technical Summary
The grid algorithm implemented by existing CPUs has high CPU requirements and affects real-time scanning speed; while the GPU grid algorithm adds hardware requirements and cannot meet the accuracy needs of real-time grids.
The grid generation method based on implicit function values is adopted to achieve rapid grid generation and rendering by initializing subspace, processing a frame of point cloud, and generating a real-time grid. This method maximizes memory compression while meeting the scanning speed and provides high-precision grid display.
It realizes the maximum compression of memory while meeting the scanning speed, provides high-precision grid display, improves scanning accuracy and user experience, does not rely on GPU hardware support, and saves product costs.
Smart Images

Figure CN114332411B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of three-dimensional scanning, and in particular to a method for generating a real-time grid of three-dimensional graphics. Background Art
[0002] In the field of 3D scanning equipment, the workflow of scanning equipment is as follows: reconstruct 3D point cloud by acquiring 2D image information, and splice 3D point cloud according to its characteristics to form a complete point cloud in a unified coordinate system, and finally generate 3D mesh from 3D point cloud to complete the digitization of real objects. In 3D real-time scanning applications, WYSIWYG real-time rendering is an important link. In real-time scanning, user interaction includes point cloud rendering and mesh rendering. Point cloud rendering is faster than mesh rendering and can meet the requirements of real-time rendering. However, in many scenarios, 3D mesh is the real-time rendering and final output of 3D scanning equipment. The main reasons are as follows: 3D mesh is the basis of 3D printing; 3D mesh can effectively reflect the characteristics of real objects through rendering; 3D mesh has geometric topological characteristics and can effectively express connectivity; 3D mesh can effectively perform texture mapping and truly reflect the surface of objects; real-time rendering of 3D mesh can improve scanning quality and enhance user experience.
[0003] Real-time rendering of 3D meshes in 3D scanning can instantly present the scanned data, which can effectively improve scanning navigation; its geometric topological characteristics can help the algorithm to remove noise in a timely and effective manner and avoid the accumulation of noise data. Therefore, realizing real-time meshing in scanning can not only improve the accuracy of scanning, but also greatly enhance the user experience. It is a necessary function for many 3D scanning equipment products. However, the existing meshing algorithms implemented by CPUs have high requirements for CPUs, which affects the real-time scanning speed; the existing GPU meshing algorithms not only increase the hardware requirements, but also are limited by the size of video memory and cannot meet the accuracy requirements of real-time meshing. For this reason, we propose a method for generating real-time meshes of 3D graphics to solve the above problems. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention combines the specific requirements of real-time scanning, comprehensively weighs memory, speed and accuracy, and provides a method for generating real-time grids for three-dimensional graphics based on the method of generating grids based on implicit function values, solving the problems raised in the above background technology. It is mainly used for data display during scanning, using true color rendering to provide layered detection, navigation, scan missing parts, delete noise points, etc. for real-time scanning; this part sacrifices some accuracy and exchanges relatively rough resolution for fast grid generation, interpolating the grid vertex color with the color of the point cloud to achieve the purpose of fast grid generation and rendering.
[0005] To achieve the above object, the present invention is implemented by the following technical scheme: a method for generating a real-time grid of a three-dimensional graphic, comprising the following steps:
[0006] Initialize the subspace: According to the size of the scanned object, establish the minimum outer bounding box Volume of its space Ω, and then divide the Volume space into subspace sets Volume = ∑ i,j,k block i,j,k ;
[0007] Processing of a frame of point cloud: Get the successfully stitched point cloud: Calculate which subspaces the point cloud belongs to based on its spatial position; further subdivide the subspace: If the subspace is not subdivided and there are point clouds divided into the subspace, then further subdivide the subspace; cache the point clouds belonging to the subspace; until the point cloud of the frame is processed;
[0008] Mesh generation: Generate real-time mesh; subspace point cloud processing; subspace mesh generation.
[0009] Preferably, the minimum outer bounding box Volume of the space Ω is a cuboid, which is generally a simplified model and expanded into a cube.
[0010] Preferably, the subspace set Volume = ∑ i,j,k block i,j,k It is a cube divided by roughness (assuming the grid accuracy is resolution, the side length of the subspace is n*resolution, where n is an integer, such as n>30 or n>100, etc.) where two adjacent subspaces overlap at a certain ratio (rate range (0, 1)): l, m, n∈{0, 1}, that is, l, m, n can only take the value 0 or 1.
[0011] Preferably, the step of obtaining successfully stitched point clouds is as follows: calculating which subspaces the point clouds belong to based on their spatial positions: point clouds at the subspace boundaries are divided into several adjacent subspaces; and point clouds at the subspace center are divided into a single subspace.
[0012] Preferably, the subspace is further subdivided as follows: if the subspace is not subdivided and a point cloud is divided into the subspace, the subspace is further subdivided into block=Σ i,j,k Voxel i,j,k ; The subdivision rules are set according to the resolution of the grid, where each Voxel i,j,kIt is also a cube, representing the smallest unit in the real-time mesh generation method. It has two scalar attribute values tsdf and weight w. Similar to pixels in a two-dimensional image, all Voxels i,j,k Same size, different location.
[0013] Preferably, the real-time grid generation is specifically as follows: the subspace Block into which the new point cloud is inserted i.j.k Collect them (there may be multiple such subspaces), and select one or several subspaces according to the CPU resource usage during real-time scanning.
[0014] Preferably, the subspace point cloud processing is specifically as follows: processing the point cloud of the subspace cache filtered out in the previous step, updating each voxel j TSDF (truncated signed distance function) value.
[0015] Preferably, the subspace grid generation is specifically: calling the Marchcube algorithm to complete the generation of the grid of each subspace.
[0016] The present invention provides a method for generating a real-time grid of a three-dimensional graphic, which has the following beneficial effects:
[0017] 1. The real-time grid generation method of the three-dimensional graphics compresses the memory to the maximum extent under the premise of meeting the scanning speed, and gives a high-precision grid display as much as possible, which is helpful for visual navigation of the scanning process, and timely reminds the quality of the scanned data, cleans up some unnecessary noise points, and avoids excessive accumulation of errors.
[0018] 2. The method for generating real-time mesh of three-dimensional graphics does not rely on GPU hardware support, thus saving product costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a schematic diagram of the real-time grid generation process of the present invention. DETAILED DESCRIPTION
[0020] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0021] See also Figure 1The present invention provides a technical solution: a method for generating a real-time grid of a three-dimensional graphic, comprising the following steps: initializing the subspace: according to the size of the scanned object, establishing the minimum outer bounding box Volume of its space Ω, and then dividing the Volume space into subspace sets Volume = Σ i,j,k block i,j,k ,According to the size of the scanned object and the resolution of the grid, the 3D space of the scanned object is roughly divided into several subspaces of the same size, and two adjacent subspaces have intersections.
[0022] Processing of a frame of point cloud: Get the successfully stitched point cloud: Calculate which subspaces the point cloud belongs to based on its spatial position; further subdivide the subspace: If the subspace is not subdivided and there are point clouds divided into the subspace, then further subdivide the subspace; cache the point cloud belonging to the subspace, and the real-time grid module caches all point clouds and sorts them according to the point cloud number index for easy and quick search. After caching each point, the real-time grid algorithm assigns the point to the corresponding subspace. When the subspace contains the actual point cloud, it is further subdivided according to the resolution of the grid; until the point cloud of the frame is processed;
[0023] Mesh generation: Generate real-time mesh; Subspace point cloud processing; Subspace mesh generation. When compressing memory, the use of CPU resources will increase accordingly, and some useful data will be deleted by mistake, resulting in occasional misleading during the scanning process. However, this situation can be eliminated by repeated scanning.
[0024] The minimum outer bounding box Volume of the space Ω is a cuboid, which is generally a simplified model and expanded to a cube.
[0025] The subspace set Volume = Σ i,j,k block i,j,k It is a cube divided by roughness (assuming the grid accuracy is resolution, the side length of the subspace is n*resolution, where n is an integer, such as n>30 or n>100, etc.) where two adjacent subspaces overlap at a certain ratio (rate range (0, 1)): l, m, n∈{0, 1}, that is, l, m, n can only take the value 0 or 1.
[0026] The method of obtaining a successfully stitched point cloud is as follows: according to the spatial position of the point cloud, it is calculated which subspaces it belongs to: the point cloud at the boundary of the subspace will be divided into several adjacent subspaces; the point cloud at the center of the subspace is divided into a single subspace. The point cloud is stored using an octree. Each point in the point cloud contains a spatial position, normal, color, and a number index and a bDelete attribute. The number index is the memory position of the point in the octree, and the bDelete attribute is used to assist in deleting noise points.
[0027] The subspace is further subdivided as follows: if the subspace is not subdivided and a point cloud is divided into the subspace, the subspace is further subdivided into block=Σ i,j,k Voxel i,j,k ; The subdivision rules are set according to the resolution of the grid, where each Voxel i,j,k It is also a cube, representing the smallest unit in the real-time mesh generation method. It has two scalar attribute values tsdf and weight w. Similar to pixels in a two-dimensional image, all Voxels i,j,k Same size, different location.
[0028] The specific steps of generating a real-time grid are as follows: i.j.k Collect them (there may be multiple such subspaces), select one or more subspaces according to the CPU resource usage during real-time scanning, and use the run-length encode (RLE) structure for memory compression for each subspace: the specific method is to take the subspace Block i.j.k A set of data, such as line = {(x0, y0, z) | 0 ≤ z ≤ z maz}, where (x0, y0, z) are all voxel numbers. If all the data of a line are the same, they are compressed to [z mazx ,tsdf,w], where tsdf and w are the implicit function value and weight respectively.
[0029] The subspace point cloud processing is specifically as follows: processing the subspace cache point cloud filtered out in the previous step, updating each voxel j TSDF (truncated signed distance function) value, asynchronous refresh mechanism: during the processing of a single-frame point cloud, the tsdf value is not calculated, only the point cloud attribution judgment is performed; when generating a mesh, the tsdf calculation is completed and the mesh is updated. There is a delay in mesh update, and some meshes will be delayed in update. When paused, all subspaces to be updated are updated.
[0030] The subspace grid generation is specifically as follows: calling the Marchcube algorithm to complete the generation of the grid of each subspace, and MarchingCube calculation optimization: using CPU multi-threading, one thread will process the interpolation of multiple voxels, but only processes the interpolation of the three edges related to the lower left corner, avoiding repeated calculations.
[0031] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific position, be constructed and operated in a specific position, and therefore cannot be understood as limiting the present invention; the terms "first", "second", and "third" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance. In addition, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or apparatus.
[0032] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for generating a real-time grid of a three-dimensional graphic, characterized in that: The following steps are involved: Initialize the subspace: According to the size of the scanned object, establish the minimum outer bounding box Volume of its space Ω, and then divide the Volume space into subspace sets with equal distances; Processing of a frame of point cloud: Obtaining successfully stitched point cloud: Calculating which subspaces the point cloud belongs to based on its spatial position; Further subdividing the subspace: If the subspace is not subdivided and there are point clouds divided into the subspace, then further subdivide the subspace; The point cloud belonging to the subspace is cached until the point cloud of the frame is processed; Mesh generation: Generate real-time mesh; Subspace point cloud processing; Subspace mesh generation; The subspace is further subdivided as follows: if the subspace is not subdivided and a point cloud is divided into the subspace, the subspace is further subdivided into block=∑ i,j,k Voxel i,j,k ;The subdivision rules are set according to the accuracy of the grid; The specific steps of generating a real-time grid are as follows: i.j.k Collect them and select one or several subspaces according to the CPU resource usage during real-time scanning; The subspace point cloud processing is specifically as follows: processing the point cloud of the selected subspace cache, updating each Voxel i.j.k The truncated signed distance function TSDF value; The subspace grid generation is specifically: calling the Marchcube algorithm to complete the generation of the grid of each subspace.
2. A method for generating a real-time grid of three-dimensional graphics according to claim 1, characterized in that: The minimum outer bounding box Volume of the space Ω is a cuboid or a cube.
3. The method for generating a real-time grid of a three-dimensional graphic according to claim 1, characterized in that: The subspace set Volume = ∑ i,j,k block i,j,k is a cube in which two adjacent subspaces overlap in a certain ratio: l, m, n∈{0, 1}, that is, l, m, n can only take the value 0 or 1.
4. The method for generating a real-time grid of a three-dimensional graphic according to claim 1, characterized in that: The method of obtaining the successfully stitched point cloud is as follows: according to the spatial position of the point cloud, the subspaces to which the point cloud belongs are calculated: the point cloud at the subspace boundary is divided into multiple adjacent subspaces; the point cloud at the subspace center is divided into a single subspace.
Citation Information
Patent Citations
Large-scale three-dimensional scene webpage display method based on model compression and asynchronous loading
CN110070613A
Point cloud plane segmentation method based on rapid adjacent voxel query
CN110443810A