A monocular vision-based target tracking method, a terminal device, and a storage medium

By using a target tracking method based on monocular vision and employing ranging and Kalman filtering algorithms, the problem of low accuracy of monocular vision in complex road environments was solved, enabling high-precision perception for unmanned driving in the park.

CN114972427BActive Publication Date: 2026-01-30XIAMEN KING LONG UNITED AUTOMOTIVE IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210548990.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2026-01-30
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

Existing monocular vision-based autonomous driving perception systems in parks have low accuracy and poor adaptability in complex road environments, and are particularly affected by factors such as vehicle vibration and uneven road surfaces.

Method used

A monocular vision-based target tracking method is adopted, which detects targets by receiving video frame images in real time, calculates the distance between the target and the vehicle using different ranging algorithms, and combines the Kalman filter algorithm for real-time tracking to improve accuracy.

Benefits of technology

It improves the accuracy and adaptability of the monocular vision perception system, enhancing the perception capabilities of unmanned driving in the park.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114972427B_ABST
    Figure CN114972427B_ABST
Patent Text Reader

Abstract

This invention relates to a target tracking method, terminal device, and storage medium based on monocular vision. The method includes: S1: receiving video frame images of the front of the vehicle captured in real time by a monocular camera installed on the vehicle; S2: performing target detection on the received video frame images at the current moment and obtaining target information of the detected targets, including the target type and target bounding box; S3: calculating the distance between the target and the vehicle at the current moment using different ranging algorithms for different types of targets based on the target information; S4: using a Kalman filter algorithm to track the target in real time based on the target information and the distance between the target and the vehicle at the current moment, obtaining the target information, the distance between the target and the vehicle, and the relative speed between the target and the vehicle at the next moment. This invention can effectively improve the perception accuracy of monocular vision and is more suitable for enhancing the perception capabilities of unmanned driving in parks on actual roads.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target tracking, and more particularly to a target tracking method, terminal device, and storage medium based on monocular vision. Background Technology

[0002] Currently, the visual perception technology for autonomous driving in industrial parks mainly focuses on two directions: monocular vision and binocular vision. Due to the high requirements for manufacturing processes and stability of binocular cameras, their cost is relatively high. Monocular cameras, on the other hand, are more widely used in perception systems because of their lower cost. However, in actual road driving, due to factors such as vehicle vibration, uneven road surfaces, and slopes, the accuracy of existing monocular vision-based perception systems is not entirely satisfactory, especially in complex road environments where their adaptability is poor. Summary of the Invention

[0003] To address the aforementioned problems, this invention proposes a target tracking method, terminal device, and storage medium based on monocular vision.

[0004] The specific plan is as follows:

[0005] A target tracking method based on monocular vision includes the following steps:

[0006] S1: Receives video frame images of the front of the vehicle in real time from the monocular camera installed on the vehicle;

[0007] S2: Perform target detection on the video frame image received at the current moment, and obtain the target information of the detected target, including the target type and target bounding box;

[0008] S3: Based on target information, different ranging algorithms are used to calculate the distance between the target and the vehicle at the current moment for different types of targets;

[0009] S4: Based on the target information and the distance between the target and the vehicle at the current moment, the Kalman filter algorithm is used to track the target in real time to obtain the target information, the distance between the target and the vehicle, and the relative speed between the target and the vehicle at the next moment.

[0010] Furthermore, the target information also includes confidence level.

[0011] Furthermore, target types include vehicles, pedestrians, and others.

[0012] Furthermore, when the target type is a vehicle, the target information also includes an image of the lower half of the vehicle's region of interest.

[0013] Furthermore, when the target type is a vehicle, the ranging algorithm used to calculate the distance between the target and the vehicle includes the following steps:

[0014] S101: Convert the image of the lower half of the vehicle's region of interest into a grayscale image, and perform edge detection on the grayscale image;

[0015] S102: Perform edge dilation processing on the image after edge detection, and find the contours in the image after edge dilation processing;

