Vehicle-mounted monocular distance measuring method based on infrared camera

CN116697975BActive Publication Date: 2026-08-21WU HAN XUAN YUAN ZHI JIA KE JI YOU XIAN GONG SI
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310568243.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-19
Publication Date
2026-08-21
Estimated Expiration
2043-05-19

AI Technical Summary

Technical Problem

随后,Liu等在此基础上考虑了相机姿态角pitch(俯仰角)对测距的影响;后期又在此模型上进行了大量的运用实践,但未进行更深入的理论研究

Benefits of technology

[0039]本发明公开了一种基于红外相机车载单目测距方法,包括:获取相机内外参和检测框信息;根据获取的相机内外参和检测框信息,按第一预设规则判断前车是否为同车道;根据前车是否为同车道判断结果,计算检测框纵向距离;根据相机外参和纵向距离计算每个检测框的横向距离,并使用偏航角对横向和纵向距离进行修正。本发明克服了模型求解法和相似三角形法的缺点,特别在车辆实际行驶过程中车身的俯仰角一直在剧烈变化,车身IMU传过来的角度精度较低,基于该方案实时修正外参俯仰角,测距结果更为可靠。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116697975B_ABST
    Figure CN116697975B_ABST
Patent Text Reader

Abstract

A kind of vehicle-mounted monocular ranging method based on infrared camera, comprising: obtaining camera internal and external parameters and bounding box information;According to the camera internal and external parameters and the bounding box information obtained, it is judged whether the preceding vehicle is in the same lane according to the first preset rule;According to the result of whether the preceding vehicle is in the same lane, the longitudinal distance of the bounding box is calculated;The lateral distance of each bounding box is calculated according to the camera external parameters and the longitudinal distance, and the yaw angle is used to correct the lateral and longitudinal distance.The present application overcomes the shortcomings of model solving method and similar triangle method, especially in the actual driving process of vehicle, the pitch angle of vehicle body is always changing dramatically, the angle accuracy of IMU transmitted by vehicle body is low, the pitch angle of external parameters is corrected in real time based on the scheme, and the ranging result is more reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of infrared camera-based vehicle-mounted monocular ranging method and system. Background Technology

[0002] Visual ranging is an essential key technology in the field of autonomous driving. Among visual ranging methods, compared with commonly used LiDAR and binocular ranging, unsupervised monocular visual ranging is advantageous due to its low cost (a single 64-line LiDAR can cost tens of thousands of yuan, and LiDAR cannot identify object types), ease of deployment, and low manufacturing requirements.

[0003] While significant progress has been made in visible light monocular vision ranging, it remains unsuitable for scenarios such as nighttime and foggy conditions, where infrared thermal imaging serves as a valuable supplement. However, compared to visible light images, infrared images suffer from drawbacks such as lower contrast, wider dynamic range, image discontinuity, lower signal-to-noise ratio, and lower texture. Simply applying visible light monocular vision ranging algorithms to infrared thermal imaging monocular vision ranging can lead to training failures, low accuracy, and blurred depth image edges, particularly hindering long-distance ranging and failing to meet user needs. Monocular ranging algorithms can be categorized into three types: ranging algorithms based on imaging models, ranging algorithms based on mathematical regression modeling, and ranging algorithms based on geometric derivations.

[0004] Ranging algorithms based on imaging models require prior knowledge of the actual height or width of the target vehicle, making them impractical in real-world applications. Ranging algorithms based on mathematical regression modeling, on the other hand, require large datasets and rely on existing data for mathematical modeling; once the dataset changes, the model becomes unusable, exhibiting poor generalization ability. Compared to these two algorithms, ranging algorithms based on geometric derivation only require the camera's intrinsic and extrinsic parameters, clearly demonstrating better generalization ability and applicability. Stein et al. proposed a basic model for similar triangle ranging algorithms and discussed the impact of pixel errors on ranging accuracy. Subsequently, Liu et al. considered the influence of camera pitch angle on ranging; further practical applications were conducted on this model, but no in-depth theoretical research was carried out.

[0005] Currently, when combining machine learning and deep learning techniques with monocular vision-based ranging methods, a relatively large dataset is required to train the ranging model. Moreover, the generalization ability of the model trained by this method is often not ideal, and the model performance is affected by many factors. In order to realize infrared camera-based alarm reminders during vehicle operation, it is necessary to combine the relatively low accuracy of the IMU angles (vehicle pitch angle, yaw angle, roll angle) transmitted by the vehicle body with infrared camera monocular vision ranging. Summary of the Invention

