Ranging method and device

By utilizing the pixels and physical distances between feature points in multiple image frames in an intelligent driving system and combining it with the pinhole imaging principle, the problem of ranging errors caused by poor obstacle imaging is solved, accurate longitudinal distance calculation between the vehicle and the obstacle is achieved, and safety risks are reduced.

CN120800307APending Publication Date: 2025-10-17NINGBO HORIZON SATENG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510899476.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

In intelligent driving scenarios, existing technologies have difficulty accurately detecting the location of obstacles in situations where obstacle imaging is poor, such as in unusually shaped vehicles or night scenes, resulting in large errors in ranging results and increased safety risks.

Method used

By determining the pixel distance between feature points in the first image of the vehicle and combining it with the physical distance between feature points in multiple frames of images, the longitudinal distance between the vehicle and the obstacle is calculated using the pinhole imaging principle, avoiding reliance on the accurate detection frame of the obstacle.

Benefits of technology

Accurately determining the longitudinal distance between the vehicle and obstacles in various scenarios reduces safety risks and improves the safety and response speed of the intelligent driving system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120800307A_ABST
    Figure CN120800307A_ABST
Patent Text Reader

Abstract

The invention discloses a distance measuring method and device, relates to the field of intelligent driving, and aims to accurately obtain the longitudinal distance between a vehicle and a front object when the vehicle is in any scene. The method comprises the steps of determining a first feature point of a first object in a first image collected by a vehicle at a first moment; determining a first physical distance between the first feature points based on a first pixel distance between the first feature points; determining a third physical distance between the first feature points based on a second physical distance between second feature points of the first object in a second image collected by the vehicle at a second moment and the first physical distance; the second moment is before the first moment; and determining the longitudinal distance between the vehicle and the first object at the first moment based on the third physical distance, the first pixel distance and the focal length of the image acquisition equipment of the vehicle.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the field of intelligent driving, and in particular, to a ranging method and device. BACKGROUND

[0002] In the field of intelligent driving, in order to ensure the driving safety of a vehicle in an intelligent driving state, it is necessary to detect the distance between the vehicle and an obstacle in front of the vehicle in real time, and then determine whether to adjust the driving parameters (such as speed, acceleration, steering wheel angle, etc.). In the related art, when determining the distance between the vehicle and the obstacle, the vehicle needs to rely on the detection box of the obstacle in the image collected by the vehicle. However, when the obstacle is a special-shaped vehicle (such as an empty car carrier or an empty low flatbed semi-trailer), or the vehicle is in a scene such as a night scene where the imaging effect of the obstacle is poor, the object detection algorithm / model on the vehicle cannot stably obtain an accurate detection box of the obstacle (i.e., a detection box that can include the complete obstacle). In this way, the ranging scheme in the related art that relies on the detection box cannot obtain an accurate ranging result, which may result in safety risks when the vehicle adjusts the driving parameters based on the ranging result. SUMMARY

[0003] To solve the above technical problems, the present disclosure provides a ranging method and device to enable a vehicle to accurately obtain the longitudinal distance between the vehicle and a front object in any scene.

[0004] The first aspect embodiment of the present disclosure provides a ranging method, comprising: determining a first feature point of a first object in a first image collected by a vehicle at a first time; determining a first physical distance between the first feature points based on a first pixel distance between the first feature points; determining a third physical distance between the first feature points based on a second physical distance between second feature points of the first object in a second image collected by the vehicle at a second time and the first physical distance; the second time is before the first time; and determining a longitudinal distance between the vehicle and the first object at the first time based on the third physical distance, the first pixel distance, and a focal length of an image collection device of the vehicle.

[0005] The second aspect embodiment of the present disclosure provides a ranging device, comprising:

[0006] A first determination module is configured to determine a first feature point of a first object in a first image collected by a vehicle at a first time.

[0007] A second determination module is configured to determine a first physical distance between the first feature points based on a first pixel distance between the first feature points determined by the first determination module.

[0008] The third determining module is configured to determine a third physical distance between the first feature points based on a second physical distance between second feature points of the first object in a second image collected by the vehicle at a second time and the first physical distance determined by the second determining module, and the second time is before the first time.

[0009] The processing module is configured to determine a longitudinal distance between the vehicle and the first object at the first time based on the third physical distance determined by the third determining module, the first pixel distance, and a focal length of an image collection device of the vehicle.

[0010] Embodiments of the third aspect of the present disclosure provide a computer readable storage medium, the storage medium storing a computer program, the computer program being configured to execute the ranging method provided in the embodiments of the first aspect of the present disclosure.

[0011] Embodiments of the fourth aspect of the present disclosure provide an electronic device, the electronic device comprising:

[0012] a processor;

[0013] a memory configured to store instructions executable by the processor;

[0014] The processor is configured to read the instructions from the memory and execute the instructions to implement the ranging method provided in the embodiments of the first aspect of the present disclosure.

[0015] Embodiments of the fifth aspect of the present disclosure provide a computer program product, when an instruction processor in the computer program product executes, the instruction processor executes the ranging method provided in the embodiments of the first aspect of the present disclosure.

[0016] The technical solution provided by the embodiments of the present disclosure can obtain the physical distance between feature points by using the pixel distance between feature points of the first object in the first image captured by the vehicle. By using the physical distance between feature points in a second image captured earlier than the first image, the first physical distance can be smoothed or stabilized, and a more accurate third physical distance between feature points in the first image can be obtained. Since in any case, even if there is an error in the physical distance between feature points obtained from a single-frame image, the physical distance between feature points obtained from multiple frames will fluctuate within a certain range of the accurate physical distance between feature points, a more accurate physical distance between feature points can be determined based on the physical distance between feature points obtained from multiple frames. Therefore, through the above method, an accurate third physical distance between feature points of the first object in the first image can be obtained. Furthermore, based on the pinhole imaging principle, the longitudinal distance between the vehicle and the first object at the first moment can be accurately obtained based on the third physical distance, the first pixel distance, and the focal length of the image acquisition device. It can be seen that the method for determining the longitudinal distance provided by the present disclosure is based on the feature points of the first object in the image, and no longer relies on the accurate detection frame of the first object. Therefore, no matter what type of object the first object in front of the vehicle is, no matter what scene the vehicle is in, the technical solution provided by the present disclosure can accurately determine the longitudinal distance between the vehicle and the first object, thereby enabling the vehicle to accurately adjust driving parameters based on the longitudinal distance, reducing safety risks. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a schematic diagram of the principle of a ranging method provided by an exemplary embodiment of the present disclosure.

[0018] Figure 2 It is a schematic diagram of an application scenario of a ranging method provided by an exemplary embodiment of the present disclosure.

[0019] Figure 3 It is a schematic diagram of an application scenario of a ranging method provided by another exemplary embodiment of the present disclosure.