[0016] S103: Perform a first filter on all found contours based on the number of contour points contained in the contour, and remove contours with fewer than the threshold number of contour points.

[0017] S104: Perform a second filtering on the contours after the first filtering based on the area of ​​the contours, and remove contours whose area is less than the contour area threshold.

[0018] S105: Perform ellipse fitting on all contours after the second filtering;

[0019] S106: Based on the matching degree between the fitted contour and the wheel contour, perform a third filtering on the contour after the second filtering, and remove the contours whose matching degree is less than the matching degree threshold.

[0020] S107: Perform a fourth filter on the contours after the third filter based on the ratio of the major axis to the minor axis, and remove contours whose ratio of the major axis to the minor axis is greater than the threshold value.

[0021] S108: The contour after the fourth filtering is detected by the vehicle posture detection algorithm. If the wheels are detected, the target vehicle is determined to be moving laterally; otherwise, the target vehicle is determined to be moving longitudinally.

[0022] S109: When the target vehicle is traveling laterally, a distance measurement algorithm based on height or coordinate system transformation is used to calculate the distance between the target vehicle and the vehicle itself; when the target vehicle is traveling longitudinally, a distance measurement algorithm based on width is used to calculate the distance between the target vehicle and the vehicle itself.

[0023] Furthermore, when the target type is a pedestrian, the ranging algorithm used to calculate the distance between the target and the vehicle includes the following steps:

[0024] S201: Calculate the aspect ratio of the target bounding box. When the aspect ratio is greater than the aspect ratio threshold, the pedestrian is determined to be standing from the side; when the aspect ratio is less than the aspect ratio threshold, the pedestrian is determined to be standing from the front.

[0025] S202: Set the corresponding width parameters according to whether the pedestrian is standing facing forward or to the side, and use a width-based ranging algorithm to calculate the distance between the pedestrian and the vehicle.

[0026] Furthermore, when the target type is other, a ranging algorithm based on altitude or coordinate system transformation is used to calculate the distance between the target and the vehicle.

[0027] Furthermore, the specific steps for real-time target tracking in step S4 are as follows:

[0028] S401: Track the target information and the distance between the target and the vehicle at time t-1 using the Kalman filter algorithm, and predict the target information, the distance between the target and the vehicle, and the relative speed between the target and the vehicle at time t.

[0029] S402: Perform IOU matching between the target bounding box obtained by target detection of the video frame image at time t and the target bounding box predicted by step S401 at time t. If the matching degree is greater than the preset matching degree threshold, it is determined to be a successful match; otherwise, it is determined to be a failed match. For a successfully matched target, update the prediction result at time t with the detection result at time t to obtain the optimal estimate of the target. For a target that fails to match, reallocate the Kalman filter for tracking. For a target that fails to match for N consecutive times, target tracking will no longer be performed using the Kalman filter algorithm.

[0030] A target tracking terminal device based on monocular vision includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described above in the embodiments of the present invention.

[0031] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above in the embodiments of the present invention.

[0032] The present invention adopts the above technical solution, which can effectively improve the accuracy of monocular vision perception and is more suitable for improving the perception capability of unmanned driving in parks on actual roads. Attached Figure Description

[0033] Figure 1 The diagram shown is a flowchart of Embodiment 1 of the present invention.

[0034] Figure 2 The flowchart shown is a process for calculating the distance between the target and the vehicle in this embodiment. Detailed Implementation

[0035] To further illustrate the various embodiments, the present invention provides accompanying drawings. These drawings are part of the disclosure of the present invention, primarily used to illustrate the embodiments and to explain the operating principles of the embodiments in conjunction with the relevant descriptions in the specification. With reference to these drawings, those skilled in the art should be able to understand other possible implementations and the advantages of the present invention.

[0036] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments.

[0037] Example 1:

[0038] This invention provides a target tracking method based on monocular vision, such as... Figure 1 The diagram shows a flowchart of a target tracking method based on monocular vision according to an embodiment of the present invention. The method includes the following steps:

