Vehicle distance detection method and device and vehicle

By using the detection frame information and perspective geometry principles in the image in vehicle distance detection, combined with multiple ranging algorithms, the problem of inaccurate distance estimation and inability to estimate distance under low light conditions in the prior art is solved, and vehicle distance detection with high accuracy and low computational complexity is achieved.

CN120214770APending Publication Date: 2025-06-27ZHEJIANG LEAPMOTOR TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510338719.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the prior art, distance estimation of the target vehicle through visual information has problems such as large amount of data, large amount of calculation, inaccurate estimation, and inability to estimate distance in a dull or low-light scenario.

Method used

The image-based vehicle distance detection method is adopted, by obtaining the overall detection frame information and/or local detection frame information of the target vehicle, combined with the camera's perspective geometry principle and multiple ranging algorithms, the distance between the obtained bicycle and the target vehicle is calculated.

Benefits of technology

It realizes that high accuracy vehicle distance detection is achieved without relying on a large amount of training data and high computing capabilities, and can still effectively estimate the distance in dull or low-light scenarios, avoiding missed detection of the target vehicle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120214770A_ABST
    Figure CN120214770A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle distance detection method and device and a vehicle, and the method comprises the steps: obtaining an image, the image comprises first detection frame information, and the first detection frame information corresponds to the first position of a target vehicle and / or the image comprises the overall detection frame information of the target vehicle; and determining a first distance between the vehicle and the target vehicle based on the image. According to the method, missing detection of the target vehicle is avoided, the problem of large vehicle distance estimation error caused by incomplete information of the whole detection frame can be avoided, and the accuracy of the vehicle distance estimation result is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of vehicle safety, and particularly to a vehicle distance detection method, device, and vehicle. Background Art

[0002] Distance estimation of surrounding vehicles relative to the host vehicle is very important in intelligent driving. Given the distance between the surrounding vehicles and the host vehicle, more information such as time information or the speed of the target vehicle can be used to control the next action of the vehicle, thereby improving the ability of the vehicle to drive safely.

[0003] Currently, methods for estimating the distance of a target through visual information have problems such as a large amount of training data required, large computational complexity, inaccurate estimated distance, and inability to estimate the distance in a scene without light or low light. Therefore, there is an urgent need for a vehicle distance detection method that does not overly rely on training data, has a small computational amount, high estimation accuracy, and does not miss detections. Summary of the Invention

[0004] This application provides a vehicle distance detection method, device, and vehicle, aiming to effectively solve the above technical problems.

[0005] According to a first aspect of this application, this application provides a vehicle distance detection method, which includes:

[0006] Obtain an image, where the image includes first detection frame information corresponding to the first position of the target vehicle and / or the image includes overall detection frame information of the target vehicle;

[0007] Based on the image, determine a first distance between the host vehicle and the target vehicle.

[0008] In some possible implementation manners, there are multiple pieces of first detection frame information;

[0009] Based on the image, determining the first distance between the host vehicle and the target vehicle includes:

[0010] Based on the perspective geometric principle of the camera and according to multiple pieces of first detection frame information, calculate multiple second distances;

[0011] Determine the first distance based on the multiple second distances.

[0012] In some possible implementation manners, the first detection frame information includes license plate detection frame information;

[0013] Based on the image, determining the first distance between the host vehicle and the target vehicle includes:

[0014] When the overall detection frame in the overall detection frame information is truncated, calculate the first distance based on the perspective geometric principle of the camera and using the license plate detection frame information.

[0015] In some possible embodiments, before calculating the first distance based on the perspective geometry principle and using the license plate detection frame information, the method further includes:

[0016] Calculating a third distance based on the perspective geometry principle and using the overall detection frame information;

[0017] When the third distance is less than a preset threshold, determining that the overall detection frame is truncated.

[0018] In some possible embodiments, the first detection frame information includes headlight detection frame information.

[0019] In some possible embodiments, determining a first distance between the host vehicle and the target vehicle based on an image includes:

[0020] When the target vehicle is behind the host vehicle, determining the first distance based on the perspective geometry principle of the camera and according to the headlight detection frame information.

[0021] In some possible embodiments, determining a first distance between the host vehicle and the target vehicle based on an image includes:

[0022] Based on the perspective geometry principle of the camera, and using multiple ranging algorithms to calculate the first detection frame information and / or the overall detection frame information to obtain multiple initial distance estimates;

[0023] Performing data analysis on the multiple initial distance estimates to determine the first distance.

[0024] In some possible embodiments, the first detection frame information and / or the overall detection frame information includes pixel width, and the multiple ranging algorithms include a first ranging algorithm;

[0025] Determining an initial distance estimate using the first ranging algorithm includes:

[0026] Obtaining a physical width corresponding to the pixel width, and based on the perspective geometry principle, determining a first initial distance estimate according to the physical width, the pixel width, and the camera internal parameters.

[0027] In some possible embodiments, the first detection frame information and / or the overall detection frame information includes pixel height and target type, and the multiple ranging algorithms include a second ranging algorithm;

[0028] Determining an initial distance estimate using the second ranging algorithm includes:

[0029] According to the first initial distance estimate and the pixel height, and using the principle of similar triangles to determine a first physical height;

[0030] Compare the first physical height and the second physical height, and determine the final physical height from the first physical height and the second physical height according to the comparison result, where the second physical height is determined based on the target type;

