Vehicle initial heading angle calculation method, device and electronic equipment

CN116823931BActive Publication Date: 2026-10-23MUSHROOM CHELIAN INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310621797.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-30
Publication Date
2026-10-23
Estimated Expiration
2043-05-30

AI Technical Summary

Benefits of technology

[0048]本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:本申请实施例的车辆的初始航向角计算方法,先获取路侧相机在当前路段采集的道路图像并对道路图像中的车辆进行检测,得到车辆检测结果,当前路段包括双向单车道的路段;然后根据车辆检测结果进行车辆跟踪,并根据车辆跟踪结果确定目标车辆检测结果,目标车辆为需要确定初始航向角的车辆;之后根据目标车辆检测结果对目标车辆对应的周围车辆进行检测,得到周围车辆检测结果;最后根据目标车辆检测结果和周围车辆检测结果以及当前路段的航向角确定目标车辆的初始航向角。本申请实施例的车辆的初始航向角的计算方法基于双向单车道的特点,对需要赋予初始航向角的目标车辆对应的周围车辆进行检测,结合周围车辆与目标车辆的相对位置关系确定目标车辆的初始航向角,保证了双向单车道的道路场景下车辆初始航向角计算的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116823931B_ABST
    Figure CN116823931B_ABST
Patent Text Reader

Abstract

The application discloses a kind of initial heading angle calculation method, device and electronic equipment of vehicle, the method includes: obtaining the road image of road side camera in current section and carrying out vehicle detection, current section includes the road section of two-way single lane;According to vehicle detection result, vehicle tracking is carried out, and target vehicle detection result is determined according to vehicle tracking result, target vehicle is the vehicle needing to determine initial heading angle;According to target vehicle detection result, the surrounding vehicle corresponding to target vehicle is detected;According to target vehicle detection result and surrounding vehicle detection result and the heading angle of current section, the initial heading angle of target vehicle is determined.The application is based on the characteristics of two-way single lane, the surrounding vehicle corresponding to target vehicle needing to be assigned initial heading angle is detected, the relative position relationship of surrounding vehicle and target vehicle is combined to determine the initial heading angle of target vehicle, guarantee the accuracy of vehicle initial heading angle calculation in the road scene of two-way single lane.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of autonomous driving technology, and in particular to a method, apparatus and electronic device for calculating the initial heading angle of a vehicle. Background Technology

[0002] Roadside detection typically employs deep learning-based target detection technology. By correlating the detection results of multiple frames, the heading angle of the vehicle is calculated, which is then sent to autonomous vehicles for warning or to the cloud for digital display.

[0003] However, the calculation of the heading angle can be inaccurate due to various factors. For example, due to malfunctions in the target tracking algorithm, missed detections in the detection algorithm, or occlusion, the target may be lost during tracking and, upon reappearing, cannot be matched, thus assigning the target a new ID. In this case, since the heading angle cannot be calculated, only an initial heading angle can be set. Similarly, when a target first appears within the field of view of a roadside camera, there is not enough data to calculate the heading angle, so only a default initial heading angle can be set.

[0004] Some existing technologies calculate the initial heading angle of a target vehicle based on the lane line detection results of the area where the vehicle is located. For example, when the target vehicle is in an area without lane lines and there are other vehicles traveling in the same lane around the target vehicle, the heading angle of the other vehicles can be used as the initial heading angle of the target vehicle. However, when there are no other vehicles traveling in the same lane around the target vehicle, the initial heading angle of the target vehicle is calculated based on the heading angle of the lost vehicle or the nearest lane line information.

[0005] However, the above solution relies on the detection results of lane lines, and the accuracy of the initial heading angle calculated by the above logic still needs to be improved in the two-way single-lane road scenario. Summary of the Invention

[0006] This application provides a method, apparatus, and electronic device for calculating the initial heading angle of a vehicle, so as to improve the accuracy of calculating the initial heading angle of a vehicle in a two-way single-lane scenario.

[0007] The embodiments of this application adopt the following technical solutions:

[0008] In a first aspect, embodiments of this application provide a method for calculating the initial heading angle of a vehicle, wherein the method includes:

[0009] Acquire road images captured by roadside cameras in the current road segment and detect vehicles in the road images to obtain vehicle detection results. The current road segment includes a two-way single-lane road segment.

[0010] Vehicle tracking is performed based on the vehicle detection results, and the target vehicle detection results are determined based on the vehicle tracking results. The target vehicle is the vehicle whose initial heading angle needs to be determined.

[0011] Based on the target vehicle detection results, the surrounding vehicles corresponding to the target vehicle are detected to obtain the surrounding vehicle detection results;

[0012] The initial heading angle of the target vehicle is determined based on the target vehicle detection results, the surrounding vehicle detection results, and the heading angle of the current road segment.

[0013] Optionally, the step of detecting surrounding vehicles corresponding to the target vehicle based on the target vehicle detection result to obtain the surrounding vehicle detection result includes:

[0014] The absolute position of the vehicle is determined based on the vehicle detection results. The absolute position of the vehicle includes the absolute position of the target vehicle and the absolute positions of other vehicles.

[0015] The relative distance between the target vehicle and the other vehicles is determined based on the absolute position of the target vehicle and the absolute positions of the other vehicles.

[0016] If the relative distance between the target vehicle and other vehicles is less than a preset distance threshold, then the other vehicles are considered as surrounding vehicles corresponding to the target vehicle and the surrounding vehicle detection result is determined to be that there are surrounding vehicles.

[0017] If the relative distance between the target vehicle and other vehicles is not less than a preset distance threshold, then the surrounding vehicle detection result is determined to be no surrounding vehicles.

[0018] Optionally, determining the initial heading angle of the target vehicle based on the target vehicle detection results, the surrounding vehicle detection results, and the heading angle of the current road segment includes:

[0019] If the surrounding vehicle detection result indicates the presence of surrounding vehicles, then based on the target vehicle detection result and the surrounding vehicle detection result, it is determined whether the target vehicle and the surrounding vehicles are running parallel, and based on the determination result of whether they are running parallel and the heading angle of the current road segment, the initial heading angle of the target vehicle is determined.

[0020] If the surrounding vehicle detection result is no surrounding vehicles, the initial heading angle of the target vehicle is determined based on the target vehicle detection result, the reference point position corresponding to the current road segment, and the heading angle of the current road segment.

[0021] Optionally, the vehicle detection results include the bottom and top ordinates of the detection frame of the target vehicle and the bottom and top ordinates of the detection frames of surrounding vehicles. Determining whether the target vehicle and surrounding vehicles are parallel based on the target vehicle detection results and the surrounding vehicle detection results includes:

[0022] The bottom ordinate of the detection frame of the target vehicle is compared with the top ordinate of the detection frame of the surrounding vehicles, and the top ordinate of the detection frame of the target vehicle is compared with the bottom ordinate of the detection frame of the surrounding vehicles.

[0023] If the bottom ordinate of the detection frame of the target vehicle is greater than the top ordinate of the detection frame of the surrounding vehicles, and the top ordinate of the detection frame of the target vehicle is less than the bottom ordinate of the detection frame of the surrounding vehicles, then it is determined that the target vehicle and the surrounding vehicles are parallel.

[0024] Otherwise, it is determined that the target vehicle is not parallel to the surrounding vehicles.

[0025] Optionally, the vehicle detection results include the lateral x-coordinates and center point coordinates of the detection frame of the target vehicle and the lateral x-coordinates of the detection frames of surrounding vehicles. Determining the initial heading angle of the target vehicle based on the parallel determination result and the heading angle of the current road segment includes:

[0026] If the target vehicle is parallel to surrounding vehicles, the relative positional relationship between the target vehicle and the surrounding vehicles in the road image is determined based on the side horizontal coordinate of the detection frame of the target vehicle and the side horizontal coordinate of the detection frame of the surrounding vehicles. The initial heading angle of the target vehicle is determined based on the relative positional relationship between the target vehicle and the surrounding vehicles in the road image and the heading angle of the current road segment.

[0027] If the target vehicle is not parallel to surrounding vehicles, the relative positional relationship between the target vehicle and the left and right boundaries of the road image is determined based on the coordinates of the center point of the target vehicle's detection frame, and the initial heading angle of the target vehicle is determined based on the relative positional relationship between the target vehicle and the left and right boundaries of the road image and the heading angle of the current road segment.

[0028] Optionally, the heading angle of the current road segment includes the outbound heading angle and the inbound heading angle of the current road segment relative to the roadside camera, and determining the initial heading angle of the target vehicle based on the relative positional relationship between the target vehicle and the surrounding vehicles in the road image and the heading angle of the current road segment includes:

[0029] If the relative position of the target vehicle and the surrounding vehicles in the road image is such that the target vehicle is located to the left of the surrounding vehicles, then the heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle.

[0030] If the target vehicle is located to the right of the surrounding vehicles in the road image, then the heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle.

[0031] Optionally, the heading angle of the current road segment includes the outbound heading angle and the inbound heading angle of the current road segment relative to the roadside camera, and determining the initial heading angle of the target vehicle based on the relative positional relationship between the target vehicle and the left and right boundaries of the road image and the heading angle of the current road segment includes:

[0032] If the relative position of the target vehicle to the left and right boundaries of the road image is such that the target vehicle is located at the left boundary of the road image, then the heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle.

[0033] If the target vehicle is located at the right boundary of the road image relative to the left and right boundaries of the road image, then the heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle.

[0034] Optionally, the heading angle of the current road segment includes the outgoing heading angle and the incoming heading angle of the current road segment relative to the roadside camera, and the reference point position includes the absolute position corresponding to the bottom edge point of the road image and the absolute position corresponding to the road vanishing point of the road image. Determining the initial heading angle of the target vehicle based on the target vehicle detection result, the reference point position corresponding to the current road segment, and the heading angle of the current road segment includes:

[0035] The absolute position of the target vehicle is determined based on the target vehicle detection results;

[0036] The absolute position of the target vehicle is compared with the absolute position corresponding to the bottom edge point of the road image and the absolute position corresponding to the road vanishing point of the road image, respectively.

[0037] If the absolute position of the target vehicle is close to the absolute position corresponding to the bottom edge point of the road image, then the heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle.

[0038] If the absolute position of the target vehicle is close to the absolute position corresponding to the road vanishing point in the road image, then the heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle.

[0039] Secondly, embodiments of this application also provide a device for calculating the initial heading angle of a vehicle, wherein the device includes:

[0040] The first detection unit is used to acquire road images captured by roadside cameras in the current road segment and detect vehicles in the road images to obtain vehicle detection results. The current road segment includes a two-way single-lane road segment.

[0041] The first determining unit is used to perform vehicle tracking based on the vehicle detection results and to determine the target vehicle detection results based on the vehicle tracking results. The target vehicle is the vehicle whose initial heading angle needs to be determined.

[0042] The second detection unit is used to detect the surrounding vehicles corresponding to the target vehicle based on the target vehicle detection result, and obtain the surrounding vehicle detection result.

[0043] The second determining unit is used to determine the initial heading angle of the target vehicle based on the target vehicle detection results, the surrounding vehicle detection results, and the heading angle of the current road segment.

[0044] Thirdly, embodiments of this application also provide an electronic device, including:

[0045] Processor; and

[0046] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform any of the methods described above.

[0047] Fourthly, embodiments of this application also provide a computer-readable storage medium that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform any of the methods described above.

[0048] The above-mentioned at least one technical solution adopted in the embodiments of this application can achieve the following beneficial effects: The method for calculating the initial heading angle of a vehicle in the embodiments of this application first acquires road images collected by roadside cameras in the current road segment and detects vehicles in the road images to obtain vehicle detection results. The current road segment includes a two-way single-lane road segment. Then, vehicle tracking is performed based on the vehicle detection results, and the target vehicle detection result is determined based on the vehicle tracking results. The target vehicle is the vehicle whose initial heading angle needs to be determined. Afterwards, the surrounding vehicles corresponding to the target vehicle are detected based on the target vehicle detection results to obtain surrounding vehicle detection results. Finally, the initial heading angle of the target vehicle is determined based on the target vehicle detection results, the surrounding vehicle detection results, and the heading angle of the current road segment. The method for calculating the initial heading angle of a vehicle in the embodiments of this application is based on the characteristics of a two-way single-lane road. It detects the surrounding vehicles corresponding to the target vehicle that needs to be assigned an initial heading angle, and determines the initial heading angle of the target vehicle by combining the relative positional relationship between the surrounding vehicles and the target vehicle, thus ensuring the accuracy of the calculation of the initial heading angle of the vehicle in a two-way single-lane road scenario. Attached Figure Description

[0049] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0050] Figure 1 This is a flowchart illustrating a method for calculating the initial heading angle of a vehicle according to an embodiment of this application.

[0051] Figure 2 This is a schematic diagram illustrating the relative positional relationship between a target vehicle and surrounding vehicles in an embodiment of this application.