[0039] S1: Receives video frame images of the front of the vehicle from a monocular camera installed on the vehicle in real time.

[0040] S2: Perform target detection on the video frame image received at the current moment and obtain the target information of the detected target.

[0041] When performing object detection on video frame images, any existing object detection algorithm can be used, and no restrictions are imposed here.

[0042] In this embodiment, the target types are defined as vehicles, pedestrians, and others. The target information includes the target type and the target bounding box. To better facilitate user judgment of the target detection results, the target information in this embodiment also includes confidence scores. Furthermore, to facilitate distance calculation for vehicle targets, the target information for vehicle targets, relative to pedestrians and the other two types of targets, also includes the image of the lower half of the vehicle's region of interest (ROI).

[0043] S3: Based on target information, different ranging algorithms are used to calculate the distance between the target and the vehicle at the current moment for different types of targets.

[0044] like Figure 2 As shown, in order to improve the accuracy of distance calculation, this embodiment sets different ranging algorithms for different types of targets, as follows:

[0045] (1) When the target type is a vehicle, the ranging algorithm is as follows:

[0046] S101: Convert the image of the lower half of the vehicle's region of interest into a grayscale image, and perform edge detection on the grayscale image;

[0047] S102: Perform edge dilation processing on the image after edge detection, and find the contours in the image after edge dilation processing;

[0048] S103: Perform a first filter on all found contours based on the number of contour points contained in the contour, and remove contours with fewer than the threshold number of contour points.

[0049] S104: Perform a second filtering on the contours after the first filtering based on the area of ​​the contours, and remove contours whose area is less than the contour area threshold.

[0050] S105: Perform ellipse fitting on all contours after the second filtering;

[0051] S106: Based on the matching degree between the fitted contour and the wheel contour, perform a third filtering on the contour after the second filtering, and remove the contours whose matching degree is less than the matching degree threshold.

[0052] S107: Perform a fourth filter on the contours after the third filter based on the ratio of the major axis to the minor axis, and remove contours whose ratio of the major axis to the minor axis is greater than the threshold value.

[0053] S108: The contour after the fourth filtering is detected by the vehicle posture detection algorithm. If the wheels are detected, the target vehicle is determined to be moving laterally; otherwise, the target vehicle is determined to be moving longitudinally.

[0054] S109: When the target vehicle is traveling laterally, a distance measurement algorithm based on height or coordinate system transformation is used to calculate the distance between the target vehicle and the vehicle itself; when the target vehicle is traveling longitudinally, a distance measurement algorithm based on width is used to calculate the distance between the target vehicle and the vehicle itself.

[0055] The values ​​of the contour point number threshold, contour area threshold, matching degree threshold, and major-minor axis ratio threshold can be preset by those skilled in the art based on empirical data, and are not limited here.

[0056] (2) When the target type is a pedestrian, the ranging algorithm is as follows:

[0057] S201: Calculate the aspect ratio of the target bounding box. When the aspect ratio is greater than the aspect ratio threshold, the pedestrian is determined to be standing from the side; when the aspect ratio is less than the aspect ratio threshold, the pedestrian is determined to be standing from the front.

[0058] S202: Set the corresponding width parameters according to whether the pedestrian is standing facing forward or to the side, and use a width-based ranging algorithm to calculate the distance between the pedestrian and the vehicle.

[0059] (3) When the target type is other, the distance between the target and the vehicle is calculated using a distance measurement algorithm based on altitude or coordinate system transformation.

[0060] The following sections introduce three distance measurement algorithms.

[0061] (I) Width-based ranging algorithm

[0062] Based on the camera model, the camera intrinsic parameters and target bounding box information are obtained through calibration. Using the principle of triangle similarity, the distance between the target and the vehicle in the world coordinate system can be calculated, as shown in the following formula:

[0063]

[0064] Where f represents the camera's focal length, w represents the target's pixel width, lx represents the horizontal pixel distance between the target's measurement point and the image center point, dx represents the unit size of the camera's horizontal pixels, X1 represents the vertical distance in world coordinates, Y1 represents the horizontal distance in world coordinates, and W1 represents the target's true width.

