Vehicle ranging method and system

Through the on-board camera, the lane line is detected and the pitch angle compensation is calculated, the problem of inaccurate distance measurement when monocular visual distance measurement changes, and real-time accurate distance measurement between the vehicle and the target obstacle is achieved.

CN113866783BActive Publication Date: 2025-05-23HANGZHOU HOPECHART
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111062043.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-10
Publication Date
2025-05-23
Estimated Expiration
2041-09-10

AI Technical Summary

Technical Problem

In the prior art, monocular visual distance measurement is used to inaccurate distance measurement when the angle changes between the road and the calibration plane, especially when the road is bumpy, slope, etc., resulting in inaccurate distance measurement.

Method used

Real-time images are collected by the on-board camera, and the target obstacles and lane lines in the image are detected. The pitch angle compensation amount of the on-board camera is obtained based on the detected lane lines, and the distance between the vehicle and the target obstacle is determined.

Benefits of technology

The problem of inaccurate distance measurement when the angle of monocular visual distance measurement changes between the road and the calibration plane is solved, and real-time accurate distance measurement between the vehicle and the target obstacle in front of the vehicle is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113866783B_ABST
    Figure CN113866783B_ABST
Patent Text Reader

Abstract

The present invention provides a vehicle distance measurement method and system, the method comprising: obtaining a real-time image captured by a vehicle-mounted camera, and detecting a target obstacle and lane line in front of the vehicle in the real-time image; obtaining a pitch angle compensation amount of the vehicle-mounted camera according to the detected lane line; and determining the distance between the vehicle and the target obstacle according to the pitch angle compensation amount. The system executes the method. Based on the real-time image captured by the vehicle-mounted camera, the present invention detects the target obstacle and lane line in the image, and compensates for the pitch angle of the vehicle-mounted camera based on the detected lane line, thereby solving the problem of inaccurate distance measurement when the angle between the road and the calibration plane changes in the prior art using monocular vision distance measurement, and realizing real-time distance measurement between the vehicle and the target obstacle in front of the vehicle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a vehicle ranging method and system. Background Art

[0002] In autonomous driving or advanced assisted driving, road traffic safety is particularly important. Distance measurement is an important means to judge obstacles in front of the vehicle. The accuracy of distance measurement is of great significance to vehicle collision warning, driver judgment and decision-making, and distance maintenance. Therefore, a high-precision distance measurement technology is imperative.

[0003] There are many methods for measuring vehicle distance, such as monocular vision, binocular vision, ultrasonic radar, millimeter wave radar, and lidar. Binocular vision is not very practical due to the large amount of calculation and difficulty in binocular registration. Ultrasonic radar is suitable for short-distance measurement. Millimeter wave radar is expensive and not intuitive. Lidar is more expensive and consumes a lot of computing resources. Monocular vision is low-cost, fast, simple, and intuitive, so it is widely used.

[0004] However, the general monocular vision distance measurement accuracy is not high enough, especially when the road is bumpy or sloped, which will cause inaccurate distance measurement. Therefore, how to accurately measure the distance between the vehicle and the target in front of the vehicle in real time without adding auxiliary sensors is an urgent problem to be solved. Summary of the invention

[0005] The vehicle distance measurement method and system provided by the present invention are used to solve the above-mentioned problems existing in the prior art. Based on the real-time image collected by the on-board camera, the target obstacle and lane line in the image are detected, and the pitch angle of the on-board camera is compensated based on the detected lane line. The problem of inaccurate distance measurement when the angle between the road and the calibration plane changes when using monocular vision distance measurement in the prior art is solved, and the real-time distance measurement between the vehicle and the target obstacle in front of the vehicle is realized.

[0006] The present invention provides a vehicle ranging method, comprising:

[0007] Acquire a real-time image captured by a vehicle-mounted camera, and detect target obstacles and lane lines in front of the vehicle in the real-time image;

[0008] Acquiring a pitch angle compensation amount of the vehicle-mounted camera according to the detected lane line;

[0009] The distance between the vehicle and the target obstacle is determined according to the pitch angle compensation amount.

[0010] According to a vehicle ranging method provided by the present invention, the installation parameters of the vehicle-mounted camera are determined in the following manner:

[0011] Calibrate the internal parameters of the vehicle-mounted camera based on a preset calibration method;