[0031] Based on the perspective geometry principle, determine the second initial distance estimate according to the final physical height, the pixel height, and the camera internal parameters.

[0032] In some possible implementation manners, the multiple ranging algorithms include a third ranging algorithm;

[0033] Using the third ranging algorithm to determine the initial distance estimate includes:

[0034] Determine the grounding point in the overall detection frame according to the overall detection frame information;

[0035] Based on the perspective geometry principle, determine the third initial distance estimate according to the camera mounting height, the camera internal parameters, and the grounding point.

[0036] In some possible implementation manners, the first detection frame information and / or the overall detection frame information includes the detection frame size and the detection frame position;

[0037] After acquiring the image, the method further includes:

[0038] Perform smoothing filtering on the detection frame size and the detection frame position of the current frame image according to the detection frame information of the historical frame image to obtain the filtered detection frame size and the filtered detection frame position.

[0039] In some possible implementation manners, after determining the first distance between the host vehicle and the target vehicle based on the image, the method further includes:

[0040] Perform balanced filtering on the first distance of the current frame image according to the first distance of the historical frame image to obtain the filtered first distance of the current frame image.

[0041] According to the second aspect of the present application, the present application further provides a vehicle distance detection device, where the device includes:

[0042] An information acquisition module, configured to acquire an image, where the image includes first detection frame information corresponding to the first position of the target vehicle and / or the image includes the overall detection frame information of the target vehicle;

[0043] A vehicle distance determination module, configured to determine the first distance between the host vehicle and the target vehicle based on the image.

[0044] In the present application, the module implementation can also be in other ways without limitation. For example, the information acquisition module and the vehicle distance determination module can also be integrated into a processing module, or split into more modules, or adopt other module layout manners.

[0045] According to the third aspect of the present application, the present application further provides a vehicle, including:

[0046] a processor;

[0047] a memory for storing instructions executable by the processor;

[0048] wherein the processor is configured to execute the executable instructions to implement the steps of the above method.

[0049] According to the fourth aspect of the present application, the present application further provides a computer-readable storage medium, including computer instructions, which when running on a device, cause the device to execute the method in any one of the above aspects and any possible design.

[0050] According to the fifth aspect of the present application, the present application further provides a computer program product, which when running on a device, causes the device to execute the method in any one of the above aspects and any possible design.

[0051] Through one or more embodiments of the above embodiments in the present application, at least the following technical effects can be achieved: The vehicle distance detection method, device and vehicle provided by the present application utilize the first detection frame information or the overall detection frame information in the image to calculate and obtain the first distance between the host vehicle and the target vehicle. Among them, the first detection frame information may be the detection frame information corresponding to the first position of the target vehicle, such as the license plate position, headlight position, rearview mirror position, etc. of the target vehicle. When the complete overall detection frame information of the target vehicle cannot be detected from the image, the first distance can be calculated through the first detection frame information, thereby avoiding the missed detection of the target vehicle. In addition, through the first detection frame information, or by comprehensively using the first detection frame information and the overall detection frame information, the problem of large vehicle distance estimation error caused by incomplete overall detection frame information can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The following will, by describing in detail the specific embodiments of the present application in conjunction with the drawings, make the technical solutions and other beneficial effects of the present application obvious.

[0053] Figure 1 FIG. 1 is one of the flowcharts of a vehicle distance detection method provided by an embodiment of the present application;

[0054] Figure 2 FIG. 2 is another flowchart of a vehicle distance detection method provided by an embodiment of the present application;

[0055] Figure 3 FIG. 3 is one of the schematic diagrams of the detection frame provided by an embodiment of the present application;

[0056] Figure 4Schematic diagram two of the detection frame provided by the embodiment of the present application;

[0057] Figure 5 Schematic diagram of the structure of a vehicle distance detection device provided by the embodiment of the present application. Specific embodiments

[0058] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.

[0059] In the description of the present application, it should be noted that unless otherwise clearly specified and limited, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the front and rear associated objects without special instructions.

[0060] Currently, all methods for distance estimation through visual information have certain disadvantages. Specifically, the method based on a convolutional neural network uses a distance neural network to estimate the target distance. This method requires a large amount of labeled data to train the neural network. The quantity and quality of the labeled data have an important impact on the output results of the network. At the same time, this method has high requirements for the computing power of the device, and in terms of current technology, the interpretability of the network is not perfect; the method based on binocular vision also has problems such as a large amount of calculation, difficult pixel point matching, and relatively strict requirements for the parameters of the two cameras; the method based on data regression modeling also needs to collect samples with actual distance annotations; the method based on the detection of the entire vehicle frame will, due to the camera's FOV (Field of View), cause the vehicle detection frame given by the model to only contain a part of the target vehicle and cannot correctly estimate the target distance; in a scene without light or low light, due to environmental conditions, the target detection model may not be able to detect the rear target, thus unable to estimate its distance, resulting in missed detection of the target.

[0061] To address the above problems, the present application combines the overall detection frame information of the target vehicle and / or the first detection frame information of the first position on the target vehicle for vehicle distance estimation, thereby avoiding the problem of missed detection, improving the accuracy of vehicle distance estimation, and having a small amount of calculation for this method.

[0062] Next, the vehicle distance detection method, device, and vehicle provided by the present application will be introduced in conjunction with the accompanying drawings.

[0063] Figure 1 FIG. 1 is one of the schematic flowcharts of a vehicle distance detection method provided by an embodiment of the present application. As Figure 1 shown, a vehicle distance detection method includes the following steps:

