Mobile vehicle height real-time detection method based on two-dimensional laser radar
The mobile vehicle height detection method using two-dimensional lidar solves the problems of existing systems being unable to provide complete vehicle information and being susceptible to environmental interference. It achieves high-precision, low-cost real-time detection and early warning, and is applicable to various traffic management scenarios.
Patent Information
- Application Number
- CN202511883532.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-02-17
AI Technical Summary
Existing ultra-high altitude detection systems cannot provide complete information about vehicle outlines, are susceptible to interference from environmental factors, and lack efficient and accurate detection models and real-time early warning mechanisms.
A real-time vehicle height detection method based on two-dimensional lidar is adopted. Through data acquisition, preprocessing, vertical line segment extraction and height calculation, the vertical line segments of the vehicle outline are screened using the X-axis bucket method, and real-time data storage and early warning are achieved by combining the MQTT protocol.
It achieves high-precision, low-cost vehicle height detection, has strong anti-interference capabilities, is suitable for various scenarios, meets real-time detection requirements, and reduces system false detection rate and maintenance costs.
Smart Images

Figure CN121541173A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of road traffic management technology, and in particular relates to a method for real-time detection of the height of moving vehicles based on two-dimensional lidar. Background Technology
[0002] In road traffic management, vehicles exceeding height limits are a common traffic safety hazard. When oversized vehicles pass through tunnels, bridges, or height-restricted areas, they may cause infrastructure damage or lead to serious traffic accidents. Currently, common methods for detecting oversized vehicles include physical height restriction barriers, photoelectric sensors, and lidar technology.
[0003] Traditional height detection systems mostly use fixed-installation ultrasonic or infrared sensors. These systems can only detect the height at a specific location, cannot provide complete information about the vehicle's outline, and are susceptible to interference from environmental factors such as wind, rain, and fog. While video image recognition technology can provide more information, its recognition performance is poor in low-light conditions. Furthermore, existing LiDAR applications lack sufficient research on vehicle height detection algorithms for specific scenarios, and lack efficient and accurate detection models and real-time early warning mechanisms. Summary of the Invention
[0004] Given the limitations of traditional ultra-high vehicle height detection systems, which cannot provide complete information about vehicle outlines and are susceptible to interference from environmental factors such as wind, rain, and fog, and the poor performance of video image recognition technology under poor lighting conditions, as well as the lack of research on vehicle ultra-high vehicle height detection algorithms for specific scenarios in existing LiDAR application solutions, and the absence of efficient and accurate detection models and real-time early warning mechanisms, this invention proposes a real-time mobile vehicle height detection method based on two-dimensional LiDAR.
[0005] This invention proposes a method for real-time detection of the height of a moving vehicle based on two-dimensional lidar. The method includes the following steps: Step S1: Data Acquisition: Obtain point cloud data by scanning with a two-dimensional lidar. Install the two-dimensional lidar device at a predetermined height position, making its scanning plane perpendicular to the ground. Set the data receiving module to receive the point cloud data sent by the lidar via the UDP protocol and parse it. Each data packet contains polar coordinate information of multiple ranging points. Step S2: Data preprocessing: The point cloud data is converted from polar coordinates to rectangular coordinates using the point cloud processing module, and valid point cloud data within the spatial range is filtered. Step S3: Vertical line segment extraction: Set up a vertical line segment extraction module and use the X-axis bucketing method to extract vertical line segments representing the vehicle outline; Step S4: Height Calculation: Set up the height calculation module to calculate the vertical segment height of the vehicle based on the extracted vertical segment and the radar installation height; Step S5: Data storage: Set up a data storage unit to store the detection results in the database.
[0006] Preferably, in step S2, the acquired polar coordinate data is converted into coordinate points in a rectangular coordinate system. The polar coordinate data includes angle θ and distance r, and the coordinate points include x and y. The conversion formula is as follows: x = -r·cos(θ); y = r·sin(θ); Where x represents the horizontal distance and y represents the height offset relative to the radar horizontal plane.
[0007] Preferably, in step S3, the specific steps of the X-axis binning method are as follows: 1) Divide the x-axis into multiple buckets with a width of ΔW; 2) Assign all points to the buckets according to their x-coordinates; 3) Calculate the number of points in each bucket and select the bucket with the most points as the candidate bucket; 4) Determine the perpendicular line segments for the point set in the candidate bucket; 5) If conditions 1)-4) above are met, sort the point set according to the y-coordinate; 6) Filter points with large height differences between adjacent points to ensure line segment continuity.
[0008] Preferably, the vertical line segment determination step is as follows: a. Check if the number of points meets the minimum requirement; the point threshold is... ; b. Calculate the height range of the point set inside the bucket; c. Check if h meets the minimum height requirement. The minimum height threshold is... ; d. Check whether the percentage of points below radar height meets the requirements.
[0009] Preferably, in step S4, the vehicle height is calculated based on the extracted vertical line segments using the following formula: H = + ; Where H is the vehicle height. The radar is installed at a height of y, and ymax is the maximum y-coordinate value in the vertical line segment.
[0010] Preferably, in step S5, the detection results include vehicle position, height, and detection time. The database publishes relevant information via the MQTT protocol for external system linkage.
[0011] Preferably, the criteria for filtering the valid point cloud data are as follows: xmin <x<xmax; Where xmin is the minimum horizontal distance and xmax is the maximum horizontal distance.
[0012] Preferably, the calculation formula for the X-axis binning method is as follows: bin_index=floor((x-xmin) / ); in The floor function is a mathematical function that rounds down to the nearest integer, and is used to define the preset bucket width. The formula for calculating the height of the vertical line segment is as follows: h = ymax - ymin; Where ymax and ymin are the maximum and minimum y coordinates of the point set inside the bucket, respectively; The formula for calculating the percentage of points below radar altitude is as follows: =count(points[y<0]) / count(points); Among them, it is necessary to ≥MIN_BELOW_LIDAR_POINTS_RATIO, the count function is a mathematical function that counts the number of numeric data in the parameter list; MIN_BELOW_LIDAR_POINTS_RATIO is the default value.
[0013] Preferably, the method for determining the continuity of heights between adjacent points is as follows: |y[i]-y[i-1]|≤Δ Δ This is the preset threshold for the maximum height difference between adjacent points.
[0014] Compared with the prior art, the beneficial effects of the present invention are: 1. The present invention simplifies the technology and reduces costs. Compared with existing three-dimensional lidar or multi-line lidar detection systems, the present invention can achieve high-precision vehicle height detection using only a single-line two-dimensional lidar, significantly reducing equipment costs. In actual detection scenarios, the height measurement accuracy of this method is comparable to that of more expensive equipment, meeting practical application needs.
[0015] 2. The algorithm of this invention improves efficiency. The X-axis bucketing method significantly reduces computational complexity, reducing the quadratic complexity of the traditional algorithm to linear complexity, and greatly shortening the processing time. In experimental tests, the point cloud data processing speed is sufficient to support high-frequency real-time detection requirements, which is far superior to the processing latency of traditional methods.
[0016] 3. The anti-interference ability of the present invention is enhanced. The innovative vertical line segment screening mechanism significantly reduces the false detection rate of the system. The vertical line segment screening mechanism includes minimum point number requirements, low point ratio screening, and adjacent point height difference limitation. Even under adverse weather conditions, the detection accuracy can still be maintained at a high level.
[0017] 4. The present invention has good adaptability and is easy to maintain. Through parameter configuration, the system can be applied to various scenarios such as highways, warehousing logistics, and underground garages. The single-line two-dimensional lidar has a simple structure, a long outdoor service life, and does not require an external light source, so it can work all day long, and its maintenance cost is lower than that of vision-based detection systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flowchart of a method for real-time detection of the height of a moving vehicle based on a two-dimensional lidar proposed by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0019] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments.
[0020] Refer to Figure 1 , a method for real-time detection of the height of a moving vehicle based on a two-dimensional lidar, the method for real-time detection of the height of a moving vehicle includes the following steps: Step S1: Data acquisition: Obtain point cloud data by scanning with a two-dimensional lidar. The two-dimensional lidar is a single-line two-dimensional lidar. Install the two-dimensional lidar device at a predetermined height position so that its scanning plane is perpendicular to the ground. Set the data receiving module to receive the point cloud data sent by the lidar through the UDP protocol and parse it. Each data packet contains the polar coordinate information of multiple ranging points. The polar coordinate information includes the angle θ and the distance r. The lidar device continuously scans the environment at a fixed frequency (such as 10Hz or 20 - 30Hz) to generate a point cloud data stream. The effective point cloud screening condition is xmin < x < xmax, where xmin is the minimum horizontal distance, xmax is the maximum horizontal distance, and xmin and xmax are the minimum and maximum values in the actual road width range.
[0021] Step S2: Data preprocessing: Convert the point cloud data from the polar coordinate system to the rectangular coordinate system through the point cloud processing module, and screen the effective point cloud data within the spatial range. Convert the obtained polar coordinate data (θ, r) into coordinate points (x, y) in the rectangular coordinate system. The conversion formula is: x = -r·cos(θ); y = r·sin(θ); Where x represents the horizontal distance and y represents the height offset relative to the radar horizontal plane. Depending on the actual installation, the y-axis direction can be adjusted by adjusting the parameters, and then the point cloud data within the effective detection range can be filtered out, while invalid points outside the detection range can be removed. The criteria for selecting valid point cloud data are as follows: xmin <x<xmax; Where xmin is the minimum horizontal distance and xmax is the maximum horizontal distance.
[0022] Step S3: Vertical line segment extraction: Set up the vertical line segment extraction module and use the X-axis bucketing method to extract the vertical line segments representing the vehicle outline. The specific steps are as follows: 1) Divide the x-axis into multiple buckets with a width of ΔW (e.g., 0.5 meters); 2) Assign all points to the buckets according to their x-coordinates; 3) Calculate the number of points in each bucket and select the bucket with the most points as the candidate bucket; 4) Perform perpendicular line segment determination on the point set in the candidate bucket. The method for determining perpendicular line segments is as follows: a. Check if the number of points meets the minimum requirement (e.g., ≥5 points). The point threshold is... ; b. Calculate the height range of the point set inside the bucket. The calculation formula is h=ymax-ymin, where ymax and ymin are the maximum and minimum y coordinates of the point set inside the bucket, respectively. c. Check if h meets the minimum height requirement (e.g., ≥1 meter). The minimum height threshold is... ; d. Check whether the percentage of points below radar height meets the requirements (e.g., ≥60%). 5) If conditions 1)-4) above are met, sort the point set according to the y-coordinate; 6) Filter points with large height differences between adjacent points to ensure line segment continuity.
[0023] The formula for calculating the X-axis bucket division is as follows: bin_index=floor((x-xmin) / ); in The floor function is a mathematical function that rounds down to the nearest integer, and is used to define the preset bucket width. The formula for calculating the percentage of points below radar altitude is as follows: =count(points[y<0]) / count(points); Among them, it is necessary to ≥MIN_BELOW_LIDAR_POINTS_RATIO, the count function is a mathematical function that counts the number of numeric data in the parameter list; MIN_BELOW_LIDAR_POINTS_RATIO is a preset value, which is a preset value based on the data fed back by the radar detecting the vehicle, for example, 0.6; The method for determining the continuity of height between adjacent points is as follows: |y[i]-y[i-1]|≤Δ Δ This is the preset threshold for the maximum height difference between adjacent points.
[0024] Step S4: Height Calculation: Set up the height calculation module to calculate the vehicle's vertical segment height based on the extracted vertical line segments and the radar installation height. The vehicle height calculation formula is: H = +ymax, where H is the vehicle height. The radar installation height is ymax, and the maximum y-coordinate value in the vertical line segment is ymax. The distance between the ground and the top of the vehicle, i.e., the vehicle height, is obtained by adding the radar installation height to the maximum value ymax detected and filtered. ymax is the measured value of the range between the radar and the top of the vehicle.
[0025] Step S5: Data storage: Set up a data storage unit to store the detection results in the database. The detection results include vehicle location, height, and detection time. The database is a time-series database, which can be InfluxDB. Relevant information can be published via the MQTT protocol for external system linkage. The communication unit is responsible for data transmission between modules within the system and data interaction with external systems.
[0026] This method includes a data acquisition unit, a data processing unit, a communication unit, and a parameter configuration unit. The data processing unit includes a data receiving module, a point cloud processing module, a vertical line segment extraction module, a height calculation module, and a data storage unit.
[0027] By using two-dimensional lidar to detect the height of moving vehicles in real time and through distributed data storage and message notification mechanisms, timely warnings can be issued for vehicles that exceed height limits. This significantly improves traffic safety management efficiency and reduces the risk of safety accidents caused by vehicles exceeding height limits. It does not require complex three-dimensional point cloud processing equipment and algorithms; it can be achieved using only a single-line two-dimensional lidar. It features low cost, high accuracy, and good real-time performance, and is suitable for various scenarios that require vehicle height monitoring. Example
[0028] A two-dimensional lidar sensor is installed on a cable tray in front of highway toll stations or height-restricted areas. Assuming the radar is installed at a height of 3.44 meters, the system automatically detects the vehicle's height when it passes through the monitoring area. If the system detects that the vehicle's height exceeds the height limit (e.g., 4 meters), it will issue a real-time warning, guiding the oversized vehicle to detour or stop for inspection.
[0029] The specific triggering process of this method is as follows: 1. The radar scans at a frequency of 10Hz to acquire point cloud data along the vertical scan line; 2. Receive data via UDP and convert it to Cartesian coordinates; 3. Filter point cloud data within a range of 1-20 meters; 4. Use the X-axis binning method (e.g., bin width 0.5 meters) to process point clouds; 5. Extract vertical line segments from the bucket with the most points: a. The bucket must contain at least 5 points; b. The height of the line segment must be at least 1 meter; c. At least 60% of the points are located below radar altitude; d. The height difference between adjacent points does not exceed 1 meter; 6. Calculate the vehicle height; 7. If H > 4 meters, an over-altitude warning will be triggered; 8. Store the detection results and timestamps in the time series database; 9. Publish early warning information via the MQTT protocol. Example
[0030] Used for height monitoring in warehousing and logistics, two-dimensional LiDAR is installed in warehouse aisles or loading and unloading areas to monitor the loading height of forklifts or transport vehicles. When the height of the goods exceeds the safety limit, the system automatically alerts the operators to prevent collision accidents.
[0031] The extraction of vertical line segments employs more stringent parameter settings, and the system's triggering process is as follows: 1. Perform bucketing on point clouds with horizontal distances ranging from 0.5 to 15 meters; 2. Each vertical line segment must contain at least 8 points; 3. The height difference between adjacent points shall not exceed 0.5 meters; 4. Cargo height calculation formula: H= + -y ground correction; 5. When H exceeds the channel height limit, an audible and visual alarm will alert the operator.
[0032] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for real-time detection of the height of a moving vehicle based on two-dimensional lidar, characterized in that, The real-time height detection method for moving vehicles includes the following steps: Step S1: Data Acquisition: Obtain point cloud data by scanning with a two-dimensional lidar. Install the two-dimensional lidar device at a predetermined height position, making its scanning plane perpendicular to the ground. Set the data receiving module to receive the point cloud data sent by the lidar via the UDP protocol and parse it. Each data packet contains polar coordinate information of multiple ranging points. Step S2: Data preprocessing: The point cloud data is converted from polar coordinates to rectangular coordinates using the point cloud processing module, and valid point cloud data within the spatial range is filtered. Step S3: Vertical line segment extraction: Set up a vertical line segment extraction module and use the X-axis bucketing method to extract vertical line segments representing the vehicle outline; Step S4: Height Calculation: Set up the height calculation module to calculate the vertical segment height of the vehicle based on the extracted vertical segment and the radar installation height; Step S5: Data storage: Set up a data storage unit to store the detection results in the database.
2. The method for real-time detection of the height of a moving vehicle based on two-dimensional lidar according to claim 1, characterized in that, In step S2, the acquired polar coordinate data is converted into coordinate points in a rectangular coordinate system. The polar coordinate data includes angle θ and distance r, and the coordinate points include x and y. The conversion formula is as follows: x = -r·cos(θ); y = r·sin(θ); Where x represents the horizontal distance and y represents the height offset relative to the radar horizontal plane.
3. The method for real-time detection of the height of a moving vehicle based on two-dimensional lidar according to claim 1, characterized in that, In step S3, the specific steps of the X-axis binning method are as follows: 1) Divide the x-axis into multiple buckets with a width of ΔW; 2) Assign all points to the buckets according to their x-coordinates; 3) Calculate the number of points in each bucket and select the bucket with the most points as the candidate bucket; 4) Determine the perpendicular line segments for the point set in the candidate bucket; 5) If conditions 1)-4) above are met, sort the point set according to the y-coordinate; 6) Filter points with large height differences between adjacent points to ensure line segment continuity.
4. The method for real-time detection of the height of a moving vehicle based on a two-dimensional lidar according to claim 3, characterized in that, The steps for determining the vertical line segment are as follows: a. Check if the number of points meets the minimum requirement; the point threshold is... ; b. Calculate the height range of the point set inside the bucket; c. Check if h meets the minimum height requirement. The minimum height threshold is... ; d. Check whether the percentage of points below radar height meets the requirements.
5. The method for real-time detection of the height of a moving vehicle based on a two-dimensional lidar according to claim 1, characterized in that, In step S4, the vehicle height is calculated based on the extracted vertical line segments. The specific calculation formula is: H = + ; Where H is the vehicle height. The radar is installed at a height of y, and ymax is the maximum y-coordinate value in the vertical line segment.
6. The method for real-time detection of the height of a moving vehicle based on two-dimensional lidar according to claim 1, characterized in that, In step S5, the detection results include vehicle position, height, and detection time. The database publishes relevant information via the MQTT protocol for external system linkage.
7. The method for real-time detection of the height of a moving vehicle based on a two-dimensional lidar according to claim 4, characterized in that, The criteria for selecting valid point cloud data are as follows: xmin <x<xmax; Where xmin is the minimum horizontal distance and xmax is the maximum horizontal distance.
8. The method for real-time detection of the height of a moving vehicle based on a two-dimensional lidar according to claim 7, characterized in that, The calculation formula for the X-axis binning method is as follows: bin_index=floor((x-xmin) / ); in The floor function is a mathematical function that rounds down to the nearest integer, and is used to define the preset bucket width. The formula for calculating the height of the vertical line segment is as follows: h = ymax - ymin; Where ymax and ymin are the maximum and minimum y coordinates of the point set inside the bucket, respectively; The formula for calculating the percentage of points below radar altitude is as follows: =count(points[y<0]) / count(points); Among them, it is necessary to ≥MIN_BELOW_LIDAR_POINTS_RATIO, the count function is a mathematical function that counts the number of numeric data in the parameter list; MIN_BELOW_LIDAR_POINTS_RATIO is the default value.
9. A method for real-time detection of the height of a moving vehicle based on a two-dimensional lidar according to claim 8, characterized in that, The method for determining the continuity of heights between adjacent points is as follows: This is the preset threshold for the maximum height difference between adjacent points.