Method, device and equipment for determining target vehicle heading angle and storage medium
By combining the target detection model with multiple neural network models, the computational complexity and hardware cost of heading angle determination are reduced, while the applicability of the algorithm and the accuracy of the heading angle are improved.
Patent Information
- Application Number
- CN202311278978.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-09-28
AI Technical Summary
In existing technologies, the heading angle determination method based on visual information has high computational complexity, limited algorithm applicability, and requires high-configuration hardware, resulting in high hardware costs and limiting the development of intelligent driving.
The system identifies target vehicles in visual images using a target detection model, calculates the center angle between the vehicle and the target vehicle, and uses multiple preset neural network models to predict observation angles for voting selection. The heading angle is then determined by combining geometric calculations.
It reduces computational complexity, decreases hardware cost requirements, improves algorithm applicability, and increases the accuracy of heading angle.
Smart Images

Figure CN117207990B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent driving technology, and in particular to a method, apparatus, device and storage medium for determining the heading angle of a target vehicle. Background Technology
[0002] During the operation of autonomous vehicles, it is usually necessary to calculate the heading angle of the target vehicle to determine its direction of travel, thereby achieving precise navigation.
[0003] In existing technologies, a common method for determining heading angle based on visual information involves using an object detection network to obtain the overall bounding box, body bounding box, front bounding box, and rear bounding box of the target vehicle, and then calculating the heading angle. This method requires a large amount of object detection bounding box annotation data, has high computational complexity, limited algorithm applicability, and requires high-configuration hardware to support the computation, thus increasing hardware costs and limiting the development of autonomous driving.
[0004] Therefore, there is an urgent need for a new method for determining the heading angle of the target vehicle to reduce computational complexity and improve the applicability of the algorithm. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for determining the heading angle of a target vehicle, in order to solve problems such as how to reduce computational complexity and how to improve the applicability of the algorithm when determining the heading angle of a target vehicle.
[0006] In a first aspect, this application provides a method for determining the heading angle of a target vehicle, the method comprising:
[0007] Acquire visual images captured by the vehicle; wherein the visual images include at least one target vehicle;
[0008] The visual image is input into the target detection model for processing to obtain the overall block diagram of the target vehicle in the visual image and the center angle between the vehicle and the target vehicle in the vehicle coordinate system.
[0009] The overall block diagram of the target vehicle is input into multiple different preset neural network models for processing. The predicted observation angle of the vehicle to the target vehicle is obtained from the output of each preset neural network model. The predicted observation angles are then voted on to determine the target observation angle of the vehicle to the target vehicle.
[0010] The heading angle of the target vehicle is determined based on the center angle between the vehicle and the target vehicle and the target observation angle of the vehicle relative to the target vehicle.
[0011] Optionally, the visual image is input into a target detection model for processing to obtain an overall bounding map of the target vehicle in the visual image and the center angle between the vehicle and the target vehicle in the vehicle coordinate system, including:
[0012] The visual image is input into the target detection model, which performs feature extraction processing on the visual image, identifies and outputs the overall outline of the target vehicle in the visual image;
[0013] The homography matrix is obtained based on the intrinsic and extrinsic parameters of the image acquisition device, and the center point of the rear axle of the target vehicle in the vehicle coordinate system is determined by inverse perspective transformation.
[0014] Determine the line connecting the center point of the rear axle of the target vehicle and the origin of the vehicle coordinate system. Based on the line, determine the center angle between the vehicle and the target vehicle in the vehicle coordinate system.
[0015] Optionally, a voting process is performed on each of the predicted observation angles to determine the target observation angle of the vehicle relative to the target vehicle, including:
[0016] Based on the value of each predicted observation angle, determine the preset observation angle interval to which each predicted observation angle belongs, and determine the observation angle corresponding to the preset observation angle interval with the most predicted observation angles as the target observation angle.
[0017] Optionally, the heading angle of the target vehicle is determined based on the center angle between the vehicle and the target vehicle and the target observation angle of the vehicle relative to the target vehicle, including:
[0018] The sum of the center angle between the vehicle and the target vehicle and the target observation angle of the vehicle relative to the target vehicle is determined, and the sum of the angles is determined as the heading angle of the target vehicle.
[0019] Optionally, the method further includes:
[0020] Acquire sample data for each of the multiple preset neural network models; wherein each sample data includes training set data, validation set data and test set data, and each set of sample data uses the overall outline of the target vehicle in the visual image acquired by the on-vehicle image acquisition device as the input value and the actual observation angle of the on-vehicle to the target vehicle as the calibration value of the output value.
[0021] Each preset neural network model is trained using training set data, and its parameters are validated and adjusted using validation set data. The performance of each preset neural network model is then tested using test set data until the preset conditions are met, thus obtaining the preset neural network model.
[0022] Optionally, sample data for each of multiple preset neural network models can be obtained, including:
[0023] Using the observation angle of the vehicle to the target vehicle as a label, classify the overall block diagram of the target vehicle into n categories; where n is a positive integer.
[0024] The overall block diagram of the target vehicle for n classification is divided into the same number of parts as the preset neural network models, and the training set data, validation set data, and test set data of each preset neural network model are determined based on the preset allocation ratio; wherein, the preset allocation ratio is the allocation ratio of training set data, validation set data, and test set data.
[0025] Optionally, before classifying the overall bounding box of the target vehicle into n categories based on the observation angle of the vehicle to the target vehicle, the method further includes:
[0026] Determine the true observation angle of the target vehicle in the visual image acquired by the image acquisition device on the vehicle, as well as the true center angle between the vehicle and the target vehicle in the vehicle coordinate system.
[0027] Secondly, this application provides a device for determining the heading angle of a target vehicle, the device comprising:
[0028] An acquisition unit is used to acquire visual images collected by the vehicle; wherein the visual images include at least one target vehicle;
[0029] The first processing unit is used to input the visual image into the target detection model for processing, and to obtain the overall block diagram of the target vehicle in the visual image and the center angle between the vehicle and the target vehicle in the vehicle coordinate system.
[0030] The second processing unit is used to input the overall block diagram of the target vehicle into multiple different preset neural network models for processing, obtain the predicted observation angle of the vehicle to the target vehicle output by each preset neural network model, and vote on each predicted observation angle to determine the target observation angle of the vehicle to the target vehicle.
[0031] The determining unit is used to determine the heading angle of the target vehicle based on the center angle between the self-vehicle and the target vehicle and the target observation angle of the self-vehicle relative to the target vehicle.
[0032] Thirdly, this application provides an electronic device, the electronic device comprising: a processor, and a memory communicatively connected to the processor;
[0033] The memory stores computer-executed instructions;
[0034] The processor executes computer execution instructions stored in the memory to implement the method described above.
[0035] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described above.
[0036] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, is used to implement the method described above.
[0037] The method, apparatus, device, and storage medium for determining the heading angle of a target vehicle provided in this application include: acquiring a visual image collected by a vehicle; wherein the visual image includes at least one target vehicle; inputting the visual image into a target detection model for processing to obtain an overall block diagram of the target vehicle in the visual image and the center angle between the vehicle and the target vehicle in the vehicle's coordinate system; inputting the overall block diagram of the target vehicle into multiple different preset neural network models for processing to obtain the predicted observation angle of the vehicle to the target vehicle output by each preset neural network model, and voting on each predicted observation angle to determine the target observation angle of the vehicle to the target vehicle; and determining the heading angle of the target vehicle based on the center angle between the vehicle and the target vehicle and the target observation angle of the vehicle to the target vehicle. The proposed solution only requires identifying the overall detection box of the target vehicle. Its computational complexity is lower compared to other methods that require detecting multiple detection boxes such as the front, rear, and wheels of the target vehicle. Consequently, the hardware requirements are not too high, and existing hardware can be directly upgraded, which not only saves hardware costs but also improves the applicability of the algorithm. In addition, this application determines a more accurate target observation angle of the self-vehicle relative to the target vehicle through multiple preset neural network models. It also uses the center angle between the self-vehicle and the target vehicle, as well as the target observation angle of the self-vehicle relative to the target vehicle, to jointly determine the heading angle of the target vehicle, further improving the accuracy of determining the heading angle of the target vehicle based on visual information. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0039] Figure 1 A flowchart illustrating a method for determining the heading angle of a target vehicle provided in an embodiment of this application;
[0040] Figure 2 A schematic diagram of an architecture for determining the heading angle of a target vehicle, provided in an embodiment of this application;
[0041] Figure 3 A flowchart illustrating a method for training a neural network model provided in an embodiment of this application;
[0042] Figure 4 A schematic diagram of a target vehicle from various angles provided for an embodiment of this application;
[0043] Figure 5 A schematic diagram of a target vehicle heading angle determination device provided in an embodiment of this application;
[0044] Figure 6 A schematic diagram of the structure of another target vehicle heading angle determination device provided in an embodiment of this application;
[0045] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0046] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0048] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0049] With the development of vehicle technology, autonomous vehicles have gradually become one of the key research and development focuses for automakers. During autonomous vehicle operation, the direction of travel is primarily determined by calculating the heading angle of the target vehicle, thereby achieving precise navigation.
[0050] In one example, various sensors such as ground sensors, infrared sensors, GPS sensors, lidar sensors, and ultrasonic sensors are used to determine the vehicle's direction of travel. These methods require additional sensors, which incurs additional costs and is relatively expensive. In addition, the accuracy of the heading angle measurement is also affected by the sensors, resulting in low measurement accuracy.
[0051] In another example, the overall bounding box, body bounding box, front bounding box, and rear bounding box of the target vehicle are obtained through an object detection network, and then the heading angle of the vehicle is calculated. This method requires a large amount of object detection bounding box annotation data, which has high computational complexity, weak algorithm applicability, and requires high-configuration hardware to support the operation, thus increasing its hardware cost and limiting the development of intelligent driving.
[0052] To address the aforementioned issues, this application provides a method for determining the heading angle of a target vehicle. The method identifies the target vehicle in a visual image captured by an onboard image acquisition device using a target detection model, calculates the center angle between the onboard vehicle and the target vehicle, predicts the onboard vehicle's observation angle of the target vehicle using multiple different neural network models, and determines the target observation angle through a voting process based on these predicted angles. Finally, geometric calculations are combined to estimate the heading angle of the target vehicle. This method significantly reduces costs compared to relying on high-precision sensors. Furthermore, the algorithm is simple, easy to implement, and has low hardware requirements; it can be implemented simply by upgrading existing hardware.
[0053] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0054] Figure 1 This is a flowchart illustrating a method for determining the heading angle of a target vehicle, provided in an embodiment of this application. The executing entity in this embodiment can be a device for determining the heading angle of the target vehicle. This device can be located on a vehicle or on an electronic device. The electronic device can be a mobile terminal, such as a mobile phone, tablet, or computer; this application does not impose any limitations. This embodiment uses the device for determining the heading angle of the target vehicle as an example for detailed explanation.
[0055] like Figure 1 As shown, the method for determining the heading angle of a target vehicle provided in this embodiment includes:
[0056] S101. Acquire visual images collected by the vehicle; wherein the visual images include at least one target vehicle.
[0057] For example, an image acquisition device is installed on the vehicle, which can be a camera, video acquisition device, etc., to acquire visual images during vehicle movement and send them to the target vehicle heading angle determination device of this application, so that the target vehicle heading angle determination device of this application can obtain the visual images acquired by the image acquisition device on the vehicle. There can be multiple image acquisition devices on the vehicle, located at different positions on the vehicle; this application does not impose any limitations. This application aims to determine the heading angle of the target vehicle for predicting the target vehicle's trajectory and avoiding collisions, etc. Therefore, the acquired visual images should include at least one target vehicle.
[0058] S102. Input the visual image into the target detection model for processing to obtain the overall block diagram of the target vehicle in the visual image and the center angle between the self-vehicle and the target vehicle in the self-vehicle coordinate system.
[0059] For example, after acquiring a visual image, the target vehicle heading angle determination device of this application inputs the visual image into a target detection model for processing to obtain an overall bounding box of the target vehicle in the visual image and the center angle between the self-vehicle and the target vehicle in the self-vehicle coordinate system. The self-vehicle coordinate system can be a coordinate system established with the center of the rear axle of the self-vehicle as the origin. The target detection model is a pre-trained model for detecting target vehicles, which can output an overall detection bounding box of the target vehicle and perform a series of calculations based on the identified target vehicle detection bounding box to obtain the center angle between the self-vehicle and the target vehicle; this application does not impose any limitations on this.
[0060] In one example, the visual image is input into the object detection model for processing to obtain the overall bounding map of the target vehicle in the visual image and the center angle between the vehicle and the target vehicle in the vehicle's coordinate system. This can include:
[0061] S1. Input the visual image into the target detection model. The target detection model performs feature extraction processing on the visual image, identifies and outputs the overall outline of the target vehicle in the visual image.
[0062] S2. Obtain the homography matrix based on the intrinsic and extrinsic parameters of the image acquisition device, and determine the center point of the rear axle of the target vehicle in the vehicle coordinate system through inverse perspective transformation.
[0063] S3. Determine the line connecting the center point of the target vehicle and the origin of the vehicle's coordinate system. Based on the line, determine the center angle between the vehicle and the target vehicle in the vehicle's coordinate system.
[0064] For example, when obtaining the center angle between the vehicle and the target vehicle in the vehicle coordinate system, the visual image is first input into a pre-trained target detection model. The target detection model performs feature extraction processing on the visual image to identify the target vehicle in the visual image, thereby outputting the overall outline of the target vehicle. While determining the overall outline of the target vehicle, key points of the target vehicle can also be determined. Then, the homography matrix is obtained by combining the intrinsic and extrinsic parameters of the image acquisition device. Through inverse perspective transformation (IPM), the center point of the rear axle of the target vehicle in the vehicle coordinate system can be determined. Then, the center point of the rear axle of the target vehicle is connected to the origin of the vehicle coordinate system to determine the line between them. Based on this line, the center angle between the vehicle and the target vehicle in the vehicle coordinate system is determined.
[0065] S103. Input the overall block diagram of the target vehicle into multiple different preset neural network models for processing, obtain the predicted observation angle of the self vehicle to the target vehicle output by each preset neural network model, and vote on each predicted observation angle to determine the target observation angle of the self vehicle to the target vehicle.
[0066] For example, after inputting the overall block diagram of the target vehicle into multiple different preset neural network models, each preset neural network model processes the overall block diagram of the target vehicle and outputs the processing result of the overall block diagram of the target vehicle, that is, the predicted observation angle of the vehicle in the visual image. Thus, the target vehicle heading angle determination device of this application obtains the predicted observation angle of the vehicle in the visual image. Then, the target vehicle heading angle determination device of this application votes on each predicted observation angle to determine the target observation angle of the vehicle in the visual image.
[0067] For example, each preset neural network model is a pre-trained neural network model used to obtain the predicted observation angle of the target vehicle in the visual image from the vehicle's perspective. For instance, each preset neural network model can be a Residual Network (ResNets), a Visual Geometry Group Network (VGG) model, a computer vision model such as Mobilenet, etc. This application does not impose any restrictions and can select the appropriate model based on the actual situation. Furthermore, this application does not impose any restrictions on the specific number of preset neural network models; for example, it can have three. If there are three preset neural network models, then by inputting the target vehicle's bounding box obtained after recognizing the visual image into three different preset neural network models, three predicted observation angles of the target vehicle in the visual image from the vehicle's perspective can be obtained.
[0068] Since this application only needs to identify the overall detection frame of the target vehicle, the computational complexity is lower compared to other methods that require detecting multiple detection frames such as the front, rear, and wheels of the target vehicle. Consequently, the requirements for hardware equipment are not too high, and existing hardware equipment can be directly upgraded, thus saving hardware costs.
[0069] For example, different preset neural network models will produce different processing results due to their different algorithms, meaning that the processing results of each preset neural network model will have certain differences in accuracy. Therefore, this application determines the target observation angle of the vehicle relative to the target vehicle based on the processing results of visual images from different preset neural network models. The target observation angle obtained based on multiple different processing results is more accurate, thereby improving the accuracy of subsequent determination of the target vehicle's heading angle.
[0070] This application does not restrict how the predicted observation angles are voted on to determine the target observation angle of the vehicle relative to the target vehicle. For example, the average value can be calculated based on the processing results of the visual images by each preset neural network model, and the average value can be determined as the target value. Alternatively, a vote can be conducted based on the processing results to select the prediction result with the highest calculation accuracy as the target value, and so on. This application does not impose any restrictions.
[0071] In one example, voting on each predicted observation angle to determine the target observation angle of the vehicle relative to the target vehicle can include:
[0072] Based on the value of each predicted observation angle, determine the preset observation angle interval to which each predicted observation angle belongs, and determine the observation angle corresponding to the preset observation angle interval with the most predicted observation angles as the target observation angle.
[0073] For example, the processing results of each preset neural network model on the visual image can be voted on separately. Specifically, based on the value of each predicted observation angle, the preset observation angle interval to which each predicted observation angle belongs is determined, and the observation angle corresponding to the preset observation angle interval with the most predicted observation angles is determined as the target observation angle.
[0074] For example, if the observation angle of the vehicle relative to the target vehicle is divided into 36 categories with 10-degree intervals, then the span of each preset observation angle interval is 10 degrees. If 1–10 degrees is the first interval, 11–20 degrees is the second interval, and so on, the angle range of each preset observation angle interval can be determined. Each preset observation angle interval also has a corresponding observation angle. After obtaining the predicted observation angles of the vehicle relative to the target vehicle output by each preset neural network model, the value of each predicted observation angle can be used to determine which preset observation angle interval each predicted observation angle falls within. Taking three preset neural network models as an example, three predicted observation angles can be obtained. If two of the predicted observation angles are within the same preset observation angle interval, then the observation angle corresponding to that preset observation angle interval is determined to be the target observation angle of the vehicle relative to the target vehicle as referred to in this application.
[0075] Determining the target observation angle in this way avoids the situation where the final target vehicle heading angle is inaccurate due to calculation errors caused by random errors, thereby ensuring the accuracy of data prediction and further improving the calculation accuracy of the target vehicle heading angle in subsequent calculations.
[0076] S104. Determine the heading angle of the target vehicle based on the center angle between the vehicle and the target vehicle and the target observation angle of the vehicle relative to the target vehicle.
[0077] For example, once the target observation angle of the vehicle relative to the target vehicle and the center angle between the vehicle and the target vehicle are determined, the heading angle of the target vehicle can be determined based on the target observation angle and the center angle.
[0078] In one example, determining the heading angle of the target vehicle based on the center angle between the vehicle and the target vehicle, and the target observation angle of the vehicle relative to the target vehicle, can include:
[0079] Determine the sum of the center angle between the vehicle and the target vehicle and the target observation angle of the vehicle relative to the target vehicle, and determine the sum of the angles as the heading angle of the target vehicle.
[0080] For example, the sum of the angles between the target observation angle and the target center angle can be determined as the heading angle of the target vehicle.
[0081] Since the target observation angle is determined by multiple different preset neural network models, the result is more accurate. Therefore, the heading angle of the target vehicle determined by the angle between the target observation angle and the target center is also more accurate. This method improves the accuracy of determining the heading angle of the target vehicle based on visual information.
[0082] For example, Figure 2 This is a schematic diagram of an architecture for determining the heading angle of a target vehicle, provided as an embodiment of this application. Figure 2As shown, the visual image acquired by the image acquisition device on the vehicle is input into the target detection model. The target detection model will output the center angle between the vehicle and the target vehicle and the overall block diagram of the target vehicle. The overall block diagram of the target vehicle is input into multiple different preset neural network models. Each preset neural network model will output a corresponding predicted observation angle of the vehicle to the target vehicle. After voting on the multiple predicted observation angles, the target observation angle of the vehicle to the target vehicle can be obtained. Based on the center angle between the vehicle and the target vehicle and the target observation angle of the vehicle to the target vehicle, the heading angle of the target vehicle can be determined.
[0083] The method for determining the heading angle of a target vehicle provided in this application includes: acquiring a visual image collected by a vehicle; wherein the visual image includes at least one target vehicle; inputting the visual image into a target detection model for processing to obtain an overall block diagram of the target vehicle in the visual image and the center angle between the vehicle and the target vehicle in the vehicle coordinate system; inputting the overall block diagram of the target vehicle into multiple different preset neural network models for processing to obtain the predicted observation angle of the vehicle to the target vehicle output by each preset neural network model, and voting on each predicted observation angle to determine the target observation angle of the vehicle to the target vehicle; and determining the heading angle of the target vehicle based on the center angle between the vehicle and the target vehicle and the target observation angle of the vehicle to the target vehicle. The proposed solution only requires identifying the overall detection box of the target vehicle. Its computational complexity is lower compared to other methods that require detecting multiple detection boxes such as the front, rear, and wheels of the target vehicle. Consequently, the hardware requirements are not too high, and existing hardware can be directly upgraded, which not only saves hardware costs but also improves the applicability of the algorithm. In addition, this application determines a more accurate target observation angle of the self-vehicle relative to the target vehicle through multiple preset neural network models. It also uses the center angle between the self-vehicle and the target vehicle, as well as the target observation angle of the self-vehicle relative to the target vehicle, to jointly determine the heading angle of the target vehicle. This method further improves the accuracy of determining the heading angle of the target vehicle based on visual information.
[0084] Based on the above embodiments, in some examples, it is also necessary to train the neural network model to obtain a trained preset neural network model, so as to better realize the solution of this application.
[0085] For example, Figure 3 This is a flowchart illustrating a method for training a neural network model provided in an embodiment of this application. Figure 3 As shown, the process of training the neural network model in this application may include:
[0086] S301. Obtain sample data for each of the multiple preset neural network models; wherein, each sample data includes training set data, validation set data and test set data, and each set of sample data uses the overall outline of the target vehicle in the visual image acquired by the on-vehicle image acquisition device as the input value and the actual observation angle of the on-vehicle to the target vehicle as the calibration value of the output value.
[0087] For example, before model training, data needs to be prepared to obtain sample data for each preset neural network model. In this application, the sample data for each preset neural network model includes training set data, validation set data, and test set data. The training set data is used to train the preset neural network model, the validation set data is used to validate and adjust the model parameters of each preset neural network model, and the test set data is used to test the performance of the preset neural network model. Each set of sample data uses the overall outline of the target vehicle in the visual image acquired by the onboard image acquisition device as the input value, and the actual observation angle of the onboard vehicle towards the target vehicle as the calibration value for the output value.
[0088] During model training, the overall block diagram of the target vehicle is input into the neural network model. After the model performs calculations, it outputs the predicted observation angle of the self-vehicle to the target vehicle. Then, the model parameters are adjusted based on the calibration value, i.e. the actual observation angle. Through repeated training, the preset conditions are met to obtain the trained preset neural network model.
[0089] In one example, obtaining sample data for multiple pre-defined neural network models can include:
[0090] S3011. Using the observation angle of the vehicle to the target vehicle as a label, classify the overall block diagram of the target vehicle into n categories; where n is a positive integer.
[0091] S3012. Divide the overall block diagram of the target vehicle for n classification into the same number of preset neural network models, and determine the training set data, validation set data, and test set data for each preset neural network model based on the preset allocation ratio; wherein, the preset allocation ratio is the allocation ratio of training set data, validation set data, and test set data.
[0092] For example, to calculate the heading angle of the target vehicle, this application first needs to obtain the observation angle of the self-vehicle relative to the target vehicle and the center angle between the self-vehicle and the target vehicle. Therefore, the overall block diagram of the target vehicle can be classified into n categories using the observation angle of the self-vehicle relative to the target vehicle as a label. Here, n is a positive integer, which can be divided according to the prediction accuracy requirements. This application does not impose any restrictions on n. For example, n can be values such as 36, 32, 28, 24, 20, 16, 12, 8, 4, etc. The observation angle range (i.e., the preset observation angle range) of each division interval after n-classification is different, and the corresponding observation angles set are also different. Then, according to the number of preset neural network modules, the overall block diagram of the target vehicle undergoing n-classification is divided into the same number of parts as the number of preset neural network modules. Based on a preset allocation ratio, the training set data, validation set data, and test set data of each preset neural network model are determined. Here, the preset allocation ratio refers to the allocation ratio of the training set data, validation set data, and test set data. This application does not impose any restrictions on the allocation ratio. For example, the allocation ratio can be 7:2:1.
[0093] For example, if a batch of 3000 sample data is collected, the number of neural network models is 3, the label classification is 36, and the distribution ratio of training set data, validation set data, and test set data is 7:2:1, then the 3000 sets of data are classified into these 36 categories based on the observation angle of the self-vehicle to the target vehicle. Then, the data in these 36 categories are divided into 3 parts, so that the sample data of each neural network model includes data from different observation angles. Then, the data divided into 3 parts are distributed into the training set data, validation set data, and test set data of their respective models according to the 7:2:1 distribution ratio, so as to obtain the training set data, validation set data, and test set data of each preset neural network model.
[0094] In some examples, the actual viewing angle of the vehicle to the target vehicle in the visual image and the actual center angle between the vehicle and the target vehicle are not known. Before performing n-classification on the overall bounding box of the target vehicle using the vehicle's viewing angle to the target vehicle as the label, the following is also required:
[0095] Determine the true observation angle of the target vehicle in the visual image acquired by the image acquisition device on the vehicle, as well as the true center angle between the vehicle and the target vehicle in the vehicle coordinate system.
[0096] For example, the true viewing angle of the target vehicle in the visual image captured by the image acquisition device on the vehicle can be determined in the vehicle's coordinate system by rotating the target vehicle around the y-axis to the z-axis, with the center of the vehicle's rear axle as the origin and the line connecting the origin of the coordinate system to the center of the target vehicle's rear axle as the radius. The angle between the target vehicle's direction and the x-axis of the coordinate system is then determined. The true center angle between the vehicle and the target vehicle in the vehicle's coordinate system can be obtained by determining the coordinates of the target vehicle's overall frame in the vehicle's coordinate system through inverse perspective transformation (IPM), determining the center point of the target vehicle's rear axle, and then viewing the angle from a BEV perspective based on the line connecting the center point of the target vehicle's rear axle to the origin of the coordinate system.
[0097] Alternatively, when establishing the vehicle coordinate system, the camera coordinate system can be established with the center of the vehicle camera as the origin, and the center point of the vehicle, rather than the center point of the rear axle, can be used as the point to be detected. The implementation principle is the same as that of the scheme in this application.
[0098] For example, Figure 4 This is a schematic diagram of a target vehicle from various angles, provided as an embodiment of this application. For example... Figure 4 As shown, a coordinate system is established with the center of the rear axle of the vehicle as the origin. The position of the target vehicle projected onto the coordinate system in the visual image is target vehicle A. The position of target vehicle B is determined by rotating target vehicle A around the y-axis of the coordinate system to the z-axis, using the line connecting the origin of the coordinate system to the center of the rear axle of target vehicle A as the radius. Then, alpha is the observation angle of the vehicle relative to the target vehicle, and β is the center angle between the vehicle and the target vehicle. y This refers to the heading angle of the target vehicle to be determined in this application.
[0099] S302. Train each preset neural network model using each training set data, verify and adjust the model parameters of each preset neural network model using each validation set data, and test the performance of each preset neural network model using each test set data until the preset conditions are met, thus obtaining each preset neural network model.
[0100] For example, during model training, each neural network model is trained using its own sample data. Visual images are sequentially input into each neural network model. After the model performs calculations, it outputs the predicted observation angle of the self-vehicle to the target vehicle. The model parameters are then adjusted based on the calibration values. Through repeated training, the preset conditions are met to obtain the trained preset neural network model.
[0101] The preset conditions can be either reaching a preset number of training iterations or the output error reaching a preset threshold; this application does not impose any restrictions on this. A preset neural network model that has undergone training, validation, and testing is relatively more stable and can yield more accurate prediction results.
[0102] The method for training a neural network model provided in this application includes: acquiring sample data for each of multiple preset neural network models; wherein each sample data includes training set data, validation set data, and test set data, and each set of sample data uses the overall outline of the target vehicle in a visual image acquired by an on-vehicle image acquisition device as the input value and the actual observation angle of the target vehicle from the on-vehicle as the calibration value of the output value; training each preset neural network model using each training set data, verifying and adjusting the model parameters of each preset neural network model using each validation set data, and testing the performance of each preset neural network model using each test set data, until preset conditions are met, thereby obtaining each preset neural network model. Since each sample data includes training set data, validation set data, and test set data, the preset neural network model obtained through training, verification, and testing has better stability and can obtain more accurate prediction results, thereby improving the accuracy of the target vehicle heading angle obtained in this application.
[0103] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0104] Figure 5 This is a schematic diagram of a target vehicle heading angle determination device provided in an embodiment of this application. Figure 5 As shown, the target vehicle heading angle determination device 50 provided in this application embodiment includes an acquisition unit 501, a first processing unit 502, a second processing unit 503, and a determination unit 504.
[0105] The acquisition unit 501 is used to acquire visual images collected by the vehicle; wherein the visual images include at least one target vehicle.
[0106] The first processing unit 502 is used to input the visual image into the target detection model for processing, and to obtain the overall block diagram of the target vehicle in the visual image and the center angle between the self-vehicle and the target vehicle in the self-vehicle coordinate system.
[0107] The second processing unit 503 is used to input the overall block diagram of the target vehicle into multiple different preset neural network models for processing, obtain the predicted observation angle of the self vehicle to the target vehicle output by each preset neural network model, and vote on each predicted observation angle to determine the target observation angle of the self vehicle to the target vehicle.
[0108] The determining unit 504 is used to determine the heading angle of the target vehicle based on the center angle between the self-vehicle and the target vehicle and the target observation angle of the self-vehicle relative to the target vehicle.
[0109] The apparatus provided in this embodiment can be used to execute the methods of the above embodiments. Its implementation principle and technical effects are similar, and will not be described again here.
[0110] Figure 6 This is a schematic diagram of another target vehicle heading angle determination device provided in an embodiment of this application. Figure 6 As shown, the target vehicle heading angle determination device 60 provided in this application embodiment includes an acquisition unit 601, a first processing unit 602, a second processing unit 603, and a determination unit 604.
[0111] The acquisition unit 601 is used to acquire visual images collected by the vehicle; wherein the visual images include at least one target vehicle.
[0112] The first processing unit 602 is used to input the visual image into the target detection model for processing, and to obtain the overall block diagram of the target vehicle in the visual image and the center angle between the self-vehicle and the target vehicle in the self-vehicle coordinate system.
[0113] The second processing unit 603 is used to input the overall block diagram of the target vehicle into multiple different preset neural network models for processing, obtain the predicted observation angle of the self vehicle to the target vehicle output by each preset neural network model, and vote on each predicted observation angle to determine the target observation angle of the self vehicle to the target vehicle.
[0114] The determining unit 604 is used to determine the heading angle of the target vehicle based on the center angle between the self-vehicle and the target vehicle and the target observation angle of the self-vehicle to the target vehicle.
[0115] In one example, the first processing unit 602 is specifically used for: inputting a visual image into a target detection model, the target detection model performing feature extraction processing on the visual image, identifying and outputting the overall outline of the target vehicle in the visual image; obtaining the homography matrix based on the intrinsic and extrinsic parameters of the image acquisition device, determining the center point of the rear axle of the target vehicle in the vehicle coordinate system through inverse perspective transformation; determining the line connecting the center point of the rear axle of the target vehicle and the origin of the vehicle coordinate system, and determining the center angle between the vehicle and the target vehicle in the vehicle coordinate system based on the line.
[0116] In one example, the second processing unit 603 is further configured to determine the preset observation angle interval to which each predicted observation angle belongs based on the value of each predicted observation angle, and determine the observation angle corresponding to the preset observation angle interval with the most predicted observation angles as the target observation angle.
[0117] In one example, the determining unit 604 is specifically used to determine the sum of the center angle between the self-vehicle and the target vehicle and the target observation angle of the self-vehicle relative to the target vehicle, and to determine the sum of the angles as the heading angle of the target vehicle.
[0118] In one example, the device 60 also includes a model training unit 600, which includes a data module 6001 and a training module 6002.
[0119] The data module 6001 is used to acquire sample data for each of the multiple preset neural network models. Each sample data includes training set data, validation set data, and test set data. Each set of sample data uses the overall outline of the target vehicle in the visual image acquired by the on-vehicle image acquisition device as the input value and the actual observation angle of the target vehicle from the on-vehicle as the calibration value of the output value.
[0120] The training module 6002 is used to train each preset neural network model using training set data, verify and adjust the model parameters of each preset neural network model using validation set data, and test the performance of each preset neural network model using test set data until the preset conditions are met, thus obtaining each preset neural network model.
[0121] In one example, data module 6001 includes a first data processing module 60011 and a second data processing module 60012.
[0122] The first data processing module 60011 is used to classify the overall block diagram of the target vehicle into n categories based on the observation angle of the vehicle to the target vehicle; where n is a positive integer.
[0123] The second data processing module 60012 is used to divide the overall block diagram of the target vehicle for n-classification into the same number of parts as the number of preset neural network models, and to determine the training set data, validation set data and test set data of each preset neural network model based on the preset allocation ratio; wherein, the preset allocation ratio is the allocation ratio of training set data, validation set data and test set data.
[0124] In one example, data module 6001 also includes data calculation module 60013.
[0125] The data calculation module 60013 is used to determine the actual observation angle of the target vehicle in the visual image acquired by the image acquisition device on the vehicle and the actual center angle between the vehicle and the target vehicle in the vehicle coordinate system.
[0126] The apparatus provided in this embodiment can be used to execute the methods of the above embodiments. Its implementation principle and technical effects are similar, and will not be described again here.
[0127] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. These modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented in software via processing element calls, while others are implemented in hardware. Furthermore, they can be stored as program code in the device's memory, and the data processing modules can be called and executed by a specific processing element. The implementation of other modules is similar. These modules can be fully or partially integrated together, or implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.
[0128] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device 70 includes a processor 701 and a memory 702 communicatively connected to the processor.
[0129] The memory 702 stores computer-executable instructions; the processor 701 executes the computer-executable instructions stored in the memory 702 to implement the method as described in any of the preceding descriptions.
[0130] In the specific implementation of the aforementioned electronic device, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The methods disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0131] This application also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, are used to implement the methods described in any of the foregoing embodiments.
[0132] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to computer instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0133] This application also provides a computer program product, including a computer program that, when executed by a processor, is used to implement the method as described in any of the foregoing embodiments.
[0134] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0135] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for determining the heading angle of a target vehicle, characterized in that, The method includes: Acquire visual images captured by the vehicle; wherein the visual images include at least one target vehicle; The visual image is input into a target detection model for processing to obtain the overall outline of the target vehicle in the visual image and the center angle between the vehicle and the target vehicle in the vehicle coordinate system. Specifically, the homography matrix is obtained based on the intrinsic and extrinsic parameters of the image acquisition device, and the rear axle center point of the target vehicle in the vehicle coordinate system is determined through inverse perspective transformation. A line is then drawn connecting the rear axle center point of the target vehicle to the origin of the vehicle coordinate system, and based on this line, the center angle between the vehicle and the target vehicle in the vehicle coordinate system is determined. The overall block diagram of the target vehicle is input into multiple different preset neural network models for processing. The predicted observation angle of the vehicle to the target vehicle is obtained from the output of each preset neural network model. Based on the value of each predicted observation angle, the preset observation angle interval to which each predicted observation angle belongs is determined. The observation angle corresponding to the preset observation angle interval with the most predicted observation angles is determined as the target observation angle. The heading angle of the target vehicle is determined based on the center angle between the vehicle and the target vehicle and the target observation angle of the vehicle relative to the target vehicle.
2. The method according to claim 1, characterized in that, The visual image is input into a target detection model for processing to obtain an overall bounding map of the target vehicle in the visual image, including: The visual image is input into the target detection model, which performs feature extraction processing on the visual image, identifies and outputs the overall outline of the target vehicle in the visual image.
3. The method according to claim 1, characterized in that, The heading angle of the target vehicle is determined based on the center angle between the vehicle and the target vehicle, and the target observation angle of the vehicle relative to the target vehicle, including: The sum of the center angle between the vehicle and the target vehicle and the target observation angle of the vehicle relative to the target vehicle is determined, and the sum of the angles is determined as the heading angle of the target vehicle.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: Acquire sample data for each of the multiple preset neural network models; wherein each sample data includes training set data, validation set data and test set data, and each set of sample data uses the overall outline of the target vehicle in the visual image acquired by the on-vehicle image acquisition device as the input value and the actual observation angle of the on-vehicle to the target vehicle as the calibration value of the output value. Each preset neural network model is trained using training set data, and its parameters are validated and adjusted using validation set data. The performance of each preset neural network model is then tested using test set data until the preset conditions are met, thus obtaining the preset neural network model.
5. The method according to claim 4, characterized in that, Obtain sample data for each of the multiple preset neural network models, including: Using the observation angle of the vehicle to the target vehicle as a label, classify the overall block diagram of the target vehicle into n categories; where n is a positive integer. The overall block diagram of the target vehicle for n classification is divided into the same number of parts as the preset neural network models, and the training set data, validation set data, and test set data of each preset neural network model are determined based on the preset allocation ratio; wherein, the preset allocation ratio is the allocation ratio of training set data, validation set data, and test set data.
6. The method according to claim 5, characterized in that, Before classifying the overall bounding box of the target vehicle into n categories based on the observation angle of the vehicle to the target vehicle, the method further includes: Determine the true observation angle of the target vehicle in the visual image acquired by the image acquisition device on the vehicle, as well as the true center angle between the vehicle and the target vehicle in the vehicle coordinate system.
7. A device for determining the heading angle of a target vehicle, characterized in that, The device includes: An acquisition unit is used to acquire visual images collected by the vehicle; wherein the visual images include at least one target vehicle; The first processing unit is used to input the visual image into a target detection model for processing, to obtain the overall block diagram of the target vehicle in the visual image and the center angle between the self-vehicle and the target vehicle in the self-vehicle coordinate system; wherein, based on the intrinsic and extrinsic parameters of the image acquisition device, the homography matrix is obtained, and the center point of the rear axle of the target vehicle in the self-vehicle coordinate system is determined by inverse perspective transformation; the line connecting the center point of the rear axle of the target vehicle and the origin of the self-vehicle coordinate system is determined, and based on the line, the center angle between the self-vehicle and the target vehicle in the self-vehicle coordinate system is determined; The second processing unit is used to input the overall block diagram of the target vehicle into multiple different preset neural network models for processing, obtain the predicted observation angle of the vehicle to the target vehicle output by each preset neural network model, and determine the preset observation angle interval to which each predicted observation angle belongs based on the value of each predicted observation angle, and determine the observation angle corresponding to the preset observation angle interval with the most predicted observation angles as the target observation angle. The determining unit is used to determine the heading angle of the target vehicle based on the center angle between the self-vehicle and the target vehicle and the target observation angle of the self-vehicle relative to the target vehicle.
8. An electronic device, characterized in that, The electronic device includes: a processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Vehicle-mounted visual real-time multi-target course angle estimation method and device
CN111291786A
Image recognition method and electronic apparatus thereof
US20230196737A1
