Neighbor voxel storage method and device, computer device and storage medium
By allocating storage space for the current voxel and updating the storage addresses of neighboring voxels, the problem of time-consuming neighboring voxel storage in traditional methods is solved, achieving faster processing speed and lower space consumption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN SHUMA ELECTRONICS TECH
- Filing Date
- 2022-11-09
- Publication Date
- 2026-06-26
AI Technical Summary
Traditional neighborhood voxel storage methods are time-consuming and cannot efficiently process neighborhood voxel information obtained from 3D scanning.
By allocating corresponding voxel storage space to the current voxel, identifying target neighboring voxels, and storing their storage space addresses into the current voxel's storage space, active and passive updates are achieved, reducing the processing time for neighboring voxels.
This improves the processing speed of neighboring voxels, reduces the space occupied by neighboring voxels, and achieves the effect of real-time processing of voxel information.
Smart Images

Figure CN115761119B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer device, and storage medium for storing neighborhood voxels. Background Technology
[0002] 3D scanning is primarily used to scan the spatial shape and structure of objects to obtain the spatial coordinates of their surfaces. Its significance lies in its ability to convert the three-dimensional information of a physical object into digital signals that a computer can directly process. Neighborhood information is crucial for the subsequent processing of images obtained from 3D scanning. Traditional methods for acquiring neighborhood voxel information involve building trees, such as OCTtrees or kd-trees, for the current voxel or point cloud to store neighboring voxels; however, these methods are time-consuming in the processing. Summary of the Invention
[0003] Therefore, it is necessary to provide a neighborhood voxel storage method, apparatus, computer device, and storage medium to address the above-mentioned technical problems, which can reduce the time required to obtain neighborhood voxels.
[0004] A neighborhood voxel storage method, the method comprising:
[0005] Get the current voxel of the current frame;
[0006] Allocate corresponding voxel storage space for the current voxel;
[0007] Determine the target neighboring voxels corresponding to the current voxel;
[0008] Obtain the storage space address corresponding to the target neighbor voxel, and store the storage space address corresponding to the target neighbor voxel into the voxel storage space of the current voxel;
[0009] Based on the spatial address corresponding to the voxel storage space of the current voxel, update the voxel storage space of the target neighboring voxel.
[0010] A neighborhood voxel storage device, the device comprising:
[0011] The current voxel acquisition module is used to acquire the current voxel of the current frame;
[0012] The allocation module is used to allocate corresponding voxel storage space for the current voxel;
[0013] The target neighborhood voxel determination module is used to determine the target neighborhood voxel corresponding to the current voxel;
[0014] The first storage module is used to obtain the storage space address corresponding to the target neighbor voxel and store the storage space address corresponding to the target neighbor voxel into the voxel storage space of the current voxel.
[0015] The second storage module is used to update the voxel storage space of the target neighboring voxel based on the space address corresponding to the voxel storage space of the current voxel.
[0016] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the embodiments of this application.
[0017] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in the embodiments of this application.
[0018] The aforementioned neighborhood voxel storage method, apparatus, computer equipment, and storage medium allocate corresponding voxel storage space for the current voxel, determine the corresponding target neighborhood voxel, and store the storage space address corresponding to the target neighborhood voxel into the voxel storage space of the current voxel. Therefore, the neighborhood voxel is actively updated once when allocating space for the voxel. Since the current voxel and its neighboring voxels are adjacent, they need to be updated bidirectionally after allocating corresponding voxel storage space for the current voxel. Thus, the voxel storage space of the target neighborhood voxel is updated based on the space address corresponding to the voxel storage space of the current voxel. For existing neighboring voxels, they are passively updated when new neighboring voxels appear. Compared to the traditional method of processing all point clouds uniformly, this method can process voxel information in real time, improve processing speed, and reduce the time spent obtaining neighboring voxels and the space occupied by neighboring voxels. Attached Figure Description
[0019] Figure 1 This is a diagram illustrating the application environment of a neighborhood voxel storage method in one embodiment.
[0020] Figure 2 This is a flowchart illustrating a neighborhood voxel storage method in one embodiment;
[0021] Figure 3 This is a flowchart illustrating the neighborhood voxel storage step in another embodiment;
[0022] Figure 4 This is a structural block diagram of a neighborhood voxel storage device in one embodiment;
[0023] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0024] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0026] It should be noted that all directional indicators (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicator will also change accordingly. The connection can be a direct connection or an indirect connection.
[0027] It is understood that the term "connection" in the following embodiments should be understood as "electrical connection," "communication connection," etc., if the connected circuits, modules, units, etc., have electrical signal or data transmission with each other.
[0028] In one embodiment, such as Figure 1 The diagram shown illustrates the application environment of a neighborhood voxel storage method in one embodiment. Figure 1 The system includes an object 110, a 3D scanner 120, and a computer device 130. The 3D scanner 120 is connected to the computer device 130. The computer device 130 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The 3D scanner 120 scans the object, generating a point cloud, and the computer device 130 obtains the current frame. The computer device 130 processes the current frame obtained from the scan.
[0029] In one embodiment, such as Figure 2 The diagram shown is a flowchart of a neighborhood voxel storage method in one embodiment. The method is illustrated using an application on a computer device as an example, and includes:
[0030] Step 202: Obtain the current voxel of the current frame.
[0031] The current frame is an image frame obtained by scanning with a scanning device. The scanning device can be, for example, a 3D scanner or a LiDAR scanner.
[0032] A voxel is short for volume pixel. A solid containing voxels can be represented through stereo rendering or by extracting polygonal isosurfaces from a given threshold contour. The concept of a voxel is similar to that of a pixel, the smallest unit in two-dimensional space. The current voxel is the voxel containing the currently scanned point to be processed. Voxels can be represented in a computer device using indices or coordinates.
[0033] Specifically, during the scanning process of the scanning device, the computer device acquires the current voxel of the current frame in real time.
[0034] Step 204: Allocate corresponding voxel storage space for the current voxel.
[0035] The current voxel's storage space is used to store the storage addresses of neighboring voxels, the point to be processed, the current voxel, and neighboring voxels. The voxel storage space can be in memory.
[0036] Specifically, when the current voxel is the voxel obtained in the first scan of the current frame, the corresponding voxel storage space is allocated to the current voxel, that is, the voxel storage space of the current voxel is obtained.
[0037] Step 206: Determine the target neighboring voxels corresponding to the current voxel.
[0038] In this context, the neighboring voxels of the current voxel refer to the voxels adjacent to the current voxel. For example, in a 3×3×3 voxel cube, the current voxel is the voxel at the center of the cube, i.e., voxel number 14. The surrounding 26 cubes are all neighboring voxels of the current voxel. The target neighboring voxel is a neighboring voxel whose corresponding voxel storage space already exists.
[0039] Specifically, the computer device determines the corresponding neighboring voxels based on the current voxel and performs a search. When there is a neighboring voxel with existing storage space for the corresponding voxel, that neighboring voxel is the target neighboring voxel.
[0040] Optionally, to determine the corresponding neighboring voxels based on the current voxel, the relative positions of the neighboring voxels with respect to the current voxel can be determined first, and then the absolute positions can be obtained. For example, if the current voxel coordinates are (x0, y0, z0), then the relative position of the neighboring voxel is (-1, 0, 0), and the absolute position of the neighboring voxel is (x0-1, y0, z0).
[0041] Step 208: Obtain the storage space address corresponding to the target neighbor voxel, and store the storage space address corresponding to the target neighbor voxel into the voxel storage space of the current voxel.
[0042] Here, the storage address refers to the address of the voxel storage space. The storage address can be represented in the form of a pointer.
[0043] Specifically, the computer device obtains the storage space address corresponding to the target neighboring voxel and stores the storage space address corresponding to the target neighboring voxel into the voxel storage space of the current voxel.
[0044] Step 210: Update the voxel storage space of the target neighboring voxel based on the space address corresponding to the voxel storage space of the current voxel.
[0045] Similarly, the voxel storage space corresponding to the neighboring voxel stores the storage space address of the neighboring voxel, the neighboring voxel of the neighboring voxel, and the neighboring voxel of the neighboring voxel.
[0046] Specifically, in the voxel storage space corresponding to the neighboring voxel, the computer device updates the storage space address corresponding to the voxel storage space of the current voxel. For example, when the computer device scans a new voxel A, it allocates voxel storage space for voxel A and searches for neighboring voxels of voxel A. If a neighboring voxel B exists, then voxel B is the target neighboring voxel, and its space address is written into the voxel storage space of voxel A. At this time, the voxel storage space of neighboring voxel B does not contain the storage space address of voxel A, so it is necessary to update the voxel storage space of neighboring voxel B based on the storage space address of voxel A, that is, to write the storage space address of voxel A into the voxel storage space of neighboring voxel B.
[0047] In this embodiment, the computer device can perform voxel processing based on the voxel storage space of each voxel to obtain the processing result. Voxel processing methods may include, for example, filtering, sampling, noise removal, smoothing, etc.
[0048] In this embodiment, a corresponding voxel storage space is allocated for the current voxel, the corresponding target neighboring voxels are determined, and the storage space address corresponding to the target neighboring voxels is stored in the voxel storage space of the current voxel. Therefore, the neighboring voxels are actively updated once when allocating space for the voxel. Since the current voxel and its neighboring voxels are adjacent, they need to be updated bidirectionally after the corresponding voxel storage space is allocated for the current voxel. Therefore, based on the space address corresponding to the voxel storage space of the current voxel, the voxel storage space of the target neighboring voxels is updated. For existing neighboring voxels, they are passively updated when new neighboring voxels appear. Compared to the traditional method of processing all point clouds uniformly, this method can process voxel information in real time, improve processing speed, and reduce the time spent obtaining neighboring voxels and the space occupied by neighboring voxels.
[0049] In one embodiment, obtaining the current voxel of the current frame includes: obtaining the point cloud of the current frame; and for each point to be processed in the point cloud, determining the current voxel corresponding to the point to be processed.
[0050] The point to be processed can be represented in coordinate form in the current frame. A voxel can contain multiple points to be processed.
[0051] Specifically, during the scanning process, the computer device acquires the point cloud in the current frame. For each point to be processed in the point cloud, the integer difference between the coordinate value of each point to be processed and the voxel size can be taken to determine the current voxel corresponding to the point to be processed.
[0052] In this embodiment, a voxel contains multiple points to be processed. By storing the points to be processed in a voxel manner, the data processing efficiency can be improved while preserving the point cloud features.
[0053] In one embodiment, determining the current voxel corresponding to each point to be processed in the point cloud includes: obtaining the coordinates of each point to be processed in the point cloud; and determining the current voxel corresponding to the point to be processed based on the coordinates and voxel resolution.
[0054] Specifically, when the voxel resolution is large, the model obtained after voxel processing has a high resolution; when the voxel resolution is small, the model obtained after voxel processing has a low resolution.
[0055] Specifically, for the point cloud S1{Pi=(xi,yi,zi)|i=1,2,..N} input in the current frame, for each point Pi to be processed in the set of points to be processed, calculate the corresponding current voxel Vi; Vi=(Vx,Vy,Vz); Vx=[xi / r], Vy=[yi / r], Vz=[zi / r]. Where r is the voxel size. Then, dividing each coordinate value by the voxel resolution and rounding it down, the current voxel corresponding to the point to be processed can be determined.
[0056] In this embodiment, for each point to be processed in the point cloud, the coordinates of the point to be processed are obtained. Based on the coordinates of the point to be processed and the voxel resolution, the current voxel corresponding to the point to be processed is determined, and the accuracy of the model can be adjusted according to the required voxel resolution.
[0057] In one embodiment, allocating corresponding voxel storage space for the current voxel includes: determining the hash value corresponding to the current voxel; searching a hash table based on the hash value; and allocating corresponding voxel storage space for the current voxel when the hash value does not exist in the hash table.
[0058] The hash table is used to store voxels with allocated voxel storage space. Alternatively, the hash table is used to store voxels with allocated voxel storage space and their corresponding voxel storage spaces.
[0059] Specifically, the computer device determines the hash value corresponding to the current voxel using a hash algorithm. The computer device searches the hash table based on the hash value. If the hash value does not exist in the hash table, that is, the current voxel does not exist in the hash table either, it means that the current voxel is a new voxel, and therefore the corresponding voxel storage space is allocated for the current voxel.
[0060] In this embodiment, the hash value corresponding to the current voxel is determined, and a search is performed in the hash table based on the hash value. When the hash value does not exist in the hash table, the corresponding voxel storage space is allocated to the current voxel, indicating that the current voxel is a new voxel, and the neighboring voxels are actively updated subsequently. The voxel storage space of the neighboring voxels is updated without repeated traversal, which reduces the time consumption of obtaining and storing neighboring voxel information.
[0061] In one embodiment, the neighborhood voxel storage method further includes: when the hash value exists in the hash table, storing the point to be processed in the current frame into the voxel storage space corresponding to the current voxel.
[0062] Specifically, when the hash value exists in the hash table, it means that the current voxel already has a corresponding voxel storage space and does not need to be allocated again. Therefore, the points to be processed in the current frame are stored in the voxel storage space corresponding to the current voxel, and subsequent processing can be carried out uniformly based on each point to be processed in the voxel.
[0063] In one embodiment, determining the target neighboring voxel corresponding to the current voxel includes: searching for neighboring voxels based on the current voxel, and when a neighboring voxel exists, using the existing neighboring voxel as the target neighboring voxel.
[0064] Specifically, based on the current voxel, a neighboring voxel is searched. When a neighboring voxel exists, it is used as the target neighboring voxel. Non-existent neighboring voxels are temporarily set to empty.
[0065] In this embodiment, neighboring voxels are searched based on the current voxel. When a neighboring voxel exists, the existing neighboring voxel is used as the target neighboring voxel, and the neighboring voxels corresponding to the current voxel are actively updated to reduce the voxel search time.
[0066] In one embodiment, such as Figure 3 The diagram shown is a flowchart of a neighborhood voxel storage method in another embodiment. Figure 3 The current voxel representation is used as an index, and the storage space address is implemented through space pointers. After starting, it determines whether to continue scanning. If scanning does not continue, it ends. If scanning continues, the 3D scanner acquires the current image frame (i.e., the current frame), and the computer calculates 3D points to obtain a point cloud. It then determines whether the point cloud of the current frame has been processed. When the point cloud of the current frame has been processed, it determines whether to continue scanning.
[0067] When the point cloud of the current frame has not been fully processed, acquire the points to be processed in the point cloud. The computer device determines the current voxel corresponding to the point to be processed. First, specify the voxel resolution r. For the point cloud S1{Pi=(xi,yi,zi)|i=1,2,..N} input in the current frame, perform the following operations on each point Pi in the point cloud:
[0068] 1) Calculate the corresponding current voxel: Based on the voxel resolution, calculate the current voxel index Vi; Vi = (Vx, Vy, Vz); Vx = [xi / r], Vy = [yi / r], Vz = [zi / r]. r is the voxel size.
[0069] 2) Determine if the current voxel exists: Calculate the hash value Hi corresponding to the current voxel using the index Vi; Hi = Hash(Vi). Search the hash table using the hash value Hi to see if a voxel with index Vi exists in the linked list corresponding to the current hash value.
[0070] Vx, Vy, and Vz are voxel indices. When searching for a voxel in the hash table, the target voxel indices Tx, Ty, and Tz are used to determine whether the current voxel is the one being searched for, i.e., to determine whether (Tx == Vx && Ty == Vy && Tz == Vz).
[0071] 3) When the current voxel exists, update the point to be processed to the voxel storage space corresponding to the current voxel.
[0072] 4) When the current voxel does not exist, allocate corresponding voxel storage space for the current voxel and store it using a specific voxel structure.
[0073] StructVoxel{
[0074] IntVx; / / Voxel index
[0075] IntVy;
[0076] IntVz;
[0077] Voxel*Neighbor
[27] ; / / A pointer to the storage space of the neighboring voxels (including the storage space pointer of the current voxel).
[0078] Void*data; / / Point cloud data
[0079] }
[0080] 5) Traverse and check if the neighboring voxels of the current voxel exist: Calculate the neighboring voxel index using the current voxel index, and perform a search based on the neighboring voxel index. If the neighboring voxel index m (m = 0, 1, ..., 26) exists, update the space pointer of the neighboring voxel Neighbor[m]. Simultaneously, update the voxel storage space of the neighboring voxel m using the space pointer of the current voxel through a reverse lookup table. This step is a bidirectional update process.
[0081] 6) When traversing and searching for a neighboring voxel of the current voxel, if no neighboring voxel exists, set the space pointer of the non-existent neighboring voxel to null.
[0082] 7) Point cloud voxel processing: such as filtering, sampling, smoothing, and noise removal.
[0083] The point cloud S2 input in the second frame is processed in the same way as the first frame. Each subsequent frame of data repeats the voxel processing operations of the first frame. All voxels only actively update their neighboring voxel pointers once when allocating voxel storage space; subsequent updates to neighboring voxel pointers are passively updated whenever a neighboring voxel appears, avoiding duplication and improving search efficiency.
[0084] This embodiment is used in the real-time scanning process of a 3D scanner, which can acquire neighborhood voxel information in real time, calculate the normal of the point cloud in real time, and perform other operations that require neighborhood voxels.
[0085] In one embodiment, a neighborhood voxel storage method includes:
[0086] Step (a1): Obtain the point cloud of the current frame.
[0087] Step (a2): For each point to be processed in the point cloud, obtain the coordinates of each point to be processed.
[0088] Step (a3): Based on the coordinates and voxel resolution of each point to be processed, determine the current voxel corresponding to the point to be processed.
[0089] Step (a4) determines the hash value corresponding to the current voxel.
[0090] Step (a5) involves searching the hash table based on the hash value.
[0091] Step (a6): When the current voxel does not exist in the hash table, allocate the corresponding voxel storage space for the current voxel.
[0092] Step (a7): When the current voxel exists in the hash table, store the point to be processed in the current frame into the voxel storage space corresponding to the current voxel.
[0093] Step (a8): Search for neighboring voxels based on the current voxel. When a neighboring voxel exists, use the existing neighboring voxel as the target neighboring voxel.
[0094] Step (a9): Obtain the storage space address corresponding to the target neighbor voxel, and store the storage space address corresponding to the target neighbor voxel into the voxel storage space of the current voxel.
[0095] Step (a10): Update the voxel storage space of the target neighboring voxel based on the space address corresponding to the voxel storage space of the current voxel.
[0096] In this embodiment, a corresponding voxel storage space is allocated for the current voxel, the corresponding target neighboring voxels are determined, and the storage space address corresponding to the target neighboring voxels is stored in the voxel storage space of the current voxel. Therefore, the neighboring voxels are actively updated once when allocating space for the voxel. Since the current voxel and its neighboring voxels are adjacent, they need to be updated bidirectionally after the corresponding voxel storage space is allocated for the current voxel. Therefore, based on the space address corresponding to the voxel storage space of the current voxel, the voxel storage space of the target neighboring voxels is updated. For existing neighboring voxels, they are passively updated when new neighboring voxels appear. Compared to the traditional method of processing all point clouds uniformly, this method can process voxel information in real time, improve processing speed, and reduce the time spent obtaining neighboring voxels and the space occupied by neighboring voxels.
[0097] It should be understood that, although the above Figure 2 In the flowchart, the steps are shown sequentially according to the arrows, and the steps (a1) to (a10) are shown sequentially according to their numbers. However, these steps are not necessarily executed in the order indicated by the arrows or numbers. Unless explicitly stated herein, there is no strict order requirement for the execution of these steps; they can be executed in other orders. Figure 2 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.
[0098] In one embodiment, such as Figure 4 The diagram shown is a structural block diagram of a neighborhood voxel storage device in one embodiment. Figure 4 A neighborhood voxel storage device is provided. This device can be a software module, a hardware module, or a combination of both, integrated into a computer device. Specifically, the device includes: a current voxel acquisition module 402, an allocation module 404, a target neighborhood voxel determination module 406, a first storage module 408, and a second storage module 410, wherein:
[0099] The current voxel acquisition module 402 is used to acquire the current voxel of the current frame;
[0100] The allocation module 404 is used to allocate corresponding voxel storage space for the current voxel;
[0101] The target neighborhood voxel determination module 406 is used to determine the target neighborhood voxels corresponding to the current voxel;
[0102] The first storage module 408 is used to obtain the storage space address corresponding to the target neighbor voxel and store the storage space address corresponding to the target neighbor voxel into the voxel storage space of the current voxel.
[0103] The second storage module 410 is used to update the voxel storage space of the target neighboring voxel based on the space address corresponding to the voxel storage space of the current voxel.
[0104] In this embodiment, a corresponding voxel storage space is allocated for the current voxel, the corresponding target neighboring voxels are determined, and the storage space address corresponding to the target neighboring voxels is stored in the voxel storage space of the current voxel. Therefore, the neighboring voxels are actively updated once when allocating space for the voxel. Since the current voxel and its neighboring voxels are adjacent, they need to be updated bidirectionally after the corresponding voxel storage space is allocated for the current voxel. Therefore, based on the space address corresponding to the voxel storage space of the current voxel, the voxel storage space of the target neighboring voxels is updated. For existing neighboring voxels, they are passively updated when new neighboring voxels appear. Compared to the traditional method of processing all point clouds uniformly, this method can process voxel information in real time, improve processing speed, and reduce the time spent obtaining neighboring voxels and the space occupied by neighboring voxels.
[0105] In one embodiment, the current voxel acquisition module 402 is used to: acquire the point cloud of the current frame; and for each point to be processed in the point cloud, determine the current voxel corresponding to the point to be processed.
[0106] In this embodiment, a voxel contains multiple points to be processed. By storing the points to be processed in a voxel manner, the data processing efficiency can be improved while preserving the point cloud features.
[0107] In one embodiment, the current voxel acquisition module 402 is used to: acquire the coordinates of each point to be processed in the point cloud; and determine the current voxel corresponding to the point to be processed based on the coordinates and voxel resolution of the point to be processed.
[0108] In this embodiment, for each point to be processed in the point cloud, the coordinates of the point to be processed are obtained. Based on the coordinates of the point to be processed and the voxel resolution, the current voxel corresponding to the point to be processed is determined, and the accuracy of the image can be adjusted according to the required voxel resolution.
[0109] In one embodiment, the allocation module 404 is used to determine the hash value corresponding to the current voxel; search the hash table based on the hash value, and when the hash value does not exist in the hash table, allocate the corresponding voxel storage space for the current voxel.
[0110] In this embodiment, the hash value corresponding to the current voxel is determined, and a search is performed in the hash table based on the hash value. When the hash value does not exist in the hash table, the corresponding voxel storage space is allocated to the current voxel, indicating that the current voxel is a new voxel, and the neighboring voxels are actively updated subsequently. The voxel storage space of the neighboring voxels is updated without repeated traversal, which reduces the time consumption of obtaining and storing neighboring voxel information.
[0111] In one embodiment, the first storage module 408 is further configured to: when the hash value exists in the hash table, store the point to be processed in the current frame into the voxel storage space corresponding to the current voxel.
[0112] In this embodiment, when the current voxel exists in the hash table, it means that the current voxel already has a corresponding voxel storage space and does not need to be allocated again. Therefore, the points to be processed in the current frame are stored in the voxel storage space corresponding to the current voxel, and subsequent processing can be carried out uniformly based on each point to be processed in the voxel.
[0113] In one embodiment, the target neighborhood voxel determination module 406 is used to search for neighboring voxels based on the current voxel, and when a neighboring voxel exists, the existing neighboring voxel is taken as the target neighboring voxel.
[0114] In this embodiment, neighboring voxels are searched based on the current voxel. When a neighboring voxel exists, the existing neighboring voxel is used as the target neighboring voxel, and the neighboring voxels corresponding to the current voxel are actively updated to reduce the search time.
[0115] Specific limitations regarding the neighborhood voxel storage device can be found in the limitations of the neighborhood voxel storage method described above, and will not be repeated here. Each module in the aforementioned neighborhood voxel storage device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0116] In one embodiment, a computer device is provided, which may be a terminal device, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a neighborhood voxel storage method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0117] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0118] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method embodiments.
[0119] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method embodiments.
[0120] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the steps in the above method embodiments.
[0121] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes described in the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0122] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A neighborhood voxel storage method, characterized in that, The method includes: During the scanning process of the scanning device, the current voxel of the current frame is acquired in real time; Allocate a corresponding voxel storage space for the current voxel; the voxel storage space is used to store the storage space address of neighboring voxels, the point to be processed, the current voxel, and the neighboring voxels; Determine the target neighboring voxel corresponding to the current voxel; the target neighboring voxel is a neighboring voxel that already has a corresponding voxel storage space; Obtain the storage space address corresponding to the target neighbor voxel, and store the storage space address corresponding to the target neighbor voxel into the voxel storage space of the current voxel; Based on the space address corresponding to the voxel storage space of the current voxel, the space address corresponding to the current voxel is written into the voxel storage space of the target neighboring voxel.
2. The method according to claim 1, characterized in that, The step of obtaining the current voxel of the current frame includes: Obtain the point cloud of the current frame; For each point to be processed in the point cloud, determine the current voxel corresponding to the point to be processed.
3. The method according to claim 2, characterized in that, The step of determining the current voxel corresponding to each point to be processed in the point cloud includes: For each point to be processed in the point cloud, obtain the coordinates of the point to be processed; Based on the coordinates of the point to be processed and the voxel resolution, the current voxel corresponding to the point to be processed is determined.
4. The method according to claim 1, characterized in that, The process of allocating corresponding voxel storage space for the current voxel includes: Determine the hash value corresponding to the current voxel; The hash value is searched in the hash table. If the hash value does not exist in the hash table, the corresponding voxel storage space is allocated to the current voxel.
5. The method according to claim 4, characterized in that, The method further includes: When the hash value exists in the hash table, the point to be processed in the current frame is stored in the voxel storage space corresponding to the current voxel.
6. The method according to claim 1, characterized in that, Determining the target neighboring voxels corresponding to the current voxel includes: Based on the current voxel, search for neighboring voxels. When a neighboring voxel exists, the existing neighboring voxel is taken as the target neighboring voxel.
7. A neighborhood voxel storage device, characterized in that, The apparatus is used to implement the method according to any one of claims 1 to 6, the apparatus comprising: The current voxel acquisition module is used to acquire the current voxel of the current frame in real time during the scanning process of the scanning device; The allocation module is used to allocate corresponding voxel storage space for the current voxel; the voxel storage space is used to store the storage space address of neighboring voxels, the point to be processed, the current voxel, and the neighboring voxels; The target neighborhood voxel determination module is used to determine the target neighborhood voxel corresponding to the current voxel; the target neighborhood voxel is a neighborhood voxel that already has a corresponding voxel storage space; The first storage module is used to obtain the storage space address corresponding to the target neighbor voxel and store the storage space address corresponding to the target neighbor voxel into the voxel storage space of the current voxel. The second storage module is used to write the space address corresponding to the current voxel into the voxel storage space of the target neighboring voxel based on the space address corresponding to the voxel storage space of the current voxel.
8. The apparatus according to claim 7, characterized in that, The current voxel acquisition module is used for: Obtain the point cloud of the current frame; For each point to be processed in the point cloud, determine the current voxel corresponding to the point to be processed.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.