[0065] Furthermore, because:

[0066] f = fx dx

[0067] ix = uW / 2

[0068] Where fx represents the camera's intrinsic parameters, u represents the horizontal pixel coordinates of the top-left corner of the target bounding box, and W represents the image width.

[0069] From the above formula, the longitudinal distance X1 and lateral distance Y1 between the target and the vehicle can be calculated.

[0070]

[0071]

[0072] (II) Altitude-based ranging algorithm

[0073] Based on the camera model, the camera's intrinsic parameters, camera installation height, and target bounding box information are obtained through calibration. Using the principle of triangle similarity, the distance between the target and the vehicle in the world coordinate system can be calculated, as shown in the following formula:

[0074]

[0075] Where f represents the camera focal length, ly represents the vertical pixel distance between the target point and the center point of the image, dy represents the unit size of the vertical pixels of the camera, H1 represents the camera installation height, and D represents the distance between the target and the vehicle in world coordinates.

[0076] Further, f = fy.dy

[0077] ly = vH / 2

[0078] Where fy represents the camera's intrinsic parameters, v represents the vertical pixel coordinates of the top-left corner of the target bounding box, and H represents the image height.

[0079] The distance D between the target and the vehicle can be calculated from the above formula:

[0080]

[0081] (III) Distance Measurement Algorithm Based on Coordinate System Transformation

[0082] The transformation from world coordinates to camera coordinates is a rigid body transformation, corresponding to the rotation matrix R and the translation matrix T. The transformation from camera coordinates to image coordinates is a perspective projection, corresponding to the perspective projection matrix P. The transformation from image coordinates to pixel coordinates is discretization, corresponding to the transformation between pixel coordinates and image coordinates. Finally, the transformation formula for a point from world coordinates to pixel coordinates is as follows:

[0083]

[0084]

[0085]

[0086] Where K represents the intrinsic parameter matrix, P represents the extrinsic parameter matrix, R and T represent the rotation and translation matrices from the world coordinate system to the camera coordinate system, fx and fy represent the focal lengths of the camera relative to a unit pixel in the horizontal and vertical directions, (u0, v0) represents the coordinates of the camera's optical center, (u, v) represents the pixel coordinates of the target point in the image, Zc represents the distance from the target point to the camera, and Xw, Yw, and Zw represent the distances of the target point in the X, Y, and Z directions in the world coordinate system, respectively.

[0087] Given the pixel coordinates (u,v) of the target point on the image, and by obtaining the intrinsic parameter matrix K and extrinsic parameter matrix P through camera calibration, the distances Xw, Yw, and Zw between the target and the vehicle can be calculated, where Zw = 0.

[0088] S4: Based on the target information and the distance between the target and the vehicle at the current moment, the Kalman filter algorithm is used to track the target in real time to obtain the target information, the distance between the target and the vehicle, and the relative speed between the target and the vehicle at the next moment.

[0089] The specific steps for real-time target tracking in this embodiment are as follows:

[0090] S401: Track the target information and the distance between the target and the vehicle at time t-1 using the Kalman filter algorithm, and predict the target information, the distance between the target and the vehicle, and the relative speed between the target and the vehicle at time t.

[0091] S402: Perform IOU matching between the target bounding box obtained by target detection of the video frame image at time t and the target bounding box predicted by step S401 at time t. If the matching degree is greater than the preset matching degree threshold, it is determined that the match is successful (same target); otherwise, it is determined that the match is unsuccessful (different targets). For targets that are successfully matched, update the prediction result at time t with the detection result at time t to obtain the optimal estimate of the target. For targets that are unsuccessfully matched, reallocate the Kalman filter for tracking. For targets that are unsuccessfully matched N times in a row, target tracking will no longer be performed using the Kalman filter algorithm.

[0092] The matching threshold can be preset by those skilled in the art based on empirical data, and is not limited here.

