Side vehicle length detection method, device, vehicle, medium and program product

By placing radars at the four corners of the vehicle and combining visual and front and rear corner radar point cloud data, the length of the vehicle to the side can be directly calculated. This solves the problem of detection accuracy in scenarios with visual perception failure and sparse point clouds, achieving high-precision and stable vehicle length estimation and ensuring driving safety.

CN122307545APending Publication Date: 2026-06-30CHONGQING CHANGAN AUTOMOBILE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING CHANGAN AUTOMOBILE CO LTD
Filing Date
2026-06-04
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing side vehicle length detection solutions lack accuracy when dealing with excessively long side vehicles, especially in scenarios where visual perception fails or point clouds are sparse, failing to provide stable and accurate vehicle length estimates, thus threatening driving safety.

Method used

By placing radars at the four corners of the vehicle, and combining the position information provided by vision with the point cloud data of the front and rear corner radars, the target point cloud is filtered, and straight line fitting and endpoint mapping distance measurement are performed to directly calculate the vehicle length. This utilizes the decimeter-level ranging capability of radar to avoid dependence on visual bounding boxes.

Benefits of technology

It improves the accuracy and stability of vehicle length detection, ensuring reliable output of vehicle length results even in scenarios with visual failure or sparse point clouds, enhancing driving safety, and adapting to high-frequency risk scenarios involving large vehicles on high-speed parallel roads and urban roads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122307545A_ABST
    Figure CN122307545A_ABST
Patent Text Reader

Abstract

This invention relates to the field of intelligent driving technology, and discloses a method, device, vehicle, medium, and program product for detecting the length of vehicles to the side. This invention utilizes visual information to provide the position of vehicles to the side, and combines this with radar point cloud filtering at the front and rear corners, extraction of near-vehicle side target point clouds, straight line fitting, and endpoint mapping ranging to detect the length of vehicles to the side. It does not rely on visual bounding boxes, solving the problem of inaccurate vehicle length estimation caused by visual truncation and distortion when driving alongside vehicles at close range. By utilizing the decimeter-level ranging capability of radar, the vehicle length is obtained directly through geometric calculations, significantly improving accuracy. Furthermore, it does not rely on complete point cloud contours and can still stably output vehicle length results even in scenarios with visual failure or sparse point clouds, ensuring the reliability of side vehicle perception and providing accurate data support for driving safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent driving technology, specifically to a method, device, vehicle, medium, and software product for detecting the length of vehicles approaching from the side. Background Technology

[0002] In the field of intelligent driving perception, the fusion of millimeter-wave radar and vision is the mainstream approach to overcome the limitations of single sensors. Vision-based bird's-eye view perception technology can unify images from multiple cameras onto a top-down plane for target detection and tracking. However, bird's-eye view perception has serious limitations in certain scenarios: when a vehicle is parallel to an extremely long vehicle (such as a semi-trailer truck exceeding 18 meters in length) for an extended period, due to limitations in camera field of view, image resolution, and the distortion and truncation effects of close-range objects, the bird's-eye view model struggles to stably and completely detect and accurately estimate the overall outline and true length of the parallel vehicle. This perception uncertainty directly threatens driving safety, potentially leading to misjudgments in lane-changing decisions or failure of lateral warning functions. Therefore, accurately detecting the true length of vehicles to the side of the vehicle has become an urgent problem to be solved. Summary of the Invention

[0003] This invention provides a method, device, vehicle, medium, and program product for detecting the length of vehicles parked on the side, in order to solve the problem of insufficient detection accuracy of existing methods for detecting extra-long vehicles parked on the side.

[0004] In a first aspect, the present invention provides a method for detecting the length of a vehicle to the side, applied to a first vehicle, wherein radars are respectively installed at the four corners of the vehicle body, and the method includes: The visual detection results of the second vehicle located to the side of the first vehicle are obtained, as well as the first point cloud data collected by the front radar and the second point cloud data collected by the rear radar located to the side of the second vehicle. The visual detection results include at least the position information of the second vehicle. Based on the location information, the first point cloud data and the second point cloud data are filtered respectively to obtain the third point cloud data and the fourth point cloud data; Target point clouds that are close to the first vehicle are selected from the third point cloud data and the fourth point cloud data respectively to obtain the first target point cloud set and the second target point cloud set; Linear fitting is performed on the first target point cloud and the second target point cloud respectively to obtain the first straight line and the second straight line; Map the farthest first target point cloud in the first target point cloud set along the direction of the front of the first vehicle onto the first straight line to determine the first position, and map the farthest second target point cloud in the second target point cloud set along the direction of the rear of the first vehicle onto the second straight line to determine the second position; The length of the second vehicle is determined based on the distance between the first and second positions.

[0005] This invention utilizes visual information to provide the position of vehicles to the side, combined with radar point cloud filtering at the front and rear corners, extraction of near-vehicle side target point clouds, line fitting, and endpoint mapping ranging to detect the length of vehicles to the side. It eliminates the need for visual bounding boxes, solving the problem of inaccurate vehicle length estimation caused by visual truncation and distortion when parallel to vehicles at close range. By leveraging the decimeter-level ranging capability of radar, the vehicle length is obtained directly through geometric calculations, significantly improving accuracy. Furthermore, it does not rely on complete point cloud contours and can still stably output vehicle length results even in scenarios with visual failure or sparse point clouds, ensuring the reliability of side vehicle perception and providing accurate data support for driving safety.

[0006] In one alternative implementation, the method further includes: The target slope is determined based on the first slope of the first line and the second slope of the second line; Based on the target slope, determine the heading angle of the second vehicle relative to the first vehicle; The vehicle length is corrected based on the heading angle to obtain the corrected vehicle length.

[0007] This invention determines the heading angle based on the slope of the fitted straight line from the front and rear radars, and corrects the vehicle length accordingly. This effectively solves the problem of deviation caused by directly calculating the distance between two points when the vehicle is not parallel to a vehicle on the side. The heading angle correction can eliminate the ranging error caused by the target vehicle's yaw, making the length calculation closer to the actual extension direction of the vehicle, further improving the accuracy of length estimation, and avoiding misjudgment of length due to vehicle attitude deviation. It is especially suitable for high-speed parallel driving and scenarios with slight vehicle attitude tilt, enhancing the matching degree between the perception results and the actual situation.

[0008] In one optional implementation, determining the target slope based on the first slope of the first straight line and the second slope of the second straight line includes: The average of the first slope and the second slope is determined as the target slope.

[0009] This invention simplifies the heading angle calculation logic and reduces algorithm complexity by using the average slope of the preceding and following straight lines as the target slope. Through averaging, it weakens the impact of single radar point cloud fitting errors on the heading angle, avoids local point cloud anomalies causing slope deviations from the true value, and improves the stability and robustness of the heading angle calculation. While ensuring accuracy, it also improves algorithm efficiency, adapting to the real-time computing needs of vehicle-mounted systems.

[0010] In one optional implementation, the visual detection result further includes: the vehicle type of the second vehicle, and the method further includes: Based on the vehicle type, a vehicle length compensation value is determined. The vehicle length compensation value is used to characterize the standard length of the low radar cross section area at the front and rear of the vehicle corresponding to the vehicle type. The vehicle length is compensated based on the vehicle length compensation value to obtain the compensated vehicle length.

[0011] This invention determines the length compensation value based on vehicle type, specifically addressing the radar's insensitivity to low-scattering-section areas at the front and rear of vehicles. Since different vehicle types have varying blind spot lengths, this classification compensation accurately matches the physical characteristics of various vehicles, eliminating the length underestimation caused by the inherent radar detection blind spot. The compensated length is closer to the vehicle's true physical length, avoiding misjudgments of oversized vehicles due to missing end-point detection. It is suitable for various oversized vehicle types such as trucks and semi-trailers, improving the accuracy of perception results.

[0012] In one optional implementation, the step of filtering the first point cloud data and the second point cloud data based on the location information to obtain the third point cloud data and the fourth point cloud data includes: The location information, the first point cloud data, and the second point cloud data are respectively converted to the vehicle coordinate system of the first vehicle; The first region corresponding to the location information is extended by a preset distance towards the front and rear of the first vehicle, respectively, to obtain a second region; Filter point cloud data belonging to the second region from the first point cloud data, and perform clustering to obtain several first point cloud clusters. The first point cloud cluster with the most point cloud data is determined as the third point cloud data. Point cloud data belonging to the second region are selected from the second point cloud data and clustered to obtain several second point cloud clusters. The second point cloud cluster with the most point cloud data is determined as the fourth point cloud data.

[0013] This invention unifies visual position information and radar point clouds into the vehicle coordinate system, and adapts to visual truncation scenarios through region expansion and clustering to select the main point cloud cluster. Expanding the visual bounding box at a preset distance recovers effective radar point clouds at distant points, solving the failure problem of traditional association strategies in truncation scenarios. Clustering selects the largest point cloud cluster and eliminates invalid and interfering point clouds, ensuring the quality of point cloud data used for calculation and avoiding the impact of sparse and messy point clouds on subsequent fitting accuracy. This provides a reliable data foundation for subsequent boundary extraction and length calculation, adapting to scenarios where visual bounding boxes are incomplete during close-range parallel processing.