[0020] Figure 4 This is a flow diagram of a distance measurement method provided by an exemplary embodiment of the present disclosure. Figure 1 .

[0021] Figure 5 It is a schematic diagram of the principle of the pinhole imaging theorem provided by an exemplary embodiment of the present disclosure.

[0022] Figure 6 This is a flow diagram of a distance measurement method provided by an exemplary embodiment of the present disclosure. Figure 2 .

[0023] Figure 7 This is a flow diagram of a distance measurement method provided by an exemplary embodiment of the present disclosure. Figure 3 .

[0024] Figure 8 is a flowchart of a ranging method provided by an example embodiment of the present disclosure Figure 4 .

[0025] Figure 9 is a structural diagram of a ranging device provided by an example embodiment of the present disclosure.

[0026] Figure 10 is a structural diagram of a ranging device provided by another example embodiment of the present disclosure.

[0027] Figure 11 is a structural diagram of an electronic device provided by an example embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] For the purpose of interpreting the present disclosure, example embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings, obviously, the described embodiments are only part of the embodiments of the present disclosure, not all the embodiments, it should be understood that the present disclosure is not limited by the example embodiments.

[0029] It should be noted that: unless otherwise specifically stated, the relative arrangement, numerical expressions and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.

[0030] SUMMARY

[0031] An intelligent driving system is an assisted driving system or an automatic driving system developed based on automatic control technology, which makes driving decisions autonomously by perceiving and analyzing environmental information around the vehicle, and realizes automatic driving or semi-automatic driving of the vehicle. In order to ensure that the vehicle with intelligent driving system can complete intelligent driving safely and reliably, the vehicle with intelligent driving function usually determines the distance between the vehicle and the surrounding obstacles in real time, and then controls the driving parameters of the vehicle based on the determined distance, which ensures the safety of the vehicle and the passengers.

[0032] In order to accurately obtain the distance between the vehicle and the obstacle, a homography matrix ranging scheme or a pinhole imaging ranging scheme can be used in the related art. Among them, the homography matrix ranging scheme is accurate only when the ground and the optical axis of the image acquisition device are parallel, and the detection frame of the obstacle in the image collected by the vehicle includes the complete obstacle. Otherwise, the ranging result will have a large error. However, the actual road surface cannot guarantee that the ground and the optical axis of the image acquisition device are always parallel, and the detection frame cannot guarantee that it can always stably include the complete obstacle, so the ranging result error of this method is large.

[0033] On this basis, in order to avoid the adverse effects of the factor that the optical axis of the ground and the image acquisition device is not parallel, the related technology then proposes a pinhole imaging ranging scheme. The pinhole imaging ranging scheme is based on the pinhole imaging formula corresponding to the pinhole imaging principle to calculate the distance between the vehicle and the obstacle, and the formula needs to rely on the detection box height of the obstacle to complete the distance calculation. However, in the case of an obstacle being a special-shaped vehicle (such as an empty car, an empty low flat semi-trailer), or the vehicle being in a scene such as a night scene where the obstacle imaging effect is poor, the object detection algorithm / model on the vehicle cannot stably obtain the accurate detection box of the obstacle. As a result, the ranging scheme will not be able to obtain accurate ranging results, resulting in the possibility of safety risks when the vehicle adjusts the driving parameters based on the ranging results.

[0034] In view of the above problems, the embodiment of the present disclosure provides a ranging method, as shown in Figure 1 In the technical scheme, the first physical distance between the first feature points is determined based on the first pixel distance between the first feature points of the first object in the first image collected by the vehicle at the first time (for example, the current time). The more accurate third physical distance between the first feature points is obtained in combination with the second physical distance between the second feature points of the first object in the second image collected at the time earlier than the first image and the first physical distance. Further, the longitudinal distance between the vehicle and the first object at the first time is obtained based on the third physical distance, the first pixel distance, and the focal length of the image acquisition device.

[0035] The technical solution provided by the embodiments of the present disclosure can obtain the physical distance between the feature points of the first object in the first image collected by the vehicle through the pixel distance between the feature points in the first image. The first physical distance can be smoothed or stabilized through the physical distance between the feature points in the second image collected at a time earlier than the first image, and a more accurate third physical distance between the feature points in the first image is obtained. Since in any case, even if the physical distance between the feature points obtained from a single image has an error, the physical distance between the feature points obtained from multiple images will fluctuate within a certain range of the accurate physical distance between the feature points, the physical distance between the feature points obtained based on multiple images can determine a more accurate physical distance between the feature points. Therefore, through the above-mentioned manner, the accurate third physical distance between the feature points of the first object in the first image can be obtained. Further, based on the principle of pinhole imaging, the longitudinal distance between the vehicle and the first object at the first time can be accurately obtained based on the third physical distance, the first pixel distance, and the focal length of the image collection device. It can be seen that the method for determining the longitudinal distance provided by the present disclosure is completed based on the feature points of the first object in the image, and no longer depends on the accurate bounding box of the first object. Therefore, no matter what type of object the first object in front of the vehicle is, no matter what scene the vehicle is in, the longitudinal distance between the vehicle and the first object can be accurately determined by using the technical solution provided by the present disclosure, and then the vehicle can accurately adjust the driving parameters based on the longitudinal distance, thereby reducing the safety risk.

[0036] Exemplary system

[0037] Figure 2 An exemplary application scenario of the ranging method provided by the present disclosure.

[0038] As Figure 2 shown, the scenario includes an intelligent driving vehicle 201 in a driving process, and a first object 202 in front of the intelligent driving vehicle. The first object 202 can be one or more, and the first object 202 can be other vehicles in a driving process, pedestrians in a walking process, two-wheeled vehicles or three-wheeled vehicles in a riding process, or other obstacles in a vehicle driving road. The present disclosure does not make specific limitations thereto.

[0039] Among them, the image collection device is arranged on the intelligent driving vehicle 201, and the image collection device is used to collect the environment image in the driving process of the intelligent driving vehicle 201. The environment image can include the first object 202 around the vehicle. For example, the image collection device can be a camera used to collect the front of the intelligent driving vehicle 201, or can also be a camera used to collect the left front of the intelligent driving vehicle 201. The present disclosure does not make specific limitations thereto.

[0040] The intelligent driving vehicle 201 can also be provided with a control device, which is configured to execute the ranging method provided in the embodiments of the present disclosure. The control device can be a vehicle-mounted computer or an intelligent driving system in the intelligent driving vehicle 201. The present disclosure does not make specific limitations in this regard.

[0041] Specifically, the control device of the intelligent driving vehicle 201 can determine the first physical distance between the feature points in the first image based on the first pixel distance between the first feature points of the first object in the first image collected at the first time (for example, the current time). Further, the control device of the intelligent driving vehicle 201 can perform smoothing processing on the first physical distance based on the second physical distance between the second feature points of the first object in the second image collected at a time earlier than the first image, to obtain a more accurate third physical distance between the feature points of the first object in the first image. Finally, the control device of the intelligent driving vehicle 201 can accurately determine the longitudinal distance between the vehicle and the first object at the first time based on the third physical distance, the first pixel distance, and the focal length of the image collection device.