[0093] The equations for tracking using the Kalman filter algorithm are as follows:

[0094] X t =FX t-1 +u

[0095] In the formula, X t-1 Let X represent the state vector (11x1) at time t-1. t-1 =[x,y,s,x_,y_,r,x^,y^,s^,x v ,y v ] T x represents the horizontal coordinate of the top-left corner of the target bounding box, y represents the vertical coordinate of the top-left corner of the target bounding box, s represents the area of ​​the target bounding box, x_ represents the vertical distance between the target and the vehicle, y_ represents the horizontal distance between the target and the vehicle, r represents the aspect ratio of the target bounding box, x^ represents the change in x, y^ represents the change in y, s^ represents the change in s, x v The longitudinal relative velocity between the target and the vehicle is represented by y. v This indicates the lateral relative speed between the target and the vehicle.

[0096] In the formula, F is the state change matrix (11x11), which is set to [value missing] in this embodiment;

[0097] F=[[1,0,0,0,0,0,1,0,0,0,0],[0,1,0,0,0,0,0,1,0,0,0],[0,0,1,0,0,0,0,0 ,1,0,0],[0,0,0,1,0,0,0,0,0,△t,0],[0,0,0,0,1,0,0,0,0,0,△t],[0,0,0,0, 0,1,0,0,0,0,0],[0,0,0,0,0,0,1,0,0,0,0],[0,0,0,0,0,0,0,1,0,0,0],[0,0,0,0,0,0,0,1,0,0],[0,0,0,0,0,0,0,0,1,0],[0,0,0,0,0,0,0,0,0,1]]

[0098] Where △t represents the time difference between time t and time t-1.

[0099] In the formula, u represents the external influence parameter, which is 0 in this embodiment.

[0100] P' = FPF T +Q

[0101] In the formula, P represents the state covariance matrix (11x11), initially set as follows:

[0102] P=[[10,0,0,0,0,0,0,0,0,0,0],[0,10,0,0,0,0,0,0,0,0,0],[0,0,10,0,0,0,0,0,0 ,0,0],[0,0,0,10,0,0,0,0,0,0,0],[0,0,0,0,10,0,0,0,0,0,0],[0,0,0,0,0,10,0, 0,0,0,0],[0,0,0,0,0,0,1000,0,0,0,0],[0,0,0,0,0,0,1000,0,0,0],[0,0,0,0,0,0,0,1000,0,0],[0,0,0,0,0,0,0,1000,0,0],[0,0,0,0,0,0,0,0,0,1000,0],[0,0,0,0,0,0,0,0,0,1000]]

[0103] In the formula, Q represents the process noise matrix (11x11), initially set as follows:

[0104] Q=[[0.01,0,0,0,0,0,0,0,0,0,0],[0,0.01,0,0,0,0,0,0,0,0,0],[0,0,0.01,0,0,0,0, 0,0,0,0],[0,0,0,0.01,0,0,0,0,0,0,0],[0,0,0,0,0.01,0,0,0,0,0,0],[0,0,0,0,0,0. 01,0,0,0,0,0],[0,0,0,0,0,0,0.01,0,0,0,0],[0,0,0,0,0,0,0,0.01,0,0,0],[0,0,0,0,0,0,0,0,0,0.01,0,0],[0,0,0,0,0,0,0,0,0,0,0.001,0],[0,0,0,0,0,0,0,0,0,0,0,0.001]]

[0105] The equation used by the Kalman filter algorithm for updating is:

[0106] y = z - HX t

[0107] In the formula, z represents the measured value at time t [x m ,y m ,s m ,x_ m ,y_ m ,r m ] T X t Let H represent the predicted state vector at time t, and let H represent the measurement matrix (6x11), initially set as follows:

[0108] H=[[1,0,0,0,0,0,0,0,0,0,0],[0,1,0,0,0,0,0,0,0,0,0],[0,0,1,0,0,0,0,0,0,0,0 ],[0,0,0,1,0,0,0,0,0,0,0],[0,0,0,0,1,0,0,0,0,0,0],[0,0,0,0,0,1,0,0,0,0,0]]

