Vehicle ranging method, apparatus, and vehicle
By combining image recognition and radar information, the basic information and size of the vehicle are determined, which solves the problem of inaccurate vehicle ranging results and achieves reliable and accurate ranging results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUNAN XINGBIDA NETLINK TECH CO LTD
- Filing Date
- 2023-03-28
- Publication Date
- 2026-06-23
AI Technical Summary
In existing technologies, vehicle ranging results are inaccurate and cannot effectively integrate monocular camera ranging and millimeter-wave radar ranging, resulting in unreliable ranging results.
By collecting forward-view images and radar information, and combining image recognition and data query, the basic information and size of the main target vehicle are determined. The distance measurement results are fused using camera intrinsic parameters and radar information to obtain the final target distance.
It improves the reliability and accuracy of vehicle ranging results, combines the advantages of image ranging and radar ranging, and provides more accurate vehicle distance data.
Smart Images

Figure CN116299396B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle ranging technology, and more particularly to a vehicle ranging method, device, and vehicle. Background Technology
[0002] Measuring the distance to the vehicle in front is a crucial part of ensuring safety while driving.
[0003] In existing technologies, ranging results obtained through monocular cameras are inaccurate, and millimeter-wave radar cannot distinguish targets, leading to false detections. Furthermore, when the deviation between monocular ranging results and millimeter-wave radar ranging results is too large, reliable and accurate ranging results cannot be obtained by fusion. Summary of the Invention
[0004] This invention provides a vehicle ranging method, device, and vehicle to address the shortcomings of unreliable and inaccurate vehicle ranging results in the prior art, and to achieve the fusion of ranging results from forward-view images and radar to obtain reliable and accurate ranging results.
[0005] This invention provides a vehicle ranging method, comprising:
[0006] The front view image of the first time period is acquired to determine the basic information of the main target vehicle. The basic information includes vehicle category information, detection box aspect ratio and detection box pixel size.
[0007] Based on the vehicle category information of the main target vehicle and the aspect ratio of the detection frame, the target vehicle size of the main target vehicle is queried in the preset vehicle database;
[0008] Based on the camera's intrinsic parameters, the pixel size of the detection frame, and the size of the target vehicle, the first target distance to be determined for the main target vehicle is determined;
[0009] Collect radar information of the primary target vehicle during the first time period to determine the second target distance of the primary target vehicle;
[0010] The final target distance relative to the main target vehicle is obtained by fusing the first target distance and the second target distance.
[0011] According to the vehicle ranging method provided by the present invention, the target vehicle size of the main target vehicle is multiple;
[0012] The method further includes:
[0013] Based on the camera's intrinsic parameters, the pixel size of the detection frame, and the size of the target vehicle, determine the first target distance to be determined for the main target vehicle corresponding to each of the target vehicle sizes;
[0014] Based on the second target distance, a first target distance is determined from among a plurality of first target distances to be determined.
[0015] According to the vehicle ranging method provided by the present invention, the step of collecting radar information of the main target vehicle in the first time period and determining the second target distance of the main target vehicle includes:
[0016] Collect radar information of at least one radar target during the first time period;
[0017] Based on the radar information, determine the direction and range information of the radar target;
[0018] Based on the direction information, the primary target vehicle is identified among at least one of the radar targets;
[0019] The distance to the second target is determined based on the distance information corresponding to the primary target vehicle.
[0020] According to the vehicle ranging method provided by the present invention, the step of acquiring a front view image of a first time period and determining the basic information of the main target vehicle includes:
[0021] The front view image is input into a deep learning model for object detection and lane line detection to obtain vehicle category information, detection box aspect ratio, detection box pixel size and vehicle pixel coordinates, as well as the lane line pixel coordinates of the current lane.
[0022] Based on the vehicle pixel coordinates and the lane line pixel coordinates, the vehicle located in the current lane with the largest detection box pixel size is identified as the main target vehicle.
[0023] The vehicle category information, the aspect ratio of the detection box, and the pixel size of the detection box of the main target vehicle are determined as the basic information of the main target vehicle.
[0024] According to the vehicle ranging method provided by the present invention, the preset vehicle database is obtained in the following manner:
[0025] Obtain vehicle category information and create a corresponding vehicle category information directory;
[0026] Based on the vehicle category information, determine the corresponding vehicle width-to-height ratio, and create a vehicle width-to-height ratio directory under the corresponding vehicle category information directory;
[0027] Obtain at least one vehicle dimension corresponding to the vehicle aspect ratio and add it to the corresponding vehicle aspect ratio directory;
[0028] A vehicle database is generated based on the vehicle category information directory, the vehicle aspect ratio directory, and the vehicle dimensions.
[0029] According to a vehicle ranging method provided by the present invention, the step of querying the target vehicle size of the main target vehicle in a preset vehicle database based on the vehicle category information of the main target vehicle and the aspect ratio of the detection frame includes:
[0030] In the vehicle database, search for target vehicle category information and the corresponding target vehicle category information directory that match the vehicle category information of the main target vehicle;
[0031] Obtain the aspect ratio of at least one vehicle to be selected from the target vehicle category information directory;
[0032] Calculate the similarity between the aspect ratio of the vehicle to be selected and the aspect ratio of the detection frame of the main target vehicle;
[0033] The aspect ratio of the candidate vehicle with the highest similarity is determined as the aspect ratio of the target vehicle.
[0034] The target vehicle size of the main target vehicle is determined by identifying at least one vehicle size under the target vehicle aspect ratio directory corresponding to the target vehicle aspect ratio.
[0035] According to the vehicle ranging method provided by the present invention, the method further includes:
[0036] The estimated vehicle size of the main target vehicle is calculated based on the final target distance, the camera's intrinsic parameters, and the detection frame pixel size.
[0037] Calculate the difference between the target vehicle size and the estimated vehicle size;
[0038] The vehicle database is updated based on the target vehicle's aspect ratio, the similarity corresponding to the target vehicle's aspect ratio, the estimated vehicle size, and the difference.
[0039] According to a vehicle ranging method provided by the present invention, the step of updating the vehicle database based on the aspect ratio of the target vehicle, the similarity corresponding to the aspect ratio of the target vehicle, the estimated vehicle size, and the difference includes:
[0040] If the similarity corresponding to the aspect ratio of the target vehicle is not the preset similarity, the aspect ratio of the detection box of the main target vehicle is added as the new vehicle aspect ratio in the target vehicle category information directory of the vehicle database, and the estimated vehicle size is added in the new vehicle aspect ratio directory.
[0041] If the similarity corresponding to the aspect ratio of the target vehicle is a preset similarity and the difference is not greater than the preset difference, the target vehicle size in the vehicle database is replaced according to the estimated vehicle size.
[0042] If the similarity corresponding to the aspect ratio of the target vehicle is a preset similarity and the difference is greater than the preset difference, the estimated vehicle size is added to the directory of the aspect ratio of the target vehicle in the vehicle database.
[0043] The present invention also provides a vehicle ranging device, comprising:
[0044] The image ranging unit is used to acquire a front view image of the first time period, determine the basic information of the main target vehicle, including vehicle category information, detection box aspect ratio, and detection box pixel size; based on the vehicle category information of the main target vehicle and the detection box aspect ratio, query the target vehicle size of the main target vehicle in a preset vehicle database; and determine the first target distance of the main target vehicle based on the camera's intrinsic parameters, the detection box pixel size, and the target vehicle size.
[0045] A radar ranging unit is used to collect radar information of the main target vehicle during the first time period and determine the second target distance of the main target vehicle.
[0046] The fusion unit is used to fuse the first target distance and the second target distance to obtain the final target distance relative to the main target vehicle.
[0047] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the vehicle ranging methods described above.
[0048] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the vehicle ranging methods described above.
[0049] The present invention also provides a vehicle including a forward-facing camera, a millimeter-wave radar, and a processor, the processor being configured to implement the steps of the vehicle ranging method described above.
[0050] The vehicle ranging method, apparatus, and vehicle provided by this invention determine the basic information of the main target vehicle based on a front view image. Based on the vehicle category information and the aspect ratio of the detection frame, the target vehicle size is queried from a preset vehicle database, combining image recognition and data query to determine the main target vehicle size, providing a data foundation for subsequent image ranging. Based on the camera's intrinsic parameters, the detection frame pixel size, and the target vehicle size, a first target distance relative to the main target vehicle is determined, achieving image ranging. Based on the radar information of the main target vehicle, a second target distance is determined, achieving radar ranging. The first and second target distances are fused to obtain the final target distance relative to the main target vehicle, achieving a fusion of image ranging and radar ranging results, resulting in a more reliable and accurate final target distance. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0052] Figure 1 This is a flowchart illustrating the vehicle ranging method provided by the present invention;
[0053] Figure 2 This is a schematic diagram of the vehicle ranging device provided by the present invention;
[0054] Figure 3 This is a structural schematic diagram of the vehicle provided by the present invention;
[0055] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention; Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0057] This invention provides a vehicle ranging method, such as... Figure 1 As shown, it includes:
[0058] S11. Acquire the front view image of the first time period and determine the basic information of the main target vehicle. The basic information includes vehicle category information, detection box aspect ratio and detection box pixel size.
[0059] S12. Based on the vehicle category information of the main target vehicle and the aspect ratio of the detection frame, query the target vehicle size of the main target vehicle in the preset vehicle database;
[0060] S13. Determine the first target distance of the main target vehicle based on the camera's intrinsic parameters, the pixel size of the detection frame, and the size of the target vehicle;
[0061] S14. Collect radar information of the main target vehicle during the first time period and determine the second target distance of the main target vehicle;
[0062] S15. The first target distance and the second target distance are fused to obtain the final target distance relative to the main target vehicle.
[0063] Step S14 can be executed after steps S11-S13, before step S11, or simultaneously with steps S11-S13.
[0064] Specifically, in the first time period, the forward-looking camera and millimeter-wave radar can be controlled to work simultaneously. The forward-looking camera acquires forward-view images, and the millimeter-wave radar acquires radar information of the main target vehicle. The start and end times of the first time period can be set according to actual needs.
[0065] Basic information such as vehicle category, detection box aspect ratio, and detection box pixel count of the target vehicle to be ranged can be determined from the front view image. Vehicle category information includes, but is not limited to, vehicle brand and model (e.g., sedan, SUV, bus, truck, etc.). Based on the target vehicle's vehicle category information and detection box aspect ratio, the vehicle size corresponding to the vehicle category information and detection box aspect ratio can be queried from a preset vehicle database. Multiple vehicle sizes can be retrieved.
[0066] For example, if the vehicle category information is A and the aspect ratio of the detection box is 2:1, in the preset vehicle database, the vehicle dimensions corresponding to A and 2:1 are dimension a (2 meters wide and 1 meter high) and dimension b (4 meters wide and 2 meters high). Then, both a and b are taken as the vehicle dimensions to be determined.
[0067] Based on the predetermined intrinsic parameters of the forward-looking camera, the pixel size of the detection frame, and the size of the vehicle to be determined, the first target distance relative to the main target vehicle is determined for each vehicle size. For vehicles with multiple sizes to be determined, multiple first target distances are obtained, which are then used for matching with the ranging information from the millimeter-wave radar.
[0068] The distance to the second target can be determined based on the radar information of the primary target vehicle.
[0069] The distances to the first and second targets are fused. Optionally, this can be done by setting weighting coefficients to calculate a weighted average of the first and second target distances as the fusion result. Combining the results of image recognition ranging and millimeter-wave radar ranging yields a more reliable and accurate final target distance relative to the primary target vehicle.
[0070] In this embodiment of the invention, basic information of the primary target vehicle is determined based on the front view image. Based on the vehicle category information and the aspect ratio of the detection frame, the target vehicle size is queried from a preset vehicle database. This combines image recognition and data query to determine the vehicle size of the primary target, providing a data foundation for subsequent image ranging. A first target distance is determined based on the camera's intrinsic parameters, the pixel size of the detection frame, and the target vehicle size, achieving image ranging. A second target distance is determined based on the radar information of the primary target vehicle, achieving millimeter-wave ranging. The first and second target distances are fused to obtain the final target distance relative to the primary target vehicle, achieving a fusion of image ranging and radar ranging results, resulting in a more reliable and accurate final target distance.
[0071] According to a vehicle ranging method provided by the present invention, the target vehicle of the main target vehicle has multiple dimensions; the method further includes:
[0072] S16. Based on the intrinsic parameters of the camera, the pixel size of the detection frame, and the size of the target vehicle, determine the first target distance to be determined for the main target vehicle corresponding to each target vehicle size;
[0073] S17. Based on the second target distance, determine the first target distance from among the plurality of first target distances to be determined.
[0074] Specifically, for each target vehicle size, a first target distance to be determined can be established relative to the main target vehicle by the forward-looking camera, and then the target can be filtered by a second target distance.
[0075] Since radar ranging is slightly more accurate than image recognition ranging, after determining the second target distance relative to the main target vehicle, the distances of multiple target vehicles corresponding to the first target distances to be determined can be filtered based on the second target distance to determine the first target distance that is closest to the second target distance.
[0076] In this embodiment of the invention, when there are multiple target vehicle sizes of the main target vehicle determined in the vehicle database, a corresponding first distance to be determined is determined for each target vehicle size as the image ranging result to be determined. The reliable first target distance is then selected from the radar ranging results as the final image test result.
[0077] According to a vehicle ranging method provided by the present invention, step S14 includes:
[0078] S141. Collect radar information of at least one radar target in the first time period;
[0079] S142. Based on the radar information, determine the direction and range information of the radar target;
[0080] S143. Based on the direction information, determine the main target vehicle among at least one of the radar targets;
[0081] S144. Determine the distance to the second target based on the distance information corresponding to the main target vehicle.
[0082] Specifically, radar information of surrounding radar targets can be acquired using millimeter-wave radar. For multiple radar targets, radar information corresponding to each target can be acquired, and the direction and distance information of the radar targets relative to the millimeter-wave radar can be analyzed. Based on the direction information, the radar target closest to the preset direction can be identified as the primary target vehicle, and its corresponding distance information can be determined as the secondary target distance.
[0083] In this embodiment of the invention, when the radar detects at least one radar target, the primary target vehicle can be determined from the at least one radar target based on the direction information of the radar target, and its corresponding distance information can be determined as the second target distance.
[0084] According to a vehicle ranging method provided by the present invention, step S11 includes:
[0085] S111. Input the front view image into a deep learning model for target detection and lane line detection to obtain vehicle category information, detection box aspect ratio, detection box pixel size and vehicle pixel coordinates, and obtain the lane line pixel coordinates of the current lane.
[0086] S112. Based on the vehicle pixel coordinates and the lane line pixel coordinates, determine the vehicle located in the current lane and with the largest detection box pixel size as the main target vehicle among the vehicles.
[0087] S113. The vehicle category information, the aspect ratio of the detection box, and the pixel size of the detection box of the main target vehicle are determined as the basic information of the main target vehicle.
[0088] Specifically, the front view image can be input into a deep learning model, which can then detect targets and lane lines in the front view image to obtain vehicle category information, vehicle detection box aspect ratio, vehicle detection box pixel size and vehicle pixel coordinates, as well as the lane line pixel coordinates of the current lane.
[0089] Based on the vehicle's pixel coordinates and the lane line's pixel coordinates, the positional relationship between the vehicle and the current lane line can be determined. This positional relationship can be used to determine whether the vehicle is in the current lane and whether the vehicle is relatively far or near in the current lane.
[0090] Among the vehicles in the current lane, the vehicle with the largest detection box pixel size (the larger the detection box pixel size, the closer it is) is identified as the closest vehicle and is used as the main target vehicle for distance measurement. Its corresponding vehicle category information, detection box aspect ratio, and detection box pixel size are determined as the basic information of the main target vehicle.
[0091] In this embodiment of the invention, by using the vehicle pixel coordinates and the lane line pixel coordinates, the vehicle located in the current lane with the largest detection box pixel size is identified as the main target vehicle, thereby realizing the identification and positioning of the main target vehicle and facilitating subsequent image ranging.
[0092] According to a vehicle ranging method provided by the present invention, the preset vehicle database is obtained in the following manner:
[0093] S21. Obtain the vehicle category information and create a corresponding vehicle category information directory;
[0094] S22. Determine the corresponding vehicle width-to-height ratio based on the vehicle category information, and create a vehicle width-to-height ratio directory under the corresponding vehicle category information directory;
[0095] S23. Obtain at least one vehicle dimension corresponding to the vehicle width-to-height ratio, and add it to the corresponding vehicle width-to-height ratio directory;
[0096] S24. Generate a vehicle database based on the vehicle category information directory, the vehicle aspect ratio directory, and the vehicle dimensions.
[0097] Specifically, vehicle category information can be obtained in advance, and this can be achieved through methods including, but not limited to, manual input and online search. After determining the vehicle category information, the corresponding aspect ratio can be determined for different categories; a single vehicle category can have multiple aspect ratios. Once the aspect ratio is determined, the vehicle category information and the corresponding vehicle dimensions can be obtained, again through methods including, but not limited to, manual input and online search. Multiple vehicle dimensions can be available.
[0098] In one example, two vehicle category information entries, A and B, were manually entered. An online search revealed that vehicle category A corresponds to two width-to-height ratios, A1 and A2, while vehicle category B corresponds to one width-to-height ratio, B1. Further online searches revealed that width-to-height ratio A1 corresponds to one vehicle size, denoted as A11; width-to-height ratio A2 corresponds to two vehicle sizes, denoted as A21 and A22; and width-to-height ratio B1 corresponds to two vehicle sizes, denoted as B11 and B12.
[0099] The generated vehicle database includes vehicle category information A, under which are vehicle aspect ratios A1 and A2, under which are vehicle dimensions A11, and under which are vehicle dimensions A21 and A22; the vehicle database also includes vehicle category information B, under which is vehicle aspect ratio B1, and under which are vehicle dimensions B11 and B12.
[0100] In this embodiment of the invention, the data constituting the vehicle database is determined based on three dimensions: vehicle category information, vehicle width-to-height ratio, and vehicle size. This makes the generated vehicle database easier to manage and query, and improves the efficiency of subsequent queries on vehicle size within the vehicle database.
[0101] According to a vehicle ranging method provided by the present invention, step S12 includes:
[0102] S121. In the vehicle database, search for target vehicle category information that matches the vehicle category information of the main target vehicle;
[0103] S122. Obtain the aspect ratio of at least one vehicle to be selected from the target vehicle category information directory;
[0104] S123. Calculate the similarity between the aspect ratio of the vehicle to be selected and the aspect ratio of the detection frame of the main target vehicle;
[0105] S124. The aspect ratio of the vehicle to be selected with the highest similarity is determined as the aspect ratio of the target vehicle.
[0106] S125. Determine at least one vehicle size under the target vehicle width-to-height ratio directory corresponding to the target vehicle width-to-height ratio as the target vehicle size of the main target vehicle.
[0107] Specifically, after determining the vehicle category information of the primary target vehicle, the target vehicle category information that matches the vehicle category information of the primary target vehicle can be directly queried in the vehicle database.
[0108] After determining the target vehicle category information, the aspect ratios of the corresponding vehicles in the target vehicle category information directory (multiple ratios are possible) can be obtained and used as the aspect ratios of vehicles to be selected. Since the detection box in deep model image recognition is the vehicle itself, the aspect ratio of the detection box can be understood as the vehicle's aspect ratio. However, due to limitations in model accuracy, the detection box may not perfectly describe the vehicle's outline, leading to slight discrepancies between the detection box aspect ratio and the actual vehicle aspect ratio. Therefore, a similarity method is used to determine the aspect ratio of the vehicle most similar to the detection box aspect ratio in the vehicle database.
[0109] After calculating the similarity between the aspect ratio of the vehicle to be selected and the aspect ratio of the detection box of the main target vehicle, the aspect ratio of the vehicle to be selected with the highest similarity is determined as the aspect ratio of the target vehicle.
[0110] Obtain the vehicle dimensions listed in the target vehicle aspect ratio directory and determine them as the vehicle dimensions to be determined for the main target vehicle.
[0111] In this embodiment of the invention, considering the limited accuracy of the depth model, the aspect ratio of the detection bounding box may differ from the actual aspect ratio of the vehicle. After obtaining the aspect ratios of vehicles to be selected from the target vehicle category information directory in the vehicle database, the similarity between the aspect ratio of the vehicles to be selected and the aspect ratio of the detection bounding box of the main target vehicle is calculated. The aspect ratio of the vehicle to be selected with the highest similarity is selected as the aspect ratio of the target vehicle, and the dimensions of the vehicles to be determined in its directory are obtained. This ensures that the obtained dimensions of the vehicles to be determined are as close as possible to the dimensions of the main target vehicle.
[0112] According to a vehicle ranging method provided by the present invention, the method further includes:
[0113] S31. Calculate the estimated vehicle size of the main target vehicle based on the final target distance, the camera's intrinsic parameters, and the detection frame pixel size;
[0114] S32. Calculate the difference between the target vehicle size and the estimated vehicle size;
[0115] S33. Update the vehicle database based on the target vehicle's aspect ratio, the similarity corresponding to the target vehicle's aspect ratio, the estimated vehicle size, and the difference.
[0116] Specifically, the target vehicle size essentially exists in the vehicle database, but this size is not necessarily absolutely standard and accurate. The target vehicle size can be updated and optimized based on factors such as the final target distance after fusion, the intrinsic parameters of the forward-looking camera, and the pixel size of the detection box, so as to improve the accuracy of the data in the vehicle database and provide a more accurate data foundation for the future.
[0117] Based on the final target distance after fusion, the intrinsic parameters of the forward-looking camera, and the pixel size of the detection box, the estimated vehicle size of the main target vehicle can be calculated. Then, the degree of difference between the estimated vehicle size and the target vehicle size can be determined.
[0118] The vehicle database is updated based on the target vehicle's aspect ratio, the similarity corresponding to the target vehicle's aspect ratio, the estimated vehicle size, and the degree of difference.
[0119] Specifically, step S33 may include:
[0120] S331. If the similarity corresponding to the aspect ratio of the target vehicle is not the preset similarity, add the aspect ratio of the detection box of the main target vehicle as the new vehicle aspect ratio to the target vehicle category information directory of the vehicle database, and add the estimated vehicle size to the new vehicle aspect ratio directory.
[0121] S332. If the similarity corresponding to the aspect ratio of the target vehicle is a preset similarity and the difference is not greater than the preset difference, replace the target vehicle size in the vehicle database with the estimated vehicle size.
[0122] S333. If the similarity corresponding to the aspect ratio of the target vehicle is a preset similarity and the difference is greater than the preset difference, add the estimated vehicle size to the directory of the aspect ratio of the target vehicle in the vehicle database.
[0123] In one example, a preset similarity of 1 can be set. If the similarity to the target vehicle's aspect ratio is not 1, it means that the aspect ratio of the main target vehicle's detection box does not exactly exist within the vehicle aspect ratios listed in the target vehicle category information directory of the vehicle database. Instead, a similar aspect ratio is used as the target vehicle's aspect ratio. In this case, the main target vehicle's detection box aspect ratio is added as the new vehicle aspect ratio to the target vehicle category information directory, and estimated vehicle size data is added as the vehicle size to the directory containing this newly added aspect ratio. This completes the supplementation of vehicle aspect ratios and vehicle sizes in the target vehicle category information directory.
[0124] Continuing with the previous example, if the similarity of the target vehicle's aspect ratio is 1, it means that the aspect ratio of the detection box of the main target vehicle just exists in the vehicle aspect ratio of the target vehicle category information directory in the vehicle database. At this time, it is further determined whether the difference is greater than the preset difference.
[0125] If the difference is not greater than the preset difference, it means that the difference between the vehicle size of the main target vehicle estimated in reverse and the target vehicle size in the vehicle database is small. This can be understood as the target vehicle size being unreliable and inaccurate. The estimated vehicle size is then used to replace the target vehicle size in the vehicle database to optimize the vehicle size data in the vehicle database.
[0126] If the difference is greater than the preset difference, it means that the vehicle size of the main target vehicle estimated in reverse is very different from the target vehicle size in the vehicle database. This may be because the width-to-height ratio of the target vehicle exists in a vehicle size that is not recorded in the vehicle database. The estimated vehicle size is added to the directory of the target vehicle width-to-height ratio in the vehicle database to supplement the vehicle size data in the vehicle database.
[0127] In this embodiment of the invention, considering that the data in the vehicle database is not absolutely standardized and accurate, the estimated vehicle size of the main target vehicle is inferred in reverse based on the final target distance, the camera's intrinsic parameters, and the pixel size of the detection box. The difference between the target vehicle size and the estimated vehicle size is calculated. Based on the target vehicle's aspect ratio, the similarity corresponding to the target vehicle's aspect ratio, the estimated vehicle size, and the difference, the vehicle database is updated to ensure that the vehicle sizes in the vehicle database have high accuracy, providing a more reliable data foundation for subsequent distance measurement.
[0128] The vehicle ranging device provided by the present invention is described below. The vehicle ranging device described below and the vehicle ranging method described above can be referred to in correspondence.
[0129] The present invention also provides a vehicle ranging device, such as... Figure 2 As shown, it includes:
[0130] Image ranging unit 21 is used to acquire a front view image of the first time period, determine the basic information of the main target vehicle, including vehicle category information, detection box aspect ratio, and detection box pixel size; query the target vehicle size of the main target vehicle in a preset vehicle database based on the vehicle category information of the main target vehicle and the detection box aspect ratio; and determine the first target distance of the main target vehicle based on the camera's intrinsic parameters, the detection box pixel size, and the target vehicle size.
[0131] Radar ranging unit 22 is used to collect radar information of the main target vehicle during the first time period and determine the second target distance of the main target vehicle;
[0132] The fusion unit 23 is used to fuse the first target distance and the second target distance to obtain the final target distance relative to the main target vehicle.
[0133] In this embodiment of the invention, basic information of the primary target vehicle is determined based on the front view image. Based on the vehicle category information and the aspect ratio of the detection frame, the target vehicle size is queried from a preset vehicle database. This combines image recognition and data query to determine the vehicle size of the primary target, providing a data foundation for subsequent image ranging. A first target distance to the primary target vehicle is calculated based on the camera's intrinsic parameters, the pixel size of the detection frame, and the target vehicle size, achieving image ranging. A second target distance to the primary target vehicle is determined based on the radar information of the primary target vehicle, achieving radar ranging. The first and second target distances are fused to obtain the final target distance relative to the primary target vehicle, achieving a fusion of image ranging and radar ranging results, resulting in a more reliable and accurate final target distance.
[0134] According to the vehicle ranging device provided by the present invention, the target vehicle of the main target vehicle has multiple target vehicle sizes; the image ranging unit 21 is further used for:
[0135] Based on the camera's intrinsic parameters, the pixel size of the detection frame, and the size of the target vehicle, determine the first target distance to be determined for the main target vehicle corresponding to each of the target vehicle sizes;
[0136] Based on the second target distance, a first target distance is determined from among a plurality of first target distances to be determined.
[0137] According to the present invention, a vehicle ranging device, a radar ranging unit 22, is specifically used for:
[0138] Collect radar information of at least one radar target during the first time period;
[0139] Based on the radar information, determine the direction and range information of the radar target;
[0140] Based on the direction information, the primary target vehicle is identified among at least one of the radar targets;
[0141] The distance to the second target is determined based on the distance information corresponding to the primary target vehicle.
[0142] According to the present invention, a vehicle ranging device, an image ranging unit 21, is specifically used for:
[0143] The front view image is input into a deep learning model for object detection and lane line detection to obtain vehicle category information, detection box aspect ratio, detection box pixel size and vehicle pixel coordinates, as well as the lane line pixel coordinates of the current lane.
[0144] Based on the vehicle pixel coordinates and the lane line pixel coordinates, the vehicle located in the current lane with the largest detection box pixel size is identified as the main target vehicle.
[0145] The vehicle category information, the aspect ratio of the detection box, and the pixel size of the detection box of the main target vehicle are determined as the basic information of the main target vehicle.
[0146] According to a vehicle ranging device provided by the present invention, the preset vehicle database is obtained in the following manner:
[0147] Obtain vehicle category information and create a corresponding vehicle category information directory;
[0148] Based on the vehicle category information, determine the corresponding vehicle width-to-height ratio, and create a vehicle width-to-height ratio directory under the corresponding vehicle category information directory;
[0149] Obtain at least one vehicle dimension corresponding to the vehicle aspect ratio and add it to the corresponding vehicle aspect ratio directory;
[0150] A vehicle database is generated based on the vehicle category information directory, the vehicle aspect ratio directory, and the vehicle dimensions.
[0151] According to the present invention, a vehicle ranging device, an image ranging unit 21, is specifically used for:
[0152] In the vehicle database, search for target vehicle category information and the corresponding target vehicle category information directory that match the vehicle category information of the main target vehicle;
[0153] Obtain the aspect ratio of at least one vehicle to be selected from the target vehicle category information directory;
[0154] Calculate the similarity between the aspect ratio of the vehicle to be selected and the aspect ratio of the detection frame of the main target vehicle;
[0155] The aspect ratio of the candidate vehicle with the highest similarity is determined as the aspect ratio of the target vehicle.
[0156] At least one vehicle size under the target vehicle aspect ratio directory corresponding to the target vehicle aspect ratio is determined as the vehicle size to be determined for the main target vehicle.
[0157] A vehicle ranging device according to the present invention further includes an updating unit for:
[0158] The estimated vehicle size of the main target vehicle is calculated based on the final target distance, the camera's intrinsic parameters, and the detection frame pixel size.
[0159] Calculate the difference between the target vehicle size and the estimated vehicle size;
[0160] The vehicle database is updated based on the target vehicle's aspect ratio, the similarity corresponding to the target vehicle's aspect ratio, the estimated vehicle size, and the difference.
[0161] According to the present invention, a vehicle ranging device, including an updating unit, is specifically used for:
[0162] If the similarity corresponding to the aspect ratio of the target vehicle is not the preset similarity, the aspect ratio of the detection box of the main target vehicle is added as the new vehicle aspect ratio in the target vehicle category information directory of the vehicle database, and the estimated vehicle size is added in the new vehicle aspect ratio directory.
[0163] If the similarity corresponding to the aspect ratio of the target vehicle is a preset similarity and the difference is not greater than the preset difference, the target vehicle size in the vehicle database is replaced according to the estimated vehicle size.
[0164] If the similarity corresponding to the aspect ratio of the target vehicle is a preset similarity and the difference is greater than the preset difference, the estimated vehicle size is added to the directory of the aspect ratio of the target vehicle in the vehicle database.
[0165] The present invention also provides a vehicle, such as Figure 3 As shown, the system includes a forward-looking camera 31, a millimeter-wave radar 32, and a processor 33. The processor 33 can execute a vehicle ranging method, which includes: acquiring forward-looking images of a first time period to determine basic information of the main target vehicle, including vehicle category information, detection frame aspect ratio, and detection frame pixel size; querying the target vehicle size of the main target vehicle in a preset vehicle database based on the vehicle category information and the detection frame aspect ratio; determining a first target distance of the main target vehicle based on the camera's intrinsic parameters, the detection frame pixel size, and the target vehicle size; acquiring radar information of the main target vehicle during the first time period to determine a second target distance of the main target vehicle; and fusing the first target distance and the second target distance to obtain a final target distance relative to the main target vehicle.
[0166] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4As shown, the electronic device may include a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute a vehicle ranging method, which includes: acquiring a front view image of a first time period to determine basic information of the main target vehicle, including vehicle category information, detection frame aspect ratio, and detection frame pixel size; querying the target vehicle size of the main target vehicle in a preset vehicle database based on the vehicle category information of the main target vehicle and the detection frame aspect ratio; determining a first target distance of the main target vehicle based on the camera's intrinsic parameters, the detection frame pixel size, and the target vehicle size; acquiring radar information of the main target vehicle in the first time period to determine a second target distance of the main target vehicle; and fusing the first target distance and the second target distance to obtain a final target distance relative to the main target vehicle.
[0167] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0168] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is able to execute the vehicle ranging method provided by the above methods, the method comprising: acquiring a front view image of a first time period, determining basic information of a primary target vehicle, the basic information including vehicle category information, detection frame aspect ratio, and detection frame pixel size; querying a target vehicle size of the primary target vehicle in a preset vehicle database based on the vehicle category information of the primary target vehicle and the detection frame aspect ratio; determining a first target distance of the primary target vehicle based on the camera's intrinsic parameters, the detection frame pixel size, and the target vehicle size; acquiring radar information of the primary target vehicle in the first time period, determining a second target distance of the primary target vehicle; and fusing the first target distance and the second target distance to obtain a final target distance relative to the primary target vehicle.
[0169] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the vehicle ranging methods provided above. The method includes: acquiring a front-view image of a first time period; determining basic information of a primary target vehicle, the basic information including vehicle category information, a detection frame aspect ratio, and a detection frame pixel size; querying a preset vehicle database for the target vehicle size based on the vehicle category information and the detection frame aspect ratio of the primary target vehicle; determining a first target distance of the primary target vehicle based on the camera's intrinsic parameters, the detection frame pixel size, and the target vehicle size; acquiring radar information of the primary target vehicle during the first time period; determining a second target distance of the primary target vehicle; and fusing the first target distance and the second target distance to obtain a final target distance relative to the primary target vehicle.
[0170] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0171] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0172] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A vehicle ranging method, characterized in that, include: The front view image of the first time period is acquired to determine the basic information of the main target vehicle. The basic information includes vehicle category information, detection box aspect ratio and detection box pixel size. Based on the vehicle category information of the main target vehicle and the aspect ratio of the detection frame, the target vehicle size of the main target vehicle is queried in the preset vehicle database; The first target distance of the main target vehicle is determined based on the camera's intrinsic parameters, the pixel size of the detection frame, and the size of the target vehicle. Collect radar information of the primary target vehicle during the first time period to determine the second target distance of the primary target vehicle; The final target distance relative to the main target vehicle is obtained by fusing the first target distance and the second target distance. The method further includes: The estimated vehicle size of the main target vehicle is calculated based on the final target distance, the camera's intrinsic parameters, and the detection frame pixel size. Calculate the difference between the target vehicle size and the estimated vehicle size; The vehicle database is updated based on the target vehicle's aspect ratio, the similarity corresponding to that aspect ratio, the estimated vehicle size, and the difference. The aspect ratio of the target vehicle is the aspect ratio of the vehicle to be selected in the target vehicle category information directory that has the highest similarity to the aspect ratio of the detection box of the main target vehicle. The target vehicle category information directory is the target vehicle category information directory in the vehicle database that corresponds to the target vehicle category information that is consistent with the vehicle category information of the main target vehicle.
2. The vehicle ranging method according to claim 1, characterized in that, The target vehicle of the main target vehicle has multiple dimensions; The method further includes: Based on the camera's intrinsic parameters, the pixel size of the detection frame, and the size of the target vehicle, determine the first target distance to be determined for the main target vehicle corresponding to each of the target vehicle sizes; Based on the second target distance, a first target distance is determined from among a plurality of first target distances to be determined.
3. The vehicle ranging method according to claim 1, characterized in that, The step of collecting radar information of the primary target vehicle during the first time period and determining the second target distance of the primary target vehicle includes: Collect radar information of at least one radar target during the first time period; Based on the radar information, determine the direction and range information of the radar target; Based on the direction information, the primary target vehicle is identified among at least one of the radar targets; The distance to the second target is determined based on the distance information corresponding to the primary target vehicle.
4. The vehicle ranging method according to claim 1, characterized in that, The acquisition of the first time period's frontal view image to determine the basic information of the main target vehicle includes: The front view image is input into a deep learning model for object detection and lane line detection to obtain vehicle category information, detection box aspect ratio, detection box pixel size and vehicle pixel coordinates, as well as the lane line pixel coordinates of the current lane. Based on the vehicle pixel coordinates and the lane line pixel coordinates, the vehicle located in the current lane with the largest detection box pixel size is identified as the main target vehicle. The vehicle category information, the aspect ratio of the detection box, and the pixel size of the detection box of the main target vehicle are determined as the basic information of the main target vehicle.
5. The vehicle ranging method according to claim 1, characterized in that, The preset vehicle database is obtained in the following way: Obtain vehicle category information and create a corresponding vehicle category information directory; Based on the vehicle category information, determine the corresponding vehicle width-to-height ratio, and create a vehicle width-to-height ratio directory under the corresponding vehicle category information directory; Obtain at least one vehicle dimension corresponding to the vehicle aspect ratio and add it to the corresponding vehicle aspect ratio directory; A vehicle database is generated based on the vehicle category information directory, the vehicle aspect ratio directory, and the vehicle dimensions.
6. The vehicle ranging method according to claim 5, characterized in that, The step of querying the target vehicle size of the main target vehicle in a preset vehicle database based on the vehicle category information of the main target vehicle and the aspect ratio of the detection frame includes: In the vehicle database, search for target vehicle category information and the corresponding target vehicle category information directory that match the vehicle category information of the main target vehicle; Obtain the aspect ratio of at least one vehicle to be selected from the target vehicle category information directory; Calculate the similarity between the aspect ratio of the vehicle to be selected and the aspect ratio of the detection frame of the main target vehicle; The aspect ratio of the candidate vehicle with the highest similarity is determined as the aspect ratio of the target vehicle. The target vehicle size of the main target vehicle is determined by identifying at least one vehicle size under the target vehicle aspect ratio directory corresponding to the target vehicle aspect ratio.
7. The vehicle ranging method according to claim 1, characterized in that, The step of updating the vehicle database based on the target vehicle's aspect ratio, the similarity corresponding to the target vehicle's aspect ratio, the estimated vehicle size, and the difference includes: If the similarity corresponding to the aspect ratio of the target vehicle is not the preset similarity, the aspect ratio of the detection box of the main target vehicle is added as the new vehicle aspect ratio in the target vehicle category information directory of the vehicle database, and the estimated vehicle size is added in the new vehicle aspect ratio directory. If the similarity corresponding to the aspect ratio of the target vehicle is a preset similarity and the difference is not greater than the preset difference, the target vehicle size in the vehicle database is replaced according to the estimated vehicle size. If the similarity corresponding to the aspect ratio of the target vehicle is a preset similarity and the difference is greater than the preset difference, the estimated vehicle size is added to the directory of the aspect ratio of the target vehicle in the vehicle database.
8. A vehicle ranging device, characterized in that, include: The image ranging unit is used to acquire the front view image of the first time period and determine the basic information of the main target vehicle. The basic information includes vehicle category information, detection box aspect ratio and detection box pixel size. Based on the vehicle category information of the main target vehicle and the aspect ratio of the detection frame, the target vehicle size of the main target vehicle is queried in the preset vehicle database; based on the camera's intrinsic parameters, the pixel size of the detection frame, and the target vehicle size, the first target distance of the main target vehicle is determined; A radar ranging unit is used to collect radar information of the main target vehicle during the first time period and determine the second target distance of the main target vehicle. A fusion unit is used to fuse the first target distance and the second target distance to obtain the final target distance relative to the main target vehicle; The device further includes an updating unit for: The estimated vehicle size of the main target vehicle is calculated based on the final target distance, the camera's intrinsic parameters, and the detection frame pixel size. Calculate the difference between the target vehicle size and the estimated vehicle size; The vehicle database is updated based on the target vehicle's aspect ratio, the similarity corresponding to that aspect ratio, the estimated vehicle size, and the difference. The aspect ratio of the target vehicle is the aspect ratio of the vehicle to be selected in the target vehicle category information directory that has the highest similarity to the aspect ratio of the detection box of the main target vehicle. The target vehicle category information directory is the target vehicle category information directory in the vehicle database that corresponds to the target vehicle category information that is consistent with the vehicle category information of the main target vehicle.
9. A vehicle, characterized in that, It includes a forward-facing camera, a millimeter-wave radar, and a processor, the processor being used to implement the steps of the vehicle ranging method as described in any one of claims 1 to 7.