Vehicle ranging method, device, vehicle, medium and program
By identifying and detecting road images and vehicle size, combined with imaging parameters and lane line compensation, the cost and accuracy issues of radar ranging are resolved, and the ranging accuracy and user experience of cameras on slopes are improved.
Patent Information
- Application Number
- CN202510094890.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-01-21
AI Technical Summary
In the existing technology, when using radar for distance measurement, it is difficult to balance measurement accuracy and hardware cost. In addition, the camera's pure vision solution has low ranging accuracy on slopes and is prone to misidentifying false targets, resulting in a reduced user experience.
By acquiring road images captured by image acquisition equipment, identifying and detecting actual lane line parameters and the size of the vehicle in front, the distance is calculated based on the imaging parameters, and the distance is corrected using the reference horizontal line and lane line compensation parameters to filter out false targets and improve ranging accuracy.
It achieves accurate identification of vehicles ahead with low-cost hardware, reduces false braking and stalling problems, and improves user experience.
Smart Images

Figure CN120008549B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent driving technology, and in particular to a vehicle ranging method, device, vehicle, medium and program. Background Art
[0002] Advanced Driver Assistance Systems (ADAS), based on the rapid development of visual sensors, can provide drivers with more comprehensive information about the traffic environment, reduce driver fatigue, and help them avoid collisions. Accurately detecting the speed and distance of vehicles ahead is the foundation of ADAS vehicle control.
[0003] Existing technology solutions use millimeter-wave radar, ultrasonic radar, lidar, and cameras to measure the distance from the vehicle ahead. Ultrasonic radar is significantly affected by weather and has a short range limit, making it suitable only for low-speed scenarios. Millimeter-wave radar offers high ranging accuracy, fast convergence, and minimal environmental impact, but is susceptible to multipath reflections and can misidentify false targets. Lidar provides accurate ranging but is significantly affected by weather, with performance degraded in rainy or snowy conditions. Furthermore, it is expensive and reduces the user experience. While purely visual camera solutions are less expensive, they suffer from lower ranging accuracy. Summary of the Invention
[0004] In view of this, the present invention provides a vehicle ranging method, device, vehicle, medium and program to solve the problem of difficulty in balancing measurement accuracy and hardware cost when using radar for distance measurement in the prior art.
[0005] In a first aspect, the present invention provides a vehicle ranging method, the method comprising:
[0006] Obtaining a road image captured by an image acquisition device, performing recognition and detection on the road image, and obtaining actual lane line parameters, the actual size of the vehicle ahead, and the image size of the vehicle ahead in the road image;
[0007] Obtaining a first distance between the vehicle and the preceding vehicle and a wheel end grounding height between the wheel end of the preceding vehicle and a horizontal line according to imaging parameters, actual size, and image size calibrated by the image acquisition device;
[0008] Determine the target vehicle ahead based on the reference horizontal line height, the first distance, and the wheel end grounding height calibrated by the image acquisition device;
[0009] A lane line compensation parameter is obtained based on the actual lane line parameters and the reference lane line calibrated by the image acquisition device. The first distance corresponding to the target front vehicle is corrected according to the lane line compensation parameter to obtain the second distance between the vehicle and the target front vehicle.
[0010] Beneficial effects: The present invention identifies and detects road images captured by an image acquisition device to obtain actual lane line parameters, the actual size of the vehicle in front, and the image size. The hardware cost is low. Then, based on the above parameters and the imaging parameters of the image acquisition device, the first distance between the vehicle and the vehicle in front and the wheel end grounding height of the vehicle in front are obtained. Next, the wheel end grounding height of the vehicle in front is verified by the reference horizontal line height and the first distance, and false targets with abnormal heights on non-actual roads are filtered out to determine the target vehicle in front, thereby preventing misjudgment of the target and causing the vehicle to stall or brake incorrectly, thereby improving the user experience. Finally, the preliminarily calculated first distance is corrected according to 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 in front.
[0011] In some optional implementations, determining the target vehicle ahead based on the reference horizontal line height, the first distance, and the wheel end ground contact height calibrated by the image acquisition device includes:
[0012] A distance reference value is obtained according to the slope threshold and the height of the reference horizontal line calibrated by the image acquisition device;
[0013] A front vehicle other than a front vehicle that meets a filtering condition is determined as a target front vehicle. The filtering condition is that the first distance to the front vehicle is not less than a distance reference value and the wheel end ground contact height is greater than a reference horizontal line height.
[0014] Beneficial effects: The present invention calculates the distance reference value between the front vehicle and the vehicle when the front vehicle is below the slope threshold, so as to facilitate filtering out the front vehicle with unreasonable distance according to the distance reference value and the first distance, accurately identify the target front vehicle, filter out highly abnormal targets on non-actual roads, reduce the problems of vehicle stalling and false braking when using the driving assistance system, and improve user experience.
[0015] In some optional implementations, obtaining a distance reference value based on a slope threshold and a reference horizontal height calibrated by an image acquisition device includes:
[0016] Calculate the tangent of the slope threshold;
[0017] The distance reference value is calculated based on the ratio of the base horizontal line height to the tangent value of the slope threshold.
[0018] Beneficial effect: When the front vehicle is in a slope scene relative to the vehicle, the present invention calculates the distance reference value between the front vehicle and the vehicle under the slope threshold according to the reference horizontal line height calibrated by the camera, so as to facilitate screening of the front vehicle with unreasonable distance according to the distance reference value, thereby filtering out false targets.
[0019] In some optional embodiments, a lane line compensation parameter is obtained based on actual lane line parameters and a reference lane line calibrated by an image acquisition device, and a first distance corresponding to a target vehicle ahead is corrected based on the lane line compensation parameter to obtain a second distance between the vehicle and the target vehicle ahead, including:
[0020] According to 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;
[0021] Calculating a lane line compensation parameter based on the first angle, the second angle, and a preset compensation coefficient;
[0022] A second distance between the vehicle and the target vehicle ahead is obtained based on the lane line compensation parameter and the first distance corresponding to the target vehicle ahead.
[0023] Beneficial Effects: When only a monocular vision perception camera is present, this embodiment of the present invention compensates for the first distance between the target vehicle ahead and the vehicle by determining the angle between the actual lane line and the reference lane line, resulting in a more accurate second distance. This allows for more accurate perception of the longitudinal distance between the target vehicle ahead and the vehicle, improving the issue of inaccurate longitudinal distance perception for vehicles on slopes. It also filters out unusually high objects on non-actual roads, reducing vehicle jerking and false braking when using the driver assistance system.
[0024] In some optional implementations, the lane line compensation parameter is calculated based on the first angle, the second angle, and a preset compensation coefficient, including:
[0025] Calculate the sum of the tangent of the first angle and the tangent of the second angle;
[0026] The lane line compensation parameter is calculated based on the product between the sum of the tangents and the preset compensation coefficient.
[0027] Beneficial effect: The present invention calculates the lane line compensation parameters for the observed distance between the vehicle in front and the vehicle based on the preset compensation coefficient, the first angle between the actual left lane line and the baseline left lane line, and the second angle between the actual right lane line and the baseline right lane line, and compensates for the initially estimated first distance.
[0028] In some optional embodiments, obtaining 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, based on actual lane line parameters and the reference lane line, includes:
[0029] Obtaining a first actual orientation corresponding to the left lane line and a second actual orientation corresponding to the right lane line in the field of view of the image acquisition device based on the actual lane line parameters, and obtaining a first reference orientation corresponding to the left lane line and a second reference orientation corresponding to the right lane line in the field of view of the image acquisition device based on the reference lane lines;
[0030] Calculating a first angle between an actual left lane marking and a reference left lane marking based on the first actual orientation and the first reference orientation;
[0031] A second angle between the actual right lane marking and the reference right lane marking is calculated based on the second actual orientation and the second reference orientation.
[0032] Beneficial effects: The embodiment of the present invention determines the angle information between the reference lane line and the actual lane line in the field of view of the image acquisition device, thereby facilitating the calculation of the lane line compensation coefficient for the observation distance and reducing the impact of lane line deformation on the accuracy of distance measurement.
[0033] In some optional embodiments, obtaining a first distance between the host vehicle and the vehicle ahead and a wheel end ground contact height between a wheel end of the vehicle ahead and a horizontal line based on imaging parameters of an image acquisition device, an actual size of the vehicle ahead, and an image size includes:
[0034] Obtaining the focal length of the image acquisition device according to imaging parameters of the image acquisition device;
[0035] The actual width of the vehicle ahead is obtained according to the actual size, and the image width and wheel end ground contact image height of the vehicle ahead are obtained according to the image size;
[0036] Calculate the first distance between the vehicle and the vehicle ahead based on the focal length, the actual width, and the image width;
[0037] The wheel end contact height between the wheel end of the front vehicle and the horizontal line is calculated according to the wheel end contact image height, the first distance and the focal length.
[0038] Beneficial effects: The embodiment of the present invention utilizes the principle of similar triangles and solves the first distance between the vehicle and the vehicle in front, as well as the vehicle in front, 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. It preliminarily estimates the observation distance and wheel-end ground contact height corresponding to the vehicle in front, and then uses the above information to perform target filtering and distance measurement on the vehicle in front, thereby improving the accuracy of distance measurement.
[0039] In some optional implementations, identifying and detecting the road image to obtain the actual size of the vehicle ahead includes:
[0040] Inputting the road image into a preset detection model for detection to obtain at least one rectangular detection frame, and identifying the rectangular detection frame to determine the vehicle model information and size information corresponding to the vehicle model information;
[0041] The actual size of the vehicle ahead is obtained according to the size information; wherein the actual size includes at least some of the following items: actual length, actual width, and actual height.
[0042] Beneficial effects: The embodiment of the present invention uses a preset detection model to detect and identify road avatars, and determines the model information of the vehicle in front through image recognition, thereby obtaining the actual dimensions of the vehicle in front, such as the actual length, actual width, and actual height, which is convenient for using the obtained actual dimensions to measure distance.
[0043] In a second aspect, the present invention provides a vehicle distance measuring device, the device comprising:
[0044] An acquisition module is used to acquire a road image captured by an image acquisition device, perform recognition and detection on the road image, and obtain 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;
[0045] a first processing module, configured to obtain a first distance between the vehicle and a preceding vehicle and a wheel end grounding height between a wheel end of the preceding vehicle and a horizontal line based on imaging parameters calibrated by an image acquisition device, an actual size, and an image size;
[0046] A second processing module is used to determine the target vehicle ahead based on the reference horizontal line height calibrated by the image acquisition device, the first distance and the wheel end ground contact height;
[0047] The third processing module 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 front vehicle based on the lane line compensation parameters to obtain the second distance between the vehicle and the target front vehicle.
[0048] In a third aspect, the present invention provides a vehicle comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the vehicle ranging method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0049] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the vehicle ranging method of the first aspect or any corresponding embodiment thereof.
[0050] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the vehicle ranging method of the first aspect or any corresponding embodiment thereof.
[0051] The beneficial effects of the present invention are:
[0052] The present invention 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 the aforementioned parameters and the imaging parameters of the image acquisition device, the first distance between the vehicle and the vehicle ahead and the wheel-end ground contact height of the vehicle ahead are then obtained. The wheel-end ground contact height of the vehicle ahead is then verified using the reference horizontal line height and the first distance. False targets with abnormal heights not on the actual road are filtered out, and the target vehicle ahead is determined. This prevents misjudgment of the target, which could lead to vehicle stalling or misbraking, 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0054] Figure 1 is a flow chart of a vehicle ranging method according to an embodiment of the present invention;
[0055] Figure 2 is a schematic diagram of a reference field of view of an image acquisition device according to an embodiment of the present invention;
[0056] Figure 3 is a flow chart of another vehicle ranging method according to an embodiment of the present invention;
[0057] Figure 4 is a schematic diagram of a principle of similar triangles according to an embodiment of the present invention;
[0058] Figure 5 is a schematic diagram of filtering vehicles above a reference horizontal line according to an embodiment of the present invention;
[0059] Figure 6 is a schematic diagram of lane compensation calculation according to an embodiment of the present invention;
[0060] Figure 7is a flow chart of another vehicle ranging method according to an embodiment of the present invention;
[0061] Figure 8 is a structural block diagram of a vehicle distance measuring device according to an embodiment of the present invention;
[0062] Figure 9 4 is a schematic diagram of the hardware structure of a vehicle according to an embodiment of the present invention. DETAILED DESCRIPTION
[0063] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.
[0064] Accurately detecting the speed and distance of the target vehicle ahead is the foundation for ADAS vehicle control. Existing technical solutions in the industry include millimeter-wave radar, ultrasonic radar, lidar, and cameras. Ultrasonic radar is significantly affected by weather conditions and has a short range limit, making it suitable only for low-speed scenarios. Millimeter-wave radar offers high ranging accuracy, fast speed convergence, and minimal environmental impact, but is susceptible to multipath reflections and the misidentification of false targets. Lidar offers accurate ranging but is significantly affected by weather, with rainy and snowy conditions leading to reduced performance and high costs, resulting in a poor user experience. While camera-based pure vision solutions are also affected by weather and have lower ranging accuracy than millimeter-wave radar and lidar, they are generally cheaper, can identify vehicles, pedestrians, two-wheeled vehicles, and other targets, and have a wide range of adaptability, high cost-performance, and a good user experience.
[0065] When the relevant technology uses a pure camera vision solution to calculate the distance to the target vehicle, although it can accurately identify the distance to targets on flat roads, for targets on remote slopes, the influence of the slope will cause large distance deviations; and the height of the target on the slope is not verified, which will lead to false detection of non-vehicle targets with abnormal heights, causing the vehicle to brake incorrectly and reducing the user experience.
[0066] Therefore, embodiments of the present invention provide a vehicle ranging method that combines the size parameters, pixel parameters, and camera focal length of the preceding vehicle to calculate the following distance to the preceding vehicle. The method also verifies the height of the preceding vehicle's 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. This prevents false braking caused by misdetection, thereby improving the user experience. Furthermore, the following distance between the vehicle and the preceding vehicle is compensated based on the left and right lane marking parameters of the current lane, reducing calculation errors and improving distance calculation accuracy.
[0067] According to an embodiment of the present invention, an embodiment of a vehicle ranging method is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0068] In this embodiment, a vehicle ranging method is provided, which can be used in vehicles equipped with image acquisition equipment, such as unmanned vehicles and hybrid vehicles equipped with monocular cameras. Figure 1 Flowchart of the vehicle ranging method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0069] Step S101 , obtaining a road image captured by an image acquisition device, performing recognition detection on the road image, and obtaining actual lane line parameters, the actual size of the front vehicle, and the image size of the front vehicle in the road image.
[0070] Specifically, appropriate image acquisition equipment can be selected based on resolution requirements, field of view, and driving environment. For example, monocular cameras, used for auxiliary road condition monitoring in intelligent transportation systems, may have relatively low resolution requirements. As long as they can recognize details such as the vehicle logo and model information of the vehicle ahead, the hardware cost is relatively low. The camera is installed in a suitable position to obtain the required road view. For in-vehicle applications, it is generally installed in a suitable position on the inside of the vehicle's windshield (such as near the rearview mirror) to ensure that its field of view covers the road ahead and minimizes obstruction.
[0071] Furthermore, the installed camera is calibrated by a checkerboard after the vehicle is off the assembly line, and calibration compensation is performed according to the camera installation height and wheel arch height output by the host computer, such as Figure 2 As shown, the reference horizon height at the far end of the camera field of view of the vehicle is set as Z0, the reference left lane line L0, and the reference right lane line L0'.
[0072] It should be noted that a checkerboard is a calibration tool with a precisely known geometric structure, typically consisting of alternating black and white squares. By capturing checkerboard images at different angles and positions, the camera's internal parameters (such as focal length and optical center position) and external parameters (such as the camera's position and attitude relative to the vehicle coordinate system) are determined based on features such as the checkerboard's corner points (the points where the black and white squares intersect). Camera calibration ensures that the image data collected by the camera accurately reflects the actual road scene and the vehicle's surroundings, which is crucial for subsequent camera-based object recognition, distance measurement, lane detection, and other tasks.
[0073] Furthermore, during calibration, calibration compensation can be performed based on the camera's mounting height. The camera mounting height refers to the vertical distance of the camera relative to a certain reference plane of the vehicle (such as the vehicle chassis plane), and the wheel arch height refers to the vertical distance of a specific position of the vehicle body (the wheel arch) relative to the vehicle reference plane. Different mounting heights will cause the images captured by the camera to present different perspectives and proportional relationships in the vertical direction. For example, a higher mounting height may enable the camera to see a farther portion of the ground ahead of the road, but it may also cause nearby objects to occupy a relatively smaller proportion in the image. In addition, the wheel arch height helps to further refine the camera's vertical viewing angle and imaging range during the calibration and compensation process. For example, when considering changes in the vehicle's posture during driving (such as vehicle body pitch, etc.), the wheel arch height information can be used together with the mounting height as a reference to determine whether the actual vertical position of the camera relative to the road plane has changed, so that calibration compensation operations can be performed in a timely manner to ensure the accuracy and stability of image acquisition.
[0074] In some optional implementations, the road avatar can be pre-processed, such as by grayscaling and filtering for noise reduction, to effectively remove noise and enhance image clarity, facilitating subsequent feature extraction and lane detection. Next, gradient features can be extracted from the image, and edge detection algorithms such as Canny edge detection can be used to extract edge information from objects in the image. Finally, a least-squares method can be used to fit straight lines based on the extracted edge points or feature points to determine lane lines.
[0075] Specifically, a road image is input into a preset detection model for detection to obtain at least one rectangular detection frame, and the rectangular detection frame is identified to determine the vehicle model information and the size information corresponding to the vehicle model information, thereby obtaining the actual size of the vehicle in front based on the size information, wherein the actual size includes at least some of the following items: actual length, actual width, and actual height.
[0076] In some optional embodiments, the preset detection model is trained based on a large number of images of different vehicle models and is capable of identifying vehicle model information and dimensions. A camera is used to capture an image of the vehicle in front. The camera sensor segments the image according to the preset detection model, detecting a rectangular frame containing the vehicle body outline information. The number of rectangular frames may be multiple, and the length, width, and height of the vehicle in front are identified and queried.
[0077] The embodiment of the present invention uses a preset detection model to detect and identify road avatars, and determines the model information of the vehicle in front through image recognition, thereby obtaining the actual dimensions of the vehicle in front, such as the actual length, actual width, and actual height, so as to facilitate distance measurement using the obtained actual dimensions.
[0078] Step S102 , obtaining a first distance between the vehicle and the vehicle in front and a wheel end grounding height between the wheel end of the vehicle in front and the horizontal line according to imaging parameters, actual size, and image size calibrated by the image acquisition device.
[0079] Specifically, the imaging parameters calibrated for the image acquisition device primarily include focal length, intrinsic parameter matrices, and extrinsic parameter matrices. For example, using a monocular camera as the image acquisition device, the monocular vision ranging principle is based on similar triangles. Given camera imaging parameters such as focal length, the actual distance between the vehicle ahead and the preceding vehicle, as well as the wheel end ground clearance, can be preliminarily calculated by measuring the image size of the preceding vehicle in the image and combining the ratio between the actual size and the image size.
[0080] Step S103 : determining the target vehicle ahead based on the reference horizontal line height calibrated by the image acquisition device, the first distance, and the wheel end ground contact height.
[0081] Specifically, in order to avoid misidentification of non-vehicle targets at a higher position in front of the vehicle, the wheel end ground height is verified according to the baseline height of the camera's field of view and the first distance between the vehicle and the vehicle in front, and false targets above the baseline at the far end of the camera's field of view are filtered out to prevent misjudgment that may cause the vehicle to brake incorrectly or stall, which is beneficial to improving user experience.
[0082] In step S104, a lane line compensation parameter is obtained based on the actual lane line parameters and the reference lane line calibrated by the image acquisition device, and the first distance corresponding to the target front vehicle is corrected based on the lane line compensation parameter to obtain a second distance between the vehicle and the target front vehicle.
[0083] Specifically, lane markings on a far-end ramp can appear to be tilted inward or outward in the camera image relative to the camera-calibrated baseline lane markings due to the slope. By comparing the actual lane markings with the calibrated baseline lane marking parameters, the system calculates lane marking compensation parameters for the current ramp, which are then used to compensate for the initial distance measurement, improving distance measurement accuracy.
[0084] The image acquisition device-based ranging method provided in this embodiment identifies and detects road images captured by the image acquisition device to obtain actual lane line parameters, the actual size of the preceding vehicle, and the image size. The hardware cost is low. Based on these parameters and the imaging parameters of the image acquisition device, the first distance between the vehicle and the preceding vehicle and the wheel end ground contact height of the preceding vehicle are then determined. The wheel end ground contact height of the preceding vehicle is then verified using the reference horizontal line height and the first distance. False targets with abnormal heights not on the actual road are filtered out, and the target preceding vehicle is identified. This prevents misjudgment of the target, which could lead to vehicle stalling or misbraking, 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 preceding vehicle.
[0085] In this embodiment, a vehicle ranging method is provided, which can be used in vehicles equipped with image acquisition equipment, such as unmanned vehicles and hybrid vehicles equipped with monocular cameras. Figure 3 Flowchart of the vehicle ranging method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0086] Step S301: Obtain a road image captured by an image acquisition device, perform recognition and detection on the road image, 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. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0087] Step S302 : obtaining a first distance between the vehicle and the vehicle ahead and a wheel end grounding height between the wheel end of the vehicle ahead and the horizontal line according to imaging parameters, actual size, and image size calibrated by the image acquisition device.
[0088] In some optional implementations, the above step S302 includes the following steps:
[0089] Step a1: Obtain the focal length f of the image acquisition device according to the imaging parameters of the image acquisition device.
[0090] Step a2: obtaining the actual width W of the vehicle ahead according to the actual size, and obtaining the image width w and the wheel end contact image height z of the vehicle ahead according to the image size.
[0091] Step a3: Calculate the first distance D1 between the vehicle and the vehicle ahead based on the focal length f, the actual width W, and the image width w.
[0092] For example, Figure 4As shown, based on the principle of similar triangles, w:W = f:D1, which can be solved to obtain the first distance D1 between the vehicle and the vehicle in front. For example, according to the preset detection model, the actual width W of the vehicle in front is observed to be 2m, the camera image width w is 0.045m, and the focal length f is 2m. The first distance D1 between the vehicle and the vehicle in front is calculated as D1 = 2 / 0.045*2, and the calculated D1 is 89m.
[0093] Step a4: Calculate the wheel end ground contact height Z1 between the wheel end of the front vehicle and the horizontal line according to the wheel end ground contact image height h, the first distance D1 and the focal length f.
[0094] For example, according to the principle of similar triangles, z:Z1=f:D1 can be obtained, thereby solving the wheel end ground contact height Z1 between the wheel end of the front vehicle and the horizontal line.
[0095] The embodiment of the present invention utilizes the principle of similar triangles and solves the first distance between the vehicle and the preceding vehicle, as well as the preceding vehicle, 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. It preliminarily estimates the observed distance and wheel-end ground contact height corresponding to the preceding vehicle, and then uses the above information to perform target filtering and distance measurement on the preceding vehicle, thereby improving the accuracy of distance measurement.
[0096] Step S303 : determining the target vehicle ahead based on the reference horizontal line height calibrated by the image acquisition device, the first distance, and the wheel end ground contact height.
[0097] Specifically, the above step S303 includes:
[0098] Step S3031: Obtain a distance reference value according to a slope threshold and a reference horizontal line height calibrated by an image acquisition device.
[0099] Specifically, the tangent value of the slope threshold p is calculated, and the distance reference value D is calculated based on the ratio of the reference horizontal line height Z0 to the tangent value of the slope threshold p. ref , that is, D ref = / tan(p).
[0100] When the front vehicle is in a slope scene relative to the vehicle, the present invention calculates the distance reference value between the front vehicle and the vehicle under the slope threshold according to the reference horizontal line height calibrated by the camera, so as to facilitate screening of the front vehicle with unreasonable distance according to the distance reference value and filter out false targets.
[0101] Step S3032: determine the preceding vehicles other than the preceding vehicles that meet the filtering conditions as target preceding vehicles. The filtering conditions are: the first distance to the preceding vehicle is not less than the distance reference value and the wheel end ground contact height is greater than the reference horizontal line height.
[0102] For example, Figure 5 As shown in the figure, according to the actual public road construction situation, the maximum slope is generally 10°. Assuming that the camera is installed at a height of 2m, after calibration, the camera reference horizontal line height is also 2m. If the ground contact height of the newly identified front vehicle (virtual) wheel end is also 2m, then according to the principle of trigonometric function, in this extreme scenario, the distance reference value D ref = 2 / tan(10°) = 11.34m. When the distance between the preceding vehicle and the host vehicle is not less than the distance reference value of 11.34m, the wheel end ground contact height Z1 of the preceding vehicle is less than 2m. When the camera calculates the first distance between the preceding vehicle and the host vehicle based on the image ratio to be greater than the distance reference value, and the front wheel end ground contact height Z1 is greater than the camera's reference horizontal height Z0, the preceding vehicle is determined to be a false target and target filtering is performed.
[0103] The present invention calculates a distance reference value between the vehicle in front and the vehicle when the vehicle in front is below a slope threshold, thereby facilitating filtering out vehicles in front with unreasonable distances according to the distance reference value and the first distance, accurately identifying target vehicles in front, filtering out highly abnormal targets on non-actual roads, reducing the problems of vehicle stalling and false braking when using a driving assistance system, and improving user experience.
[0104] In step S304, a lane line compensation parameter is obtained based on the actual lane line parameters and the reference lane line calibrated by the image acquisition device. The first distance corresponding to the target front vehicle is corrected based on the lane line compensation parameter to obtain a second distance between the vehicle and the target front vehicle.
[0105] Specifically, the above step S304 includes:
[0106] Step S3041: Obtain 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, based on the actual lane line parameters and the reference lane line.
[0107] Specifically, a first actual orientation corresponding to the left lane line and a second actual orientation corresponding to the right lane line in the field of view of the image acquisition device are obtained based on the actual lane line parameters. A first reference orientation corresponding to the left lane line and a second reference orientation corresponding to the right lane line in the field of view of the image acquisition device are obtained based on the reference lane line. Then, a first angle between the actual left lane line and the reference left lane line is calculated based on the first actual orientation and the first reference orientation. A second angle between the actual right lane line and the reference right lane line is calculated based on the second actual orientation and the second reference orientation.
[0108] In some optional embodiments, such as Figure 6 As shown, according to the preset sampling points of the preset detection model, the current (actual) 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′.
[0109] The embodiment of the present invention determines the angle information between the reference lane line and the actual lane line in the field of view of the image acquisition device, thereby facilitating the calculation of the lane line compensation coefficient for the observed distance and reducing the impact of lane line deformation on the accuracy of distance measurement.
[0110] Step S3042: Calculate the lane line compensation parameter based on the first angle, the second angle, and the preset compensation coefficient.
[0111] Specifically, the sum of the tangents of the first angle θ and the second angle θ′ is calculated, and the lane line compensation parameter D is calculated based on the product of the sum of the tangents and the preset compensation coefficient a / 2. 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 angle and distance can be determined through a large number of experiments, and a comparison table can be set. The preset compensation coefficient can be determined based on the actual measured angle of the vehicle.
[0112] The present invention calculates lane line compensation parameters for the observed distance between the preceding vehicle and the vehicle based on a preset compensation coefficient, a first angle between the actual left lane line and the baseline left lane line, and a second angle between the actual right lane line and the baseline right lane line, thereby compensating for the initially estimated first distance.
[0113] Step S3043: Obtain a second distance between the vehicle and the target vehicle ahead based on the lane compensation parameter and the first distance corresponding to the target vehicle ahead.
[0114] For example, the second distance D2 between the vehicle and the target vehicle ahead is D offset +D1.
[0115] In the case of only a monocular vision camera, this embodiment of the present invention compensates for the first distance between the target vehicle ahead and the vehicle by determining the angle between the actual lane line and the reference lane line, obtaining a more accurate second distance. This allows for more accurate perception of the longitudinal distance between the target vehicle ahead and the vehicle, improving the issue of inaccurate longitudinal distance perception for vehicles on slopes. It also filters out unusually high objects on non-actual roads, reducing jerking and false braking issues associated with the use of the driver assistance system.
[0116] The vehicle distance measurement method of the present invention is described in detail below with reference to a specific application example. Figure 7 As shown, this application example includes the following steps:
[0117] Step 1: Obtain a monocular image of the vehicle in front captured by the camera.
[0118] Step 2: Segment the vehicle ahead in the monocular image according to a preset algorithm, confirm the vehicle's size parameters including length, width, height, and wheel end ground clearance, and determine the lane line parameters ahead.
[0119] Exemplarily, the focal length f of the monocular camera, the actual width W of the vehicle ahead, the image width w, and the wheel end ground contact height Z1 of the vehicle ahead are confirmed.
[0120] Step 3: Calculate a first distance between the camera and the vehicle in front based on the size parameter information.
[0121] Exemplarily, according to the principle of similar triangles, w:W=f:D1, and the first distance D1=f*W / w.
[0122] Step 4: Based on the first distance between the camera and the front vehicle and the ground contact height of the front vehicle's wheel end, the authenticity of the front vehicle is determined, false targets are filtered out, and the target front vehicle is obtained.
[0123] For example, the tangent value of the slope threshold p is calculated, and the distance reference value D is calculated based on the ratio of the reference horizontal line height Z0 to the tangent value of the slope threshold p. ref , that is, D ref = / tan(p). Filter out D1≥D ref The vehicle ahead with Z1>Z0 is the target vehicle ahead.
[0124] Step 5: Calculate the lane slope information based on the lane line parameters ahead and the preset lane line parameters.
[0125] For example, according to 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 baseline left lane line L0 and the second angle θ′ between the current right lane line L1′ and the baseline right lane line L0′.
[0126] Step 6: Compensate the first distance based on the slope information to determine a second distance between the camera and the vehicle in front of the target.
[0127] Exemplarily, the second distance D2 between the camera and the target front vehicle is D1=(1+a(tanθ+tanθ′ / 2*D1), where a is a compensation coefficient corresponding to the first angle θ and the second angle θ′.
[0128] The present invention can accurately perceive the longitudinal distance between the target vehicle in front and the vehicle at a relatively low cost when only a visual perception camera is present, optimize the problem of inaccurate longitudinal distance perception of vehicle targets on slopes, and filter out highly abnormal virtual targets on non-actual roads, reducing the problems of vehicle jerking and false braking when using the driving assistance system, thereby improving the user experience.
[0129] This embodiment also provides a vehicle distance measuring device for implementing the above-mentioned embodiments and preferred embodiments. Details already described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented using software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0130] This embodiment provides a vehicle distance measuring device, such as Figure 8 As shown, including:
[0131] An acquisition module 801 is configured to acquire a road image captured by an image acquisition device, perform recognition and detection on the road image, and obtain actual lane line parameters, the actual size of the vehicle ahead, and the image size of the vehicle ahead in the road image;
[0132] A first processing module 802 is configured to obtain a first distance between the vehicle and the preceding vehicle and a wheel end grounding height between the wheel end of the preceding vehicle and the horizontal line based on imaging parameters calibrated by the image acquisition device, the actual size, and the image size;
[0133] The second processing module 803 is used to determine the target vehicle ahead according to the reference horizontal line height calibrated by the image acquisition device, the first distance and the wheel end ground contact height;
[0134] 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 front vehicle based on the lane line compensation parameters to obtain the second distance between the vehicle and the target front vehicle.
[0135] In some optional implementations, the acquisition module 801 is further configured to:
[0136] Inputting the road image into a preset detection model for detection to obtain at least one rectangular detection frame, and identifying the rectangular detection frame to determine the vehicle model information and size information corresponding to the vehicle model information;
[0137] The actual size of the vehicle ahead is obtained according to the size information; wherein the actual size includes at least some of the following items: actual length, actual width, and actual height.
[0138] In some optional implementations, the first processing module 802 is further configured to:
[0139] Obtaining the focal length of the image acquisition device according to imaging parameters of the image acquisition device;
[0140] The actual width of the vehicle ahead is obtained according to the actual size, and the image width and wheel end ground contact image height of the vehicle ahead are obtained according to the image size;
[0141] Calculate the first distance between the vehicle and the vehicle ahead based on the focal length, the actual width, and the image width;
[0142] The wheel end contact height between the wheel end of the front vehicle and the horizontal line is calculated according to the wheel end contact image height, the first distance and the focal length.
[0143] In some optional implementations, the second processing module 803 is further configured to:
[0144] A distance reference value is obtained according to the slope threshold and the height of the reference horizontal line calibrated by the image acquisition device;
[0145] A front vehicle other than a front vehicle that meets a filtering condition is determined as a target front vehicle. The filtering condition is that the first distance to the front vehicle is not less than a distance reference value and the wheel end ground contact height is greater than a reference horizontal line height.
[0146] In some optional implementations, the second processing module 803 is further configured to:
[0147] Calculate the tangent of the slope threshold;
[0148] The distance reference value is calculated based on the ratio of the base horizontal line height to the tangent value of the slope threshold.
[0149] In some optional implementations, the third processing module 804 is further configured to:
[0150] According to 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;
[0151] Calculating a lane line compensation parameter based on the first angle, the second angle, and a preset compensation coefficient;
[0152] A second distance between the vehicle and the target vehicle ahead is obtained based on the lane line compensation parameter and the first distance corresponding to the target vehicle ahead.
[0153] In some optional implementations, the third processing module 804 is further configured to:
[0154] Calculate the sum of the tangent of the first angle and the tangent of the second angle;
[0155] The lane line compensation parameter is calculated based on the product between the sum of the tangents and the preset compensation coefficient.
[0156] In some optional implementations, the third processing module 804 is further configured to:
[0157] Obtaining a first actual orientation corresponding to the left lane line and a second actual orientation corresponding to the right lane line in the field of view of the image acquisition device based on the actual lane line parameters, and obtaining a first reference orientation corresponding to the left lane line and a second reference orientation corresponding to the right lane line in the field of view of the image acquisition device based on the reference lane line;
[0158] Calculating a first angle between an actual left lane marking and a reference left lane marking based on the first actual orientation and the first reference orientation;
[0159] A second angle between the actual right lane marking and the reference right lane marking is calculated based on the second actual orientation and the second reference orientation.
[0160] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0161] The vehicle ranging device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0162] The embodiment of the present invention further provides a vehicle having the above Figure 8 The vehicle distance measuring device shown.
[0163] See also Figure 9 , Figure 9 : is a structural diagram of a vehicle provided by an optional embodiment of the present invention, such as Figure 9 As shown, the vehicle includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the vehicle, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple devices can be connected, each device providing part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 9 A processor 10 is taken as an example.
[0164] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0165] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0166] The memory 20 may include a program storage area and a data storage area. The program storage area may store an operating system and applications required for at least one function; the data storage area may store data generated based on vehicle usage, etc. Furthermore, the memory 20 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and such remote memory may be connected to the vehicle via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0167] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0168] The vehicle further includes a communication interface 30 for the vehicle to communicate with other devices or a communication network.
[0169] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0170] A portion of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc. Accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by the computer.
[0171] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A vehicle ranging method, characterized in that: The method comprises: Obtaining a road image captured by an image acquisition device, performing recognition and detection on the road image, and obtaining actual lane line parameters, the actual size of the vehicle ahead, and the image size of the vehicle ahead in the road image; Obtaining a first distance between the vehicle and the preceding vehicle and a wheel end grounding height between the wheel end of the preceding vehicle and a horizontal line according to imaging parameters, actual size, and image size calibrated by the image acquisition device; Determine the target vehicle ahead based on the reference horizontal line height, the first distance, and the wheel end grounding height calibrated by the image acquisition device; A lane line compensation parameter is obtained based on the actual lane line parameters and the reference lane line calibrated by the image acquisition device. The first distance corresponding to the target front vehicle is corrected according to the lane line compensation parameter to obtain the second distance between the vehicle and the target front vehicle.
2. The method according to claim 1, characterized in that The method of determining the target vehicle ahead according to the reference horizontal line height, the first distance, and the wheel end ground contact height calibrated by the image acquisition device includes: A distance reference value is obtained according to the slope threshold and the height of the reference horizontal line calibrated by the image acquisition device; A front vehicle other than a front vehicle that meets a filtering condition is determined as a target front vehicle. The filtering condition is that the first distance to the front vehicle is not less than a distance reference value and the wheel end ground contact height is greater than a reference horizontal line height.
3. The method according to claim 2, characterized in that Obtaining a distance reference value based on the slope threshold and the reference horizontal line height calibrated by the image acquisition device includes: Calculate the tangent of the slope threshold; The distance reference value is calculated based on the ratio of the base horizontal line height to the tangent value of the slope threshold.
4. The method according to claim 1, wherein The method includes obtaining a lane line compensation parameter based on the actual lane line parameter and the reference lane line calibrated by the image acquisition device, and correcting the first distance corresponding to the target front vehicle based on the lane line compensation parameter to obtain a second distance between the host vehicle and the target front vehicle, including: According to 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; Calculating a lane line compensation parameter based on the first angle, the second angle, and a preset compensation coefficient; A second distance between the host vehicle and the target vehicle ahead is obtained based on the lane line compensation parameter and the first distance corresponding to the target vehicle ahead.
5. The method according to claim 4, characterized in that The calculating of the lane line compensation parameter according to the first angle, the second angle, and the preset compensation coefficient includes: Calculate the sum of the tangent of the first angle and the tangent of the second angle; The lane line compensation parameter is calculated based on the product between the sum of the tangents and a preset compensation coefficient.
6. The method according to claim 4, characterized in that The method of obtaining 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 based on the actual lane line parameters and the reference lane line includes: Obtaining a first actual orientation corresponding to the left lane line and a second actual orientation corresponding to the right lane line in the field of view of the image acquisition device based on the actual lane line parameters, and obtaining a first reference orientation corresponding to the left lane line and a second reference orientation corresponding to the right lane line in the field of view of the image acquisition device based on the reference lane lines; Calculating a first angle between an actual left lane marking and a reference left lane marking based on the first actual orientation and the first reference orientation; A second angle between the actual right lane line and the reference right lane line is calculated based on the second actual orientation and the second reference orientation.
7. The method according to any one of claims 1 to 6, characterized in that The obtaining of a first distance between the host vehicle and the vehicle ahead and a wheel end grounding height between a wheel end of the vehicle ahead and a horizontal line according to imaging parameters of the image acquisition device, an actual size of the vehicle ahead, and an image size includes: Obtaining the focal length of the image acquisition device according to imaging parameters of the image acquisition device; Obtaining an actual width of the vehicle ahead according to the actual size, and obtaining an image width and a wheel end contact height of the vehicle ahead according to the image size; Calculating a first distance between the vehicle and a preceding vehicle based on the focal length, the actual width, and the image width; The wheel end ground contact height between the wheel end of the front vehicle and the horizontal line is calculated according to the wheel end ground contact image height, the first distance, and the focal length.
8. The method according to any one of claims 1 to 6, characterized in that The identifying and detecting the road image to obtain the actual size of the vehicle ahead includes: Inputting the road image into a preset detection model for detection to obtain at least one rectangular detection frame, and identifying the rectangular detection frame to determine vehicle type information and size information corresponding to the vehicle type information; The actual size of the vehicle ahead is obtained according to the size information; wherein the actual size includes at least some of the following items: actual length, actual width, and actual height.
9. A vehicle distance measuring device, characterized in that: The device comprises: An acquisition module is used to acquire a road image captured by an image acquisition device, perform recognition and detection on the road image, and obtain 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; a first processing module, configured to obtain a first distance between the vehicle and a preceding vehicle and a wheel end grounding height between a wheel end of the preceding vehicle and a horizontal line based on imaging parameters calibrated by an image acquisition device, an actual size, and an image size; A second processing module is used to determine the target vehicle ahead based on the reference horizontal line height calibrated by the image acquisition device, the first distance and the wheel end ground contact height; The third processing module 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 front vehicle based on the lane line compensation parameters to obtain the second distance between the vehicle and the target front vehicle.
10. A vehicle, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, 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, and the computer instructions are used to enable a computer to execute the vehicle distance measurement method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the vehicle distance measurement method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Monocular vision based front vehicle detection and ranging method
CN105488454A
Vehicle distance measurement method and system
CN113866783A