[0064] S101, obtain an image, which includes the detection result of a target vehicle. The detection result includes first detection frame information and / or overall detection frame information. Among them, the first detection frame information corresponds to the first position of the target vehicle. The first position can be the positions of different components of the target vehicle, such as the license plate position, headlight position, wheel position, rearview mirror position, etc. Correspondingly, the first detection frame information includes license plate detection frame information, headlight detection frame information, wheel detection frame information, rearview mirror detection frame information, etc.

[0065] In this step, the in-vehicle camera is used to obtain the image to be detected around the host vehicle. Specifically, it can be the images to be detected in front of, behind, on both sides, etc. of the host vehicle. The target detection algorithm is used to detect the image to be detected, so as to obtain the detection result of the target vehicle. The detection result includes the first detection frame information and / or the overall detection frame information of the target vehicle and the type information of the object corresponding to the detection frame. Specifically, the training image and the corresponding label information are obtained in advance. When the label information is the label information corresponding to the overall detection frame, it includes the type of the vehicle (such as a small car, a large car, a truck, etc.) and the position of the overall detection frame in the training image, etc.; if the label information is the label information of the license plate position, it includes the type of the license plate (such as an ordinary vehicle license plate, a special vehicle license plate, etc.) and the position of the license plate detection frame in the training image, etc.; if the label information is the label information of the headlight position, it includes the type of the headlight (such as a front headlight, a rear headlight, a side headlight, etc.) and the position of the headlight detection frame in the training image, etc. Based on the training image and the label information, a target detection model or multiple target detection sub-models are trained. The target detection model can perform target detection on different positions of the vehicle and output the overall detection frame information and the first detection frame information at the same time. The multiple target detection sub-models are respectively used to detect the overall vehicle, license plate, headlight, rearview mirror, wheel, etc., and independently output the corresponding detection results. The specific acquisition process of the overall detection frame information and the first detection frame information in the present application will not be elaborated too much.

[0066] It should be understood that the overall detection frame may be missing or truncated due to problems such as light, the target vehicle exceeding the field of view of the in-vehicle camera, or the target vehicle being blocked. At this time, the overall detection frame information is unavailable or has a large error. However, the first detection frames are all detection frames of local positions on the target vehicle, and the possibility of the first detection frames being truncated or missing is small. Therefore, it can avoid the problem of missing detection of the target vehicle or a large estimated vehicle distance. Or, when the overall detection frame is complete, there is no need to use the gas target detection sub-model for target detection.

[0067] S102. Based on the image, determine the first distance between the host vehicle and the target vehicle.

[0068] In this step, the first distance between the host vehicle and the target vehicle is calculated using the first detection frame information and / or the overall detection frame information and through the perspective geometric principle of the camera. Specifically, if the overall detection frame information is not detected, the first distance is calculated through the width or height information in the first detection frame information; if there is only the overall detection frame information, the first distance can also be calculated through the width or height information in the overall detection frame information; if both the overall detection frame information and the first detection frame information are available, two first distances are calculated using the overall detection frame information and the first detection frame information respectively, and the final first distance is calculated by synthesizing the two first distances.

[0069] It should be understandable that there can be multiple pieces of first detection frame information, and a first distance can be calculated using each piece of first detection frame information. Data analysis can be performed on multiple first distances to determine a more accurate final first distance.

[0070] The vehicle distance detection method provided by the embodiments of the present application is based on the first detection frame information and / or the overall detection frame information of the target vehicle, and calculates the first distance between the host vehicle and the target vehicle using the perspective geometric principle of the camera. Among them, the first detection frame information can be the detection frame information corresponding to the first position of the target vehicle, such as the license plate position, headlight position, rearview mirror position, etc. of the target vehicle. When the complete overall detection frame information of the target vehicle cannot be detected from the image, the first distance can be calculated through the first detection frame information, thus avoiding missing detection of the target vehicle. In addition, through the first detection frame information, or by comprehensively using the first detection frame information and the overall detection frame information, the problem of large estimated vehicle distance error caused by incomplete overall detection frame information is avoided. In addition, the perspective geometric principle of the camera is also used to estimate the first distance between the host vehicle and the target vehicle, and the calculation amount is smaller. In addition, at least one camera for acquiring the image is required. Compared with the vehicle distance estimation method of a binocular camera, the hardware cost is lower, and there is no need for restrictions on the baseline distance or camera alignment, and it has higher flexibility.

[0071] In some embodiments of the present application, there are multiple pieces of first detection frame information;

[0072] Based on an image, determining a first distance between the host vehicle and a target vehicle includes:

[0073] Based on the perspective geometric principle of a camera and according to multiple pieces of first detection frame information, calculating multiple second distances.

[0074] Determining the first distance based on the multiple second distances.

[0075] That is to say, the first detection frame may include detection frames at multiple first positions, such as a license plate detection frame, a vehicle lamp detection frame, a wheel detection frame, and so on. Calculating a second distance using each piece of first detection frame information, and determining the final first distance through data analysis of the multiple second distances. Specifically, the average value of the multiple second distances may be used as the final first distance. It may also be that after obtaining the average value of the second distances, analyzing whether each second distance deviates too much from the average value. If the deviation reaches a certain threshold, the corresponding second distance is excluded as an outlier, and the average value of the remaining second distances is obtained and used as the final first distance. It is also possible to perform a weighted sum of the multiple second distances to obtain the final first distance. Or determining and excluding outliers among the multiple second distances through other data outlier analysis methods, and calculating the final first distance based on the normal second distances, which is not limited herein.