[0014] In one optional implementation, the step of filtering target point clouds near the first vehicle from the third point cloud data and the fourth point cloud data respectively to obtain a first target point cloud set and a second target point cloud set includes: The third point cloud data and the fourth point cloud data are respectively divided along the direction of the vehicle head to obtain several first slice data and several second slice data; The target point cloud closest to the first vehicle is extracted from each of the first slice data to form a first target point cloud set, and the target point cloud closest to the first vehicle is extracted from each of the second slice data to form a second target point cloud set.

[0015] This invention slices point cloud data along the vehicle's front direction and extracts the target point cloud near the vehicle side from each slice, accurately selecting key data representing the vehicle's side boundary. Slicing avoids interference from local point cloud anomalies, extracts continuous boundary features from discrete point clouds, reduces redundant point cloud data, focuses on effective boundary information near the vehicle side, and provides highly correlated and discriminative point cloud data for straight line fitting, improving boundary line fitting accuracy and preventing deviations from the true boundary due to non-boundary point clouds participating in the fitting process, thus enhancing the reliability of boundary extraction.

[0016] In one optional implementation, the step of mapping the farthest first target point cloud in the first target point cloud set along the direction of the front of the first vehicle onto the first straight line to determine a first position, and mapping the farthest second target point cloud in the second target point cloud set along the direction of the rear of the first vehicle onto the second straight line to determine a second position, includes: The coordinates of the first target point cloud along the direction of the vehicle's front are used as the coordinates of the first straight line along the direction of the vehicle's front. These coordinates are then substituted into the equation of the first straight line to determine the first position. The coordinates of the second target point cloud along the rear direction of the vehicle are used as the coordinates of the second straight line along the rear direction of the vehicle. These coordinates are then substituted into the equation of the corresponding straight line to determine the second position.

[0017] This invention determines the endpoint position by substituting the coordinates of the farthest target point cloud into the fitted straight line, rather than directly using the original point cloud coordinates, effectively avoiding single-point noise interference. The fitted straight line has filtered out local point cloud errors, and the endpoint is determined by mapping from the straight line, eliminating the influence of a single outlier on the endpoint positioning. This ensures the stability and accuracy of the endpoint positions of the front and rear of the vehicle, avoids endpoint jumps caused by sparse or discontinuous point clouds, makes the distance calculation between two points more accurate, and ensures that the length estimation results are stable between frames without significant fluctuations.

[0018] In one optional implementation, before acquiring the visual detection results of the second vehicle located to the side of the first vehicle and the first point cloud data acquired by the front radar and the second point cloud data acquired by the rear radar located to the side of the second vehicle, the method further includes: Acquire a first image of the side region of the first vehicle; Vehicle target detection is performed on the first image to obtain visual detection results, which include at least: the location information of the detected target vehicle and the vehicle type of the target vehicle; When the target vehicle is of a preset extra-long vehicle type, the target vehicle is identified as the second vehicle, and the preset extra-long vehicle type is used to indicate that the vehicle length exceeds a preset length.

[0019] This invention first outputs the vehicle's location and type through image detection, then performs subsequent length detection only on ultra-long targets, reducing unnecessary computations. It accurately identifies ultra-long vehicle detection scenarios, avoiding redundant calculations for ordinary vehicles and improving system efficiency. By pre-screening ultra-long vehicles and initiating a targeted high-precision perception process, it focuses on high-risk targets, prioritizing the perception accuracy of ultra-long vehicles. This adapts to high-frequency, high-risk scenarios involving large vehicles traveling side-by-side on highways and urban roads, optimizing system resource allocation.

[0020] In one alternative implementation, the method further includes: Determine whether the number of points in the third point cloud data and the fourth point cloud data is greater than a preset point cloud number threshold. When the number of point clouds in both the third and fourth point cloud data is greater than a preset point cloud number threshold, the average distance between each point cloud in the third and fourth point cloud data and a preset number of adjacent point clouds is calculated respectively. Based on the mean and standard deviation of the average distances corresponding to all point clouds in the third point cloud data, outliers in the third point cloud data are removed, and based on the mean and standard deviation of the average distances corresponding to all point clouds in the fourth point cloud data, outliers in the fourth point cloud data are removed. Remove point cloud data whose ground elevation is outside the preset height range from the third and fourth point cloud data. If the number of point clouds in the third point cloud data and / or the fourth point cloud data is not greater than a preset point cloud number threshold, the steps of acquiring the visual detection results of the second vehicle located to the side of the first vehicle and the first point cloud data collected by the front radar and the second point cloud data collected by the rear radar located to the side of the second vehicle are re-executed.

[0021] This invention filters out flying points, clutter noise, ground reflections, and airborne clutter in radar point clouds through point cloud quantity verification, outlier removal, and height threshold filtering. First, the point cloud quantity is verified to remove invalid data with insufficient evidence, avoiding erroneous calculations based on sparse point clouds. Then, outliers are filtered out using the average neighborhood distance to accurately filter abnormal noise. Furthermore, ground reflections and airborne clutter data are filtered out using height-based filtering, retaining valid point cloud data, improving point cloud quality, and reducing noise interference with line fitting and endpoint localization. In scenarios where point clouds are susceptible to interference, such as rain, snow, and complex road conditions, the algorithm's noise resistance and stability are enhanced.

[0022] In one alternative implementation, the method further includes: When the vehicle length exceeds a preset length, a lane-changing decision-making plan is made based on the vehicle length, and the lateral warning area of ​​the first vehicle is adjusted based on the vehicle length.

[0023] This invention, based on the precise detection of extra-long vehicle length, dynamically performs lane-changing decisions and adjusts the warning area, achieving a closed loop of perception, decision-making, and early warning. Extra-long vehicles require a longer safety distance for lane changes, and targeted planning can avoid misjudgments. Expanding the warning area can cover the trailer's blind spot, preventing scratches during mid-lane changes. It accurately matches the risk characteristics of extra-long vehicles, transforming length perception results into safety protection strategies. By mitigating parallel risks from both decision-making and early warning perspectives, it comprehensively ensures driving safety.

[0024] Secondly, the present invention provides a lateral vehicle length detection device, applied to a first vehicle, wherein radars are respectively installed at the four corners of the vehicle body, and the device includes: The acquisition module is used to acquire the visual detection results of the second vehicle located to the side of the first vehicle, as well as the first point cloud data collected by the front radar and the second point cloud data collected by the rear radar located to the side of the second vehicle. The visual detection results include at least the position information of the second vehicle. The first processing module is used to filter the first point cloud data and the second point cloud data based on the location information to obtain the third point cloud data and the fourth point cloud data. The second processing module is used to filter target point clouds that are close to the first vehicle from the third point cloud data and the fourth point cloud data respectively, to obtain a first target point cloud set and a second target point cloud set. The third processing module is used to perform line fitting on the first target point cloud and the second target point cloud respectively to obtain the first straight line and the second straight line; The fourth processing module is used to map the farthest first target point cloud in the first target point cloud along the direction of the front of the first vehicle onto the first straight line to determine the first position, and to map the farthest second target point cloud in the second target point cloud along the direction of the rear of the first vehicle onto the second straight line to determine the second position. The fifth processing module is used to determine the length of the second vehicle based on the distance between the first position and the second position.

[0025] Thirdly, the present invention provides a vehicle, wherein radars are respectively provided at the four corners of the vehicle body, the vehicle includes a controller, the controller includes a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the method provided in the first aspect or any corresponding embodiment above.

[0026] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the method provided in the first aspect or any corresponding embodiment thereof.

[0027] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to perform the method provided in the first aspect or any corresponding embodiment thereof. Attached Figure Description

[0028] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0029] Figure 1 This is a schematic diagram of the first process of a lateral vehicle length detection method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a second process for a lateral vehicle length detection method according to an embodiment of the present invention; Figure 3A and Figure 3B This is a schematic diagram of the image truncation phenomenon of parallel vehicles on the side according to an embodiment of the present invention; Figure 4A This is a schematic diagram of the main working process of the lateral vehicle length detection system according to an embodiment of the present invention; Figure 4B This is a schematic diagram of radar point cloud-visual target association according to an embodiment of the present invention; Figure 5 This is a structural block diagram of a lateral vehicle length detection device according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the hardware structure of the vehicle controller according to an embodiment of the present invention. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0031] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0032] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0033] Vision-based bird's-eye view perception technologies share common limitations when dealing with the specific scenario of "extremely long vehicles traveling in close parallel at sideways": 1) a lack of targeted optimization solutions; 2) over-reliance on point cloud quality and track updates, failing to consider point cloud sparsity and tracking loss; and 3) visual truncation leading to the inability to provide a length measurement benchmark. Therefore, when visual perception fails, a stable, direct, and accurate vehicle length estimation remedy cannot be provided.

[0034] To address the aforementioned issues, this invention proposes a precise lateral perception scheme for ultra-long vehicles based on front and rear corner radar point cloud boundary fusion. After visually identifying the target type and approximate region, it abandons the reliance on incomplete visual bounding boxes and instead utilizes point cloud clusters detected by front and rear corner radars, representing the front and rear sides of the vehicle respectively. By fitting their respective local near-vehicle side boundary lines and extracting key representative points from the fitted lines, direct ranging is performed. By using front and rear corner radars to capture local side point clouds of the front and rear of the vehicle, the distance between the two points is directly calculated using geometric methods, improving the accuracy of length estimation from the meter level of vision to the decimeter level inherent to radar, with stable results and no inter-frame jitter. It does not require the radar point cloud to cover the entire length of the vehicle, nor does it rely on stable visual bounding boxes or tracking tracks, and it can still work reliably when vision fails completely or the point cloud is discontinuous.