[0042] Figure 3 Another exemplary application scenario of the ranging method provided in the present disclosure.

[0043] As shown in Figure 3 , the scenario includes an intelligent driving vehicle 301 in the process of driving, a server device 303, and a first object 302 in front of the intelligent driving vehicle 301. The specific definition of the first object 302 can refer to the related description of the first object 202 in the foregoing embodiments, which will not be repeated here. The server device 303 stores an image sequence collected by the intelligent driving vehicle 301 and other possible data. The server device 303 and the intelligent driving vehicle 301 can realize data transmission through any possible wired or wireless communication means.

[0044] Among them, the intelligent driving vehicle 301 is provided with an image collection device. The function of the image collection device can refer to the image collection device provided in the intelligent driving vehicle 201 in the foregoing embodiments, which will not be repeated here. The intelligent driving vehicle 301 can also be provided with a control device. The function of the control device can refer to the control device provided in the intelligent driving vehicle 201 in the foregoing embodiments, which will not be repeated here. The difference between the two is that the control device in the embodiments of the present disclosure can obtain the second physical distance between the second feature points of the first object in the second image from the server device when the third physical distance needs to be determined.

[0045] It should be noted that when the scenario in which the ranging method provided in the present disclosure is applied includes an intelligent driving vehicle and a server device, the method can be implemented partially or entirely on the server device in addition to being implemented solely by the control device on the intelligent driving vehicle.

[0046] Exemplary method

[0047] Figure 4 FIG. 1 is a flowchart of a ranging method provided by an exemplary embodiment of the present disclosure. The embodiment can be applied to the intelligent driving vehicle mentioned in the foregoing embodiments. As shown in FIG. 1, the method can include S401-S404: Figure 4

[0048] S401, determining a first feature point of a first object in a first image collected by the vehicle at a first time.

[0049] In some embodiments, the first feature point can be a key point and / or a corner point capable of reflecting a shape, contour, and the like of the first object.

[0050] In another embodiment, the first feature point can be a pixel point of the first object, whose gradient is greater than a gradient threshold or whose order is located in a front preset percentage of a pixel point sequence. The gradient of the pixel point is used to reflect a brightness (or grayscale) change rate of the brightness of the image at the pixel point. The pixel point sequence is a sequence obtained by arranging all pixel points of the first object in descending order of the gradient.

[0051] In the embodiment of the present disclosure, the image collection device / image sensor (for example, a front camera) on the vehicle (i.e., the intelligent driving vehicle) can collect images of the front area of the vehicle in real time during driving, so that the control device of the vehicle can execute the ranging method provided by the present disclosure in real time to obtain the longitudinal distance between the vehicle and the front object (for example, the first object) in real time.

[0052] In a possible implementation, in the case that the first image is an image collected by the vehicle and including the first object, in order to accurately determine the first feature point of the first object, an object detection algorithm can be used to detect the first object in the first image to obtain a detection box of the first object. The object detection algorithm can be any possible detection model, such as a YOLO (you only look once) model, an SSD (single shot multibox detector) model, a DETR (detection transformer) model, and the like, which is not specifically limited in the present disclosure.

[0053] ​After obtaining the detection frame of the first object, any possible feature point extraction algorithm can be used to determine the first feature points of the first object from the detection frame of the first object. Exemplarily, the feature extraction algorithm can be an algorithm such as Oriented FAST (Features from Accelerated Segment Test) and Rotated BRIEF (Binary Robust Independent Elementary Features), Intrinsic Shape Signatures (ISS), 3D Scale Invariant Feature Transform (3D-SIFT), and the like. The present disclosure does not make a specific limitation in this regard. The above process is as follows Figure 4 Extraction of feature points is shown.

[0054] In addition, since the corner points on the first detection frame are easy to determine and convenient to process, the corner points on the detection frame of the first object can also be used as the first feature points of the first object. In the embodiments of the present disclosure, the detection frame can be a rectangular frame, and the corner points of the detection frame can be the four vertices on the detection frame.

[0055] In another possible implementation, in the case where the first image is not an image including the first object collected by the vehicle, the first feature points of the first object in the first image can be determined by using optical flow tracking.

[0056] The optical flow tracking is a computer vision technology for estimating the position and motion trajectory of an object by analyzing the motion of pixels between consecutive image frames, and the implementation thereof is mainly based on the following three assumptions: (1) brightness constancy assumption: the surface brightness of the same object remains unchanged between consecutive frames (i.e., the gray value of a pixel point does not change with motion). (2) spatial consistency: the motion trend of adjacent pixel points is similar. (3) time continuity: the time interval between frames is extremely short, and the displacement of the object is small. Specifically, the general process of obtaining the first feature points of the first object in the first image by using optical flow tracking is as follows: 1. By performing optical flow algorithm processing on two different frames (for example, adjacent frames) in the image sequence, the displacement vector (or called optical flow field) of the pixel points of the first object in the two different frames is obtained. 2. By using the displacement vector and the feature point coordinates of the first object in the previous frame in the two different frames (specifically, the coordinates of the feature points in the image coordinate system), the feature point coordinates of the first object in the next frame in the two different frames are obtained. The process of obtaining the displacement vector of the pixel points can also be referred to as optical flow estimation, and the optical flow tracking is a further processing based on the optical flow estimation.

[0057] Based on this, in some embodiments, determining the first feature point of the first object in the first image may specifically include: performing optical flow tracking on the third feature point of the first object in the third image captured by the vehicle at a third moment, to obtain the first feature point of the first object in the first image. The third moment is before the first moment. Specifically, the vehicle control device may, when the image capture device captures two frames of images including the first object, use the aforementioned optical flow tracking method to perform optical flow tracking on the feature point of the first object in the first of the two frames, to obtain the feature point of the first object in the second of the two frames.

[0058] In the embodiments of the present disclosure, any possible optical flow tracking algorithm may be used for optical flow tracking, such as the Lucas-Kanade (LK) optical flow method, the Horn-Schunck (HS) optical flow method, etc. The present disclosure does not impose any specific limitation on this.

[0059] In this way, optical flow tracking can accurately obtain the first feature points of the first object in the first image captured at the first moment based on the image information. Furthermore, a stable and accurate physical distance between the first feature points can be determined based on the pixel distance between the first feature points. This allows the vehicle control device to accurately determine the longitudinal distance between the vehicle and the first object at the first moment based on the stable and accurate physical distance between the first feature points.