[0076] It should be understood that when obtaining the overall detection frame information, a second distance can also be calculated using the overall detection frame information, and performing the above-mentioned data analysis on the second distance corresponding to the overall detection frame information and the second distances corresponding to the first detection frame information together to obtain the final first distance.

[0077] The vehicle distance detection method provided by the embodiments of the present application calculates multiple second distances using multiple pieces of first detection frame information, and determines the final first distance according to the multiple second distances, thereby improving the accuracy of vehicle distance estimation.

[0078] In some embodiments of the present application, the first detection frame information includes license plate detection frame information;

[0079] Based on an image, determining a first distance between the host vehicle and a target vehicle includes:

[0080] When the overall detection frame in the overall detection frame information is truncated, based on the perspective geometric principle of a camera and using the license plate detection frame information, calculating the first distance.

[0081] Specifically, in the case where there is both overall detection box information and license plate detection box information, first determine whether the overall detection box is truncated. If the overall detection box is truncated, calculate the first distance using the license plate detection box information. If the overall detection box is not truncated, the first distance can be calculated only using the overall detection box information, or the first distance can be calculated using the overall detection box information and the license plate detection box information. It should be understood that the truncation of the overall detection box may be due to the limited field of view of the vehicle-mounted camera or the fact that the self-vehicle is too close to the target vehicle, resulting in the overall detection box of the identified target vehicle only containing a part of the target vehicle. Estimating the vehicle distance based on the truncated overall detection box information is likely to result in a large error in the vehicle distance estimation result.

[0082] In the vehicle distance detection method provided by the embodiments of the present application, when the overall detection box is truncated, the license plate detection box information is used to calculate the first distance, thereby improving the accuracy of the first distance.

[0083] In some embodiments of the present application, before calculating the first distance based on the perspective geometry principle and using the license plate detection box information, the method further includes:

[0084] Calculating a third distance based on the perspective geometry principle and using the overall detection box information;

[0085] When the third distance is less than a preset threshold, it is determined that the overall detection box is truncated.

[0086] Specifically, if the distance between the target vehicle and the self-vehicle is less than the preset threshold, it is determined that there is a possibility that the overall detection box is truncated. At this time, in order to improve the accuracy of the first distance, it is necessary to calculate the first distance based on the license plate detection box information. When the distance between the target vehicle and the self-vehicle is greater than or equal to the preset threshold, the overall detection box can contain the entire target vehicle, the position of the overall detection box is more accurate, and the information such as the width and height provided by the overall detection box information is more accurate and diverse. Based on the overall detection box information, a relatively accurate first distance can be obtained. Therefore, at this time, the first distance can be calculated only using the overall detection box information, or the first detection box information and the overall detection box information can be comprehensively used to calculate the first distance. In one case, when the distance between the target vehicle and the self-vehicle is greater than or equal to the preset threshold, the third distance is calculated in real time using the overall detection box information, and this third distance is also the distance between the self-vehicle and the target vehicle. When the calculated third distance is less than the preset threshold, it is determined that the self-vehicle and the target vehicle are relatively close, and then the license plate detection box information is used for vehicle distance estimation.

[0087] The vehicle distance detection method provided by the embodiments of the present application uses the overall detection frame information or a combination of the overall detection frame information and the first detection frame information to estimate the vehicle distance when the distance between the host vehicle and the target vehicle is greater than or equal to a preset threshold, thereby improving the accuracy of the first distance; when the distance between the host vehicle and the target vehicle is less than the preset threshold, it is determined that the overall detection frame is truncated, and when the overall detection frame is truncated, the license plate detection frame information in the first detection frame information is used to calculate the first distance, thereby avoiding the problem of large vehicle distance estimation errors caused by the truncation of the overall detection frame.

[0088] In some embodiments of the present application, the first detection frame information includes headlight detection frame information.

[0089] Further, determining the first distance between the host vehicle and the target vehicle based on an image includes:

[0090] When the target vehicle is behind the host vehicle, based on the perspective geometric principle of the camera and according to the headlight detection frame information, the first distance is determined.

[0091] Specifically, in the case of poor lighting conditions (such as no light, low light, etc.), the target detection algorithm is very likely to be unable to detect the overall detection frame of the target vehicle from the image, but it is possible to detect a light source such as a headlight (usually, the headlights of the target vehicle will be turned on in poor lighting conditions, such as driving in a tunnel, driving at night, etc.) to obtain the headlight detection frame information, thereby overcoming the problem that vehicle distance estimation cannot be performed due to the absence of an overall detection frame under lighting conditions.

[0092] It should be understood that the headlight detection frame information can be either the detection frame information of the front headlights or the detection frame information of the rear headlights. If the target vehicle is behind the host vehicle, the headlight detection frame information is the detection frame information of the front headlights on the target vehicle; if the target vehicle is in front of the host vehicle, the headlight detection frame information is the detection frame information of the rear headlights on the target vehicle.

[0093] The vehicle distance detection method provided by the embodiments of the present application can still use the headlight detection frame information to calculate the first distance under no light or low light conditions, thereby preventing the missed detection of the target vehicle and improving the accuracy of vehicle distance estimation.

[0094] In some embodiments of the present application, determining the first distance between the host vehicle and the target vehicle based on an image includes:

