CN115661028A - Distance detection method, device, equipment, storage medium and vehicle - Google Patents

Distance detection method, device, equipment, storage medium and vehicle Download PDF

Info

Publication number
CN115661028A
CN115661028A CN202211122203.9A CN202211122203A CN115661028A CN 115661028 A CN115661028 A CN 115661028A CN 202211122203 A CN202211122203 A CN 202211122203A CN 115661028 A CN115661028 A CN 115661028A
Authority
CN
China
Prior art keywords
distance
target
detection
vehicle
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211122203.9A
Other languages
Chinese (zh)
Inventor
赵庆会
张一鸣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Rockwell Technology Co Ltd
Original Assignee
Beijing Rockwell Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Rockwell Technology Co Ltd filed Critical Beijing Rockwell Technology Co Ltd
Priority to CN202211122203.9A priority Critical patent/CN115661028A/en
Publication of CN115661028A publication Critical patent/CN115661028A/en
Pending legal-status Critical Current

Links

Images

Abstract

The disclosure relates to a distance detection method, a distance detection device, a distance detection apparatus, a storage medium and a vehicle, wherein the method comprises the following steps: acquiring a target image and a target detection frame corresponding to a detection target in the target image; determining a first distance between the detection target and the vehicle through inverse perspective transformation based on the pixel coordinates of the target detection frame in the target image; determining a second distance between the detection target and the self-vehicle according to a small hole imaging principle based on the pixel height of the target detection frame in the target image; and determining the smaller value of the first distance and the second distance as the distance between the detection target and the own vehicle. The distance between the detection target and the self-vehicle is detected by two different methods, namely inverse perspective transformation ranging and small-hole imaging ranging, corresponding ranging results are obtained respectively, and a smaller value in the different ranging results is further selected as the distance between the detection target and the self-vehicle, so that the stability and the accuracy of the distance detection method are improved.

Description

