Target vehicle posture detection method based on wheels
By detecting vehicle targets and extracting wheel frame feature points, and calculating the vehicle attitude, it solves the real-time and accuracy problems of target vehicle attitude detection in autonomous driving, and achieves good performance and efficient detection at low speeds.
Patent Information
- Application Number
- CN202010784979.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-06
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-08-06
AI Technical Summary
Existing technologies are difficult to achieve accurate real-time detection of the target vehicle's attitude in autonomous driving, especially at low speeds and congested conditions. Moreover, existing methods require a large amount of annotated data or high computing power support, and cannot meet real-time and accuracy requirements.
The wheel-based target vehicle attitude measurement method is used to detect the vehicle target and extract the feature points of the wheel frame, convert it to the world coordinate system, calculate the vehicle's inclination angle, and use deep learning models and Kalman filtering to improve detection accuracy and efficiency.
It can quickly realize vehicle corner attitude judgment without a large amount of annotated data. It is suitable for low-speed congested road conditions, improves the accuracy and real-time performance of attitude calculation, and is suitable for automatic driving and assisted driving applications.
Smart Images

Figure CN111967360B
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of autonomous driving and computer vision, and in particular to a technology for identifying and analyzing the position and posture of a target vehicle in autonomous driving based on computer vision, and in particular to a method and device for measuring the posture of a target vehicle based on wheels. Background Art
[0002] With the advancement of technology and scientific and technological development, autonomous driving has become a research hotspot in the field of transportation at this stage.
[0003] During the driving process of an autonomous vehicle, the position and posture of the target vehicle play a key role in the control decision. Due to the complex and changeable road conditions and the high speed of the vehicle during the autonomous driving process, in order to improve driving safety, it is necessary to detect the operating status of the target vehicle in real time and accurately, and predict the driving intention of the target vehicle in advance. When the main vehicle automatically changes lanes or is suddenly cut in from the side by other vehicles, it is even more necessary to judge the behavioral intention of the target vehicle in advance, so as to adjust the control decision in real time according to the intention of the target vehicle and ensure safe driving. Therefore, it is particularly important to obtain the posture of the target vehicle, especially the turning angle.
[0004] There are two main methods for obtaining vehicle turning angle and vehicle driving intention in the prior art:
[0005] 1) Prediction through neural network;
[0006] 2) Use the historical trajectory calculation method.
[0007] Chinese patent document CN110232379A (invention title: A vehicle posture detection method and system) proposes a method for vehicle posture detection using a target detection network model, which detects the image area of the target vehicle in the image to be detected, and outputs the tilt angle of the target vehicle at the same time when the network model makes a prediction. However, this method requires a large amount of vehicle annotation data with angles for training, which is not suitable for actual implementation, and the stability of the results obtained by the detection method is poor, which cannot meet the actual use needs.
[0008] US Patent Document US20030235332A1 (Invention Name: System and Method for Pose-angle Estimation) proposes a method for pose detection, which uses a target detection network and a regression estimation neural network training to detect the angle pose of the input image. However, this method also requires a large amount of annotated data of pose images with angles for training, and the detection result depends on the accuracy of data calibration; and the use of neural networks for prediction consumes a lot of computation, which is not conducive to the real-time requirements of vehicle pose detection in autonomous driving.
[0009] Chinese patent document CN109305171A (Invention Title: A device and method for observing the driving posture of a vehicle ahead) uses the comparison between the position of the front wheels of the vehicle and the lane line to determine the driving safety of the vehicle ahead, but does not provide vehicle posture information.
[0010] Chinese patent document CN109949364A (Invention title: A method for optimizing vehicle posture detection accuracy based on a road test monocular camera) introduces a method for estimating the vehicle's direction of travel based on vehicle trajectory tracking. However, this method requires knowing the vehicle's historical trajectory and is not very effective at low speeds.
[0011] The prediction method using neural networks requires a large amount of vehicle posture data collection and requires high calibration accuracy. The heavy workload is not conducive to the rapid realization of vehicle posture estimation, and generally requires a large computing power support from the computing platform, with poor real-time performance, making it difficult to apply in actual autonomous driving.
[0012] The method of using historical trajectory extrapolation is only applicable to medium and high speed conditions. It is difficult to implement at low speeds and in congested conditions, and it is impossible to obtain the posture of the target vehicle.
[0013] Therefore, how to perform real-time and accurate posture detection of targets within a large range has become a technical problem that needs to be solved urgently. Summary of the invention
[0014] In view of the above technical problems, the present invention proposes a new wheel-based target vehicle posture measurement method and device in order to study a target vehicle posture measurement system with a large adaptability range, high measurement accuracy and low computational consumption, and improve the accuracy and efficiency of front vehicle target detection in automatic driving. First, the wheel frame is detected and extracted in the vehicle target two-dimensional frame, and then the pixel coordinates of the feature points of the wheel frame are detected and converted to the world coordinate system to obtain the center coordinates of the two wheels of the vehicle. Finally, the inclination posture of the vehicle is obtained according to the connecting line of the center coordinates.
[0015] To solve the above technical problems, according to one aspect of the present invention, a method for detecting a target vehicle posture based on wheels is provided, comprising:
[0016] Step 1, get the current camera image;
[0017] Step 2: input the acquired current camera image, perform vehicle target detection on the input image, and obtain the vehicle target;
[0018] Step 3, performing wheel detection on the vehicle target to obtain a wheel target;
[0019] Step 4: extract the feature points of two wheels on the same side from the wheel target;
[0020] Step 5: Obtain the inclination angle of the vehicle using the line connecting the coordinates of the two wheel feature points on the same side.
[0021] Preferably, before acquiring the current camera image, the camera needs to be calibrated, including calibrating the camera's intrinsic parameters and extrinsic parameters;
[0022] The camera intrinsic parameter matrix is shown in formula (1):
[0023]
[0024] Among them, f x , f y Respectively represent the focal length of the camera in the X and Y coordinate directions, p x , p y Indicates the offset of the camera center point relative to the upper left corner;
[0025] The camera extrinsic parameter matrix is shown in formula (2):
[0026]
[0027] Among them, r ij (i=1,2,3;j=1,2,3) represents the elements of the rotation matrix of the camera relative to the world coordinate system, t i (i=1,2,3) represents the translation relationship between the camera coordinate system and the world coordinate system;
[0028] Furthermore, the relationship matrix EM between the camera intrinsic parameters and extrinsic parameters is as shown in formula (3):
[0029]
[0030] Among them, m ij (i=1,2,3; j=1,2,3,4) represents the elements of the parameter matrix composed of the camera intrinsic parameters and extrinsic parameters.
[0031] Preferably, the camera comprises an RGB camera, an infrared camera or a depth camera.
[0032] Preferably, the camera is a camera installed at the front end of the vehicle.
[0033] Preferably, a trained deep learning model is used for vehicle target detection to obtain the two-dimensional box of the vehicle target V, that is, the coordinates and size (x, y, w, h) of the target box in the image, where (x, y) represents the coordinates of the upper left corner of the two-dimensional box, and w and h are the width and height of the two-dimensional box.
[0034] Preferably, wheel detection is performed in the acquired target frame to obtain the wheel frame in the image, which is represented by W i (x i ,yi ,w i ,h i ), where i = 1, 2...N, N represents the number of wheels detected, and x i ,y i 、w i and h i They represent the x-coordinate, y-coordinate, wheel frame width and height of the upper left corner of the wheel frame respectively.
[0035] Preferably, the vehicle targets within the camera field of view are first divided into left targets and right targets, and then the wheels of the left vehicle and the right vehicle are detected respectively to extract the required two wheel frames on the same side;
[0036] Extract the detected wheel frame W i (x i ,y i ,w i ,h i )’s pixel coordinates P i (u i ,v i ), transform the pixel coordinates of these feature points into the world coordinate system, and obtain the coordinates in the world coordinate system
[0037] Based on the world coordinates of the wheels obtained in the above process, the top, center or bottom coordinates of the two wheels of the vehicle are obtained, and the inclination attitude of the vehicle is obtained according to the connecting line of the top, center or bottom coordinates of the two wheels.
[0038] Preferably, a trained deep neural network model is used to detect wheels in the vehicle target frame, and the detection result is the coordinates and size W of the wheel in the image. i (x i ,y i ,w i ,h i ).
[0039] Preferably, the feature point detection of the wheel uses a segmentation map of the target vehicle frame and the corresponding vehicle, wherein the segmentation map is obtained based on a deep neural network segmentation model.
[0040] Preferably, the detection of the target vehicle wheel feature points comprises the following steps:
[0041] Step 1), according to the position of the target vehicle in the current image, it is divided into two cases: left and right: if the horizontal coordinate x+w / 2 of the center point of the target vehicle frame is on the left side of the image, it is considered that the target vehicle is on the left side of the current vehicle; if x+w / 2 is on the right side of the image, it is considered that the target vehicle is on the right side of the current vehicle;
[0042] Step 2): When the target vehicle is on the right side of the current vehicle, first, within the target box image area, search from bottom to top based on the vehicle pixels in the segmentation map to find the coordinates of the first row of vehicle pixel points, which are used as the first wheel reference coordinate P w1 , then within the coordinate neighborhood δ, count the number of vehicle pixels and calculate the first ratio r of the number of vehicle pixels in the entire neighborhood δ wpix1 . If r wpix1 is greater than the first threshold T wpix1 , then this coordinate is considered valid; otherwise, it is considered invalid, and continue to search upward;
[0043] Step 3): Using the wheel reference coordinate P w1 that meets the conditions in the above step as the starting point, and a point on the right boundary of the vehicle target box as the end point P wr (x + w, y + h - s), form a scan line, where s is the number of scans and 0 < s < h. The scanning order is that s increases from 1. Then count the second ratio r of the number of vehicle pixel points on this scan line to the entire scan line spix . If r spix is greater than the second threshold T spix , then this line is considered a valid vehicle scan line. Then, on this scan line, find a point closest to the end point as the second wheel reference coordinate P w2 . Then within the coordinate neighborhood δ of this coordinate, count the number of vehicle pixels and calculate the third ratio r of the number of vehicle pixels in the entire neighborhood δ wpix2 . If r wpix2 is greater than the third threshold T wpix2 , then this coordinate is considered valid; otherwise, it is considered invalid, and continue scanning;
[0044] Step 4): If valid coordinates are found after the scanning in the above steps, then take P w1 and P w2 as vehicle feature points;
[0045] Step 5): When the target vehicle is on the left side of the current vehicle, then in Step 3), represent the coordinates of the end point P wr as (x, y + h - s), and the rest of the steps are the same.
[0046] Preferably, when the image resolution is 640×480, the size of the neighborhood δ is taken as a 5×5 rectangular neighborhood, the first threshold T wpix1 takes a value of 0.2, the second threshold T spix takes a value of 0.2, and the third threshold T wpix2 takes a value of 0.2.
[0047] Preferably, use the deep learning method to detect the visible ratio or occlusion ratio of the wheels;
[0048] If the visible ratio is greater than the fourth threshold T vis , then the wheel is considered to appear complete in the image;
[0049] If the occlusion ratio is less than the fifth threshold T hid , the wheel is considered to appear complete in the image.
[0050] Preferably, if the detected wheel frame W i (x i ,y i ,w i ,h i ) Bottom vertical coordinate y bi =y i +h i The bottom vertical coordinate y of the two-dimensional box of the vehicle target V b = The difference between y and h δy = abs(y bi -y b ) is less than the sixth threshold T, and y b If the difference with the bottom edge of the image is also smaller than the sixth threshold T, it is considered that the wheel appears incomplete in the image at this time.
[0051] Preferably, the sixth threshold T is 5 px when the original image resolution is 640×480.
[0052] Preferably, when the wheel appears complete in the image, the point where the bottom of the wheel contacts the ground is used as the feature point; when the wheel appears incomplete in the image, the midpoint of the top of the wheel is used as the feature point.
[0053] Preferably, if the target vehicle has more than two wheels on one side, all N wheels on the same side are detected. w All wheels are detected, and N wheels on the same side of the vehicle are selected. w feature point coordinates, the N w >2, obtain the wheel straight line equation y by fitting method w =k w x w +b w , then select N w N in wheels w The x coordinates of the two coordinates with the largest and smallest horizontal coordinates among the feature points are denoted as x wmax and x wmin , substitute into the wheel straight line equation y w =k w x w +b w Find the corresponding two y coordinates, denoted as y wmax and wmin , and obtain the wheel feature point coordinates for the final calculation of the vehicle posture.
[0054] Preferably, the target vehicle model is a van, a large truck or an engineering vehicle.
[0055] Preferably, the pixel coordinates of the feature points are transformed into a world coordinate system using a perspective transformation matrix.
[0056] Preferably, the pixel coordinates of the feature points are converted into the world coordinate system using formulas (4) and (5):
[0057]
[0058] in,
[0059]
[0060] Among them, m ij (i=1,2,3;j=1,2,3,4) represents the elements of the parameter matrix composed of the camera internal and external parameters; u i 、v i represents the x-coordinate and y-coordinate of the wheel frame feature point numbered i in the image coordinate system; z represents the coordinate value of the feature point on the Z axis in the world coordinate system; x i w ,y i w They respectively represent the X-axis and Y-axis coordinate values of the pixel coordinates in the world coordinate system.
[0061] Preferably, when the point where the bottom of the wheel contacts the ground is used as the feature point, z=0. In this case, formulas (4) and (5) are simplified to the form of formulas (6) and (7):
[0062]
[0063] Preferably, when the midpoint of the wheel top is used as the feature point, z=D wheel , where D wheel Indicates the diameter of the wheel.
[0064] Preferably, whether the vehicle target is driving on the left side (LEFT) or the right side (RIGHT) is determined based on the position where the vehicle target appears in the field of view; if it is driving on the left side (LEFT), the two side wheels of the target vehicle seen in the field of view are located on the right side of the target frame; conversely, if the target vehicle is driving on the right side (RIGHT), the two side wheels of the target vehicle seen are on the left side of the target frame.
[0065] Preferably, for the feature point pixel coordinate P i (u i ,v i), if all detected wheels appear in the field of view as a whole, the contact point between the bottom of the wheel and the ground is used as the feature point, which is expressed as formula (8)
[0066]
[0067] Preferably, for the feature point pixel coordinate P i (u i ,v i ), if the wheel is detected to be incomplete in the image, the midpoint of the top of the wheel is used as the wheel feature point, which is expressed as formula (9)
[0068]
[0069] At this time, when calculating the conversion of the points on the image to the world coordinate system, the points (A, B, C, D) in the world coordinate system taken during the perspective transformation matrix calculation process are not on the ground plane, but on the parallel ground plane z = D wheel , where D wheel Indicates the diameter of the wheel.
[0070] Preferably, the pixel coordinates of the feature points are converted to a world coordinate system, including:
[0071] The rectangular range formed by four points in the fixed world coordinate system, denoted as points A, B, C, and D, can be used as a bird's-eye view to represent the area;
[0072] By using the camera extrinsic matrix and intrinsic matrix, the four points in the world coordinate system are transformed into the image coordinate system, as shown in formula (10):
[0073]
[0074] Among them, [Xw s Y s Z s ], (s = A, B, C, D), represents the coordinates of the four points A, B, C, D in the world coordinate system, Zc represents the value of the coordinate Z axis direction of the corresponding point in the camera coordinate system, [u s ,v s ], (s=A, B, C, D), is the coordinate of the corresponding point in the image coordinate system.
[0075] Preferably, the four vertices of the bird's-eye view are taken as reference points for perspective transformation, and combined with the four points in the original image coordinate system to obtain the perspective transformation matrix Warp from the original image to the bird's-eye view;
[0076] According to the scale relationship between the four points in the world coordinate system and the scale relationship between the bird's-eye view image, the proportional relationship G between the pixel value in the bird's-eye view image and the coordinate in the world coordinate system is calculated. w ;
[0077] Then the points in the image coordinate system are transformed to the world coordinate system through formula (11):
[0078]
[0079] Among them, Z t In the formula, x has no practical meaning; i w ,y i w They represent the x-coordinate value and y-coordinate value of the pixel coordinate in the world coordinate system respectively.
[0080] Preferably, the calculation steps of the transformation matrix Warp are as follows:
[0081] Step 1) Take 4 points on the ground in the world coordinate system As the 4 vertices in the bird's eye view, where i = 1, 2, 3, 4 represents the index of the point, is the coordinate value in the world coordinate system; in the world coordinate system, these four points form a rectangle, the sides of the rectangle are parallel to the coordinate axes in the world coordinate system, and in the bird's-eye view, the coordinates of the four vertices are W img , H img All are coordinate values in the world coordinate system;
[0082] Step 2) According to the camera internal and external parameters, the above four points Projected to image coordinates, expressed as Where i = 1, 2, 3, 4 represents the index of the point, is the coordinate value in the image coordinate system;
[0083] Step 3) Through the above points and The corresponding relationship forms the following set of equations:
[0084]
[0085] Solve the homography matrix Warp between the bird's-eye view image and the original image.
[0086] Preferably, if the wheel feature point is the position where the wheel contacts the ground, then If the wheel feature point is the wheel center, then If the wheel feature point is the top of the wheel, then
[0087] Obtain the wheel diameter D based on the trained deep neural network wheel .
[0088] Preferably, when the wheel is running on the ground, the actual height Z of the wheel feature at this time isw Recorded as 0.
[0089] Preferably, the world coordinates of the two wheel feature points are recorded as Where Z w represents the actual height of the wheel feature; then the vehicle's attitude angle is as shown in formula (12):
[0090]
[0091] Preferably, a motion model is used to track vehicle coordinates and pose.
[0092] Preferably, the CTRV motion model is used to track and filter the coordinates and posture of the vehicle, and the coordinate values and vehicle posture values calculated for each frame of image are used as observations, and the Kalman tracking method is used for prediction.
[0093] To solve the above technical problems, according to another aspect of the present invention, a target vehicle posture detection device based on wheels is provided, comprising:
[0094] An image acquisition device, which acquires a current camera image;
[0095] A vehicle target detection device, inputting the acquired current camera image, performing vehicle target detection on the input image, and obtaining a vehicle target;
[0096] A wheel target detection device performs wheel detection on the vehicle target to obtain a wheel target;
[0097] The same-side wheel extraction device extracts the characteristic points of two wheels on the same side from the wheel target;
[0098] The inclination attitude calculation device obtains the inclination attitude of the vehicle by using the connecting line of the coordinates of the two wheel feature points on the same side.
[0099] Beneficial effects of the present invention:
[0100] 1. The present invention can quickly judge the vehicle corner posture without marking the vehicle posture, and still has good performance under low-speed congested road conditions; it not only overcomes the shortcomings of the existing prediction through neural network that requires a large amount of vehicle posture data calibration and cannot guarantee real-time performance, but also solves the problem that the traditional historical trajectory estimation method is only applicable to medium and high speed conditions but cannot be applied to low speed conditions;
[0101] 2. Using wheels as the main basis for attitude judgment and performing attitude estimation under a bird's-eye view improves the accuracy of attitude calculation and enables real-time and accurate attitude detection of targets within a large range;
[0102] 3. The wheel-based target vehicle posture estimation method of the present invention is simple and easy to implement, has high estimation accuracy, and is suitable for practical application in automatic driving or assisted driving. BRIEF DESCRIPTION OF THE DRAWINGS
[0103] The accompanying drawings illustrate exemplary embodiments of the present invention and are used to explain the principles of the present invention together with the description thereof. These drawings are included to provide a further understanding of the present invention and are included in and constitute a part of this specification. The above and other purposes, features and advantages of the present invention will become more apparent by describing the embodiments of the present invention in detail in conjunction with the accompanying drawings.
[0104] Figure 1 is a flow chart of a method for calculating the attitude of a target vehicle based on wheels;
[0105] Figure 2 It is the coordinates and size diagram of the two-dimensional box of the vehicle target in the image;
[0106] Figure 3 It is a flow chart of obtaining wheel feature points based on the segmentation graph;
[0107] Figure 4 The wheel feature point result map is obtained based on the segmentation map;
[0108] Figure 5 It is a flow chart of the conversion from original image coordinates to world coordinates;
[0109] Figure 6 It is the perspective transformation relationship diagram from the original image to the bird's-eye view;
[0110] Figure 7 It is the original image and its bird's-eye view after perspective transformation;
[0111] Figure 8 is the vehicle’s attitude angle;
[0112] Fig. 9 It is the actual target vehicle posture measurement result diagram. DETAILED DESCRIPTION
[0113] The present invention will be further described in detail below in conjunction with the accompanying drawings and implementations. It is to be understood that the specific implementations described herein are only used to explain the relevant content, rather than to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention are shown in the accompanying drawings.
[0114] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0115] Unless otherwise specified, the exemplary embodiments / embodiments shown will be understood as providing exemplary features of various details of some ways in which the technical concept of the present disclosure can be implemented in practice. Therefore, unless otherwise specified, the features of the various embodiments / embodiments can be combined, separated, interchanged and / or rearranged without departing from the technical concept of the present disclosure.
[0116] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments / methods or examples described in this specification and the features of the different embodiments / methods or examples, unless they are contradictory.
[0117] In view of the problem that the method of predicting by neural network in the prior art requires a large amount of vehicle posture data collection and has poor real-time performance, and the method of using historical trajectory estimation is difficult to implement under low speed and congestion conditions, the present invention proposes a new method for calculating the target vehicle posture based on wheels. The flowchart of the method for calculating the target vehicle posture based on wheels is shown in FIG. Figure 1 As shown, it mainly includes the following steps:
[0118] Step 1: Get the camera image;
[0119] Step 2: collecting the image, detecting the vehicle target from the image, and detecting the relevant wheels of the vehicle;
[0120] Step 3: Select the feature points of the wheel on the same side according to the completeness of the wheel;
[0121] Step 4: Use camera extrinsics to transform the wheel feature points into a world coordinate system;
[0122] Step 5: Calculate the vehicle posture using the world coordinates of the wheel feature points;
[0123] Step 6: Use Kalman tracking to reduce measurement errors.
[0124] Before acquiring camera images, the camera parameters need to be calibrated.
[0125] 1) Calibrate the camera's internal and external parameters: Calibrate the camera's internal and external parameters to obtain the camera's internal parameter matrix as follows:
[0126]
[0127] Among them, f x , f y Indicates the focal length of the camera in the x and y directions, p x , p y Indicates the offset of the camera center point relative to the upper left corner. The above parameters can be obtained through calibration methods.
[0128] The camera extrinsic matrix is as follows:
[0129]
[0130] Among them, r ij (i=1,2,3;j=1,2,3) represents the rotation matrix of the camera relative to the world coordinate system, t i (i=1,2,3) represents the translation relationship of the camera coordinate system relative to the world coordinate system.
[0131] And the relationship between the internal and external parameters of the camera is recorded as:
[0132]
[0133] 2) Vehicle target detection and wheel detection: The camera is installed at the front end of the vehicle. The camera is used to collect images and obtain an image, which is denoted as I. The trained deep learning model is used for target detection, such as Figure 2 As shown, the coordinates and size (x, y, w, h) of the two-dimensional box of the vehicle target V in the image can be obtained, where (x, y) represents the coordinates of the upper left corner of the two-dimensional box, and w and h are the sizes of the two-dimensional box.
[0134] In the acquired target frame, the wheel frame in the image is obtained by using the wheel detection and extraction method, which is represented by W i (x i ,y i ,w i ,h i ), as the basis for subsequent calculations, where i = 1, 2...N, N represents the number of wheels detected, and x i ,y i 、w i and h i They respectively represent the x-coordinate, y-coordinate, wheel frame width and height of the upper left corner of the wheel frame.
[0135] 3) Vehicle target posture calculation:
[0136] When the number of detectable wheels N of a vehicle target V is ≥ 2, the following steps can be used to calculate the vehicle's posture:
[0137] Check the wheel frames of the left vehicle and the right vehicle respectively, and extract the two wheels on the same side required;
[0138] Select the wheel frame W detected in the above steps i The pixel coordinates of the feature point P i (u i ,v i ), transform these feature points into the world coordinate system, and obtain the coordinates in the world coordinate system
[0139] Based on the world coordinates of the bottom (or top) of the wheel obtained in the above process, the center coordinates of the two wheels of the vehicle can be obtained, and the inclination attitude of the vehicle can be obtained according to the connecting line of the center coordinates.
[0140] In addition, for occasions where the real-time requirements for transformation are not so strict or the vehicle posture detection system has a high configuration and strong computing power, the following formula can be used to convert the pixel coordinates of the feature point into the world coordinate system:
[0141]
[0142] in,
[0143]
[0144] Gc=m 11 ·m 22 -m 12 ·m 21 +
[0145] (m 21 ·m 32 -m 22 ·m 31 )·u i -
[0146] (m 11 ·m 32 -m 12 ·m 31 )·v i
[0147] Among them, m ij (i=1,2,3;j=1,2,3,4) represents the elements of the parameter matrix composed of the camera internal and external parameters; u i 、v i represents the x-coordinate and y-coordinate of the wheel frame feature point numbered i in the image coordinate system; z represents the value of the feature point in the Z axis of the world coordinate system; x i w ,y i wThey represent the x-coordinate value and y-coordinate value of the pixel coordinate in the world coordinate system respectively.
[0148] When the point where the bottom of the wheel contacts the ground is used as the feature point, z = 0. In this case, formulas (4) and (5) are simplified to formulas (6) and (7):
[0149]
[0150]
[0151] When the midpoint of the wheel top is used as the feature point, z = D wheel , where D wheel Indicates the diameter of the wheel.
[0152] The characteristic of the formula transformation method is that it only needs to calculate the coordinate points that need to be converted at present, but the calculation process is relatively complicated. It can be used directly when the system configuration is high and the computing power is strong. For embedded platforms in autonomous driving, due to limited computing power and high real-time requirements, the direct perspective transformation method is used for coordinate transformation. At this time, it is only necessary to calculate the world coordinate value corresponding to each pixel in the image in advance. When the coordinate transformation is performed later, the coordinate mapping interface is directly used, and the transformation speed is fast, which is suitable for embedded real-time computing platforms. The use of the direct perspective transformation method for coordinate transformation greatly reduces the system computing consumption and ensures the calculation accuracy. It is suitable for both medium and high speed detection and low speed detection. It is a simple and widely applicable fast calculation method.
[0153] 3.1) Same-side wheel detection method
[0154] If the number of wheels detected for the same vehicle target is N>2, it is necessary to extract the wheels belonging to the same side of the vehicle.
[0155] If the target vehicle has more than two wheels on one side, all N wheels on the same side will be w All wheels are detected, and N wheels on the same side of the vehicle are selected. w feature point coordinates, the N w >2, obtain the wheel straight line equation y by fitting method w =k w x w +b w , then select N w N in wheels w The x coordinates of the two coordinates with the largest and smallest horizontal coordinates among the feature points are denoted as x wmax and x wmin , substitute into the wheel straight line equation y w =k w xw +b w Find the corresponding two y coordinates, denoted as y wmax and wmin , and obtain the wheel feature point coordinates for the final calculation of the vehicle posture.
[0156] like Figure 2 As shown, first determine whether the vehicle target is driving on the left side (LEFT in the figure) or the right side (RIGHT in the figure) according to the position of the vehicle target in the field of view; if it is driving on the left side (LEFT), the two side vehicles of the target vehicle that can be seen in the field of view should be located on the right side of the target frame; conversely, if the target vehicle is driving on the right side (RIGHT), the visible wheels should be on the left side of the target frame.
[0157] 3.2) Feature point pixel coordinates P i (u i ,v i )
[0158] Generally, if all detected wheels appear in the field of view as a whole, the contact point between the bottom of the wheel and the ground is used as the feature point.
[0159]
[0160] In practice, when a vehicle just enters or disappears from the field of view, the wheel may appear incomplete in the image. In the case of an incomplete wheel, the midpoint of the bottom of the wheel cannot be obtained. In this case, the midpoint of the top of the wheel is used as the wheel feature point P. i (u i ,v i ).
[0161] At this time, when calculating the conversion of the points on the image to the world coordinate system, the points (A, B, C, D) in the world coordinate system taken during the perspective transformation matrix calculation process are not on the ground plane, but on the ground plane parallel to the ground plane Z. w =D wheel , where D wheel Indicates the diameter of the wheel.
[0162]
[0163] How to judge whether the wheel is complete:
[0164] Determine the wheel frame W detected in the above steps i Check whether the wheel image is complete as follows:
[0165] If the wheel frame W i Bottom vertical coordinate y bi =y i +hi The bottom y of the two-dimensional box with the target V b = The difference between y and h δy = abs(y bi -y b ) is less than the acceptable threshold T, and y b If the difference with the bottom edge of the image is also less than the threshold T, it can be considered that the wheel is incomplete. Generally, T can be 5px.
[0166] 3.3) Conversion of original image coordinates to world coordinates
[0167] Figure 5 This is a flow chart of the conversion of the original image coordinates to the world coordinates of the present invention. The conversion uses the direct perspective transformation method to perform the coordinate transformation. It is only necessary to calculate the world coordinate value corresponding to each pixel in the image once in advance. When the coordinate transformation is performed later, the coordinate mapping interface is directly used. The transformation speed is fast and it is suitable for embedded real-time computing platforms. The specific process is as follows:
[0168] 3.3.1) A rectangular range consisting of four points (A, B, C, D) in a fixed world coordinate system can be used as a bird's-eye view to represent the area; the perspective transformation relationship is as follows Figure 6 As shown;
[0169] 3.3.2) By using the camera extrinsic matrix and intrinsic matrix, the four points in the world coordinate system are transformed into the image coordinate system.
[0170]
[0171] Among them, [Xw s Y s Z s ](s=A,B,C,D), represents the coordinates of the four points A, B, C, and D in the world coordinate system, Zc represents the value of the coordinate Z axis direction of the corresponding point in the camera coordinate system, [u s ,v s ](s=A,B,C,D) is the coordinate of the corresponding point in the image coordinate system. Generally, since the wheels are running on the ground, Z here ws Recorded as 0.
[0172] 3.3.3) Take the four vertices of the bird's-eye view as reference points for perspective transformation, and combine them with the four points in the original image coordinate system obtained in the previous step to obtain the perspective transformation matrix Warp from the original image to the bird's-eye view.
[0173] 3.3.4) According to the scale relationship between the four points in the world coordinate system and the scale relationship of the bird's-eye view, calculate the proportional relationship G between the pixel value in the bird's-eye view and the coordinates in the world coordinate system w ; The effect after conversion is as follows Figure 7 As shown, Figure 7(a) is the original image. Figure 7 (b) is a bird’s-eye view.
[0174] 3.3.5) Then the points in the image coordinate system can be transferred to the world coordinate system by the following formula
[0175]
[0176] Among them, Z t It has no practical meaning in the formula.
[0177] The calculation steps of the transformation matrix Warp are as follows:
[0178] Step 1) Take 4 points on the ground in the world coordinate system As the 4 vertices in the bird's eye view, where i = 1, 2, 3, 4 represents the index of the point, is the coordinate value in the world coordinate system; in the world coordinate system, these four points form a rectangle, the sides of the rectangle are parallel to the coordinate axes in the world coordinate system, and in the bird's-eye view, the coordinates of the four vertices are W img , H img All are coordinate values in the world coordinate system;
[0179] Step 2) According to the camera internal and external parameters, the above four points Projected to image coordinates, expressed as Where i = 1, 2, 3, 4 represents the index of the point, is the coordinate value in the image coordinate system;
[0180] Step 3) Through the above points and The corresponding relationship forms the following set of equations:
[0181]
[0182] Solve the homography matrix Warp between the bird's-eye view image and the original image.
[0183] Calculation of vehicle attitude angle:
[0184] The world coordinates of the two wheel feature points calculated through the above steps are: Where Z w To calculate the actual height of the wheel feature, the vehicle's attitude angle can be calculated as:
[0185]
[0186] like Figure 8 As shown, the coordinates of the center position of the vehicle are P c (x c ,yc ), where W and L are the track width and wheelbase of the target vehicle, respectively.
[0187] 4) Use the motion model to track the vehicle coordinates and posture to obtain stable measurement results
[0188] For example, the CTRV motion model can be used to track and filter the coordinates and posture of the vehicle, and the coordinate values and vehicle posture values calculated for each frame of the image can be used as observations, and the Kalman tracking method can be used for prediction.
[0189] Fig. 9 This is a diagram of the target vehicle calculation results calculated using the method proposed in this patent. From the top view on the right, it can be seen that the target posture obtained using this method is consistent with the actual posture of the vehicle, and the purpose of measuring the target vehicle posture can be achieved.
[0190] It can be seen that the present invention can quickly judge the vehicle's turning posture without marking the vehicle's posture, and still has good performance under low-speed congested road conditions; it not only overcomes the shortcomings of the existing prediction through neural networks that require a large amount of vehicle posture data calibration and cannot guarantee real-time performance, but also solves the problem that the traditional historical trajectory calculation method is only applicable to medium and high speed conditions but cannot be applied under low speed conditions; the present invention uses wheels as the main basis for posture judgment, and performs posture estimation under a bird's-eye view, which improves the accuracy of posture calculation and can perform real-time and accurate posture detection of targets within a large range; the method is simple and easy to implement, has high measurement accuracy, and is suitable for practical application in automatic driving or assisted driving.
[0191] So far, the technical scheme of the present invention has been described in conjunction with the preferred implementation methods shown in the accompanying drawings. However, those skilled in the art should understand that the above implementations are only for the purpose of clearly illustrating the present invention, and are not intended to limit the scope of the present invention. The protection scope of the present invention is obviously not limited to these specific implementations. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical schemes after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A target vehicle posture detection method based on wheels, characterized in that: include: Step 1, get the current camera image; Step 2: input the acquired current camera image, perform vehicle target detection on the input image, and obtain the vehicle target; Step 3, performing wheel detection on the vehicle target to obtain a wheel target; Step 4: extract the feature points of two wheels on the same side from the wheel target; Step 5, obtaining the inclination angle posture of the vehicle by using the line connecting the coordinates of the two wheel feature points on the same side; Among them, firstly, the vehicle targets in the camera field of view are divided into left targets and right targets, and then the wheels of the left and right vehicles are detected respectively to extract the required two wheel frames on the same side; Extract the detected wheel frame W i (x i ,y i ,w i ,h i )’s pixel coordinates P i (u i ,v i ), transform the pixel coordinates of these feature points into the world coordinate system, and obtain the coordinates in the world coordinate system Among them, the wheel detection is performed in the acquired target frame to obtain the wheel frame in the image, which is represented by W i (x i ,y i ,w i ,h i ), where i = 1, 2...N, N represents the number of wheels detected, and x i ,y i 、w i and h i Respectively represent the x-coordinate, y-coordinate, wheel frame width and height of the upper left corner of the wheel frame; Based on the obtained world coordinates of the wheels, the top, center or bottom coordinates of the two wheels of the vehicle are obtained, and the inclination attitude of the vehicle is obtained according to the connecting line of the top, center or bottom coordinates of the two wheels; Among them, the feature point detection of the wheel uses the target vehicle frame and the segmentation map of the corresponding vehicle, where the segmentation map is obtained based on the deep neural network segmentation model; The detection of the target vehicle wheel feature points comprises the following steps: Step 1), according to the position of the target vehicle in the current image, it is divided into two cases: left and right: if the horizontal coordinate x+w / 2 of the center point of the target vehicle frame is on the left side of the image, it is considered that the target vehicle is on the left side of the current vehicle; if x+w / 2 is on the right side of the image, it is considered that the target vehicle is on the right side of the current vehicle; Step 2), when the target vehicle is on the right side of the current vehicle, firstly, in the target frame image area, based on the vehicle pixels in the segmentation map, search from bottom to top to find the coordinates of the first row of vehicle pixels as the first wheel reference coordinates P w1 Then, within this coordinate neighborhood δ, the first proportion r of the number of vehicle pixels in the entire neighborhood δ is counted wpix1 , if r wpix1 Greater than the first threshold T wpix1 , then the coordinates are considered valid, otherwise they are considered invalid and the search continues upwards; Step 3): Using the wheel reference coordinate P that meets the conditions in the above steps w1 as the starting point and a point on the right boundary of the vehicle target box as the ending point P wr (x + w, y + h - s), to form a scan line, where s is the number of scans, and 0 < s < h. The scanning order is that s increases from 1, and then count the second ratio r of the vehicle pixel points on this scan line to the entire scan line spix . If r spix is greater than the second threshold T spix , then consider this line as a valid vehicle scan line. Then, on this scan line, find a point closest to the ending point as the second wheel reference coordinate P w2 . Then, within the neighborhood δ of this coordinate, count the third ratio r of the number of vehicle pixels to the entire neighborhood δ wpix2 . If r wpix2 is greater than the third threshold T wpix2 , then consider this coordinate valid, otherwise consider this coordinate invalid and continue scanning; Step 4) If valid coordinates are found after scanning in the above steps, take P w1 and P w2 is the vehicle feature point; Step 5), when the target vehicle is on the left side of the current vehicle, the end point P is set in step 3). wr The coordinates of are expressed as (x,y+hs), and the rest of the steps are the same.
2. The wheel-based target vehicle posture detection method according to claim 1, characterized in that: Before acquiring the current camera image, the camera needs to be calibrated, including calibrating the camera's internal and external parameters; The camera intrinsic parameter matrix is shown in formula (1): Among them, f x , f y Respectively represent the focal length of the camera in the X and Y coordinate directions, p x , p y Indicates the offset of the camera center point relative to the upper left corner; The camera extrinsic parameter matrix is shown in formula (2): Among them, r ij (i=1,2,3;j=1,2,3) represents the elements of the rotation matrix of the camera relative to the world coordinate system, t i (i=1,2,3) represents the translation relationship between the camera coordinate system and the world coordinate system; Furthermore, the relationship matrix EM between the camera intrinsic parameters and extrinsic parameters is as shown in formula (3): Among them, m ij (i=1,2,3; j=1,2,3,4) represents the elements of the parameter matrix composed of the camera intrinsic parameters and extrinsic parameters.
3. The method for detecting the target vehicle posture based on wheels according to claim 1, characterized in that: The camera includes an RGB camera, an infrared camera or a depth camera.
4. The method for detecting the target vehicle posture based on wheels according to claim 1, characterized in that: The camera is a camera installed at the front end of the vehicle.
5. The wheel-based target vehicle posture detection method according to claim 1, characterized in that: The trained deep learning model is used for vehicle target detection to obtain the two-dimensional box of the vehicle target V, that is, the coordinates and size (x, y, w, h) of the target box in the image, where (x, y) represents the coordinates of the upper left corner of the two-dimensional box, and w and h are the width and height of the two-dimensional box.
6. The wheel-based target vehicle posture detection method according to claim 1, characterized in that: Use the trained deep neural network model to detect wheels in the vehicle target frame. The detection results are the coordinates and size W of the wheels in the image. i (x i ,y i ,w i ,h i ).
7. The wheel-based target vehicle posture detection method according to claim 1, characterized in that: When the image resolution is 640×480, the size of the neighborhood δ is a 5×5 rectangular neighborhood, and the first threshold T wpix1 The value is 0.2, the second threshold T spix The value is 0.2, and the third threshold T wpix2 The value is 0.
2.
8. The method for detecting the target vehicle posture based on wheels according to claim 1, characterized in that: A deep learning method is used to detect the visible ratio or occlusion ratio of the wheel; If the visible ratio is greater than the fourth threshold T vis , then the wheel is considered to appear complete in the image; If the occlusion ratio is less than the fifth threshold T hid , the wheel is considered to appear complete in the image.
9. The method for detecting the target vehicle posture based on wheels according to claim 1, characterized in that: If the detected wheel frame W i (x i ,y i ,w i ,h i ) Bottom vertical coordinate y bi =y i +h i The bottom vertical coordinate y of the two-dimensional box of the vehicle target V b = The difference between y and h δy = abs(y bi -y b ) is less than the sixth threshold T, and y b If the difference with the bottom edge of the image is also smaller than the sixth threshold T, it is considered that the wheel appears incomplete in the image at this time.
10. The method for detecting the target vehicle posture based on wheels according to claim 9, characterized in that: The sixth threshold T is 5 px when the original image resolution is 640×480.
11. The wheel-based target vehicle posture detection method according to claim 8 or 9, characterized in that: When the wheel appears complete in the image, the point where the bottom of the wheel contacts the ground is used as the feature point; when the wheel appears incomplete in the image, the midpoint of the top of the wheel is used as the feature point.
12. The wheel-based target vehicle posture detection method according to claim 1 or 6, characterized in that: If the target vehicle has more than two wheels on one side, all N wheels on the same side will be w All wheels are detected, and N wheels on the same side of the vehicle are selected. w feature point coordinates, the N w >2, obtain the wheel straight line equation y by fitting method w =k w x w +b w , then select N w N in wheels w The x coordinates of the two coordinates with the largest and smallest horizontal coordinates among the feature points are denoted as x wmax and x wmin , substitute into the wheel straight line equation y w =k w x w +b w Find the corresponding two y coordinates, denoted as y wmax and wmin , and obtain the wheel feature point coordinates for the final calculation of the vehicle posture.
13. The wheel-based target vehicle posture detection method according to claim 1 or 6, characterized in that: The target vehicle model is a van, a large truck or an engineering vehicle.
14. The method for detecting the target vehicle posture based on wheels according to claim 1, characterized in that: The pixel coordinates of the feature points are transformed into the world coordinate system using a perspective transformation matrix.
15. The method for detecting the target vehicle posture based on wheels according to claim 1, characterized in that: Formulas (4) and (5) are used to transform the pixel coordinates of the feature points into the world coordinate system. in, Among them, m ij (i=1,2,3;j=1,2,3,4) represents the elements of the parameter matrix composed of the camera internal and external parameters; u i 、v i represents the x-coordinate and y-coordinate of the wheel frame feature point numbered i in the image coordinate system; z represents the coordinate value of the feature point on the Z axis in the world coordinate system; x i w ,y i w They respectively represent the X-axis and Y-axis coordinate values of the pixel coordinates in the world coordinate system.
16. The wheel-based target vehicle posture detection method according to claim 15, characterized in that: When the point where the bottom of the wheel contacts the ground is used as the feature point, z = 0. In this case, formulas (4) and (5) are simplified to formulas (6) and (7):
17. The method for detecting the target vehicle posture based on wheels according to claim 15, characterized in that: When the midpoint of the wheel top is used as the feature point, z = D wheel , where D wheel Indicates the diameter of the wheel.
18. The wheel-based target vehicle posture detection method according to claim 1 or 6, characterized in that: Determine whether the vehicle target is driving on the left side (LEFT) or the right side (RIGHT) according to the position of the vehicle target in the field of view; If the vehicle is traveling on the left side (LEFT), the two side wheels of the target vehicle seen in the field of view are located on the right side of the target frame; conversely, if the target vehicle is traveling on the right side (RIGHT), the two side wheels of the target vehicle seen are located on the left side of the target frame.
19. The wheel-based target vehicle posture detection method according to claim 1 or 6, characterized in that: For the feature point pixel coordinates P i (u i ,v i ), if all detected wheels appear in the field of view as a whole, the contact point between the bottom of the wheel and the ground is used as the feature point, which is expressed as formula (8) 20. The wheel-based target vehicle posture detection method according to claim 1 or 6, characterized in that: For the feature point pixel coordinates P i (u i ,v i ), if the wheel is detected to be incomplete in the image, the midpoint of the top of the wheel is used as the wheel feature point, which is expressed as formula (9) At this time, when calculating the conversion of the points on the image to the world coordinate system, the points (A, B, C, D) in the world coordinate system taken during the perspective transformation matrix calculation process are not on the ground plane, but on the parallel ground plane z = D wheel , where D wheel Indicates the diameter of the wheel.
21. The wheel-based target vehicle posture detection method according to claim 1 or 6, characterized in that: Convert feature point pixel coordinates to the world coordinate system, including: The rectangular range formed by four points in the fixed world coordinate system, denoted as points A, B, C, and D, can be used as a bird's-eye view to represent the area; By using the camera extrinsic matrix and intrinsic matrix, the four points in the world coordinate system are transformed into the image coordinate system, as shown in formula (10): Among them, [Xw s Y s Z s ], (s = A, B, C, D), represents the coordinates of the four points A, B, C, D in the world coordinate system, Zc represents the value of the coordinate Z axis direction of the corresponding point in the camera coordinate system, [u s ,v s ], (s=A, B, C, D), is the coordinate of the corresponding point in the image coordinate system.
22. The wheel-based target vehicle posture detection method according to claim 21, characterized in that: Take the four vertices of the bird's-eye view as reference points for perspective transformation, and combine them with the four points in the original image coordinate system to obtain the perspective transformation matrix Warp from the original image to the bird's-eye view; According to the scale relationship between the four points in the world coordinate system and the scale relationship between the bird's-eye view image, the proportional relationship G between the pixel value in the bird's-eye view image and the coordinate in the world coordinate system is calculated. w ; Then the points in the image coordinate system are transformed to the world coordinate system through formula (11): Among them, Z t In the formula, x has no practical meaning; i w ,y i w They represent the x-coordinate value and y-coordinate value of the pixel coordinate in the world coordinate system respectively.
23. The wheel-based target vehicle posture detection method according to claim 22, characterized in that: The calculation steps of the transformation matrix Warp are as follows: Step 1) Take 4 points on the ground in the world coordinate system As the 4 vertices in the bird's eye view, where i = 1, 2, 3, 4 represents the index of the point, is the coordinate value in the world coordinate system; in the world coordinate system, these four points form a rectangle, the sides of the rectangle are parallel to the coordinate axes in the world coordinate system, and in the bird's-eye view, the coordinates of the four vertices are W img , H img All are coordinate values in the world coordinate system; Step 2) According to the camera internal and external parameters, the above four points Projected to image coordinates, expressed as Where i = 1, 2, 3, 4 represents the index of the point, is the coordinate value in the image coordinate system; Step 3) Through the above points and The corresponding relationship forms the following set of equations: Solve the homography matrix Warp between the bird's-eye view image and the original image.
24. The wheel-based target vehicle posture detection method according to claim 23, characterized in that: If the wheel feature point is the position where the wheel contacts the ground, then If the wheel feature point is the wheel center, then If the wheel feature point is the top of the wheel, then Obtain the wheel diameter D based on the trained deep neural network wheel .
25. The wheel-based target vehicle posture detection method according to claim 24, characterized in that: When the wheel is running on the ground, the actual height Z of the wheel feature at this time w Recorded as 0.
26. The wheel-based target vehicle posture detection method according to claim 25, characterized in that: The world coordinates of the two wheel feature points are Where Z w represents the actual height of the wheel feature; then the vehicle's attitude angle is as shown in formula (12):
27. The method for detecting the target vehicle posture based on wheels according to any one of claims 22 to 25, characterized in that: Use the motion model to track the vehicle coordinates and pose.
28. The method for detecting the target vehicle posture based on wheels according to any one of claims 22 to 25, characterized in that: The CTRV motion model is used to track and filter the coordinates and posture of the vehicle. The coordinate values and vehicle posture values calculated for each frame of the image are used as observations, and the Kalman tracking method is used for prediction.
29. A target vehicle posture detection device based on wheels, characterized in that: include: An image acquisition device, which acquires a current camera image; A vehicle target detection device, inputting the acquired current camera image, performing vehicle target detection on the input image, and obtaining a vehicle target; A wheel target detection device performs wheel detection on the vehicle target to obtain a wheel target; The same-side wheel extraction device extracts the characteristic points of two wheels on the same side from the wheel target; A tilt angle attitude calculation device, which obtains the tilt angle attitude of the vehicle by using the line connecting the coordinates of the two wheel feature points on the same side; Among them, firstly, the vehicle targets in the camera field of view are divided into left targets and right targets, and then the wheels of the left vehicle and the right vehicle are detected respectively, and the required two wheel frames on the same side are extracted; Extract the detected wheel frame W i (x i ,y i ,w i ,h i )’s pixel coordinates P i (u i ,v i ), transform the pixel coordinates of these feature points into the world coordinate system, and obtain the coordinates in the world coordinate system Among them, the wheel detection is performed in the acquired target frame to obtain the wheel frame in the image, which is represented by W i (x i ,y i ,w i ,h i ), where i = 1, 2...N, N represents the number of wheels detected, and x i ,y i 、w i and h i Respectively represent the x-coordinate, y-coordinate, wheel frame width and height of the upper left corner of the wheel frame; Based on the obtained world coordinates of the wheels, the top, center or bottom coordinates of the two wheels of the vehicle are obtained, and the inclination attitude of the vehicle is obtained according to the connecting line of the top, center or bottom coordinates of the two wheels; Among them, the feature point detection of the wheel uses the target vehicle frame and the segmentation map of the corresponding vehicle, where the segmentation map is obtained based on the deep neural network segmentation model; The detection of the target vehicle wheel feature points comprises the following steps: Step 1), according to the position of the target vehicle in the current image, it is divided into two cases: left and right: if the horizontal coordinate x+w / 2 of the center point of the target vehicle frame is on the left side of the image, it is considered that the target vehicle is on the left side of the current vehicle; if x+w / 2 is on the right side of the image, it is considered that the target vehicle is on the right side of the current vehicle; Step 2), when the target vehicle is on the right side of the current vehicle, firstly, in the target frame image area, based on the vehicle pixels in the segmentation map, search from bottom to top to find the coordinates of the first row of vehicle pixels as the first wheel reference coordinates P w1 Then, within this coordinate neighborhood δ, the first proportion r of the number of vehicle pixels in the entire neighborhood δ is counted wpix1 , if r wpix1 Greater than the first threshold T wpix1 , then the coordinates are considered valid, otherwise they are considered invalid and the search continues upwards; Step 3): Using the wheel reference coordinate P that meets the conditions in the above steps w1 as the starting point and a point on the right boundary of the vehicle target box as the end point P wr (x + w, y + h - s), form a scan line, where s is the number of scans, and 0 < s < h. The scanning order is that s increases from 1, and then count the second ratio r of the vehicle pixel points on this scan line to the entire scan line spix . If r spix is greater than the second threshold T spix , then consider this line as a valid vehicle scan line. Then, on this scan line, find a point closest to the end point as the second wheel reference coordinate P w2 . Then, within the neighborhood δ of this coordinate, count the third ratio r of the number of vehicle pixels to the entire neighborhood δ wpix2 . If r wpix2 is greater than the third threshold T wpix2 , then consider this coordinate valid, otherwise consider this coordinate invalid and continue scanning; Step 4) If valid coordinates are found after scanning in the above steps, take P w1 and P w2 is the vehicle feature point; Step 5), when the target vehicle is on the left side of the current vehicle, the end point P is set in step 3). wr The coordinates of are expressed as (x,y+hs), and the rest of the steps are the same.