[0052] Figure 3 This is a schematic diagram illustrating the initial heading angle calculation process for a vehicle in an embodiment of this application.

[0053] Figure 4 This is a schematic diagram of the structure of an initial heading angle calculation device for a vehicle according to an embodiment of this application;

[0054] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0056] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0057] This application provides a method for calculating the initial heading angle of a vehicle, such as... Figure 1 The diagram shows a flowchart illustrating a method for calculating the initial heading angle of a vehicle according to an embodiment of this application. The method includes at least the following steps S110 to S140:

[0058] Step S110: Obtain road images captured by roadside cameras in the current road segment and detect vehicles in the road images to obtain vehicle detection results. The current road segment includes a two-way single-lane road segment.

[0059] The initial heading angle calculation method for vehicles in this application embodiment can be executed by roadside equipment. When calculating the initial heading angle, it is necessary to first acquire road images captured by the roadside camera in the current road segment, i.e., the road segment corresponding to the camera's shooting range. Here, the current road segment mainly refers to a two-way single-lane road segment, which is a single lane allowing two-way traffic. Since vehicle travel in a two-way single-lane road has specific characteristics, a corresponding initial heading angle calculation strategy can be designed for such road segments. When the roadside camera is installed, it can be marked according to the covered scene, such as a two-way single-lane road or a two-way two-lane road scene. Then, based on the scene covered by the roadside camera, it can be determined whether to invoke the initial heading angle calculation logic of this application embodiment.

[0060] Subsequently, a target detection model trained using deep learning, such as the YOLO series, is used to detect vehicle targets in the road image. This detection model can be either 2D or 3D. Of course, those skilled in the art can flexibly determine the specific method for vehicle target detection based on existing technologies, and no specific limitations are made here.

[0061] Step S120: Perform vehicle tracking based on the vehicle detection results, and determine the target vehicle detection results based on the vehicle tracking results. The target vehicle is the vehicle whose initial heading angle needs to be determined.

[0062] The vehicle detection results obtained from the aforementioned steps include all vehicle targets detected from the current road image. However, not all vehicle targets need to be assigned an initial heading angle. It is often only vehicle targets that appear in the field of view of the roadside camera for the first time or that cannot be associated with vehicle targets detected in previous frames due to abnormalities in the tracking and detection algorithm that need to be assigned an initial heading angle.

[0063] Based on this, the embodiments of this application can perform tracking and matching between the vehicle detection results obtained from the aforementioned steps and the detection results of the previous frame. If a match is successful, it means that the vehicle has appeared in the previous frame, and the current heading angle can be calculated based on the positions of the two adjacent frames without assigning an initial heading angle. If the match fails, it means that the vehicle was not detected in the previous frame or that the tracking and detection algorithm is malfunctioning, resulting in a failure to match the target that was not detected in the previous frame, i.e., the target is lost. In either case, a failed match can be considered as requiring an initial heading angle. Therefore, the target vehicle that needs to be assigned an initial heading angle can be determined from all the vehicles detected in the current road image through the vehicle tracking results.

[0064] Step S130: Detect the surrounding vehicles corresponding to the target vehicle based on the target vehicle detection results to obtain the surrounding vehicle detection results.

[0065] After identifying the target vehicle, we can further detect the surrounding vehicles to determine whether there are other vehicles around the target vehicle. This allows us to adopt different initial heading angle calculation strategies depending on the situation.

[0066] Step S140: Determine the initial heading angle of the target vehicle based on the target vehicle detection results, the surrounding vehicle detection results, and the heading angle of the current road segment.

[0067] The initial heading angle of the vehicle in this embodiment is mainly calculated based on the heading angle of the current road segment. The heading angle of the current road segment can be divided into the incoming heading angle and the outgoing heading angle according to the vehicle's orientation relative to the roadside camera. The orientation of the roadside camera is the heading angle of the roadside camera in the world coordinate system, which can be pre-calibrated. The direction opposite to the orientation of the roadside camera is the incoming heading angle, and the direction in the same direction as the orientation of the roadside camera is the outgoing heading angle.

[0068] By combining the target vehicle detection results from the aforementioned steps with the surrounding vehicle detection results, the orientation of the current target vehicle relative to the roadside camera can be determined, i.e., whether it is traveling towards or away from the roadside camera. Then, the incoming heading angle and the outgoing heading angle can be assigned respectively, thereby obtaining the initial heading angle of the current target vehicle in the world coordinate system.

[0069] The method for calculating the initial heading angle of a vehicle in this embodiment is based on the characteristics of a two-way single-lane road. It detects the surrounding vehicles corresponding to the target vehicle that needs to be assigned an initial heading angle, and determines the initial heading angle of the target vehicle by combining the relative positional relationship between the surrounding vehicles and the target vehicle, thus ensuring the accuracy of the calculation of the initial heading angle of the vehicle in a two-way single-lane road scenario.

[0070] In some embodiments of this application, the vehicle tracking based on the vehicle detection results includes: obtaining the transformation relationship between a high-precision map and a road image; filtering vehicle detection results that do not belong to the motor vehicle road area in the vehicle detection results according to the transformation relationship between the high-precision map and the road image to obtain filtered vehicle detection results; and performing vehicle tracking based on the filtered vehicle detection results to obtain the vehicle tracking result.

[0071] Since the roadside camera senses all vehicles within its field of view, the vehicle detection results obtained in the aforementioned embodiments may include detection results of vehicles that do not belong to the motor vehicle road area. Therefore, the embodiments of this application can filter these vehicles to avoid subsequent invalid processing.

[0072] Since high-precision maps can provide information on the driving areas of motor vehicles on roads, and the transformation relationship between high-precision maps and road images can be pre-defined, the driving area information of the current road segment in the high-precision map can be projected onto the road image based on this transformation relationship. This yields the driving area information of motor vehicles in the road image, filters out vehicle detection results located outside the driving area, and tracks and detects the remaining vehicle detection results.

[0073] In some embodiments of this application, the step of detecting surrounding vehicles corresponding to the target vehicle based on the target vehicle detection result to obtain the surrounding vehicle detection result includes: determining the absolute position of the vehicle based on the vehicle detection result, wherein the absolute position of the vehicle includes the absolute position of the target vehicle and the absolute positions of other vehicles; determining the relative distance between the target vehicle and other vehicles based on the absolute position of the target vehicle and the absolute positions of other vehicles; if the relative distance between the target vehicle and other vehicles is less than a preset distance threshold, then the other vehicles are considered as surrounding vehicles corresponding to the target vehicle and the surrounding vehicle detection result is determined to be that there are surrounding vehicles; if the relative distance between the target vehicle and other vehicles is not less than the preset distance threshold, then the surrounding vehicle detection result is determined to be that there are no surrounding vehicles.

