Laser radar data coding compression system and method
By designing a lidar data encoding and compression system, using plane fitting and entropy coding technologies, the problems of low compression ratio and loss of data in the existing technology are solved, and efficient and reliable data compression and decompression effects are achieved.
Patent Information
- Application Number
- CN202411564307.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-03-04
AI Technical Summary
The existing lidar point cloud data compression method has low compression ratio and occupies a large resource. The compressed data is lossy and cannot be restored to the accuracy of the original data.
Design a lidar data encoding and compression system and method to achieve efficient data compression through steps such as data reception, preprocessing, plane fitting, encoding and serialization, entropy encoding and compression, and provide decompression functions to restore the original data.
It improves the compression ratio, reduces the burden of data transmission and storage, ensures data integrity and accuracy, and improves the real-time and response speed of the system.
Smart Images

Figure CN119557273A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of autonomous driving and relates to data processing for autonomous driving, and specifically to a laser radar data encoding and compression system and method. Background Art
[0002] Mechanical LiDAR and semi-solid-state LiDAR, as important components of modern perception technology, play a key role in fields such as autonomous driving. These two types of LiDAR devices can accurately construct a three-dimensional model of the surrounding environment, namely point cloud data, by emitting laser beams and receiving signals reflected by objects. These data contain rich spatial information, such as the position (x, y, z) coordinates, shape, size, etc. of the object. During the data acquisition process, the LiDAR device will transmit the scanned point cloud data to the processor through the network in real time for further processing. However, due to the large amount of data, especially high-resolution scanning or large-scale scene scanning, only part of the scanned sector data is sent at a certain moment. In order to alleviate this problem, data compression technology is usually used to reduce the amount of data.
[0003] At present, the mainstream data compression methods are mainly based on two-dimensional, three-dimensional, coding formats and special compression algorithms to compress point cloud data. In two-dimensional compression, point cloud data is projected onto a plane and then processed using image compression technology. Three-dimensional compression directly targets three-dimensional point cloud data and achieves compression by reducing the number of data points or reducing the accuracy of the data. Compression methods based on coding formats use specific coding rules to reduce data redundancy. Compression-based algorithms may combine multiple technologies, such as predictive coding, transform coding, etc., to achieve higher compression ratios.
[0004] In terms of coordinate system, point cloud data can usually be represented in Cartesian coordinate system (i.e. rectangular coordinate system) or spherical coordinate system. Cartesian coordinate system is the most commonly used coordinate system, which uses three mutually perpendicular axes (x, y, z) to represent the position of points. Spherical coordinate system is more suitable for representing spherical or nearly spherical objects, which uses three parameters: distance, azimuth and elevation to describe the position of points.
[0005] However, most of the above compression methods have some technical problems. First, compressed data is often lossy, that is, the compressed data cannot fully restore the accuracy and integrity of the original data. This may affect the subsequent data processing and analysis results. Secondly, the low compression ratio means that the amount of compressed data is still large, which cannot effectively reduce the burden of data transmission and storage. In addition, some compression methods also require more online computing resources, which may reduce the real-time performance and response speed of the system.
[0006] Therefore, when researching and developing lidar point cloud data compression technology, it is necessary to comprehensively consider multiple factors such as compression ratio, data integrity, and computational complexity in order to find an efficient and reliable compression method. At the same time, it is also necessary to select the most appropriate compression strategy and algorithm based on specific application scenarios and requirements. Summary of the invention
[0007] In view of the above problems, the main purpose of the present invention is to design a lidar data coding and compression system and method. Through the system's data receiving, pre-processing, compression and decompression functions, the technical problems of existing compression methods such as low compression ratio, large resource occupation, lossy compressed data and inability to restore the accuracy of the original data are solved.
[0008] In order to achieve the above purpose, the present invention adopts the following technical solutions: A laser radar data encoding and compression method, the method is used in a system for processing laser radar data, the system having data receiving, pre-processing, compression and decompression functions; The method comprises the following steps: The system receives radar scanning data and performs pre-processing; Generate range images from radar scanning data in an orderly manner and perform plane fitting; Encode and serialize the plane fitting results to complete the EncodePointCloud process; Compress the coded data by entropy coding; The system receives a user instruction, triggers a thread to operate according to the user instruction, stores the data compressed by entropy coding into a database, and obtains compressed data.
[0009] As a further description of the present invention, before receiving radar scanning data, the system is first initialized and fills in radar internal and external parameters, including calibration parameters and calibration parameters; a receiving thread is started to receive data generated by the radar scanning in real time to obtain data packets, and the data of each data packet includes real-time ranging information and reflection intensity information.
[0010] As a further description of the present invention, the radar scanning data is parsed to obtain data content including azimuth angle information; According to the parsed data content, the current scanning sector is clarified, including rows and columns; According to the row and column information and the offset of the current code, the ranging information of the radar scanning data is filled into the corresponding range image frame by frame. When a frame scan is completed and the offset of the code reaches the set value, the current range image cycle has been filled.
[0011] As a further description of the present invention, after a range image is filled, it is processed to generate a range image for analysis or display, including the following steps: Extract data of any frame in the range image to perform plane fitting calculation, and evenly divide the extracted data into set unit blocks; Fit a plane to the points in the first tile; Gradually expand the block range to include adjacent blocks, and after each block expansion, make a fitting validity judgment; Repeat the block enlargement and judgment until all blocks in the distance image are processed; The fitting ratio is used to determine whether all distance images need to be fitted. The fitting ratio is the ratio of successfully encoded blocks to the total number of blocks. If the fitting ratio is greater than 25%, it is considered that the plane fitting effect in the current distance image is good and all distance images can be fitted. Otherwise, no fitting is performed.
[0012] As a further description of the present invention, the fitting validity is judged as follows: whether the currently fitted plane can effectively encode all points in the enlarged block under the resolution threshold; if so, the block range can be further expanded, and all points in the enlarged block can be encoded using the currently fitted plane; if not, the plane fitting is performed again starting from the current block.
[0013] As a further description of the present invention, the encoding and serialization of the plane fitting results includes the following steps: Through the plane fitting results of the range image, the data to be encoded is obtained, including fitting parameters, original occupied points, tile fitting status, and range image; The fitting results are stored in the fitting parameters. The original occupied points are stored using b_occ_map, where each bit represents whether the position has a value. The tile fitting status is stored using b_fit_map, which represents whether the tile has been fitted. The data that does not need to be fitted is stored in the range image. There is no need to store the fitting parameters, the original occupied points, and the tile fitting status. In this case, the fields related to fitting are empty or undefined. Once all the data that needs to be encoded is stored, the EncodePointCloud process is completed; Convert the encoded data structure into a byte stream or string format to obtain serialized data.
[0014] As a further description of the present invention, the entropy coding compression process includes the following steps: Select the zstd compression method and set the compression level; According to the statistical characteristics of the data, the zstd compression method assigns codes of different lengths to different data; Compress the data generated by the EncodePointCloud process using the zstd compression method and the set compression level; After compression is completed, the compressed data is placed in a ring buffer queue.
[0015] As a further description of the present invention, the above method also includes data decompression, and the data decompression process is the reverse operation of the above compression method; First, restore the fitting point data, and then restore the distance image; The restored fitting point data is merged with the range image to reconstruct the original point cloud data of the radar.
[0016] A laser radar data coding and compression system, which is used to execute the above-mentioned data coding and compression method, comprises a data receiving module, a pre-processing module, a compression module and a decompression module; The data receiving module is used to accept user instructions and receive data generated by radar scanning in real time through a receiving thread; The pre-processing module is used for system initialization and filling in radar internal and external parameters, including calibration parameters and calibration parameters; The compression module is used to generate a range image from the radar scanning data and perform plane fitting; encode and serialize based on the plane fitting result to complete the EncodePointCloud process; and compress the encoded data by entropy coding to obtain compressed data; The decompression module is used to perform the reverse operation of the compression module to decompress the compressed data to obtain the original point cloud data of the radar.
[0017] Compared with the prior art, the technical effects of the present invention are: The present invention provides a laser radar data encoding and compression system and method. The system includes a data receiving module, a pre-processing module, a compression module and a decompression module. The method is used in a system for processing laser radar data, including receiving radar scanning data and performing pre-processing, orderly generating a distance image from the radar scanning data, performing plane fitting, encoding and serializing the plane fitting result, completing the EncodePointCloud process, compressing the encoded data through entropy coding, receiving user instructions through the system, triggering a thread to operate according to the user instructions, storing the data compressed by the entropy coding into a database, and obtaining the compressed data; and decompressing the compressed data through the reverse operation of the above compression method according to demand, using the spherical coordinate system 2D storage overhead is small, adjacent coil scanning distance data is close, and a dynamic fitting method is used to achieve the purpose of high real-time compression efficiency and high CPU utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1It is a schematic diagram of the overall method flow of the present invention; Figure 2 It is a timing diagram of the overall method of the present invention; Figure 3 It is a schematic diagram of filling the distance image of the present invention; Figure 4 The data structure defined for use with protobuf. DETAILED DESCRIPTION
[0019] The present invention is described in detail below in conjunction with the accompanying drawings: In one embodiment of the present invention, a laser radar data encoding and compression method is disclosed, referring to Figure 1-3 As shown, the method is used in a system for processing laser radar data, the system having data receiving, pre-processing, compression and decompression functions; the process includes: receiving radar scanning data and pre-processing, data processing, generating range images, encoding and serialization, entropy coding compression, storing compressed data, and data decompression; specifically, the method includes the following steps: The system receives radar scanning data and performs pre-processing; Generate range images from radar scanning data in an orderly manner and perform plane fitting; Encode and serialize the plane fitting results to complete the EncodePointCloud process; Compress the coded data by entropy coding; The system receives a user instruction, triggers a thread to operate according to the user instruction, stores the data compressed by entropy coding into a database, and obtains compressed data; The compressed data is decompressed by the reverse operation of the above compression method.
[0020] Specifically, in this embodiment, before the system receives radar scanning data, it first performs initialization and fills in the internal and external parameters of the radar, including but not limited to calibration parameters and calibration parameters; starts a receiving thread to receive the data generated by the radar scanning in real time to obtain data packets, and the data of each data packet includes real-time ranging information and reflection intensity information.
[0021] Parse the radar scanning data to obtain data content containing azimuth angle information; clarify the current scanning sector, including rows and columns, based on the parsed data content; fill the ranging information of the radar scanning data into the corresponding range image frame by frame based on the row and column information and the offset of the current code. When a frame scan is completed and the offset of the code reaches the set value, the current range image period has been filled.
[0022] For example, a range image takes 10 frames of scan data, with an offset of [1,10], where 1 is the start and 10 is the end. If the offset is already 10, the current range image is already filled, and the next range image will be filled. Figure 3 The AT128 is shown with 1300 columns and 128 rows of distance image fill.
[0023] In this embodiment, after a distance image is filled, it is processed to generate a distance image for analysis or display, including the following steps: Extract data of any frame in the range image to perform plane fitting calculation, and evenly divide the extracted data into set unit blocks; Fit a plane to the points in the first tile; Gradually expand the block range to include adjacent blocks, and after each block expansion, make a fitting validity judgment; Repeat the block enlargement and judgment until all blocks in the distance image are processed; The fitting ratio is used to determine whether all distance images need to be fitted. The fitting ratio is the ratio of successfully encoded blocks to the total number of blocks. If the fitting ratio is greater than 25%, it is considered that the plane fitting effect in the current distance image is good and all distance images can be fitted. Otherwise, no fitting is performed.
[0024] As mentioned above, 10 frames of scanning data are taken from one distance image. If one frame of scanning is completed (frame division is completed) and the number of encoded offsets reaches 10, it is considered that one distance image is filled, and the first frame (or any frame) of data is extracted for plane fitting calculation. In this embodiment, the sampled data is evenly divided into 4×4 unit blocks, and the linear least squares method is used to calculate the closed-form solution to obtain the fitting parameters.
[0025] It should be noted that the above-mentioned fitting validity judgment is: to judge whether the currently fitted plane can effectively encode all points in the enlarged block under the resolution threshold; if so, the block range can be further expanded, and all points in the enlarged block can be encoded with the currently fitted plane; if not, the plane fitting is re-performed starting from the current block.
[0026] In this embodiment, the encoding and serialization of the above plane fitting results include the following steps: Through the plane fitting results of the range image, the data to be encoded is obtained, including fitting parameters, original occupied points, tile fitting status, and range image; The fitting results are stored in the fitting parameters (FittingParameters); the original occupied points are stored using b_occ_map, where each bit represents whether there is a value at that position; the tile fitting status is stored using b_fit_map, which represents whether the tile has been fitted; The data that does not need to be fitted is stored in the range image. There is no need to store the fitting parameters, the original occupied points, and the tile fitting status. In this case, the fields related to fitting are empty or undefined. Once all the data that needs to be encoded is stored, the EncodePointCloud process is completed; Convert the encoded data structure into a byte stream or string format to obtain serialized data.
[0027] In this embodiment, the entropy coding compression process includes the following steps: Select the zstd compression method and set the compression level. In this embodiment, the compression level is set to the lowest level 1; According to the statistical characteristics of the data, the zstd compression method assigns codes of different lengths to different data; Compress the data generated by the EncodePointCloud process using the zstd compression method and the set compression level; After compression is completed, the compressed data is placed in a ring buffer queue.
[0028] To store compressed data, the trigger thread will receive user instructions and store the data in the ring buffer queue into the database if it needs to be stored on disk.
[0029] In this embodiment, the data decompression process is the reverse operation of the above compression method; First, restore the fitting point data, and then restore the distance image; The restored fitting point data is merged with the range image to reconstruct the original point cloud data of the radar.
[0030] like Figure 4 The data structure shown in the figure takes protobuf as an example. Its code is the message structure defined by protocol buffers (protobuf), which is used to describe the various parameters and metadata required in the encoding and compression process of lidar data. Through these data structures, the point cloud data generated by the lidar and the calibration and calibration information related thereto can be effectively organized and stored.
[0031] CorrectionData message: sensor_type: An optional field used to specify the sensor type; lidar_correction: an optional byte sequence field used to store radar calibration parameters; transformation: an optional Transformation message field used to store calibration parameters; horizons: A repeated floating point field used to store the horizontal azimuth angle; elevations: A repeated floating point field storing the vertical elevation angle.
[0032] RangeMap Message: MetaInfo message: header: an optional header message field, usually containing information such as timestamp; block_delta_time: a repeated integer field that stores the time difference between each data block and header.time_meas in microseconds; block_angle: a repeated integer field storing the rotation angle, which may be the horizontal rotation angle or the prism angle of a solid-state lidar; block_pitch: a repeated integer field that stores the pitch angle of the sector; block_status: a repeated integer field used to store the sector status, possibly used for sector angle calibration; meta_infos: A repeated MetaInfo message field, each point cloud data corresponds to a metadata information; distances: a repeated unsigned integer field that stores distance measurement data; intensitys: A repeated unsigned integer field that stores reflection intensity data.
[0033] FittingParameters message: factors_a, factors_b, factors_c, factors_d: four repeated floating-point fields used to store fitting coefficients; fit_lengths: A repeated unsigned integer field that stores the length of the fitting block.
[0034] EncodePointCloud message: range_map: an optional RangeMap message field used to store range map data; fitting_parameters: an optional FittingParameters message field used to store fitting parameters; b_occ_map: a repeated unsigned integer field that stores occupancy table data; b_fit_map: A repeated Boolean field that stores the grid fit table data.
[0035] In another embodiment of the present invention, a laser radar data coding and compression system is disclosed, which is used to execute the above-mentioned data coding and compression method, and includes a data receiving module, a pre-processing module, a compression module and a decompression module; The data receiving module is used to accept user instructions and receive data generated by radar scanning in real time through a receiving thread; The pre-processing module is used for system initialization and filling in radar internal and external parameters, including calibration parameters and calibration parameters; The compression module is used to generate a range image from the radar scanning data and perform plane fitting; encode and serialize based on the plane fitting result to complete the EncodePointCloud process; and compress the encoded data by entropy coding to obtain compressed data; The decompression module is used to perform the reverse operation of the compression module to decompress the compressed data to obtain the original point cloud data of the radar.
[0036] The technical solution of the present invention is disclosed through the above embodiments. Compared with the prior art, the present invention utilizes the spherical coordinate system with low 2D storage overhead, close adjacent coil scanning distance data, and dynamic fitting to achieve high real-time compression efficiency and high CPU utilization.
[0037] The above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Other modifications or equivalent substitutions made to the technical solution of the present invention by ordinary technicians in this field should be included in the scope of the claims of the present invention as long as they do not depart from the spirit and scope of the technical solution of the present invention.
Claims
1. A laser radar data encoding and compression method, characterized in that: The method is used in a system for processing laser radar data, wherein the system has data receiving, pre-processing, compression and decompression functions; The method comprises the following steps: The system receives radar scanning data and performs pre-processing; Generate range images from radar scanning data in an orderly manner and perform plane fitting; Encode and serialize the plane fitting results to complete the EncodePointCloud process; Compress the coded data by entropy coding; The system receives a user instruction, triggers a thread to operate according to the user instruction, stores the data compressed by entropy coding into a database, and obtains compressed data.
2. A laser radar data encoding and compression method according to claim 1, characterized in that: Before receiving radar scanning data, the system is initialized and fills in radar internal and external parameters, including calibration parameters and calibration parameters; a receiving thread is started to receive data generated by radar scanning in real time to obtain data packets, and the data of each data packet includes real-time ranging information and reflection intensity information.
3. The laser radar data encoding and compression method according to claim 1, characterized in that: Analyze the radar scanning data to obtain the data content including azimuth angle information; According to the parsed data content, the current scanning sector is clarified, including rows and columns; According to the row and column information and the offset of the current code, the ranging information of the radar scanning data is filled into the corresponding range image frame by frame. When a frame scan is completed and the offset of the code reaches the set value, the current range image cycle has been filled.
4. The laser radar data encoding and compression method according to claim 3, characterized in that: After a range image is filled, it is processed to generate a range image for analysis or display, including the following steps: Extract data of any frame in the range image to perform plane fitting calculation, and evenly divide the extracted data into set unit blocks; Fit a plane to the points in the first tile; Gradually expand the block range to include adjacent blocks, and after each block expansion, make a fitting validity judgment; Repeat the block enlargement and judgment until all blocks in the distance image are processed; The fitting ratio is used to determine whether all distance images need to be fitted. The fitting ratio is the ratio of successfully encoded blocks to the total number of blocks. If the fitting ratio is greater than 25%, it is considered that the plane fitting effect in the current distance image is good and all distance images can be fitted. Otherwise, no fitting is performed.
5. The laser radar data encoding and compression method according to claim 4, characterized in that: The validity of the fitting is judged as follows: whether the currently fitted plane can effectively encode all points in the enlarged block under the resolution threshold; if so, the block range can be further expanded, and all points in the enlarged block can be encoded using the currently fitted plane; if not, the plane fitting is performed again starting from the current block.
6. The laser radar data encoding and compression method according to claim 1, characterized in that: The encoding and serialization of plane fitting results includes the following steps: Through the plane fitting results of the range image, the data to be encoded is obtained, including fitting parameters, original occupied points, tile fitting status, and range image; The fitting results are stored in the fitting parameters. The original occupied points are stored using b_occ_map, where each bit represents whether the position has a value. The tile fitting status is stored using b_fit_map, which represents whether the tile has been fitted. The data that does not need to be fitted is stored in the range image. There is no need to store the fitting parameters, the original occupied points, and the tile fitting status. In this case, the fields related to fitting are empty or undefined. Once all the data that needs to be encoded is stored, the EncodePointCloud process is completed; Convert the encoded data structure into a byte stream or string format to obtain serialized data.
7. The laser radar data encoding and compression method according to claim 1, characterized in that: The entropy coding compression process includes the following steps: Select the zstd compression method and set the compression level; According to the statistical characteristics of the data, the zstd compression method assigns codes of different lengths to different data; Compress the data generated by the EncodePointCloud process using the zstd compression method and the set compression level; After compression is completed, the compressed data is placed in a ring buffer queue.
8. The laser radar data encoding and compression method according to claim 1, characterized in that: It also includes data decompression, and the data decompression process is the reverse operation of the above compression method; First, restore the fitting point data, and then restore the distance image; The restored fitting point data is merged with the range image to reconstruct the original point cloud data of the radar.
9. A laser radar data coding compression system according to the compression method according to any one of claims 1 to 8, characterized in that: The system includes a data receiving module, a pre-processing module, a compression module and a decompression module; The data receiving module is used to accept user instructions and receive data generated by radar scanning in real time through a receiving thread; The pre-processing module is used for system initialization and filling in radar internal and external parameters, including calibration parameters and calibration parameters; The compression module is used to generate a range image from the radar scanning data and perform plane fitting; encode and serialize based on the plane fitting result to complete the EncodePointCloud process; and compressing the encoded data by entropy coding to obtain compressed data; The decompression module is used to perform the reverse operation of the compression module to decompress the compressed data to obtain the original point cloud data of the radar.