[0095] Based on the perspective geometric principle of the camera and using multiple ranging algorithms to calculate the first detection frame information and / or the overall detection frame information to obtain multiple initial distance estimates.

[0096] Performing data analysis on the multiple initial distance estimates to determine the first distance.

[0097] Specifically, the detection box information (collectively referred to as detection box information including the first detection box information and the overall detection box information) includes the width and height of the detection box (collectively referred to as the detection box including the first detection box and the overall detection box) and the corresponding type of the detection box. The initial distance estimate can be calculated respectively using the width and height. At this time, the ranging algorithm is a ranging algorithm based on width and a ranging algorithm based on height.

[0098] The ranging algorithm based on width can specifically use the internal parameters of the camera (such as the camera focal length), the pixel width of the detection box, and the physical width of the object corresponding to the detection box to calculate the initial distance estimate, where

[0099] The ranging algorithm based on height can use the internal parameters of the camera (such as the camera focal length), the pixel height of the detection box, and the physical height of the object corresponding to the detection box to calculate the initial distance estimate, where

[0100]

[0101] It should be understood that if the detection box is the overall detection box, the object in the detection box is the entire target vehicle; if the detection box is the license plate detection box, the object in the detection box is the license plate; if the detection box is the headlight detection box, the object in the detection box is the headlight; if the detection box is the wheel detection box, the object in the detection box is the wheel, and so on. The physical width, physical width and physical height can be determined according to the type of the detection box. For example, if the detection box is the overall detection box, the types include cars, SUVs, etc. Since the physical sizes of vehicles of the same type need to comply with relevant regulations and the physical sizes of target vehicles of the same type are relatively close, the physical width and physical height of the target vehicle can be determined according to the type of the vehicle. If the detection box is the license plate detection box, the physical height and width of the license plate can also be determined according to the type of the license plate detection box, and then the initial distance estimate is calculated. If the detection box is the headlight detection box, the mapping relationship between the actual physical size and the pixel size of the headlights at different positions can be statistically determined, and then the mapping relationship is used to calculate the initial distance estimate. In addition, here the headlight detection box refers to the detection box that detects two headlights on the same horizontal line, and the physical width of the corresponding headlight is the distance between the two headlights (the outermost points of each pair).

[0102] After calculating multiple initial distance estimates through multiple ranging algorithms, the first distance can be determined by averaging the multiple initial distance estimates, or the first distance can be obtained by weighted summation of the multiple initial distance estimates. Or first perform outlier screening on the multiple initial distance estimates, and calculate the first distance based on the screening results through data processing methods such as averaging or weighted summation. No specific limitation is made on this.

[0103] The vehicle distance detection method provided by the embodiment of the present application calculates the first detection frame information and / or the overall detection frame information by using multiple ranging algorithms, obtains multiple initial distance estimates, and determines the first distance by synthesizing multiple initial distance estimates, thereby further improving the accuracy of the first distance.

[0104] In some embodiments of the present application, both the first detection frame information and / or the overall detection frame information include pixel widths, and the multiple ranging algorithms include a first ranging algorithm.

[0105] Determining the initial distance estimate by using the first ranging algorithm includes:

[0106] Obtain the physical width corresponding to the pixel width, and based on the perspective geometry principle, determine the first initial distance estimate according to the physical width, pixel width, and camera internal parameters.

[0107] In this embodiment, the first initial distance estimate is calculated by using the pixel width of the detection frame, the physical width of the object in the detection frame, and the internal parameters of the camera.

[0108] In some embodiments of the present application, the first detection frame information and / or the overall detection frame information include pixel height and target type, and the multiple ranging algorithms include a second ranging algorithm.

[0109] Determining the initial distance estimate by using the second ranging algorithm includes:

[0110] According to the first initial distance estimate and the pixel height, and use the principle of similar triangles to determine the first physical height.

[0111] Compare the first physical height with the second physical height, and determine the final physical height from the first physical height and the second physical height according to the comparison result, and the second physical height is determined based on the target type.

[0112] Based on the perspective geometry principle, determine the second initial distance estimate according to the final physical height, pixel height, and camera internal parameters.

[0113] In this embodiment, after calculating the first initial distance estimate using the pixel width, physical width, and the internal parameters of the camera, the first physical height is calculated through the principle of similar triangles. Then, the first physical height is compared with the second physical height. If the error between the first physical height and the second physical height is less than the height error threshold, the first physical height is determined as the final physical height; if the error between the first physical height and the second physical height is greater than or equal to the height error threshold, the second physical height is determined as the final physical height. The second initial distance estimate is calculated based on the final physical height, pixel height, and camera internal parameters. Among them, the second physical height is determined according to the type of the detection frame. For example, if the detection frame is an overall detection frame, the second physical height of the target vehicle is determined according to the type of the target vehicle; if the detection frame is a license plate detection frame, the second physical height of the license plate is determined according to the type of the license plate; if the detection frame is a headlight detection frame, the second physical height of the headlight is determined according to the mapping relationship between the physical size and pixel size of the headlight (the mapping relationship between the two can be obtained by analyzing the data of the pixel size and physical size of the collected headlight).

[0114] The vehicle distance detection method provided by the embodiments of the present application determines the first physical height according to the first initial distance estimate and the pixel height, and uses the principle of similar triangles; determines the final physical height according to the comparison result between the first physical height and the second physical height, and calculates the second initial distance estimate based on the final physical height, pixel height, and camera internal parameters; among them, the second physical height is determined according to the type of the detection frame. The accuracy of calculating the second initial distance estimate is improved by the first physical height and the second physical height, and the pixel width of the detection frame is also fully utilized.