[0074] When detecting vehicles around the target vehicle, the paired positions of the vehicles can be determined first based on the vehicle detection results, including the absolute positions of the target vehicle and all other vehicles. Specifically, the coordinates of the rectangular boxes in the vehicle detection results can be transformed to the world coordinate system through the transformation relationship between the image coordinate system and the world coordinate system to obtain the absolute position of the vehicle. Alternatively, it can be combined with roadside lidar and other technologies for fusion positioning to obtain the absolute position of the vehicle. The specific method of vehicle positioning can be flexibly determined by those skilled in the art based on existing technologies, and no specific limitation is made here.

[0075] After obtaining the absolute position of the vehicle, the relative distance between the target vehicle and other vehicles can be calculated based on the absolute position. If there is a vehicle among the other vehicles whose relative distance to the target vehicle is less than a preset distance threshold, it indicates that there are other vehicles around the target vehicle. These surrounding vehicles can, to some extent, assist in determining the subsequent travel direction of the target vehicle on the current road segment. In other words, the surrounding vehicle detection result is "surrounding vehicles present." If the relative distance between the target vehicle and all other vehicles is not less than the preset distance threshold, it indicates that the distances between the other vehicles detected in the current road image and the target vehicle are relatively far, and they cannot provide a reliable reference for determining the travel direction of the target vehicle on the current road segment. In other words, the surrounding vehicle detection result is "no surrounding vehicles present."

[0076] In some embodiments of this application, determining the initial heading angle of the target vehicle based on the target vehicle detection result, the surrounding vehicle detection result, and the heading angle of the current road segment includes: if the surrounding vehicle detection result indicates the presence of surrounding vehicles, determining whether the target vehicle and the surrounding vehicles are running parallel based on the target vehicle detection result and the surrounding vehicle detection result, and determining the initial heading angle of the target vehicle based on the determination result of whether they are running parallel and the heading angle of the current road segment; if the surrounding vehicle detection result indicates the absence of surrounding vehicles, determining the initial heading angle of the target vehicle based on the target vehicle detection result, the reference point position corresponding to the current road segment, and the heading angle of the current road segment.

[0077] When there are surrounding vehicles near the target vehicle, the relative driving relationship between the target vehicle and the surrounding vehicles can be determined by combining the detection results of the target vehicle and the surrounding vehicles. That is, in the case of a two-way single-lane road, it can be determined whether the target vehicle and the surrounding vehicles are parallel. Based on the determination of whether they are parallel, the initial heading angle of the target vehicle can be calculated by combining the heading angle of the current road segment.

[0078] If there are no surrounding vehicles near the target vehicle and no surrounding vehicle information is available for reference, the initial heading angle of the target vehicle can be assigned based on the predefined reference point position corresponding to the current road segment and the absolute position of the target vehicle. The reference point position here mainly refers to the two endpoint positions corresponding to the road segment in the current road image. Thus, the orientation of the target vehicle relative to the roadside camera can be determined based on the relative positional relationship between the target vehicle and the two endpoint positions, and then the corresponding initial heading angle can be assigned.

[0079] In some embodiments of this application, the vehicle detection result includes the bottom and top ordinates of the detection frame of the target vehicle and the bottom and top ordinates of the detection frames of surrounding vehicles. Determining whether the target vehicle and surrounding vehicles are parallel based on the target vehicle detection result and the surrounding vehicle detection result includes: comparing the bottom ordinate of the target vehicle's detection frame with the top ordinate of the surrounding vehicle's detection frame, and comparing the top ordinate of the target vehicle's detection frame with the bottom ordinate of the surrounding vehicle's detection frame; if the bottom ordinate of the target vehicle's detection frame is greater than the top ordinate of the surrounding vehicle's detection frame, and the top ordinate of the target vehicle's detection frame is less than the bottom ordinate of the surrounding vehicle's detection frame, then it is determined that the target vehicle and the surrounding vehicles are parallel; otherwise, it is determined that the target vehicle and the surrounding vehicles are not parallel.

[0080] In an image coordinate system, the origin is usually the top left corner of the image. The horizontal axis extends to the right from the top left corner and the vertical axis extends downwards. The closer to the bottom edge of the image, the larger the value of the vertical coordinate. Therefore, when determining whether a target vehicle is parallel to surrounding vehicles, the vertical coordinate of the detection box of the target vehicle in the road image and the vertical coordinate of the detection boxes of surrounding vehicles in the road image can be used for judgment.

[0081] like Figure 2 The diagram illustrates the relative positional relationship between a target vehicle and surrounding vehicles according to an embodiment of this application. Taking the target vehicle's position relative to the surrounding vehicles on the lower right side of the road image as an example, if the bottom ordinate y1 of the target vehicle's detection box is greater than the top ordinate y4 of the surrounding vehicles' detection boxes, and the top ordinate y2 of the target vehicle's detection box is less than the bottom ordinate y3 of the surrounding vehicles' detection boxes, it indicates that the target vehicle and surrounding vehicles are parallel. Otherwise, it is considered a non-parallel situation, meaning the surrounding vehicles are in front of or behind the target vehicle. Of course, the above-mentioned criteria for determining whether parallelism exists also apply to situations where the target vehicle is relative to the surrounding vehicles on the upper right, upper left, and lower left sides of the road image, and will not be specifically demonstrated here.

[0082] In some embodiments of this application, the vehicle detection result includes the side horizontal coordinates and center point coordinates of the detection frame of the target vehicle and the side horizontal coordinates of the detection frames of surrounding vehicles. Determining the initial heading angle of the target vehicle based on the determination of whether it is parallel to surrounding vehicles and the heading angle of the current road segment includes: if the target vehicle is parallel to surrounding vehicles, determining the relative positional relationship between the target vehicle and the surrounding vehicles in the road image based on the side horizontal coordinates of the target vehicle's detection frame and the side horizontal coordinates of the detection frames of the surrounding vehicles, and determining the initial heading angle of the target vehicle based on the relative positional relationship between the target vehicle and the surrounding vehicles in the road image and the heading angle of the current road segment; if the target vehicle is not parallel to surrounding vehicles, determining the relative positional relationship between the target vehicle and the left and right boundaries of the road image based on the center point coordinates of the target vehicle's detection frame, and determining the initial heading angle of the target vehicle based on the relative positional relationship between the target vehicle and the left and right boundaries of the road image and the heading angle of the current road segment.