[0012] Determining the installation parameters according to the calibrated internal parameters and the external parameters of the vehicle-mounted camera;

[0013] Wherein, the internal parameters include the focal length and principal point coordinates of the vehicle-mounted camera;

[0014] The external parameters include the installation height and pitch angle of the vehicle-mounted camera.

[0015] According to a vehicle ranging method provided by the present invention, obtaining the pitch angle compensation amount of the vehicle-mounted camera according to the detected lane line includes:

[0016] Determine the angle between the lane line and a preset reference line according to the detected position coordinates of the lane line;

[0017] Obtaining the pitch angle compensation amount according to the included angle, lane width, principal point longitudinal coordinates, and the focal length of the vehicle-mounted camera relative to a unit pixel in the vertical direction;

[0018] Wherein, the principal point longitudinal coordinate is determined according to the principal point coordinate.

[0019] According to a vehicle distance measurement method provided by the present invention, determining the distance between the vehicle and the target obstacle according to the pitch angle compensation amount includes:

[0020] Determine the longitudinal distance between the vehicle and the target obstacle according to the pitch angle compensation amount, the installation height, the focal length of the vehicle-mounted camera relative to the unit pixel in the vertical direction, the longitudinal coordinate of the principal point and the longitudinal coordinate of the target obstacle on the real-time image;

[0021] Determine the lateral distance between the vehicle and the target obstacle according to the lateral coordinates of the principal point, the lateral coordinates of the target obstacle on the real-time image, the focal length of the vehicle-mounted camera relative to the unit pixel in the horizontal direction, and the longitudinal distance;

[0022] Determining the distance between the vehicle and the target obstacle according to the longitudinal distance and the lateral distance;

[0023] Wherein, the transverse coordinate of the principal point is determined according to the coordinate of the principal point.

[0024] According to a vehicle ranging method provided by the present invention, the lateral coordinate and the longitudinal coordinate of the target obstacle on the real-time image are determined in the following manner:

[0025] Detecting the target obstacle in front of the vehicle in the real-time image based on the target detection algorithm to obtain a target detection frame;

[0026] Determining the position of the target obstacle in the real-time image according to the center position of the lower boundary of the target detection frame;

[0027] According to the position of the target obstacle in the real-time image, the horizontal coordinate and the vertical coordinate of the target obstacle in the real-time image are determined respectively.

[0028] The present invention also provides a vehicle ranging system, comprising:

[0029] Target detection module, data acquisition module and distance measurement module;

[0030] The target detection module is used to obtain the real-time image collected by the vehicle camera and detect the target obstacles and lane lines in front of the vehicle in the real-time image;

[0031] The data acquisition module is used to acquire the pitch angle compensation value of the vehicle-mounted camera according to the detected lane line;

[0032] The distance measurement module is used to determine the distance between the vehicle and the target obstacle according to the pitch angle compensation amount.

[0033] A vehicle ranging system provided according to the present invention also includes:

[0034] A parameter acquisition module, used to calibrate the internal parameters of the vehicle-mounted camera based on a preset calibration method;

[0035] Determining installation parameters of the vehicle-mounted camera according to the calibrated internal parameters and the external parameters of the vehicle-mounted camera;

[0036] Wherein, the internal parameters include the focal length and principal point coordinates of the vehicle-mounted camera;

[0037] The external parameters include the installation height and pitch angle of the vehicle-mounted camera.

[0038] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned vehicle distance measurement methods are implemented.

[0039] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned vehicle distance measurement methods are implemented.

[0040] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned distance measurement methods are implemented.

[0041] The vehicle distance measurement method and system provided by the present invention detect target obstacles and lane lines in the real-time image collected by the vehicle-mounted camera, and compensate the pitch angle of the vehicle-mounted camera based on the detected lane lines, thereby solving the problem of inaccurate distance measurement when the angle between the road and the calibration plane changes when using monocular vision distance measurement in the prior art, and realizing real-time distance measurement between the vehicle and the target obstacle in front of the vehicle. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 It is a schematic diagram of the process of the vehicle ranging method provided by the present invention;

[0044] Figure 2 It is a schematic diagram of the target detection frame and lane lines provided by the present invention;

[0045] Figure 3 It is a schematic diagram of lane lines under different camera angles provided by the present invention;

[0046] Figure 4 It is a structural schematic diagram of the vehicle ranging system provided by the present invention;

