Point cloud file compression method, device, equipment, storage medium and program product
By performing data recombination and variable-length integer compression on point cloud files, the problem of low compression efficiency of point cloud files is solved, achieving efficient point cloud file storage and transmission, reducing performance overhead, and improving application efficiency.
Patent Information
- Application Number
- CN202210814588.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-12
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-07-12
AI Technical Summary
Existing point cloud file compression methods suffer from high performance overhead and low compression efficiency, especially in the storage and transmission of high-precision map data, leading to data lag and resource waste.
By parsing the point cloud file, the data is reorganized based on the offset values between data points to form multiple data segments. The offset values and point attribute values of the data points in the data segments are compressed using variable-length integer storage to obtain the compressed point cloud file.
It reduces the storage space usage and transmission bandwidth pressure of point cloud files, improves compression efficiency, reduces performance overhead, and enhances the operational efficiency of practical applications.
Smart Images

Figure CN115185912B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of big data, in particular to a point cloud file compression method and device, equipment, a storage medium and a program product. BACKGROUND
[0002] With the development of big data technology, and the gradual popularization and application of automatic driving, lane-level navigation and other technologies, the accuracy requirements for map data are also increasing, and thus high-precision maps have emerged. Among them, the high-precision map can be understood as an electronic map with higher accuracy and more comprehensive data, which is used to realize automatic driving or high-precision navigation. Among them, point cloud data is an important basis for high-precision map operation. As high-precision maps become more and more accurate and detailed, the density of corresponding point cloud data also becomes higher. When the surrounding environment is relatively complex, the amount of data will increase sharply, resulting in the need for a large amount of resources and space for storage and transmission of point cloud data, and even causing data lag, which affects the operation efficiency in actual application. In order to improve the operation speed and reduce the storage pressure, it is necessary to compress the point cloud file before transmission to reduce the performance overhead.
[0003] Traditionally, open source libraries such as PCL (Point Cloud Library) and Potree (Point Cloud Renderer) are used to parse point cloud files and compress them. PCL is an extension package for point clouds that provides various common point cloud parsing and compression functions. Potree is a large-scale point cloud renderer based on WebGL (3D drawing protocol) that also provides point cloud compression algorithms.
[0004] However, the inventors have found that the current PCL and Potree only support compression of specific formats, and the format conversion before compression processing results in greater performance overhead. Therefore, the traditional point cloud file compression method still has the problem of large performance overhead and compression efficiency needs to be improved. SUMMARY
[0005] Therefore, it is necessary to provide a point cloud file compression method, device, computer equipment, computer readable storage medium and computer program product that can reduce performance overhead and improve file compression efficiency.
[0006] In a first aspect, the present application provides a point cloud file compression method. The method comprises:
[0007] parsing a point cloud file to be compressed to obtain data content in the point cloud file to be compressed;
[0008] reorganizing data points in the data content based on offset values between the data points to obtain a plurality of data segments; the offset values between adjacent data points in the data segments are within a target offset value range.
[0009] The offset values of the data points in each data segment in different dimensions and the corresponding point attribute values are compressed by variable-length integer storage to obtain a compressed point cloud file.
[0010] In a second aspect, the present application further provides a point cloud file compression device. The device comprises:
[0011] A to-be-compressed file analysis module is configured to analyze a to-be-compressed point cloud file to obtain data content in the to-be-compressed point cloud file.
[0012] A data reorganization module is configured to reorganize data points in the data content based on offset values between the data points to obtain a plurality of data segments; offset values between adjacent data points in the data segments are within a target offset value range.
[0013] A compression processing module is configured to compress offset values of the data points in each data segment in different dimensions and the corresponding point attribute values by variable-length integer storage to obtain a compressed point cloud file.
[0014] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0015] A to-be-compressed point cloud file is analyzed to obtain data content in the to-be-compressed point cloud file.
[0016] The data points in the data content are reorganized based on offset values between the data points to obtain a plurality of data segments; offset values between adjacent data points in the data segments are within a target offset value range.
[0017] Offset values of the data points in each data segment in different dimensions and the corresponding point attribute values are compressed by variable-length integer storage to obtain a compressed point cloud file.
[0018] In a fourth aspect, the present application further provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0019] A to-be-compressed point cloud file is analyzed to obtain data content in the to-be-compressed point cloud file.
[0020] The data points in the data content are reorganized based on offset values between the data points to obtain a plurality of data segments; offset values between adjacent data points in the data segments are within a target offset value range.
[0021] The offset values of the data points in different dimensions and the corresponding point attribute values are compressed by variable-length integer storage to obtain a compressed point cloud file.
[0022] In a fifth aspect, the present application further provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the following steps:
[0023] parsing a to-be-compressed point cloud file to obtain data content in the to-be-compressed point cloud file;
[0024] reorganizing the data points in the data content based on offset values between the data points to obtain a plurality of data segments; offset values between adjacent data points in the data segments are within a target offset value range;
[0025] The offset values of the data points in different dimensions and the corresponding point attribute values are compressed by variable-length integer storage to obtain a compressed point cloud file.
[0026] In the point cloud file compression method, device, computer equipment, storage medium and computer program product, by parsing a to-be-compressed point cloud file to obtain data content in the to-be-compressed point cloud file, and reorganizing the data points in the data content based on offset values between the data points, until offset values between adjacent data points in the data segments are within a target offset value range, a plurality of data segments are obtained, and the offset values of the data points in different dimensions and the corresponding point attribute values in the data segments are further compressed by variable-length integer storage to obtain a compressed point cloud file. After the point cloud file is compressed, it is stored and fed back to the terminal device for application, which relieves the bandwidth pressure in the point cloud file transmission process, and does not need to use the specification conversion when using the open source library, reduces the complexity of the compression process, improves the point cloud file compression efficiency, and reduces the performance overhead. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 An application environment diagram of the point cloud file compression method in one embodiment;
[0028] Figure 2 A flowchart of the point cloud file compression method in one embodiment;
[0029] Figure 3 A traffic distribution diagram of the point cloud file in the operation process of a traditional high-precision map in one embodiment;
[0030] Figure 4Fig. 2 is a schematic diagram of a single request average traffic after point cloud file compression in an embodiment;
[0031] Figure 5 Fig. 3 is a schematic diagram of an example of offset value distribution between data points in an embodiment;
[0032] Figure 6 Fig. 4 is a schematic diagram of a process of obtaining multiple data segments in an embodiment;
[0033] Figure 7 Fig. 5 is a schematic diagram of a data point segmentation process based on multi-queue in an embodiment;
[0034] Figure 8 Fig. 6 is a schematic diagram of a process of obtaining a compressed point cloud file in an embodiment;
[0035] Figure 9 Fig. 7 is a schematic diagram of storage of offset values of data points in different dimensions in an embodiment;
[0036] Figure 10 Fig. 8 is a schematic diagram of a process of point cloud file compression in another embodiment;
[0037] Figure 11 Fig. 9 is a structural block diagram of a point cloud file compression device in an embodiment;
[0038] Figure 12 Fig. 10 is an internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0040] The point cloud file compression method provided by the embodiments of the present application relates to big data technology and is specifically applied to the field of maps. Big data refers to a collection of data that cannot be captured, managed and processed within a certain time range by conventional software tools, and is a massive, high-growth and diversified information asset that requires new processing modes to have stronger decision-making, insight discovery and process optimization capabilities. With the advent of the cloud era, big data has attracted more and more attention. Big data requires special technology to effectively process large amounts of data over time. The technology suitable for big data includes large-scale parallel processing databases, data mining, distributed file systems, distributed databases, cloud computing platforms, the Internet and scalable storage systems, etc.
[0041] The point cloud file compression method provided by the embodiments of the present application relates to big data technology, can be applied to the field of maps, and can be specifically applied to the application environment shown in Figure 1 The terminal 102 communicates with the server 104 through a network. The data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. The server 104 obtains the data content in the to-be-compressed point cloud file by analyzing the to-be-compressed point cloud file, and performs data reorganization on each data point based on the offset values between the data points in the data content, to obtain a plurality of data segments, wherein the offset values between adjacent data points in each data segment are within a target offset value range. The to-be-compressed point cloud file can be stored in the data storage system or the cloud storage corresponding to the server 104. When point cloud file compression processing is required, the server 104 can obtain the to-be-compressed point cloud file from the data storage system or the cloud storage. Then, the server 104 performs compression processing on the offset values of each data point in each data segment in different dimensions and the corresponding point attribute values through variable-length integer storage, to obtain a compressed point cloud file, and transmits the compressed point cloud file to the terminal 102. Further, the terminal 102 can obtain navigation data for realizing automatic driving or vehicle navigation in the field of maps on the terminal 102 by storing and decompressing the compressed point cloud file.
[0042] The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices, portable wearable devices, and aircraft, etc. The Internet of Things device can be a smart speaker, a smart vehicle device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms.
[0043] In one embodiment, as shown in Figure 2 A point cloud file compression method is provided. Taking the server in Figure 1 as an example, the method includes the following steps:
[0044] In step S202, a to-be-compressed point cloud file is analyzed to obtain data content in the to-be-compressed point cloud file.
[0045] Point cloud files are files that store point cloud data. Point cloud data is a dataset of points in a coordinate system. Specifically, it can be a collection of data points in three-dimensional space. Point cloud data contains rich data or information, which may include three-dimensional coordinates (including X-axis, Y-axis, and Z-axis coordinates), color, classification value, intensity value (or reflectivity), and time information.
[0046] In this embodiment, the point cloud data in the point cloud file is dense point cloud data, which can be understood as the coordinate information of multiple densely distributed data points, or as a spatially close coordinate sequence, such as the coordinate information of continuous trajectory points. The point cloud file does not necessarily store specific location or coordinate information; it only needs to meet the requirement that the data is continuous and changes minimally, such as temperature change records. It can also be used as compressed point cloud data.
[0047] With the widespread application of technologies such as autonomous driving and lane-level navigation, the accuracy requirements for map data have increased. Consequently, point cloud data, as a crucial foundation for high-precision maps, is becoming increasingly dense. In complex environments, the data volume increases dramatically, consuming significant resources and space for storage and transmission. Therefore, point cloud files need to be compressed before storage and transmission. In other words, the unprocessed point cloud data file is the point cloud file to be compressed. The data content in the point cloud file to be compressed can include the coordinate values and corresponding attribute values of each data point.
[0048] Specifically, refer to, for example Figure 3 The diagram illustrating the traffic distribution of point cloud files during traditional high-precision map operations shows that bandwidth becomes a bottleneck during the storage and transmission of point cloud data. Specifically, when the data flow increases dramatically, the amount of data transmitted and received easily approaches the bandwidth limit, leading to data lag and impacting operational efficiency in practical applications. Therefore, it is necessary to compress the point cloud data to obtain compressed point cloud files before storage and transmission, and then decompress them for use on the terminal device. For example, in in-vehicle intelligent terminal devices, decompressing the compressed point cloud files can be used for autonomous driving and lane-level navigation, further improving navigation accuracy and efficiency.
[0049] Specifically, by parsing the to-be-compressed point cloud file, a file composition structure of the to-be-compressed point cloud file is obtained, where the file composition structure includes first file header information and a first data part, the first file header information includes a plurality of field names, byte numbers corresponding to the field names, and field information, and the first data part can include coordinate information and point attribute information of each data point. Further, based on the first data part of the to-be-compressed point cloud file, data content in the to-be-compressed point cloud file is obtained, and the obtained data content can include a plurality of continuous coordinate values and a plurality of continuous point attribute values.
[0050] In the embodiment, a t3m file is taken as an example for description, and the t3m file represents a self-defined point cloud file format, which is a point cloud file format similar to a PCD format (i.e., a Point Cloud Data format). The t3m file is a binary file before compression, and needs to be parsed into a meaningful structure before compression, that is, a file composition structure of the to-be-compressed point cloud file needs to be obtained.
[0051] Further, the file composition structure of the to-be-compressed point cloud file, i.e., the t3m file, specifically includes first file header information and a first data part, where the first file header information includes a plurality of field names, byte numbers corresponding to the field names, and field information, and the first data part can include coordinate information and point attribute information of each data point. The coordinate information of the first data part is three 4-byte floating-point numbers, and the unit is meter. The point attribute information is one 4-byte floating-point number representing the reflectivity of the data point.
[0052] In one embodiment, the specific composition of the first file header information is described in detail by Table 1 as follows:
[0053] Table 1
[0054] Field name Number of bytes Meaning Magic 4 File magic number Version 2 Algorithm version Flag 2 Flag point attribute meaning, currently only reflectance CenterX 8 Center point x coordinate value CenterY 8 Center point y coordinate value CenterZ 8 Center point z coordinate value Scale 4 Scale Pad 4 Reserved field NumVertices 4 Number of points
[0055] Specifically, referring to Table 1, the first file header information includes the field name, specifically: 1) Magic, the corresponding meaning of the field information is file magic number, indicating the file standard format, used for file type identification, occupying 4 bytes; 2) Version, the corresponding field information is algorithm version, used to indicate the current version of the algorithm, occupying 2 bytes; 3) Flag, the field information is represented as a marker point attribute meaning, that is, used to represent the meaning of the fourth data of each data point, which can be reflectivity and color value, etc. In this embodiment, it is the reflectivity of the data point, which is used to represent the surface reflectivity of the object, and occupies 2 bytes; 4) CenterX, CenterY, and CenterZ, respectively corresponding to the x coordinate value, y coordinate value and z coordinate value of the center point, each occupying 8 bytes; 5) Scale, the corresponding field information is the scaling ratio, used to indicate that the data points are scaled by a certain multiple, but the number of data points remains unchanged, occupying 4 bytes; 6) Pad, the corresponding field information is a reserved field, that is, it is not currently used, and provides a reserved position for possible information storage or recording in the future, occupying 4 bytes; 7) NumVertices, the corresponding field information is the number of points, that is, the number of data points in the point cloud file, which occupies 4 bytes.
[0056] Further, based on the first data part of the to-be-compressed point cloud file, including the coordinate information and point attribute information of each data point, the data content in the to-be-compressed point cloud file can be obtained, that is, a plurality of continuous coordinate values and a plurality of continuous point attribute values in the to-be-compressed point cloud file are obtained, which can be a plurality of continuous x coordinates, y coordinates and z coordinates of each data point, and the point attribute values of the continuous data points. The point attribute value can be the reflectivity of the data point.
[0057] In step S204, based on the offset values between the data points in the data content, the data points are reorganized to obtain a plurality of data segments, and the offset values between the adjacent data points in the data segment are within the target offset value range.
[0058] Wherein, by calculating the offset values between the coordinate values of each data point, the offset values of the data points can be stored instead of the traditional way of storing the actual coordinate values of the data points, which can reduce the storage space as much as possible under the premise of ensuring the accuracy, improve the transmission efficiency of the point cloud file, and reduce the performance consumption. Specifically, by using the offset values between the data points, the data points can be reorganized, the data points can be divided into a plurality of data segments, and the offset values between the adjacent data points in each data segment are within the target offset value range, so as to compress the offset values between the data points in each data segment and then store them.
[0059] Specifically, according to the offset values between the data points in the data content, the data points with offset values in the target offset value range are divided into the same data segment, and a plurality of data segments are obtained until the offset values between adjacent data points in each data segment are in the target offset value range.
[0060] In an embodiment, the actual operation precision requirement in the field of map is centimeter level, and the t3m file to be compressed has a spatial range of a cube with a side length of 60 m. After comprehensive analysis of the offset values between the data points in the t3m file, it is determined that most of the offset values between the data points in the t3m file are in the value range [-32.768 m, 32.768 m], and then the data points are divided into a plurality of data segments with offset values not exceeding [-32.768 m, 32.768 m].
[0061] That is, the target offset value range can be set as [-32.768 m, 32.768 m], and then the offset values between adjacent data points in each data segment obtained are in the target offset value range. After offset scaling of each data point, 2-byte integers can be used for storage instead of traditional 4-byte floating-point numbers, which can further reduce the storage space occupation. Compared with the traditional 4-byte floating-point number storage, the 2-byte integer storage after offset scaling saves 50% of the storage space.
[0062] In step S206, the offset values of each data point in each data segment in different dimensions and the corresponding point attribute values are compressed by variable-length integer storage to obtain a compressed point cloud file.
[0063] The offset values of each data point in each data segment in different dimensions can specifically include the offset values in three-dimensional coordinates, including the offset values in the x-axis coordinate, the offset values in the y-axis coordinate, and the offset values in the z-axis coordinate, and the corresponding point attribute values are the reflectivity of each data point.
[0064] Variable-length integer storage, also known as variable-length int storage, can be understood as a compression scheme of integer type, and its core idea is to store data in appropriate space to reduce space redundancy. The specific implementation manner can be that the actual number of bytes occupied by an integer is recorded by header information instead of directly storing data. Specifically, header information can be set for the offset values between the data points to record the number of bytes occupied by the offset values in the x-axis coordinate, the offset values in the y-axis coordinate, and the offset values in the z-axis coordinate, and then the offset values in each dimension are stored by using the corresponding number of bytes.
[0065] Specifically, for the offset values of each data point in each data segment in different dimensions and the corresponding point attribute values, corresponding header information is set to record the number of bytes occupied by the offset values on the x-axis, the offset values on the y-axis and the offset values on the z-axis respectively, and the point attribute values are enlarged and rounded, and the traditional 4-byte floating-point number storage mode of the point attribute values is further adjusted to a 2-byte integer storage mode to obtain a compressed point cloud file, thereby reducing the data storage space occupation.
[0066] In one embodiment, as shown in Figure 4 , a single request average flow diagram after point cloud file compression is provided, as shown in Figure 4 , it can be seen that the compressed point cloud file obtained by using the point cloud file compression method in the present application reduces the point cloud file space occupation to 41% of the original, and the single request data pulling flow is also reduced to about 42% of the original. That is, the compressed point cloud file obtained by using the point cloud file compression method in the present application is transmitted, stored and actually applied, which relieves the bandwidth pressure, improves the actual work efficiency, and reduces the storage cost and performance cost.
[0067] In one embodiment, the current offset value is stored using 1 or 2 bytes, 1 byte corresponding to 8 bits, but since there are some offset values that need to be represented by 9 bits, the number must be represented by 2 bytes, i.e. 16 bits, and there is still a waste of storage space. Therefore, bit granularity can be further implemented, i.e. using a complete number of bits to store the offset value, without having to divide it by bytes, reducing the waste of storage space and improving the rational utilization rate of storage space.
[0068] In the above point cloud file compression method, by analyzing the to-be-compressed point cloud file, the data content in the to-be-compressed point cloud file is obtained, and based on the offset values between each data point in the data content, the data of each data point is reorganized until the offset values between adjacent data points in each data segment are within the target offset value range, a plurality of data segments are obtained, and further, the offset values of each data point in each data segment in different dimensions and the corresponding point attribute values are compressed by variable-length integer storage to obtain a compressed point cloud file. After the point cloud file is compressed, it is stored and fed back to the terminal device for application, which relieves the bandwidth pressure in the point cloud file transmission process, and also eliminates the need for specification conversion when using an open source library, thereby reducing the complexity of the compression process, improving the point cloud file compression efficiency, and reducing the performance cost.
[0069] In one embodiment, after the compression processing of the offset values of the data points in each data segment in different dimensions and the corresponding point attribute values is performed by using the variable-length integer storage to obtain the compressed point cloud file, the method further comprises: outputting the compressed point cloud file in a preset target format.
[0070] The preset target format of the output compressed point cloud file is a binary format, and the compressed point cloud file comprises second file header information and a second data part. The second file header information comprises a data segment number indicating a decompression operation, i.e., the number of data segments obtained by dividing the data points. The second data part comprises a plurality of continuous data segments.
[0071] Further, each data segment comprises segment header information and a segment data part. The segment header information comprises the number of points in the data segment, the coordinates of each dimension of the data points, and the point attribute value. The number of points in the data segment represents the number of data points included in each data segment. The coordinates of each dimension of the data points represent the x coordinate, y coordinate, and z coordinate of the data points. The point attribute value of the data points represents the reflectivity of the data points.
[0072] The composition of the segment header information of the data segment is specifically described by using Table 2 as follows:
[0073] Table 2
[0074] Field name Number of bytes Meaning NumPoint 4 Number of points in the segment BaseX 4 Base point x coordinate value BaseY 4 Base point y coordinate value BaseZ 4 Base point z coordinate value Intensity 2 Base point reflectance
[0075] Specifically, as shown in Table 2, the segment header information of the data segment specifically comprises the following field names: 1) NumPoint, the corresponding meaning, i.e., the field information is the number of points in the segment, which represents the number of data points included in each data segment, and occupies 4 bytes; 2) BaseX, BaseY, and BaseZ, the field information of each is the x coordinate value, y coordinate value, and z coordinate value of the base point, respectively, and each occupies 4 bytes. 3) Intensity, the field information of which is the base point reflectivity, and it occupies 2 bytes. The base point represents the first data point stored in the data segment.
[0076] In the present application, the core idea of the compression processing is based on the idea of "base point + offset", and the compression is completed by using variable-length int and the like. Figure 5 As shown in Table 2, an example of the distribution of the offset values between the data points is provided, and as shown in Figure 5 It can be seen that for each data segment, a corresponding base point is set, i.e. Figure 5The begin point (i.e., the base point) in the segment data part, and based on the base point, the offset value between the second data point and the base point (i.e., offset), the offset value between the third data point and the second data point, and so on, are calculated to obtain the offset value of each data point relative to the previous data point. Specifically, the offset in the segment data part is used to represent the offset value of each data point relative to the previous data point. Figure 5
[0077] Further, the segment data part includes offset information between a plurality of consecutive data points. Specifically, the offset information includes the header information of the variable-length integer storage processing, the offset values of each adjacent data point in different dimensions, and the point attribute value of the corresponding data point. The offset value between the data points refers to the offset value of the current point relative to the previous point. Starting from the base point, the offset value between each subsequent data point and the previous data point is calculated in sequence.
[0078] Specifically, the specific components of the offset information are described in detail through Table 3 as follows:
[0079] Table 3
[0080] Field name Number of bytes Meaning Head 1 Variable length int header information OffsetX 1 or 2 Offset value on x axis OffsetY 1 or 2 Offset value on y axis OffsetZ 1 or 2 Offset value on z axis Intensity 2 Base point reflectance
[0081] Specifically, as shown in Table 3, the segment data part, i.e., the offset information, specifically includes the following field names: 1) Head, which means that the field information is the header information of the variable-length int, and the number of bytes occupied is 1 byte. The variable-length int header information can be understood as the header information of the variable-length integer storage processing, which is used to record the number of bytes occupied by the offset value of the data point in different dimensions; 2) OffsetX, OffsetY, and OffsetZ, which are respectively the offset value of the data point in the x-axis, the offset value in the y-axis, and the offset value in the z-axis. The number of bytes occupied by each of them can be 1 byte or 2 bytes; 3) Intensity, which is the field information of the base point reflectivity, and the number of bytes occupied is 2 bytes.
[0082] In an embodiment, after compression, the point cloud file needs to be output in a preset target format to facilitate transmission to a terminal device for decompression and use. In this embodiment, the preset target format of the compressed point cloud file output is a binary format, and the corresponding decompression time complexity is O(n) when using a streaming reading processing method, further reducing the processing time and improving the actual work efficiency.
[0083] Further, by using the point cloud file compression method in the present application, the compressed point cloud file obtained has a binary output format, and the decompression is performed in a streaming reading processing mode, so the decompression performance is less affected, the analysis time is less, and compared with zip and other tools, the decompression time is increased by more than one time, the decompression time can be greatly reduced, and on the basis of reducing the storage space occupation, the possibility of further compression using zip and other tools is provided.
[0084] Among them, combined with different business needs in the actual application process, zip and other tools can be considered for further compression, that is, the compressed point cloud file obtained on the basis is further compressed by zip and other tools, but the data content needs to be further organized to improve the repetition rate, so as to obtain higher compression rate by zip and other tools.
[0085] In one embodiment, the point cloud file compression method in the present application is used to obtain a compressed point cloud file, and the compressed point cloud file is transmitted to a terminal device, such as a smart vehicle device and a smart phone, etc., so that the compressed point cloud file is decompressed based on the smart vehicle device, etc., to obtain decompressed point cloud data, and further data extraction and data analysis are performed based on the decompressed point cloud data, to obtain navigation data that can be used in the actual scene of automatic driving or vehicle navigation in the field of map, to realize precise navigation.
[0086] In the present embodiment, the compressed point cloud file is output in a preset target format, that is, output as a binary file, and the decompression can be performed in a streaming reading processing mode without additional format conversion, so that the front end and the editor can be parsed by byte operation without relying on third-party libraries, the decompression processing time is reduced, and the actual work efficiency is further improved.
[0087] In one embodiment, as shown in Figure 6 The step of obtaining a plurality of data segments, that is, according to the offset values between the data points in the data content, dividing the data points with offset values in the target offset value range into the same data segment to obtain a plurality of data segments, until the offset values between adjacent data points in each data segment are in the target offset value range, specifically includes:
[0088] Step S602, respectively calculating the offset values between the coordinate values of each data point in the data content and the coordinate values of the data points at the tail of each data storage queue.
[0089] Specifically, by calculating the offset value between the coordinate value of each data point in the data content and the coordinate value of the tail data point of each data storage queue, and judging whether the obtained offset value is within the target offset value range, for example, it can be specifically judged whether the obtained offset value is within [-32.768m, 32.768m].
[0090] Step S604, if the offset value is within the target offset value range, the data point is added to the tail of the corresponding data storage queue.
[0091] Specifically, if it is determined that the offset value between the coordinate value of a certain data point and the coordinate value of the tail data point of any one data storage queue is within the target offset value range, the data point is added to the tail of the corresponding data storage queue as the new tail data point of the data storage queue. The data points already added to any data storage queue are not calculated repeatedly and are stored in only one data storage queue, i.e., not stored repeatedly.
[0092] Step S606, if the offset value is outside the target offset value range, a new data storage queue is created, and the data point is added to the newly created data storage queue.
[0093] Specifically, if the offset value between the coordinate value of a certain data point and the coordinate value of the tail data point of each data storage queue is outside the target offset value range, it indicates that the data point cannot be added to the tail of any one data storage queue, and thus a corresponding data storage queue needs to be created for the data point, and the data point is added to the newly created data storage queue, i.e., the point is taken as the base point in the newly created data storage queue.
[0094] In one embodiment, as shown in Figure 7 , a data point segmentation process based on multiple queues is provided, as shown in Figure 7 , by setting multiple data storage queues and adding each data point in the data content to each data storage queue, if the addition fails, a data storage queue needs to be created for the corresponding data point for storing the data point.
[0095] Similarly, for the newly created data storage queue, the coordinate values of other subsequent data points and the coordinate values of the tail data points in the data storage queue also need to be calculated to determine the division of each data point, i.e., which data storage queue the data point is added to.
[0096] Further, as shown in Figure 7For example, if there are three data storage queues, including queue 1, queue 2 and queue 3, and three data points, including point 1, point 2 and point 3, the calculation rule is: sequentially calculate the offset values between point 1 and the tail data point 1 of queue 1, point 1 and the tail data point 2 of queue 2, and point 1 and the tail data point 3 of queue 3. During the calculation process, if the offset value between point 1 and the tail data point 1 of queue 1 is within the target offset value range, point 1 is added to the tail of queue 1, and the calculation of the offset values between point 1 and the tail data point 2 of queue 2 and point 1 and the tail data point 3 of queue 3 is not continued, but the offset values between point 2 and the tail data point 1 of queue 1, point 2 and the tail data point 2 of queue 2, and point 2 and the tail data point 3 of queue 3 are sequentially calculated.
[0097] Further, if the offset value between point 1 and the tail data point 1 of queue 1 is outside the target offset value range, the offset value between point 1 and the tail data point 2 of queue 2 needs to be further calculated. If the offset value between point 1 and the tail data point 2 of queue 2 is within the target offset value range, point 1 is added to the tail of queue 2, and the calculation of the offset value between point 1 and the tail data point 3 of queue 3 is not continued. If the offset value between point 1 and the tail data point 2 of queue 2 is outside the target offset value range, the offset value between point 1 and the tail data point 3 of queue 3 needs to be further calculated, and it is determined whether the offset value between point 1 and the tail data point 3 of queue 3 is within the target offset value range.
[0098] If the offset value between point 1 and the tail data point 3 of queue 3 is within the target offset value range, point 1 is added to the tail of queue 3. If the offset values between point 1 and the tail data point 1 of queue 1, point 1 and the tail data point 2 of queue 2, and point 1 and the tail data point 3 of queue 3 are all outside the target offset value range, a new data storage queue is created for point 1, and point 1 is added to the new data storage queue as the base point of the new data storage queue.
[0099] Similarly, the specific division process of point 2 and point 3 is similar to that of point 1. After the division of point 1 is completed, the offset values between point 2 and the tail data point 1 of queue 1, point 2 and the tail data point 2 of queue 2, and point 2 and the tail data point 3 of queue 3 are sequentially calculated to determine the specific division result of point 2, i.e., which queue point 2 specifically locates in and whether a new data storage queue needs to be created for point 2. Similarly, after the division of point 2 is completed, the offset values between point 3 and the tail data point 1 of queue 1, point 3 and the tail data point 2 of queue 2, and point 3 and the tail data point 3 of queue 3 are sequentially calculated to determine the specific division result of point 3, i.e., which queue point 3 specifically locates in and whether a new data storage queue needs to be created for point 3.
[0100] Step S608, until the offset values between adjacent data points in each data storage queue are within the target offset value range, the data points in the same data storage queue are divided into the same data segment, and a plurality of data segments are obtained.
[0101] Specifically, by dividing each data point and adding it to the corresponding storage queue, a plurality of data storage queues can be obtained. Similarly, since the offset value between each data point and the coordinate value of the data point at the tail of the data storage queue needs to be calculated and determined whether the offset value between each data point and the coordinate value of the data point at the tail of the data storage queue is within the target offset value range, the offset value between adjacent data points in each data storage queue can be within the target offset value range.
[0102] Further, by dividing each data point in the same data storage queue into the same data segment, i.e., the offset value between adjacent data points in the same data storage queue is within the target offset value range, specifically, the offset value between adjacent data points can be within the range of [-32.768m, 32.768m], to obtain a plurality of data segments.
[0103] In this embodiment, by calculating the offset value between each data point in the data content and the coordinate value of the data point at the tail of each data storage queue, and determining that the offset value is within the target offset value range, the data point is added to the tail of the corresponding data storage queue. If it is determined that the offset value is outside the target offset value range, a new data storage queue is created and the data point is added to the newly created data storage queue, until the offset value between adjacent data points in each data storage queue is within the target offset value range. The data points in the same data storage queue are divided into the same data segment, and a plurality of data segments are obtained. Each data point can be reorganized to obtain a plurality of data segments, so that subsequent compression based on each data segment can be realized. Since the offset value between adjacent data points in each data segment is within the target offset value range, it meets the compression processing requirements in the actual application process, and thus the processing efficiency of subsequent compression processing can be further improved and the storage space occupation can be reduced.
[0104] In one embodiment, as shown in Figure 8 The step of obtaining the compressed point cloud file, i.e., performing variable-length integer storage processing on the offset values of each data point in each data segment in different dimensions and the corresponding point attribute values, to obtain the compressed point cloud file, specifically includes:
[0105] Step S802, amplifying the offset values between each data point in each data segment to obtain the range distribution of the amplified first offset value.
[0106] Specifically, the offset values between the data points in each data segment are amplified. After the offset values are processed by using the "base point + offset" idea, the offset values between the data points are located in the range of [-32.768m, 32.768m]. The offset values are amplified, for example, amplified by 1000 times, to obtain the range distribution of the amplified first offset values, that is, the offset values are in the range of [-32768, 32768]. Therefore, the offset values can be represented by 2-byte integers. Compared with the 4-byte floating-point numbers in the original data, 50% of the storage space is saved.
[0107] In an embodiment, the expansion or adjustment processing operation on the offset values can enable more offset values to be represented by fewer bytes, so as to further reduce the storage space occupation. Specifically, all permutations of the offset values can be traversed to find the permutation with the smallest overall space occupation of the offset values, so as to further improve the compression rate. However, the performance consumption will be multiplied, and repeated adjustment and testing are required to balance the performance consumption and the compression rate, so as to improve the compression rate while reducing the performance consumption as much as possible.
[0108] In step S804, the scaling processing is performed on the offset values according to the range distribution of the first offset values, to obtain the range distribution of the second offset values after the scaling processing.
[0109] Specifically, the scaling processing manner is determined by further analyzing the range distribution of the amplified first offset values, and the scaling processing is performed on the offset values according to the scaling processing manner, to obtain the range distribution of the second offset values after the scaling processing.
[0110] In this embodiment, it is determined by further analyzing the range distribution of the amplified first offset values that 83% of the offset values between the data points are in the range of [-0.128m, 0.127m] in the range distribution of the first offset values. Therefore, the scaling processing is further performed on the offset values, to obtain the range distribution of the second offset values after the scaling processing, that is, the offset values after the scaling processing are located in the range of [-128, 127]. Therefore, the offset values can be represented by 1-byte integers. Compared with the 2-byte integers, the storage space occupation is further reduced.
[0111] In step S806, the corresponding variable-length integer storage processing manner is determined based on the range distribution of the second offset values.
[0112] Specifically, based on the range distribution of the second offset value, a variable-length integer storage processing mode is determined, where the variable-length integer storage processing, i.e., variable-length int storage processing, can be understood as a compression scheme of an integer type, and the core idea thereof is to store data in a suitable space to reduce space redundancy, and a specific implementation manner can be that the actual number of bytes occupied by an integer is recorded through header information instead of directly storing data.
[0113] In step S808, offset values of each data point in different dimensions and storage occupied bytes of corresponding point attribute values in each data segment are determined according to the variable-length integer storage processing mode.
[0114] Specifically, for the offset values of each data point in different dimensions, corresponding header information is set according to the variable-length integer storage processing mode, where the header information is used to record the number of bytes occupied by the offset values in different dimensions, and the storage schematic diagram of the offset values of each data point in different dimensions is shown in FIG. 8. Figure 9 As shown in the storage schematic diagram of the offset values of each data point in different dimensions, the header information corresponding to the offset values of each data point in different dimensions specifically includes the number of bytes occupied by the offset value on the x-axis coordinate, the offset value on the y-axis coordinate and the offset value on the z-axis coordinate, and the offset values in different dimensions are stored by using the corresponding number of bytes, and all data points before compression can be restored to the original coordinates through the accumulation of the offset values between the base point and a series of data points.
[0115] In addition, a reserved byte is also provided and can be used to store the point attribute value. Wherein, the point attribute currently only represents reflectivity, and the corresponding point attribute value can be a 4-byte floating point number in the range of [0, 1], which is enlarged and then rounded to an integer, which can be converted into an integer in the range of [0, 65535] and then represented by a 2-byte integer. Compared with the original 4-byte floating point storage mode, 50% of the storage space is saved. Specifically, the point attribute value can be enlarged by 65535 times and then rounded to an integer, which can be converted into an integer in the range of [0, 65535] and then represented by a 2-byte integer. Specifically, the scaling multiple is determined based on the data characteristics of the reflectivity. Since the reflectivity is a floating point number in the range of [0, 1], if it needs to be expressed by a 2-byte integer, [0, 1] is enlarged to [0, 65535], and the maximum accuracy loss is 1 / 65535. The less the number of bytes used, the greater the accuracy loss.
[0116] Further, the bytes occupied by each offset value are calculated, wherein the mathematical expectation of the number of bytes occupied by each offset value is 0.83*1+(1-0.83)*2=1.17 bytes, and each point is composed of 1 byte of header information and 3 offset values, so the space occupied by each data point is 3*1.17+1=4.51 bytes, compared with the original data using 4 bytes of floating point number, 3*4=12 bytes are needed, that is, the storage space of the point cloud file after the current compression processing is only 4.51 / 12=37.5% of the original, which greatly reduces the storage space occupation.
[0117] In step S810, the number of bytes of the storage occupation bytes of each data point is stored in the corresponding header information, and the offset values of each data point in different dimensions and the corresponding point attribute values are respectively stored in the corresponding storage occupation bytes, to obtain the compressed point cloud file.
[0118] Specifically, the number of bytes of the storage occupation bytes of each data point is stored in the corresponding header information, the number of bytes occupied by the offset values of each data point in different dimensions is recorded through the header information, and the storage mode and the storage occupation bytes of the point attribute values of the data point are determined, and then the offset values of each data point in different dimensions and the corresponding point attribute values are respectively stored in the corresponding storage occupation bytes, to obtain the compressed point cloud file.
[0119] In this embodiment, the offset values between the data points in each data segment are amplified to obtain the range distribution of the amplified first offset values, and the offset values are further scaled according to the range distribution of the first offset values to obtain the range distribution of the scaled second offset values. Then, based on the range distribution of the second offset values, the corresponding variable-length integer storage processing mode is determined, and the storage occupation bytes of the offset values of each data point in different dimensions and the corresponding point attribute values in each data segment are determined according to the variable-length integer storage processing mode, to store the number of bytes of the storage occupation bytes of each data point in the corresponding header information, and store the offset values of each data point in different dimensions and the corresponding point attribute values in the corresponding storage occupation bytes, to obtain the compressed point cloud file. The multi-layer processing of the offset values is realized, including the offset value amplification processing, the scaling processing and the variable-length integer storage processing, to improve the data compression rate as much as possible, reduce the storage space occupation while maintaining the data accuracy, improve the storage space utilization efficiency, and reduce the performance overhead.
[0120] In one embodiment, as shown in Figure 10 , a point cloud file compression method is provided, as shown in Figure 10 , which specifically includes the following steps:
[0121] In step S1001, the point cloud file to be compressed is parsed to obtain a file composition structure of the point cloud file to be compressed, the file composition structure including first file header information and a first data part.
[0122] In step S1002, based on the first data part of the point cloud file to be compressed, data content in the point cloud file to be compressed is obtained, the data content including a plurality of continuous coordinate values and a plurality of continuous point attribute values.
[0123] In step S1003, an offset value between each data point in the data content and a coordinate value of a data point at a tail of each data storage queue is calculated respectively.
[0124] In step S1004, if the offset value is within a target offset value range, the data point is added to the tail of the corresponding data storage queue.
[0125] In step S1005, if the offset value is outside the target offset value range, a data storage queue is newly created, and the data point is added to the newly created data storage queue.
[0126] In step S1006, until the offset values between adjacent data points in each data storage queue are within the target offset value range, each data point in a same data storage queue is divided into a same data segment to obtain a plurality of data segments.
[0127] In step S1007, the offset values between the data points in each data segment are amplified to obtain a range distribution of amplified first offset values.
[0128] In step S1008, according to the range distribution of the first offset values, each offset value is scaled to obtain a range distribution of scaled second offset values.
[0129] In step S1009, based on the range distribution of the second offset values, a corresponding variable-length integer storage processing mode is determined.
[0130] In step S1010, according to the variable-length integer storage processing mode, storage occupying bytes of each data point in each data segment in different dimensions and corresponding point attribute values are determined.
[0131] In step S1011, byte numbers of the storage occupying bytes of each data point are stored in corresponding header information, and the offset values of each data point in different dimensions and the corresponding point attribute values are stored in corresponding storage occupying bytes respectively to obtain a compressed point cloud file.
[0132] In step S1012, the compressed point cloud file is output in a preset target format.
[0133] In the point cloud file compression method, the data content in the to-be-compressed point cloud file is obtained by analyzing the to-be-compressed point cloud file, and each data point is data-recombined based on the offset values between the data points in the data content until the offset values between adjacent data points in each data segment are within a target offset value range, to obtain a plurality of data segments. Further, the offset values of each data point in each data segment in different dimensions and the corresponding point attribute values are compressed by variable-length integer storage to obtain a compressed point cloud file. After the point cloud file is compressed, it is stored and fed back to the terminal device for application, which relieves the bandwidth pressure in the point cloud file transmission process, and also eliminates the need for specification conversion when using an open source library, reduces the complexity of the compression process, improves the point cloud file compression efficiency, and reduces the performance overhead.
[0134] In one embodiment, a point cloud file compression method is provided, which specifically includes the following parts:
[0135] P1, data analysis: analyzing a to-be-compressed binary t3m file, parsing the t3m file into a meaningful structure, i.e., obtaining the file composition structure of the t3m file, wherein the file composition structure includes first file header information and a first data part, the first file header information includes a plurality of field names, byte numbers corresponding to the field names, and field information, and the first data part can include coordinate information and point attribute information of each data point. Further, based on the first data part of the to-be-compressed point cloud file, the data content in the to-be-compressed point cloud file is obtained, and the obtained data content can include a plurality of continuous coordinate values and a plurality of continuous point attribute values.
[0136] P2, data reorganization: data-recombining the data content in the parsed first data part, and reorganizing the data content into a format more suitable for compression. Wherein, the idea of "base point + offset" is adopted, i.e., assuming that there is a line connecting all data in order, since the data points in the point cloud data are very dense and the distance between adjacent data points is very close, a base point can be stored, and then the offset value of each data point relative to the previous point is stored in turn, and the value range of the obtained offset value is much smaller than the value range of the data point coordinates.
[0137] The offset value between the coordinate values of each data point can be calculated, and the offset value of the data point can be stored instead of the actual coordinate value of the data point in a conventional manner, so as to reduce the storage space as much as possible, improve the transmission efficiency of the point cloud file, and reduce the performance consumption under the premise of ensuring the accuracy. Specifically, the data points can be reorganized by using the offset values between the data points, the data points are divided into multiple data segments by using a multi-level queue, and the offset values between adjacent data points in each data segment are within a target offset value range, so as to compress the offset values between the data points in each data segment and then store the data points.
[0138] Further, the offset value between the coordinate values of each data point in the data content and the coordinate values of the data point at the tail of each data storage queue is calculated, and it is determined whether the obtained offset value is within a target offset value range. If it is determined that the offset value between the coordinate values of a data point and the coordinate values of any data point at the tail of a data storage queue is within the target offset value range, the data point is added to the tail of the corresponding data storage queue as a new tail data point of the data storage queue.
[0139] Similarly, if the offset values between the coordinate values of a data point and the coordinate values of the data points at the tail of each data storage queue are all outside the target offset value range, it is indicated that the data point cannot be added to the tail of any data storage queue, and a corresponding data storage queue needs to be newly created for the data point, and the data point is added to the newly created data storage queue, that is, the data point is taken as a base point in the newly created data storage queue.
[0140] P3, data compression: first, the offset values between the data points in each data segment are amplified, for example, amplified by 1000 times, to obtain the range distribution of the amplified first offset values, that is, the offset values are within the range of [-32768, 32768], and therefore a 2-byte integer can be used to represent the offset values.
[0141] Secondly, by further analyzing the range distribution of the amplified first offset values, it is determined that 83% of the offset values in the range distribution of the first offset values are within the range of [-0.128m, 0.127m], and the offset values can be further scaled to obtain the range distribution of the scaled second offset values, that is, the scaled offset values are within the range of [-128, 127], and therefore a 1-byte integer can be used to represent the offset values, further reducing the storage space occupation.
[0142] Thirdly, based on the range distribution of the second offset value, a variable-length integer storage processing mode is determined, and according to the variable-length integer storage processing mode, the head information of each data point in different dimensions is set, the offset value of the data point on the x-axis coordinate, the offset value of the data point on the y-axis coordinate and the offset value of the data point on the z-axis coordinate are recorded in the head information, and the point attribute value is amplified and converted into an integer in the range of [0, 65535] to be represented by a 2-byte integer.
[0143] Further, by storing the byte number of the storage occupation bytes of each data point into the corresponding head information, the byte number of the offset value of each data point in different dimensions is recorded in the head information, and the storage mode of the point attribute value of the data point and the storage occupation byte number are determined, and then the offset value of each data point in different dimensions and the corresponding point attribute value are stored in the corresponding storage occupation byte to obtain the compressed point cloud file.
[0144] P4, format output: after obtaining the compressed point cloud file, the compressed point cloud file is output in a preset target format. The preset target format is a binary format, and the compressed point cloud file includes a second file header information and a second data part. The second file header information includes a data segment number indicating a decompression operation, and the second data part includes a plurality of continuous data segments. Each data segment includes a segment header information and a segment data part. The segment header information includes the number of points in the data segment, the coordinates of each dimension of the data point and the point attribute value. The segment data part includes offset information between a plurality of continuous data points. The offset information includes head information of variable-length integer storage processing, offset values of each adjacent data point in different dimensions and point attribute values of the corresponding data points.
[0145] Further, after obtaining the compressed point cloud file, the compressed point cloud file is transmitted to a terminal device, such as a smart vehicle device and a smart phone, to decompress the compressed point cloud file based on the smart vehicle device, obtain decompressed point cloud data, and further extract and analyze data based on the decompressed point cloud data to obtain navigation data for automatic driving or vehicle navigation in the field of map, and realize precise navigation.
[0146] In the above point cloud file compression method, the point cloud file is compressed and then stored and fed back to the terminal device for application, which relieves the bandwidth pressure in the point cloud file transmission process, and also eliminates the specification conversion when using the open source library, reduces the complexity of the compression process, improves the point cloud file compression efficiency, and reduces the performance overhead.
[0147] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.
[0148] Based on the same inventive concept, the embodiments of the present application also provide a point cloud file compression device for implementing the above-mentioned point cloud file compression method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more point cloud file compression device embodiments provided below can refer to the limitations of the point cloud file compression method in the above text, which will not be repeated here.
[0149] In one embodiment, as shown in Figure 11 A point cloud file compression device is provided, including a to-be-compressed file analysis module 1102, a data reorganization module 1104, and a compression processing module 1106, wherein:
[0150] The to-be-compressed file analysis module 1102 is configured to analyze a to-be-compressed point cloud file to obtain data content in the to-be-compressed point cloud file.
[0151] The data reorganization module 1104 is configured to perform data reorganization on each data point based on an offset value between the data points in the data content to obtain a plurality of data segments; and the offset value between adjacent data points in the data segment is within a target offset value range.
[0152] The compression processing module 1106 is configured to perform compression processing on the offset values in different dimensions of each data point in each data segment and the corresponding point attribute values by variable-length integer storage to obtain a compressed point cloud file.
[0153] In the point cloud file compression device, the data content in the to-be-compressed point cloud file is obtained by analyzing the to-be-compressed point cloud file, and each data point is reorganized based on the offset values between the data points in the data content until the offset values between adjacent data points in each data segment are within the target offset value range, thereby obtaining a plurality of data segments. Further, the offset values of each data point in each data segment in different dimensions and the corresponding point attribute values are compressed by variable-length integer storage, thereby obtaining a compressed point cloud file. After the point cloud file is compressed, it is stored and fed back to the terminal device for application, thereby relieving the bandwidth pressure in the point cloud file transmission process, and eliminating the need for specification conversion when using an open source library, thereby reducing the complexity of the compression process, improving the point cloud file compression efficiency, and reducing the performance overhead.
[0154] In one embodiment, the to-be-compressed file analysis module is further configured to analyze the to-be-compressed point cloud file to obtain a file composition structure of the to-be-compressed point cloud file, wherein the file composition structure comprises first file header information and a first data portion, the first file header information comprises a plurality of field names, byte numbers corresponding to the field names, and field information; and based on the first data portion of the to-be-compressed point cloud file, data content in the to-be-compressed point cloud file is obtained, wherein the data content comprises a plurality of continuous coordinate values and a plurality of continuous point attribute values.
[0155] In one embodiment, the data reorganization module is further configured to divide each data point with an offset value within the target offset value range into the same data segment according to the offset values between the data points in the data content, thereby obtaining a plurality of data segments, until the offset values between adjacent data points in each data segment are within the target offset value range.
[0156] In one embodiment, the data reorganization module is further configured to calculate the offset values between each data point in the data content and the coordinate values of the data points at the tail of each data storage queue, respectively; if the offset value is within the target offset value range, the data point is added to the tail of the corresponding data storage queue; if the offset value is outside the target offset value range, a new data storage queue is created, and the data point is added to the new data storage queue; until the offset values between adjacent data points in each data storage queue are within the target offset value range, each data point in the same data storage queue is divided into the same data segment, thereby obtaining a plurality of data segments.
[0157] In an embodiment, the compression processing module is further configured to: amplify the offset values between the data points in each data segment to obtain a range distribution of amplified first offset values; scale the offset values according to the range distribution of the first offset values to obtain a range distribution of scaled second offset values; determine a corresponding variable-length integer storage processing mode based on the range distribution of the second offset values; determine the storage occupying bytes of the offset values of the data points in each data segment in different dimensions and the corresponding point attribute values according to the variable-length integer storage processing mode; store the byte number of the storage occupying bytes of the data points into the corresponding header information, and store the offset values of the data points in different dimensions and the corresponding point attribute values into the corresponding storage occupying bytes respectively to obtain the compressed point cloud file.
[0158] In an embodiment, a point cloud file compression apparatus is provided, and further includes a file output module configured to output the compressed point cloud file in a preset target format; the preset target format is a binary format, and the compressed point cloud file includes a second file header information and a second data part; the second file header information includes a data segment number indicating a decompression operation, and the second data part includes a plurality of continuous data segments; each data segment includes a segment header information and a segment data part; the segment header information includes a point number in the data segment, the dimensional coordinates of the data points and the point attribute values; and the segment data part includes offset information between a plurality of continuous data points; the offset information includes header information of a variable-length integer storage processing, the offset values of each adjacent data point in different dimensions and the point attribute values of the corresponding data points.
[0159] The modules in the point cloud file compression apparatus described above can be all or partially implemented by software, hardware and combinations thereof. The modules described above can be embedded in or independent of a processor in a computer device in a hardware form, or stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform the operations corresponding to the modules.
[0160] In an embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in FIG. 6. Figure 12As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the compressed point cloud file, the data content of the compressed point cloud file, the data points, the offset values between the data points, the data segments, the target offset value range, the offset values of the data points in different dimensions, the point attributes and the compressed point cloud file and other data. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with the terminal outside through the network connection. The computer program is executed by the processor to realize a point cloud file compression method.
[0161] Those skilled in the art can understand that, Figure 12 The person skilled in the art can understand that,
[0162] In one embodiment, a computer device is also provided, including a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the steps in each method embodiment described above.
[0163] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by the processor to realize the steps in each method embodiment described above.
[0164] In one embodiment, a computer program product is provided, including a computer program, and the computer program is executed by the processor to realize the steps in each method embodiment described above.
[0165] 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. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, 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, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0166] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0167] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A point cloud file compression method, characterized by, The method comprises: parsing a to-be-compressed point cloud file to obtain data content in the to-be-compressed point cloud file; based on the offset values between the data points in the data content, reorganizing the data points to obtain a plurality of data segments; the offset values between adjacent data points in the data segment are within a target offset value range; performing compression processing on the offset values of the data points in each data segment in different dimensions and the corresponding point attribute values by variable-length integer storage to obtain a compressed point cloud file.
2. The method of claim 1, wherein, The method comprises: According to the offset values between the data points in the data content, the data points whose offset values are within the target offset value range are divided into the same data segment to obtain a plurality of data segments, until the offset values between adjacent data points in each data segment are within the target offset value range.
3. The method of claim 2, wherein, The method comprises: respectively calculating the offset values between the data points in the data content and the coordinate values of the data points at the tail of each data storage queue; if the offset value is within the target offset value range, the data point is added to the tail of the corresponding data storage queue; if the offset value is outside the target offset value range, a new data storage queue is created, and the data point is added to the new data storage queue; until the offset values between adjacent data points in each data storage queue are within the target offset value range, the data points in the same data storage queue are divided into the same data segment to obtain a plurality of data segments.
4. The method according to any one of claims 1 to 3, characterized in that, The method comprises: performing amplification processing on the offset values between the data points in each data segment to obtain the range distribution of the amplified first offset value; performing scaling processing on the offset values according to the range distribution of the first offset value to obtain the range distribution of the second offset value after scaling processing; determining the corresponding variable-length integer storage processing mode based on the range distribution of the second offset value; determining the storage byte occupancy of the offset values of the data points in each data segment in different dimensions and the corresponding point attribute values according to the variable-length integer storage processing mode; storing the byte number of the storage byte occupancy of each data point into the corresponding header information, and storing the offset values of each data point in different dimensions and the corresponding point attribute values into the corresponding storage byte occupancy, to obtain a compressed point cloud file.
5. The method according to any one of claims 1 to 3, characterized in that, The method comprises: The point cloud file to be compressed is parsed to obtain a file composition structure of the point cloud file to be compressed; the file composition structure comprises first file header information and a first data part, the first file header information comprises a plurality of field names, byte numbers corresponding to each of the field names, and field information; Based on the first data part of the point cloud file to be compressed, data content in the point cloud file to be compressed is obtained; the data content comprises a plurality of continuous coordinate values and a plurality of continuous point attribute values.
6. The method of claim 5, wherein, After the compression processing of the variable-length integer storage of the offset values of each of the data points in each of the data segments in different dimensions and the corresponding point attribute values is performed, the following is further included: The compressed point cloud file is output in a preset target format; The preset target format is a binary format, and the compressed point cloud file comprises second file header information and a second data part; the second file header information comprises a data segment number used to indicate a decompression operation, and the second data part comprises a plurality of continuous data segments; each of the data segments comprises segment header information and a segment data part, the segment header information comprises a point number in the data segment, coordinate values of each dimension of the data point, and a point attribute value, and the segment data part comprises offset information between a plurality of continuous data points; the offset information comprises header information of the variable-length integer storage processing, offset values of each of the adjacent data points in different dimensions, and point attribute values of the corresponding data points.
7. A point cloud file compression apparatus, characterized by, The device comprises: A point cloud file to be compressed is parsed to obtain data content in the point cloud file to be compressed; A data reorganization module is configured to perform data reorganization on each of the data points based on offset values between the data points in the data content to obtain a plurality of data segments; offset values between adjacent data points in the data segments are within a target offset value range; A compression processing module is configured to perform compression processing of variable-length integer storage of offset values of each of the data points in each of the data segments in different dimensions and corresponding point attribute values to obtain a compressed point cloud file.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Bitmap index compressing method and bitmap index decompressing method
CN103995887A
Point cloud compression
CN111095929A