[0083] Based on the aforementioned embodiments, it can be determined whether the target vehicle is parallel to surrounding vehicles. Depending on whether parallelism exists, different strategies can be adopted to calculate the initial heading angle of the target vehicle.

[0084] If the target vehicle is parallel to surrounding vehicles, the relative position of the target vehicle and surrounding vehicles in the road image can be determined based on the horizontal coordinate of the detection boxes of the target vehicle and surrounding vehicles. This relative position mainly reflects whether the target vehicle is traveling on the left or right side of the surrounding vehicles in the parallel situation. In this way, combined with the traffic rule that vehicles travel on the right side of the road in a two-way single-lane parallel road scenario, the orientation of the target vehicle relative to the roadside camera can be determined, and then the corresponding initial heading angle can be assigned.

[0085] Further integration Figure 2 To clarify, if the x-coordinates (x1 and x2) of the corner points of the target vehicle's detection frame are both greater than the x-coordinates (x3 and x4) of the corner points of the surrounding vehicles' detection frames, it can be determined that the target vehicle is traveling to the left of the surrounding vehicles. Conversely, if the x-coordinates of all four corner points of the target vehicle's detection frame are all less than the x-coordinates of the four corner points of the surrounding vehicles' detection frames, it can be determined that the target vehicle is traveling to the right of the surrounding vehicles.

[0086] If the target vehicle is not traveling parallel to or in front of other vehicles, since there is no reference for the left-right relative position of the surrounding vehicles, the target vehicle can be determined to be closer to the left or right road boundary based on its relative position to the left and right boundaries of the road image. Then, by combining this with the habit of vehicles driving on the right side of the road in a two-way single-lane road scene, the orientation of the target vehicle relative to the roadside camera can be determined, and the corresponding initial heading angle can be assigned.

[0087] In some embodiments of this application, the heading angle of the current road segment includes the outgoing heading angle and the incoming heading angle of the current road segment relative to the roadside camera. The step of determining the initial heading angle of the target vehicle based on the relative positional relationship between the target vehicle and the surrounding vehicles in the road image and the heading angle of the current road segment includes: if the relative positional relationship between the target vehicle and the surrounding vehicles in the road image is that the target vehicle is to the left of the surrounding vehicles, then the incoming heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle; if the relative positional relationship between the target vehicle and the surrounding vehicles in the road image is that the target vehicle is to the right of the surrounding vehicles, then the outgoing heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle.

[0088] If the target vehicle is located to the left of surrounding vehicles, based on the traffic rule that vehicles travel on the right side of the road in a two-way single-lane parallel road scenario, it can be determined that the target vehicle is traveling towards the roadside camera. Therefore, an incoming heading angle can be assigned, which is the opposite heading angle to the roadside camera's heading angle. If the target vehicle is located to the right of surrounding vehicles, it can be determined that the target vehicle is traveling away from the roadside camera. Therefore, a outgoing heading angle can be assigned, which is the same heading angle as the roadside camera's heading angle.

[0089] In some embodiments of this application, the heading angle of the current road segment includes the outgoing heading angle and the incoming heading angle of the current road segment relative to the roadside camera. Determining the initial heading angle of the target vehicle based on the relative positional relationship between the target vehicle and the left and right boundaries of the road image and the heading angle of the current road segment includes: if the relative positional relationship between the target vehicle and the left and right boundaries of the road image is that the target vehicle is located at the left boundary of the road image, then the incoming heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle; if the relative positional relationship between the target vehicle and the left and right boundaries of the road image is that the target vehicle is located at the right boundary of the road image, then the outgoing heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle.

[0090] If the target vehicle is closer to the left edge of the road image, then based on the habit of vehicles driving on the right side of the road in a two-way single-lane road scenario, it can be assumed that the target vehicle is traveling towards the roadside camera. Therefore, an incoming heading angle can be assigned, which is the opposite heading angle to the roadside camera's heading angle. If the target vehicle is closer to the right edge of the road image, it can be assumed that the target vehicle is traveling away from the roadside camera. Therefore, a outgoing heading angle can be assigned, which is the same heading angle as the roadside camera's heading angle.

[0091] To determine whether a target vehicle is closer to the left or right road boundary, one can offset the center point coordinates of the target vehicle's detection frame to the left and right respectively. For example, convert the center point coordinates of the target vehicle's detection frame to a high-precision map, and then offset the converted coordinates to the left and right respectively to see which road boundary it crosses first; this is the closer road boundary. Alternatively, one can convert the center point of the target vehicle's detection frame to the world coordinate system and then calculate the distance to the curve equation corresponding to the road boundary to determine which road boundary it is closer to.

[0092] In some embodiments of this application, the heading angle of the current road segment includes the outgoing heading angle and the incoming heading angle of the current road segment relative to the roadside camera. The reference point position includes the absolute position corresponding to the bottom edge point of the road image and the absolute position corresponding to the road vanishing point of the road image. Determining the initial heading angle of the target vehicle based on the target vehicle detection result, the reference point position corresponding to the current road segment, and the heading angle of the current road segment includes: determining the absolute position of the target vehicle based on the target vehicle detection result; comparing the absolute position of the target vehicle with the absolute position corresponding to the bottom edge point of the road image and the absolute position corresponding to the road vanishing point of the road image, respectively; if the absolute position of the target vehicle is closer to the absolute position corresponding to the bottom edge point of the road image, then the outgoing heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle; if the absolute position of the target vehicle is closer to the absolute position corresponding to the road vanishing point of the road image, then the incoming heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle.

[0093] The reference point positions defined in this application for the current road segment mainly include the positions of the two endpoints of the current road segment. Based on the shooting angle characteristics of the roadside camera, one endpoint can be determined based on the bottom edge point in the road image, such as the midpoint of the bottom edge of the road image, which is usually closer to the starting point of the motor vehicle driving area of ​​the current road segment. The other endpoint can be determined based on the road vanishing point in the road image, which can be detected by the road vanishing point detection algorithm in the prior art, and represents the position of the ending point of the motor vehicle driving area of ​​the current road segment.