[0060] Furthermore, as discussed above with respect to optical flow tracking, when obtaining the first feature point of the first object in the first image through optical flow tracking, it is necessary to ensure that the capture time of the third image targeted by the optical flow tracking is as close as possible to the first image. This ensures that the ambient light shift between the third image and the first image is smaller, the displacement of the first object is smaller, and the optical flow tracking results are more accurate. Therefore, the third image can be the frame preceding the first image, meaning that the third image and the first image are adjacent frames.

[0061] Of course, if the vehicle's image acquisition device captures images at a high frame rate and the acquisition interval between adjacent frames is very short, the third image and the first image may not be adjacent frames, that is, the third image and the first image are cross-frame images separated by multiple frames.

[0062] In addition, in the optical flow tracking process, due to the change of ambient light, the gradient of some of the tracked feature points can be reduced, and thus these feature points are prone to tracking failure. Therefore, when tracking the feature points (for example, the third feature points) of the first object, if it is determined that the gradient of some of the feature points is less than the gradient threshold, the tracking of these feature points is stopped. At the same time, in order to ensure that the number of tracked feature points is sufficient, some feature points of the first object can also be re-determined for tracking. Specifically, the detection frame of the first object can be determined first, and then the feature points meeting the requirements (for example, the gradient is greater than the gradient threshold) are selected from the detection frame of the first object, and the feature points that do not coincide with the previously tracked feature points are taken as the re-determined feature points. Then, the optical flow tracking can be continued for the existing feature points that have not stopped tracking and the re-determined feature points.

[0063] In S402, a first physical distance between the first feature points is determined based on the first pixel distance between the first feature points.

[0064] In some embodiments, the pixel distance d between two feature points on the image and the actual physical distance D between the two feature points conform to the pinhole imaging principle as shown in the following formula (1). Figure 5 Figure 5 In the formula (1), h is the pixel height of the first object in the image, H is the actual height of the first object, f is the focal length of the image acquisition device of the vehicle, and X is the longitudinal distance between the vehicle and the first object in the longitudinal direction. Figure 5 According to the pinhole imaging principle shown in the formula (1), the following formula (2) can be obtained.

[0065]

[0066] In the formula (2), h is the pixel height of the first object in the image, H is the actual height of the first object, f is the focal length of the image acquisition device of the vehicle, and X is the longitudinal distance between the vehicle and the first object in the longitudinal direction.

[0067] In addition, in the embodiments of the present disclosure, the height of the first detection frame of the first object can be determined as the pixel height of the first object in the image. The height of the first detection frame of the first object can be obtained by detecting the first object in the first image using any feasible object detection algorithm.

[0068] Based on this, in some embodiments, the implementation manner of determining the distance of the first object based on the first pixel distance can include: determining the first physical distance between the first feature points based on the first pixel distance between the first feature points, the height of the first detection frame of the first object in the first image, and the height of the first object. Specifically, the first physical distance can be calculated based on the foregoing formula (1).

[0069] ​In this way, the first physical distance corresponding to the first pixel distance between the first feature points can be obtained based on the pinhole imaging principle. This provides data support for subsequently obtaining a stable and accurate physical distance between the first feature points.

[0070] In addition, based on the above, it can be known that before implementing the ranging method provided by the present disclosure, the actual height of the first object needs to be obtained first. In the embodiments of the present disclosure, the actual height of the first object can be obtained in any possible way. For example, in one possible implementation, a homography matrix can be used to estimate the longitudinal distance between the vehicle and the first object first, and then the actual height of the first object can be calculated based on the foregoing formula (1). Of course, since the bounding box of the first object can not be accurate, the pixel height of the first object can also not be accurate, and thus the actual height of the first object obtained based on single-frame data can also not be accurate. Therefore, in this implementation, after obtaining multiple actual heights of the first object through multiple frames of data, a more accurate actual height of the first object can be obtained through any possible smoothing method (for example, taking the median value or the average value). For another example, in another possible implementation, a pre-trained height recognition model can be used to recognize the actual height of the first object in the first image. The height recognition model has the ability to process input images to obtain the actual height of each object in the input image, and the model architecture and training process can be determined according to actual needs.

[0071] S403, determining a third physical distance between the first feature points based on a second physical distance between second feature points of the first object in a second image collected by the vehicle at a second time and the first physical distance.

[0072] The second time is before the first time. In the embodiments of the present disclosure, the second time can include multiple image collection times before the first time. In addition, in the embodiments of the present disclosure, the multiple image collection times included in the second time can include the third time in the foregoing embodiments. In the embodiments of the present disclosure, the third time can include the image collection times of all historical images in the first image sequence, and the first image sequence is an image sequence including the first object collected by the image collection device of the vehicle, and the historical image is an image collected at a time earlier than the first image. Alternatively, the third time can include the image collection times of a preset number of historical images in the first image sequence.

[0073] In the embodiments of the present disclosure, there are multiple first feature points, and there are also multiple second feature points. The second feature points and the first feature points can be one-to-one corresponding feature points, that is, the second feature points and the first feature points corresponding thereto are both projection points of the same three-dimensional point on the image at the same position on the actual first object. For example, if the first object is a vehicle, the second feature point pair and the first feature point pair corresponding thereto can both correspond to a pair of three-dimensional points at the upper and lower ends of the left rearview mirror on the vehicle. In addition, if the multiple image capturing time points included in the second time point include the third time point in the foregoing embodiments, the second feature points also include the third feature points in the foregoing embodiments. In addition, in the embodiments of the present disclosure, when the third physical distance is determined, the multiple pairs of second feature points corresponding to the multiple second physical distances used and the pair of first feature points corresponding to the first physical distance all correspond to the same pair of three-dimensional points on the first object.

[0074] After S402 is executed, the first physical distance is a single-frame physical distance calculated based on the height of the detection box of the first object in the single-frame first image. Therefore, the single-frame physical distance will have errors due to the inaccuracy of the first detection box of the first object (not accurately including the complete first object). Further, although the height of the detection box of the first object in the single-frame image can be inaccurate, the height of the detection box of the first object in the multiple-frame image will change within a certain range of the accurate detection box height of the first object. Therefore, a more accurate detection box height of the first object can be obtained through the height of the detection box of the first object in the multiple-frame image. Therefore, in order to reduce the error of the first physical distance, the single-frame physical distance can be smoothed based on the physical distance between the feature points corresponding to the historical image captured earlier than the first image to obtain a third physical distance. The third physical distance is more reliable than the first physical distance. The physical distance between the feature points corresponding to the historical image can include the second physical distance between the second feature points of the first object in the second image captured at the second time point of the vehicle.

[0075] After the third physical distance is obtained, the determination of the longitudinal distance between the vehicle and the first object can be completed in combination with the first pixel distance and the focal length of the image capturing device of the vehicle, that is, S404 is executed.

[0076] In S404, the longitudinal distance between the vehicle and the first object at the first time point is determined based on the third physical distance, the first pixel distance, and the focal length of the image capturing device of the vehicle.