[0006] In view of the above problems, the present invention is proposed to provide a vehicle-mounted monocular ranging method based on an infrared camera that overcomes or at least partially solves the above problems.

[0007] To address the aforementioned technical problems, the embodiments of this application disclose the following technical solutions:

[0008] A vehicle-mounted monocular ranging method based on an infrared camera includes:

[0009] S100. Obtain camera intrinsic and extrinsic parameters and detection box information;

[0010] S200. Based on the acquired camera intrinsic and extrinsic parameters and detection frame information, determine whether the vehicle in front is in the same lane according to the first preset rule;

[0011] S300. Calculate the longitudinal distance of the detection frame based on whether the vehicle in front is in the same lane;

[0012] S400. Calculate the lateral distance of each detection box based on the camera extrinsic parameters and longitudinal distance, and correct the lateral and longitudinal distances using the yaw angle.

[0013] Furthermore, in S100, the obtained intrinsic parameter matrix K and extrinsic parameter vector external are respectively:

[0014]

[0015] external=(H α β γ)

[0016] in, f is the focal length, dx and dy are the pixel size in the x and y directions, and c is the focal length. x and c y Here, H represents the principal imaging point in the x / y direction, α represents the pitch angle, β represents the yaw angle, and γ represents the roll angle.

[0017] Furthermore, in S100, the method for obtaining the detection box information is as follows: the detection box vector of the target in the image is obtained as (x0 y0 w0 h0), the horizontal / vertical coordinates of the midpoint of the bottom edge of the detection box are (uv), and v = y0 + h0; where (x0 y0) are the coordinates of the corner point of the detection box edge, w0 is the width of the detection box, and h0 is the height of the detection box.

[0018] Furthermore, in S200, the first preset rule for determining whether the vehicle in front is in the same lane is:

[0019] S201. Based on the yaw angle, determine the relationship between the longitudinal distance of the preceding vehicle within the preset range and the actual lateral distance of the target;

[0020] S202. The longitudinal distances of different categories of vehicles ahead are calculated using the similar triangle method and the model solution method;

[0021] S203. Based on the horizontal coordinate and vertical distance of the center point of the target detection box, find the relationship table between the vertical distance and the actual horizontal distance of the target to determine whether the vehicle in front is in the same lane.

[0022] Furthermore, in S202, firstly, based on the existing camera extrinsic parameters, the longitudinal distance corresponding to each detection box is solved using a model-based solution method. The calculation formula for the model-based solution method is as follows:

[0023]

[0024] Where H is the camera mounting height, h is the target's height relative to the horizontal plane of the vehicle, α is the extrinsic calibration pitch angle, v is the ordinate of the midpoint of the bottom edge of the detection frame, and c y As the principal point of the image, f is the focal length, and dy is the pixel size in the y direction;

[0025] Then, based on the height of the detection boxes, the vertical distance corresponding to each detection box is estimated using the similar triangle method. The formula for the similar triangle method is:

[0026]

[0027] in, f is the focal length, dx is the pixel size in the x-direction, h1 is the actual height of the person, and h0 is the height of the detection box.

[0028] Furthermore, in S300, if the vehicle to be detected is in the same lane, the longitudinal distance of different types of vehicles is estimated using the similar triangle method based on the detection box width, and the error between the target width estimation distance and the model solution distance is judged; if the error is less than the error threshold, the model solution distance, width estimation distance and height estimation distance are fused to give the longitudinal distance of all targets on the image.

[0029] Furthermore, if the error is greater than the error threshold, the longitudinal distance is calculated based on the vehicle width in the same lane, the extrinsic parameter calibration pitch angle is corrected, and then the target model solution distance in other lanes is updated based on the corrected extrinsic parameter calibration pitch angle. Finally, the longitudinal distance of all targets in the image is given by fusing the model solution distance, width estimation distance, and height estimation distance.

[0030] Furthermore, in S300, if the vehicle to be detected is not in the same lane, it is determined whether the distance solved by the model meets the preset range. If it meets the preset range, the model-solved distance and the height estimation distance are fused to give the longitudinal distance of all targets on the image. If it does not meet the preset range, the height distance is used as the longitudinal distance of the target.