[0094] After determining the positions of two reference points on the current road segment, the distances between the target vehicle and each reference point are calculated to determine which reference point the target vehicle is closer to. If the target vehicle is closer to the absolute position corresponding to the bottom edge of the road image, it can be assumed that the vehicle has just appeared at the bottom edge of the road image. Therefore, the target vehicle is traveling away from the roadside camera, and a heading angle can be assigned, which is the same as the heading angle of the roadside camera. If the target vehicle is closer to the absolute position corresponding to the vanishing point of the road, it can be assumed that the vehicle has just appeared at the top edge of the road image. Therefore, the target vehicle is traveling towards the roadside camera, and a heading angle can be assigned, which is the opposite of the heading angle of the roadside camera.

[0095] For ease of understanding of the various embodiments of this application, such as Figure 3 The diagram illustrates a process for calculating the initial heading angle of a vehicle according to an embodiment of this application. First, road images captured by a roadside camera on the current road segment are acquired and vehicle detection is performed. Based on the vehicle detection results, vehicle tracking is performed, and the target vehicle detection result is determined based on the vehicle tracking results. Then, surrounding vehicles corresponding to the target vehicle are detected based on the target vehicle detection result to obtain the surrounding vehicle detection result.

[0096] If the surrounding vehicle detection result is no surrounding vehicles, the target vehicle's absolute position and the positions of the two endpoints corresponding to the current road segment are used to determine which endpoint the target vehicle is closer to. Based on the closer endpoint, the target vehicle's orientation relative to the roadside camera is determined, and a corresponding initial heading angle is assigned. If it is closer to the bottom edge of the road image, a outward heading angle is assigned; if it is closer to the road vanishing point of the road image, an inward heading angle is assigned.

[0097] If the surrounding vehicle detection result indicates the presence of surrounding vehicles, the system further determines whether the target vehicle is parallel to these surrounding vehicles. If the target vehicle is parallel to surrounding vehicles, the system further determines their relative positional relationship. If the target vehicle is to the left of the surrounding vehicles, an incoming heading angle can be assigned. If the target vehicle is to the right of the surrounding vehicles, a outgoing heading angle can be assigned. If the target vehicle is not parallel to surrounding vehicles, an initial heading angle can be assigned based on the relative positional relationship between the target vehicle and the left and right boundaries of the road image. If the target vehicle is closer to the left boundary of the road image, an incoming heading angle can be assigned. If the target vehicle is closer to the right boundary of the road image, a outgoing heading angle can be assigned.

[0098] The initial heading angle calculation process of this application is designed for a two-way single-lane road scenario. It detects the surrounding vehicles corresponding to the target vehicle that needs to be assigned an initial heading angle, and determines the initial heading angle of the target vehicle by combining the relative positional relationship between the surrounding vehicles and the target vehicle. This ensures the accuracy of the initial heading angle calculation of the vehicle in a two-way single-lane road scenario, and does not depend on the detection of lane lines in the road.

[0099] This application embodiment also provides a vehicle initial heading angle calculation device 400, such as... Figure 4 The diagram shows a structural schematic of a vehicle initial heading angle calculation device according to an embodiment of this application. The device 400 includes: a first detection unit 410, a first determination unit 420, a second detection unit 430, and a second determination unit 440, wherein:

[0100] The first detection unit 410 is used to acquire road images collected by roadside cameras in the current road segment and detect vehicles in the road images to obtain vehicle detection results. The current road segment includes a two-way single-lane road segment.

[0101] The first determining unit 420 is used to perform vehicle tracking based on the vehicle detection result and determine the target vehicle detection result based on the vehicle tracking result. The target vehicle is the vehicle whose initial heading angle needs to be determined.

[0102] The second detection unit 430 is used to detect the surrounding vehicles corresponding to the target vehicle based on the target vehicle detection result, and obtain the surrounding vehicle detection result.

[0103] The second determining unit 440 is used to determine the initial heading angle of the target vehicle based on the target vehicle detection results, the surrounding vehicle detection results, and the heading angle of the current road segment.

[0104] In some embodiments of this application, the second detection unit 430 is specifically used for: determining the absolute position of a vehicle based on the vehicle detection result, wherein the absolute position of the vehicle includes the absolute position of the target vehicle and the absolute positions of other vehicles; determining the relative distance between the target vehicle and other vehicles based on the absolute position of the target vehicle and the absolute positions of the other vehicles; if the relative distance between the target vehicle and other vehicles is less than a preset distance threshold, then the other vehicles are considered as surrounding vehicles corresponding to the target vehicle and the surrounding vehicle detection result is determined to be that there are surrounding vehicles; if the relative distance between the target vehicle and other vehicles is not less than the preset distance threshold, then the surrounding vehicle detection result is determined to be that there are no surrounding vehicles.

[0105] In some embodiments of this application, the second determining unit 440 is specifically used for: if the surrounding vehicle detection result indicates the presence of surrounding vehicles, determining whether the target vehicle and the surrounding vehicles are running parallel based on the target vehicle detection result and the surrounding vehicle detection result, and determining the initial heading angle of the target vehicle based on the determination result of whether they are running parallel and the heading angle of the current road segment; if the surrounding vehicle detection result indicates the absence of surrounding vehicles, determining the initial heading angle of the target vehicle based on the target vehicle detection result, the reference point position corresponding to the current road segment, and the heading angle of the current road segment.

[0106] In some embodiments of this application, the vehicle detection result includes the bottom and top ordinates of the detection frame of the target vehicle and the bottom and top ordinates of the detection frames of surrounding vehicles. The second determining unit 440 is specifically used to: compare the bottom ordinate of the detection frame of the target vehicle with the top ordinate of the detection frames of the surrounding vehicles, and compare the top ordinate of the detection frame of the target vehicle with the bottom ordinate of the detection frames of the surrounding vehicles; if the bottom ordinate of the detection frame of the target vehicle is greater than the top ordinate of the detection frames of the surrounding vehicles, and the top ordinate of the detection frame of the target vehicle is less than the bottom ordinate of the detection frames of the surrounding vehicles, then it is determined that the target vehicle and the surrounding vehicles are parallel; otherwise, it is determined that the target vehicle and the surrounding vehicles are not parallel.

[0107] In some embodiments of this application, the vehicle detection result includes the side horizontal coordinates and center point coordinates of the detection frame of the target vehicle and the side horizontal coordinates of the detection frames of surrounding vehicles. The second determining unit 440 is specifically used for: if the target vehicle is parallel to surrounding vehicles, determining the relative positional relationship between the target vehicle and the surrounding vehicles in the road image based on the side horizontal coordinates of the detection frame of the target vehicle and the side horizontal coordinates of the detection frames of the surrounding vehicles, and determining the initial heading angle of the target vehicle based on the relative positional relationship between the target vehicle and the surrounding vehicles in the road image and the heading angle of the current road segment; if the target vehicle is not parallel to surrounding vehicles, determining the relative positional relationship between the target vehicle and the left and right boundaries of the road image based on the center point coordinates of the detection frame of the target vehicle, and determining the initial heading angle of the target vehicle based on the relative positional relationship between the target vehicle and the left and right boundaries of the road image and the heading angle of the current road segment.