[0109] S = HP'H T +R

[0110] In the formula, R represents the measurement noise matrix (6x6), and its value is set according to the measurement error. The initial setting is:

[0111] R=[[1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,1,0,0,0],[0,0,0,10,0,0],[0,0,0,0,10,0],[0,0,0,0,0,10]]

[0112] K = P'H T S -1

[0113] In the formula, K represents the Kalman gain.

[0114] X = X t +Ky

[0115] P = (I - KH)P'

[0116] In the formula, X and P represent the state vector and state covariance matrix after Kalman filtering update at time t, respectively, and I represents the identity matrix with the same dimension as the state vector.

[0117] When performing IOU matching on two target bounding boxes, let the target bounding box obtained at time t be A = (x m ,y m ,s m ,r m The target bounding box at time t is predicted as B = (x) through step S401. p ,y p s p The two are matched using IOU (Intersection over Union) calculations. The IOU value is the matching degree, calculated using the following formula:

[0118]

[0119] Furthermore, this embodiment also includes sending the predicted target information for the next moment, the distance between the target and the vehicle, and the relative speed between the target and the vehicle to the display interface for display.

[0120] The embodiments of the present invention can accurately predict the position, distance and relative speed of obstacles, which can effectively improve the accuracy of monocular vision perception and is more suitable for improving the perception capabilities of unmanned driving in parks on actual roads.

[0121] Example 2:

[0122] The present invention also provides a target tracking terminal device based on monocular vision, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the method embodiment described above in Embodiment 1 of the present invention.

[0123] Furthermore, as an executable solution, the monocular vision-based target tracking terminal device can be a computing device such as an in-vehicle computer or a cloud server. The monocular vision-based target tracking terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that the above-described structural composition of the monocular vision-based target tracking terminal device is merely an example and does not constitute a limitation on the monocular vision-based target tracking terminal device. It may include more or fewer components than described above, or combine certain components, or different components. For example, the monocular vision-based target tracking terminal device may also include input / output devices, network access devices, buses, etc., and this embodiment of the invention does not limit this.

[0124] Furthermore, as an executable solution, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. This processor is the control center of the monocular vision-based target tracking terminal device, connecting all parts of the device via various interfaces and lines.

[0125] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the monocular vision-based target tracking terminal device by running or executing the computer programs and / or modules stored in the memory, and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0126] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in the embodiments of the present invention.

[0127] If the modules / units integrated in the monocular vision-based target tracking terminal device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media, etc.

[0128] Although the invention has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to the invention without departing from the spirit and scope of the invention as defined in the appended claims, all of which shall be within the scope of protection of the invention.

Claims