[0035] According to an embodiment of the present invention, a method for detecting the length of a lateral vehicle is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0036] This embodiment provides a method for detecting the length of a vehicle from the side, which can be used in the controller of a first vehicle with radars installed at each of its four corners, such as a microcontroller or CPU. Figure 1 This is a flowchart of a lateral vehicle length detection method according to an embodiment of the present invention, as follows: Figure 1 As shown, the process includes the following steps: Step S101: Obtain the visual detection results of the second vehicle located to the side of the first vehicle, as well as the first point cloud data collected by the front radar and the second point cloud data collected by the rear radar located to the side of the second vehicle.

[0037] The visual detection results include at least the location information of the second vehicle.

[0038] Specifically, the first vehicle is an intelligent driving vehicle equipped with a visual perception module such as multiple cameras and a radar perception module such as a front-angle millimeter-wave radar and a rear-angle millimeter-wave radar. During vehicle operation, the visual perception module and the radar perception module are activated simultaneously. The visual perception module acquires images of the side area through side cameras, identifies the second vehicle present on the side using a target detection algorithm, and outputs a visual detection result containing the position information of the second vehicle. For example, this position information can be the position information of the bounding box containing the second vehicle, based on the first vehicle's own coordinate system, to determine the approximate lateral and longitudinal range of the second vehicle relative to the first vehicle. In the radar perception module, the front-angle radar on the side closest to the second vehicle acquires point cloud data of the surrounding environment in real time, forming the first point cloud data. The rear-angle radar on the same side simultaneously acquires point cloud data, forming the second point cloud data. The entire data acquisition process must ensure that the visual image frames and radar point cloud frames are time-synchronized. This can be achieved through hardware PPS pulses or software-aligned timestamps to ensure that the image frames and radar point cloud frames are time-aligned, avoiding data misalignment due to time deviations and laying the foundation for subsequent data association.

[0039] For example, when the first vehicle is traveling at high speed, a semi-trailer truck appears as the second vehicle in the adjacent lane on the right. The vision module detects the truck and outputs its position information as 5m-25m on the X-axis (direction of the vehicle's front) and -3m to -1m on the Y-axis (lateral direction pointing to the left of the vehicle) in the vehicle coordinate system. The right front corner radar collects the first point cloud data in real time, and the right rear corner radar collects the second point cloud data simultaneously. Both types of point cloud data contain the spatial coordinate information of each detection point.

[0040] Step S102: Based on the location information, the first point cloud data and the second point cloud data are filtered to obtain the third point cloud data and the fourth point cloud data.

[0041] Specifically, based on the second vehicle's position information in the visual detection results, a related region is defined: for example, the lateral range of the second vehicle is matched horizontally, and the visual position interval is covered vertically; or, based on the lateral range of the second vehicle, the visual position interval is covered vertically and extended appropriately outwards to ensure that radar point clouds of the second vehicle's front and rear that are outside the visual detection range are included, thus avoiding the omission of valid point clouds due to the truncation effect of the visual detection results. Then, based on this related region, point clouds located within this region are selected from the first point cloud data to form the third point cloud data; similarly, point clouds within the same region are selected from the second point cloud data to form the fourth point cloud data, thereby eliminating background point clouds and interfering point clouds unrelated to the second vehicle and retaining valid point cloud data.

[0042] Step S103: Select target point clouds that are close to the first vehicle from the third point cloud data and the fourth point cloud data respectively to obtain the first target point cloud set and the second target point cloud set.

[0043] Specifically, the point cloud that is relatively close to the first vehicle can be selected as the target point cloud based on the position of each point cloud in the point cloud data. The target point cloud is used to represent the boundary of the second vehicle on the side closer to the first vehicle.

[0044] Step S104: Perform line fitting on the first target point cloud and the second target point cloud respectively to obtain the first straight line and the second straight line.

[0045] Specifically, a straight-line fitting algorithm can be used to fit the contours of the two sets of point clouds to reconstruct the local boundary line of the second vehicle's near-vehicle side. For example, for the first target point cloud, a robust fitting algorithm or a random sampling consensus algorithm is used to remove any remaining small noise points within the point cloud, fitting a straight line that conforms to the distribution trend of the point cloud, denoted as the first straight line. This straight line corresponds to the near-vehicle side boundary of the second vehicle's front side. Similarly, a robust straight-line fitting operation is performed on the second target point cloud to obtain a second straight line that conforms to its distribution trend. This straight line corresponds to the near-vehicle side boundary of the second vehicle's rear side. The two fitted straight lines can accurately characterize the directional features of the second vehicle's front and rear sides.

[0046] Step S105: Map the farthest first target point cloud in the first target point cloud set along the direction of the front of the first vehicle onto the first straight line to determine the first position, and map the farthest second target point cloud in the second target point cloud set along the direction of the rear of the first vehicle onto the second straight line to determine the second position.

[0047] Specifically, by substituting the coordinates of the vehicle's front direction and parking direction corresponding to the first and second positions into the equations corresponding to the first and second straight lines, two coordinates of the vehicle's lateral direction are obtained, resulting in two coordinate points: the first position and the second position.

[0048] Step S106: Determine the length of the second vehicle based on the distance between the first and second positions.

[0049] Specifically, the straight-line distance between the first and second positions is calculated, which is the length of the second vehicle. This calculation method relies on the precise boundary points determined by the fitted straight line, which can directly reflect the longitudinal length of the second vehicle near the vehicle side, thus completing the accurate detection of the length of the vehicle on the side.

[0050] This invention utilizes visual information to provide the position of vehicles to the side, combined with radar point cloud filtering at the front and rear corners, extraction of near-vehicle side target point clouds, line fitting, and endpoint mapping ranging to detect the length of vehicles to the side. This eliminates the need for visual bounding boxes, solving the problem of inaccurate vehicle length estimation caused by visual truncation and distortion when parallel to vehicles at close range. By leveraging the decimeter-level ranging capability of radar, vehicle length is obtained directly through geometric calculations, significantly improving accuracy. Furthermore, it does not rely on complete point cloud contours and can still stably output vehicle length results even in scenarios with visual failure or sparse point clouds, ensuring the reliability of side vehicle perception and providing accurate data support for driving safety.

[0051] This embodiment provides a method for detecting the length of a vehicle from the side, which can be used in the controller of a first vehicle with radars installed at each of its four corners, such as a microcontroller or CPU. Figure 2 This is a flowchart of a lateral vehicle length detection method according to an embodiment of the present invention, as follows: Figure 2 As shown, the process includes the following steps: Step S201: Obtain a first image of the side region of the first vehicle.

[0052] Specifically, side-view cameras can be deployed on both sides of the first vehicle to acquire images. These cameras face the side road area, covering a large area in front of and behind the vehicle. During vehicle movement, the side-view cameras continuously capture environmental images of the side area at a fixed frame rate, generating a real-time image stream. Each frame is the first image. The camera's installation angle and focal length are precisely calibrated to ensure that the acquired first image clearly presents key information such as the lane to the side of the vehicle, adjacent vehicles, and road markings, providing high-quality image data for subsequent target detection. For example, a schematic diagram illustrating the image truncation phenomenon of large vehicles traveling in parallel to the side is shown below. Figure 3A and Figure 3B As shown.

[0053] Step S202: Perform vehicle target detection on the first image to obtain visual detection results.

[0054] The visual detection results include at least: the location information of the detected target vehicle and the vehicle type of the target vehicle.

[0055] Specifically, a pre-trained vehicle target detection model can be invoked to perform pixel-level analysis and target recognition on the first image. For example, this detection model is a deep learning model optimized for intelligent driving scenarios, capable of accurately identifying various vehicle targets in the image. During detection, the model selects vehicle targets in the image, outputs the bounding box information of the target in the image coordinate system, and, combined with sensor calibration parameters, transforms the bounding box information in the image coordinate system to the vehicle's own coordinate system, obtaining the lateral and longitudinal position information of the target vehicle relative to the first vehicle. Simultaneously, the model identifies the specific type of the target vehicle, such as sedan, SUV, truck, or semi-trailer, through feature extraction and classification. The above position information and vehicle type information are integrated to form the visual detection result.

[0056] In practical applications, a visual perception model is used to detect lateral vehicle targets and output results that include at least the target's incomplete two-dimensional bounding box and vehicle classification. The vehicle classification includes "large vehicle candidate categories" (such as trucks, semi-trailers, etc., which may belong to the category of extra-long vehicles). The incomplete bounding box output by vision is only used as a spatial anchor point for radar point cloud association and is not required to completely cover the actual outline of the target.

[0057] For example, target detection is performed on the first image containing the semi-trailer truck on the right. The model identifies the presence of a vehicle target in the image and outputs its position information in the vehicle coordinate system as 5m-25m on the X-axis and -3m to -1m on the Y-axis. At the same time, the vehicle type is identified as "semi-trailer". The position information and the vehicle type are combined to obtain the visual detection result.

[0058] Step S203: When the target vehicle's vehicle type is a preset extra-long vehicle type, the target vehicle is identified as the second vehicle.

[0059] Among them, the preset extra-long vehicle type is used to indicate that the vehicle length exceeds the preset length.

[0060] Specifically, the system pre-stores a list of preset extra-long vehicle types. This list is formulated based on traffic regulations and intelligent driving perception requirements, defining vehicle types that exceed a preset length (e.g., 18 meters), typically including semi-trailers, heavy-duty tractor-trailers, and extra-long trucks. After acquiring the visual detection results, the system extracts the target vehicle type and matches it with the preset list of extra-long vehicle types: if the target vehicle type belongs to a type in the list, it is determined to be an extra-long vehicle, marked as the second vehicle, and the subsequent side vehicle length detection process is triggered; if it does not belong to a type in the list, it is determined to be a vehicle of normal length, and there is no need to initiate the precise length detection process for extra-long vehicles, reducing unnecessary computational overhead.

[0061] For example: The system has a preset list of extra-long vehicle types that includes "semi-trailers" and "heavy trucks", with a preset length threshold of 18 meters. In this visual inspection result, the target vehicle type is "semi-trailer", and the list is matched successfully. The semi-trailer is determined to be an extra-long vehicle, and it is identified as the second vehicle. The subsequent radar point cloud screening, boundary fitting, and length calculation process is then initiated.

[0062] This invention first outputs the vehicle's location and type through image detection, then performs subsequent length detection only on ultra-long targets, reducing unnecessary computations. It accurately identifies ultra-long vehicle detection scenarios, avoiding redundant calculations for ordinary vehicles and improving system efficiency. By pre-screening ultra-long vehicles and initiating a targeted high-precision perception process, it focuses on high-risk targets, prioritizing the perception accuracy of ultra-long vehicles. This adapts to high-frequency, high-risk scenarios involving large vehicles traveling side-by-side on highways and urban roads, optimizing system resource allocation.

[0063] Step S204: Obtain the visual detection results of the second vehicle located to the side of the first vehicle, as well as the first point cloud data collected by the front radar and the second point cloud data collected by the rear radar located to the side of the second vehicle. The visual detection results include at least the position information of the second vehicle. See details below. Figure 1 The relevant descriptions of step S101 shown will not be repeated here.

[0064] Step S205: Based on the location information, the first point cloud data and the second point cloud data are filtered to obtain the third point cloud data and the fourth point cloud data.

[0065] Specifically, step S205 includes: Step a1: Convert the location information, the first point cloud data, and the second point cloud data to the vehicle coordinate system of the first vehicle.

[0066] Specifically, to eliminate deviations caused by inconsistencies in coordinate references between different sensors, all perceived data needs to be mapped to the same coordinate system. For example, in this embodiment of the invention, a vehicle coordinate system is established with the center of the rear axle of the first vehicle as the origin: the X-axis points along the front of the vehicle, the Y-axis points to the left side of the vehicle, and the Z-axis points vertically upward. The target vehicle position information (image coordinate system) output by visual detection, the first point cloud data output by the front radar (radar local coordinate system), and the second point cloud data output by the rear radar (radar local coordinate system) are uniformly transformed to this vehicle coordinate system based on the sensor's internal and external parameters and the installation calibration matrix, thus completing coordinate alignment.

[0067] Step a2: Extend the first region corresponding to the location information by a preset distance towards the front and rear of the first vehicle to obtain the second region.

[0068] Specifically, the positional information output by visual detection corresponds to an initial rectangular area, denoted as the first region. This region often fails to cover the complete front and rear of extra-long vehicles due to close-range truncation. To include effective radar point clouds exceeding the visual bounding box in the association range, the first region is extended outward by a preset distance (e.g., 5 meters) along both the front (positive X) and rear (negative X) directions, while maintaining the same lateral range, thus forming an expanded second region, which serves as an effective association window for radar point cloud filtering. By extending the visual bounding box forward and backward, this method is specifically adapted to the truncation scenario of extra-long vehicles running parallel at close range, effectively including radar point clouds at the front and rear that exceed the visual range, significantly improving the coverage of point clouds at both ends of extra-long vehicles.

[0069] Step a3: Filter point cloud data belonging to the second region from the first point cloud data, and perform clustering to obtain several first point cloud clusters. The first point cloud cluster with the most point cloud data is determined as the third point cloud data.

[0070] Specifically, under a unified coordinate system, the first point cloud data output by the radar is traversed, retaining the point clouds whose spatial coordinates fall within the second region, while filtering out irrelevant background points. The retained point clouds are then clustered using existing clustering algorithms such as Euclidean distance clustering, with a distance threshold set to 0.5 meters, aggregating spatially adjacent points into multiple first point cloud clusters. Among all the first point cloud clusters, the cluster with the most points is selected as the main target point cloud, i.e., the third point cloud data, thereby eliminating clutter clusters and retaining the effective point cloud from the front of the vehicle.

[0071] Step a4: Filter point cloud data belonging to the second region from the second point cloud data, and perform clustering to obtain several second point cloud clusters. The second point cloud cluster with the most point cloud data is determined as the fourth point cloud data.

[0072] Specifically, by adopting a processing method symmetrical to step a3: traversing the second point cloud data output by the radar, retaining the point clouds falling within the second region; performing the same Euclidean clustering on these point clouds to obtain several second point cloud clusters; selecting the cluster with the most points as the fourth point cloud data, retaining the effective point cloud on the rear side of the vehicle and filtering out scattered clutter. Thus, through spatial filtering, clustering, and finally selecting the largest cluster, three layers of filtering effectively remove noise such as ground reflections, roadside clutter, and birds, ensuring high purity and high correlation of the point clouds entering subsequent fitting, and avoiding length estimation jumps caused by clutter interference. Furthermore, it does not rely on complete contours or continuous tracks; the main cluster extraction can be completed using only the point cloud within a single frame region. Even under adverse conditions such as rain, snow, occlusion, and sparse point clouds, it can still stably output effective point clouds on the front and rear sides of the vehicle, significantly improving the reliability of ultra-long vehicle perception.

[0073] This invention unifies visual position information and radar point clouds into the vehicle coordinate system, and adapts to visual truncation scenarios through region expansion and clustering to select the main point cloud cluster. Expanding the visual bounding box at a preset distance recovers effective radar point clouds at distant points, solving the failure problem of traditional association strategies in truncation scenarios. Clustering selects the largest point cloud cluster and eliminates invalid and interfering point clouds, ensuring the quality of point cloud data used for calculation and avoiding the impact of sparse and messy point clouds on subsequent fitting accuracy. This provides a reliable data foundation for subsequent boundary extraction and length calculation, adapting to scenarios where visual bounding boxes are incomplete during close-range parallel processing.

[0074] In some optional implementations, after performing step a4 above, the lateral vehicle length detection method further includes the following steps: Step a5: Determine whether the number of points in the third and fourth point cloud data is greater than the preset point cloud number threshold.

[0075] The preset point cloud number threshold can be flexibly set according to the detection accuracy. For example, the preset point cloud number threshold is 5 or 8.

[0076] Step a6: When the number of point clouds in both the third and fourth point cloud data is greater than the preset point cloud number threshold, calculate the average distance between each point cloud in the third and fourth point cloud data and the preset number of adjacent point clouds.

[0077] Specifically, for each group of point clouds, each point is traversed, and a preset number (e.g., 10) of nearest neighbor points around the point are found. The average distance from the point to this group of neighbor points is calculated as the local density feature of the point. The average distance calculation of all points in the third and fourth point cloud data is completed in sequence.

[0078] Step a7: Based on the mean and standard deviation of the average distances corresponding to all point clouds in the third point cloud data, remove outliers from the third point cloud data; and based on the mean and standard deviation of the average distances corresponding to all point clouds in the fourth point cloud data, remove outliers from the fourth point cloud data.

[0079] Specifically, statistical analysis was performed on the average distances of the two sets of point clouds: the mean of all average distances was calculated. with standard deviation Set an outlier detection threshold (e.g.) , (Take 1.5); points whose average distance exceeds the outlier determination threshold are identified as outliers and removed, while retaining effective point clouds with dense distribution and good consistency, and eliminating long-distance flying points and clutter interference.

[0080] Step a8: Remove point cloud data from the third and fourth point cloud data whose altitude above the ground is not within the preset altitude range.

[0081] Specifically, to further filter ground reflections and aerial clutter (such as birds and dust), a preset height range (e.g., 0.2m to 3.5m) is set based on the Z-axis (vertical height) of the vehicle coordinate system; the two sets of point clouds are traversed, and only points whose Z-coordinates fall within this range are retained, while invalid point clouds on the ground and at high altitudes are removed, focusing on the effective reflection area on the side of the vehicle.

[0082] Step a9: If the number of point clouds in the third point cloud data and / or the fourth point cloud data is not greater than the preset point cloud number threshold, step S204 is executed again.

[0083] Specifically, if it is determined that the number of points in any one or two groups of the third and fourth point cloud data is less than or equal to the preset threshold, it indicates that the effective radar point cloud in the current frame is insufficient and the subsequent fitting accuracy cannot be guaranteed. At this time, the current frame data is discarded, step S204 is triggered again, the image and radar point cloud are reacquired, and the subsequent process is executed to avoid invalid calculations and erroneous outputs.

[0084] This invention filters out flying points, clutter noise, ground reflections, and air clutter in radar point clouds through point cloud quantity verification, outlier removal, and height threshold filtering. First, the point cloud quantity is verified to remove invalid data with insufficient evidence, avoiding erroneous calculations based on sparse point clouds. Then, outliers are filtered using the average neighborhood distance to accurately filter abnormal noise. Furthermore, ground reflections and air clutter data are filtered through height-based filtering, retaining valid point cloud data, improving point cloud quality, and reducing noise interference with line fitting and endpoint localization. In scenarios where point clouds are susceptible to interference, such as rain, snow, and complex road conditions, the algorithm's noise resistance and stability are enhanced.

[0085] Step S206: Select target point clouds that are close to the first vehicle from the third point cloud data and the fourth point cloud data respectively to obtain the first target point cloud set and the second target point cloud set.

[0086] Specifically, step S206 includes: Step b1: Divide the third point cloud data and the fourth point cloud data along the direction of the vehicle head to obtain several first slice data and several second slice data.

[0087] Specifically, to accurately extract the near-vehicle side profile of the second vehicle facing the first vehicle, the two sets of point clouds are divided at equal intervals along the direction of the first vehicle's front (X-axis direction). The division interval can be set to 0.2 meters or 0.3 meters, etc. The continuously distributed point cloud is divided longitudinally into multiple non-overlapping segments. Each segment is either the first slice data (from the third point cloud) or the second slice data (from the fourth point cloud), realizing the longitudinal discretization of the point cloud, which facilitates the segment-by-segment selection of near-vehicle side boundary points.

[0088] For example, the third point cloud data is distributed in the 20m-25m range on the X-axis, and is divided into 25 first slice data at 0.2m intervals; the fourth point cloud data is distributed in the 5m-10m range on the X-axis, and is also divided into 25 second slice data.

[0089] Step b2: Extract the target point cloud closest to the first vehicle from each first slice of data to form a first target point cloud set, and extract the target point cloud closest to the first vehicle from each second slice of data to form a second target point cloud set.

[0090] Specifically, after the slice division is completed, key contour points near the vehicle are selected slice by slice. For each first slice, among all point clouds within the slice, the point cloud closest to the first vehicle in the horizontal direction (Y-axis) is selected, i.e., the point with the largest (right target) or smallest (left target) Y-coordinate value. All points selected from the first slice are aggregated to form the first target point cloud, which accurately corresponds to the near-vehicle boundary of the second vehicle's front side. Similarly, the same filtering operation is performed on each second slice, extracting the point cloud closest to the first vehicle within each slice and aggregating it to obtain the second target point cloud, which accurately corresponds to the near-vehicle boundary of the second vehicle's rear side. Redundant point clouds are eliminated, focusing on core contour features.

[0091] For example, one nearest point is extracted from each of the 25 first slice data, and the summaries are used to obtain a first target point cloud consisting of 25 points; similarly, points are extracted from the 25 second slice data, and the summaries are used to obtain a second target point cloud consisting of 25 points. Both sets of point clouds accurately fit the side profile of the semi-trailer truck facing the side of the vehicle.

[0092] By employing a longitudinal slicing method combined with near-point extraction per slice, the contour points of the second vehicle facing the user are directly identified, filtering out invalid point clouds far from the user. This provides a highly relevant and accurate set of boundary points for subsequent straight-line fitting. For extra-long vehicles such as semi-trailer trucks, whose sides are approximately straight, evenly spaced longitudinal slices uniformly cover the side contour, resulting in a uniformly distributed distribution of extracted boundary points that accurately reconstruct the side profile and suit the characteristics of extra-long vehicle side contours. Independent selection of boundary points per slice avoids the impact of minor local noise points on the overall contour extraction. Even if individual slices contain slight clutter, it will not interfere with the validity of the overall boundary point set, ensuring stable fitting results. The slicing and extreme value extraction operations are simple and computationally inexpensive, requiring no complex algorithms and enabling rapid boundary point extraction. This meets the real-time requirements of intelligent driving perception systems and provides efficient support for subsequent length calculations.

[0093] This invention employs a method of slicing point cloud data along the vehicle's front direction and extracting target point clouds near the vehicle side from each slice. This precise selection of key data characterizing the vehicle's side boundary allows for the identification of key data. Slicing avoids interference from local point cloud anomalies, extracts continuous boundary features from discrete point clouds, reduces redundant point cloud data, focuses on effective boundary information near the vehicle side, and provides highly correlated and discriminative point cloud data for straight line fitting. This improves the accuracy of boundary line fitting, prevents deviations from the true boundary due to the participation of non-boundary point clouds in the fitting process, and enhances the reliability of boundary extraction.

[0094] Step S207: Perform line fitting on the first target point cloud and the second target point cloud respectively to obtain the first straight line and the second straight line. See details below. Figure 1 The relevant description of step S104 shown will not be repeated here.

[0095] Step S208: Map the farthest first target point cloud in the first target point cloud set along the direction of the front of the first vehicle onto a first straight line to determine the first position, and map the farthest second target point cloud in the second target point cloud set along the direction of the rear of the first vehicle onto a second straight line to determine the second position.

[0096] Specifically, step S208 includes: Step c1: Take the coordinates of the first target point cloud along the direction of the vehicle's front as the coordinates of the first straight line along the direction of the vehicle's front, substitute them into the equation of the first straight line, and determine the first position.

[0097] Step c2: Take the coordinates of the second target point cloud along the rear direction of the vehicle as the coordinates of the second straight line along the rear direction of the vehicle, substitute them into the equation of the corresponding straight line of the second straight line, and determine the second position.

[0098] Specifically, for the first target point cloud, the point cloud with the largest coordinate value along the direction of the first vehicle's front (positive X-axis) is selected, i.e., the farthest first target point cloud. The X-axis coordinate of this point cloud is substituted into the equation of the first straight line to calculate the corresponding Y-axis coordinate. This coordinate point is the first position, corresponding to the frontal boundary point of the second vehicle near the vehicle. For the second target point cloud, the point cloud with the smallest coordinate value along the direction of the first vehicle's rear (negative X-axis) is selected, i.e., the farthest second target point cloud. The X-axis coordinate of this point cloud is substituted into the equation of the second straight line to calculate the corresponding Y-axis coordinate. This coordinate point is the second position, corresponding to the rearal boundary point of the second vehicle near the vehicle.

[0099] For example, the maximum X-axis coordinate within the first target point set is 24.9m. Substituting this into the equation of the first straight line, the Y-axis coordinate is calculated to determine the first position. The minimum X-axis coordinate within the second target point set is 5.1m. Substituting this into the equation of the second straight line, the Y-axis coordinate is calculated to determine the second position.

[0100] This invention does not directly use the extreme points of the original point cloud as boundaries. Instead, it substitutes the coordinates of the extreme points into a fitted straight line to determine the position, effectively avoiding positioning deviations caused by accidental noise points in the original point cloud, resulting in higher boundary positioning accuracy. Based on the fitted straight line mapping boundary position, it fully utilizes the overall contour features of the target point cloud rather than relying on a single discrete point, making the front and rear boundary positions of the vehicle more closely match the actual side profile of the vehicle, resulting in strong stability. Position calculation can be completed simply by substituting coordinates into the straight line equation, which is simple to operate and does not involve complex iteration processes. It can quickly output accurate boundary positions, adapting to the high real-time requirements of intelligent driving perception systems. For the characteristic of ultra-long vehicles where the front and rear exceed the visual range, it uses front and rear radars to fit straight lines mapping boundaries, accurately capturing the extreme positions at both ends of the vehicle, providing reliable endpoint data for subsequent length calculations, and ensuring the accuracy of ultra-long vehicle length detection.

[0101] This invention, in its embodiment, determines the endpoint position by substituting the coordinates of the farthest target point cloud into the fitted straight line, rather than directly using the original point cloud coordinates, effectively avoiding interference from single-point noise. The fitted straight line has filtered out local point cloud errors, and the endpoint is determined by mapping from the straight line, eliminating the influence of a single outlier on the endpoint positioning. This ensures the stability and accuracy of the endpoint positions of the vehicle's front and rear, avoids endpoint jumps caused by sparse or discontinuous point clouds, makes the distance calculation between two points more accurate, and ensures that the length estimation results are stable between frames without significant fluctuations.

[0102] Step S209: Determine the length of the second vehicle based on the distance between the first and second positions. See details below. Figure 1 The relevant description of step S106 shown will not be repeated here.

[0103] Step S210: Determine the target slope based on the first slope of the first straight line and the second slope of the second straight line.

[0104] Specifically, step S210 includes: determining the average of the first slope and the second slope as the target slope.

[0105] For example, a first straight line is obtained by fitting the first target point set, and its equation can be expressed as: ,in This is the first slope, reflecting the degree of inclination of the second vehicle's frontal side near the vehicle boundary; the second straight line is obtained by fitting the set of second target points, and its equation can be expressed as: ,in This is the second slope, reflecting the degree of tilt of the rear side near the vehicle boundary of the second vehicle. The system weights and fuses the first and second slopes, calculates their average value, and uses this average value as the target slope to characterize the average tilt state of the overall side boundary of the second vehicle, eliminating errors caused by local tilt differences between the front and rear of the vehicle.

[0106] Furthermore, in practical applications, the maximum or minimum value of the first slope and the second slope can be determined as the target slope according to actual needs, and this invention is not limited thereto.

[0107] This invention simplifies the heading angle calculation logic and reduces algorithm complexity by using the average slope of the preceding and following straight lines as the target slope. Through averaging, the impact of single radar point cloud fitting errors on the heading angle is mitigated, avoiding local point cloud anomalies that could cause the slope to deviate from the true value. This improves the stability and robustness of the heading angle calculation, enhancing algorithm efficiency while maintaining accuracy, and adapting to the real-time computing needs of vehicle-mounted systems.

[0108] Step S211: Based on the target slope, determine the heading angle of the second vehicle relative to the first vehicle.

[0109] Specifically, the target slope characterizes the degree of inclination of the second vehicle's side boundary relative to the X-axis of the vehicle's coordinate system. According to analytical geometry, the target slope and the heading angle satisfy a tangent relationship: .

[0110] in, For the target slope, This is the heading angle of the second vehicle relative to the first vehicle, used to describe the angle of deviation between the two vehicles' directions of travel. When the heading angle is 0°, it means that the two vehicles are completely parallel; the larger the absolute value of the heading angle, the greater the deviation between the two vehicles' headings.

[0111] For example, the target slope Substitute into the formula to calculate the heading angle: This indicates that the second vehicle is basically parallel to the first vehicle, with a slight heading deviation.

[0112] Step S212: Correct the vehicle length based on the heading angle to obtain the corrected vehicle length.

[0113] Specifically, since the heading angle is not 0°, directly calculating the straight-line distance between the two points will introduce projection errors, requiring heading correction along the actual driving direction of the second vehicle. Let the uncorrected straight-line distance between the two points be Lraw, and the heading angle be... The corrected vehicle length Lcorrect is: By using cosine projection, the straight-line distance in the tilt direction is converted into the length along the vehicle's actual heading, thus eliminating measurement deviations caused by yaw.

[0114] Furthermore, step S212 above can also be modified as follows: assuming the coordinates of the first position and the second position are respectively... and The corrected vehicle length, i.e., the projected length, along the vehicle's heading can be calculated using the following formula: Assume the critical points of the vehicle's front boundary. Key points of the rear boundary of the car Calculate the projected length along the vehicle's heading:

[0115] This invention determines the heading angle based on the slope of the fitted straight line from the front and rear radars, and corrects the vehicle length accordingly. This effectively solves the problem of deviation caused by directly calculating the distance between two points when the vehicle is not parallel to a vehicle on the side. The heading angle correction can eliminate the ranging error caused by the target vehicle's yaw, making the length calculation closer to the actual extension direction of the vehicle, further improving the accuracy of length estimation, and avoiding misjudgment of length due to vehicle attitude deviation. It is especially suitable for high-speed parallel driving and scenarios with slight vehicle attitude tilt, enhancing the matching degree between the perception results and the actual situation.

[0116] Step S213: Based on the vehicle type, determine the vehicle length compensation value. The vehicle length compensation value is used to characterize the standard length of the low radar cross section area of ​​the front and rear of the vehicle corresponding to the vehicle type.

[0117] Specifically, millimeter-wave radar is sensitive to areas with strong metal reflection, but has weak reflection and is difficult to detect areas with low radar cross-sections, such as plastic bumpers, rubber parts, and gaps in anti-collision beams. This results in radar point clouds typically ending at the inner edge of the metal at the front and rear of the vehicle, making the measured length slightly shorter than the actual physical length. The system pre-establishes a vehicle length compensation value lookup table based on different vehicle types, and presets corresponding standard compensation lengths for the dimensions of the low radar cross-section areas at the front and rear of each type of vehicle. When the visual detection outputs the target vehicle type, the system queries this lookup table to retrieve the matching vehicle length compensation value.

[0118] For example, in the preset lookup table, the compensation value corresponding to semi-trailers / heavy trucks is 0.5m; the target vehicle type output by the visual inspection in this case is "semi-trailer", and the vehicle length compensation value is obtained by querying. It is used to compensate for areas with low radar cross-section, such as the plastic bumpers at the front and rear of the vehicle.

[0119] Step S214: Compensate the vehicle length based on the vehicle length compensation value to obtain the compensated vehicle length.

[0120] Specifically, based on the corrected vehicle length obtained from the heading correction, a vehicle length compensation value is added to compensate for the low radar cross-section areas at the front and rear that cannot be detected by radar, so that the final length is closer to the actual physical length of the vehicle.

[0121] For example, the final output length Although the estimated value is slightly less than the actual 22m (due to the physical limitations of the radar itself, which cannot cover the entire front of the vehicle), it is far greater than the length of a normal vehicle, which is enough to accurately trigger the "extra-long vehicle" response strategy. Moreover, the estimated value is extremely stable between frames and will not fluctuate significantly like the visual value.

[0122] This invention determines the length compensation value based on vehicle type, specifically addressing the radar's insensitivity to low-scattering-section areas at the front and rear of vehicles. Since different vehicle types have varying blind spot lengths, this classification compensation accurately matches the physical characteristics of various vehicles, eliminating the length underestimation caused by the inherent radar detection blind spot. The compensated length is closer to the vehicle's true physical length, avoiding misjudgments of oversized vehicles due to missing end-point detection. It is suitable for various oversized vehicle types such as trucks and semi-trailers, improving the accuracy of perception results.

[0123] In some optional implementations, the lateral vehicle length detection method provided in this embodiment of the invention further includes: when the vehicle length exceeds a preset length, performing lane-changing decision planning based on the vehicle length, and adjusting the lateral warning area of ​​the first vehicle based on the vehicle length.

[0124] Specifically, the system pre-sets a length threshold (e.g., 18 meters) to define oversized vehicles. After obtaining the compensated vehicle length, it compares it with the preset length threshold: if the vehicle length exceeds the preset length, the target vehicle is determined to be an oversized vehicle, and the driving strategy needs to be adjusted accordingly. In lane-changing decision-making, the system calculates the time required for the oversized vehicle to completely pass the vehicle by combining the actual length of the oversized vehicle, the current speed, the relative position and speed of the two vehicles, and reserves an extra safety margin in the decision-making process to avoid rashly changing lanes during parallel driving with oversized vehicles. In terms of lateral warning, the lateral warning area is dynamically expanded according to the length of the oversized vehicle. For example, the warning range is extended longitudinally backward along the vehicle, focusing on covering the blind spot in the middle and rear of the trailer of the oversized vehicle, monitoring in real time for any close approach risks in this area, and preventing scraping collisions when changing lanes in the middle of the oversized vehicle. Based on accurate length determination of oversized vehicles, targeted delays in lane-changing decisions and the reservation of safety margins fundamentally avoid the risk of collisions when parallel driving with oversized vehicles, significantly improving high-speed driving safety. It also expands the warning area according to the length of extra-long vehicles, accurately covering the blind spots of trailer extensions, solving the shortcoming that ordinary warning modes cannot cover the rear of extra-long vehicles, and realizing full-section risk monitoring.

[0125] For example, the preset length threshold is 18 meters, and the compensated vehicle length is 20.3 meters. If the length exceeds the threshold, the vehicle is identified as an oversized semi-trailer truck. When making a lane-changing decision, it is calculated that the vehicle will need an additional 2.5 seconds to pass completely, thus forcibly delaying the lane-changing opportunity. The lateral warning area extends 8 meters backward along the rear of the vehicle to continuously monitor the blind spot of the rear half of the trailer and avoid the risk of lane changing in the middle of parallel driving.

[0126] This invention, based on accurately detected extra-long vehicle length, dynamically adjusts lane-changing decisions and warning zones to achieve a closed loop of perception, decision-making, and warning. Extra-long vehicles require a longer safety distance for lane changes; targeted planning can avoid misjudgments. Expanding the warning zone can cover trailer blind spots, preventing mid-lane change collisions. By accurately matching the risk characteristics of extra-long vehicles, the length perception results are transformed into safety protection strategies, mitigating concurrent risks from both decision-making and warning perspectives, and comprehensively ensuring driving safety.

[0127] The following will provide a detailed explanation of the specific working process of the vehicle length detection system built using the lateral vehicle length detection method provided in this embodiment of the invention, with reference to specific application examples.

[0128] First, the system is deployed on smart cars equipped with cameras and front / rear corner millimeter-wave radar. The main working process of the system is as follows: Figure 4A As shown, a detailed description is given using the example of a car traveling at high speed and a truck approximately 22 meters long traveling parallel to it in the adjacent lane on the right (with a negative Y-coordinate and the direction of the truck's front being the positive X-axis): Initialization and calibration: When the system starts, the calibration parameters of the camera and radar are loaded. The radar and camera synchronize data through CAN bus or Ethernet. Time synchronization is completed with a timestamp alignment error of <10ms.

[0129] S1 / S2: The bird's-eye view vision system outputs a target T1. , Due to the near-field truncation, the visual bounding box Bvisual_1 only covers a general area in the vehicle coordinate system. , The visual model cannot perceive its true length; the incomplete box serves only as an anchor point.

[0130] S3 Association and Clustering: In the front corner radar point cloud, the Y coordinate is in Between, and the X coordinate is located between Points within a 25m radius or within a 5m radius are associated. After clustering, a main cluster Cfront_main is obtained, containing approximately 30 points, concentrated in... , .

[0131] In the rear corner radar point cloud, following the same logical association, clustering yields the main cluster Crear_main, containing approximately 25 points, concentrated in... , .

[0132] S4 filtering: SOR filtering is performed on both main clusters separately. , ) and relative ground plane height filtering, each removing 2-3 noise points.

[0133] S5 Core Boundary Extraction: For Cfront_main: the target is on the right, so the "near-vehicle side boundary" is defined as the boundary with the largest Y-coordinate. The X-axis slice width is set to 0.2 meters. Within the slice, there are 3 points; the one with the largest Y value is... , denoted as candidate points. Within the slice, take the point with the maximum Y value. And so on, processing continues until... Approximately 20 candidate boundary points were obtained. The RANSAC line fitting algorithm was used to fit these candidate points (maximum number of iterations 1000, interior point distance threshold 0.1 meters), resulting in the line Lfront, whose equation is: (The slope is close to 0, consistent with the straight side profile of a truck). The maximum X-coordinate determined from all candidate points is 24.9. Substituting into the fitted line equation, we get This is the key point of the vehicle's front boundary. It corresponds to the left front corner of the truck closest to the vehicle. The key point of this step is that it is calculated from the fitted straight line, rather than directly taking the original maximum point, thus eliminating the interference of single-point noise.

[0134] Processing Crear_main: The slicing method is also used; within each slice along the X dimension, the point with the maximum Y value is selected. For example, in... Within the slice, take the point with the maximum Y value. Forward processing to The candidate point set is obtained. RANSAC fitting yields the straight line Lesser: The minimum value for determining the X-coordinate from the candidate points is 5.1. Substituting into the fitted line equation, we get This is the key point of the rear boundary of the vehicle. It corresponds to the left rear corner of the truck. For example, a radar point cloud-visual target association diagram is shown below. Figure 4B As shown.

[0135] S6 Length Calculation and Compensation Output: Heading correction calculation: Forward boundary slope Slope of the back boundary line Take the average slope Calculate the target vehicle's heading angle. .

[0136] Calculate the projected length along the vehicle's heading:

[0137] Endpoint physical compensation: The system retrieves the endpoint physical compensation length based on the "truck" category output by S2. Final output length .

[0138] S7 downstream applications: regulatory control module judgment If a vehicle is confirmed to be oversized, the driver must wait for it to pass completely before making a lane change decision, and allow an additional 1.5 seconds of safety margin. The side warning module extends the warning area along the negative X-axis to cover the blind spot in the middle and rear of the trailer, preventing the vehicle from scraping when changing lanes in the middle of an oversized vehicle.

[0139] Real-vehicle testing shows that in complex urban road and highway scenarios, the system's length estimation error for vehicles over 18m is less than 5%, significantly better than the mean square error of using only BEV images. Compared with the "simple point selection" scheme, the present invention improves the detection stability by more than 30% in rainy or snowy weather or when radar point clouds are sparse and discontinuous, fundamentally solving the safety hazard of lateral long vehicle perception failure.

[0140] The side vehicle length detection scheme provided in this invention utilizes front and rear corner radars to capture local side point clouds of the vehicle's front and rear, respectively. It then directly calculates the distance between the two points using geometric methods, improving the length estimation accuracy from the meter level of visual perception to the decimeter level inherent to radar, with stable results and no inter-frame jitter. Addressing the phenomenon of visual truncation boxes, a "lateral consistency + longitudinal extension" association strategy is adopted, effectively recovering effective point clouds from distant radars that extend beyond the visual truncation box range, solving the problem of traditional near-range association methods failing in truncation scenarios. Furthermore, through a two-stage processing approach of "slicing for extreme values, robust linear fitting, and calculating key points from the straight line," reliable boundary segments are reconstructed from the local point cloud, fundamentally avoiding sensitivity to individual noise points. Compared to the scheme of "directly taking the extreme point from the original point cloud," it has extremely high reliability. By introducing heading angle projection calculation, the ranging error when the target vehicle is not perfectly parallel to the vehicle itself is eliminated; and by introducing end-point physical compensation, the inherent defect of radar inability to detect areas with low radar cross-sections is compensated, making the measurement results closer to the physical true value. In addition, it is specifically optimized for the "side-extended vehicle" scenario, which does not require radar point cloud to cover the entire length of the vehicle, nor does it rely on a stable visual frame or tracking trajectory, and can still work reliably when vision fails completely or the point cloud is discontinuous.

[0141] This embodiment also provides a lateral vehicle length detection device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0142] This embodiment provides a lateral vehicle length detection device, applied to a first vehicle, wherein radars are respectively installed at the four corners of the vehicle body, such as... Figure 5 As shown, the lateral vehicle length detection device includes: The acquisition module 501 is used to acquire the visual detection results of the second vehicle located to the side of the first vehicle, as well as the first point cloud data collected by the front radar and the second point cloud data collected by the rear radar located to the side of the second vehicle. The visual detection results include at least the position information of the second vehicle. The first processing module 502 is used to filter the first point cloud data and the second point cloud data based on location information to obtain the third point cloud data and the fourth point cloud data. The second processing module 503 is used to filter target point clouds that are close to the first vehicle from the third point cloud data and the fourth point cloud data respectively, to obtain the first target point cloud set and the second target point cloud set. The third processing module 504 is used to perform line fitting on the first target point cloud and the second target point cloud respectively to obtain the first straight line and the second straight line; The fourth processing module 505 is used to map the farthest first target point cloud in the first target point cloud along the direction of the front of the first vehicle onto a first straight line to determine a first position, and to map the farthest second target point cloud in the second target point cloud along the direction of the rear of the first vehicle onto a second straight line to determine a second position. The fifth processing module 506 is used to determine the length of the second vehicle based on the distance between the first position and the second position.

[0143] In some alternative implementations, the lateral vehicle length detection device further includes: The sixth processing module is used to determine the target slope based on the first slope of the first straight line and the second slope of the second straight line; The seventh processing module is used to determine the heading angle of the second vehicle relative to the first vehicle based on the target slope; The eighth processing module is used to correct the vehicle length based on the heading angle to obtain the corrected vehicle length.

[0144] In some alternative implementations, the sixth processing module includes: The first processing unit is used to determine the average of the first slope and the second slope as the target slope.

[0145] In some optional implementations, the visual detection result further includes: the vehicle type of the second vehicle, and the lateral vehicle length detection device further includes: The ninth processing module is used to determine the vehicle length compensation value based on the vehicle type. The vehicle length compensation value is used to characterize the standard length of the low radar cross section area of ​​the front and rear of the vehicle corresponding to the vehicle type. The tenth processing module is used to compensate the vehicle length based on the vehicle length compensation value to obtain the compensated vehicle length.

[0146] In some alternative implementations, the first processing module 502 includes: The second processing unit is used to convert the location information, the first point cloud data, and the second point cloud data into the vehicle coordinate system of the first vehicle, respectively. The third processing unit is used to extend the first region corresponding to the location information by a preset distance towards the front and rear of the first vehicle, respectively, to obtain the second region; The fourth processing unit is used to filter point cloud data belonging to the second region from the first point cloud data, and perform clustering to obtain several first point cloud clusters, and determine the first point cloud cluster with the most point cloud data as the third point cloud data. The fifth processing unit is used to filter point cloud data belonging to the second region from the second point cloud data, and perform clustering to obtain several second point cloud clusters. The second point cloud cluster with the most point cloud data is determined as the fourth point cloud data.

[0147] In some alternative implementations, the second processing module 503 includes: The sixth processing unit is used to divide the third point cloud data and the fourth point cloud data along the direction of the vehicle head to obtain several first slice data and several second slice data. The seventh processing unit is used to extract the target point cloud closest to the first vehicle from each first slice of data to form a first target point cloud set, and to extract the target point cloud closest to the first vehicle from each second slice of data to form a second target point cloud set.

[0148] In some alternative implementations, the fourth processing module 505 includes: The eighth processing unit is used to take the coordinate values ​​of the first target point cloud along the direction of the vehicle head as the coordinate values ​​of the first straight line along the direction of the vehicle head, substitute them into the equation of the straight line corresponding to the first straight line, and determine the first position. The ninth processing unit is used to take the coordinate values ​​of the second target point cloud along the rear direction of the vehicle as the coordinate values ​​of the second straight line along the rear direction of the vehicle, substitute them into the equation of the corresponding straight line of the second straight line, and determine the second position.

[0149] In some alternative implementations, the lateral vehicle length detection device further includes: The eleventh processing module is used to acquire a first image of the side region of the first vehicle; The twelfth processing module is used to perform vehicle target detection on the first image and obtain visual detection results. The visual detection results include at least: the location information of the detected target vehicle and the vehicle type of the target vehicle. The thirteenth processing module is used to identify the target vehicle as the second vehicle when the target vehicle type is a preset extra-long vehicle type. The preset extra-long vehicle type is used to indicate that the vehicle length exceeds the preset length.

[0150] In some alternative implementations, the lateral vehicle length detection device further includes: The fourteenth processing module is used to determine whether the number of points in the third point cloud data and the fourth point cloud data is greater than the preset point cloud number threshold. The fifteenth processing module is used to calculate the average distance between each point cloud in the third point cloud data and the preset number of adjacent point clouds when the number of point clouds in the third point cloud data and the fourth point cloud data are both greater than the preset point cloud number threshold. The sixteenth processing module is used to remove outliers in the third point cloud data based on the mean and standard deviation of the average distances corresponding to all point clouds in the third point cloud data, and to remove outliers in the fourth point cloud data based on the mean and standard deviation of the average distances corresponding to all point clouds in the fourth point cloud data. The seventeenth processing module is used to remove point cloud data from the third and fourth point cloud data whose ground altitude is outside the preset altitude range; The eighteenth processing module is used to re-execute the steps of acquiring the visual detection results of the second vehicle located on the side of the first vehicle and the first point cloud data and the second point cloud data acquired by the front radar and the rear radar located on the side of the second vehicle when the number of point clouds in the third point cloud data and / or the fourth point cloud data is not greater than the preset point cloud number threshold.

[0151] In some alternative implementations, the lateral vehicle length detection device further includes: The nineteenth processing module is used to make lane-changing decisions and plans based on the vehicle length when the vehicle length exceeds the preset length, and to adjust the lateral warning area of ​​the first vehicle based on the vehicle length.