[0108] In some embodiments of this application, the heading angle of the current road segment includes the outbound heading angle and the inbound heading angle of the current road segment relative to the roadside camera. The second determining unit 440 is specifically used to: if the relative position relationship between the target vehicle and the surrounding vehicles in the road image is that the target vehicle is located to the left of the surrounding vehicles, then the inbound heading angle of the current road segment relative to the roadside camera is used as the initial heading angle of the target vehicle; if the relative position relationship between the target vehicle and the surrounding vehicles in the road image is that the target vehicle is located to the right of the surrounding vehicles, then the outbound heading angle of the current road segment relative to the roadside camera is used as the initial heading angle of the target vehicle.

[0109] In some embodiments of this application, the heading angle of the current road segment includes the outbound heading angle and the inbound heading angle of the current road segment relative to the roadside camera. The second determining unit 440 is specifically used to: if the relative positional relationship between the target vehicle and the left and right boundaries of the road image is that the target vehicle is located at the left boundary of the road image, then the inbound heading angle of the current road segment relative to the roadside camera is used as the initial heading angle of the target vehicle; if the relative positional relationship between the target vehicle and the left and right boundaries of the road image is that the target vehicle is located at the right boundary of the road image, then the outbound heading angle of the current road segment relative to the roadside camera is used as the initial heading angle of the target vehicle.

[0110] In some embodiments of this application, the heading angle of the current road segment includes the outgoing heading angle and the incoming heading angle of the current road segment relative to the roadside camera, and the reference point position includes the absolute position corresponding to the bottom edge point of the road image and the absolute position corresponding to the road vanishing point of the road image. The second determining unit 440 is specifically used for: determining the absolute position of the target vehicle based on the target vehicle detection result; comparing the absolute position of the target vehicle with the absolute position corresponding to the bottom edge point of the road image and the absolute position corresponding to the road vanishing point of the road image respectively; if the absolute position of the target vehicle is close to the absolute position corresponding to the bottom edge point of the road image, then the outgoing heading angle of the current road segment relative to the roadside camera is used as the initial heading angle of the target vehicle; if the absolute position of the target vehicle is close to the absolute position corresponding to the road vanishing point of the road image, then the incoming heading angle of the current road segment relative to the roadside camera is used as the initial heading angle of the target vehicle.

[0111] It is understood that the vehicle's initial heading angle calculation device described above can implement each step of the vehicle's initial heading angle calculation method provided in the foregoing embodiments. The relevant explanations regarding the vehicle's initial heading angle calculation method are applicable to the vehicle's initial heading angle calculation device, and will not be repeated here.

[0112] Figure 5This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 5 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.

[0113] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0114] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0115] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming the vehicle's initial heading angle calculation device at the logical level. The processor executes the program stored in memory and specifically performs the following operations:

[0116] Acquire road images captured by roadside cameras in the current road segment and detect vehicles in the road images to obtain vehicle detection results. The current road segment includes a two-way single-lane road segment.

[0117] Vehicle tracking is performed based on the vehicle detection results, and the target vehicle detection results are determined based on the vehicle tracking results. The target vehicle is the vehicle whose initial heading angle needs to be determined.

[0118] Based on the target vehicle detection results, the surrounding vehicles corresponding to the target vehicle are detected to obtain the surrounding vehicle detection results;

[0119] The initial heading angle of the target vehicle is determined based on the target vehicle detection results, the surrounding vehicle detection results, and the heading angle of the current road segment.

[0120] The above is as stated in this application. Figure 1 The method for calculating the initial heading angle of a vehicle disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0121] The electronic device can also perform Figure 1 The method for calculating the initial heading angle of a vehicle is described, and the method for implementing the initial heading angle calculation of a vehicle is described. Figure 1 The functions of the embodiments shown are not described again in this application.

[0122] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 1 The method executed by the vehicle's initial heading angle calculation device in the illustrated embodiment is specifically used to perform:

[0123] Acquire road images captured by roadside cameras in the current road segment and detect vehicles in the road images to obtain vehicle detection results. The current road segment includes a two-way single-lane road segment.

[0124] Vehicle tracking is performed based on the vehicle detection results, and the target vehicle detection results are determined based on the vehicle tracking results. The target vehicle is the vehicle whose initial heading angle needs to be determined.

[0125] Based on the target vehicle detection results, the surrounding vehicles corresponding to the target vehicle are detected to obtain the surrounding vehicle detection results;

[0126] The initial heading angle of the target vehicle is determined based on the target vehicle detection results, the surrounding vehicle detection results, and the heading angle of the current road segment.

[0127] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0128] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0129] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0130] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0131] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0132] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0133] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0134] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0135] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0136] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for calculating the initial heading angle of a vehicle, wherein, The method includes: Acquire road images captured by roadside cameras in the current road segment and detect vehicles in the road images to obtain vehicle detection results. The current road segment includes a two-way single-lane road segment. Vehicle tracking is performed based on the vehicle detection results, and the target vehicle detection results are determined based on the vehicle tracking results. The target vehicle is the vehicle whose initial heading angle needs to be determined. Based on the target vehicle detection results, the surrounding vehicles corresponding to the target vehicle are detected to obtain the surrounding vehicle detection results; The initial heading angle of the target vehicle is determined based on the target vehicle detection results, the surrounding vehicle detection results, and the heading angle of the current road segment. The step of determining the initial heading angle of the target vehicle based on the target vehicle detection results, the surrounding vehicle detection results, and the heading angle of the current road segment includes: If the surrounding vehicle detection result indicates the presence of surrounding vehicles, then based on the target vehicle detection result and the surrounding vehicle detection result, it is determined whether the target vehicle and the surrounding vehicles are running parallel, and based on the determination result of whether they are running parallel and the heading angle of the current road segment, the initial heading angle of the target vehicle is determined. If the surrounding vehicle detection result is no surrounding vehicles, the initial heading angle of the target vehicle is determined based on the target vehicle detection result, the reference point position corresponding to the current road segment, and the heading angle of the current road segment. The heading angle of the current road segment is divided into the approach heading angle and the destination heading angle according to the orientation of the target vehicle relative to the roadside camera.