[0031] Furthermore, in S400, the lateral distance of each detection box is calculated based on the camera extrinsic parameters and the longitudinal distance. The calculation formula is as follows:

[0032]

[0033] Where u is the x-coordinate of the midpoint of the bottom edge of the detection box, and c x Let y1 be the principal point of the image, and y1 be the longitudinal distance calculated by the model. f is the focal length, dx is the pixel size in the x-direction, v is the y-coordinate of the midpoint of the bottom edge of the detection box, and c y The principal point for imaging in the y-direction is [the point where the image is formed].

[0034] Furthermore, in the S400, yaw angle is used to correct for lateral and longitudinal distances. The specific correction formula is as follows:

[0035] x′=cosβ*x1+sinβ*y1

[0036] y′=-sinβ*x1+cosβ*y1

[0037] Where x1 and y1 are the lateral and longitudinal distances between the camera's location and the vehicle in front within the detection frame, respectively, and (x′ y′) are the corrected lateral and longitudinal distances between the camera's location and the vehicle in front within the detection frame, respectively.

[0038] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following:

[0039] This invention discloses a vehicle-mounted monocular ranging method based on an infrared camera, comprising: acquiring camera intrinsic and extrinsic parameters and detection frame information; determining whether the preceding vehicle is in the same lane according to a first preset rule based on the acquired camera extrinsic and extrinsic parameters and detection frame information; calculating the longitudinal distance of the detection frame based on the determination result of whether the preceding vehicle is in the same lane; calculating the lateral distance of each detection frame based on the camera extrinsic parameters and longitudinal distance, and correcting the lateral and longitudinal distances using a yaw angle. This invention overcomes the shortcomings of model-based solutions and similar triangle methods. In particular, during actual vehicle operation, the vehicle's pitch angle changes drastically, resulting in low accuracy of the angle transmitted by the vehicle's IMU. Based on this scheme, the extrinsic parameter pitch angle is corrected in real time, making the ranging results more reliable.

[0040] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0041] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0042] Figure 1This is a flowchart of a vehicle-mounted monocular ranging method based on an infrared camera in Embodiment 1 of the present invention;

[0043] Figure 2 This is a schematic diagram illustrating the calculation of horizontal and vertical distance corrections in Embodiment 2 of the present invention. Detailed Implementation

[0044] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0045] To address the problems existing in the prior art, embodiments of the present invention provide a vehicle-mounted monocular ranging method based on an infrared camera.

[0046] Example 1

[0047] This embodiment discloses a vehicle-mounted monocular ranging method based on an infrared camera, such as... Figure 1 ,include:

[0048] S100. Obtain camera intrinsic and extrinsic parameters and detection box information; specifically, camera intrinsic parameters are parameters related to the camera's own characteristics, such as the camera's focal length and pixel size; camera extrinsic parameters are parameters in the world coordinate system, such as the camera's position and rotation direction.

[0049] In this embodiment S100, the obtained intrinsic parameter matrix K and extrinsic parameter vector external are respectively:

[0050]

[0051] external=(H α β γ)

[0052] in, f is the focal length, dx and dy are the pixel size in the x and y directions, and c is the focal length. x and c y Here, H represents the principal imaging point in the x / y direction, α represents the pitch angle, β represents the yaw angle, and γ represents the roll angle.

[0053] In this embodiment S100, the method for obtaining the detection box information is as follows: the detection box vector of the target in the image is obtained as (x0 y0 w0 h0), and the horizontal / vertical coordinates of the midpoint of the bottom edge of the detection box are (uv), then u=x0+w0 / 2, v=y0+h0; where (x0y0) is set as the coordinates of the upper left corner of the detection box, w0 is the width of the detection box, and h0 is the height of the detection box.

[0054] S200. Based on the acquired camera intrinsic and extrinsic parameters and detection box information, determine whether the vehicle in front is in the same lane according to the first preset rule; specifically, the first preset rule for determining whether the vehicle in front is in the same lane is:

[0055] S201. Based on the yaw angle, determine the relationship between the longitudinal distance of the preceding vehicle within the preset range and the actual lateral distance of the target;