[0077] In the embodiments of the present disclosure, the control device of the vehicle can calculate the longitudinal distance between the vehicle and the first object at the first time point based on the foregoing formula (1) by using the third physical distance, the first pixel distance, and the focal length of the image capturing device. The third physical distance and the first pixel distance correspond to the same pair of first feature points.

[0078] In addition, since there are multiple first feature points, there are multiple first physical distances, and each first physical distance corresponds to a third physical distance, there are multiple third physical distances. On this basis, multiple longitudinal distances between the vehicle and the first object at the first moment can be obtained. In order to obtain a more accurate longitudinal distance, in the embodiment of the present disclosure, any feasible way can be used to determine the most accurate longitudinal distance from the multiple longitudinal distances. The present disclosure does not make specific limitations on this.

[0079] The technical solution provided by the embodiment of the present disclosure can obtain the physical distance between the feature points in the first image of the vehicle through the pixel distance between the feature points of the first object in the first image. By using the physical distance between the feature points in the second image collected at a moment earlier than the first image, the smoothing or stabilization of the first physical distance can be achieved, and a more accurate third physical distance between the feature points in the first image can be obtained. Since in any case, even if the physical distance between the feature points obtained from a single image has errors, the physical distance between the feature points obtained from multiple images will fluctuate within a certain range of the accurate physical distance between the feature points, so the physical distance between the feature points obtained based on multiple images can determine a more accurate physical distance between the feature points. Therefore, by using the above method, an accurate third physical distance between the feature points of the first object in the first image can be obtained. Further, based on the principle of pinhole imaging, the longitudinal distance between the vehicle and the first object at the first moment can be accurately obtained based on the third physical distance, the first pixel distance, and the focal length of the image collection device. It can be seen that the method for determining the longitudinal distance provided by the present disclosure is completed based on the feature points of the first object in the image, and no longer depends on the accurate detection frame of the first object. Therefore, regardless of the type of object in front of the vehicle, regardless of the scene in which the vehicle is located, the longitudinal distance between the vehicle and the first object can be accurately determined by using the technical solution provided by the present disclosure, and the vehicle can accurately adjust the driving parameters based on the longitudinal distance, thereby reducing the safety risk.

[0080] Further, since the ranging result (the longitudinal distance between the vehicle and the first object) obtained by the ranging method provided by the embodiment of the present disclosure is more accurate, when the ranging result is used, it does not need to be calibrated to a large extent, because the final use process is also faster, and the response speed of the vehicle based on the ranging result to adjust the driving parameters is faster.

[0081] In some embodiments, the first physical distance can be smoothed by the second physical distance to obtain the third physical distance. Based on this, in combination with Figure 4 , referring to Figure 6 , S403 can include S4031 and S4032:

[0082] S4031, smoothing the first physical distance based on a second physical distance between second feature points of the first object in a second image collected by the vehicle at a second time.

[0083] In a first possible implementation, S4031 can include: performing constant value filtering on the second physical distance and the first physical distance to obtain the initial physical distance.

[0084] According to different constant value filters, different constant value filtering methods are used. If the constant value filter is an arithmetic mean filter (or mean filter), the initial physical distance obtained by performing constant value filtering on the second physical distance and the first physical distance is the average of the second physical distance and the first physical distance. For example, if there are five second physical distances, 4, 5, 6, 6, and 3, and the first physical distance is 5, the initial physical distance obtained by performing constant value filtering on the second physical distance and the first physical distance is 4.83.

[0085] In this way, the initial physical distance between the first feature points can be more accurate by constant value filtering. Subsequently, a more accurate longitudinal distance can be determined based on the more accurate physical distance between the first feature points.

[0086] In a second possible implementation, S4031 can include: determining the median or average of the second physical distance and the first physical distance as the initial physical distance.

[0087] Since the median or average can reflect the overall level of all data, the median or average of the second physical distance and the first physical distance can be considered as a more accurate initial physical distance between the first feature points.

[0088] In a third possible implementation, S4031 can include: calculating the mean and standard deviation of the second physical distance and the first physical distance; determining invalid physical distances in the second physical distance and the first physical distance that are greater than three times the standard deviation from the mean; and determining the average or median of the physical distances in the second physical distance and the first physical distance excluding the invalid physical distances as the initial physical distance.

[0089] In this way, based on the three-sigma (standard deviation) principle, the outliers in the second physical distance and the first physical distance can be removed, and the average or median of the remaining physical distances can be considered as a more accurate initial physical distance between the first feature points.

[0090] In a fourth possible implementation, S4031 can include: determining a mapping relationship between the physical distance and the image collection time based on the second physical distance, the first physical distance, the second time, and the first time; and determining the initial physical distance based on the mapping relationship.

[0091] The manner of determining the mapping relationship can be any possible data fitting manner (for example, linear fitting, curve fitting, etc.), and a fitting function capable of representing the mapping relationship between the image capture time and the physical distance is obtained. After obtaining the fitting function representing the mapping relationship, the first time can be substituted into the fitting function, and the initial physical distance can be obtained. Since the mapping relationship is fully considered how the physical distance calculated based on the pixel distance between the feature points changes in the plurality of images including the first object, the mapping relationship can well reflect the change of the physical distance calculated based on the pixel distance between the feature points over time. Therefore, based on the mapping relationship, a more accurate initial physical distance between the first feature points can be obtained.

[0092] The above several implementation manners are only examples, and the smoothing manner of the first physical distance based on the second physical distance can be any possible implementation manner, and the present disclosure does not make specific limitations thereto.

[0093] It should be noted that the second physical distance used in the embodiments of the present disclosure is also a physical distance smoothed by using the above smoothing manner.

[0094] S4032, determining a third physical distance based on the initial physical distance.

[0095] After obtaining the initial physical distance, a more accurate third physical distance between the first feature points of the first object in the first image can be determined based on the initial physical distance. For example, the initial physical distance is directly determined as the third physical distance, or the third physical distance is obtained after other processing of the initial physical distance.

[0096] Based on the technical solutions provided in the embodiments of the present disclosure, the smoothing of the first physical distance can be completed based on the second physical distance between the second feature points of the second object in the second image captured between the first images, and a more accurate third physical distance between the first feature points of the first object in the first image is obtained. Since in any case, even if the physical distance between the feature points obtained from a single image has errors, the physical distance between the feature points obtained from multiple images will fluctuate within a certain range of accurate physical distance between the feature points, so the physical distance between the feature points obtained from multiple images can determine a more accurate physical distance between the feature points. Therefore, by the above manner, an accurate third physical distance between the feature points of the first object in the first image can be obtained. Subsequently, based on the accurate third physical distance, the longitudinal distance between the vehicle and the first object at the first time can be accurately obtained. In this way, since the entire ranging scheme no longer depends on the accurate detection frame of the first object, the use scenario is more extensive, and the vehicle can also accurately adjust the driving parameters based on the determined longitudinal distance, thereby reducing the safety risk.