2. The method as described in claim 1, wherein, The step of detecting surrounding vehicles based on the target vehicle detection results to obtain surrounding vehicle detection results includes: The absolute position of the vehicle is determined based on the vehicle detection results. The absolute position of the vehicle includes the absolute position of the target vehicle and the absolute positions of other vehicles. The relative distance between the target vehicle and the other vehicles is determined based on the absolute position of the target vehicle and the absolute positions of the other vehicles. If the relative distance between the target vehicle and other vehicles is less than a preset distance threshold, then the other vehicles are considered as surrounding vehicles corresponding to the target vehicle and the surrounding vehicle detection result is determined to be that there are surrounding vehicles. If the relative distance between the target vehicle and other vehicles is not less than a preset distance threshold, then the surrounding vehicle detection result is determined to be no surrounding vehicles.

3. The method as described in claim 1, wherein, The vehicle detection results include the bottom and top ordinates of the detection frame of the target vehicle and the bottom and top ordinates of the detection frames of surrounding vehicles. Determining whether the target vehicle and surrounding vehicles are parallel based on the target vehicle detection results and the surrounding vehicle detection results includes: The bottom ordinate of the detection frame of the target vehicle is compared with the top ordinate of the detection frame of the surrounding vehicles, and the top ordinate of the detection frame of the target vehicle is compared with the bottom ordinate of the detection frame of the surrounding vehicles. If the bottom ordinate of the detection frame of the target vehicle is greater than the top ordinate of the detection frame of the surrounding vehicles, and the top ordinate of the detection frame of the target vehicle is less than the bottom ordinate of the detection frame of the surrounding vehicles, then it is determined that the target vehicle and the surrounding vehicles are parallel. Otherwise, it is determined that the target vehicle is not parallel to the surrounding vehicles.

4. The method as described in claim 1, wherein, The vehicle detection results include the lateral horizontal coordinates and center point coordinates of the target vehicle's detection frame, as well as the lateral horizontal coordinates of the detection frames of surrounding vehicles. Determining the initial heading angle of the target vehicle based on the parallelism determination result and the heading angle of the current road segment includes: If the target vehicle is parallel to surrounding vehicles, the relative positional relationship between the target vehicle and the surrounding vehicles in the road image is determined based on the side horizontal coordinate of the detection frame of the target vehicle and the side horizontal coordinate of the detection frame of the surrounding vehicles. The initial heading angle of the target vehicle is determined based on the relative positional relationship between the target vehicle and the surrounding vehicles in the road image and the heading angle of the current road segment. If the target vehicle is not parallel to surrounding vehicles, the relative positional relationship between the target vehicle and the left and right boundaries of the road image is determined based on the coordinates of the center point of the target vehicle's detection frame, and the initial heading angle of the target vehicle is determined based on the relative positional relationship between the target vehicle and the left and right boundaries of the road image and the heading angle of the current road segment.

5. The method as described in claim 4, wherein, The heading angle of the current road segment includes the outbound heading angle and the inbound heading angle of the current road segment relative to the roadside camera. Determining the initial heading angle of the target vehicle based on the relative positional relationship between the target vehicle and surrounding vehicles in the road image and the heading angle of the current road segment includes: If the relative position of the target vehicle and the surrounding vehicles in the road image is such that the target vehicle is located to the left of the surrounding vehicles, then the heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle. If the target vehicle is located to the right of the surrounding vehicles in the road image, then the heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle.

6. The method of claim 4, wherein, The heading angle of the current road segment includes the outgoing heading angle and the incoming heading angle of the current road segment relative to the roadside camera. Determining the initial heading angle of the target vehicle based on the relative positional relationship between the target vehicle and the left and right boundaries of the road image and the heading angle of the current road segment includes: If the relative position of the target vehicle to the left and right boundaries of the road image is such that the target vehicle is located at the left boundary of the road image, then the heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle. If the target vehicle is located at the right boundary of the road image relative to the left and right boundaries of the road image, then the heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle.

7. The method of claim 4, wherein, The heading angle of the current road segment includes the outgoing heading angle and the incoming heading angle of the current road segment relative to the roadside camera. The reference point position includes the absolute position corresponding to the bottom edge point of the road image and the absolute position corresponding to the road vanishing point of the road image. Determining the initial heading angle of the target vehicle based on the target vehicle detection result, the reference point position corresponding to the current road segment, and the heading angle of the current road segment includes: The absolute position of the target vehicle is determined based on the target vehicle detection results; The absolute position of the target vehicle is compared with the absolute position corresponding to the bottom edge point of the road image and the absolute position corresponding to the road vanishing point of the road image, respectively. If the absolute position of the target vehicle is close to the absolute position corresponding to the bottom edge point of the road image, then the heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle. If the absolute position of the target vehicle is close to the absolute position corresponding to the road vanishing point in the road image, then the heading angle of the current road segment relative to the roadside camera is taken as the initial heading angle of the target vehicle.

8. A device for calculating the initial heading angle of a vehicle, wherein, The device includes: The first detection unit is used to acquire road images captured by roadside cameras in the current road segment and detect vehicles in the road images to obtain vehicle detection results. The current road segment includes a two-way single-lane road segment. The first determining unit is used to perform vehicle tracking based on the vehicle detection results and to determine the target vehicle detection results based on the vehicle tracking results. The target vehicle is the vehicle whose initial heading angle needs to be determined. The second detection unit is used to detect the surrounding vehicles corresponding to the target vehicle based on the target vehicle detection result, and obtain the surrounding vehicle detection result. The second determining unit is used to determine the initial heading angle of the target vehicle based on the target vehicle detection results, the surrounding vehicle detection results, and the heading angle of the current road segment. The second determining unit is specifically used for: If the surrounding vehicle detection result indicates the presence of surrounding vehicles, then based on the target vehicle detection result and the surrounding vehicle detection result, it is determined whether the target vehicle and the surrounding vehicles are running parallel, and based on the determination result of whether they are running parallel and the heading angle of the current road segment, the initial heading angle of the target vehicle is determined. If the surrounding vehicle detection result is no surrounding vehicles, the initial heading angle of the target vehicle is determined based on the target vehicle detection result, the reference point position corresponding to the current road segment, and the heading angle of the current road segment. The heading angle of the current road segment is divided into the approach heading angle and the destination heading angle according to the orientation of the target vehicle relative to the roadside camera.

9. An electronic device, comprising: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Course angle determination method and device of autonomous vehicle and electronic equipment

    CN115556827A