[0152] The lateral vehicle length detection device provided in this embodiment of the invention can execute the lateral vehicle length detection method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.

[0153] Figure 6 This is a schematic diagram of a vehicle controller provided in an embodiment of the present invention. The vehicle body has radars installed at each of its four corners.

[0154] The following is a detailed reference. Figure 6 The diagram illustrates a structural schematic suitable for implementing a controller in an embodiment of the present invention. The controller may include a processor (e.g., a central processing unit, graphics processor, etc.) 601, which can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) 602 or a program loaded from memory 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of the electronic device. The processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0155] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows the controller to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 A controller with various devices is shown, but it should be understood that it is not required to implement or have all of the devices shown, and may alternatively implement or have more or fewer devices.

[0156] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a memory 608, or installed from a ROM 602. When the computer program is executed by the processor 601, it performs the functions defined in the lateral vehicle length detection method of the embodiments of the present invention.

[0157] Figure 6 The controller shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0158] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the lateral vehicle length detection method shown in the above embodiments is implemented.

[0159] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0160] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for detecting the length of a vehicle from the side, applied to a first vehicle, wherein radars are respectively installed at the four corners of the vehicle body, characterized in that, The method includes: The visual detection results of the second vehicle located to the side of the first vehicle are obtained, as well as the first point cloud data collected by the front radar and the second point cloud data collected by the rear radar located to the side of the second vehicle. The visual detection results include at least the position information of the second vehicle. Based on the location information, the first point cloud data and the second point cloud data are filtered respectively to obtain the third point cloud data and the fourth point cloud data; Target point clouds that are close to the first vehicle are selected from the third point cloud data and the fourth point cloud data respectively to obtain the first target point cloud set and the second target point cloud set; Linear fitting is performed on the first target point cloud and the second target point cloud respectively to obtain the first straight line and the second straight line; Map the farthest first target point cloud in the first target point cloud set along the direction of the front of the first vehicle onto the first straight line to determine the first position, and map the farthest second target point cloud in the second target point cloud set along the direction of the rear of the first vehicle onto the second straight line to determine the second position; The length of the second vehicle is determined based on the distance between the first and second positions.

2. The method according to claim 1, characterized in that, The method further includes: The target slope is determined based on the first slope of the first line and the second slope of the second line; Based on the target slope, determine the heading angle of the second vehicle relative to the first vehicle; The vehicle length is corrected based on the heading angle to obtain the corrected vehicle length.

3. The method according to claim 1, characterized in that, Determining the target slope based on the first slope of the first straight line and the second slope of the second straight line includes: The average of the first slope and the second slope is determined as the target slope.

4. The method according to any one of claims 1-3, characterized in that, The visual detection result also includes: the vehicle type of the second vehicle, and the method further includes: Based on the vehicle type, a vehicle length compensation value is determined. The vehicle length compensation value is used to characterize the standard length of the low radar cross section area at the front and rear of the vehicle corresponding to the vehicle type. The vehicle length is compensated based on the vehicle length compensation value to obtain the compensated vehicle length.

5. The method according to claim 1, characterized in that, The step of filtering the first point cloud data and the second point cloud data based on the location information to obtain the third point cloud data and the fourth point cloud data includes: The location information, the first point cloud data, and the second point cloud data are respectively converted to the vehicle coordinate system of the first vehicle; The first region corresponding to the location information is extended by a preset distance towards the front and rear of the first vehicle, respectively, to obtain a second region; Filter point cloud data belonging to the second region from the first point cloud data, and perform clustering to obtain several first point cloud clusters. The first point cloud cluster with the most point cloud data is determined as the third point cloud data. Point cloud data belonging to the second region are selected from the second point cloud data and clustered to obtain several second point cloud clusters. The second point cloud cluster with the most point cloud data is determined as the fourth point cloud data.

6. The method according to claim 5, characterized in that, The step of filtering target point clouds near the first vehicle from the third point cloud data and the fourth point cloud data respectively to obtain a first target point cloud set and a second target point cloud set includes: The third point cloud data and the fourth point cloud data are respectively divided along the direction of the vehicle head to obtain several first slice data and several second slice data; The target point cloud closest to the first vehicle is extracted from each of the first slice data to form a first target point cloud set, and the target point cloud closest to the first vehicle is extracted from each of the second slice data to form a second target point cloud set.

7. The method according to claim 1, characterized in that, The step of mapping the farthest first target point cloud in the first target point cloud set along the direction of the front of the first vehicle onto the first straight line to determine the first position, and mapping the farthest second target point cloud in the second target point cloud set along the direction of the rear of the first vehicle onto the second straight line to determine the second position, includes: The coordinates of the first target point cloud along the direction of the vehicle's front are used as the coordinates of the first straight line along the direction of the vehicle's front. These coordinates are then substituted into the equation of the first straight line to determine the first position. The coordinates of the second target point cloud along the rear direction of the vehicle are used as the coordinates of the second straight line along the rear direction of the vehicle. These coordinates are then substituted into the equation of the corresponding straight line to determine the second position.

8. The method according to claim 1, characterized in that, Before acquiring the visual detection results of the second vehicle located to the side of the first vehicle, and the first point cloud data collected by the front radar and the second point cloud data collected by the rear radar located to the side of the second vehicle, the method further includes: Acquire a first image of the side region of the first vehicle; Vehicle target detection is performed on the first image to obtain visual detection results, which include at least: the location information of the detected target vehicle and the vehicle type of the target vehicle; When the target vehicle is of a preset extra-long vehicle type, the target vehicle is identified as the second vehicle, and the preset extra-long vehicle type is used to indicate that the vehicle length exceeds a preset length.

9. The method according to claim 5, characterized in that, The method further includes: Determine whether the number of points in the third point cloud data and the fourth point cloud data is greater than a preset point cloud number threshold. When the number of point clouds in both the third and fourth point cloud data is greater than a preset point cloud number threshold, the average distance between each point cloud in the third and fourth point cloud data and a preset number of adjacent point clouds is calculated respectively. Based on the mean and standard deviation of the average distances corresponding to all point clouds in the third point cloud data, outliers in the third point cloud data are removed, and based on the mean and standard deviation of the average distances corresponding to all point clouds in the fourth point cloud data, outliers in the fourth point cloud data are removed. Remove point cloud data whose ground elevation is outside the preset height range from the third and fourth point cloud data. If the number of point clouds in the third point cloud data and / or the fourth point cloud data is not greater than a preset point cloud number threshold, the steps of acquiring the visual detection results of the second vehicle located to the side of the first vehicle and the first point cloud data collected by the front radar and the second point cloud data collected by the rear radar located to the side of the second vehicle are re-executed.

10. The method according to claim 4, characterized in that, The method further includes: When the vehicle length exceeds a preset length, a lane-changing decision-making plan is made based on the vehicle length, and the lateral warning area of ​​the first vehicle is adjusted based on the vehicle length.

11. A lateral vehicle length detection device, applied to a first vehicle, wherein radars are respectively installed at the four corners of the vehicle body, characterized in that, The device includes: The acquisition module is used to acquire the visual detection results of the second vehicle located to the side of the first vehicle, as well as the first point cloud data collected by the front radar and the second point cloud data collected by the rear radar located to the side of the second vehicle. The visual detection results include at least the position information of the second vehicle. The first processing module is used to filter the first point cloud data and the second point cloud data based on the location information to obtain the third point cloud data and the fourth point cloud data. The second processing module is used to filter target point clouds that are close to the first vehicle from the third point cloud data and the fourth point cloud data respectively, to obtain a first target point cloud set and a second target point cloud set. The third processing module is used to perform line fitting on the first target point cloud and the second target point cloud respectively to obtain the first straight line and the second straight line; The fourth processing module is used to map the farthest first target point cloud in the first target point cloud along the direction of the front of the first vehicle onto the first straight line to determine the first position, and to map the farthest second target point cloud in the second target point cloud along the direction of the rear of the first vehicle onto the second straight line to determine the second position. The fifth processing module is used to determine the length of the second vehicle based on the distance between the first position and the second position.

12. A vehicle, wherein radars are respectively installed at the four corners of the vehicle body, characterized in that, The vehicle includes: a controller, the controller comprising: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 10.

14. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the method of any one of claims 1 to 10.