[0115] In some embodiments of the present application, the multiple ranging algorithms include a third ranging algorithm;

[0116] Using the third ranging algorithm to determine the initial distance estimate includes:

[0117] Determine the grounding point in the overall detection frame according to the overall detection frame information. Among them, when the overall detection frame is not truncated, the midpoint of the lower side of the overall detection frame is the grounding point.

[0118] Based on the perspective geometry principle, according to the camera installation height, camera internal parameters (i.e., camera focal length), and the grounding point, determine the third initial distance estimate, that is, It should be noted that it is less likely that the center point of the bottom edge of the first detection frame such as the license plate detection frame and the headlight detection frame is the grounding point. Therefore, when the overall detection frame is not truncated, the third initial distance estimate is calculated using the third ranging algorithm.

[0119] The vehicle distance detection method provided by the embodiments of the present application calculates a third initial distance estimate value by using the grounding point in the overall detection frame, fully utilizes the overall detection frame information, enriches the acquisition method of the initial distance estimate value, and improves the accuracy of the final first distance.

[0120] In some embodiments of the present application, the first detection frame information and / or the overall detection frame information includes the detection frame size and the detection frame position.

[0121] After acquiring the image, the method further includes:

[0122] Performing smoothing filtering on the detection frame size and the detection frame position of the current frame image according to the detection frame information of the historical frame image to obtain the filtered detection frame size and the filtered detection frame position.

[0123] That is, after performing object detection on the current frame image by using the object detection algorithm, performing state estimation on the detection frame information of the historical frame image by using a smoothing filtering algorithm (such as the Kalman filtering algorithm, the extended Kalman filtering algorithm, the unscented Kalman filtering algorithm, the moving average filtering algorithm, etc.), and reducing the jitter and noise of the detection frame of the current frame image based on the estimation result to improve the accuracy of the detection frame of the current frame image, thereby improving the accuracy of the vehicle distance estimation.

[0124] In some embodiments of the present application, after determining the first distance between the host vehicle and the target vehicle based on the image, the method further includes:

[0125] Performing balanced filtering on the first distance of the current frame image according to the first distance of the historical frame image to obtain the filtered first distance of the current frame image.

[0126] That is, after calculating the first distance of the current frame image, estimating the first distance of the historical frame image by using a smoothing filtering algorithm, and filtering the first distance of the current frame image based on the estimated distance to further improve the accuracy of the final first distance.

[0127] As Figure 2 shown, the embodiments of the present application further provide a vehicle distance detection method, and the vehicle distance detection method includes the following steps:

[0128] S201, performing object detection on the image to be detected by using the object detection algorithm to obtain an object detection result, and then entering step S202. Wherein, the object detection result includes the overall detection frame information and / or the first detection frame information, and the overall detection frame is the detection frame shown by arrow 1 in Figure 3 The first detection frame information may be license plate detection frame information (the license plate detection frame is the detection frame shown by arrow 2 in Figure 3 ), headlight detection frame information (the license plate detection frame is the detection frame shown by arrow 2 inFigure 4 The detection frame information of the first position of the target vehicle, such as the overall detection frame information and the wheel detection frame information shown in the figure. It should be understood that both the overall detection frame information and the first detection frame information include information such as the position, size, and category of the detection frame.

[0129] S202, based on the target detection results of the historical frame images, and using the Kalman filtering algorithm to perform smooth filtering on the detection frame position and size in the target detection results of the current frame image to obtain the filtered target detection results, and then enter steps S203, S206, and S215 respectively.

[0130] S203, obtain the license plate detection frame information in the filtered target detection results, and enter step S204 when the distance between the host vehicle and the target vehicle is less than a preset threshold. It should be noted that when the distance between the host vehicle and the target vehicle is less than the preset threshold, there is a possibility that the overall detection frame corresponding to the target vehicle is truncated. At this time, the overall detection frame cannot provide the accurate pixel size of the target vehicle, and thus the distance between the host vehicle and the target vehicle cannot be accurately calculated. Therefore, the license plate detection frame information can be used for vehicle distance estimation. In addition, the preset threshold here can be 10m, 5m, etc., which is set according to the actual situation and is not set here. When the distance between the vehicles is greater than or equal to the preset threshold, the vehicle distance can be estimated only using the overall detection frame information, or the license plate detection frame information and the overall detection frame information can be comprehensively used for vehicle distance estimation, which is not limited here. In one embodiment, the vehicle distance is first estimated based on the overall detection frame information, and it is determined in real time whether the distance between the host vehicle and the target vehicle is less than the preset threshold based on the estimation result.

[0131] S204, determine the physical width of the license plate according to the type of the license plate in the vehicle detection frame information, and then enter step S205.

[0132] S205, according to the perspective geometric principle of the camera, use the physical width of the license plate, the camera internal parameters, and the pixel width of the license plate to calculate the distance D4 between the host vehicle and the target vehicle, and then enter step S218.

[0133] S206, obtain the overall detection frame information in the filtered target detection results, and then enter steps S207, S209, and S212 respectively.

[0134] S207, determine the physical width of the target vehicle according to the type of the target vehicle in the overall detection frame information, and then enter step S208.

[0135] S208, according to the pixel width of the overall detection frame, the physical width of the target vehicle, and the camera internal parameters, and using the perspective geometric principle of the camera to calculate the distance D1 between the host vehicle and the target vehicle, and then enter step S214.

[0136] S209, obtaining the distance D1 between the vehicle and the target vehicle and the pixel height of the entire detection frame calculated in S208, and calculating the first physical height of the target vehicle using the principle of similar triangles, and then entering step S210.

[0137] S210, determine the second physical height of the target vehicle according to the type of the overall detection frame, and compare the first physical height with the second physical height. If the difference between the first physical height and the second physical height is less than the height error threshold, the first physical height is used as the final physical height of the target vehicle. If the difference between the first physical height and the second physical height is greater than or equal to the height error threshold, the second physical height is used as the final physical height of the target vehicle, and then enter step S211.

[0138] S211, according to the physical height, pixel height and camera internal parameters of the target vehicle, and using the perspective geometry principle of the camera, calculate the distance D2 between the target vehicle and the own vehicle, and then enter step S214.

[0139] S212, obtaining the grounding point from the entire detection frame, and then proceeding to step S213.

[0140] S213, according to the camera installation height, the pixel coordinates of the grounding point, the camera internal parameters, and the ground level assumption, the distance D3 between the target vehicle and the vehicle is calculated, and then enters step S214.

[0141] S214, perform data analysis on D1 in step S208, D2 in S211, and D3 in S213 to determine whether there are outliers among D1, D2, and D3. If there are outliers, remove the outliers and perform weighted summation on the remaining distance values ​​to obtain the final distance D. If there are no outliers, perform weighted summation based on D1, D2, and D3 to obtain the final distance D, and then enter step S18.

[0142] In this step, the outliers can be determined by calculating the difference between the distance values ​​​​pairwise, and if the difference exceeds the preset distance difference threshold, the larger value in the distance value is eliminated, and the remaining distance values ​​are weighted averaged to obtain the final distance D. It should be understood that if all the differences exceed the preset distance difference threshold, the minimum value among D1, D2 and D3 is used as the final distance D.

[0143] S215, obtain the headlight detection frame information in the filtered target detection result, and when the target vehicle is located behind the own vehicle, proceed to step S216. At this time, the headlight detection frame is the detection frame of the front headlights of the target vehicle. If the target vehicle is located in front of the own vehicle, the headlight detection frame is the detection frame of the rear headlights of the target vehicle.

[0144] S216. Obtain the physical width of the vehicle headlight detection frame according to the pixel width of the vehicle headlight detection frame and the mapping relationship between the pixel width and the physical width of the vehicle headlight detection frame, and then proceed to step S217.

[0145] S217. Calculate the distance D5 between the vehicle and the host vehicle according to the physical width, pixel width of the vehicle headlight detection frame, and the camera internal parameters, and by using the perspective geometric principle of the camera, and then proceed to step S218.

[0146] S218. Conduct data analysis on D4 in step S205, D in S214, and D5 in S217 to determine whether there are outliers among D4, D, and D5. If there are outliers, propose them and then perform weighted averaging to obtain the final first distance. If there are no outliers, perform weighted averaging on D4, D, and D5 to obtain the final first distance, and then proceed to step S219.

[0147] It should be understood that the overall detection frame may not be able to finally calculate D due to problems such as missed detection or truncation, and there may only be the cases of D4 and D5. It may also be that because the vehicle headlights are not turned on and the vehicle headlight detection frame is not detected, there are only the cases of D4 and D. Or because the distance is too far and the license plate detection frame is not detected, etc. When only two of D4, D, and D5 are obtained, the comparison of the two distance values can still be carried out. If the difference between the two distance values exceeds the preset distance difference threshold, the smaller one of the two distance values is used as the final first distance. If the difference between the two distance values does not exceed the preset distance difference threshold, perform weighted averaging on the two distance values to obtain the final first distance. When only one of D4, D, and D5 is obtained, the remaining one is used as the final first distance.

[0148] S219. According to the first distance of the historical frame image, perform smoothing filtering on the first distance output by S218 by using the Kalman filtering method, and output the smoothed filtering result as the vehicle distance estimation result.

[0149] The vehicle distance detection method provided by the embodiments of the present application first performs smoothing filtering on the size and position of the detection frame in the target detection result to improve the accuracy of the detection frame information. Then, ranging estimations are respectively performed for different detection frame information, and the final first distance is determined from multiple estimation results to improve the accuracy of the first distance. Among them, the overall detection frame has the richest information, and the vehicle distance can be estimated respectively based on the pixel width, pixel height, and grounding point of the overall detection frame. By synthesizing multiple estimation results, the corresponding estimation distance is determined for the overall detection frame, further improving the accuracy of the vehicle distance estimation. In addition, when the overall detection frame is truncated, the license plate detection frame can be used for vehicle distance estimation, further avoiding the problem of large distance estimation errors caused by the truncation of the overall detection frame, improving the accuracy, and also avoiding the missed detection of the target vehicle. In addition, the headlight detection frame is also used for vehicle distance estimation, enabling the host vehicle to still perform vehicle distance estimation under poor lighting conditions and preventing the missed detection of the target vehicle in poor lighting conditions. Finally, smoothing filtering is performed on the estimation distances corresponding to different detection frames to avoid the influence of noise or jitter, further improving the accuracy of the vehicle distance estimation.

[0150] As Figure 5 shown, the embodiments of the present application further provide a vehicle distance detection device, which includes:

[0151] An information acquisition module 501, configured to acquire an image, where the image includes first detection frame information, and the first detection frame information corresponds to the first position of the target vehicle and / or the image includes the overall detection frame information of the target vehicle.

[0152] A vehicle distance determination module 502, configured to determine the first distance between the host vehicle and the target vehicle based on the image.

[0153] The vehicle distance detection device provided by the embodiments of the present application corresponds to the vehicle distance detection method provided by any of the above embodiments, and will not be elaborated herein.

[0154] Based on any of the above embodiments, another embodiment of the present application further provides a vehicle, which includes a processor and a memory for storing processor-executable instructions. The processor is configured to execute the executable instructions to implement the vehicle distance detection method of any of the above embodiments.

[0155] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0156] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, 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 for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiments.