[0047] Figure 5 It is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] The vehicle ranging method provided by the present invention is implemented on the basis of a monocular vision ranging method based on lane line compensation, which can solve the problem of inaccurate ranging of monocular vision in the prior art when the angle between the road and the calibration plane changes, and has low cost, fast calculation speed and strong practicality.

[0050] Calibrate the internal and external parameters of the vehicle camera, including the focal length, principal point coordinates, installation height and pitch angle of the vehicle camera; obtain the real-time image collected by the vehicle camera; use the vision-based target detection algorithm to detect the target obstacles in front of the vehicle, including vehicles, pedestrians or non-motor vehicles; use the vision-based lane line detection algorithm to detect the lane line on the road in front of the vehicle; use the angle between the lane line and the horizontal line to calculate the pitch angle compensation of the vehicle camera; and determine the distance between the vehicle and the target obstacle based on the pitch angle compensation. The specific implementation is as follows:

[0051] Figure 1 It is a flow chart of the vehicle ranging method provided by the present invention, such as Figure 1 As shown, the method includes:

[0052] S1. Obtain a real-time image captured by a vehicle-mounted camera, and detect target obstacles and lane lines in front of the vehicle in the real-time image;

[0053] S2. Obtaining a pitch angle compensation value of the vehicle camera according to the detected lane line;

[0054] S3. Determine the distance between the vehicle and the target obstacle according to the pitch angle compensation amount.

[0055] It should be noted that the execution subject of the above method can be an electronic device, a component in an electronic device, an integrated circuit, or a chip. The electronic device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the present invention does not make specific limitations.

[0056] Optionally, based on the real-time image of the road ahead of the vehicle captured by a camera installed on the vehicle, a conventional image processing algorithm or an image detection algorithm based on deep learning, such as a target detection algorithm, can be used to detect the acquired real-time image to identify the target obstacle ahead of the vehicle, wherein the target obstacle can specifically include a vehicle, a pedestrian or a non-motor vehicle. The vehicle-mounted camera can be a monocular camera.

[0057] For example, the target detection algorithm can be a pre-trained single-stage multi-target detector model (Single Shot MultiBox Detector, SSD) or an end-to-end target detection model, wherein the end-to-end target detection model can specifically include a pre-trained YOLO (You Only Look Once) and other models. It should be noted that the target detection algorithm provided by the present invention is not limited to the above-listed algorithms.

[0058] The real-time image is detected based on a visual lane line detection algorithm to identify the lane lines on the road ahead of the vehicle. For example, the image segmentation network LaneNet and SCNN (Spatial Convolutional Neural Network) can be used to detect the lane lines. It should be noted that the lane line detection algorithm provided by the present invention is not limited to the above-listed algorithms.

[0059] According to the detected lane line, the pitch angle compensation of the vehicle camera is calculated, and the distance between the vehicle and the target obstacle is calculated by using the ranging algorithm and the pitch angle compensation.

[0060] The vehicle distance measurement method provided by the present invention detects target obstacles and lane lines in the real-time image collected by the on-board camera, and compensates the pitch angle of the on-board camera based on the detected lane lines, thereby solving the problem of inaccurate distance measurement when the angle between the road and the calibration plane changes when using monocular vision distance measurement in the prior art, and realizing real-time distance measurement between the vehicle and the target obstacle in front of the vehicle.

[0061] Furthermore, in one embodiment, the installation parameters of the vehicle-mounted camera are determined in the following manner:

[0062] Calibrate the internal parameters of the vehicle camera based on the preset calibration method;

[0063] Determine the installation parameters based on the calibrated internal parameters and the external parameters of the vehicle camera;

[0064] Among them, the internal parameters include the focal length and principal point coordinates of the vehicle-mounted camera;

[0065] External parameters include the installation height and pitch angle of the vehicle-mounted camera.

[0066] Optionally, calibrate the internal and external parameters of the vehicle-mounted camera, including the focal length, principal point coordinates, installation height, and pitch angle of the camera;

[0067] Specifically, existing calibration methods such as Zhang Zhengyou's chessboard calibration method or Kruppa-based self-calibration method can be used to calibrate the internal parameters of the vehicle-mounted camera. The internal parameters include: camera focal length fx 、f y , the principal point coordinates (c x , c y ). Use a ruler to measure the installation height h of the camera, use a gyroscope to measure the pitch angle θ of the camera, and adjust the pitch angle of the camera to make it zero.