[0056] Specifically, during actual vehicle operation, the vehicle's pitch angle is constantly changing. Assuming normal following, with no significant yaw angle, once the yaw angle is determined, the image abscissa u is determined at different distances in the image when the actual distance x′ = 0 for the target directly in front of the camera at different pitch angles. Furthermore, the image abscissa u is only related to the longitudinal distance y1 and the yaw angle β, and has a relatively small relationship with the pitch angle α. Therefore, a table showing the relationship between the longitudinal distance y1, the actual distance x′, and the image abscissa u can be obtained experimentally when the yaw angle β is determined.

[0057] S202. The longitudinal distances of different categories of vehicles ahead are calculated using the similar triangle method and the model solution method;

[0058] Specifically, firstly, based on the existing camera extrinsic parameters, the longitudinal distance corresponding to each detection box is calculated using a model-based solution method. The calculation formula for the model-based solution method is as follows:

[0059]

[0060] Where H is the camera mounting height, α is the external parameter calibration pitch angle, v is the ordinate of the midpoint of the bottom edge of the detection frame, and c y As the principal point of the image, f is the focal length, and dy is the pixel size in the y direction;

[0061] Then, based on the height of the detection boxes, the vertical distance corresponding to each detection box is estimated using the similar triangle method. The formula for the similar triangle method is:

[0062]

[0063] in, f is the focal length, dx is the pixel size in the x-direction, h1 is the actual height of the person, and h0 is the height of the detection box.

[0064] In this embodiment, the different categories of vehicles include common car types on the market, at least including: cars, trucks, buses, construction vehicles, bicycles, electric bicycles, and other vehicles. The width and height of different vehicle categories are different; for example, a car is 1.8m high and 1.88m wide, while a bus is 3.5m high and 2.5m wide. There is a very small permissible error range for the width and height of vehicles within the same category. The calculation formulas using the similar triangle method and the model-based solution method are consistent for different vehicle categories; only the different width and height values ​​are changed during calculation.

[0065] S203. Based on the x-coordinate and longitudinal distance of the target detection box center point, look up the relationship table between the longitudinal distance and the actual y-distance of the target to determine whether the vehicle in front is in the same lane. Specifically, determine whether the target is in the same lane based on the x-coordinate u of the target detection box center point, the lookup table in S201, and the longitudinal distance y1 estimated by height.

[0066] S300. Based on the judgment result of whether the preceding vehicle is in the same lane, calculate the longitudinal distance of the detection box. Specifically, in this embodiment, if the preceding vehicle to be detected is in the same lane, the longitudinal distance of different types of preceding vehicles is estimated using the similar triangle method according to the detection box width, and the error between the target width estimation distance and the model solution distance is judged. If the error is less than or equal to the error threshold, the longitudinal distance of all targets in the image is given by fusing the model solution distance, width estimation distance, and height estimation distance. If the error is greater than the error threshold, the pitch angle of the extrinsic parameter calibration is corrected by calculating the longitudinal distance based on the vehicle width of the vehicle in the same lane, and then the model solution distance of other lane targets is updated according to the corrected extrinsic parameter calibration pitch angle. Finally, the longitudinal distance of all targets in the image is given by fusing the model solution distance, width estimation distance, and height estimation distance.

[0067] Width estimation: Based on the similar triangle method, the target width, actual target width, and intrinsic parameters are used to solve for triangle similarity according to the target detection category;

[0068] Height estimation: The vertical distance is estimated using the target height, target detection box height, and intrinsic parameters based on triangle similarity.

[0069] In some preferred embodiments, if the vehicle to be detected is not in the same lane, it is determined whether the distance solved by the model meets the preset range. If it meets the preset range, the model-solved distance and the height estimation distance are fused to give the longitudinal distance of all targets on the image. If it does not meet the preset range, the height distance is used as the longitudinal distance of the target.

[0070] S400. Calculate the lateral distance of each detection box based on the camera extrinsic parameters and longitudinal distance, and correct the lateral and longitudinal distances using the yaw angle.

[0071] Specifically, in the S400, the lateral distance of each detection box is calculated based on the camera extrinsic parameters and the longitudinal distance. The calculation formula is as follows:

[0072]

[0073] Where u is the x-coordinate of the midpoint of the bottom edge of the detection box, and c x Let y1 be the principal point for imaging in the x-direction, and y1 be the longitudinal distance calculated by the model. f is the focal length, dx is the pixel size, v is the ordinate of the midpoint of the bottom edge of the detection box, and c y The principal point for imaging in the y-direction is [the point where the image is formed].

[0074] In some preferred S400 configurations, yaw angle is used to correct for lateral and longitudinal distances. The specific correction formula is as follows:

[0075] x′=cosβ*x1+sinβ*y1

[0076] y′=-sinβ*x1+cosβ*y1

[0077] Where, x1 and y1 are the lateral and longitudinal distances between the camera's location and the preceding vehicle within the detection frame, respectively, and (x′y′) are the corrected lateral and longitudinal distances between the camera's location and the preceding vehicle within the detection frame, respectively.

[0078] This embodiment discloses a vehicle-mounted monocular ranging method based on an infrared camera, comprising: acquiring camera intrinsic and extrinsic parameters and detection frame information; determining whether the preceding vehicle is in the same lane according to a first preset rule based on the acquired camera extrinsic and extrinsic parameters and detection frame information; calculating the longitudinal distance of the detection frame based on the determination result of whether the preceding vehicle is in the same lane; calculating the lateral distance of each detection frame based on the camera extrinsic parameters and longitudinal distance, and correcting the lateral and longitudinal distances using a yaw angle. This invention overcomes the shortcomings of model-based solutions and similar triangle methods. Especially during actual vehicle operation, the vehicle's pitch angle changes drastically, resulting in low accuracy of the angle transmitted from the vehicle's IMU. Based on this scheme, the extrinsic parameter pitch angle is corrected in real time, making the ranging results more reliable.

[0079] Example 2

[0080] Based on Example 1, this example discloses a vehicle-mounted monocular ranging method based on an infrared camera, such as... Figure 1 ,include:

[0081] S100. Obtain camera intrinsic and extrinsic parameters and detection box information; specifically, camera intrinsic parameters are parameters related to the camera's own characteristics, such as the camera's focal length and pixel size; camera extrinsic parameters are parameters in the world coordinate system, such as the camera's position and rotation direction.

[0082] In this embodiment S100, the obtained intrinsic parameter matrix K and extrinsic parameter vector external are respectively:

[0083]

[0084] external=(H α β γ)

[0085] in, f is the focal length, dx and dy are the pixel sizes, and c x and c y H is the principal imaging point, H is the installation height, α is the pitch angle, β is the yaw angle, and γ is the roll angle.

[0086] In this embodiment S100, the method for obtaining the detection box information is as follows: the detection box vector of the target in the image is obtained as (x0 y0 w0 h0), and the coordinates of the midpoint of the bottom edge of the detection box are (uv), then u=x0+w0 / 2, v=y0+h0; where (x0 y0) is the coordinate of the upper left corner of the detection box, w0 is the width of the detection box, and h0 is the height of the detection box.

[0087] In some preferred embodiments, after obtaining the coordinates (uv) of the midpoint of the bottom edge of the detection box, a general distortion correction method is used to correct the distortion of the midpoint coordinates of the bottom edge of the detection box based on the intrinsic parameter matrix K and the distortion vector. The distortion vector is:

[0088] distcoff = [k1 k2 p1 p2 k3]

[0089] Where k1, k2, and k3 are radial distortion coefficients, and p1 and p2 are tangential distortion coefficients.

[0090] S200. Based on the acquired camera intrinsic and extrinsic parameters and detection box information, determine whether the vehicle in front is in the same lane according to the first preset rule; specifically, the first preset rule for determining whether the vehicle in front is in the same lane is:

[0091] S201. Based on the yaw angle, determine the relationship between the longitudinal distance of the preceding vehicle within the preset range and the actual lateral distance of the target;

[0092] Specifically, during actual vehicle operation, the vehicle's pitch angle is constantly changing. Assuming normal following, with no significant yaw angle, once the yaw angle is determined, the image abscissa u is determined at different distances in the image when the actual distance x′ = 0 for the target directly in front of the camera at different pitch angles. Furthermore, the image abscissa u is only related to the longitudinal distance y1 and the yaw angle β, and has a relatively small relationship with the pitch angle α. Therefore, a table showing the relationship between the longitudinal distance y1, the actual distance x′, and the image abscissa u can be obtained experimentally when the yaw angle β is determined.

[0093] Specifically, based on the actual calibration results of the internal references f x ≈760, from |vc y If |<100 (the change in the coordinates of the midpoint of the bottom edge of the imaging detection box for a target ranging from 10m to 100m in the camera is less than 100 pixels), then Since y1 >> h (h < 1m), then