[0157] In summary, although the present application has been disclosed above with preferred embodiments, the above preferred embodiments are not intended to limit the present application. Those of ordinary skill in the art can make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the protection scope of the present application shall be subject to the scope defined by the claims.

Claims

1. A vehicle distance detection method, characterized in that: The method comprises: Acquire an image, wherein the image includes first detection frame information, the first detection frame information corresponds to a first position of the target vehicle and / or the image includes overall detection frame information of the target vehicle; Based on the image, a first distance between the ego vehicle and the target vehicle is determined.

2. The method according to claim 1, characterized in that There are multiple pieces of first detection frame information; The determining, based on the image, a first distance between the vehicle and the target vehicle comprises: Based on the perspective geometry principle of the camera and according to the information of the first detection frames, a plurality of second distances are calculated; The first distance is determined based on a plurality of the second distances.

3. The method according to claim 1, characterized in that The first detection frame information includes license plate detection frame information; The determining, based on the image, a first distance between the vehicle and the target vehicle comprises: When the overall detection frame in the overall detection frame information is truncated, the first distance is calculated based on the perspective geometry principle of the camera and using the license plate detection frame information.

4. The method according to claim 3, characterized in that Before calculating the first distance based on the perspective geometry principle and using the license plate detection frame information, the method further includes: A third distance is calculated based on the perspective geometry principle and using the overall detection frame information; When the third distance is less than a preset threshold, it is determined that the entire detection frame is truncated.

5. The method according to claim 1, characterized in that The first detection frame information includes vehicle light detection frame information.

6. The method according to claim 5, characterized in that The determining, based on the image, a first distance between the vehicle and the target vehicle comprises: When the target vehicle is located behind the own vehicle, the first distance is determined based on the perspective geometry principle of the camera and according to the vehicle light detection frame information.

7. The method according to any one of claims 1 to 6, characterized in that The determining, based on the image, a first distance between the vehicle and the target vehicle comprises: Based on the perspective geometry principle of the camera, and using multiple distance measurement algorithms, the first detection frame information and / or the overall detection frame information are calculated to obtain multiple initial distance estimation values; A data analysis is performed on the plurality of initial distance estimates to determine the first distance.

8. The method according to claim 7, characterized in that The first detection frame information and / or the overall detection frame information includes pixel width, and the multiple distance measurement algorithms include a first distance measurement algorithm; Determine an initial distance estimate using a first distance measurement algorithm, including: A physical width corresponding to the pixel width is obtained, and based on the perspective geometry principle, a first initial distance estimation value is determined according to the physical width, the pixel width, and a camera intrinsic parameter.

9. The method according to claim 8, characterized in that The first detection frame information and / or the overall detection frame information includes pixel height and target type, and the multiple ranging algorithms include a second ranging algorithm; Determine an initial distance estimate using a second distance measurement algorithm, including: Determine a first physical height based on the first initial distance estimate and the pixel height and using a triangle similarity principle; comparing the first physical height and a second physical height, and determining a final physical height from the first physical height and the second physical height according to the comparison result, wherein the second physical height is determined based on the target type; Based on the perspective geometry principle, a second initial distance estimate is determined according to the final physical height, the pixel height, and the camera intrinsic parameter.

10. The method according to claim 7, characterized in that The plurality of ranging algorithms include a third ranging algorithm; The initial distance estimate is determined using the third distance measurement algorithm, including: Determine a grounding point in the overall detection frame according to the overall detection frame information; Based on the perspective geometry principle, a third initial distance estimate is determined according to the camera installation height, the camera internal parameters and the grounding point.

11. The method according to claim 1, characterized in that The first detection frame information and / or the overall detection frame information includes a detection frame size and a detection frame position; After acquiring the image, the method further includes: The detection frame size and the detection frame position of the current frame image are smoothed and filtered according to the detection frame information of the historical frame image to obtain the filtered detection frame size and the filtered detection frame position.

12. The method according to claim 1, characterized in that After determining the first distance between the vehicle and the target vehicle based on the image, the method further includes: A balanced filter is performed on the first distance of the current frame image according to the first distance of the historical frame image to obtain the filtered first distance of the current frame image.

13. A vehicle distance detection device, characterized in that: The device comprises: An information acquisition module, used to acquire an image, wherein the image includes first detection frame information, the first detection frame information corresponds to a first position of a target vehicle and / or the image includes overall detection frame information of the target vehicle; The vehicle distance determination module is used to determine a first distance between the vehicle and the target vehicle based on the image.

14. A vehicle, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the executable instructions to implement the steps of the method according to any one of claims 1 to 12.