Methods, devices, terminal equipment, and storage media for detecting the lane in which a vehicle is located.
By acquiring the vehicle's latitude and longitude coordinates and map data from the vehicle-road cooperative system, the target location of the vehicle at the intersection is first determined, and then lane comparison is performed, which solves the real-time problem of lane detection and achieves more efficient lane recognition.
Patent Information
- Application Number
- CN202211678167.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-26
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-12-26
AI Technical Summary
Existing technologies consume a long computation time when detecting the lane where a vehicle is located in vehicle-road cooperative systems, which affects real-time performance.
By acquiring the vehicle's latitude and longitude coordinates and the map data of the road area, the target location of the vehicle at the intersection is first determined. Then, the latitude and longitude information of the lane area at the target location is compared, reducing unnecessary comparisons of lane latitude and longitude information.
It effectively reduces computation time and improves the real-time performance of operations, especially in lane detection within intersection areas.
Smart Images

Figure CN116246459B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle-road cooperative technology, and in particular to a method, apparatus, terminal device and storage medium for detecting the lane in which a vehicle is located. Background Technology
[0002] In the field of vehicle-road cooperative technology, it is typically necessary to detect the lane in which each vehicle is traveling within a road area, that is, to determine the lane number of each vehicle. This is the data foundation for online traffic management. Existing technologies generally obtain the latitude and longitude coordinates of the vehicle, and then compare these coordinates with the latitude and longitude information of each lane in the map data of the road area (such as GeoJSON data) to determine the lane in which the vehicle is located. However, this approach leads to high computational time, affecting the real-time performance of the operation. Summary of the Invention
[0003] In view of this, embodiments of this application provide a method, apparatus, terminal device, and storage medium for detecting the lane in which a vehicle is located, which can reduce computation time and improve the real-time performance of the operation.
[0004] A first aspect of this application provides a method for detecting the lane in which a vehicle is located, including:
[0005] When a vehicle is traveling in a road area that includes an intersection, the vehicle's latitude and longitude coordinates and the map data of the road area are obtained; wherein, the map data includes the latitude and longitude information of each lane in the road area and the latitude and longitude range corresponding to each direction of the lane area in the intersection;
[0006] Based on the latitude and longitude coordinates and the latitude and longitude range corresponding to the lane area in each direction, the target position of the vehicle in the intersection is determined;
[0007] The lane in which the vehicle is located is determined based on the latitude and longitude coordinates and the latitude and longitude information of each lane within the lane area of the target location.
[0008] In this embodiment, when a vehicle is traveling within a road area including an intersection, the vehicle's latitude and longitude coordinates and the map data of the road area are first acquired. The map data includes the latitude and longitude information of each lane within the road area and the latitude and longitude range corresponding to each lane area in the intersection. Then, based on the vehicle's latitude and longitude coordinates and the latitude and longitude range corresponding to each lane area in the intersection, the target location of the vehicle within the intersection is determined. Finally, based on the vehicle's latitude and longitude coordinates and the latitude and longitude information of each lane within the target location's lane area, the lane the vehicle is in is determined. Before comparing the vehicle's latitude and longitude coordinates with the lane latitude and longitude information in the map data, the above process first determines the vehicle's target location within the intersection based on the latitude and longitude range corresponding to each lane area in the intersection, and then filters out the lane latitude and longitude information of all other directions within the intersection besides the target location. With this setting, it is only necessary to compare the vehicle's latitude and longitude coordinates with the lane latitude and longitude information corresponding to the target location, instead of comparing the vehicle's latitude and longitude coordinates with all lane latitude and longitude information in the map data. Therefore, it can reduce the calculation time and improve the real-time performance of the operation.
[0009] In one implementation of this application, the lane area of the target orientation includes an entry intersection area and an exit intersection area; after determining the target orientation of the vehicle in the intersection, it may further include:
[0010] Determine whether the vehicle is entering or exiting the intersection.
[0011] Determining the lane where the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane within the lane area of the target orientation may include:
[0012] If the vehicle is traveling in the direction of entering the intersection, then the lane in which the vehicle is located is determined based on the latitude and longitude coordinates and the latitude and longitude information of each lane in the area of the intersection.
[0013] If the vehicle is traveling in the direction of exiting the intersection, the lane in which the vehicle is located is determined based on the latitude and longitude coordinates and the latitude and longitude information of each lane within the exit intersection area.
[0014] Furthermore, determining whether the vehicle's direction of travel is entering or exiting the intersection may include:
[0015] Obtain the heading angle of the vehicle and the azimuth angle of the target location; wherein, the azimuth angle includes a first azimuth angle for entering the intersection from the target location and a second azimuth angle for exiting the intersection from the target location;
[0016] If the difference between the heading angle and the first direction angle is less than a first threshold, then the vehicle's driving direction is determined to be entering the intersection.
[0017] If the difference between the heading angle and the second direction angle is less than the first threshold, then the vehicle's driving direction is determined to be exiting the intersection.
[0018] In one implementation of this application, each lane comprises multiple polygonal regions; determining the lane where the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane within the lane region of the target orientation may include:
[0019] Based on the latitude and longitude information of all polygon regions contained in all lanes within the lane area of the target orientation and the latitude and longitude coordinates, the target polygon region where the vehicle is located in all polygon regions is determined;
[0020] The lane where the target polygonal region is located is determined as the lane where the vehicle is located.
[0021] Specifically, determining the target polygonal region where the vehicle is located within all polygonal regions based on the latitude and longitude information of all polygonal regions contained in all lanes within the lane area of the target orientation and the latitude and longitude coordinates may include:
[0022] For any polygonal region among all the polygonal regions, based on the latitude and longitude information of the arbitrary polygonal region and the latitude and longitude coordinates, it is determined whether the vehicle is located within the arbitrary polygonal region based on computational geometry theory;
[0023] If the vehicle is located within the arbitrary polygonal region, then the arbitrary polygonal region is determined as the target polygonal region.
[0024] Furthermore, the latitude and longitude information of the arbitrary polygonal region includes the latitude and longitude coordinates of each discrete point on each side of the arbitrary polygonal region; the step of determining whether the vehicle is within the arbitrary polygonal region based on computational geometry theory, using the latitude and longitude information of the arbitrary polygonal region and the latitude and longitude coordinates, may include:
[0025] Connecting the discrete points together yields a convex polygon corresponding to the arbitrary polygonal region.
[0026] The latitude and longitude coordinates of the vehicle are converted into vehicle planar coordinates in the Cartesian coordinate system, and the latitude and longitude coordinates of each vertex of the convex polygon are converted into individual vertex planar coordinates in the Cartesian coordinate system.
[0027] Based on the vehicle's planar coordinates and the planar coordinates of each vertex, determine whether the vehicle is inside the convex polygon;
[0028] If the vehicle is located within the convex polygon, then the vehicle is determined to be located within the arbitrary polygon region.
[0029] Furthermore, determining whether the vehicle is within the convex polygon based on the vehicle's planar coordinates and the planar coordinates of each vertex may include:
[0030] Set the initial value of the counter to 0;
[0031] Select one vertex of the convex polygon as the first vertex;
[0032] Based on the first plane coordinates of the first vertex, the second plane coordinates of the second vertex adjacent to the first vertex in the convex polygon, and the vehicle plane coordinates, determine whether the vehicle plane coordinates are inside the convex polygon;
[0033] If the vehicle's planar coordinates are inside the convex polygon, and the x-coordinate of the vehicle's planar coordinates is between the x-coordinates of the first and second planar coordinates, then increment the counter by 1.
[0034] If each vertex of the convex polygon is not selected as the first vertex, then return to the step of selecting one vertex of the convex polygon as the first vertex.
[0035] If each vertex of the convex polygon has been traversed and selected as the first vertex, then the final value of the counter is obtained;
[0036] If the final value is odd, then the vehicle is determined to be inside the convex polygon;
[0037] If the final value is even, then the vehicle is determined to be outside the convex polygon.
[0038] Furthermore, determining whether the vehicle's plane coordinates are inside the convex polygon based on the first plane coordinates of the first vertex, the second plane coordinates of the second vertex adjacent to the first vertex in the convex polygon, and the vehicle's plane coordinates may include:
[0039] Based on the first plane coordinates, the second plane coordinates, and the vehicle plane coordinates, the y-coordinate of the intersection point between the target ray and the target connecting line is calculated; wherein, the target ray is a ray extending in the positive y-direction with the vehicle plane coordinates as its endpoint, and the target connecting line is the line connecting the first vertex and the second vertex;
[0040] If the y-coordinate of the vehicle's planar coordinates is less than the y-coordinate of the intersection point, then the vehicle's planar coordinates are determined to be inside the convex polygon.
[0041] In one implementation of this application, obtaining the latitude and longitude coordinates of the vehicle and the map data of the road area may include:
[0042] When the distance between the vehicle's location and the intersection is detected to be less than a second threshold, the vehicle's latitude and longitude coordinates and the map data of the road area are obtained.
[0043] A second aspect of this application provides an apparatus for detecting the lane in which a vehicle is located, comprising:
[0044] The data acquisition module is used to acquire the latitude and longitude coordinates of the vehicle and the map data of the road area when the vehicle is driving in a road area containing an intersection; wherein, the map data includes the latitude and longitude information of each lane in the road area and the latitude and longitude range corresponding to each direction of the lane area in the intersection.
[0045] The intersection orientation determination module is used to determine the target orientation of the vehicle in the intersection based on the latitude and longitude coordinates and the latitude and longitude range corresponding to the lane area of each orientation.
[0046] The lane determination module is used to determine the lane where the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane in the lane area of the target orientation.
[0047] A third aspect of this application provides a terminal device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method for detecting the lane where a vehicle is located as provided in the first aspect of this application.
[0048] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for detecting the lane where a vehicle is located as provided in the first aspect of this application.
[0049] The fifth aspect of this application provides a computer program product that, when run on a terminal device, causes the terminal device to perform the method for detecting the lane where a vehicle is located, as provided in the first aspect of this application.
[0050] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0051] Figure 1 This is a flowchart of a method for detecting the lane where a vehicle is located, provided in an embodiment of this application;
[0052] Figure 2 This is an operational schematic diagram of setting cross-sections at various locations at an intersection to filter vehicles, provided in an embodiment of this application.
[0053] Figure 3 This is a schematic diagram of the operation for determining the vehicle's driving direction provided in an embodiment of this application;
[0054] Figure 4 This is a schematic diagram of the operation for determining whether the vehicle's planar coordinates are inside a convex polygon, provided in an embodiment of this application.
[0055] Figure 5 This is a schematic diagram of the operation process of the method for detecting the lane where a vehicle is located, provided in the embodiments of this application, in a practical application scenario;
[0056] Figure 6 This is a schematic diagram of the GeoJSON map data visualization of a certain intersection area provided in an embodiment of this application;
[0057] Figure 7 This is a schematic diagram of the structure of a device for detecting the lane where a vehicle is located, provided in an embodiment of this application;
[0058] Figure 8 This is a schematic diagram of a terminal device provided in an embodiment of this application. Detailed Implementation
[0059] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail. Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.
[0060] Vehicle-to-infrastructure (V2I) communication utilizes advanced wireless communication and next-generation Internet technologies to implement comprehensive, real-time dynamic information interaction between vehicles and infrastructure. Based on the collection and fusion of dynamic traffic information across all time and space, it enables active vehicle safety control and cooperative road management. V2I requires detecting the lane in which each vehicle is traveling within the road area. Existing technologies typically compare the vehicle's latitude and longitude coordinates with the latitude and longitude information of each lane in the map data of the road area to determine the vehicle's lane. However, this method results in high computational time consumption and fails to meet real-time requirements. Therefore, this application provides a method, apparatus, terminal device, and storage medium for detecting the lane in which a vehicle is located, which can reduce computational time and improve the real-time performance of the operation. For more specific technical implementation details of this application's embodiments, please refer to the method embodiments described below.
[0061] It should be understood that the execution subject of the various method embodiments of this application can be various types of terminal devices or servers, such as mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), large-screen TVs, etc. The embodiments of this application do not impose any restrictions on the specific type of terminal device and server.
[0062] Please see Figure 1 This application illustrates a method for detecting the lane in which a vehicle is located, as provided in an embodiment of the present application, comprising:
[0063] 101. When a vehicle is traveling within a road area that includes an intersection, acquire the vehicle's latitude and longitude coordinates and the map data of the road area;
[0064] When a vehicle travels within a road area including intersections, its perception data can be collected through various sensing devices. These sensing devices may include, but are not limited to, lidar, cameras, and other types of sensors. The vehicle's perception data may include, but is not limited to, its latitude and longitude coordinates, speed, heading angle, type, and vehicle ID. After collecting the vehicle's perception data, the sensing devices can send this data to the vehicle-to-infrastructure (V2I) terminal device (i.e., the execution entity of this method embodiment).
[0065] The terminal device can obtain the vehicle's latitude and longitude coordinates through sensing data sent by the sensing device. It can also obtain pre-created map data for the road area, which includes the latitude and longitude information of each lane within the road area and the latitude and longitude range corresponding to each lane area at the intersection. This map data can be any data structure containing the latitude and longitude information of each lane within the road area, such as GeoJSON format map data. After obtaining the map data of the road area including the intersection, the latitude and longitude range corresponding to each lane area at the intersection can be calculated. For example, since the map data already records the latitude and longitude information of each lane in the road area, the latitude and longitude information of all lanes included in the lane area at a certain direction (e.g., the north direction) of the intersection can be found. Then, a latitude and longitude range can be calculated based on this lane information as the latitude and longitude range corresponding to the lane area at that direction. Additionally, the azimuth angle for each direction within the intersection can be calculated. This azimuth angle includes the angle from which a vehicle enters the intersection and the angle from which it exits. For example, for the north direction of the intersection, a vehicle entering from the north direction travels due south, while a vehicle exiting from the north direction travels due north. Therefore, the azimuth angle for the north direction can be determined to include both due south and due north directions. For GeoJSON format map data, the latitude and longitude information for each lane can be divided into the latitude and longitude information of multiple polygonal regions. Each polygonal region can have its own globally unique ID, and the correspondence between the polygonal region ID and the lane is known. For example, lane A contains 10 polygonal regions with IDs 1-10, and lane B contains 20 polygonal regions with IDs 11-30. It is known that the polygonal region with ID 5 corresponds to lane A, the polygonal region with ID 28 corresponds to lane B, and so on.
[0066] In one implementation of this application, obtaining the latitude and longitude coordinates of the vehicle and the map data of the road area may include:
[0067] When the distance between the vehicle's location and the intersection is detected to be less than a second threshold, the vehicle's latitude and longitude coordinates and the map data of the road area are obtained.
[0068] Since the technical solution of this application embodiment filters the latitude and longitude information of the lanes to be compared based on the vehicle's location at the intersection, thereby completing the matching of vehicle and lane numbers, the lane number matching operation for the vehicle can only be performed when a vehicle is detected to be about to enter the intersection or has not yet left the intersection far enough (i.e., the distance between the vehicle's position and the intersection is less than a set threshold). This involves obtaining the vehicle's latitude and longitude coordinates and map data to perform subsequent operations. This setting can filter out vehicles that are far from the intersection in the scene, further improving the real-time performance of the method. Figure 2 The diagram shows an operation schematic of setting up cross-sections at various locations at an intersection to filter vehicles. Figure 2 In the intersection shown, each of the four directions (east, west, south, and north) has a cross-section located 100 meters from the center of the intersection. At the current moment, only vehicles (vehicle 1 and vehicle 2) within the area enclosed by the cross-section and the intersection will undergo lane number matching, while vehicles outside the enclosed area (vehicle 3, vehicle 4, and vehicle 5) will be filtered out. It should be noted that this distance threshold can be set reasonably according to actual needs, and the distance thresholds for different directions of the intersection do not need to be the same.
[0069] 102. Determine the target location of the vehicle at the intersection based on the latitude and longitude coordinates and the latitude and longitude range corresponding to the lane area in each direction;
[0070] After acquiring the vehicle's latitude and longitude coordinates and map data, the terminal device can determine the vehicle's location within the intersection based on these coordinates and the corresponding latitude and longitude ranges for each lane area at each direction within the map data. This location is denoted as the target location. Specifically, it can determine which lane area's latitude and longitude range the vehicle's coordinates fall into, thus identifying that location as the vehicle's target location within the intersection.
[0071] 103. Determine the lane where the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane within the lane area of the target location.
[0072] Once the target location is determined, most of the lane latitude and longitude information can be filtered out. Only the vehicle's latitude and longitude coordinates need to be compared with the latitude and longitude information of each lane within the target location's lane area to ultimately determine the vehicle's lane. For example, assuming the intersection is a crossroads, after determining the target location, the lane latitude and longitude information for the other three directions within the crossroads can be filtered out, reducing the amount of lane latitude and longitude information comparison by 75%, effectively reducing computation time and improving the real-time performance of the operation.
[0073] In one implementation of this application, the lane area of the target orientation includes an entry intersection area and an exit intersection area; after determining the target orientation of the vehicle in the intersection, it may further include:
[0074] Determine whether the vehicle is traveling in the direction of entering or exiting the intersection.
[0075] In practice, the lane area at a target location can be divided into an entry zone and an exit zone. The entry zone encompasses all lanes entering the intersection from that location, while the exit zone comprises all lanes exiting the intersection from that location. For example, at a four-lane intersection, the area encompassing the two entry lanes is the entry zone, and the area encompassing the two exit lanes is the exit zone. To further reduce the amount of lane latitude and longitude information comparison, after determining the vehicle's target location, it's possible to further determine whether the vehicle is entering or exiting the intersection, thus reducing the amount of lane latitude and longitude information comparison by another 50%. The direction of travel can be determined using the vehicle's heading angle and the intersection's azimuth angle.
[0076] Furthermore, determining whether the vehicle's direction of travel is entering or exiting the intersection may include:
[0077] (1) Obtain the heading angle of the vehicle and the direction angle of the target location; wherein, the direction angle includes a first direction angle for entering the intersection from the target location and a second direction angle for exiting the intersection from the target location;
[0078] (2) If the difference between the heading angle and the first direction angle is less than the first threshold, then the driving direction of the vehicle is determined to be entering the intersection;
[0079] (3) If the difference between the heading angle and the second direction angle is less than the first threshold, then the driving direction of the vehicle is determined to be exiting the intersection.
[0080] When determining the vehicle's direction of travel, the vehicle's heading angle and the direction angle of the target location can be obtained. These direction angles include the first direction angle from which the vehicle enters the intersection and the second direction angle from which it exits the intersection. The vehicle's heading angle can be obtained from the perception data described in step 101, while the direction angle of the target location can be pre-calculated based on map data. If the difference between the vehicle's heading angle and the first direction angle is less than a certain set threshold (e.g., 10°), the vehicle can be considered to be traveling in the direction indicated by the first direction angle, i.e., entering the intersection. Similarly, if the difference between the vehicle's heading angle and the second direction angle is less than a certain set threshold, the vehicle can be considered to be traveling in the direction indicated by the second direction angle, i.e., exiting the intersection. Figure 3 The diagram shown illustrates the operation for determining the vehicle's direction of travel. Figure 3 In the intersection shown, vehicle A is positioned to the north. The azimuth angle of the north direction includes due south (entering the intersection) and due north (exiting the intersection). Since vehicle A's heading angle is close to due north, it can be determined that vehicle A is traveling out of the intersection.
[0081] Determining the lane where the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane within the lane area of the target orientation may include:
[0082] (1) If the vehicle is traveling in the direction of entering the intersection, the lane in which the vehicle is located is determined based on the latitude and longitude coordinates and the latitude and longitude information of each lane in the area of the intersection.
[0083] (2) If the vehicle is traveling in the direction of exiting the intersection, the lane in which the vehicle is located is determined based on the latitude and longitude coordinates and the latitude and longitude information of each lane in the area of the exiting intersection.
[0084] If the vehicle's direction of travel is towards the intersection, it means the vehicle is traveling in the lane of the intersection's entry area at the target location. Therefore, the latitude and longitude information of the lanes exiting the intersection can be filtered out. In this case, simply compare the vehicle's latitude and longitude coordinates with the latitude and longitude information of each lane within the intersection's entry area. Conversely, if the vehicle's direction of travel is towards the intersection's exit, it means the vehicle is traveling in the lane of the intersection's exit area at the target location. Therefore, the latitude and longitude information of the lanes entering the intersection can be filtered out. In this case, simply compare the vehicle's latitude and longitude coordinates with the latitude and longitude information of each lane within the intersection's exit area.
[0085] In one implementation of this application, each lane comprises multiple polygonal regions; determining the lane where the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane within the lane region of the target orientation may include:
[0086] (1) Based on the latitude and longitude information of all polygon regions contained in all lanes within the lane area of the target orientation and the latitude and longitude coordinates, determine the target polygon region where the vehicle is located in all polygon regions;
[0087] (2) The lane where the target polygonal region is located is determined as the lane where the vehicle is located.
[0088] For map data in formats like GeoJSON, the latitude and longitude information of each lane can be divided into the latitude and longitude information of multiple polygonal regions, each with its own globally unique ID. The correspondence between the polygonal region ID and the lane is known. After filtering the latitude and longitude information of the lanes to be matched based on the vehicle's location at the intersection (further filtering can be done by considering the vehicle's direction of travel), the latitude and longitude information of all lanes to be compared can be determined, thus identifying the latitude and longitude information of all polygonal regions to be compared. Then, combining the vehicle's latitude and longitude coordinates with the latitude and longitude information of these polygonal regions, the polygonal region in which the vehicle is located is determined, denoted as the target polygonal region. Finally, the lane in which the target polygonal region is located can be identified as the lane in which the vehicle is located, thus completing the lane number matching. For example, suppose after filtering, we need to compare the latitude and longitude information of lane A and lane B. Lane A contains 10 polygonal regions with IDs 1-10, and lane B contains 20 polygonal regions with IDs 11-30. We can then compare the latitude and longitude coordinates of the vehicle with the latitude and longitude information of these 30 polygonal regions to find the polygonal region where the vehicle is located. Suppose that polygonal region has an ID of 26, then we can finally determine that the vehicle is in lane B, which corresponds to the polygonal region with ID 26.
[0089] Specifically, determining the target polygonal region where the vehicle is located within all polygonal regions based on the latitude and longitude information of all polygonal regions contained in all lanes within the lane area of the target orientation and the latitude and longitude coordinates may include:
[0090] (1) For any polygonal region among all the polygonal regions, based on the latitude and longitude information of the arbitrary polygonal region and the latitude and longitude coordinates, determine whether the vehicle is located within the arbitrary polygonal region based on computational geometry theory;
[0091] (2) If the vehicle is located within the arbitrary polygonal region, then the arbitrary polygonal region is determined as the target polygonal region.
[0092] When locating the target polygon region where a vehicle is situated within all the polygon regions to be compared, computational geometry theory can be used to determine the location of each polygon region individually. For example, for any polygon region among these regions, based on the latitude and longitude information of that arbitrary polygon region and the vehicle's latitude and longitude coordinates, computational geometry theory can be used to determine whether the vehicle's latitude and longitude coordinates fall within the corresponding latitude and longitude range of that arbitrary polygon region. If so, it means the vehicle is within that arbitrary polygon region, and in this case, that arbitrary polygon region is identified as the target polygon region; if not, it means the vehicle is outside that arbitrary polygon region, and in this case, it can be determined that that arbitrary polygon region is not the target polygon region.
[0093] Furthermore, the latitude and longitude information of the arbitrary polygonal region includes the latitude and longitude coordinates of each discrete point on each side of the arbitrary polygonal region; the step of determining whether the vehicle is within the arbitrary polygonal region based on computational geometry theory, using the latitude and longitude information of the arbitrary polygonal region and the latitude and longitude coordinates, may include:
[0094] (1) Connect the discrete points to obtain a convex polygon corresponding to the arbitrary polygonal region;
[0095] (2) Convert the latitude and longitude coordinates of the vehicle into the vehicle plane coordinates in the Cartesian coordinate system, and convert the latitude and longitude coordinates of each vertex of the convex polygon into the plane coordinates of each vertex in the Cartesian coordinate system.
[0096] (3) Determine whether the vehicle is inside the convex polygon based on the vehicle's planar coordinates and the planar coordinates of each vertex;
[0097] (4) If the vehicle is located within the convex polygon, then the vehicle is determined to be located within the arbitrary polygon area.
[0098] For map data in formats such as GeoJSON, the latitude and longitude information of each polygonal region can include the latitude and longitude coordinates of discrete points along each edge of the polygonal region. When determining whether a vehicle is within a polygonal region based on computational geometry, the discrete points along each edge of the polygonal region can be connected to form a closed convex polygon corresponding to that region. To improve processing speed, these discrete points can be sampled; for example, one point can be sampled every m points, ensuring that the sampled points can be connected to form a closed convex polygon. Next, the vehicle's latitude and longitude coordinates and the latitude and longitude coordinates of each vertex of the convex polygon are converted to Cartesian coordinates. The vehicle's latitude and longitude coordinates are converted to the vehicle's planar coordinates, and the latitude and longitude coordinates of each vertex of the convex polygon are converted to the planar coordinates of each vertex. Then, based on the vehicle's planar coordinates and the planar coordinates of each vertex, and using the principles of plane geometry, it can be determined whether the vehicle's planar coordinates are within the convex polygon enclosed by the planar coordinates of the vertices, and thus whether the vehicle is within that convex polygon. If the vehicle is within the convex polygon, it means that the vehicle is within the polygonal region corresponding to that convex polygon.
[0099] Furthermore, determining whether the vehicle is within the convex polygon based on the vehicle's planar coordinates and the planar coordinates of each vertex may include:
[0100] (1) Set the initial value of the counter to 0;
[0101] (2) Select one vertex of the convex polygon as the first vertex;
[0102] (3) Based on the first plane coordinates of the first vertex, the second plane coordinates of the second vertex adjacent to the first vertex in the convex polygon, and the vehicle plane coordinates, determine whether the vehicle plane coordinates are inside the convex polygon;
[0103] (4) If the vehicle plane coordinates are inside the convex polygon, and the x-coordinate of the vehicle plane coordinates is between the x-coordinate of the first plane coordinates and the x-coordinate of the second plane coordinates, then increment the counter by 1.
[0104] (5) If each vertex of the convex polygon is not selected as the first vertex, then return to the step of selecting one vertex of the convex polygon as the first vertex.
[0105] (6) If each vertex of the convex polygon has been traversed and selected as the first vertex, then obtain the final value of the counter.
[0106] (7) If the final value is odd, then the vehicle is determined to be inside the convex polygon;
[0107] (8) If the final value is even, then the vehicle is determined to be outside the convex polygon.
[0108] This application proposes an algorithm to determine whether a vehicle is inside a convex polygon based on the vehicle's planar coordinates and the planar coordinates of each vertex of the polygon. Assume the vehicle's planar coordinates are (x0, y0), and the convex polygon has n vertices, where the planar coordinates of vertex i (i = 0, 1, 2…n-1) are (x0, y ... i y i The algorithm sets a counter `count` initialized to 0 and iterates through each vertex of the convex polygon. Assuming vertex `i` is currently selected, the formula `j = (i+1)%n` can be used to calculate the vertex `j` adjacent to vertex `i` in the convex polygon. Then, the planar coordinates (x, y, y) of vertex `i` can be used to determine the vertex `j`. i y i ), the planar coordinates (x) of vertex j j y j Given the vehicle's planar coordinates (x0, y0) and the vehicle's planar coordinates (x0, y0), determine whether the vehicle's planar coordinates (x0, y0) are inside the convex polygon. Here, a variable `above` can be set; if the vehicle's planar coordinates (x0, y0) are inside the convex polygon, then `above` is true; otherwise, `above` is false. Additionally, it's necessary to determine whether the vehicle's planar coordinates (x0, y0) are between the x-coordinates of the two adjacent vertices, i.e., whether x0 is inside the convex polygon. i and x j Between; here we can follow x i and x j To determine the size, two variables, cond1 and cond2, are set, where cond1 corresponds to x. j Greater than x i In the case that (x) i ≤x0<x j If x ), then cond1 is true; otherwise, cond1 is false. cond2 corresponds to x. j Less than x i In the case that (x) j ≤x0<x i If either cond1 or cond2 is true and above is true, then cond2 is true; otherwise, cond2 is false. If either cond1 or cond2 is true and above is true, then count = count + 1; otherwise, count remains unchanged. Perform the same operation for each vertex of the convex polygon, and obtain the final value of count after the traversal is complete. Finally, if the final value of count is odd (not divisible by 2), it means the vehicle is inside the convex polygon; if the final value of count is even (divisible by 2), it means the vehicle is outside the convex polygon.
[0109] Furthermore, determining whether the vehicle's plane coordinates are inside the convex polygon based on the first plane coordinates of the first vertex, the second plane coordinates of the second vertex adjacent to the first vertex in the convex polygon, and the vehicle's plane coordinates may include:
[0110] (1) Calculate the y-coordinate of the intersection point between the target ray and the target line based on the first plane coordinates, the second plane coordinates and the vehicle plane coordinates; wherein; the target ray is a ray extending in the positive y-axis direction with the vehicle plane coordinates as the endpoint, and the target line is the line connecting the first vertex and the second vertex;
[0111] (2) If the y-coordinate of the vehicle plane coordinate is less than the y-coordinate of the intersection point, then the vehicle plane coordinate is determined to be inside the convex polygon.
[0112] When determining whether a vehicle's planar coordinates are inside a convex polygon based on its planar coordinates and the planar coordinates of two adjacent vertices, the y-coordinate of the intersection point between the target ray and the target line can be calculated using these three planar coordinates. The target ray is a ray extending in the positive y-axis with the vehicle's planar coordinates as its endpoint, and the target line is the line connecting two adjacent vertices of the convex polygon. If the y-coordinate of the vehicle's planar coordinates is less than the y-coordinate of this intersection point, it indicates that the vehicle's planar coordinates are inside the convex polygon. Figure 4 The diagram shown illustrates the operation for determining whether a vehicle's planar coordinates lie inside a convex polygon. Figure 4 In the diagram, the vehicle's planar coordinates are (x0, y0), and the planar coordinates of two adjacent vertices of the convex polygon are (x0, y0). i y i ) and (x j y j A ray extends from (x0, y0) in the positive y-direction. The intersection of this ray with the line connecting two adjacent vertices is (x0, y0). s y s First, we can calculate the slope k = (y - y) of the line connecting two adjacent vertices. j -y i ) / (x j -x i Then, according to the formula y s =k(x0-x) i )+y i The y-coordinate of the intersection point is calculated. s Finally, determine whether y0 is less than y s If y0 is less than y sIf the ray (x0, y0) is below the line connecting two adjacent vertices of the convex polygon, it means the vehicle's planar coordinates (x0, y0) are inside the polygon; otherwise, it means the vehicle's planar coordinates (x0, y0) are outside the polygon. The principle behind this method is: check if the vehicle's planar coordinates (x0, y0) are below the line connecting two adjacent vertices of the convex polygon. If they are, it means the ray extending from (x0, y0) towards the positive y-axis intersects this line. The counter `count` records the number of intersections between this ray and all edges of the convex polygon after traversing all vertices. If the number of intersections is odd, the vehicle is inside the polygon; if the number is even, the vehicle is outside. For example, in... Figure 4 In the given information, the ray intersects with all the edges of the convex polygon at one point (an odd number), thus confirming that the vehicle is inside the convex polygon.
[0113] It should be understood that the lane of each vehicle traveling within this road area can be determined in the same manner as described above. Furthermore, if the road area contains multiple intersections, the lane of each vehicle near each intersection can be determined in the same manner as described above.
[0114] In this embodiment, when a vehicle is traveling within a road area including an intersection, the vehicle's latitude and longitude coordinates and the map data of the road area are first acquired. The map data includes the latitude and longitude information of each lane within the road area and the latitude and longitude range corresponding to each lane area in the intersection. Then, based on the vehicle's latitude and longitude coordinates and the latitude and longitude range corresponding to each lane area in the intersection, the target location of the vehicle within the intersection is determined. Finally, based on the vehicle's latitude and longitude coordinates and the latitude and longitude information of each lane within the target location's lane area, the lane the vehicle is in is determined. Before comparing the vehicle's latitude and longitude coordinates with the lane latitude and longitude information in the map data, the above process first determines the vehicle's target location within the intersection based on the latitude and longitude range corresponding to each lane area in the intersection, and then filters out the lane latitude and longitude information of all other directions within the intersection besides the target location. With this setting, it is only necessary to compare the vehicle's latitude and longitude coordinates with the lane latitude and longitude information corresponding to the target location, instead of comparing the vehicle's latitude and longitude coordinates with all lane latitude and longitude information in the map data. Therefore, it can reduce the calculation time and improve the real-time performance of the operation.
[0115] To facilitate understanding of the method for detecting the lane where a vehicle is located provided in the embodiments of this application, the following are some practical application scenarios.
[0116] like Figure 5 The diagram shown is a schematic representation of the operation flow of the method for detecting the lane where a vehicle is located, provided in an embodiment of this application, in a practical application scenario.
[0117] exist Figure 5 First, the GeoJSON map data of the road area is obtained. Through this GeoJSON map data, the latitude and longitude information of the polygon area contained in each lane of the road area can be obtained. Figure 6 This is a schematic diagram of the GeoJSON map data visualization for a certain intersection area. Figure 6 In this process, each lane can be divided into multiple polygonal regions. The latitude and longitude coordinates of each discrete point on each edge of each polygonal region are known, and the lane to which each polygonal region belongs is also known. Furthermore, after obtaining the perception data of all vehicles in the road area at the current moment, vehicles can be filtered by setting cross-sections, retaining only vehicles close to the intersection. For each remaining vehicle after filtering, its intersection location is determined, thereby reducing the amount of lane latitude and longitude information that needs to be matched, i.e., reducing the search range of polygonal regions. Then, the vehicle's heading angle is used to determine its travel direction, further reducing the search range of polygonal regions, resulting in the final polygonal regions to be compared. Finally, each polygonal region to be compared is traversed to determine whether the vehicle is within that region, thus determining the vehicle's lane number.
[0118] In summary, the embodiments of this application reduce the lane search range and filter vehicles through multiple levels, and utilize computational geometry theory to achieve efficient matching between vehicles and their respective lane numbers, which can effectively reduce computation time and improve the real-time performance of the operation.
[0119] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0120] The above mainly describes a method for detecting the lane in which a vehicle is located. The following will describe a device for detecting the lane in which a vehicle is located.
[0121] Please see Figure 7 One embodiment of a device for detecting the lane in which a vehicle is located, as described in this application, includes:
[0122] The data acquisition module 701 is used to acquire the latitude and longitude coordinates of the vehicle and the map data of the road area when the vehicle is driving in a road area containing an intersection; wherein, the map data includes the latitude and longitude information of each lane in the road area and the latitude and longitude range corresponding to each direction of the lane area in the intersection.
[0123] The intersection orientation determination module 702 is used to determine the target orientation of the vehicle in the intersection based on the latitude and longitude coordinates and the latitude and longitude range corresponding to the lane area of each orientation.
[0124] The lane determination module 703 is used to determine the lane where the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane in the lane area of the target orientation.
[0125] In one implementation of this application, the lane area of the target location includes an entry intersection area and an exit intersection area, and the device for detecting the lane where the vehicle is located may further include:
[0126] The driving direction determination module is used to determine whether the vehicle is entering or exiting the intersection.
[0127] The lane determination module may include:
[0128] The first lane determination unit is used to determine the lane where the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane in the area of the intersection if the vehicle's driving direction is entering the intersection.
[0129] The second lane determination unit is used to determine the lane in which the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane in the exit intersection area if the vehicle's travel direction is exiting the intersection.
[0130] Furthermore, the driving direction determination module may include:
[0131] An angle acquisition unit is used to acquire the heading angle of the vehicle and the direction angle of the target location; wherein, the direction angle includes a first direction angle for entering the intersection from the target location and a second direction angle for exiting the intersection from the target location;
[0132] The first driving direction determination unit is used to determine the driving direction of the vehicle as entering the intersection if the difference between the heading angle and the first direction angle is less than a first threshold.
[0133] The second driving direction determination unit is used to determine the driving direction of the vehicle as exiting the intersection if the difference between the heading angle and the second direction angle is less than the first threshold.
[0134] In one implementation of this application, each lane comprises multiple polygonal regions; the lane determination module may include:
[0135] The target polygon region determination unit is used to determine the target polygon region where the vehicle is located in all polygon regions based on the latitude and longitude information of all polygon regions contained in all lanes within the lane region of the target orientation and the latitude and longitude coordinates.
[0136] The lane determination unit is used to determine the lane where the target polygonal region is located as the lane where the vehicle is located.
[0137] Specifically, the target polygon region determination unit may include:
[0138] The computational geometry theory judgment unit is used to determine, based on computational geometry theory, whether the vehicle is located within any of the polygonal regions, according to the latitude and longitude information and the latitude and longitude coordinates of the arbitrary polygonal region.
[0139] The target polygon region determination unit is used to determine the arbitrary polygon region as the target polygon region if the vehicle is located within the arbitrary polygon region.
[0140] Furthermore, the latitude and longitude information of the arbitrary polygonal region includes the latitude and longitude coordinates of each discrete point on each side of the arbitrary polygonal region; the computational geometry theory judgment unit may include:
[0141] Discrete point connection unit, used to connect the discrete points to obtain a convex polygon corresponding to the arbitrary polygonal region;
[0142] The coordinate transformation unit is used to convert the latitude and longitude coordinates of the vehicle into vehicle planar coordinates in the Cartesian coordinate system, and to convert the latitude and longitude coordinates of each vertex of the convex polygon into the planar coordinates of each vertex in the Cartesian coordinate system.
[0143] A convex polygon determination unit is used to determine whether the vehicle is inside the convex polygon based on the vehicle's planar coordinates and the planar coordinates of each vertex.
[0144] A convex polygon determination unit is used to determine that the vehicle is within the arbitrary polygon region if the vehicle is within the convex polygon.
[0145] Furthermore, the convex polygon determination unit may include:
[0146] The counter setting subunit is used to set the initial value of the counter to 0;
[0147] A vertex selection subunit is used to select one vertex of the convex polygon as the first vertex.
[0148] The inner determination subunit is used to determine whether the vehicle plane coordinates are inside the convex polygon based on the first plane coordinates of the first vertex, the second plane coordinates of the second vertex adjacent to the first vertex in the convex polygon, and the vehicle plane coordinates.
[0149] The counter increment subunit is used to increment the counter by 1 if the vehicle plane coordinate is inside the convex polygon and the x-coordinate of the vehicle plane coordinate is between the x-coordinate of the first plane coordinate and the x-coordinate of the second plane coordinate.
[0150] The step return sub-unit is used to return to the step of selecting one vertex of the convex polygon as the first vertex if each vertex of the convex polygon has not been traversed and selected as the first vertex.
[0151] The counter final value acquisition subunit is used to acquire the final value of the counter if each vertex of the convex polygon has been traversed and selected as the first vertex.
[0152] The first determining subunit is used to determine that the vehicle is inside the convex polygon if the final value is odd.
[0153] The second determining subunit is used to determine that the vehicle is outside the convex polygon if the final value is even.
[0154] Furthermore, the inner judgment subunit may include:
[0155] The intersection point coordinate calculation subunit is used to calculate the y-coordinate of the intersection point between the target ray and the target connecting line based on the first plane coordinate, the second plane coordinate, and the vehicle plane coordinate; wherein the target ray is a ray extending in the positive y-axis direction with the vehicle plane coordinate as the endpoint, and the target connecting line is the line connecting the first vertex and the second vertex;
[0156] An inner determination subunit is used to determine that the vehicle's planar coordinates are inside the convex polygon if the y-coordinate of the vehicle's planar coordinates is less than the y-coordinate of the intersection point.
[0157] In one implementation of this application, the data acquisition module may include:
[0158] The data acquisition unit is used to acquire the latitude and longitude coordinates of the vehicle and the map data of the road area when the distance between the detected vehicle's position and the intersection is less than a second threshold.
[0159] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a method for detecting the lane where a vehicle is located, as shown in any of the above embodiments.
[0160] This application also provides a computer program product that, when run on a terminal device, causes the terminal device to perform a method for detecting the lane where a vehicle is located, as shown in any of the above embodiments.
[0161] Figure 8 This is a schematic diagram of a terminal device provided in an embodiment of this application. For example... Figure 8 As shown, the terminal device 8 in this embodiment includes: a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and executable on the processor 80. When the processor 80 executes the computer program 82, it implements the steps in the embodiments of the various methods for detecting the lane where a vehicle is located, for example... Figure 1 Steps 101 to 103 are shown. Alternatively, when the processor 80 executes the computer program 82, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 7 The functions of modules 701 to 703 are shown.
[0162] The computer program 82 can be divided into one or more modules / units, which are stored in the memory 81 and executed by the processor 80 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 82 in the terminal device 8.
[0163] The processor 80 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0164] The memory 81 can be an internal storage unit of the terminal device 8, such as a hard disk or memory of the terminal device 8. The memory 81 can also be an external storage device of the terminal device 8, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the terminal device 8. Furthermore, the memory 81 can include both internal and external storage units of the terminal device 8. The memory 81 is used to store the computer program and other programs and data required by the terminal device. The memory 81 can also be used to temporarily store data that has been output or will be output.
[0165] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0166] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0167] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0168] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0169] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0170] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0171] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0172] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0173] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for detecting the lane in which a vehicle is located, characterized in that, include: When a vehicle is traveling in a road area that includes an intersection, the vehicle's latitude and longitude coordinates and the map data of the road area are obtained; wherein, the map data includes the latitude and longitude information of each lane in the road area and the latitude and longitude range corresponding to each direction of the lane area in the intersection; Based on the latitude and longitude coordinates and the latitude and longitude range corresponding to the lane area in each direction, the target position of the vehicle in the intersection is determined; The lane in which the vehicle is located is determined based on the latitude and longitude coordinates and the latitude and longitude information of each lane within the lane area of the target location; The lane area of the target orientation includes an entry area and an exit area; after determining the target orientation of the vehicle in the intersection, it also includes: Determine whether the vehicle is entering or exiting the intersection. Determining the lane where the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane within the lane area of the target orientation includes: If the vehicle is traveling in the direction of entering the intersection, then the lane in which the vehicle is located is determined based on the latitude and longitude coordinates and the latitude and longitude information of each lane in the area of the intersection. If the vehicle is traveling in the direction of exiting the intersection, the lane in which the vehicle is located is determined based on the latitude and longitude coordinates and the latitude and longitude information of each lane within the exit intersection area.
2. The method as described in claim 1, characterized in that, The determination of whether the vehicle is entering or exiting the intersection includes: Obtain the heading angle of the vehicle and the azimuth angle of the target location; wherein, the azimuth angle includes a first azimuth angle for entering the intersection from the target location and a second azimuth angle for exiting the intersection from the target location; If the difference between the heading angle and the first direction angle is less than a first threshold, then the vehicle's driving direction is determined to be entering the intersection. If the difference between the heading angle and the second direction angle is less than the first threshold, then the vehicle's driving direction is determined to be exiting the intersection.
3. The method as described in claim 1, characterized in that, Each lane contains multiple polygonal regions; determining the lane where the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane within the lane region of the target orientation includes: Based on the latitude and longitude information of all polygon regions contained in all lanes within the lane area of the target orientation and the latitude and longitude coordinates, the target polygon region where the vehicle is located in all polygon regions is determined; The lane where the target polygonal region is located is determined as the lane where the vehicle is located.
4. The method as described in claim 3, characterized in that, The step of determining the target polygonal region where the vehicle is located among all polygonal regions based on the latitude and longitude information of all polygonal regions contained in all lanes within the lane area of the target orientation and the latitude and longitude coordinates includes: For any polygonal region among all the polygonal regions, based on the latitude and longitude information of the arbitrary polygonal region and the latitude and longitude coordinates, it is determined whether the vehicle is located within the arbitrary polygonal region based on computational geometry theory; If the vehicle is located within the arbitrary polygonal region, then the arbitrary polygonal region is determined as the target polygonal region.
5. The method as described in claim 4, characterized in that, The latitude and longitude information of the arbitrary polygonal region includes the latitude and longitude coordinates of each discrete point on each edge of the arbitrary polygonal region; the step of determining whether the vehicle is within the arbitrary polygonal region based on the latitude and longitude information and the latitude and longitude coordinates, using computational geometry theory, includes: Connecting the discrete points together yields a convex polygon corresponding to the arbitrary polygonal region. The latitude and longitude coordinates of the vehicle are converted into vehicle planar coordinates in the Cartesian coordinate system, and the latitude and longitude coordinates of each vertex of the convex polygon are converted into individual vertex planar coordinates in the Cartesian coordinate system. Based on the vehicle's planar coordinates and the planar coordinates of each vertex, determine whether the vehicle is inside the convex polygon; If the vehicle is located within the convex polygon, then the vehicle is determined to be located within the arbitrary polygon region.
6. The method as described in claim 5, characterized in that, The step of determining whether the vehicle is within the convex polygon based on the vehicle's planar coordinates and the planar coordinates of each vertex includes: Set the initial value of the counter to 0; Select one vertex of the convex polygon as the first vertex; Based on the first plane coordinates of the first vertex, the second plane coordinates of the second vertex adjacent to the first vertex in the convex polygon, and the vehicle plane coordinates, determine whether the vehicle plane coordinates are inside the convex polygon; If the vehicle's planar coordinates are inside the convex polygon, and the x-coordinate of the vehicle's planar coordinates is between the x-coordinates of the first and second planar coordinates, then increment the counter by 1. If each vertex of the convex polygon is not selected as the first vertex, then return to the step of selecting one vertex of the convex polygon as the first vertex. If each vertex of the convex polygon has been traversed and selected as the first vertex, then the final value of the counter is obtained; If the final value is odd, then the vehicle is determined to be inside the convex polygon; If the final value is even, then the vehicle is determined to be outside the convex polygon.
7. The method as described in claim 6, characterized in that, The step of determining whether the vehicle's planar coordinates are inside the convex polygon based on the first planar coordinates of the first vertex, the second planar coordinates of the second vertex adjacent to the first vertex in the convex polygon, and the vehicle's planar coordinates includes: Based on the first plane coordinates, the second plane coordinates, and the vehicle plane coordinates, the y-coordinate of the intersection point between the target ray and the target connecting line is calculated; wherein, the target ray is a ray extending in the positive y-direction with the vehicle plane coordinates as its endpoint, and the target connecting line is the line connecting the first vertex and the second vertex; If the y-coordinate of the vehicle's planar coordinates is less than the y-coordinate of the intersection point, then the vehicle's planar coordinates are determined to be inside the convex polygon.
8. The method according to any one of claims 1 to 7, characterized in that, The acquisition of the vehicle's latitude and longitude coordinates and the map data of the road area includes: When the distance between the vehicle's location and the intersection is detected to be less than a second threshold, the vehicle's latitude and longitude coordinates and the map data of the road area are obtained.
9. A device for detecting the lane in which a vehicle is located, characterized in that, include: The data acquisition module is used to acquire the latitude and longitude coordinates of the vehicle and the map data of the road area when the vehicle is driving in a road area containing an intersection; wherein, the map data includes the latitude and longitude information of each lane in the road area and the latitude and longitude range corresponding to each direction of the lane area in the intersection. The intersection orientation determination module is used to determine the target orientation of the vehicle in the intersection based on the latitude and longitude coordinates and the latitude and longitude range corresponding to the lane area of each orientation. The lane determination module is used to determine the lane where the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane in the lane area of the target location; The lane area at the target location includes an entry intersection area and an exit intersection area, and the device for detecting the lane where the vehicle is located further includes: The driving direction determination module is used to determine whether the vehicle is entering or exiting the intersection. The lane determination module includes: The first lane determination unit is used to determine the lane where the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane in the area of the intersection if the vehicle's driving direction is entering the intersection. The second lane determination unit is used to determine the lane in which the vehicle is located based on the latitude and longitude coordinates and the latitude and longitude information of each lane in the exit intersection area if the vehicle's travel direction is exiting the intersection.
10. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for detecting the lane in which a vehicle is located as described in any one of claims 1 to 8.
11. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for detecting the lane in which a vehicle is located as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Lane positioning method and device, vehicle, storage medium and map construction method
CN111400418A