Vehicle distance measurement method and apparatus, and vehicle, medium and program
By using image acquisition equipment to identify and detect lane lines and vehicle dimensions, and combining imaging parameters and lane line compensation, the problems of accuracy and cost in radar ranging are solved, the ranging error of the camera on the slope is optimized, and the user experience is improved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- CHONGQING CHANGAN AUTOMOBILE CO LTD
- Filing Date
- 2026-01-20
- Publication Date
- 2026-07-30
AI Technical Summary
In existing technologies, it is difficult to balance measurement accuracy and hardware cost when using radar for distance measurement. Furthermore, pure vision-based camera solutions have low ranging accuracy on slopes and are prone to misidentifying false targets, resulting in a reduced user experience.
By acquiring road images from image acquisition devices, the system identifies and detects actual lane line parameters and the size of vehicles ahead. It then calculates the distance by combining imaging parameters and corrects the distance using baseline horizon and lane line compensation parameters, filtering out false targets and improving ranging accuracy.
It enables accurate measurement of distance to vehicles ahead with low-cost hardware, reducing misjudgments and false braking, improving user experience, and especially enhancing the accuracy of distance perception in slope scenarios.
Smart Images

Figure CN2026073800_30072026_PF_FP_ABST
Abstract
Description
Vehicle ranging methods, devices, vehicles, media and procedures
[0001] This application claims priority to Chinese Patent Application No. 2025100948905, filed on January 21, 2025, entitled “Vehicle Distance Measurement Method, Apparatus, Vehicle, Medium and Procedure”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of intelligent driving technology, specifically to vehicle ranging methods, devices, vehicles, media, and programs. Background Technology
[0003] Advanced Driver Assistance Systems (ADAS), based on the rapid development of vision sensors, provide drivers with more comprehensive traffic environment information, reducing driver fatigue and assisting them in avoiding collision risks in a timely manner. Accurately detecting the speed and distance of vehicles ahead is fundamental to the vehicle control capabilities of ADAS systems.
[0004] Existing technologies utilize millimeter-wave radar, ultrasonic radar, lidar, and cameras to measure the distance to a vehicle ahead. Ultrasonic radar is significantly affected by weather conditions and has a short maximum ranging range, limiting its application to low-speed scenarios. Millimeter-wave radar offers high accuracy and fast convergence, and is less affected by environmental factors, but it is susceptible to multipath reflections and may misidentify false targets. LiDAR provides accurate ranging, but its performance is greatly affected by weather conditions; rain and snow reduce its effectiveness, and its higher cost leads to a poorer user experience. While pure vision-based camera solutions are less expensive, their ranging accuracy is relatively low. Summary of the Invention
[0005] In view of this, this application provides a vehicle ranging method, device, vehicle, medium, and program to solve the problem of balancing measurement accuracy and hardware cost when using radar for distance measurement in the prior art.
[0006] In a first aspect, this application provides a vehicle ranging method, the method comprising:
[0007] The system acquires road images captured by image acquisition devices, performs recognition and detection on the road images, and obtains actual lane line parameters, actual size of vehicles ahead, and image size of vehicles ahead in the road images.
[0008] Based on the imaging parameters calibrated by the image acquisition equipment, the actual size, and the image size, the first distance between this vehicle and the vehicle in front, as well as the wheel end grounding height between the wheel end of the vehicle in front and the horizontal line, are obtained.
[0009] Based on the baseline horizontal height, first distance, and wheel-end ground contact height calibrated by the image acquisition equipment, determine the vehicle in front of the target;
[0010] Based on the actual lane line parameters and the baseline lane line calibrated by the image acquisition equipment, lane line compensation parameters are obtained. The first distance corresponding to the vehicle in front of the target is corrected according to the lane line compensation parameters to obtain the second distance between the vehicle and the vehicle in front of the target.
[0011] Beneficial Effects: This application identifies and detects road images acquired by an image acquisition device, obtaining actual lane line parameters, the actual size of the vehicle ahead, and the image size. The hardware cost is low. Based on these parameters and the imaging parameters of the image acquisition device, a first distance between the vehicle and the vehicle ahead, as well as the wheel-end contact height of the vehicle ahead, are obtained. Next, the wheel-end contact height of the vehicle ahead is verified using a reference horizontal line height and the first distance, filtering out false targets with abnormal heights not on the actual road, thus confirming the target vehicle ahead and preventing misjudgment that could cause vehicle jerking or false braking, thereby improving the user experience. Finally, the initially calculated first distance is corrected based on the actual lane line parameters and the calibrated reference lane line to obtain a more accurate second distance between the vehicle and the target vehicle ahead.
[0012] In some optional implementations, determining the vehicle ahead of the target based on the reference horizontal line height calibrated by the image acquisition device, a first distance, and the wheel-end ground contact height includes:
[0013] Based on the slope threshold and the height of the baseline horizontal line calibrated by the image acquisition equipment, a distance reference value is obtained;
[0014] Vehicles in front that do not meet the filtering criteria are identified as target vehicles in front. The filtering criteria are: the first distance to the vehicle in front is not less than the distance reference value and the wheel end ground contact height is greater than the reference horizontal line height.
[0015] Beneficial effects: This application calculates the distance reference value between the vehicle in front and the vehicle itself when the vehicle in front is below the slope threshold. This facilitates the filtering of vehicles in front with unreasonable distances based on the distance reference value and the first distance, accurately identifies the target vehicle in front, filters out abnormally high targets that are not on the actual road, reduces jerking and false braking problems caused by the use of the driving assistance system, and improves the user experience.
[0016] In some optional implementations, a distance reference value is obtained based on a slope threshold and the height of a baseline horizontal line calibrated by the image acquisition device, including:
[0017] Calculate the tangent value of the slope threshold;
[0018] The distance reference value is calculated based on the ratio of the baseline height to the tangent of the slope threshold.
[0019] Beneficial effects: When the vehicle in front is on a slope relative to the vehicle itself, this application calculates the reference distance between the vehicle in front and the vehicle itself based on the height of the baseline horizontal line calibrated by the camera, which is within the slope threshold. This facilitates the screening of vehicles in front with unreasonable distances according to the reference distance value, thereby filtering out false targets.
[0020] In some optional implementations, lane line compensation parameters are obtained based on actual lane line parameters and a reference lane line calibrated by the image acquisition device. The first distance corresponding to the vehicle ahead of the target is then corrected based on the lane line compensation parameters to obtain a second distance between the vehicle and the vehicle ahead of the target, including:
[0021] Based on the actual lane line parameters and the reference lane line, the first included angle between the actual left lane line and the reference left lane line, and the second included angle between the actual right lane line and the reference right lane line are obtained.
[0022] The lane line compensation parameters are calculated based on the first included angle, the second included angle, and the preset compensation coefficient.
[0023] Based on the lane line compensation parameters and the first distance corresponding to the target vehicle ahead, the second distance between the vehicle and the target vehicle ahead is obtained.
[0024] Beneficial effects: In the case of only a monocular vision perception camera, this application embodiment calculates a more accurate second distance by determining the angle between the actual lane line and the reference lane line to compensate for the first distance between the target vehicle and the vehicle itself. This results in a more accurate perception of the longitudinal distance between the target vehicle and the vehicle, optimizing the problem of inaccurate perception of the longitudinal distance of vehicles on slopes. Furthermore, it filters out abnormally high targets not on actual roads, reducing jerking and accidental braking issues when using the driver assistance system.
[0025] In some optional implementations, lane line compensation parameters are calculated based on the first included angle, the second included angle, and a preset compensation coefficient, including:
[0026] Calculate the sum of the tangents between the first and second included angles;
[0027] The lane line compensation parameters are calculated by multiplying the sum of the tangents with the preset compensation coefficients.
[0028] Beneficial effects: This application calculates lane line compensation parameters for the observed distance between the vehicle ahead and the vehicle based on a preset compensation coefficient, the first angle between the actual left lane line and the reference left lane line, and the second angle between the actual right lane line and the reference right lane line, and compensates for the initially estimated first distance.
[0029] In some optional implementations, based on the actual lane line parameters and the reference lane line, a first angle between the actual left lane line and the reference left lane line, and a second angle between the actual right lane line and the reference right lane line are obtained, including:
[0030] Based on the actual lane line parameters, the first actual orientation of the left lane line and the second actual orientation of the right lane line in the field of view of the image acquisition device are obtained. Based on the reference lane line, the first reference orientation of the left lane line and the second reference orientation of the right lane line in the field of view of the image acquisition device are obtained.
[0031] Based on the first actual orientation and the first reference orientation, the first included angle between the actual left lane line and the reference left lane line is calculated;
[0032] Based on the second actual orientation and the second reference orientation, the second included angle between the actual right lane line and the reference right lane line is calculated.
[0033] Beneficial effects: By determining the angle information between the reference lane line and the actual lane line in the field of view of the image acquisition device, the embodiments of this application facilitate the calculation of the lane line compensation coefficient for the observation distance and reduce the impact of lane line deformation on the accuracy of distance measurement.
[0034] In some optional implementations, based on the imaging parameters of the image acquisition device, the actual size of the vehicle in front, and the image size, the first distance between the vehicle and the vehicle in front, and the wheel-end ground contact height between the wheel ends of the vehicle in front and the horizontal line, are obtained, including:
[0035] The focal length of the image acquisition device is obtained based on its imaging parameters.
[0036] The actual width of the vehicle in front is obtained based on its actual dimensions, and the image width and wheel-end ground contact image height of the vehicle in front are obtained based on the image dimensions.
[0037] The first distance between this vehicle and the vehicle in front is calculated based on the focal length, actual width, and image width.
[0038] Based on the wheel-end grounding image height, the first distance, and the focal length, the wheel-end grounding height between the front vehicle's wheel end and the horizontal line is calculated.
[0039] Beneficial effects: This application embodiment utilizes the principle of similar triangles and, based on the focal length of the image acquisition device, the proportional relationship between the image width and the actual width, and the proportional relationship between the wheel-end grounding image height and the wheel-end grounding height, calculates the first distance between the vehicle and the vehicle in front, as well as the vehicle in front, and preliminarily estimates the observation distance and wheel-end grounding height corresponding to the vehicle in front. Then, it uses the above information to perform target filtering and distance calculation for the vehicle in front, thereby improving the accuracy of distance calculation.
[0040] In some alternative implementations, road images are identified and detected to obtain the actual size of vehicles ahead, including:
[0041] The road image is input into a preset detection model for detection, at least one rectangular detection box is obtained, and the rectangular detection box is identified to determine the vehicle type information and the size information corresponding to the vehicle type information.
[0042] Based on the size information, obtain the actual dimensions of the vehicle in front; wherein the actual dimensions include at least some of the following items: actual length, actual width, and actual height.
[0043] Beneficial effects: The embodiments of this application utilize a preset detection model to detect and recognize road images, and determine the vehicle type information of the vehicle in front through image recognition, thereby obtaining the actual dimensions of the vehicle in front, such as its actual length, actual width, and actual height, which facilitates distance measurement using the obtained actual dimensions.
[0044] Secondly, this application provides a vehicle ranging device, the device comprising:
[0045] The acquisition module is used to acquire road images captured by the image acquisition device, perform recognition and detection on the road images, and obtain the actual lane line parameters, the actual size of the vehicle in front, and the image size of the vehicle in front in the road image.
[0046] The first processing module is used to obtain the first distance between the vehicle and the vehicle in front, and the wheel end grounding height between the wheel end of the vehicle in front and the horizontal line, based on the imaging parameters calibrated by the image acquisition device, the actual size and the image size.
[0047] The second processing module is used to determine the vehicle in front of the target based on the reference horizontal line height, the first distance, and the wheel end ground contact height calibrated by the image acquisition device;
[0048] The third processing module is used to obtain lane line compensation parameters based on the actual lane line parameters and the reference lane lines calibrated by the image acquisition device, and to correct the first distance corresponding to the target vehicle based on the lane line compensation parameters to obtain the second distance between the vehicle and the target vehicle.
[0049] Thirdly, this application provides a vehicle, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the vehicle ranging method of the first aspect or any corresponding embodiment described above.
[0050] Fourthly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to execute the vehicle ranging method of the first aspect or any corresponding embodiment described above.
[0051] Fifthly, this application provides a computer program product, including computer instructions for causing a computer to execute the vehicle ranging method of the first aspect or any corresponding embodiment described above.
[0052] The beneficial effects of this application are as follows:
[0053] This application identifies and detects road images captured by an image acquisition device to obtain actual lane line parameters, the actual size of the vehicle ahead, and the image size. The hardware cost is low. Based on these parameters and the imaging parameters of the image acquisition device, a first distance between the vehicle and the vehicle ahead, as well as the wheel-end contact height of the vehicle ahead, are obtained. Next, the wheel-end contact height of the vehicle ahead is verified using a reference horizontal line height and the first distance, filtering out false targets with abnormal heights not on the actual road, thus confirming the target vehicle ahead and preventing misjudgment that could cause vehicle jerking or false braking, thereby improving the user experience. Finally, the initially calculated first distance is corrected based on the actual lane line parameters and the calibrated reference lane line to obtain a more accurate second distance between the vehicle and the target vehicle ahead. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the specific embodiments of this application or 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 this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0055] Figure 1 is a schematic flowchart of a vehicle ranging method according to an embodiment of this application.
[0056] Figure 2 is a schematic diagram of the reference field of view of the image acquisition device according to an embodiment of this application.
[0057] Figure 3 is a flowchart illustrating another vehicle ranging method according to an embodiment of this application.
[0058] Figure 4 is a schematic diagram of the principle of a similar triangle according to an embodiment of this application.
[0059] Figure 5 is a schematic diagram of a vehicle above a reference horizontal line according to an embodiment of this application.
[0060] Figure 6 is a schematic diagram of lane line compensation calculation according to an embodiment of this application.
[0061] Figure 7 is a flowchart illustrating another vehicle ranging method according to an embodiment of this application.
[0062] Figure 8 is a structural block diagram of a vehicle ranging device according to an embodiment of this application.
[0063] Figure 9 is a schematic diagram of the hardware structure of the vehicle according to an embodiment of this application. Detailed Implementation
[0064] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0065] Accurately detecting the speed and distance of vehicles ahead is fundamental for ADAS (Advanced Driver Assistance Systems) vehicle control. Current industry solutions include millimeter-wave radar, ultrasonic radar, lidar, and cameras. Ultrasonic radar is significantly affected by weather conditions and has a short maximum ranging range, limiting its application to low-speed scenarios. Millimeter-wave radar offers high accuracy and fast convergence, and is less affected by environmental factors, but it is susceptible to multipath reflections, leading to false target identification. LiDAR provides accurate ranging, but its performance is significantly affected by weather conditions; rain and snow reduce its performance, and its higher cost contributes to a poor user experience. While camera-based pure vision solutions are also affected by weather and have lower ranging accuracy than millimeter-wave and lidar, they are generally cheaper, can identify vehicles, pedestrians, and two-wheeled vehicles, have a wide target range, offer high cost-effectiveness, and provide a superior user experience.
[0066] While the related technologies, which use a camera-based pure vision solution to calculate the distance to target vehicles, are relatively accurate in recognizing the distance to targets on flat roads, the distance to targets on distant slopes is greatly affected by the slope. Furthermore, the lack of verification of the height of targets on slopes can lead to false detection of non-vehicle targets with abnormal heights, causing vehicles to brake incorrectly and reducing the user experience.
[0067] Therefore, this application provides a vehicle distance measurement method that calculates the following distance by combining the size parameters, pixel parameters, and camera focal length of the vehicle in front. Simultaneously, it verifies the height between the vehicle in front and the ground contact point with the horizontal baseline of the camera's field of view, filtering out false targets above the baseline at the far end of the field of view to prevent false braking caused by misdetection, thereby improving user experience. Furthermore, it compensates for the following distance based on the left and right lane line parameters of the current lane, reducing calculation deviation and improving the accuracy of distance calculation.
[0068] According to an embodiment of this application, a vehicle ranging method embodiment 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.
[0069] This embodiment provides a vehicle ranging method, which can be used for vehicles equipped with image acquisition devices, such as autonomous vehicles and hybrid vehicles equipped with monocular cameras. Figure 1 is a flowchart of the vehicle ranging method according to an embodiment of this application. As shown in Figure 1, the process includes the following steps:
[0070] Step S101: Acquire road images captured by the image acquisition device, perform recognition and detection on the road images, and obtain the actual lane line parameters, the actual size of the vehicle in front, and the image size of the vehicle in front in the road image.
[0071] Specifically, suitable image acquisition equipment can be selected based on resolution requirements, field of view, and driving environment. For example, a monocular camera used in intelligent transportation systems for road condition monitoring may not have such high resolution requirements; it only needs to be able to identify details such as vehicle logos and model information of vehicles ahead, thus resulting in lower hardware costs. The camera should be installed in a suitable location to obtain the required road view. For vehicle applications, it is generally installed in a suitable position inside the windshield (such as near the rearview mirror) to ensure that its field of view covers the road ahead and minimizes obstruction.
[0072] Furthermore, the installed cameras are calibrated using a checkerboard pattern after the vehicle rolls off the production line. The calibration and compensation are performed based on the camera installation height and wheel arch height output by the host computer. As shown in Figure 2, the reference horizon height at the far end of the camera's field of view is set as Z0, the reference left lane line as L0, and the reference right lane line as L0'.
[0073] It's important to note that a checkerboard calibration tool is a precise calibration tool with a known geometric structure, typically composed of alternating black and white squares. By capturing checkerboard images from different angles and positions, and based on features such as the corner points (the points where black and white squares intersect), the camera's internal parameters (e.g., focal length, optical center position) and external parameters (e.g., the camera's position and orientation relative to the vehicle coordinate system) are determined. Camera calibration ensures that the image data acquired by the camera accurately reflects the real road scene and the vehicle's surrounding environment, which is crucial for subsequent target recognition, distance measurement, lane detection, and other image-based operations.
[0074] Furthermore, calibration compensation can be performed based on the camera's installation height during calibration. Camera installation height refers to the vertical distance of the camera relative to a reference plane of the vehicle (such as the vehicle's chassis plane), while wheel arch height is the vertical distance of a specific position on the vehicle body (at the wheel arch) relative to the vehicle's reference plane. Different installation heights will result in different viewing angles and scales in the images captured by the camera in the vertical direction. For example, a higher installation height may allow the camera to see a greater portion of the road ahead, but it may also make nearby objects appear relatively smaller in the image. In addition, wheel arch height helps to further refine the camera's vertical viewing angle and imaging range during calibration compensation. For instance, when considering changes in the vehicle's attitude during movement (such as vehicle pitch), wheel arch height information can be used along with the installation height as a reference to determine whether the camera's actual vertical position relative to the road plane has changed, thus enabling timely calibration compensation to ensure the accuracy and stability of image acquisition.
[0075] In some alternative implementations, the road image can be preprocessed, such as by grayscale conversion and filtering to effectively remove noise and make the image clearer, which is beneficial for subsequent feature extraction and lane detection. Next, gradient features of the image can be extracted, and edge detection algorithms such as Canny edge detection can be used to extract the edge information of objects in the image. Finally, based on the extracted edge points or feature points, a straight line can be fitted using the least squares method to determine the lane lines.
[0076] Specifically, the road image is input into a preset detection model for detection to obtain at least one rectangular detection box. The rectangular detection box is then identified to determine the vehicle type information and the corresponding size information. Based on the size information, the actual size of the vehicle in front is obtained. The actual size includes at least some of the following items: actual length, actual width, and actual height.
[0077] In some optional implementations, the preset detection model is trained on a large number of images of different vehicle models and can identify the vehicle model information and size information. A camera is used to acquire an image of the vehicle in front. The camera sensor segments the image of the vehicle in front according to the preset detection model, detecting rectangular boxes containing vehicle body outline information. There can be multiple such rectangular boxes, and the length, width, and height of the vehicle in front are identified and retrieved.
[0078] This application embodiment uses a preset detection model to detect and recognize road images. By using image recognition, the model information of the vehicle in front is determined, thereby obtaining the actual dimensions of the vehicle in front, such as its actual length, actual width, and actual height, which is convenient for distance measurement.
[0079] Step S102: Based on the imaging parameters calibrated by the image acquisition device, the actual size, and the image size, obtain the first distance between the vehicle and the vehicle in front, as well as the wheel end grounding height between the wheel end of the vehicle in front and the horizontal line.
[0080] Specifically, the imaging parameters calibrated by the image acquisition device mainly include focal length, intrinsic parameter matrix, and extrinsic parameter matrix. Taking a monocular camera as an example, the ranging principle of monocular vision is based on similar triangles. Knowing the imaging parameters of the camera, such as focal length, by measuring the image size of the vehicle in front in the image and combining the ratio between the actual size and the image size, the initial distance between the vehicle and the vehicle in front, as well as the wheel-end ground contact height, can be preliminarily calculated.
[0081] Step S103: Determine the vehicle in front of the target based on the reference horizontal line height, first distance, and wheel end ground contact height calibrated by the image acquisition device.
[0082] Specifically, to avoid misidentification of non-vehicle targets higher in front of the vehicle, the wheel-end ground contact height is verified based on the baseline horizontal line height of the camera's field of view and the first distance between the vehicle and the vehicle in front. False targets above the baseline at the far end of the camera's field of view are filtered out to prevent misjudgment that could lead to mis-braking or jerking, thus improving the user experience.
[0083] Step S104: Based on the actual lane line parameters and the reference lane line calibrated by the image acquisition device, obtain the lane line compensation parameters. Correct the first distance corresponding to the target vehicle in front based on the lane line compensation parameters to obtain the second distance between the vehicle and the target vehicle in front.
[0084] Specifically, for lane markings on distant slopes, due to the slope's influence, the distant lane markings may appear outward or inward in the camera's image compared to the baseline lane markings. By comparing the actual lane markings with the parameters of the baseline lane markings, lane marking compensation parameters for the current slope are calculated. This compensates for the initially calculated distance, improving the accuracy of distance measurement.
[0085] The ranging method based on an image acquisition device provided in this embodiment identifies and detects road images acquired by the image acquisition device to obtain actual lane line parameters, the actual size of the vehicle ahead, and the image size. This method has low hardware costs. Based on these parameters and the imaging parameters of the image acquisition device, a first distance between the vehicle and the vehicle ahead, as well as the wheel-end contact height of the vehicle ahead, are obtained. Next, the wheel-end contact height of the vehicle ahead is verified using a reference horizontal line height and the first distance, filtering out false targets with abnormal heights not on the actual road, thus confirming the target vehicle ahead and preventing misjudgment that could cause vehicle jerking or false braking, thereby improving the user experience. Finally, the initially calculated first distance is corrected based on the actual lane line parameters and the calibrated reference lane line to obtain a more accurate second distance between the vehicle and the target vehicle ahead.
[0086] This embodiment provides a vehicle ranging method, which can be used for vehicles equipped with image acquisition devices, such as autonomous vehicles and hybrid vehicles equipped with a monocular camera. Figure 3 is a flowchart of the vehicle ranging method according to an embodiment of this application. As shown in Figure 3, the process includes the following steps:
[0087] Step S301: Acquire a road image captured by the image acquisition device, perform recognition and detection on the road image to obtain the actual lane line parameters, the actual size of the vehicle ahead, and the image size of the vehicle ahead in the road image. For details, please refer to step S101 of the embodiment shown in Figure 1, which will not be repeated here.
[0088] Step S302: Based on the imaging parameters calibrated by the image acquisition device, the actual size, and the image size, obtain the first distance between the vehicle and the vehicle in front, as well as the wheel end grounding height between the wheel end of the vehicle in front and the horizontal line.
[0089] In some optional implementations, step S302 above includes the following steps:
[0090] Step a1: Obtain the focal length f of the image acquisition device based on its imaging parameters.
[0091] Step a2: Obtain the actual width W of the vehicle in front based on the actual dimensions, and obtain the image width w and wheel-end ground contact image height z of the vehicle in front based on the image dimensions.
[0092] Step a3: Calculate the first distance D1 between the vehicle and the vehicle in front based on the focal length f, the actual width W, and the image width w.
[0093] For example, as shown in Figure 4, based on the principle of similar triangles, we can obtain w:W = f:D1, and thus solve for the first distance D1 between the vehicle and the vehicle in front. For instance, according to the preset detection model, the actual width W of the vehicle in front is 2m, the camera image width w is 0.045m, and the focal length f is 2m. Therefore, the first distance D1 between the vehicle and the vehicle in front can be obtained as D1 = 2 / 0.045*2, which calculates to be 89m.
[0094] Step a4: Based on the wheel-end grounding image height h, the first distance D1, and the focal length f, calculate the wheel-end grounding height Z1 between the wheel end of the vehicle in front and the horizontal line.
[0095] For example, based on the principle of similar triangles, we can obtain z:Z1=f:D1, and thus solve for the wheel end grounding height Z1 between the wheel end of the vehicle in front and the horizontal line.
[0096] This application embodiment utilizes the principle of similar triangles and, based on the focal length of the image acquisition device, the proportional relationship between the image width and the actual width, and the proportional relationship between the wheel-end ground contact image height and the wheel-end ground contact height, calculates the first distance between the vehicle and the vehicle in front, as well as the vehicle in front, and preliminarily estimates the observation distance and wheel-end ground contact height corresponding to the vehicle in front. Then, it uses the above information to perform target filtering and distance calculation for the vehicle in front, thereby improving the accuracy of distance calculation.
[0097] Step S303: Determine the vehicle in front of the target based on the reference horizontal line height, first distance, and wheel end ground contact height calibrated by the image acquisition device.
[0098] Specifically, step S303 includes:
[0099] Step S3031: Obtain the distance reference value based on the slope threshold and the height of the baseline horizontal line calibrated by the image acquisition device.
[0100] Specifically, the tangent of the slope threshold p is calculated, and the distance reference value D is obtained based on the ratio of the baseline horizontal line height Z0 to the tangent of the slope threshold p. ref D ref = / tan(p).
[0101] When the vehicle in front is on a slope relative to the vehicle itself, this application calculates a reference distance between the vehicle in front and the vehicle itself based on the height of the baseline horizontal line calibrated by the camera, which is within the slope threshold. This facilitates the screening of vehicles in front with unreasonable distances according to the reference distance value, thus filtering out false targets.
[0102] Step S3032: Determine the vehicles in front that do not meet the filtering conditions as the target vehicles in front. The filtering conditions are: the first distance of the vehicle in front is not less than the distance reference value and the wheel end ground contact height is greater than the reference horizontal line height.
[0103] For example, as shown in Figure 5, based on the actual construction of public roads, the maximum slope is generally 10°. Assuming the camera is installed at a height of 2m, after calibration, the camera's reference horizontal line height is also 2m. If the newly identified vehicle's (virtual) wheel end touches the ground at a height of 2m, then according to the principle of trigonometric functions, in this extreme scenario, the distance to the reference value D... ref =2 / tan(10°) = 11.34m. When the distance between the vehicle in front and the vehicle itself is not less than the reference distance value of 11.34m, the wheel-to-ground contact height Z1 of the vehicle in front is less than 2m. When the camera calculates that the first distance between the vehicle in front and the vehicle itself is greater than the reference distance value based on the image ratio, and the wheel-to-ground contact height Z1 of the vehicle in front is greater than the reference horizontal line height Z0 of the camera, the vehicle in front can be determined to be a false target, and target filtering processing can be performed.
[0104] This application calculates a reference value for the distance between the vehicle ahead and the vehicle when the vehicle ahead is below the slope threshold. This facilitates the filtering of vehicles ahead with unreasonable distances based on the reference value and the first distance, accurately identifying the target vehicle ahead, filtering out abnormally high targets that are not on the actual road, reducing jerking and mis-braking problems when the vehicle is using the driver assistance system, and improving the user experience.
[0105] Step S304: Based on the actual lane line parameters and the reference lane line calibrated by the image acquisition device, obtain the lane line compensation parameters. Correct the first distance corresponding to the vehicle in front of the target based on the lane line compensation parameters to obtain the second distance between the vehicle and the vehicle in front of the target.
[0106] Specifically, step S304 includes:
[0107] Step S3041: Based on the actual lane line parameters and the reference lane line, obtain the first angle between the actual left lane line and the reference left lane line, and the second angle between the actual right lane line and the reference right lane line.
[0108] Specifically, based on the actual lane line parameters, the first actual orientation of the left lane line and the second actual orientation of the right lane line in the field of view of the image acquisition device are obtained. Based on the reference lane line, the first reference orientation of the left lane line and the second reference orientation of the right lane line in the field of view of the image acquisition device are obtained. Then, based on the first actual orientation and the first reference orientation, the first angle between the actual left lane line and the reference left lane line is calculated. Based on the second actual orientation and the second reference orientation, the second angle between the actual right lane line and the reference right lane line is calculated.
[0109] In some optional implementations, as shown in Figure 6, the current (actual) left lane line L1 and the current right lane line L1' can be observed based on the preset sampling points of the preset detection model, thereby detecting the first angle θ between the current left lane line L1 and the reference left lane line L0, and the second angle θ' between the current right lane line L1' and the reference right lane line L0'.
[0110] This application embodiment determines the angle information between the reference lane line and the actual lane line in the field of view of the image acquisition device, which facilitates the calculation of the lane line compensation coefficient for the observation distance and reduces the impact of lane line deformation on the accuracy of distance measurement.
[0111] Step S3042: Calculate the lane line compensation parameters based on the first included angle, the second included angle, and the preset compensation coefficient.
[0112] Specifically, the sum of the tangents between the first included angle θ and the second included angle θ' is calculated. Based on the product of the sum of the tangents and the preset compensation coefficient a / 2, the lane line compensation parameter D is calculated. offset For example, the lane line compensation parameter is D. offset = (tan(θ) + tan(θ'))a / 2. It should be noted that the compensation relationship between lane line angle and distance can be determined through numerous experiments, and a comparison table can be set up. The preset compensation coefficient can be determined based on the actual measured angle of the vehicle.
[0113] This application calculates lane line compensation parameters for the observed distance between the vehicle ahead and the vehicle based on a preset compensation coefficient, the first angle between the actual left lane line and the reference left lane line, and the second angle between the actual right lane line and the reference right lane line, thereby compensating for the initially estimated first distance.
[0114] Step S3043: Based on the lane line compensation parameters and the first distance corresponding to the target vehicle in front, obtain the second distance between the vehicle and the target vehicle in front.
[0115] For example, the second distance D2 between this vehicle and the target vehicle in front is D offset +D1.
[0116] This embodiment of the application, using only a monocular vision perception camera, calculates a more accurate second distance by determining the angle between the actual lane line and the reference lane line to compensate for the first distance between the vehicle ahead and the vehicle itself. This results in a more accurate perception of the longitudinal distance between the vehicle ahead and the vehicle, thus optimizing the problem of inaccurate perception of the longitudinal distance of vehicles on slopes. Furthermore, it filters out abnormally high targets not on actual roads, reducing jerking and accidental braking issues when using the driver assistance system.
[0117] The vehicle ranging method of this application will be described in detail below with reference to a specific application example, as shown in Figure 7. This application example includes the following steps:
[0118] Step 1: Obtain a monocular image of the vehicle in front captured by the camera.
[0119] Step 2: Segment the vehicles ahead in the monocular image according to the preset algorithm, confirm the size parameters of the vehicles ahead, including length, width, height, and wheel-end ground contact height, and determine the parameters of the lane lines ahead.
[0120] For example, the focal length f of the monocular camera, the actual width W of the vehicle in front, the image width w, and the wheel-end grounding height Z1 of the vehicle in front are confirmed.
[0121] Step 3: Calculate the first distance between the camera and the vehicle in front based on the size parameter information.
[0122] For example, according to the principle of similar triangles, we can obtain w:W=f:D1, and the first distance D1=f*W / w.
[0123] Step 4: Based on the first distance between the camera and the vehicle in front and the ground contact height of the vehicle's wheels, determine the authenticity of the vehicle in front, filter out false targets, and obtain the target vehicle in front.
[0124] For example, the tangent of the slope threshold p is calculated, and the distance reference value D is obtained based on the ratio of the baseline horizontal line height Z0 to the tangent of the slope threshold p. ref D ref = / tan(p). Filter out D1≥D ref The vehicle ahead of Z1 > Z0 is the target vehicle ahead.
[0125] Step 5: Calculate the lane slope information ahead based on the lane line parameters ahead and the preset lane line parameters.
[0126] For example, based on the preset sampling points of the preset detection model, the current left lane line L1 and the current right lane line L1' can be observed, thereby detecting the first angle θ between the current left lane line L1 and the reference left lane line L0, and the second angle θ' between the current right lane line L1' and the reference right lane line L0'.
[0127] Step 6: Based on the slope information, compensate for the first distance to determine the second distance between the camera and the vehicle in front of the target.
[0128] For example, the second distance D2 between the camera and the vehicle in front of the target is (1+a(tanθ+tanθ') / 2)*D1, where a is the compensation coefficient corresponding to the first included angle θ and the second included angle θ'.
[0129] This application can accurately perceive the longitudinal distance between the target vehicle and the vehicle itself at a lower cost when only a visual perception camera is used. It optimizes the problem of inaccurate perception of the longitudinal distance of the target vehicle on the slope, and filters out virtual targets with abnormal heights that are not on the actual road. This reduces the jerking and false braking problems caused by the vehicle when using the driver assistance system, thereby improving the user experience.
[0130] This embodiment also provides a vehicle ranging device for implementing 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.
[0131] This embodiment provides a vehicle ranging device, as shown in Figure 8, including:
[0132] The acquisition module 801 is used to acquire road images captured by the image acquisition device, perform recognition and detection on the road images, and obtain the actual lane line parameters, the actual size of the vehicle in front, and the image size of the vehicle in front in the road image.
[0133] The first processing module 802 is used to obtain the first distance between the vehicle and the vehicle in front and the wheel end grounding height between the wheel end of the vehicle in front and the horizontal line based on the imaging parameters calibrated by the image acquisition device, the actual size and the image size.
[0134] The second processing module 803 is used to determine the vehicle in front of the target based on the reference horizontal line height, the first distance and the wheel end grounding height calibrated by the image acquisition device;
[0135] The third processing module 804 is used to obtain lane line compensation parameters based on the actual lane line parameters and the reference lane line calibrated by the image acquisition device, and to correct the first distance corresponding to the target vehicle based on the lane line compensation parameters to obtain the second distance between the vehicle and the target vehicle.
[0136] In some optional implementations, the acquisition module 801 is further configured to:
[0137] The road image is input into a preset detection model for detection, at least one rectangular detection box is obtained, and the rectangular detection box is identified to determine the vehicle type information and the size information corresponding to the vehicle type information.
[0138] Based on the size information, obtain the actual dimensions of the vehicle in front; wherein the actual dimensions include at least some of the following items: actual length, actual width, and actual height.
[0139] In some optional implementations, the first processing module 802 is further configured to:
[0140] The focal length of the image acquisition device is obtained based on its imaging parameters.
[0141] The actual width of the vehicle in front is obtained based on its actual dimensions, and the image width and wheel-end ground contact image height of the vehicle in front are obtained based on the image dimensions.
[0142] The first distance between this vehicle and the vehicle in front is calculated based on the focal length, actual width, and image width.
[0143] Based on the wheel-end grounding image height, the first distance, and the focal length, the wheel-end grounding height between the front vehicle's wheel end and the horizontal line is calculated.
[0144] In some optional implementations, the second processing module 803 is further configured to:
[0145] Based on the slope threshold and the height of the baseline horizontal line calibrated by the image acquisition equipment, a distance reference value is obtained;
[0146] Vehicles in front that do not meet the filtering criteria are identified as target vehicles in front. The filtering criteria are: the first distance to the vehicle in front is not less than the distance reference value and the wheel end ground contact height is greater than the reference horizontal line height.
[0147] In some optional implementations, the second processing module 803 is further configured to:
[0148] Calculate the tangent value of the slope threshold;
[0149] The distance reference value is calculated based on the ratio of the baseline height to the tangent of the slope threshold.
[0150] In some optional implementations, the third processing module 804 is further configured to:
[0151] Based on the actual lane line parameters and the reference lane line, the first included angle between the actual left lane line and the reference left lane line, and the second included angle between the actual right lane line and the reference right lane line are obtained.
[0152] The lane line compensation parameters are calculated based on the first included angle, the second included angle, and the preset compensation coefficient.
[0153] Based on the lane line compensation parameters and the first distance corresponding to the target vehicle ahead, the second distance between the vehicle and the target vehicle ahead is obtained.
[0154] In some optional implementations, the third processing module 804 is further configured to:
[0155] Calculate the sum of the tangents between the first and second included angles;
[0156] The lane line compensation parameters are calculated by multiplying the sum of the tangents with the preset compensation coefficients.
[0157] In some optional implementations, the third processing module 804 is further configured to:
[0158] Based on the actual lane line parameters, the first actual orientation of the left lane line and the second actual orientation of the right lane line in the field of view of the image acquisition device are obtained. Based on the reference lane line, the first reference orientation of the left lane line and the second reference orientation of the right lane line in the field of view of the image acquisition device are obtained.
[0159] Based on the first actual orientation and the first reference orientation, the first included angle between the actual left lane line and the reference left lane line is calculated;
[0160] Based on the second actual orientation and the second reference orientation, the second included angle between the actual right lane line and the reference right lane line is calculated.
[0161] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0162] In this embodiment, the vehicle ranging device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0163] This application also provides a vehicle having the vehicle ranging device shown in FIG8.
[0164] Please refer to Figure 9, which is a schematic diagram of a vehicle structure provided in an optional embodiment of this application. As shown in Figure 9, the vehicle includes one or more processors 10, a memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components communicate with each other using different buses and can be installed on a common motherboard or otherwise as needed. The processors can process instructions executed within the vehicle, including instructions stored in or on memory to display graphical information of a GUI (Graphical User Interface) on external input / output devices (such as display devices coupled to the interfaces). In some optional embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple devices can be connected, each providing some of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). Figure 9 uses one processor 10 as an example.
[0165] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0166] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0167] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on vehicle usage. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, which can be connected to the vehicle via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0168] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0169] The vehicle also includes a communication interface 30 for communicating with other devices or communication networks.
[0170] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently 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 methods shown in the above embodiments are implemented.
[0171] A portion of this application 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 this application 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.
[0172] Although embodiments of this application 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 this application, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A vehicle ranging method, characterized in that, The method includes: The system acquires road images captured by image acquisition devices, performs recognition and detection on the road images, and obtains actual lane line parameters, actual size of vehicles ahead, and image size of vehicles ahead in the road images. Based on the imaging parameters calibrated by the image acquisition equipment, the actual size, and the image size, the first distance between this vehicle and the vehicle in front, as well as the wheel end grounding height between the wheel end of the vehicle in front and the horizontal line, are obtained. Based on the baseline horizontal height, first distance, and wheel-end ground contact height calibrated by the image acquisition equipment, determine the vehicle in front of the target; Based on the actual lane line parameters and the baseline lane line calibrated by the image acquisition device, lane line compensation parameters are obtained. The first distance corresponding to the vehicle in front of the target is corrected according to the lane line compensation parameters to obtain the second distance between the vehicle and the vehicle in front of the target.
2. The method according to claim 1, characterized in that, The step of determining the vehicle ahead of the target based on the reference horizontal line height, the first distance, and the wheel-end ground contact height calibrated by the image acquisition equipment includes: The distance reference value is obtained based on the slope threshold and the height of the baseline horizontal line calibrated by the image acquisition equipment; Vehicles in front that do not meet the filtering criteria are identified as target vehicles in front. The filtering criteria are: the first distance to the vehicle in front is not less than the distance reference value and the wheel end ground contact height is greater than the reference horizontal line height.
3. The method according to claim 2, characterized in that, The process of obtaining a distance reference value based on a slope threshold and the height of a baseline horizontal line calibrated by the image acquisition device includes: Calculate the tangent value of the slope threshold; The distance reference value is calculated based on the ratio of the baseline height to the tangent of the slope threshold.
4. The method according to claim 1, characterized in that, The process involves obtaining lane line compensation parameters based on actual lane line parameters and a reference lane line calibrated by an image acquisition device, and then correcting the first distance corresponding to the target vehicle based on these lane line compensation parameters to obtain a second distance between the vehicle and the target vehicle. This includes: Based on the actual lane line parameters and the reference lane line, the first included angle between the actual left lane line and the reference left lane line, and the second included angle between the actual right lane line and the reference right lane line are obtained. The lane line compensation parameters are calculated based on the first included angle, the second included angle, and the preset compensation coefficient. Based on the lane line compensation parameters and the first distance corresponding to the target vehicle ahead, the second distance between the vehicle and the target vehicle ahead is obtained.
5. The method according to claim 4, characterized in that, The calculation of lane line compensation parameters based on the first included angle, the second included angle, and the preset compensation coefficient includes: Calculate the sum of the tangents between the first and second included angles; The lane line compensation parameters are calculated based on the product of the sum of the tangents and the preset compensation coefficient.
6. The method according to claim 4, characterized in that, The process of obtaining the first angle between the actual left lane line and the reference left lane line, and the second angle between the actual right lane line and the reference right lane line based on the actual lane line parameters and the reference lane line, includes: Based on the actual lane line parameters, the first actual orientation of the left lane line and the second actual orientation of the right lane line in the field of view of the image acquisition device are obtained. Based on the reference lane line, the first reference orientation of the left lane line and the second reference orientation of the right lane line in the field of view of the image acquisition device are obtained. Based on the first actual orientation and the first reference orientation, the first included angle between the actual left lane line and the reference left lane line is calculated; Based on the second actual orientation and the second reference orientation, the second included angle between the actual right lane line and the reference right lane line is calculated.
7. The method according to any one of claims 1-6, characterized in that, The step of obtaining the first distance between the vehicle and the vehicle in front, and the wheel-end ground contact height between the wheel ends of the vehicle in front and the horizontal line, based on the imaging parameters of the image acquisition device, the actual size of the vehicle in front, and the image size, includes: The focal length of the image acquisition device is obtained based on its imaging parameters. The actual width of the vehicle in front is obtained based on the actual dimensions, and the image width and wheel-end ground contact image height of the vehicle in front are obtained based on the image dimensions. The first distance between the vehicle and the vehicle in front is calculated based on the focal length, the actual width, and the image width. The wheel-end grounding height between the wheel end of the vehicle ahead and the horizontal line is calculated based on the wheel-end grounding image height, the first distance, and the focal length.
8. The method according to any one of claims 1-6, characterized in that, The process of recognizing and detecting road images to obtain the actual size of vehicles ahead includes: The road image is input into a preset detection model for detection to obtain at least one rectangular detection box. The rectangular detection box is then identified to determine the vehicle type information and the size information corresponding to the vehicle type information. Based on the size information, the actual size of the vehicle in front is obtained; wherein the actual size includes at least some of the following items: actual length, actual width, and actual height.
9. A vehicle ranging device, characterized in that, The device includes: The acquisition module is used to acquire road images captured by the image acquisition device, perform recognition and detection on the road images, and obtain the actual lane line parameters, the actual size of the vehicle in front, and the image size of the vehicle in front in the road image. The first processing module is used to obtain the first distance between the vehicle and the vehicle in front, and the wheel end grounding height between the wheel end of the vehicle in front and the horizontal line, based on the imaging parameters calibrated by the image acquisition device, the actual size and the image size. The second processing module is used to determine the vehicle in front of the target based on the reference horizontal line height, the first distance, and the wheel end ground contact height calibrated by the image acquisition device; The third processing module is used to obtain lane line compensation parameters based on the actual lane line parameters and the reference lane lines calibrated by the image acquisition device, and to correct the first distance corresponding to the target vehicle based on the lane line compensation parameters to obtain the second distance between the vehicle and the target vehicle.
10. A vehicle, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the vehicle ranging method according to any one of claims 1 to 8 by executing the computer instructions.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the vehicle ranging method according to any one of claims 1 to 8.
12. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the vehicle ranging method according to any one of claims 1 to 8.