Compression storage method and device for point cloud position data
By dividing the point cloud scene and converting the point cloud location data into offset data for storage, the problem of excessive space occupation of the point cloud location data set in the case of extremely large numbers of points is solved, and efficient compressed storage of point cloud location data is achieved.
Patent Information
- Application Number
- CN202411537477.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the case of processing a very large number of points, the point cloud location data set faces the problem of excessive space occupancy during storage, transmission, dynamic scheduling and display.
By obtaining the position coordinates of each spatial point in the point cloud scene, dividing the point cloud scene, multiple spatial data blocks are obtained, and the position coordinates of each spatial point are converted into offset data relative to the center point of the spatial data block, and then the point cloud position data is stored.
On the premise of ensuring a certain position accuracy, the space required for point cloud location data is compressed, the storage method of point cloud location data is optimized, and the data space occupation is reduced.
Smart Images

Figure CN119597945A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and in particular to a method, device, electronic device, computer storage medium and computer program product for compressing and storing point cloud position data. Background Art
[0002] In recent years, point cloud data has been widely used in many fields such as computer vision, robot navigation, 3D reconstruction, reverse engineering, and autonomous driving. It is a data set composed of a large number of discrete points in three-dimensional space. These points usually contain rich information, such as position data, color, normal, intensity, etc. In some scenarios, the data of point cloud scenes is usually very large, and may contain millions or even billions of points of data information.
[0003] In point cloud scenes, the spatial location coordinate information of points is crucial. However, when existing technologies process extremely large numbers of points, point cloud location data sets face multiple challenges in storage, transmission, dynamic scheduling and display. Therefore, there is an urgent need for a compressed storage method for point cloud location data that can optimize the storage method of point cloud location data and reduce the data space occupied during storage and scheduling. Summary of the invention
[0004] The main purpose of the present invention is to solve the technical problem in the prior art that point cloud location data occupies a large data space and is difficult to store.
[0005] A first aspect of the present invention provides a method for compressing and storing point cloud position data, comprising:
[0006] Obtaining the position coordinates of each spatial point in the point cloud scene, dividing the point cloud scene to obtain multiple spatial data blocks, and obtaining the center point coordinates and spatial range of each of the spatial data blocks according to the division results;
[0007] Based on the center point coordinates of each of the spatial data blocks and the position coordinates of the spatial points contained in each of the spatial data blocks, converting the position coordinates of the spatial points into offset data relative to the center point of the spatial data block;
[0008] The point cloud position data is stored according to the offset data of each spatial point in each spatial data block and the spatial coordinates of the center point.
[0009] Optionally, in a first implementation manner of the first aspect of the present invention, dividing the point cloud scene to obtain a plurality of spatial data blocks includes:
[0010] Generate a bounding box of the point cloud scene based on the position coordinates of each spatial point in the point cloud scene;
[0011] Taking the bounding box as the root node of the scene tree, calling the octree partitioning method to perform scene tree partitioning on the point cloud scene, and obtaining non-leaf nodes and leaf nodes of the scene tree;
[0012] A spatial data block is obtained based on the range corresponding to each leaf node.
[0013] Optionally, in a second implementation of the first aspect of the present invention, storing the point cloud position data according to the offset data of each spatial point in each of the spatial data blocks and the spatial coordinates of the center point further includes:
[0014] Obtaining the number of spatial points contained in the spatial data block;
[0015] Calculate the number of corresponding spatial points according to the sampling ratio to obtain the number of points to be extracted;
[0016] According to the number of points to be extracted, uniformly extracting spatial points that have not been extracted within the range of the spatial data block to obtain a first extracted point set;
[0017] According to the range of the spatial data block, the first extraction point set is evenly divided into a number of sampling grids, and the spatial point closest to the center point of each sampling grid is obtained as the first sampling point;
[0018] The point cloud position data is stored based on the offset data of the first sampling point and the spatial coordinates of the center point of the spatial data block.
[0019] Optionally, in a third implementation of the first aspect of the present invention, after uniformly extracting unextracted spatial points within the range of the spatial data block according to the number of points to be extracted to obtain a first extracted point set, the method further includes:
[0020] Acquire all the remaining spatial points within the spatial data block after the spatial points are extracted to obtain a second extracted point set;
[0021] Evenly dividing the second extraction point set into a plurality of sampling grids within the range of the spatial data block, and obtaining the spatial point closest to the center point of each sampling grid as the second sampling point;
[0022] The point cloud data is stored based on the offset data of the first sampling point and the second sampling point and the spatial coordinates of the center point of the spatial data block.
[0023] Optionally, in a fourth implementation manner of the first aspect of the present invention, before obtaining the position coordinates of each spatial point in the point cloud scene and dividing the point cloud scene, the method further includes:
[0024] The storage method of the offset data is obtained, and the spatial range size of the spatial data block is determined based on the storage method of the offset data.
[0025] Optionally, in a fifth implementation of the first aspect of the present invention, a signed integer is represented by a 16-bit storage method, and the offset data is stored based on the signed integer;
[0026] The spatial coordinates of the center point are stored using a 64-bit storage method.
[0027] A second aspect of the present invention provides a compression storage device for point cloud position data, comprising:
[0028] A division module is used to obtain the position coordinates of each spatial point in the point cloud scene, divide the point cloud scene to obtain multiple spatial data blocks, and obtain the center point coordinates and spatial range of each of the spatial data blocks according to the division results;
[0029] a calculation module, configured to convert the position coordinates of the spatial points into offset data relative to the center point of the spatial data block based on the center point coordinates of each of the spatial data blocks and the position coordinates of the spatial points contained in each of the spatial data blocks;
[0030] The storage module is used to store the point cloud position data according to the offset data of each spatial point in each spatial data block and the spatial coordinates of the center point.
[0031] A third aspect of the present invention provides a compression storage device for point cloud position data, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the compression storage device for point cloud position data executes the steps of the above-mentioned compression storage method for point cloud position data.
[0032] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the steps of the above-mentioned method for compressing and storing point cloud position data.
[0033] A fifth aspect of the present invention provides a computer program product, comprising a computer program / instruction, characterized in that when the computer program / instruction is executed by a processor, the steps of implementing the above-mentioned method for compressing and storing point cloud position data are implemented.
[0034] In the technical solution provided by the present invention, the position coordinates of each spatial point in the point cloud scene are obtained, the point cloud scene is divided to obtain multiple spatial data blocks, and the center point coordinates and spatial range of each spatial data block are obtained according to the division results; based on the center point coordinates of each spatial data block and the position coordinates of the spatial points contained in each spatial data block, the position coordinates of the spatial point are converted into offset data relative to the center point of the spatial data block; the point cloud position data is stored according to the offset data of each spatial point in each spatial data block and the spatial coordinates of the center point. This method can store the point cloud position data by dividing the point cloud scene into data blocks and using the offset data of each spatial point, and can compress the space required for storing the point cloud position data under the premise of ensuring a certain position accuracy.
[0035] Furthermore, a device, an electronic device, a computer-readable storage medium, and a computer program product provided by the present invention also solve corresponding technical problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0037] Figure 1 It is a flowchart of a first embodiment of a method for compressing and storing point cloud position data in an embodiment of the present invention;
[0038] Figure 2 It is a schematic diagram of a spatial data block in a first embodiment of a method for compressing and storing point cloud position data in an embodiment of the present invention;
[0039] Figure 3 This is a schematic diagram of dividing a point cloud scene in a first embodiment of a method for compressing and storing point cloud position data in an embodiment of the present invention;
[0040] Figure 4 1 is a flow chart of a second embodiment of a method for compressing and storing point cloud position data according to an embodiment of the present invention;
[0041] Figure 5 This is a flow chart of the sampling and storage part in the second embodiment of the method for compressing and storing point cloud position data in an embodiment of the present invention;
[0042] Figure 6 It is a schematic diagram of point cloud sampling in the second embodiment of the method for compressing and storing point cloud position data in an embodiment of the present invention;
[0043] Figure 7 A schematic diagram of an embodiment of a device for compressing and storing point cloud position data in an embodiment of the present invention;
[0044] Figure 8 A schematic diagram of an embodiment of a compression storage device for point cloud position data in an embodiment of the present invention;
[0045] Fig. 9 The figure is a schematic diagram of a computer-readable medium in an embodiment of the present invention. DETAILED DESCRIPTION
[0046] Exemplary embodiments of the present invention will now be described more fully with reference to the accompanying drawings. However, exemplary embodiments can be implemented in a variety of forms, and should not be construed as limiting the present invention to the embodiments set forth herein. On the contrary, providing these exemplary embodiments enables the present invention to be more comprehensive and complete, and is more convenient for fully conveying the inventive concept to those skilled in the art. The same reference numerals in the figures represent the same or similar elements, components or parts, and thus their repeated description will be omitted.
[0047] Under the premise of being consistent with the technical concept of the present invention, the features, structures, characteristics or other details described in a specific embodiment do not exclude that they can be combined in one or more other embodiments in a suitable manner.
[0048] In the description of specific embodiments, the features, structures, characteristics or other details described in the present invention are intended to enable those skilled in the art to fully understand the embodiments. However, it does not exclude that those skilled in the art can practice the technical solutions of the present invention without one or more of the specific features, structures, characteristics or other details.
[0049] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0050] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0051] The term "and / or" or "and / or" includes all combinations of any one or more of the associated listed items.
[0052] See also Figure 1-Figure 3 The first embodiment of the method for compressing and storing point cloud location data in the embodiment of the present invention includes:
[0053] S101, obtaining the position coordinates of each spatial point in the point cloud scene, dividing the point cloud scene to obtain multiple spatial data blocks, and obtaining the center point coordinates and spatial range of each spatial data block according to the division result;
[0054] It is understandable that the execution subject of the present invention may be a compression storage device for point cloud location data, or a terminal or a server, which is not specifically limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.
[0055] After receiving the request for storing point cloud location data, the server first obtains the original position coordinates of each spatial point in the point cloud scene that needs to be compressed and saved, where the position coordinates of each spatial point are spatial coordinates, including coordinate values in the directions of three coordinate axes: x, y, and z.
[0056] In the prior art, the coordinate value in each direction is usually represented by a single-precision floating-point number (float) or a double-precision floating-point number (double) data type, and each single-precision floating-point number (float) occupies 32 bits, or 4 bytes, of storage space, and each double occupies 64 bits, or 8 bytes, of storage space. When there are a large number of points, more space is occupied.
[0057] Therefore, in this step, after obtaining the information of the position coordinates of each spatial point in the point cloud scene, the point cloud scene is first divided to obtain multiple spatial data blocks. Specifically, the number of spatial data blocks obtained is related to the range that each spatial data block can represent and the spatial position relationship of each spatial point in the point cloud scene. When dividing, an octree can be used, or a K-dimensional tree (kd-tree), or uniform grid division can be used to divide the point cloud scene into multiple cubic spatial data blocks according to the spatial relationship.
[0058] In a specific embodiment, see Figure 2 If the octree is used to divide the point cloud scene, the largest bounding box of the entire point cloud scene can be used as the root node for division to obtain the spatial data corresponding to the non-leaf nodes and leaf nodes. Figure 3 After the division, the leaf node is used as the smallest spatial data block unit. According to the division result, the center point of each spatial data block, the spatial range it represents, and the corresponding point cloud spatial points contained in the spatial range it represents can be obtained.
[0059] In a specific implementation, the maximum spatial range represented by the spatial data block is related to the accuracy of a preset storage method. When dividing, the spatial range of the spatial data block obtained by division should not exceed the maximum spatial range.
[0060] S102, based on the coordinates of the center point of each spatial data block and the position coordinates of the spatial points included in each spatial data block, convert the position coordinates of the spatial points into offset data relative to the center point of the spatial data block;
[0061] For each spatial data block, according to the center point coordinates of the spatial data block and the position coordinates of the spatial points obtained in the above steps, the offset data of each spatial point relative to the center point coordinates of the spatial data block is calculated.
[0062] S103, storing the point cloud position data according to the offset data of each spatial point in each spatial data block and the spatial coordinates of the center point.
[0063] After obtaining the offset data of the coordinates of each spatial point relative to the center point of the spatial data block in which it is located, when storing the position information of each spatial point contained in the subsequent spatial data block, only the position coordinates of the center point of each spatial data block during division are saved, and each spatial point does not use the original position coordinate information, but is saved using the offset data relative to the center point of the spatial data block. In this way, the amount of data required to record the coordinates of each spatial point is limited to a certain data range; therefore, when recording the offset data of each spatial point, a data type that occupies less space can be used.
[0064] For example, in a specific implementation, compared to a solution in which all point cloud location data are stored using a 32-bit storage method or a 64-bit storage method, the offset data may be stored using a 16-bit storage method, and the center point spatial coordinates may be stored using a 64-bit storage method, which can reduce a certain amount of data storage space.
[0065] The method in this embodiment can divide the point cloud scene into data blocks and use the offset data of each spatial point to store the point cloud position data, which can compress the space required for storing the point cloud position data while ensuring a certain position accuracy.
[0066] Please see Figure 4-6 The second embodiment of the method for compressing and storing point cloud position data in the embodiment of the present invention includes:
[0067] It is understandable that the execution subject of the present invention may be a compression storage device for point cloud location data, or a terminal or a server, which is not specifically limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.
[0068] First, the data accuracy requirement for point cloud position data compression and storage is obtained, and the number of bits required for saving the offset data subsequently calculated in this embodiment is determined based on the data accuracy requirement.
[0069] In a specific implementation, a 16-bit storage method can be used to represent a signed integer, and the specific range can be [-32768, 32767]. In order to save the position data of the point cloud accurately to the millimeter level, the last three digits are used to represent the offset data after the decimal point, and the first two digits are used to represent the offset data before the decimal point, that is, the actual valid range is [-32.768, 32.767]; in this case, the maximum value of the spatial range that each data block can represent is actually 65.535 cubic meters.
[0070] S201, obtaining the position coordinates of each spatial point in the point cloud scene;
[0071] After receiving the request for storing point cloud location data, the server first obtains the original location coordinates of each spatial point in the point cloud scene that needs to be compressed and saved, wherein the location coordinates of each spatial point are spatial coordinates, including coordinate values in the directions of three coordinate axes: x, y, and z. Generally, the coordinate value in each direction is usually represented by a single-precision floating point number (float) or a double-precision floating point number (double) data type.
[0072] In a specific implementation, it also includes a solution for preprocessing point cloud data, specifically including enhancing the point cloud image; after obtaining the position coordinates of each spatial point in the point cloud scene, it also includes using a filter to reduce noise on the point cloud and using a filter to smooth the point cloud.
[0073] S202, generating a bounding box of the point cloud scene based on the position coordinates of each spatial point in the point cloud scene;
[0074] After obtaining the position coordinates of each spatial point in the point cloud scene, the minimum bounding box of the point cloud scene is generated according to the position coordinate information of each spatial point in the point cloud scene; in this embodiment, the shape of the minimum bounding box can be a cube.
[0075] S203, taking the bounding box as the root node of the scene tree, calling the octree partitioning method to partition the point cloud scene into a scene tree, and obtaining non-leaf nodes and leaf nodes of the scene tree;
[0076] The minimum cubic bounding box obtained in the previous step is used as the root node of the scene tree, and the octree partitioning method is called to divide the point cloud scene into a scene tree to obtain non-leaf nodes and leaf nodes; and the spatial ranges corresponding to the non-leaf nodes and leaf nodes are obtained.
[0077] S204, obtaining a spatial data block based on the range corresponding to each leaf node, and obtaining the center point coordinates and spatial range of each spatial data block according to the division result;
[0078] Since there are certain requirements on the accuracy of point cloud position data in this embodiment (i.e., the aforementioned accuracy to the millimeter level), when dividing, the spatial range corresponding to the leaf node obtained should be less than 65.535 cubic meters, and the spatial range corresponding to the spatial data block corresponding to each leaf node is obtained, and the coordinates of the center point of the spatial data block are obtained at the same time.
[0079] S205, based on the center point coordinates of each spatial data block and the position coordinates of the spatial points included in each spatial data block, convert the position coordinates of the spatial points into offset data relative to the center point of the spatial data block;
[0080] For each spatial data block, according to the center point coordinates of the spatial data block obtained in the above steps and the position coordinates of the spatial point, calculate the offset data of each spatial point relative to the center point coordinates of the spatial data block. The offset data includes the offset in the x-axis direction, the offset in the y-axis direction, and the offset in the z-axis direction; and the offset data on each axis are all represented by a signed integer using a 16-bit storage method, and the data range that can be represented is [-32768, 32767], and the distance range that can be represented (unit: meter) is [-32.768, 32.767].
[0081] S206 , storing the point cloud position data according to the offset data of each spatial point in each spatial data block and the spatial coordinates of the center point.
[0082] In this embodiment, when storing point cloud position data, the root node and non-leaf nodes of the scene tree only save the spatial range of the point cloud, and do not save the specific point cloud position information; only the leaf node saves the specific point cloud position information of the point cloud, and when saving, the point cloud position data is stored through the offset data of each spatial point in each spatial data block corresponding to the leaf node and the spatial coordinates of the center point and the spatial coordinates of the center point. Among them, when storing the center point data of the center point spatial coordinates of each spatial data block corresponding to the leaf node, this center point can be represented by a single-precision floating point number (float) or a multi-precision floating point number (double) data type; because each leaf node has only one center data, this point does not occupy too much storage space.
[0083] Furthermore, in this embodiment, when storing the point cloud location data, the compressed point cloud data can also be split into multiple different data files for storage, so that when the point cloud scene needs to be displayed and loaded later, it can be loaded and displayed step by step. Figure 5 The solution of splitting the compressed point cloud data into multiple different data files for storage is actually a solution of generating multiple different data files for storage by percentage thinning the spatial points of the point cloud scene. In order to achieve gradual loading and display, multiple data files of different sizes will be generated according to display requirements during thinning; in one embodiment, the specific steps are as described in S301-S308 below:
[0084] S301, obtaining the number of spatial points contained in the spatial data block;
[0085] S302, calculating the number of corresponding spatial points according to the sampling ratio to obtain the number of points to be extracted;
[0086] S303, according to the number of points to be extracted, uniformly extracting spatial points that have not been extracted within the range of the spatial data block to obtain a first extraction point set;
[0087] S304, evenly dividing the first extraction point set into a number of sampling grids according to the range of the spatial data block, and obtaining the spatial point closest to the center point of the sampling grid in each sampling grid as the first sampling point;
[0088] S305, storing the point cloud position data based on the offset data of the first sampling point and the spatial coordinates of the center point of the spatial data block;
[0089] S306, acquiring all the spatial points remaining in the spatial data block after the spatial points are extracted, to obtain a second extracted point set;
[0090] S307, within the range of the spatial data block, evenly divide the second extraction point set into a number of sampling grids, and obtain the spatial point in each sampling grid that is closest to the center point of the sampling grid as the second sampling point;
[0091] S308 , storing the point cloud data based on the offset data of the first sampling point and the second sampling point and the spatial coordinates of the center point of the spatial data block.
[0092] Based on the above contents of S301-S308, a specific example is given to illustrate that when splitting, each spatial data block is only split into two parts, one part is the first extracted point set, and the other part is the second extracted point set; first, the number of spatial points contained in the spatial data block is obtained, and the number of points to be extracted required for obtaining the first extracted point set is calculated according to the sampling ratio required when loading and displaying; according to the required number of points to be extracted, the spatial points that have not been extracted are uniformly extracted within the range of the spatial data block to obtain the first extracted point set. Subsequently, according to the range of the spatial data block, the first extracted point set is evenly divided into several sampling grids, and the spatial point closest to the center point of each sampling grid is obtained as the first sampling point; the offset information of each first sampling point is calculated according to the offset information of the points in the first extracted point set contained in each sampling grid, and the point cloud data is stored according to the offset information of each first sampling point and the center point position information of the spatial data block. If it is necessary to load and display the point cloud scene subsequently according to the first display ratio corresponding to the first sampling ratio, then only the point cloud storage file consisting of the offset information of each first sampling point in each spatial data block relative to the center point of each spatial data block and the current center point position coordinate information can be downloaded for loading and display. This can display the approximate shape of the point cloud scene when the user's observation position is far away from the point cloud scene.
[0093] Furthermore, after storing the point cloud data through the offset information of the first sampling point, it also includes taking all the remaining spatial points within the spatial data block after the spatial points are extracted as the second extracted point set, and evenly dividing the second extracted point set into a number of sampling grids within the spatial data block, and obtaining the spatial point closest to the center point of each sampling grid as the second sampling point to replace the technical solution for storing the point cloud data based on the first sampling point and the second sampling point data. The sampling and saving method similar to the aforementioned storage of point cloud data based on the first sampling point can store the information of the remaining spatial points after the first sampling point is extracted. When the entire point cloud scene needs to be displayed later, the user can download the point cloud storage file composed of the offset information of the second sampling point relative to the center point of each spatial data block and the position coordinate information of the center point of the current spatial data block on the basis of downloading the point cloud data corresponding to the first extracted point set, thereby obtaining the position information represented by the compressed point cloud file.
[0094] In a preferred embodiment, the number of the first extracted point sets can be multiple. When the number of the first extracted point sets is multiple, the offset data of each spatial point in each spatial data block obtained in steps S201-S205 and the spatial coordinates of the center point can be split and stored in combination with the second extracted point set. Take a specific example to illustrate, in order to realize the gradual loading when observing data from far to near, instead of waiting for the complete data block to be downloaded before displaying all point cloud information, each data block is split into multiple files at a sampling ratio of 20%, 30% and 50%, and the sum is still 100% of the original data block. Through this splitting method, each point cloud file generated can represent the general outline of the original point cloud.
[0095] For each spatial data block, first obtain the number of spatial points contained therein, and calculate the number of points that need to be extracted in the first extracted point set obtained by the first thinning according to the first sampling ratio. For example, a spatial data block contains 10,000 spatial points. When the first sampling ratio is 20%, 2,000 spatial points need to be uniformly extracted to obtain the first extracted point set corresponding to the 20% ratio. Then, the first extracted point set corresponding to the 20% ratio is uniformly divided into several sampling grids, and the center point of the sampling grid is obtained. The spatial point closest to the center point of the sampling grid in each sampling grid is selected as the first sampling point. According to the offset information of the first sampling point and the center point position information of the spatial data block, a point cloud file F1 is generated for storage. In this way, the size of the position data file of the point cloud scene that needs to be loaded when the user's observation position is far away from the point cloud scene is reduced; when the user's observation position is far away from the point cloud scene, only the file F1 can be downloaded for loading and display.
[0096] In addition, after extracting the first extracted point set corresponding to 20% of the remaining 8000 spatial points, 30% of the 10,000 spatial points are extracted again, that is, 3000 spatial points are extracted from the remaining 8000 spatial points, and a point cloud file F2 is generated and stored through a scheme similar to the above scheme. When the user needs to further observe the point cloud scene, the point cloud file can be downloaded based on the downloaded file F1 to load and display the point cloud file.
[0097] Finally, the remaining 5000 spatial points after extracting 20% and 30% of the corresponding spatial points are obtained as the second extracted point set, and the second extracted point set is evenly divided into several sampling grids within the spatial data block, and the spatial point closest to the center point of each sampling grid is obtained as the second sampling point, and the point cloud file F3 is generated and stored according to the offset information of the second sampling point and the center point position information of the spatial data block. When the user needs to further observe the point cloud scene, the point cloud file can be loaded and displayed based on the downloaded files F1 and F2.
[0098] The method in this embodiment can divide the point cloud scene into data blocks and use the offset data of each spatial point to store the point cloud position data, which can compress the space required for the storage of point cloud position data under the premise of ensuring a certain position accuracy; and the method in this embodiment can dynamically schedule resources for the stored point cloud files, which can better meet the needs of subsequent transmission, dynamic scheduling and display while compressing the point cloud position data storage space.
[0099] The above describes the method for compressing and storing point cloud position data in the embodiment of the present invention. The following describes the device for compressing and storing point cloud position data in the embodiment of the present invention. Figure 7 , an embodiment of a compression storage device for point cloud position data in an embodiment of the present invention includes:
[0100] The division module 701 is used to obtain the position coordinates of each spatial point in the point cloud scene, divide the point cloud scene to obtain multiple spatial data blocks, and obtain the center point coordinates and spatial range of each of the spatial data blocks according to the division results;
[0101] A calculation module 702, configured to convert the position coordinates of the spatial points into offset data relative to the center point of the spatial data block based on the center point coordinates of each of the spatial data blocks and the position coordinates of the spatial points included in each of the spatial data blocks;
[0102] The storage module 703 is used to store the point cloud position data according to the offset data of each spatial point in each of the spatial data blocks and the spatial coordinates of the center point.
[0103] The compression storage device for point cloud position data in the embodiment of the present invention can divide the point cloud scene into data blocks and store the point cloud position data using the offset data of each spatial point, thereby compressing the space required for storing the point cloud position data while ensuring a certain position accuracy.
[0104] In another embodiment of the present application, the division module 701 is specifically used for:
[0105] Generate a bounding box of the point cloud scene based on the position coordinates of each spatial point in the point cloud scene;
[0106] Taking the bounding box as the root node of the scene tree, calling the octree partitioning method to perform scene tree partitioning on the point cloud scene, and obtaining non-leaf nodes and leaf nodes of the scene tree;
[0107] A spatial data block is obtained based on the range corresponding to each leaf node.
[0108] In another embodiment of the present application, the storage module 703 is further used for:
[0109] Obtaining the number of spatial points contained in the spatial data block;
[0110] Calculate the number of corresponding spatial points according to the sampling ratio to obtain the number of points to be extracted;
[0111] According to the number of points to be extracted, uniformly extracting spatial points that have not been extracted within the range of the spatial data block to obtain a first extracted point set;
[0112] According to the range of the spatial data block, the first extraction point set is evenly divided into a number of sampling grids, and the spatial point closest to the center point of each sampling grid is obtained as the first sampling point;
[0113] The point cloud position data is stored based on the offset data of the first sampling point and the spatial coordinates of the center point of the spatial data block.
[0114] In another embodiment of the present application, the storage module 703 is further used for:
[0115] Acquire all the remaining spatial points within the spatial data block after the spatial points are extracted to obtain a second extracted point set;
[0116] Evenly dividing the second extraction point set into a plurality of sampling grids within the range of the spatial data block, and obtaining the spatial point closest to the center point of each sampling grid as the second sampling point;
[0117] The point cloud data is stored based on the offset data of the first sampling point and the second sampling point and the spatial coordinates of the center point of the spatial data block.
[0118] In another embodiment of the present application, the division module 701 is further configured to:
[0119] The storage method of the offset data is obtained, and the spatial range size of the spatial data block is determined based on the storage method of the offset data.
[0120] In another embodiment of the present application, the point cloud location data storage module 703 is further used for:
[0121] Using a 16-bit storage method to represent a signed integer, and storing the offset data based on the signed integer;
[0122] The spatial coordinates of the center point are stored using a 64-bit storage method.
[0123] The embodiment of the present invention can divide the point cloud scene into data blocks and use the offset data of each spatial point to store the point cloud position data, which can compress the space required for the point cloud position data storage under the premise of ensuring a certain position accuracy; and the method in this embodiment can dynamically schedule the resources of the stored point cloud files, which can better meet the subsequent transmission, dynamic scheduling and display requirements while compressing the point cloud position data storage space.
[0124] Based on the same inventive concept, an embodiment of this specification also provides an electronic device for compressing and storing point cloud position data. The electronic device for compressing and storing point cloud position data in an embodiment of the present invention is described in detail below from the perspective of hardware processing.
[0125] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. Figure 8 The electronic device 800 according to this embodiment of the present invention is described. Figure 8 The electronic device 800 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0126] like Figure 8 As shown, the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 may include, but are not limited to: at least one processing unit 810, at least one storage unit 820, a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810), a display unit 840, etc.
[0127] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present invention described in the above processing method section of this specification. For example, the processing unit 810 can perform the following steps: Figure 1 , Figure 4 or Figure 5 Steps shown.
[0128] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .
[0129] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.
[0130] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0131] The electronic device 800 may also communicate with one or more external devices 100 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 800, and / or any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 850. Furthermore, the electronic device 800 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 860. The network adapter 860 may communicate with other modules of the electronic device 800 through the bus 830. It should be understood that although Figure 8 Not shown, other hardware and / or software modules may be used in conjunction with electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0132] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the exemplary embodiments described in the present invention can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation method of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.) or on a network, including a number of instructions to enable a computing device (which can be a personal computer, server, or network device, etc.) to execute the above method according to the present invention. When the computer program is executed by a data processing device, the computer-readable medium can implement the above method of the present invention, that is: Figure 1 , Figure 4 or Figure 5 The steps of the method are shown.
[0133] Fig. 9 A schematic diagram of a computer-readable medium provided for an embodiment of this specification.
[0134] accomplish Figure 1 , Figure 4 or Figure 5The computer program of the steps of the method shown can be stored on one or more computer readable media. The computer readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0135] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0136] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0137] In summary, the present invention can be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that general data processing devices such as microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0138] In addition, the present invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the method for compressing and storing point cloud position data as described in any of the above embodiments.
[0139] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the present invention is not inherently related to any specific computer, virtual device or electronic device, and various general devices can also implement the present invention. The above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0140] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0141] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for compressing and storing point cloud position data, characterized in that: include: Obtaining the position coordinates of each spatial point in the point cloud scene, dividing the point cloud scene to obtain multiple spatial data blocks, and obtaining the center point coordinates and spatial range of each of the spatial data blocks according to the division results; Based on the center point coordinates of each of the spatial data blocks and the position coordinates of the spatial points contained in each of the spatial data blocks, converting the position coordinates of the spatial points into offset data relative to the center point of the spatial data block; The point cloud position data is stored according to the offset data of each spatial point in each spatial data block and the spatial coordinates of the center point.
2. The method for compressing and storing point cloud position data according to claim 1, characterized in that: The point cloud scene is divided to obtain multiple spatial data blocks including: Generate a bounding box of the point cloud scene based on the position coordinates of each spatial point in the point cloud scene; Taking the bounding box as the root node of the scene tree, calling the octree partitioning method to perform scene tree partitioning on the point cloud scene, and obtaining non-leaf nodes and leaf nodes of the scene tree; A spatial data block is obtained based on the range corresponding to each leaf node.
3. The method for compressing and storing point cloud position data according to claim 2, characterized in that: The storing of the point cloud position data according to the offset data of each spatial point in each spatial data block and the spatial coordinates of the center point also includes: Obtaining the number of spatial points contained in the spatial data block; Calculate the number of corresponding spatial points according to the sampling ratio to obtain the number of points to be extracted; According to the number of points to be extracted, uniformly extracting spatial points that have not been extracted within the range of the spatial data block to obtain a first extracted point set; According to the range of the spatial data block, the first extraction point set is evenly divided into a number of sampling grids, and the spatial point closest to the center point of each sampling grid is obtained as the first sampling point; The point cloud position data is stored based on the offset data of the first sampling point and the spatial coordinates of the center point of the spatial data block.
4. The method for compressing and storing point cloud position data according to claim 3, characterized in that: After uniformly extracting unextracted spatial points within the spatial data block according to the number of points to be extracted to obtain a first extraction point set, the method further includes: Acquire all the remaining spatial points within the spatial data block after the spatial points are extracted to obtain a second extracted point set; Evenly dividing the second extraction point set into a plurality of sampling grids within the range of the spatial data block, and obtaining the spatial point closest to the center point of each sampling grid as the second sampling point; The point cloud data is stored based on the offset data of the first sampling point and the second sampling point and the spatial coordinates of the center point of the spatial data block.
5. The method for compressing and storing point cloud position data according to any one of claims 1 to 4, characterized in that: Before obtaining the position coordinates of each spatial point in the point cloud scene and dividing the point cloud scene, the method further includes: The storage method of the offset data is obtained, and the spatial range size of the spatial data block is determined based on the storage method of the offset data.
6. The method for compressing and storing point cloud position data according to claim 5, characterized in that: Using a 16-bit storage method to represent a signed integer, and storing the offset data based on the signed integer; The spatial coordinates of the center point are stored using a 64-bit storage method.
7. A compression storage device for point cloud position data, characterized in that: include: A division module is used to obtain the position coordinates of each spatial point in the point cloud scene, divide the point cloud scene to obtain multiple spatial data blocks, and obtain the center point coordinates and spatial range of each of the spatial data blocks according to the division results; a calculation module, configured to convert the position coordinates of the spatial points into offset data relative to the center point of the spatial data block based on the center point coordinates of each of the spatial data blocks and the position coordinates of the spatial points contained in each of the spatial data blocks; The storage module is used to store the point cloud position data according to the offset data of each spatial point in each spatial data block and the spatial coordinates of the center point.
8. An electronic device, characterized in that: The electronic device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory so that the electronic device executes the steps of the method for compressing and storing point cloud position data as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the program / instructions are executed by a processor, the steps of the method for compressing and storing point cloud position data as described in any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method for compressing and storing point cloud position data according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Point cloud data processing method, point cloud data processing device, point cloud rendering method and point cloud rendering device
CN107798721A
Point cloud compression method and device, point cloud rendering method and device, equipment and storage medium
CN113486276A
Point cloud data processing method and device, electronic equipment and storage medium
CN113722415A
Gridding space storage and indexing method and device based on point cloud data and computer readable storage medium
CN117009411A