Target vehicle yaw angle calculation method, device, equipment and medium
By acquiring multiple frames of information images and using ranging algorithms and motion parameters to calculate the yaw angle, the problems of complex models and slow detection speed in existing technologies are solved, and efficient and accurate yaw angle detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-06
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies use complex models to calculate the yaw angle of target vehicles, resulting in slow detection speeds and requiring more manual annotation.
By acquiring multiple frames of information images of the target vehicle, the distance parameters are calculated using a preset ranging algorithm, and the yaw angle is calculated by combining motion parameters. The accurate yaw angle is obtained through filtering, which simplifies the calculation process.
It improves the efficiency and accuracy of target vehicle yaw angle detection, simplifies the detection process, and increases detection speed.
Smart Images

Figure CN117197227B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to methods, apparatus, devices, and media for calculating the yaw angle of a target vehicle. Background Technology
[0002] Yaw angle is the angle between the direction of travel of a moving target on a horizontal plane and true north. It is an important parameter describing the attitude of a moving target and a parameter that needs to be estimated in 3D target detection and tracking. A target is a rigid body, or a part of it, with a certain length, width, and height in space. The yaw angle of a target vehicle is obtained by observing the yaw angle of the target during its movement using a camera as the reference frame. Of course, after transformation, the yaw angle of the target in the world coordinate system can also be obtained. The yaw angle of a target vehicle is important for predicting the movement of various targets around the vehicle. For example, if a vehicle in front changes lanes and enters in front of the vehicle, if the yaw angle of the vehicle in front can be calculated as soon as it enters the lane, then the possible collision point and collision time can be known in advance, and thus avoidance measures can be taken in advance.
[0003] In existing technologies, the yaw angle of a target vehicle is generally calculated using a 3D detection box. However, 3D detection boxes require more manpower to annotate the target in the image more precisely. A typical 2D detection box only needs to annotate 4 points, while a 3D detection box needs to annotate 8 points. Correspondingly, the model of the 3D detection box also needs to output at least 8 points, so the model of the 3D detection box is more complex.
[0004] In summary, there is an urgent need to simplify the model for calculating the yaw angle of target vehicles and improve the detection speed. Summary of the Invention
[0005] This invention provides a method, apparatus, device, and medium for calculating the yaw angle of a target vehicle, which can improve the detection efficiency of the yaw angle of the target vehicle.
[0006] To achieve the above objectives, the present invention provides a method for calculating the yaw angle of a target vehicle, comprising:
[0007] Acquire multi-frame information images of the target vehicle, and calculate the distance parameters between the target vehicle and the preset image acquisition device using a preset ranging algorithm;
[0008] The motion parameters of the target vehicle are calculated using the distance parameters;
[0009] The undetermined yaw angle of the target vehicle is calculated based on the distance parameter, and the undetermined yaw angle is filtered based on the motion parameter to obtain the yaw angle of the target vehicle.
[0010] Optionally, acquiring multi-frame information images of the target vehicle includes:
[0011] Pre-configured target detection and target tracking modules;
[0012] Multiple frames of raw images are acquired using a pre-set image acquisition device;
[0013] The target detection module is used to detect the category of objects and the 2D bounding box of objects in the original image, and to filter out the original images containing the target category as multi-frame information images.
[0014] The target tracking module tracks the target by using the size, position, and category information of the 2D bounding box of the target category in multi-frame information images.
[0015] Optionally, calculating the undetermined yaw angle of the target vehicle includes:
[0016] Determine the set of diagonals of the 2D rectangle corresponding to the target vehicle;
[0017] Select a reference diagonal from the set of diagonals;
[0018] Determine the reference optical axis of the preset image acquisition device;
[0019] Obtain the left and right endpoint lines of the 2D rectangle;
[0020] The yaw angle of the target vehicle is calculated based on the distance parameter, the reference diagonal, the reference optical axis, the left endpoint line, and the right endpoint line to obtain the undetermined value of the yaw angle.
[0021] Optionally, calculating the motion parameters of the target vehicle using the distance parameters includes:
[0022] Extract the longitudinal relative distance from the distance parameters;
[0023] Calculate the set of longitudinal relative velocities within a preset time period based on the longitudinal relative distance;
[0024] The set of longitudinal relative velocities is filtered using a preset filter to obtain a standard longitudinal relative velocity.
[0025] The lateral relative distance of the target vehicle is calculated based on the 2D rectangular frame, the longitudinal relative distance, and the reference optical axis.
[0026] Calculate the set of lateral relative velocities within a preset time period based on the lateral relative distance;
[0027] The set of lateral relative velocities is filtered using the preset filter to obtain the standard lateral relative velocity.
[0028] Optionally, calculating the yaw angle of the target vehicle based on the distance parameter, the reference diagonal, the reference optical axis, the left endpoint line, and the right endpoint line includes:
[0029] Obtain the target length and target width of the target vehicle;
[0030] Calculate the diagonal length based on the target length and the target width, and calculate the angle formed by the long side of the target vehicle and the reference diagonal, denoted as the first angle.
[0031] Calculate the angle between the left endpoint line of the 2D rectangle and the reference optical axis to obtain the left endpoint angle;
[0032] Calculate the angle between the right endpoint line of the 2D rectangle and the reference optical axis to obtain the right endpoint angle;
[0033] Calculate the angle between the line connecting the left or right endpoint to the acquisition point of the preset image acquisition device and the long side of the target vehicle;
[0034] The minimum and maximum yaw angles of the target vehicle are calculated based on the first included angle, the included angle of the left endpoint, the included angle of the right endpoint, and the included angle of the connecting line, to obtain the undetermined yaw angle value.
[0035] Optionally, the step of filtering the undetermined yaw angle values based on the motion parameters to obtain the yaw angle of the target vehicle includes:
[0036] The lateral velocity threshold and the ratio threshold of the longitudinal relative velocity to the lateral relative velocity are obtained using numerical statistics.
[0037] The yaw angle of the target vehicle is obtained by selecting a unique yaw angle from the undetermined yaw angle values based on the lateral velocity threshold and the ratio threshold.
[0038] Optionally, the step of selecting a unique yaw angle from the undetermined yaw angle values based on the lateral velocity threshold and the ratio threshold includes:
[0039] The following formula is used to select the unique yaw angle:
[0040]
[0041] Where, sign(·) is the sign function, a1 is the angle between the left and right endpoints, a2 is the angle between the right and left endpoints, a7 is the angle between the line connecting the left or right endpoint to the preset image acquisition point and the long side of the target vehicle, abs(·) is the absolute value function, and rv x For standard lateral relative velocity, rv Z For standard longitudinal relative velocity, rvxthresh The lateral velocity threshold, rv thresh This is the ratio threshold.
[0042] To address the above problems, the present invention also provides a device for calculating the yaw angle of a target vehicle, the device comprising:
[0043] The distance parameter acquisition module is used to acquire multi-frame information images of the target vehicle and calculate the distance parameters of the target vehicle from the preset image acquisition device using a preset ranging algorithm.
[0044] A motion parameter calculation module is used to calculate the motion parameters of the target vehicle using the distance parameters;
[0045] The yaw angle determination module is used to calculate the undetermined yaw angle value of the target vehicle based on the distance parameters, and filter the undetermined yaw angle value based on the motion parameters to obtain the yaw angle of the target vehicle.
[0046] To address the above problems, the present invention also provides an electronic device, the electronic device comprising:
[0047] At least one processor; and,
[0048] A memory communicatively connected to the at least one processor; wherein,
[0049] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the method for calculating the yaw angle of the target vehicle as described above.
[0050] To address the aforementioned problems, the present invention also provides a computer-readable storage medium storing at least one computer program, which is executed by a processor in an electronic device to implement the above-described method for calculating the yaw angle of a target vehicle.
[0051] This invention, through acquiring multi-frame images of a target vehicle, extracts the vehicle's shape and calculates the distance parameters between the target vehicle and a preset image acquisition device using a pre-defined ranging algorithm. This allows for the calculation of the target vehicle's dimensions and distance from the device within the multi-frame images, thereby determining the vehicle's motion parameters. This leads to the calculation of the undetermined yaw angle. Further filtering of the undetermined yaw angle using motion parameters improves the accuracy of the calculated yaw angle. The overall process simplifies the yaw angle calculation and detection process by processing 2D images, thus increasing detection speed. Attached Figure Description
[0052] Figure 1 This is a flowchart illustrating a method for calculating the yaw angle of a target vehicle according to an embodiment of the present invention.
[0053] Figures 2 to 9 This is a target vehicle attitude diagram provided by an embodiment of the present invention for a method of calculating the yaw angle of a target vehicle;
[0054] Figure 10 A functional block diagram of a device for calculating the yaw angle of a target vehicle provided in an embodiment of the present invention;
[0055] Figure 11 This is a schematic diagram of the structure of an electronic device for implementing the method for calculating the yaw angle of a target vehicle, as provided in an embodiment of the present invention.
[0056] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0057] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0058] This application provides a method for calculating the yaw angle of a target vehicle. The execution entity of this method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the method for calculating the yaw angle of a target vehicle can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0059] Reference Figure 1 The diagram shown is a flowchart illustrating a method for calculating the yaw angle of a target vehicle according to an embodiment of the present invention. In this embodiment, the method for calculating the yaw angle of the target vehicle includes:
[0060] S1. Acquire multi-frame information images of the target vehicle, and use a preset ranging algorithm to calculate the distance parameters between the target vehicle and the preset image acquisition device.
[0061] In this embodiment of the invention, the target vehicle refers to the vehicle whose trajectory needs to be predicted. For example, if the target vehicle changes lanes and enters in front of the vehicle, if the yaw angle of the target vehicle can be calculated when it just enters the lane, then the possible collision point and collision time can be known in advance, and thus avoidance measures can be taken in advance.
[0062] As an embodiment of the present invention, the acquisition of multi-frame information images of the target vehicle includes:
[0063] Pre-configured target detection and target tracking modules;
[0064] Multiple frames of raw images are acquired using a pre-set image acquisition device;
[0065] The target detection module is used to detect the category of objects and the 2D bounding box of objects in the original image, and to filter out the original images containing the target category as multi-frame information images.
[0066] The target tracking module tracks the target by using the size, position, and category information of the 2D bounding box of the target category in multi-frame information images.
[0067] In this embodiment of the invention, the target detection module refers to a module that can detect the shape and category of a target, and can be installed in a preset image acquisition device for real-time identification of the shape and category of the target.
[0068] In this embodiment of the invention, the preset ranging algorithm refers to an algorithm used to calculate the distance between two points. For example, binocular camera ranging, monocular camera ranging, lidar ranging, deep learning ranging, and other ranging methods can be used.
[0069] In this embodiment of the invention, the preset image acquisition device refers to a device capable of capturing images or videos. For example, the preset image acquisition device can be a camera, a camcorder, or other image acquisition devices. In this embodiment of the invention, a camera is used as the preset image acquisition device.
[0070] In this embodiment of the invention, the preset image acquisition device can be installed in a collision prevention scenario. For example, the preset image acquisition device can be installed in front of the vehicle itself to avoid collisions with other vehicles in front; it can also be installed in a fixed location, such as a fixed location in a parking lot, to avoid collisions when vehicles enter or leave the parking lot; or it can be installed on streetlights, traffic lights, and the left and right sides of pedestrian crossings, etc.
[0071] In this embodiment of the invention, the distance parameter refers to the distance between the target and the preset image acquisition device. For example, the distance parameter may be the longitudinal relative distance between the target vehicle and the preset image acquisition device.
[0072] S2. Calculate the motion parameters of the target vehicle using the distance parameters.
[0073] In this embodiment of the invention, the motion parameters refer to the relative speed of the target in the lateral and longitudinal directions.
[0074] Specifically, in this embodiment of the invention, the motion parameters of the target vehicle are calculated by extracting the longitudinal relative distance from the distance parameters; calculating a set of longitudinal relative velocities within a preset time period based on the longitudinal relative distance; filtering the set of longitudinal relative velocities using a preset filter to obtain a standard longitudinal relative velocity; calculating the lateral relative distance of the target vehicle based on a 2D rectangle, the longitudinal relative distance, and the reference optical axis; calculating a set of lateral relative velocities within a preset time period based on the lateral relative distance; and filtering the set of lateral relative velocities using the preset filter to obtain a standard lateral relative velocity.
[0075] In this embodiment of the invention, the preset time period refers to the time used to track the target using the target tracking module.
[0076] In this embodiment of the invention, the longitudinal relative velocity and the lateral relative velocity can be calculated by the time and position changes of the target recorded in the target tracking module.
[0077] In this embodiment of the invention, the preset filter refers to a filter used to smooth random errors in relative velocity. For example, the preset filter may be a Kalman filter, a mean filter, or other filters.
[0078] In this embodiment of the invention, the reference optical axis refers to the reference line formed when the optical axis of the preset image acquisition device is aligned with the target vehicle image.
[0079] S3. Calculate the undetermined yaw angle of the target vehicle based on the distance parameters, and filter the undetermined yaw angle based on the motion parameters to obtain the yaw angle of the target vehicle.
[0080] As an embodiment of the present invention, the calculation of the undetermined yaw angle of the target vehicle includes:
[0081] Determine the set of diagonals of the 2D rectangle corresponding to the target vehicle;
[0082] Select a reference diagonal from the set of diagonals;
[0083] Determine the reference optical axis of the preset image acquisition device;
[0084] Obtain the left and right endpoint lines of the 2D rectangle;
[0085] The yaw angle of the target vehicle is calculated based on the distance parameter, the reference diagonal, the reference optical axis, the left endpoint line, the right endpoint line, and the included angle of the connecting lines, and the yaw angle value to be determined is obtained.
[0086] In this embodiment of the invention, the left and right endpoint lines of the 2D rectangle refer to the lines connecting the left and right endpoints of the acquired target image to the position of the preset image acquisition device.
[0087] In this embodiment of the invention, the reference diagonal refers to the diagonal determined by the long side and the short side of the 2D rectangle facing the preset image acquisition device, such as... Figures 2-9 The edge BC is shown.
[0088] Further, the step of calculating the yaw angle of the target vehicle based on the distance parameter, the reference diagonal, the reference optical axis, the left endpoint line, and the right endpoint line includes:
[0089] Obtain the target length and target width of the target vehicle;
[0090] Calculate the diagonal length based on the target length and the target width, and calculate the angle formed by the long side of the target vehicle and the reference diagonal, denoted as the first angle.
[0091] Calculate the angle between the left endpoint line of the 2D rectangle and the reference optical axis to obtain the left endpoint angle;
[0092] Calculate the angle between the right endpoint line of the 2D rectangle and the reference optical axis to obtain the right endpoint angle;
[0093] Calculate the angle between the line connecting the left or right endpoint to the acquisition point of the preset image acquisition device and the long side of the target vehicle;
[0094] The minimum and maximum yaw angles of the target vehicle are calculated based on the first included angle, the included angle of the left endpoint, the included angle of the right endpoint, and the included angle of the connecting line, to obtain the undetermined yaw angle value.
[0095] Furthermore, in this embodiment of the invention, the angle between the left endpoint line of the 2D rectangular frame and the reference optical axis is calculated to obtain the left endpoint angle value, which can be obtained using the following formula:
[0096]
[0097] Where a1 is the included angle value of the left endpoint, x is the x-coordinate of the left endpoint, vpx is the x-coordinate of the point on the target vehicle image where the optical axis of the preset image acquisition device is directly opposite, and ppd is the pixel parameter of the preset image acquisition device.
[0098] Furthermore, in this embodiment of the invention, the angle between the right endpoint line of the 2D rectangular frame and the reference optical axis is calculated to obtain the right endpoint angle value, which can be obtained using the following formula:
[0099]
[0100] Where a2 is the included angle value of the right endpoint, and w is the width of the target vehicle.
[0101] Furthermore, in this embodiment of the invention, the angle between the line connecting the left or right endpoint to the acquisition point of the preset image acquisition device and the target length can be calculated using the following formula:
[0102]
[0103] Wherein, ∠BCO is the angle between the reference diagonal BC and the line connecting the left or right endpoint to the point where the optical axis of the preset image acquisition device is directly opposite the target vehicle image, dist_z is the longitudinal relative distance, a7=∠BCO-a0, where a0 is the arctangent function value of the target width pw and the target length pl, and a0 is the angle formed by the long side of the target vehicle and the reference diagonal.
[0104] As an embodiment of the present invention, the step of filtering the undetermined yaw angle value according to the motion parameters to obtain the yaw angle of the target vehicle includes:
[0105] The lateral velocity threshold and the ratio threshold of the longitudinal relative velocity to the lateral relative velocity are obtained using numerical statistics.
[0106] The yaw angle of the target vehicle is obtained by selecting a unique yaw angle from the undetermined yaw angle values based on the lateral velocity threshold and the ratio threshold.
[0107] In this embodiment of the invention, the numerical statistical method refers to a data processing method that utilizes numerical data. For example, the numerical statistical method can employ methods such as mean calculation and standard deviation calculation.
[0108] Further, the step of selecting a unique yaw angle from the undetermined yaw angle values based on the lateral velocity threshold and the ratio threshold includes:
[0109] The following formula is used to select the unique yaw angle:
[0110]
[0111] Where, sign(·) is the sign function, a1 is the angle between the left and right endpoints, a2 is the angle between the right and left endpoints, a7 is the angle between the line connecting the left or right endpoint to the preset image acquisition point and the long side of the target vehicle, abs(·) is the absolute value function, and rvx For standard lateral relative velocity, rv Z For standard longitudinal relative velocity, rvx thresh The lateral velocity threshold, rv thresh This is the ratio threshold.
[0112] This invention, through acquiring multi-frame images of a target vehicle, extracts the vehicle's shape and calculates the distance parameters between the target vehicle and a preset image acquisition device using a pre-defined ranging algorithm. This allows for the calculation of the target vehicle's dimensions and distance from the device within the multi-frame images, thereby determining the vehicle's motion parameters. This leads to the calculation of the undetermined yaw angle. Further filtering of the undetermined yaw angle using motion parameters improves the accuracy of the calculated yaw angle. The overall process simplifies the yaw angle calculation and detection process by processing 2D images, thus increasing detection speed.
[0113] Reference Figure 2 As shown, the target vehicle is to the right of the vehicle, turns right, and moves away from the center. a1 is the angle value of the left endpoint, a2 is the angle value of the right endpoint, a7 is the angle formed by the line connecting the right endpoint and the preset image acquisition point and the long side of the target vehicle, and a2+a7 is the yaw angle.
[0114] Reference Figure 3 As shown, the target vehicle is to the left of the vehicle, turns left, and moves away from the center. a1 is the angle value of the left endpoint, a2 is the angle value of the right endpoint, a7 is the angle formed by the line connecting the left endpoint and the preset image acquisition point and the long side of the target vehicle, and a1+a7 is the yaw angle.
[0115] Reference Figure 4 As shown, the target vehicle is in front of the vehicle, turns right, and moves away from the center. a1 is the angle value of the left endpoint, a2 is the angle value of the right endpoint, a7 is the angle formed by the line connecting the left endpoint and the preset image acquisition point and the long side of the target vehicle, and a1+a7 is the yaw angle.
[0116] Reference Figure 5 As shown, the target vehicle is in front of the vehicle, turns left, and moves away from the center. a1 is the angle value of the left endpoint, a2 is the angle value of the right endpoint, a7 is the angle formed by the line connecting the right endpoint and the acquisition point of the preset image acquisition device and the long side of the target vehicle, and a2+a7 is the yaw angle.
[0117] Reference Figure 6 As shown, the target vehicle is to the right of the vehicle, turns left, changes lanes and enters the center. a1 is the angle value of the left endpoint, a2 is the angle value of the right endpoint, a7 is the angle formed by the line connecting the left endpoint and the preset image acquisition point and the long side of the target vehicle, and a7-a1 is the yaw angle.
[0118] Reference Figure 7 As shown, the target vehicle is to the left of the vehicle, turning right and changing lanes into the center. a1 is the angle value of the left endpoint, a2 is the angle value of the right endpoint, a7 is the angle formed by the line connecting the left endpoint and the preset image acquisition point and the long side of the target vehicle, and a7-a1 is the yaw angle.
[0119] Reference Figure 8 As shown, the target vehicle is to the right of the vehicle and is turning right. a1 is the angle value of the left endpoint, a2 is the angle value of the right endpoint, a7 is the angle formed by the line connecting the left endpoint and the preset image acquisition point and the long side of the target vehicle, and a1-a7 is the yaw angle.
[0120] Reference Figure 9 As shown, the target vehicle is to the left of the vehicle and is turning left. a1 is the angle value of the left endpoint, a2 is the angle value of the right endpoint, a7 is the angle formed by the line connecting the right endpoint and the preset image acquisition point and the long side of the target vehicle, and a2-a7 is the yaw angle.
[0121] like Figure 10 The diagram shown is a functional block diagram of a device for calculating the yaw angle of a target vehicle according to an embodiment of the present invention.
[0122] The target vehicle yaw angle calculation device 100 of the present invention can be installed in an electronic device. Depending on the functions implemented, the target vehicle yaw angle calculation device 100 may include a distance parameter acquisition module 101, a motion parameter calculation module 102, and a yaw angle determination module 103.
[0123] The module described in this invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and are stored in the memory of the electronic device.
[0124] In this embodiment, the functions of each module / unit are as follows:
[0125] The distance parameter acquisition module 101 is used to acquire multi-frame information images of the target vehicle and calculate the distance parameters of the target vehicle from the preset image acquisition device using a preset ranging algorithm.
[0126] In this embodiment of the invention, the target vehicle refers to the vehicle whose trajectory needs to be predicted. For example, if the target vehicle changes lanes and enters in front of the vehicle, if the yaw angle of the target vehicle can be calculated when it just enters the lane, then the possible collision point and collision time can be known in advance, and thus avoidance measures can be taken in advance.
[0127] As an embodiment of the present invention, the acquisition of multi-frame information images of the target vehicle includes:
[0128] Pre-configured target detection and target tracking modules;
[0129] Multiple frames of raw images are acquired using a pre-set image acquisition device;
[0130] The target detection module is used to detect the category of objects and the 2D bounding box of objects in the original image, and to filter out the original images containing the target category as multi-frame information images.
[0131] The target tracking module tracks the target by using the size, position, and category information of the 2D bounding box of the target category in multi-frame information images.
[0132] In this embodiment of the invention, the target detection module refers to a module that can detect the shape and category of a target, and can be installed in a preset image acquisition device for real-time identification of the shape and category of the target.
[0133] In this embodiment of the invention, the preset ranging algorithm refers to an algorithm used to calculate the distance between two points. For example, binocular camera ranging, monocular camera ranging, lidar ranging, deep learning ranging, and other ranging methods can be used.
[0134] In this embodiment of the invention, the preset image acquisition device refers to a device capable of capturing images or videos. For example, the preset image acquisition device can be a camera, a camcorder, or other image acquisition devices. In this embodiment of the invention, a camera is used as the preset image acquisition device.
[0135] In this embodiment of the invention, the preset image acquisition device can be installed in a collision prevention scenario. For example, the preset image acquisition device can be installed in front of the vehicle itself to avoid collisions with other vehicles in front; it can also be installed in a fixed location, such as a fixed location in a parking lot, to avoid collisions when vehicles enter or leave the parking lot; or it can be installed on streetlights, traffic lights, and the left and right sides of pedestrian crossings, etc.
[0136] In this embodiment of the invention, the distance parameter refers to the distance between the target and the preset image acquisition device. For example, the distance parameter may be the longitudinal relative distance between the target vehicle and the preset image acquisition device.
[0137] The motion parameter calculation module 102 is used to calculate the motion parameters of the target vehicle using the distance parameters.
[0138] In this embodiment of the invention, the motion parameters refer to the relative speed of the target in the lateral and longitudinal directions.
[0139] Specifically, in this embodiment of the invention, the motion parameters of the target vehicle are calculated by extracting the longitudinal relative distance from the distance parameters; calculating a set of longitudinal relative velocities within a preset time period based on the longitudinal relative distance; filtering the set of longitudinal relative velocities using a preset filter to obtain a standard longitudinal relative velocity; calculating the lateral relative distance of the target vehicle based on a 2D rectangle, the longitudinal relative distance, and the reference optical axis; calculating a set of lateral relative velocities within a preset time period based on the lateral relative distance; and filtering the set of lateral relative velocities using the preset filter to obtain a standard lateral relative velocity.
[0140] In this embodiment of the invention, the preset time period refers to the time used to track the target using the target tracking module.
[0141] In this embodiment of the invention, the longitudinal relative velocity and the lateral relative velocity can be calculated by the time and position changes of the target recorded in the target tracking module.
[0142] In this embodiment of the invention, the preset filter refers to a filter used to smooth random errors in relative velocity. For example, the preset filter may be a Kalman filter, a mean filter, or other filters.
[0143] In this embodiment of the invention, the reference optical axis refers to the reference line formed when the optical axis of the preset image acquisition device is aligned with the target vehicle image.
[0144] The yaw angle determination module 103 is used to calculate the undetermined yaw angle value of the target vehicle based on the distance parameter, and filter the undetermined yaw angle value based on the motion parameter to obtain the yaw angle of the target vehicle.
[0145] As an embodiment of the present invention, the calculation of the undetermined yaw angle of the target vehicle includes:
[0146] Determine the set of diagonals of the 2D rectangle corresponding to the target vehicle;
[0147] Select a reference diagonal from the set of diagonals;
[0148] Determine the reference optical axis of the preset image acquisition device;
[0149] Obtain the left and right endpoint lines of the 2D rectangle;
[0150] The yaw angle of the target vehicle is calculated based on the distance parameter, the reference diagonal, the reference optical axis, the left endpoint line, the right endpoint line, and the included angle of the connecting lines, and the yaw angle value to be determined is obtained.
[0151] In this embodiment of the invention, the left and right endpoint lines of the 2D rectangle refer to the lines connecting the left and right endpoints of the acquired target image to the position of the preset image acquisition device.
[0152] In this embodiment of the invention, the reference diagonal refers to the diagonal determined by the long side and the short side of the 2D rectangle directly opposite the preset image acquisition device.
[0153] Further, the step of calculating the yaw angle of the target vehicle based on the distance parameter, the reference diagonal, the reference optical axis, the left endpoint line, and the right endpoint line includes:
[0154] Obtain the target length and target width of the target vehicle;
[0155] Calculate the diagonal length based on the target length and the target width, and calculate the angle formed by the long side of the target vehicle and the reference diagonal, denoted as the first angle.
[0156] Calculate the angle between the left endpoint line of the 2D rectangle and the reference optical axis to obtain the left endpoint angle;
[0157] Calculate the angle between the right endpoint line of the 2D rectangle and the reference optical axis to obtain the right endpoint angle;
[0158] Calculate the angle between the line connecting the left or right endpoint to the acquisition point of the preset image acquisition device and the long side of the target vehicle;
[0159] The minimum and maximum yaw angles of the target vehicle are calculated based on the first included angle, the included angle of the left endpoint, the included angle of the right endpoint, and the included angle of the connecting line, to obtain the undetermined yaw angle value.
[0160] Furthermore, in this embodiment of the invention, the angle between the left endpoint line of the 2D rectangular frame and the reference optical axis is calculated to obtain the left endpoint angle value, which can be obtained using the following formula:
[0161]
[0162] Where a1 is the included angle value of the left endpoint, x is the x-coordinate of the left endpoint, vpx is the x-coordinate of the point on the target vehicle image where the optical axis of the preset image acquisition device is directly opposite, and ppd is the pixel parameter of the preset image acquisition device.
[0163] Furthermore, in this embodiment of the invention, the angle between the right endpoint line of the 2D rectangular frame and the reference optical axis is calculated to obtain the right endpoint angle value, which can be obtained using the following formula:
[0164]
[0165] Where a2 is the included angle value of the right endpoint, and w is the width of the target vehicle.
[0166] Furthermore, in this embodiment of the invention, the angle between the line connecting the left or right endpoint to the acquisition point of the preset image acquisition device and the target length can be calculated using the following formula:
[0167]
[0168] Wherein, ∠BCO is the angle between the reference diagonal BC and the line connecting the left or right endpoint to the point where the optical axis of the preset image acquisition device is directly opposite the target vehicle image, dist_z is the longitudinal relative distance, a7=∠BCO-a0, where a0 is the arctangent function value of the target width pw and the target length pl, and a0 is the angle formed by the long side of the target vehicle and the reference diagonal.
[0169] As an embodiment of the present invention, the step of filtering the undetermined yaw angle value according to the motion parameters to obtain the yaw angle of the target vehicle includes:
[0170] The lateral velocity threshold and the ratio threshold of the longitudinal relative velocity to the lateral relative velocity are obtained using numerical statistics.
[0171] The yaw angle of the target vehicle is obtained by selecting a unique yaw angle from the undetermined yaw angle values based on the lateral velocity threshold and the ratio threshold.
[0172] In this embodiment of the invention, the numerical statistical method refers to a data processing method that utilizes numerical data. For example, the numerical statistical method can employ methods such as mean calculation and standard deviation calculation.
[0173] Further, the step of selecting a unique yaw angle from the undetermined yaw angle values based on the lateral velocity threshold and the ratio threshold includes:
[0174] The following formula is used to select the unique yaw angle:
[0175]
[0176] Where, sign(·) is the sign function, a1 is the angle between the left and right endpoints, a2 is the angle between the right and left endpoints, a7 is the angle between the line connecting the left or right endpoint to the preset image acquisition point and the long side of the target vehicle, abs(·) is the absolute value function, and rv x For standard lateral relative velocity, rv Z For standard longitudinal relative velocity, rvx thresh The lateral velocity threshold, rv thresh This is the ratio threshold.
[0177] like Figure 11 The diagram shown is a structural schematic of an electronic device for implementing a method for calculating the yaw angle of a target vehicle, according to an embodiment of the present invention.
[0178] The electronic device may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13. It may also include a computer program stored in the memory 11 and capable of running on the processor 10, such as a program for calculating the yaw angle of a target vehicle.
[0179] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 (e.g., executing a program for calculating the yaw angle of a target vehicle) and calls data stored in the memory 11 to perform various functions of the electronic device and process data.
[0180] The memory 11 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a portable hard drive. In other embodiments, the memory 11 can be an external storage device of the electronic device, such as a plug-in portable hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc. Furthermore, the memory 11 can include both internal and external storage units of the electronic device. The memory 11 can be used not only to store application software and various types of data installed on the electronic device, such as code for a method to calculate the yaw angle of a target vehicle, but also to temporarily store data that has been output or will be output.
[0181] The communication bus 12 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory 11 and at least one processor 10, etc.
[0182] The communication interface 13 is used for communication between the aforementioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, Bluetooth interface, etc.), typically used to establish communication connections between the electronic device and other electronic devices. The user interface may be a display, an input unit (such as a keyboard), or, optionally, a standard wired or wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device and to display a visual user interface.
[0183] Figure 11 Only electronic devices with components are shown; those skilled in the art will understand that... Figure 11 The structure shown does not constitute a limitation on the electronic device and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0184] For example, although not shown, the electronic device may also include a power supply (such as a battery) to power the various components. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0185] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.
[0186] The program for calculating the yaw angle of a target vehicle, stored in the memory 11 of the electronic device, is a combination of multiple instructions. When run in the processor 10, it can achieve the following:
[0187] Acquire multi-frame information images of the target vehicle, and calculate the distance parameters between the target vehicle and the preset image acquisition device using a preset ranging algorithm;
[0188] The motion parameters of the target vehicle are calculated using the distance parameters;
[0189] The undetermined yaw angle of the target vehicle is calculated based on the distance parameter, and the undetermined yaw angle is filtered based on the motion parameter to obtain the yaw angle of the target vehicle.
[0190] Specifically, the specific implementation method of the processor 10 for the above instructions can be referred to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, and will not be repeated here.
[0191] Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).
[0192] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor of an electronic device, can perform the following:
[0193] Acquire multi-frame information images of the target vehicle, and calculate the distance parameters between the target vehicle and the preset image acquisition device using a preset ranging algorithm;
[0194] The motion parameters of the target vehicle are calculated using the distance parameters;
[0195] The undetermined yaw angle of the target vehicle is calculated based on the distance parameter, and the undetermined yaw angle is filtered based on the motion parameter to obtain the yaw angle of the target vehicle.
[0196] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.
[0197] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0198] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0199] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0200] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.
[0201] The blockchain referred to in this invention is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.
[0202] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0203] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.
[0204] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for calculating the yaw angle of a target vehicle, characterized in that, The method includes: Acquire multi-frame information images of the target vehicle, and calculate the distance parameters between the target vehicle and the preset image acquisition device using a preset ranging algorithm; The motion parameters of the target vehicle are calculated using the distance parameters, wherein the calculation of the motion parameters of the target vehicle using the distance parameters includes: extracting the longitudinal relative distance from the distance parameters; calculating a set of longitudinal relative velocities within a preset time period based on the longitudinal relative distance; filtering the set of longitudinal relative velocities using a preset filter to obtain a standard longitudinal relative velocity; calculating the lateral relative distance of the target vehicle based on a 2D rectangle, the longitudinal relative distance, and a reference optical axis; calculating a set of lateral relative velocities within a preset time period based on the lateral relative distance; and filtering the set of lateral relative velocities using the preset filter to obtain a standard lateral relative velocity. The undetermined yaw angle of the target vehicle is calculated based on the distance parameters. This calculation includes: determining the set of diagonals of the 2D rectangle corresponding to the target vehicle; selecting a reference diagonal from the set of diagonals; determining the reference optical axis of the preset image acquisition device; obtaining the left and right endpoints of the 2D rectangle; and calculating the yaw angle of the target vehicle based on the distance parameters, the reference diagonal, the reference optical axis, the left endpoint, and the right endpoint to obtain the undetermined yaw angle. The calculation of the yaw angle based on the distance parameters, the reference diagonal, the reference optical axis, the left endpoint, and the right endpoint includes: obtaining the target length and target width of the target vehicle; calculating the diagonal length based on the target length and target width; calculating the angle formed by the long side of the target vehicle and the reference diagonal, denoted as the first angle; and calculating the angle between the left endpoint of the 2D rectangle and the reference optical axis. The angle is calculated to obtain the left endpoint angle; the angle between the right endpoint line of the 2D rectangle and the reference optical axis is calculated to obtain the right endpoint angle; the angle between the line connecting the left endpoint or right endpoint to the acquisition point of the preset image acquisition device and the long side of the target vehicle is calculated; the minimum and maximum yaw angles of the target vehicle are calculated based on the first angle, the left endpoint angle, the right endpoint angle, and the angle of the connecting line to obtain the yaw angle undetermined value; and the yaw angle undetermined value is filtered according to the motion parameters to obtain the yaw angle of the target vehicle, wherein the step of filtering the yaw angle undetermined value according to the motion parameters to obtain the yaw angle of the target vehicle includes: obtaining a lateral velocity threshold using numerical statistics, and obtaining a ratio threshold of the ratio of the longitudinal relative velocity to the lateral relative velocity; filtering a unique yaw angle from the undetermined yaw angles based on the lateral velocity threshold and the ratio threshold to obtain the yaw angle of the target vehicle, wherein the unique yaw angle is filtered using the following formula: Where, sign(·) is the sign function, a1 is the angle between the left and right endpoints, a2 is the angle between the right and left endpoints, a7 is the angle between the line connecting the left or right endpoint to the preset image acquisition point and the long side of the target vehicle, abs(·) is the absolute value function, and rv x For standard lateral relative velocity, rv Z For standard longitudinal relative velocity, rvx thresh The lateral velocity threshold, rv thresh This is the ratio threshold.
2. The method for calculating the yaw angle of a target vehicle as described in claim 1, characterized in that, The acquisition of multi-frame information images of the target vehicle includes: Pre-configured target detection and target tracking modules; Multiple frames of raw images are acquired using a pre-set image acquisition device; The target detection module is used to detect the category of objects and the 2D bounding box of objects in the original image, and to filter out the original images containing the target category as multi-frame information images. The target tracking module tracks the target by using the size, position, and category information of the 2D bounding box of the target category in multi-frame information images.
3. A device for calculating the yaw angle of a target vehicle, characterized in that, The apparatus can implement the method for calculating the yaw angle of a target vehicle as described in any one of claims 1 to 2, and the apparatus includes: The distance parameter acquisition module is used to acquire multi-frame information images of the target vehicle and calculate the distance parameters of the target vehicle from the preset image acquisition device using a preset ranging algorithm. A motion parameter calculation module is used to calculate the motion parameters of the target vehicle using the distance parameters. The calculation of the motion parameters using the distance parameters includes: extracting the longitudinal relative distance from the distance parameters; calculating a set of longitudinal relative velocities within a preset time period based on the longitudinal relative distance; filtering the set of longitudinal relative velocities using a preset filter to obtain a standard longitudinal relative velocity; calculating the lateral relative distance of the target vehicle based on a 2D rectangle, the longitudinal relative distance, and the reference optical axis; calculating a set of lateral relative velocities within a preset time period based on the lateral relative distance; and filtering the set of lateral relative velocities using the preset filter to obtain a standard lateral relative velocity. A yaw angle determination module is used to calculate the undetermined yaw angle of the target vehicle based on the distance parameters. The calculation of the undetermined yaw angle of the target vehicle includes: determining the diagonal set of the 2D rectangle corresponding to the target vehicle; selecting a reference diagonal from the diagonal set; determining the reference optical axis of the preset image acquisition device; obtaining the left and right endpoints of the 2D rectangle; and calculating the yaw angle of the target vehicle based on the distance parameters, the reference diagonal, the reference optical axis, the left endpoint, and the right endpoint to obtain the undetermined yaw angle. The calculation of the yaw angle based on the distance parameters, the reference diagonal, the reference optical axis, the left endpoint, and the right endpoint includes: obtaining the target length and target width of the target vehicle; calculating the diagonal length based on the target length and target width; calculating the angle formed by the long side of the target vehicle and the reference diagonal, denoted as the first angle; and calculating the angle between the left endpoint of the 2D rectangle and the reference diagonal. The angle between the reference optical axis and the left endpoint angle is obtained; the angle between the right endpoint line of the 2D rectangle and the reference optical axis is calculated to obtain the right endpoint angle; the angle between the line connecting the left or right endpoint and the acquisition point of the preset image acquisition device and the long side of the target vehicle is calculated; the minimum and maximum yaw angles of the target vehicle are calculated based on the first angle, the left endpoint angle, the right endpoint angle, and the angle of the connecting line to obtain the yaw angle undetermined value; and the yaw angle undetermined value is filtered according to the motion parameters to obtain the yaw angle of the target vehicle, wherein the step of filtering the yaw angle undetermined value according to the motion parameters to obtain the yaw angle of the target vehicle includes: obtaining a lateral velocity threshold using numerical statistics, and obtaining a ratio threshold of the ratio of the longitudinal relative velocity to the lateral relative velocity; filtering a unique yaw angle from the undetermined yaw angles based on the lateral velocity threshold and the ratio threshold to obtain the yaw angle of the target vehicle, wherein the unique yaw angle is filtered using the following formula: Where, sign(·) is the sign function, a1 is the angle between the left and right endpoints, a2 is the angle between the right and left endpoints, a7 is the angle between the line connecting the left or right endpoint to the preset image acquisition point and the long side of the target vehicle, abs(·) is the absolute value function, and rv x For standard lateral relative velocity, rv Z For standard longitudinal relative velocity, rvx thresh The lateral velocity threshold, rv thresh This is the ratio threshold.
4. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the method for calculating the yaw angle of a target vehicle as described in any one of claims 1 to 2.
5. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for calculating the yaw angle of the target vehicle as described in any one of claims 1 to 2.
Citation Information
Patent Citations
Vehicle driving state recognition method and device, storage medium and electronic equipment
CN112406884A
Vehicle course angle detection method and device, equipment and storage medium
CN114091521A