[0097] In some embodiments, although the smoothed initial physical distance is determined in S4031, it is uncertain whether the smoothed initial physical distance is stable in time sequence. A stable physical distance can further ensure accuracy. Therefore, it is further needed to combine the second physical distance of the first object in the historical image to further determine whether the initial physical distance is a physical distance stable in time sequence. Based on this, S4032 can include S701-S703, as shown in Figure 6 Figure 7 S4032 can include S701-S703, as shown in

[0098] S701, determining a first variance of the second physical distance and the initial physical distance.

[0099] Since the actual physical distance between the feature points of the first object will not change, if the dispersion degree of the second physical distance and the initial physical distance is small, it can be determined that the change in time sequence of the second physical distance and the initial physical distance is small. At this time, it can be considered that the initial physical distance is stable, further proving the accuracy. The initial physical distance can also be used as the third physical distance to calculate the longitudinal distance of the vehicle and the first object.

[0100] Based on this, when judging whether the initial physical distance is stable in time sequence, the first variance of the second physical distance and the initial physical distance can be calculated. After obtaining the first variance, it can be compared with the first preset variance.

[0101] If the first variance is less than the first preset variance, it indicates that the change in time sequence of the second physical distance and the initial physical distance is small, and the stability of the initial physical distance is sufficient. At this time, the initial physical distance can be determined as the third physical distance closest to the true physical distance between the first feature points, that is, S702 is executed.

[0102] If the first variance is greater than the first preset variance, it indicates that the change in time sequence of the second physical distance and the initial physical distance is large, and the stability of the initial physical distance is insufficient. At this time, the longitudinal distance cannot be determined based on the physical distance between the feature points, but can be determined based on the height of the detection frame, that is, S703 is executed.

[0103] It should be noted that the case where the first variance is equal to the first preset variance can be attributed to the case where the first variance is less than the first preset variance, or the case where the first variance is greater than the first preset variance. The present disclosure does not make specific limitations thereon, and the specific implementation is determined according to actual needs.

[0104] In addition, in addition to variance, standard deviation can also be used to represent the dispersion degree of the data sequence. Therefore, the above-mentioned first variance can also be a first standard deviation, and the first preset variance can also be a first preset standard deviation. ​

[0105] S702, in response to the first variance being less than the first preset variance, determining the initial physical distance as a third physical distance.

[0106] In some embodiments, if the stability of the second physical distance and the initial physical distance in time sequence is sufficient, and after the initial physical distance is determined as the third physical distance, the method provided in the foregoing embodiments can no longer be used to determine the physical distance between the feature points of the first object in the new image again. Within a certain time length, the third physical distance can be fixedly used as the physical distance between the feature points of the first object in the image (the feature points corresponding to the first feature points) to calculate the longitudinal distance between the vehicle and the first object. In this case, after the pixel distance between the feature points of the first object in the newly collected image is determined, the subsequent S404 of determining the longitudinal distance between the vehicle and the first object can be performed, thereby reducing the resource consumption of the entire ranging method.

[0107] Of course, in order to ensure that the third physical distance used when calculating the longitudinal distance is more accurate as much as possible, when a new image is collected, the ranging method provided in the embodiments of the present disclosure can also be completely performed. The present disclosure does not make specific limitations on the selection of the execution mode.

[0108] S703, in response to the first variance being greater than the first preset variance, determining the longitudinal distance between the vehicle and the first object at the first time based on the height of the first detection box of the first object in the first image, the focal length of the image collection device, and the height of the first object.

[0109] When the stability of the second physical distance and the initial physical distance does not meet the requirements, in order to prevent the downstream algorithm of the vehicle ranging method from being unable to obtain the longitudinal distance, the height of the first detection box of the first object in the first image, the focal length of the image collection device, and the height of the first object can be used to calculate the longitudinal distance between the vehicle and the first object at the first time. In this way, when the physical distance between each pair of first feature points cannot be guaranteed to be stable and accurate, the ranging result can also be obtained by the downstream algorithm after the ranging method, thereby smoothly running, so that the vehicle can normally perform assisted driving or intelligent driving.

[0110] Based on the technical solutions provided in the embodiments of the present disclosure, the stability of the second physical distance and the initial physical distance can be measured by variance, and then it can be determined whether to use the initial physical distance as the third physical distance. Specifically, in the case where the stability of the second physical distance and the initial physical distance meets the requirements, the initial physical distance can be used as the third physical distance. Then, the accurate longitudinal distance between the vehicle and the first object can be determined based on the third physical distance. In this way, since the entire ranging scheme no longer depends on the accurate detection box of the first object, the use scenario is more extensive, and the vehicle can also accurately adjust the driving parameters based on the determined longitudinal distance, thereby reducing the safety risk.

[0111] In some embodiments, after obtaining the third physical distance, the longitudinal distance between the vehicle and the first object corresponding to the third physical distance can be obtained based on the pinhole imaging principle. Further, since there are multiple third physical distances, there are also multiple longitudinal distances. In practice, the longitudinal distance between the vehicle and the first object should be smooth in time sequence, so if a certain longitudinal distance and its corresponding historical longitudinal distance change smoothly or stably in time sequence, it indicates that the longitudinal distance is probably stable and accurate. Therefore, the final longitudinal distance between the vehicle and the first object at the first time can be determined based on whether the longitudinal distance and its corresponding historical longitudinal distance are stable in time sequence. Wherein, the feature point pair corresponding to the longitudinal distance and the feature point pair corresponding to the historical longitudinal distance both correspond to the same three-dimensional point pair on the first object.

[0112] Based on the above content, combined with Figure 4 , referring to 8, S404 can include S4041-S4043:

[0113] S4041, based on the third physical distance, the first pixel distance, and the focal length of the image acquisition device of the vehicle, determine the first initial distance between the vehicle and the first object at the first time corresponding to the third physical distance.

[0114] In the embodiments of the present disclosure, the control device of the vehicle can use the formula (1) in the foregoing embodiments to calculate the first initial distance between the vehicle and the first object at the first time corresponding to the third physical distance based on the third physical distance, the first pixel distance, and the focal length of the image acquisition device of the vehicle.

[0115] S4042, determine the stability quantitative index of the second initial distance and the first initial distance.

[0116] Wherein, the second initial distance is the initial distance between the vehicle and the first object at the second time corresponding to the second physical distance. The second initial distance is the initial distance between the vehicle and the first object at the second time calculated based on the second physical distance using the ranging method provided by the embodiments of the present disclosure. The stability quantitative index is used to represent the degree of smooth change / stable change of the second initial distance and the first initial distance in time sequence.

[0117] In the embodiments of the present disclosure, since there are multiple third physical distances, there are also multiple first initial distances. S4042 can be performed for each first initial distance.