Distance detection method, device, equipment, storage medium and vehicle
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a distance detection method, apparatus, device, storage medium, and vehicle.
Background
In vehicle driver assistance technology, an automatic Braking system (AEB) is a very important part. Under the mixed traffic environment, pedestrians, vehicles and the like are traffic participants, wherein the pedestrians and the pedestrians are called weak road users, and in order to ensure the safety of the pedestrians and the vehicles, the automatic braking system can brake in time when the distance between the bicycle and the pedestrians or the pedestrians is smaller than the safe distance, and the safe trip is ensured.
In order to ensure the effect of the automatic braking system, the accuracy of measuring the distance between the vehicle and the pedestrian or the rider is very important. At present, various distance measurement methods can be used for detecting the distance, but due to the error of a distance measurement system or the influence of the environment, the stability of the distance measurement result obtained by various methods cannot be guaranteed, so that the effect of an automatic braking system is influenced, and potential safety hazards are brought.
Disclosure of Invention
In order to solve the technical problem, the disclosure provides a distance detection method, a distance detection device, distance detection equipment, a storage medium and a vehicle, so that the stability and accuracy of distance detection are improved, and driving safety is guaranteed.
In a first aspect, an embodiment of the present disclosure provides a distance detection method, including:
acquiring a target image and a target detection frame corresponding to a detection target in the target image;
determining a first distance between the detection target and the own vehicle through inverse perspective transformation based on the pixel coordinates of the target detection frame in the target image;
determining a second distance between the detection target and the self-vehicle according to a small hole imaging principle based on the pixel height of the target detection frame in the target image;
and determining the smaller value of the first distance and the second distance as the distance between the detection target and the own vehicle.
In some embodiments, determining a first distance of the detection target from the host vehicle through an inverse perspective transformation based on pixel coordinates of the target detection frame in a target image includes:
determining an inverse perspective transformation matrix of the target detection frame based on camera calibration parameters;
according to the inverse perspective transformation matrix, performing inverse perspective transformation on pixel coordinates of the target detection frame in a target image to obtain the position of the detection target in a vehicle coordinate system;
and determining a first distance between the detection target and the vehicle according to the position of the detection target in a vehicle coordinate system.
In some embodiments, before determining the second distance of the detection target from the host vehicle according to a pinhole imaging principle based on a pixel height of the target detection frame in the target image, the method further comprises:
acquiring the real height of the detection target;
and if the real height of the detection target is smaller than a second preset threshold, determining that the real height of the detection target is the second preset threshold.
In some embodiments, determining a second distance of the detection target from the self-vehicle according to a pinhole imaging principle based on a pixel height of the target detection frame in a target image comprises:
calculating the ratio of the product of the focal length of the camera and the real height of the detected target to the pixel height, and determining the distance from the detected target to the camera;
and determining a second distance between the detection target and the vehicle based on the distance between the detection target and the camera and the calibration parameters of the camera.
In some embodiments, after determining that the smaller of the first distance and the second distance is the distance from the detection target to the host vehicle, the method further includes:
obtaining the historical distance between the vehicle and the detection target according to the previous frame of image of the target image, and determining the difference between the distance between the detection target and the vehicle and the historical distance;
taking the product of the difference between the distance from the detected target to the self-vehicle and the historical distance and a preset distance compensation coefficient as a distance compensation value;
and compensating the distance between the detection target and the self-vehicle according to the motion state of the self-vehicle and the distance compensation value to obtain the compensated distance between the detection target and the self-vehicle.
In some embodiments, compensating the distance of the detection target from the host vehicle according to the motion state of the host vehicle and the distance compensation value includes:
if the motion state of the self-vehicle is an acceleration state, the compensated distance between the detection target and the self-vehicle is the difference between the distance between the detection target and the self-vehicle and the distance compensation value;
and if the motion state of the self-vehicle is a deceleration state, the compensated distance between the detection target and the self-vehicle is the sum of the distance between the detection target and the self-vehicle and the distance compensation value.
In a second aspect, an embodiment of the present disclosure provides a distance detecting apparatus, including:
the acquisition module is used for acquiring a target image and a target detection frame corresponding to a detection target in the target image;
the first distance measurement module is used for determining a first distance between the detection target and the self-vehicle through inverse perspective transformation based on the pixel coordinates of the target detection frame in the target image;
the second distance measurement module is used for determining a second distance between the detected target and the self-vehicle according to a small hole imaging principle based on the pixel height of the target detection frame in the target image;
and the determining module is used for determining the smaller value of the first distance and the second distance as the distance between the detection target and the vehicle.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the first aspect.
In a fourth aspect, the present disclosure provides a computer-readable storage medium, on which a computer program is stored, the computer program being executed by a processor to implement the method of the first aspect.
In a fifth aspect, embodiments of the present disclosure also provide a vehicle including the distance detection apparatus as described above.
According to the distance detection method, the device, the equipment, the storage medium and the vehicle, the distance of the detection target relative to the vehicle is detected through two different methods of inverse perspective transformation ranging and small-hole imaging ranging, corresponding ranging results are obtained respectively, a smaller value in the different ranging results is further selected as the distance between the detection target and the vehicle, the instability of the detection result caused by the error of a ranging system or the influence of the environment is avoided, the stability and the accuracy of the distance detection method are improved, meanwhile, reliable distance data are provided for an AEB system, and the driving safety is effectively guaranteed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a flowchart of a distance detection method provided in an embodiment of the present disclosure;
fig. 2 is a flowchart of a distance detection method according to another embodiment of the disclosure;
fig. 3 is a schematic diagram illustrating a second distance calculation principle provided by the embodiment of the present disclosure;
fig. 4 is a flowchart of a distance detection method according to another embodiment of the disclosure;
fig. 5 is a schematic structural diagram of a distance detection apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
The embodiment of the present disclosure provides a distance detection method, which is described below with reference to specific embodiments.
Fig. 1 is a flowchart of a distance detection method according to an embodiment of the present disclosure. The method can be applied to vehicle-mounted equipment, wherein the vehicle-mounted equipment can be a vehicle machine, a smart phone, a palm computer, a tablet computer, a notebook computer, an all-in-one machine, intelligent driving equipment and the like. It can be understood that the distance detection method provided by the embodiment of the present disclosure may also be applied in other scenarios.
The following describes a distance detection method shown in fig. 1, which includes the following specific steps:
s101, acquiring a target image and a target detection frame corresponding to a detection target in the target image.
The target image refers to an image of the surrounding environment of the vehicle, which is acquired in real time by a front camera of the vehicle during the driving process of the vehicle, and specifically may be an environmental image within 120 degrees in front of the vehicle. The detection target may be any target within the image capturing range in front of the vehicle, such as a pedestrian, a rider, or the like. The target detection frame corresponding to the detection target, that is, the bounding frame of the detection target in the target image, is generally rectangular in shape.
And training the detection model in advance to obtain the trained detection model. Specifically, the labeled sample image set may be obtained in advance, the sample image is used as the input of the detection model, the labeling result of the sample image is used as the output of the detection model, and the detection model is trained. And the labeling result of the sample image comprises a detection frame of a detection target preset in the sample image. Preferably, a plurality of detection models can be constructed and trained respectively, a test image set is obtained to detect the plurality of detection models, and a model with the optimal detection effect is selected from the plurality of detection models.
And inputting the target image into the trained detection model to obtain the output of the detection model, namely a target detection frame corresponding to the detection target in the target image. It is understood that the target image may include a plurality of different detection targets, and the number of each detection target may not be unique, so that one or more target detection frames may be included in the target image, and the embodiment of the present disclosure is described by taking only one of the target detection frames as an example.
S102, determining a first distance between the detection target and the vehicle through inverse perspective transformation based on the pixel coordinates of the target detection frame in the target image.
The pixel coordinates of the target detection frame are used for reflecting the position of the target detection frame in the target image, namely the coordinate position of a certain point on the target detection frame or a pixel point corresponding to a certain point inside the target detection frame in the target image. Optionally, the coordinate position of the corresponding pixel point in the bottom edge of the target detection frame in the target image may be used as the pixel coordinate of the target detection frame in the target image.
The inverse perspective transformation is the inverse process of perspective transformation, and mainly maps a certain point in an image from an image coordinate system to a world coordinate system or a coordinate system with a self-vehicle as an origin by combining camera parameters, so that the interference and the error of perspective influence on image detection and identification tasks are eliminated. The method comprises the steps of obtaining a corresponding relation between an image coordinate system and a world coordinate system or a coordinate system with a self-vehicle as an origin by adopting inverse perspective transformation, then corresponding pixel coordinates in the image coordinate system to obtain a position of the pixel coordinates corresponding to the world coordinate system or the coordinate system with the self-vehicle as the origin, and calculating a first distance between a detection target and the self-vehicle by combining position information of the self-vehicle.
S103, determining a second distance between the detection target and the self-vehicle according to a small hole imaging principle based on the pixel height of the target detection frame in the target image.
And acquiring height data of the detection target in the real world through a vision sensor, and performing Kalman filtering on the height data to acquire the height of the detection target in the real world. And simultaneously detecting the pixel height of a target detection frame corresponding to the detection target in the target image, and determining a second distance from the detection target to the self-vehicle according to a pinhole imaging principle based on the pixel height of the target detection frame of the detection target in the target image, the height of the detection target in the real world and the focal length of the camera.
And S104, determining the smaller value of the first distance and the second distance as the distance between the detection target and the vehicle.
Because two different distance measurement methods are respectively adopted in S102 and S103, the first distance and the second distance which are respectively calculated by the two distance measurement methods may be different, and in order to fully ensure the driving safety, the smaller value of the first distance and the second distance is determined as the distance between the detection target and the own vehicle.
Optionally, if both the first distance and the second distance are greater than the preset distance threshold, determining the smaller value of the first distance and the second distance as the distance from the detection target to the host vehicle; if the first distance and the second distance are both smaller than or equal to the preset distance threshold, the first distance is determined to be the distance from the detected target to the own vehicle because the distance measurement method in the S102 is fast in calculation speed.
The method comprises the steps of obtaining a target image and a target detection frame corresponding to a detection target in the target image; determining a first distance between the detection target and the vehicle through inverse perspective transformation based on the pixel coordinates of the target detection frame in the target image; determining a second distance between the detection target and the self-vehicle according to a pinhole imaging principle based on the pixel height of the target detection frame in the target image; the smaller value of the first distance and the second distance is determined to be the distance between the detection target and the self-vehicle, the distance between the detection target and the self-vehicle is detected through two different methods of inverse perspective transformation ranging and small-hole imaging ranging, corresponding ranging results are respectively obtained, the smaller value of the different ranging results is further selected to be used as the distance between the detection target and the self-vehicle, the instability of the detection result caused by the error of a ranging system or the influence of the environment is avoided, the stability and the accuracy of the distance detection method are improved, meanwhile, reliable distance data are provided for an AEB system, and the driving safety is effectively guaranteed.
Fig. 2 is a flowchart of a distance detection method according to another embodiment of the disclosure. As shown in fig. 2, the method comprises the following specific steps:
s201, acquiring a target image and a target detection frame corresponding to a detection target in the target image.
Specifically, the implementation process and principle of S201 and S101 are consistent, and are not described herein again.
S202, determining an inverse perspective transformation matrix of the target detection frame based on camera calibration parameters.
And S203, according to the inverse perspective transformation matrix, performing inverse perspective transformation on the pixel coordinates of the target detection frame in the target image to obtain the position of the detection target in a vehicle coordinate system.
S204, determining a first distance between the detection target and the vehicle according to the position of the detection target in the vehicle coordinate system.
The camera calibration parameters comprise internal parameters and external parameters of the camera, and the internal parameters comprise the focal length of the camera. Camera pixel size, etc., and external parameters include camera position, pitch angle, etc. And calculating according to the parameters of the camera to obtain an inverse perspective transformation matrix, and multiplying by the matrix to obtain the position of the detection target in the vehicle coordinate system. The vehicle coordinate system is a coordinate system with the self vehicle as an origin. The specific calculation process is as follows:
Figure BDA0003846942860000051
wherein, M is an inverse perspective transformation matrix, x, y and z are coordinate values of the detection target in the vehicle coordinate system respectively, and u and v are pixel coordinate values of the target detection frame in the target image.
S205, calculating the ratio of the product of the focal length of the camera and the real height of the detected target to the pixel height, and determining the distance from the detected target to the camera.
S206, determining a second distance between the detection target and the vehicle based on the distance between the detection target and the camera and the calibration parameters of the camera.
Fig. 3 is a schematic diagram illustrating a second distance calculation principle provided in the embodiment of the present disclosure. As shown in fig. 2, height data of the detected target in the real world is obtained through a vision sensor, and kalman filtering is performed on the height data to obtain a height H of the detected target in the real world; obtaining a camera focal length f according to camera internal parameters; determining the pixel height h of the detection target according to the pixel height of the detection frame corresponding to the detection target in the target image, calculating the distance d of the detection target from the camera in the real world according to the pinhole imaging rule by utilizing the graph similarity relation, further determining the relative position relation between the camera and the self-vehicle based on the external parameters of the camera, and obtaining the second distance between the detection target and the self-vehicle by combining the distance d of the detection target from the camera in the real world. The specific calculation formula is as follows:
Figure BDA0003846942860000061
optionally, for the two different distance measurement methods, in order to respectively ensure the accuracy of the measurement result of each distance measurement method, distance calculation may be performed by the two methods based on a plurality of adjacent target images, and a plurality of calculation results obtained from each target image may be converged to obtain a final first distance and a final second distance.
And S207, determining the smaller value of the first distance and the second distance as the distance between the detection target and the vehicle.
The two different distance measurement methods are respectively adopted in the steps, the first distance and the second distance which are respectively calculated by the two different distance measurement methods possibly have difference, and in order to fully ensure the driving safety, the smaller value of the first distance and the second distance is determined as the distance between the detection target and the self vehicle.
Optionally, if both the first distance and the second distance are greater than the preset distance threshold, determining the smaller value of the first distance and the second distance as the distance from the detection target to the host vehicle; and if the first distance and the second distance are both smaller than or equal to the preset distance threshold value, determining the first distance as the distance between the detection target and the own vehicle because the distance measurement method corresponding to the first distance has higher calculation speed and convergence speed.
According to the distance detection method and device, the distance between the detection target and the self-vehicle is detected through different methods, the smaller value in different distance measurement results is selected as the distance between the detection target and the self-vehicle, the problem that the detection result is unstable due to errors of a distance measurement system or the influence of the environment is avoided, the stability and the accuracy of the distance detection method are improved, meanwhile, reliable distance data are provided for an AEB system, and the driving safety is effectively guaranteed.
Fig. 4 is a flowchart of a distance detection method according to another embodiment of the disclosure. As shown in fig. 4, the method comprises the following specific steps:
s401, acquiring a target image and a target detection frame corresponding to a detection target in the target image.
S402, determining a first distance between the detection target and the vehicle through inverse perspective transformation based on the pixel coordinates of the target detection frame in the target image.
Specifically, an inverse perspective transformation matrix of the target detection frame is determined based on camera calibration parameters; according to the inverse perspective transformation matrix, performing inverse perspective transformation on pixel coordinates of the target detection frame in a target image to obtain the position of the detection target in a vehicle coordinate system; and determining a first distance between the detection target and the vehicle according to the position of the detection target in the vehicle coordinate system.
And S403, acquiring the real height of the detection target.
S404, if the real height of the detection target is smaller than a second preset threshold, determining that the real height of the detection target is the second preset threshold.
Or, if the real height of the detection target is greater than or equal to the second preset threshold, directly using the real height of the detection target.
In some embodiments, the height of an adult is not lower than 1.6m according to the prior information, a second preset threshold value is set to be 1.6m for the detection target, and if the measured real height of the detection target is smaller than 1.6m, the real height of the detection target is considered to be 1.6m, so that driving safety is ensured to a greater extent.
S405, determining a second distance between the detection target and the self-vehicle according to a small hole imaging principle based on the pixel height of the target detection frame in the target image.
Specifically, the ratio of the product of the focal length of the camera and the real height of the detected target to the pixel height is calculated, and the distance from the detected target to the camera is determined; and determining a second distance between the detection target and the vehicle based on the distance between the detection target and the camera and the calibration parameters of the camera.
S406, determining the smaller value of the first distance and the second distance as the distance between the detection target and the vehicle.
S407, obtaining the historical distance between the vehicle and the detection target according to the previous frame image of the target image, and determining the difference between the distance between the detection target and the vehicle and the historical distance.
And S408, taking the product of the difference between the distance from the detected target to the self vehicle and the historical distance and a preset distance compensation coefficient as a distance compensation value.
And S409, compensating the distance between the detection target and the vehicle according to the motion state of the vehicle and the distance compensation value to obtain the compensated distance between the detection target and the vehicle.
Since the distance between the detection target and the own vehicle is calculated based on the acquired target image, the distance between the detection target and the own vehicle obtained in the steps S401 to S406 has a certain time lag, and therefore, the calculation result needs to be compensated. The specific implementation method can be that the historical distance between the vehicle corresponding to the last frame of image of the target image and the detection target is obtained, the difference between the distance between the vehicle corresponding to the target image and the detection target is calculated, and then the difference between the distance between the vehicle and the detection target is multiplied by the distance compensation coefficient to obtain the distance compensation value. The distance compensation factor can be determined according to the self-parameters of the vehicle and the driving state. In some embodiments, the driving state may be a current driving speed of the vehicle, and the distance compensation factor may be determined according to the current driving speed of the vehicle, the faster the current driving speed of the vehicle, the larger the distance compensation factor; the slower the current running speed of the vehicle is, the smaller the distance compensation coefficient is. And finally, compensating the distance between the detection target and the self-vehicle according to the obtained distance compensation value and the motion state of the self-vehicle to obtain the compensated distance between the detection target and the self-vehicle.
Specifically, the motion state of the self-vehicle comprises an acceleration state and a deceleration state. If the motion state of the self-vehicle is an acceleration state, the compensated distance between the detection target and the self-vehicle is the difference between the distance between the detection target and the self-vehicle and the distance compensation value; and if the motion state of the self-vehicle is a deceleration state, the compensated distance between the detection target and the self-vehicle is the sum of the distance between the detection target and the self-vehicle and the distance compensation value.
When the self-vehicle is in an acceleration state, the distance between the self-vehicle and the detection target is gradually reduced, and the reduction speed is gradually increased, so that the driving safety can be ensured only if the distance between the detection target and the self-vehicle is smaller than a calculation result, and the compensated distance between the detection target and the self-vehicle is the difference between the distance between the detection target and the self-vehicle and the distance compensation value; similarly, when the vehicle is in a deceleration state, the distance between the vehicle and the detection target is gradually reduced, and the reduced speed gradually becomes slower, so that the distance between the detection target and the vehicle is greater than the calculation result, the distance can be closer to a true value, and the distance between the compensated detection target and the vehicle is the sum of the distance between the detection target and the vehicle and the distance compensation value.
According to the distance detection method and device, the distance between the detection target and the self-vehicle is detected through different methods, the smaller value in different distance measurement results is selected as the distance between the detection target and the self-vehicle, the instability of the detection result caused by the error of a distance measurement system or the influence of the environment is avoided, and the stability and the accuracy of the distance detection method are improved. Meanwhile, the distance compensation is carried out on the calculated distance according to the motion state of the self-vehicle, so that the distance between the detection target and the self-vehicle is more in line with the actual situation, the accuracy of the distance detection method is further improved, reliable distance data are provided for the AEB system, and the driving safety is effectively guaranteed.
Fig. 5 is a schematic structural diagram of a distance detection device according to an embodiment of the present disclosure. The distance detection means may be the in-vehicle device described in the above embodiments, or the distance detection means may be a component or assembly in the in-vehicle device. The distance detection apparatus provided in the embodiment of the present disclosure may execute the processing procedure provided in the embodiment of the distance detection method, as shown in fig. 5, the distance detection apparatus 50 includes: the system comprises an acquisition module 51, a first ranging module 52, a second ranging module 53 and a determination module 54; the acquiring module 51 is configured to acquire a target image and a target detection frame corresponding to a detection target in the target image; the first distance measurement module 52 is configured to determine, based on the pixel coordinates of the target detection frame in the target image, a first distance from the detected target to the host vehicle through inverse perspective transformation; the second distance measurement module 53 is configured to determine, based on the pixel height of the target detection frame in the target image, a second distance from the detected target to the host vehicle according to a pinhole imaging principle; the determining module 54 is configured to determine that the smaller of the first distance and the second distance is the distance between the detection target and the host vehicle.
Optionally, the first ranging module 52 includes a first determining unit 521, a transforming unit 522, and a second determining unit 523; the first determining unit 521 is configured to determine an inverse perspective transformation matrix of the target detection frame based on the camera calibration parameters; the transformation unit 522 is configured to perform inverse perspective transformation on the pixel coordinates of the target detection frame in the target image according to the inverse perspective transformation matrix, so as to obtain a position of the detection target in a vehicle coordinate system; the second determining unit 523 is configured to determine a first distance from the detection target to the host vehicle according to the position of the detection target in the vehicle coordinate system.
Optionally, the distance detection apparatus 50 further includes a height detection module 55, configured to obtain a real height of the detection target; and under the condition that the real height of the detection target is smaller than a second preset threshold, determining the real height of the detection target as the second preset threshold.
Optionally, the second ranging module 53 includes a first calculating unit 531 and a third determining unit 532; the first calculating unit 531 is configured to calculate a ratio of a product of a focal length of the camera and a true height of the detected target to the pixel height, and determine a distance from the detected target to the camera; the third determining unit 532 is configured to determine a second distance between the detection target and the host vehicle based on the distance between the detection target and the camera and the calibration parameter of the camera.
Optionally, the distance detection device 50 further includes a compensation module 56; the compensation module 56 includes a fourth determination unit 561, a second calculation unit 562, and a compensation unit 563; the fourth determination unit 561 is configured to obtain a historical distance between a vehicle and a detection target according to a previous frame image of the target image, and determine a difference between the distance between the detection target and the vehicle and the historical distance; the second calculating unit 562 is configured to use a product of a difference between the distance from the detected target to the host vehicle and the historical distance and a preset distance compensation coefficient as a distance compensation value; the compensation unit 563 is configured to compensate the distance between the detection target and the vehicle according to the motion state of the vehicle and the distance compensation value, so as to obtain a compensated distance between the detection target and the vehicle.
Optionally, the compensating unit 563 is further configured to determine, when the motion state of the host vehicle is an acceleration state, that the distance between the compensated detection target and the host vehicle is a difference between the distance between the detection target and the host vehicle and the distance compensation value; and when the motion state of the self-vehicle is a deceleration state, determining that the distance between the compensated detection target and the self-vehicle is the sum of the distance between the detection target and the self-vehicle and the distance compensation value.
The distance detection apparatus in the embodiment shown in fig. 5 can be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device may be the in-vehicle device described in the above embodiment. The electronic device provided in the embodiment of the present disclosure may execute the processing procedure provided in the embodiment of the distance detection method, as shown in fig. 6, the electronic device 60 includes: memory 61, processor 62, computer programs and communication interface 63; wherein a computer program is stored in the memory 61 and is configured to execute the distance detection method as described above by the processor 62.
In addition, the embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the distance detection method described in the above embodiment.
Furthermore, the embodiments of the present disclosure also provide a computer program product comprising a computer program or instructions which, when executed by a processor, implement the distance detection method as described above.
In addition, the embodiment of the disclosure also provides a vehicle, and the vehicle comprises the distance detection device in the embodiment.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of distance detection, the method comprising:
acquiring a target image and a target detection frame corresponding to a detection target in the target image;
determining a first distance between the detection target and the vehicle through inverse perspective transformation based on the pixel coordinates of the target detection frame in the target image;
determining a second distance between the detection target and the self-vehicle according to a small hole imaging principle based on the pixel height of the target detection frame in the target image;
and determining the smaller value of the first distance and the second distance as the distance between the detection target and the own vehicle.
2. The method of claim 1, wherein determining a first distance of the detection target from the host vehicle through an inverse perspective transformation based on pixel coordinates of the target detection frame in a target image comprises:
determining an inverse perspective transformation matrix of the target detection frame based on camera calibration parameters;
according to the inverse perspective transformation matrix, performing inverse perspective transformation on pixel coordinates of the target detection frame in a target image to obtain the position of the detection target in a vehicle coordinate system;
and determining a first distance between the detection target and the vehicle according to the position of the detection target in the vehicle coordinate system.
3. The method of claim 1, wherein prior to determining a second distance of the detection target from the host vehicle according to pinhole imaging principles based on a pixel height of the target detection frame in the target image, the method further comprises:
acquiring the real height of the detection target;
and if the real height of the detection target is smaller than a second preset threshold, determining that the real height of the detection target is the second preset threshold.
4. The method of claim 1, wherein determining a second distance of the detection target from the host vehicle according to a pinhole imaging principle based on a pixel height of the target detection frame in the target image comprises:
calculating the ratio of the product of the focal length of the camera and the real height of the detected target to the pixel height, and determining the distance from the detected target to the camera;
and determining a second distance between the detection target and the vehicle based on the distance between the detection target and the camera and the calibration parameters of the camera.
5. The method of claim 1, wherein after determining that the smaller of the first distance and the second distance is the distance of the detection target from the host vehicle, the method further comprises:
obtaining the historical distance between the vehicle and the detection target according to the previous frame of image of the target image, and determining the difference between the distance between the detection target and the vehicle and the historical distance;
taking the product of the difference between the distance from the detected target to the self-vehicle and the historical distance and a preset distance compensation coefficient as a distance compensation value;
and compensating the distance between the detection target and the self-vehicle according to the motion state of the self-vehicle and the distance compensation value to obtain the compensated distance between the detection target and the self-vehicle.
6. The method of claim 5, wherein compensating the distance of the detection target from the host vehicle according to the motion state of the host vehicle and the distance compensation value comprises:
if the motion state of the self-vehicle is an acceleration state, the compensated distance between the detection target and the self-vehicle is the difference between the distance between the detection target and the self-vehicle and the distance compensation value;
and if the motion state of the self-vehicle is a deceleration state, the compensated distance between the detection target and the self-vehicle is the sum of the distance between the detection target and the self-vehicle and the distance compensation value.
7. A distance detection device, characterized in that the device comprises:
the acquisition module is used for acquiring a target image and a target detection frame corresponding to a detection target in the target image;
the first distance measurement module is used for determining a first distance between the detection target and the self-vehicle through inverse perspective transformation based on the pixel coordinates of the target detection frame in the target image;
the second distance measurement module is used for determining a second distance between the detected target and the self-vehicle according to a small hole imaging principle based on the pixel height of the target detection frame in the target image;
and the determining module is used for determining the smaller value of the first distance and the second distance as the distance between the detection target and the vehicle.
8. An electronic device, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-6.
10. A vehicle, comprising: the distance detection device according to claim 7.
CN202211122203.9A 2022-09-15 2022-09-15 Distance detection method, device, equipment, storage medium and vehicle Pending CN115661028A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211122203.9A CN115661028A (en) 2022-09-15 2022-09-15 Distance detection method, device, equipment, storage medium and vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211122203.9A CN115661028A (en) 2022-09-15 2022-09-15 Distance detection method, device, equipment, storage medium and vehicle