[0094] Formula for solving the x-axis using the model-based solution method Transformation yields Substituting x′=cosβ*x1+sinβ*y1 into the expression, we get...

[0095]

[0096] Let x′=0 in the expression, then u=-f x tanβ+c x The following conclusions can be drawn: After the yaw angle is determined, for different pitch angles, the actual distance x′=0 for the target directly in front of the camera is determined at different distances in the image; after the yaw angle is determined, the coordinates u of the center point of the target detection box are only related to the actual distance x′ and the longitudinal distance y1.

[0097] Based on the above inference, a lookup table is provided for the coordinates x of the center point of the detection box when the vehicle ahead is 10-66m (y1) and the actual distance to the target is x = -3.5m to 3.5m (x′).

[0098] In this embodiment, the different categories of vehicles include common car types on the market, at least including: cars, trucks, buses, construction vehicles, bicycles, electric bicycles, and other vehicles. The width and height of different vehicle categories are different; for example, a car is 1.8m high and 1.88m wide, while a bus is 3.5m high and 2.5m wide. There is a very small permissible error range for the width and height of vehicles within the same category. The calculation formulas using the similar triangle method and the model-based solution method are consistent for different vehicle categories; only the different width and height values ​​are changed during calculation.

[0099] S202. The longitudinal distances of different categories of vehicles ahead are calculated using the similar triangle method and the model solution method;

[0100] Specifically, firstly, based on the existing camera extrinsic parameters, the longitudinal distance corresponding to each detection box is calculated using a model-based solution method. The calculation formula for the model-based solution method is as follows:

[0101]

[0102] Where H is the camera mounting height, α is the external parameter calibration pitch angle, v is the ordinate of the midpoint of the bottom edge of the detection frame, and cy As the principal point of the image, f is the focal length, and dy is the pixel size;

[0103] Then, based on the height of the detection boxes, the vertical distance corresponding to each detection box is estimated using the similar triangle method. The formula for the similar triangle method is:

[0104]

[0105] Where h1 is the actual height of the person and h0 is the height of the detection box.

[0106] S203. Based on the x-coordinate and longitudinal distance of the target detection box center point, look up the relationship table between the longitudinal distance and the actual lateral distance of the target, and the x-coordinate and longitudinal distance of the bottom center point of the target detection box, to determine whether the vehicle in front is in the same lane. Specifically, based on the x-coordinate u of the target detection box center point, the lookup table in S201, and the longitudinal distance y1 estimated by height, determine whether the target is in the same lane.

[0107] S300. Based on the judgment result of whether the preceding vehicle is in the same lane, calculate the longitudinal distance of the detection box. Specifically, in this embodiment, if the preceding vehicle to be detected is in the same lane, the longitudinal distance of different types of vehicles is estimated using the similar triangle method according to the detection box width, and it is determined whether the error between the target width estimation distance and the model solution distance meets the condition. If the error meets the preset condition, the longitudinal distance of all targets on the image is given by fusing the model solution distance, width estimation distance, and height estimation distance. Specifically, in this embodiment, when the absolute value of the target width estimation distance and the model solution distance is less than 5m, the error meets the preset condition. At this time, the longitudinal distance of the target in the same lane is calculated as 0.5 * model solution longitudinal distance + 0.5 * width estimation longitudinal distance; the longitudinal distance of the target in different lanes is calculated as 0.9 * model solution longitudinal distance + 0.1 * height estimation longitudinal distance.

[0108] If the error does not meet the preset conditions, the extrinsic parameter calibration pitch angle is corrected based on the lane width estimate. Then, the distances of other target models are updated based on the corrected extrinsic parameter calibration pitch angle. Finally, the longitudinal distances of all targets in the image are given by fusing the model-solved distances, width estimation distances, and height estimation distances. After updating the extrinsic parameter calibration pitch angle, the longitudinal distances of the detection boxes are calculated using the same method.

[0109] In some preferred embodiments, if the vehicle to be detected is not in the same lane, the model-solved distance is judged to be reasonable based on whether it is within the range of 0-150m. If reasonable, the model-solved distance and the height-estimated distance are fused to give the longitudinal distance of all targets on the image. If unreasonable, the height distance is used as the longitudinal distance of the target. Specifically, if the model-solved distance is within a reasonable range, the longitudinal distance of the target is obtained by using 0.4 * model-solved distance + 0.6 * height-estimated distance; otherwise, the height-estimated distance is used as the longitudinal distance of the target.