1. A monocular vision-based target tracking method, characterized in that, The method comprises the following steps: S1: Real-time receiving a video frame image collected by a monocular camera mounted on a vehicle in front of the vehicle; S2: Target detection is performed on the video frame image received at the current time, and target information of the detected target is obtained, the target information comprising a type of the target and a target bounding box; S3: Based on the target information, different ranging algorithms are used to calculate the distance between the target and the vehicle at the current time for different types of targets; S4: Based on the target information at the current time and the distance between the target and the vehicle, a Kalman filtering algorithm is used to track the target in real time to obtain target information, the distance between the target and the vehicle and the relative speed between the target and the vehicle at the next time; The specific steps of the real-time tracking of the target in step S4 are as follows: S401: The target information and the distance between the target and the vehicle at t-1 time are tracked by the Kalman filtering algorithm to predict the target information, the distance between the target and the vehicle and the relative speed between the target and the vehicle at t time; S402: The target bounding box at t time obtained by performing target detection on the video frame image at t time is matched with the target bounding box at t time obtained by the prediction of step S401, when the matching degree is greater than a preset matching degree threshold, it is determined that the matching is successful, otherwise, it is determined that the matching is unsuccessful; for the target with successful matching, the detection result at t time is used to update the prediction result at t time to obtain the optimal estimation value of the target; for the target with unsuccessful matching, the Kalman filter is re-assigned for tracking; for the tracking target with unsuccessful matching for N consecutive times, the Kalman filtering algorithm is not used for target tracking any more; The equation for tracking by the Kalman filtering algorithm is as follows: X t = FX t-1 + u In the formula, X t-1 Let X represent the state vector at time t-1. t-1 = [x, y, s, x_, y_, r, x^, y^, s^, x v ,y v ] T x represents the horizontal coordinate of the top-left corner of the target bounding box, y represents the vertical coordinate of the top-left corner of the target bounding box, s represents the area of ​​the target bounding box, x_ represents the vertical distance between the target and the vehicle, y_ represents the horizontal distance between the target and the vehicle, r represents the aspect ratio of the target bounding box, x^ represents the change in x, y^ represents the change in y, s^ represents the change in s, x v The longitudinal relative velocity between the target and the vehicle is represented by y. v The lateral relative velocity between the target and the vehicle is represented by F; F is the state change matrix; and u represents the external influence parameters. Wherein, the target type comprises a vehicle, a pedestrian and others; When the target type is a vehicle, the target information further comprises an image of a lower half of the vehicle, and the ranging algorithm for calculating the distance between the target and the vehicle comprises the following steps: S101: The image of the lower half of the vehicle is converted into a gray image, and edge detection is performed on the gray image; S102: Edge dilation processing is performed on the image after the edge detection, and the contours in the image after the edge dilation processing are searched; S103: All the contours searched are filtered for the first time according to the number of contour points contained in the contours, and the contours with the number of contour points less than a contour point number threshold are removed; S104: The contours after the first filtering are filtered for the second time according to the areas of the contours, and the contours with the area less than a contour area threshold are removed; S105: Ellipse fitting is performed on all the contours after the second filtering; S106: The contours after the second filtering are filtered for the third time according to the matching degree of the fitted contours and the wheel contour, and the contours with the matching degree less than a matching degree threshold are removed; S107: The contours after the third filtering are filtered for the fourth time according to the length-to-short-axis ratio of the contours, and the contours with the length-to-short-axis ratio greater than a length-to-short-axis ratio threshold are removed; S108: The contours after the fourth filtering are detected by a vehicle posture detection algorithm, if a wheel is detected, it is determined that the target vehicle travels horizontally, otherwise, it is determined that the target vehicle travels vertically; S109: When the target vehicle is transversely running, a ranging algorithm based on height or coordinate system conversion is used to calculate the distance between the target vehicle and the ego vehicle; when the target vehicle is longitudinally running, a ranging algorithm based on width is used to calculate the distance between the target vehicle and the ego vehicle; When the target type is a pedestrian, the ranging algorithm for calculating the distance between the target and the ego vehicle includes the following steps: S201: Calculate the aspect ratio of the target bounding box, when the aspect ratio is greater than the aspect ratio threshold, determine that the pedestrian is standing sideways; when the aspect ratio is less than the aspect ratio threshold, determine that the pedestrian is standing face to face; S202: Set the corresponding width parameter according to whether the pedestrian is standing face to face or sideways, and use the ranging algorithm based on width to calculate the distance between the pedestrian and the ego vehicle; When the target type is other, the ranging algorithm based on height or coordinate system conversion is used to calculate the distance between the target and the ego vehicle.

2. The monocular vision-based target tracking method of claim 1, wherein: The target information further includes a confidence. 3.A monocular vision based target tracking terminal device, characterized in that: A computer program product comprising a processor, a memory, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the method according to any one of claims 1-2 when running the computer program.

4. A computer readable storage medium storing a computer program, characterized in that: The computer program is executed by the processor to implement the steps of the method according to any one of claims 1-2.

Citation Information

Patent Citations

  • Computer vision-based method for measuring distances of driving obstacles

    CN108596058A

  • Position estimation method and device for tracking target and unmanned aerial vehicle

    CN112037260A