[0068] Based on the above calibration method, the intrinsic parameter matrix of the camera is obtained as follows: Among them, f x 、f y are the focal lengths of the camera relative to the unit pixel in the horizontal and vertical directions, c x 、c y They are the horizontal coordinates and the vertical coordinates of the principal point respectively.

[0069] The vehicle ranging method provided by the present invention completes the installation of the camera based on the calibrated internal and external parameters of the camera, and then uses the real-time image collected by the installed camera to measure the distance between the vehicle and the target obstacle. The ranging method has low ranging cost, low computing resource consumption, simple installation, intuitive effect and strong practicality.

[0070] Furthermore, in one embodiment, step S2 may specifically include:

[0071] S21, determining the angle between the lane line and a preset reference line according to the position coordinates of the detected lane line;

[0072] S22, obtaining a pitch angle compensation amount according to the included angle, lane width, longitudinal coordinates of the principal point, and the focal length of the vehicle-mounted camera relative to a unit pixel in the vertical direction;

[0073] Among them, the longitudinal coordinate of the principal point is determined according to the coordinate of the principal point.

[0074] Optionally, a vision-based lane detection algorithm (such as LaneNet and SCNN) is used to detect all lanes in front of the vehicle, where there are at least two lanes, to obtain specific position coordinates of the lanes, and to calculate the camera pitch angle compensation amount according to the lane position coordinates, specifically:

[0075] Select two lane lines on the left and right sides of the vehicle in front of the detected lane lines, such as Figure 2 As shown in AO and BO in the figure, the two lane lines are compared to the vanishing point O, EF is the skyline position, and the collected real-time image area is divided into two. Point O is on EF, and the coordinates of point O are the main point coordinates (c x , c y). The distance AB between the two lane lines at the lower boundary of the real-time image is determined by the camera installation height and the actual width of the lane. So when the camera installation height is determined, AB is determined by the actual width of the lane. When the camera installation height is higher, the AB value is smaller, and when the camera installation height is lower, the AB value is larger. When the lane is narrower, the AB value is smaller, and when the lane is wider, the AB value is larger. On different roads, the actual lane width will be slightly different, so AB∈(0,CD].

[0076] It should be noted that the intersection points A and B of the lane line and the boundary of the real-time image do not necessarily appear at the lower boundary of the image, but may also appear on the left and right boundaries of the image.

[0077] like Figure 3 As shown in the figure, when the camera is facing forward horizontally, that is, when the pitch angle θ=0, point O is on the skyline EF; when the camera is facing upward, that is, when the pitch angle θ>0, point O is below the skyline EF; when the camera is facing downward, that is, when the pitch angle θ<0, point O is above the skyline EF. Therefore, the pitch angle compensation of the camera can be calculated according to the angle α between the lane line and the preset reference line (such as the horizontal line).

[0078] Specifically, after the position of the lane line is detected, the camera pitch angle compensation β can be calculated according to the angle α between the lane line and a preset reference line such as a horizontal line:

[0079]

[0080] Among them, c y is the longitudinal coordinate of the principal point, w is the pixel distance between AB, and f y is the focal length of the camera relative to the unit pixel in the vertical direction, and α is the angle between the lane line and the horizontal line.

[0081] The β∈(0,90°). When the pitch angle θ=0, the pitch angle compensation β=0; when the pitch angle θ>0, that is, when the camera is facing upward, the pitch angle compensation β<0. If the pitch angle compensation is not considered, the calculated target distance is closer than the actual distance, resulting in a ranging error; when the pitch angle θ<0, that is, when the camera is facing downward, the pitch angle compensation β>0. If the pitch angle compensation is not considered, the calculated target distance is farther than the actual distance, resulting in a ranging error.

[0082] It should be noted that the angle between the above-mentioned lane line and the preset reference line is not necessarily the angle between the lane line and the horizontal line. Other angles may also be used, such as the angle between two lane lines, the angle between the lane line and the vertical line, etc. If it is other angles, the calculation formula for the camera pitch angle compensation amount needs to be modified accordingly.

[0083] The vehicle ranging method provided by the present invention uses lane lines to calculate the pitch angle compensation of the vehicle-mounted camera, thereby compensating for the ranging error of the monocular vision, which can effectively improve the accuracy and stability of ranging, and solves the problem of inaccurate ranging caused by changes in the initial position of the camera due to structural stress or unstable installation during use. It is of great significance to vehicle collision warning, driver judgment and decision-making, and vehicle distance maintenance.

[0084] Furthermore, in one embodiment, step S3 may specifically include:

[0085] S31, determining the longitudinal distance between the vehicle and the target obstacle according to the pitch angle compensation amount, the installation height, the focal length of the vehicle-mounted camera relative to the unit pixel in the vertical direction, the longitudinal coordinates of the principal point, and the longitudinal coordinates of the target obstacle in the real-time image;

[0086] S32, determining the lateral distance between the vehicle and the target obstacle according to the lateral coordinates of the principal point, the lateral coordinates of the target obstacle on the real-time image, the focal length of the vehicle-mounted camera relative to the unit pixel in the horizontal direction, and the longitudinal distance;

[0087] S33, determining the distance between the vehicle and the target obstacle according to the longitudinal distance and the lateral distance;

[0088] Among them, the lateral coordinates of the principal point are determined according to the coordinates of the principal point.

[0089] Furthermore, in one embodiment, the lateral coordinate and the longitudinal coordinate of the target obstacle on the real-time image are determined in the following manner:

[0090] Detect the target obstacle in front of the vehicle in the real-time image based on the target detection algorithm to obtain the target detection frame;

[0091] According to the center position of the lower boundary of the target detection frame, the position of the target obstacle in the real-time image is determined;

[0092] According to the position of the target obstacle in the real-time image, the horizontal coordinate and the vertical coordinate of the target obstacle on the real-time image are determined respectively.

[0093] Optionally, a visual-based target detection algorithm is used to detect the target obstacle in front of the vehicle, and a target detection frame is obtained, and the center position of the lower boundary of the target detection frame of the target obstacle is selected as the key point (the position is as follows Figure 2 ), determine the position of the target obstacle in the real-time image, and determine the horizontal coordinate and the vertical coordinate of the target obstacle on the real-time image according to the position of the target obstacle in the real-time image.

[0094] According to the obtained angle α between the lane line and the horizontal line and the calibrated camera internal parameter fy , c y , substitute the distance w between the endpoints of the two lane lines on the image into the formula Calculate the camera's pitch angle compensation.

[0095] According to the calculated pitch angle compensation β, installation height h, and the focal length f of the vehicle camera relative to the unit pixel in the vertical direction y , the principal point longitudinal coordinate c y and the longitudinal coordinate p of the target obstacle on the real-time image y , the longitudinal distance d1 between the vehicle and the target obstacle is calculated based on the following formula:

[0096]

[0097] According to the transverse coordinate c of the principal point x , the lateral coordinate p of the target obstacle on the real-time image x , the focal length f of the vehicle camera relative to the unit pixel in the horizontal direction x The lateral distance d2 between the vehicle and the target obstacle is calculated by the following formula:

[0098]

[0099] According to the calculated longitudinal distance d1 and lateral distance d2, the distance d between the vehicle and the target obstacle is calculated based on the following formula.

[0100]

[0101] The vehicle distance measurement method provided by the present invention uses lane lines to calculate the pitch angle compensation amount of the vehicle-mounted camera and the installation parameters of the camera, and respectively calculates the longitudinal distance and the lateral distance between the vehicle and the target obstacle, and then obtains the distance between the vehicle and the target obstacle based on the calculated longitudinal distance and the lateral distance. The calculation method is simple, and solves the problem of inaccurate distance measurement caused by changes in the initial position of the camera due to structural stress or unstable installation during use.

[0102] The vehicle distance measurement system provided by the present invention is described below. The vehicle distance measurement system described below and the vehicle distance measurement method described above can be referred to each other.

[0103] Figure 4 Schematic diagram of the structure of the vehicle distance measurement system provided by the present invention. Figure 4 As shown, it includes: a target detection module 410, a data acquisition module 411 and a distance measurement module 412;

[0104] The target detection module is used to obtain the real-time image collected by the vehicle camera and detect the target obstacles and lane lines in front of the vehicle in the real-time image;

[0105] The data acquisition module 411 is used to obtain the pitch angle compensation value of the vehicle-mounted camera according to the detected lane line;