[0110] S400. Calculate the lateral distance of each detection box based on the camera extrinsic parameters and longitudinal distance, and correct the lateral and longitudinal distances using the yaw angle.

[0111] Specifically, in the S400, the lateral distance of each detection box is calculated based on the camera extrinsic parameters and the longitudinal distance. The calculation formula is as follows:

[0112]

[0113] Where u is the x-coordinate of the midpoint of the bottom edge of the detection box, and c x Let y1 be the principal point of the image, and y1 be the longitudinal distance calculated by the model. f is the focal length, dx is the pixel size in the x-direction, v is the y-coordinate of the midpoint of the bottom edge of the detection box, and c y The principal point for imaging in the y-direction is [the point where the image is formed].

[0114] In some preferred S400 configurations, yaw angle is used to correct for lateral and longitudinal distances. The specific correction formula is as follows:

[0115] x′=cosβ*x1+sinβ*y1

[0116] y′=-sinβ*x1+cosβ*y1

[0117] Where x1 and y1 are the lateral and longitudinal distances between the camera's location and the vehicle in front within the detection frame, respectively, and (x′ y′) are the corrected lateral and longitudinal distances between the camera's location and the vehicle in front within the detection frame, respectively.

[0118] Specifically, such as Figure 2 Let o be the point projected onto the horizontal plane from the origin of the infrared camera coordinate system. The y1 axis is the projection of the infrared camera's optical axis onto the horizontal plane, and the x1 axis is the axis perpendicular to the y1 axis. First, the distance coordinates of point P (the center point of the bottom edge of the rear of the vehicle under test) in the x1oy1 coordinate system are calculated using the center point of the bottom edge of the target detection box of the vehicle under test according to the model solution formula. Then, according to the yaw angle, the distance coordinates of point P in the x1oy1 coordinate system are corrected to the coordinates in the x′oy′ coordinate system, which are the horizontal and longitudinal distances of the vehicle under test relative to the front of the main vehicle.

[0119] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process may be rearranged without departing from the scope of this disclosure. The appended method claims provide elements of various steps in an exemplary order and are not intended to limit the scope to the specific order or hierarchy described.

[0120] In the detailed description above, various features are combined together in a single embodiment to simplify this disclosure. This approach to disclosure should not be construed as reflecting an intention that embodiments of the claimed subject matter require more features than are explicitly stated in each claim. Rather, as reflected in the appended claims, the invention is presented with fewer features than all of the features in a single disclosed embodiment. Therefore, the appended claims are hereby explicitly incorporated into the detailed description, with each claim representing a separate preferred embodiment of the invention.

[0121] Those skilled in the art will also understand that the various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments herein can be implemented as electronic hardware, computer software, or a combination thereof. To clearly illustrate the interchangeability between hardware and software, the various illustrative components, blocks, modules, circuits, and steps described above are generally described in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. Those skilled in the art can implement the described functionality in alternative ways for each specific application; however, such implementation decisions should not be construed as departing from the scope of this disclosure.

[0122] The steps of the methods or algorithms described in conjunction with the embodiments herein can be directly embodied in hardware, software modules executed by a processor, or a combination thereof. The software modules can reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium well known in the art. An exemplary storage medium is connected to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and storage medium can reside in an ASIC. The ASIC can reside in a user terminal. Alternatively, the processor and storage medium can exist as discrete components in the user terminal.

[0123] For software implementation, the techniques described in this application can be implemented using modules (e.g., procedures, functions, etc.) that perform the functions described in this application. This software code can be stored in memory units and executed by a processor. The memory units can be implemented within the processor or outside the processor; in the latter case, they are communicatively coupled to the processor via various means, as is well known in the art.

[0124] The foregoing description includes examples of one or more embodiments. It is certainly impossible to describe all possible combinations of components or methods in order to describe the above embodiments, but those skilled in the art will recognize that further combinations and arrangements of the various embodiments are possible. Therefore, the embodiments described herein are intended to cover all such changes, modifications, and variations that fall within the scope of the appended claims. Furthermore, the term "comprising" as used in the specification or claims is interpreted in a manner similar to the term "including," as interpreted when used as a conjunction in the claims. Additionally, the use of any term "or" in the specification of the claims is intended to mean "non-exclusive or."

Claims