[0118] In the embodiments of the present disclosure, determining the stability quantitative index of the second initial distance and the first initial distance includes the following implementation manners:

[0119] In the first possible implementation, since the frame rate of the image acquisition device is high, the initial distance between the vehicle and the first object obtained based on multiple images close in time changes little in time sequence. The variance used to represent the dispersion degree of the data set can be used to represent the degree of change in time sequence of the second initial distance and the first initial distance. Based on this, the second variance of the second initial distance and the first initial distance can be determined as the stable quantitative indicator. In this way, the variance can be used as the stable quantitative indicator to measure whether the change in time sequence of the second initial distance and the first initial distance is stable. Then, a more accurate longitudinal distance between the vehicle and the first object at the first time can be determined based on the variance of the second initial distance and the first initial distance.

[0120] After obtaining the second variance corresponding to all the first initial distances, if the second variance corresponding to a certain first initial distance is the smallest, the first initial distance can be determined as the longitudinal distance between the vehicle and the first object at the first time, that is, S4043 is performed. In this implementation, the preset stability condition includes that the second variance as the stable quantitative indicator is the smallest.

[0121] In addition, in addition to the variance that can be used to represent the dispersion degree of the data sequence, the standard deviation can also be used to represent the dispersion degree of the data sequence. Therefore, the second variance described above can also be the second standard deviation.

[0122] In this way, by calculating the variance of the second initial distance and the first initial distance, whether the second initial distance and the first initial distance are stable in time sequence can be determined, and then a more accurate longitudinal distance between the vehicle and the first object at the first time can be determined.

[0123] In the second possible implementation, when the second initial distance and the first initial distance change stably in time sequence, the dispersion degree of the first-order difference in the distance sequence composed of the second initial distance and the first initial distance is relatively small. The first-order difference is the absolute value of the difference between two adjacent initial distances in the distance sequence. For example, if the distance sequence composed of the second initial distance and the first initial distance is [5, 4, 5, 6, 7], the first-order difference of the distance sequence is 1, 1, 1, 1 in turn. Therefore, the variance or the standard deviation of the first-order difference of the second initial distance and the first initial distance can be determined as the stable quantitative indicator.

[0124] After obtaining the second variance corresponding to all the first initial distances, if the variance of the first-order difference corresponding to a certain first initial distance is the smallest, the first initial distance can be determined as the longitudinal distance between the vehicle and the first object at the first time, that is, S4043 is performed. In this implementation, the preset stability condition includes that the variance of the first-order difference as the stable quantitative indicator is the smallest.

[0125] Of course, the above two implementations are only examples, and in actuality the stable quantization index can also be any other possible parameter, and the present disclosure does not make a specific limitation thereto.

[0126] S4043, in response to the stable quantization index satisfying a preset stable condition, determining the first initial distance as the longitudinal distance between the vehicle and the first object at the first time.

[0127] Based on the technical solutions provided by the embodiments of the present disclosure, after the first initial distance corresponding to the third physical distance is determined, the stable quantization index corresponding to the first initial distance can be determined based on the historical initial distance (i.e., the second initial distance) corresponding to the first initial distance. The stable quantization index can be used to represent the degree of smooth change / stable change in time sequence of the second initial distance and the first initial distance. Therefore, based on the stable quantization index corresponding to the first initial distance, the most stable first initial distance can be determined and used as the longitudinal distance between the vehicle and the first object at the first time. Since the multiple initial distances (e.g., the first initial distance and the second initial distance) corresponding to the feature point pair are more stable in time sequence, the latest initial distance is more accurate. Therefore, the above-mentioned method can obtain the most accurate longitudinal distance between the vehicle and the first object at the first time, so that the vehicle can accurately adjust the driving parameters based on the longitudinal distance, thereby reducing the safety risk.

[0128] Exemplary device

[0129] Figure 9 is a schematic diagram of the composition structure of the distance measuring device provided by an exemplary embodiment of the present disclosure, as Figure 9 shown, the distance measuring device can include:

[0130] The first determination module 901 is configured to determine a first feature point of a first object in a first image collected by a vehicle at a first time.

[0131] The second determination module 902 is configured to determine a first physical distance between the first feature points based on a first pixel distance between the first feature points determined by the first determination module 901.

[0132] The third determination module 903 is configured to determine a third physical distance between the first feature points based on a second physical distance between second feature points of the first object in a second image collected by the vehicle at a second time and the first physical distance determined by the second determination module 902; the second time is before the first time.

[0133] The processing module 904 is configured to determine a longitudinal distance between the vehicle and the first object at the first time based on the third physical distance determined by the third determination module 903, the first pixel distance, and a focal length of an image collection device of the vehicle.

[0134] In some embodiments, the first determination module 901 is specifically used to: perform optical flow tracking on the third feature point of the first object in the third image captured by the vehicle at the third moment to obtain the first feature point of the first object in the first image; the third moment is before the first moment.

[0135] In some embodiments, the second determination module 902 is specifically configured to determine a first physical distance between the first feature points based on a first pixel distance between the first feature points, a height of a first detection frame of the first object in the first image, and a height of the first object.

[0136] In some embodiments, combined Figure 9 , refer to Figure 10 As shown, the third determination module 903 may include a smoothing submodule 9031 and a determination submodule 9032. The smoothing submodule 9031 is configured to smooth the first physical distance based on the second physical distance to obtain an initial physical distance; and the determination submodule 9032 is configured to determine the third physical distance based on the initial physical distance determined by the smoothing submodule 9031.

[0137] In some embodiments, the smoothing submodule 9031 is specifically configured to perform constant filtering on the second physical distance and the first physical distance to obtain an initial physical distance.

[0138] In some embodiments, the determination submodule 9032 includes: a first unit for determining a first variance between the second physical distance and the initial physical distance; and a second unit for determining the initial physical distance as a third physical distance in response to the first variance being less than a first preset variance.

[0139] In some embodiments, combined Figure 9 , refer to Figure 10 As shown, the processing module 904 may include:

[0140] A first submodule 9041 is configured to determine a first initial distance between the vehicle and the first object at a first moment corresponding to the third physical distance based on the third physical distance, the first pixel distance, and a focal length of the image acquisition device of the vehicle;

[0141] The second submodule 9042 is configured to determine a stability quantitative index of the second initial distance and the first initial distance determined by the first submodule 9041; the second initial distance is the initial distance between the vehicle and the first object at the second moment corresponding to the second physical distance;

[0142] The third submodule 9043 is configured to determine the first initial distance as the longitudinal distance between the vehicle and the first object at the first moment in response to the stability quantitative index determined by the second submodule 9042 satisfying a preset stability condition.

[0143] In some embodiments, the second sub-module 9042 is specifically configured to determine the second variance of the second initial distance and the first initial distance as the stable quantization indicator.