[0106] The distance measurement module 412 is used to determine the distance between the vehicle and the target obstacle according to the pitch angle compensation amount.

[0107] The vehicle distance measurement system provided by the present invention detects target obstacles and lane lines in the real-time image collected by the vehicle-mounted camera, and compensates the pitch angle of the vehicle-mounted camera based on the detected lane lines, thereby solving the problem of inaccurate distance measurement when the angle between the road and the calibration plane changes when using monocular vision distance measurement in the prior art, and realizing real-time distance measurement between the vehicle and the target obstacle in front of the vehicle.

[0108] Furthermore, in one embodiment, the vehicle distance measurement system may further specifically include:

[0109] The parameter acquisition module 413 is used to calibrate the internal parameters of the vehicle-mounted camera based on a preset calibration method;

[0110] Determine the installation parameters of the vehicle camera based on the calibrated internal parameters and the external parameters of the vehicle camera;

[0111] Among them, the internal parameters include the focal length and principal point coordinates of the vehicle-mounted camera;

[0112] External parameters include the installation height and pitch angle of the vehicle-mounted camera.

[0113] The vehicle distance measurement system provided by the present invention completes the installation of the camera based on the calibrated internal and external parameters of the camera, and then uses the real-time image collected by the installed camera to measure the distance between the vehicle and the target obstacle. The distance measurement cost is low, the computing resource consumption is low, the installation is simple, the effect is intuitive, and the practicability is strong.

[0114] Figure 5 is a schematic diagram of the physical structure of an electronic device provided by the present invention, such as Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 511, a memory 512 and a bus 513, wherein the processor 510, the communication interface 511 and the memory 512 communicate with each other through the bus 513. The processor 510 may call the logic instructions in the memory 512 to execute the following method:

[0115] Obtain the real-time image captured by the vehicle camera, and detect the target obstacles and lane lines in front of the vehicle in the real-time image;

[0116] According to the detected lane line, obtain the pitch angle compensation of the vehicle camera;

[0117] The distance between the vehicle and the target obstacle is determined according to the pitch angle compensation amount.

[0118] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer power screen (which can be a personal computer, a server, or a network power screen, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0119] Furthermore, the present invention discloses a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer can execute the vehicle ranging method provided by the above-mentioned method embodiments, for example, comprising:

[0120] Obtain the real-time image captured by the vehicle camera, and detect the target obstacles and lane lines in front of the vehicle in the real-time image;

[0121] According to the detected lane line, obtain the pitch angle compensation of the vehicle camera;

[0122] The distance between the vehicle and the target obstacle is determined according to the pitch angle compensation amount.

[0123] On the other hand, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the vehicle ranging method provided in the above embodiments, for example, including:

[0124] Obtain the real-time image captured by the vehicle camera, and detect the target obstacles and lane lines in front of the vehicle in the real-time image;

[0125] According to the detected lane line, obtain the pitch angle compensation of the vehicle camera;

[0126] The distance between the vehicle and the target obstacle is determined according to the pitch angle compensation amount.

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