1. A vehicle-mounted monocular ranging method based on an infrared camera, characterized in that, include: S100. Obtain camera intrinsic and extrinsic parameters and detection box information; S200. Based on the acquired camera intrinsic and extrinsic parameters and detection frame information, determine whether the vehicle in front is in the same lane according to the first preset rule; In S200, the first preset rule for determining whether the vehicle in front is in the same lane is: S201. Based on the yaw angle, determine the relationship between the longitudinal distance of the preceding vehicle within the preset range and the actual lateral distance of the target; S202. The longitudinal distances of different categories of vehicles ahead are calculated using the similar triangle method and the model solution method; S203. Based on the horizontal coordinate and vertical distance of the center point of the target detection box, find the relationship table between the vertical distance and the actual horizontal distance of the target, and determine whether the vehicle in front is in the same lane; S300. Calculate the longitudinal distance of the detection box based on whether the preceding vehicle is in the same lane. In S300, if the preceding vehicle is in the same lane, estimate the longitudinal distance of different types of preceding vehicles using the similar triangle method based on the detection box width, and determine the error between the target width estimation distance and the model solution distance. In S300, if the preceding vehicle is not in the same lane, determine whether the model solution distance meets the preset range. If it is within the preset range, use the model solution distance and the height estimation distance to fuse and give the longitudinal distance of all targets on the image. If it is not within the preset range, use the height distance as the target longitudinal distance. S400. Calculate the lateral distance of each detection box based on the camera extrinsic parameters and longitudinal distance, and correct the lateral and longitudinal distances using the yaw angle.

2. The vehicle-mounted monocular ranging method based on an infrared camera as described in claim 1, characterized in that, In S100, the obtained intrinsic parameter matrix K and extrinsic parameter vector external are respectively: ; ; in, , , Focal length , The pixel size in the x / y direction. and The principal points for imaging in the x and y directions. For installation height, The pitch angle, Yaw angle This is the roll angle.

3. The vehicle-mounted monocular ranging method based on an infrared camera as described in claim 1, characterized in that, In S100, the method for obtaining the detection box information is as follows: obtain the detection box vector of the target in the image. The x / y coordinates of the midpoint of the bottom edge of the detection box are ;in, To detect the coordinates of the corner points of the bounding box, For the detection frame width, This is the height of the detection frame.

4. The vehicle-mounted monocular ranging method based on an infrared camera as described in claim 1, characterized in that, In S300, if the error is less than or equal to the error threshold, the model-based solution method is used to solve for the distance, width estimation distance, and height estimation distance respectively, and then the longitudinal distance of all targets in the image is fused to give the longitudinal distance of all targets in the image. If the error is greater than the error threshold, the longitudinal distance is calculated based on the vehicle width in the same lane, the extrinsic parameter calibration pitch angle is corrected, and then the model-based solution method distance of other lane targets is updated based on the corrected extrinsic parameter calibration pitch angle. Finally, the model-based solution method distance, width estimation distance, and height estimation distance are fused to give the longitudinal distance of all targets in the image.

5. The vehicle-mounted monocular ranging method based on an infrared camera as described in claim 1, characterized in that, In S400, the lateral distance of each detection box is calculated based on the camera extrinsic parameters and the longitudinal distance. The calculation formula is as follows: ; Where u is the x-coordinate of the midpoint of the bottom edge of the detection box. Let y1 be the principal point for imaging in the x-direction, y1 be the longitudinal distance solved by the model, and h be the height of the target relative to the horizontal plane where the vehicle is located. , Focal length v is the pixel size, v is the ordinate of the midpoint of the bottom edge of the detection box, and c is the pixel size. y The principal point for imaging in the y-direction is [the point where the image is formed].

6. The vehicle-mounted monocular ranging method based on an infrared camera as described in claim 1, characterized in that, In S400, yaw angle is used to correct for lateral and longitudinal distances. The specific correction formula is as follows: ; ; Where x1 and y1 are the lateral and longitudinal distances between the camera's location and the vehicle in front within the detection frame, respectively. These represent the corrected camera location and the lateral and longitudinal distances from the preceding vehicle within the detection frame. This is the yaw angle.

Citation Information

Patent Citations

  • Vehicle distance measurement method and system

    CN113866783A

  • Lane line optical ranging method based on inertial measurement unit compensation

    CN114659527A

  • Target tracking method based on monocular vision, terminal equipment and storage medium

    CN114972427A