[0144] In some embodiments, the second unit is further configured to: in response to the first variance being greater than the first preset variance, determine the longitudinal distance between the vehicle and the first object at the first time based on a height of the first detection frame of the first object in the first image, a focal length of the image acquisition device, and a height of the first object.

[0145] It should be noted that the above description of the device example embodiments is similar to the description of the above method example embodiments, and has the same beneficial effects as the method example embodiments. For technical details not disclosed in the device example embodiments of the present disclosure and the corresponding beneficial technical effects, please refer to the description of the method example embodiments of the present disclosure, which will not be described here.

[0146] An example electronic device

[0147] Figure 10 A structural diagram of an electronic device provided by an embodiment of the present disclosure includes at least one processor 101 and a memory 102 for storing processor-executable instructions.

[0148] The processor 101 can be a central processing unit (CPU) or other forms of processing units having data processing and / or instruction execution capabilities, and can control other components in the electronic device to perform desired functions.

[0149] The memory 102 can include one or more computer program products, which can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may, for example, include random access memory (RAM), cache memory, and / or the like. Non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, and / or the like. One or more computer program instructions can be stored on the computer-readable storage medium, and the processor 101 can run the one or more computer program instructions to implement the ranging method and / or other desired functions of various embodiments of the present disclosure described above.

[0150] In one example, the electronic device can further include an input device 103 and an output device 104, which are interconnected through a bus system and / or other forms of connection mechanism (not shown).

[0151] The input device 103 can further include, for example, a keyboard, a mouse, a touch screen, and / or the like.

[0152] The output device 104 can externally output various information, which can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0153] Of course, in order to simplify, Figure 10 Only some of the components of the electronic device related to the present disclosure are shown in the middle, and components such as buses, input / output interfaces, and the like are omitted. In addition, the electronic device can further include any other appropriate components according to a specific application.

[0154] Exemplary computer program product and computer readable storage medium

[0155] In addition to the above-mentioned method and device, embodiments of the present disclosure can also provide a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the steps of the ranging method of various embodiments of the present disclosure described in the "Exemplary Method" section above.

[0156] The computer program product can be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, C++, and the like, and conventional procedural programming languages, such as the "C" programming language, or the like. The program code can execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.

[0157] In addition, embodiments of the present disclosure can also be a computer readable storage medium having stored thereon computer program instructions, which, when executed by a processor, cause the processor to perform the steps of the ranging method of various embodiments of the present disclosure described in the "Exemplary Method" section above.

[0158] The computer readable storage medium can take any combination of one or more of the readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium, for example, but not limited to, includes an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination of the above.

[0159] The basic principles of the present disclosure are described above with reference to specific embodiments, but the advantages, benefits and effects mentioned in the present disclosure are only examples and are not considered to be mandatory for each embodiment of the present disclosure. In addition, the specific details of the above disclosure are only for the purpose of illustration and understanding, and are not considered to limit the present disclosure to the above specific details. It is necessary to implement the present disclosure.

[0160] Various modifications and changes can be made to the present disclosure by those skilled in the art without departing from the spirit and scope of the present application. Thus, it is intended that the present disclosure include all such modifications and changes as fall within the scope of the claims of the present disclosure and their equivalents.

Claims

1. A ranging method, comprising: Determining a first feature point of a first object in a first image captured by the vehicle at a first moment; determining a first physical distance between the first feature points based on a first pixel distance between the first feature points; determining a third physical distance between the first feature points based on a second physical distance between second feature points of the first object in a second image captured by the vehicle at a second moment, and the first physical distance, wherein the second moment is before the first moment; A longitudinal distance between the vehicle and the first object at the first moment is determined based on the third physical distance, the first pixel distance, and a focal length of an image acquisition device of the vehicle.

2. The method according to claim 1, wherein The determining of a first feature point of a first object in a first image captured by the vehicle at a first moment includes: Optical flow tracking is performed on a third feature point of the first object in a third image captured by the vehicle at a third moment to obtain a first feature point of the first object in the first image; the third moment is before the first moment.

3. The method according to claim 1, wherein The determining the first physical distance between the first feature points based on the first pixel distance between the first feature points includes: A first physical distance between the first feature points is determined based on a first pixel distance between the first feature points, a height of a first detection frame of the first object in the first image, and a height of the first object.

4. The method according to claim 1, wherein The determining, based on the second physical distance between the second feature points of the first object in the second image captured by the vehicle at the second moment and the first physical distance, a third physical distance between the first feature points includes: Smoothing the first physical distance based on the second physical distance to obtain an initial physical distance; Based on the initial physical distance, a third physical distance is determined.

5. The method according to claim 4, wherein The smoothing the first physical distance based on the second physical distance to obtain the initial physical distance includes: Perform constant filtering on the second physical distance and the first physical distance to obtain the initial physical distance.

6. The method according to claim 4, wherein: The determining, based on the initial physical distance, a third physical distance includes: determining a first variance between the second physical distance and the initial physical distance; In response to the first variance being smaller than a first preset variance, the initial physical distance is determined as the third physical distance.

7. The method according to claim 1, wherein Determining the longitudinal distance between the vehicle and the first object at the first moment based on the third physical distance, the first pixel distance, and a focal length of an image acquisition device of the vehicle includes: determining, based on the third physical distance, the first pixel distance, and a focal length of an image acquisition device of the vehicle, a first initial distance between the vehicle and the first object at the first moment corresponding to the third physical distance; Determining a stable quantitative index of a second initial distance and the first initial distance; wherein the second initial distance is an initial distance between the vehicle and the first object at the second moment corresponding to the second physical distance; In response to the stability quantitative index satisfying a preset stability condition, the first initial distance is determined as the longitudinal distance between the vehicle and the first object at the first moment.

8. The method according to claim 7, wherein: The determining of the stable quantitative index of the second initial distance and the first initial distance includes: A second variance between the second initial distance and the first initial distance is determined as the stable quantitative indicator.

9. The method according to claim 6, wherein: The method further comprises: In response to the first variance being greater than a first preset variance, the longitudinal distance between the vehicle and the first object at the first moment is determined based on the height of the first detection frame of the first object in the first image, the focal length of the image acquisition device, and the height of the first object.

10. A distance measuring device, comprising: A first determining module, configured to determine a first feature point of a first object in a first image captured by the vehicle at a first moment; a second determining module, configured to determine a first physical distance between the first feature points based on the first pixel distance between the first feature points determined by the first determining module; a third determining module, configured to determine a third physical distance between the first feature points based on a second physical distance between second feature points of the first object in a second image captured by the vehicle at a second moment and the first physical distance determined by the second determining module, wherein the second moment is before the first moment; A processing module is used to determine the longitudinal distance between the vehicle and the first object at the first moment based on the third physical distance determined by the third determination module, the first pixel distance and the focal length of the image acquisition device of the vehicle.

11. A computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the ranging method according to any one of claims 1 to 9.

12. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the ranging method described in any one of claims 1 to 9.