[0128] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer power screen (which can be a personal computer, a server, or a network power screen, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0129] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A vehicle ranging method, It is characterized in that include: Acquire a real-time image captured by a vehicle-mounted camera, and detect target obstacles and lane lines in front of the vehicle in the real-time image; Acquiring a pitch angle compensation amount of the vehicle-mounted camera according to the detected lane line; determining the distance between the vehicle and the target obstacle according to the pitch angle compensation amount; The step of obtaining a pitch angle compensation amount of the vehicle-mounted camera according to the detected lane line includes: Determine the angle between the lane line and a preset reference line according to the detected position coordinates of the lane line; the preset reference line is a line between intersection points A and B of the lane line and the boundary of the real-time image; Obtaining the pitch angle compensation amount according to the included angle, lane width, principal point longitudinal coordinates, and the focal length of the vehicle-mounted camera relative to a unit pixel in the vertical direction; Wherein, the principal point longitudinal coordinate is determined according to the principal point coordinate; The camera pitch angle compensation β is calculated by the following formula: Among them, c y is the vertical coordinate of the principal point, w is the pixel distance between A and B, and f y is the focal length of the camera relative to the unit pixel in the vertical direction, α is the angle between the lane line and the preset reference line; β∈(0, ); When the pitch angle θ=0, the pitch angle compensation β=0; when the pitch angle θ>0, that is, when the camera is facing upward, the pitch angle compensation β<0; when the pitch angle θ<0, that is, when the camera is facing downward, the pitch angle compensation β>0; The step of determining the distance between the vehicle and the target obstacle according to the pitch angle compensation amount includes: Determine the longitudinal distance between the vehicle and the target obstacle according to the pitch angle compensation amount, the installation height, the focal length of the vehicle-mounted camera relative to the unit pixel in the vertical direction, the longitudinal coordinate of the principal point and the longitudinal coordinate of the target obstacle on the real-time image; Specifically, the longitudinal distance is calculated by the following formula: Where d1 is the longitudinal distance, β is the pitch angle compensation, h is the installation height, and f y is the focal length of the vehicle camera relative to the unit pixel in the vertical direction, c y is the longitudinal coordinate of the principal point, p y is the longitudinal coordinate of the target obstacle on the real-time image; Determine the lateral distance between the vehicle and the target obstacle according to the lateral coordinates of the principal point, the lateral coordinates of the target obstacle on the real-time image, the focal length of the vehicle-mounted camera relative to the unit pixel in the horizontal direction, and the longitudinal distance; Specifically, the longitudinal distance is calculated by the following formula: Among them, d2 is the longitudinal distance, c x is the transverse coordinate of the principal point, p x is the lateral coordinate of the target obstacle on the real-time image, f x is the focal length of the vehicle camera relative to the unit pixel in the horizontal direction; Determining the distance between the vehicle and the target obstacle according to the longitudinal distance and the lateral distance; Wherein, the transverse coordinate of the principal point is determined according to the principal point coordinate; and d is the distance between the vehicle and the target obstacle.

2. The vehicle distance measurement method according to claim 1, It is characterized in that The installation parameters of the vehicle-mounted camera are determined in the following manner: Calibrate the internal parameters of the vehicle-mounted camera based on a preset calibration method; Determining the installation parameters according to the calibrated internal parameters and the external parameters of the vehicle-mounted camera; Wherein, the internal parameters include the focal length and principal point coordinates of the vehicle-mounted camera; The external parameters include the installation height and pitch angle of the vehicle-mounted camera.

3. The vehicle distance measurement method according to claim 1, It is characterized in that The horizontal coordinate and the vertical coordinate of the target obstacle on the real-time image are determined in the following manner: Detecting the target obstacle in front of the vehicle in the real-time image based on the target detection algorithm to obtain a target detection frame; Determining the position of the target obstacle in the real-time image according to the center position of the lower boundary of the target detection frame; According to the position of the target obstacle in the real-time image, the horizontal coordinate and the vertical coordinate of the target obstacle in the real-time image are determined respectively.

4. A vehicle distance measurement system, applied to the vehicle distance measurement method according to claim 1, It is characterized in that include: Target detection module, data acquisition module and distance measurement module; The target detection module is used to obtain the real-time image collected by the vehicle camera and detect the target obstacles and lane lines in front of the vehicle in the real-time image; The data acquisition module is used to acquire the pitch angle compensation value of the vehicle-mounted camera according to the detected lane line; The distance measurement module is used to determine the distance between the vehicle and the target obstacle according to the pitch angle compensation amount.

5. The vehicle distance measurement system according to claim 4, It is characterized in that Also includes: A parameter acquisition module, used to calibrate the internal parameters of the vehicle-mounted camera based on a preset calibration method; Determining installation parameters of the vehicle-mounted camera according to the calibrated internal parameters and the external parameters of the vehicle-mounted camera; Wherein, the internal parameters include the focal length and principal point coordinates of the vehicle-mounted camera; The external parameters include the installation height and pitch angle of the vehicle-mounted camera.

6. An electronic device comprising a processor and a memory storing a computer program, It is characterized in that When the processor executes the computer program, the steps of the vehicle distance measurement method according to any one of claims 1 to 3 are implemented.

7. A processor-readable storage medium, It is characterized in that The processor-readable storage medium stores a computer program, and the computer program is used to enable the processor to execute the steps of the vehicle distance measurement method according to any one of claims 1 to 3.

8. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the vehicle distance measurement method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Vehicle-mounted camera ranging method and device, storage medium and electronic equipment

    CN109141347A