Publications (1)

Publication Number Publication Date
CN115661028A true CN115661028A (en) 2023-01-31

Family

ID=85024541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211122203.9A Pending CN115661028A (en) 2022-09-15 2022-09-15 Distance detection method, device, equipment, storage medium and vehicle

Country Status (1)

Country Link
CN (1) CN115661028A (en)

Similar Documents

Publication Publication Date Title
CN109343061B (en) Sensor calibration method and device, computer equipment, medium and vehicle
CN109544629B (en) Camera position and posture determining method and device and electronic equipment
WO2018142900A1 (en) Information processing device, data management device, data management system, method, and program
US8885049B2 (en) Method and device for determining calibration parameters of a camera
CN111476106B (en) Monocular camera-based straight road relative gradient real-time prediction method, system and device
CN112014845A (en) Vehicle obstacle positioning method, device, equipment and storage medium
CN110341621B (en) Obstacle detection method and device
CN113030990B (en) Fusion ranging method, device, ranging equipment and medium for vehicle
CN112562093A (en) Object detection method, electronic medium, and computer storage medium
CN114639085A (en) Traffic signal lamp identification method and device, computer equipment and storage medium
CN115546315A (en) Sensor on-line calibration method and device for automatic driving vehicle and storage medium
CN116386000A (en) Method and system for measuring obstacle distance based on high-precision map and monocular camera
CN114037972A (en) Target detection method, device, equipment and readable storage medium
CN114705121A (en) Vehicle pose measuring method and device, electronic equipment and storage medium
CN117079238A (en) Road edge detection method, device, equipment and storage medium
CN115841660A (en) Distance prediction method, device, equipment, storage medium and vehicle
CN111351497B (en) Vehicle positioning method and device and map construction method and device
CN115661028A (en) Distance detection method, device, equipment, storage medium and vehicle
CN110836656B (en) Anti-shake distance measuring method and device for monocular ADAS (adaptive Doppler analysis System) and electronic equipment
CN111103584A (en) Device and method for determining height information of objects in the surroundings of a vehicle
CN110706374B (en) Motion state prediction method and device, electronic equipment and vehicle
CN112815979B (en) Sensor calibration method and device
CN116052121B (en) Multi-sensing target detection fusion method and device based on distance estimation
JP7117408B1 (en) POSITION CALCULATION DEVICE, PROGRAM AND POSITION CALCULATION METHOD
CN114882727A (en) Parking space detection method based on domain controller, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination