Road Detection Method, Device, Computer, Readable Storage Medium and Program Product
By automatically identifying the angles of the contour lines and edge lines of the intersection area and dividing road sections, the problems of low efficiency and poor accuracy of intersection labeling in the existing technology are solved, and efficient and accurate road detection and labeling are achieved.
Patent Information
- Application Number
- CN202310433502.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-13
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2043-04-13
AI Technical Summary
In the prior art, the acquisition efficiency of intersection labeling data is low and the accuracy is poor, especially in the labeling process of intersection polygons, intersection key points and road section connection edges, which requires a lot of manual intervention, resulting in insufficient labeling efficiency and accuracy.
By obtaining the contour lines of the intersection area of the traffic road, determining the angle of the contour points, dividing the road sections based on the angle, and combining the road edge lines, automatically identifying the connecting edges of the sections and the non-section connecting edges, constructing the intersection structure data, and realizing independent labeling.
It improves the accuracy and efficiency of road detection, ensures the correlation between labeled data, realizes adaptive road marking, and improves the efficiency and accuracy of intersection marking.
Smart Images

Figure CN116453119B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular, to a road detection method, device, computer, readable storage medium, and program product. Background Art
[0002] In order to realize the recognition and deconstruction of satellite image intersections, it is necessary to complete the structured model training of intersections. However, it is difficult to obtain the structured intersection annotation data required by the model, including intersection polygons, intersection key points, road segment connection edges, and non-road segment connection edges. Among them, the intersection key points are the connection points of different edges, and all the edges form an intersection polygon in a clockwise or counterclockwise order. However, at present, it is necessary to manually annotate the intersections to ensure that the annotations meet the requirements, resulting in low annotation efficiency and accuracy for intersections. Moreover, for the annotation of intersections, when annotating each parameter of the intersection annotation data, it is undoubtedly necessary to carry out a huge amount of work to compare and correct each parameter, resulting in low annotation efficiency for intersections. Summary of the Invention
[0003] Embodiments of the present application provide a road detection method, device, computer, readable storage medium, and program product, which can improve the accuracy and detection efficiency of road detection.
[0004] On the one hand, an embodiment of the present application provides a road detection method, which includes:
[0005] Obtain the contour line of the intersection area of the traffic road, and determine the first angle corresponding to each of the N contour points that make up the contour line of the intersection area; the first angle of any one contour point is used to represent the angle of the included angle formed by taking this contour point as the vertex and connecting this contour point with the first contour points on both sides of this contour point on the contour line of the intersection area at an interval of c contour points; N is a positive integer, and c is a positive integer less than N;
[0006] Based on the first angles corresponding to the N contour points, determine candidate points from the N contour points, and divide the contour line of the intersection area into M road segments based on the candidate points; M is a positive integer;
[0007] Obtain the road edge line of the traffic road, obtain the road segment distances between the M road segments and the road edge line respectively, and determine the road segment connection edges and non-road segment connection edges of the traffic road based on the road segment distances corresponding to the M road segments respectively.
[0008] On the one hand, an embodiment of the present application provides a road detection device, which includes:
[0009] A contour acquisition module, configured to obtain the contour line of the intersection area of the traffic road;
[0010] An angle determination module for determining first angles corresponding to N contour points that make up the contour line of the intersection area; the first angle of any one contour point is used to represent the angle of the included angle formed by taking this contour point as the vertex and connecting this contour point to the first contour points on both sides of this contour point on the contour line of the intersection area at an interval of c contour points; N is a positive integer, and c is a positive integer less than N.
[0011] A point screening module for determining candidate points from the N contour points based on the first angles corresponding to the N contour points.
[0012] A road section division module for dividing the contour line of the intersection area into M road sections based on the candidate points; M is a positive integer.
[0013] A distance determination module for obtaining the road edge line of the traffic road and obtaining the section distances between the M road sections and the road edge line respectively.
[0014] An edge analysis module for determining the section connection edges and non-section connection edges of the traffic road based on the section distances corresponding to the M road sections respectively.
[0015] Among them, the point screening module includes:
[0016] A point sorting unit for sorting the N contour points according to the first angles corresponding to the N contour points.
[0017] A threshold obtaining unit for obtaining the intersection point threshold of the traffic scene where the traffic road is located.
[0018] A candidate determination unit for determining K candidate points from the sorted N contour points based on the intersection point threshold; K is a positive integer less than or equal to N and less than or equal to the intersection point threshold.
[0019] Among them, the number of road edge lines is d, and d is a positive integer; the distance determination module includes:
[0020] A distance detection unit for obtaining the point distances between at least two contour points that make up the i-th road section and the j-th road edge line respectively, and determining the statistical value of the point distances corresponding to the at least two contour points as the initial distance between the i-th road section and the j-th road edge line; i is a positive integer less than or equal to M, and j is a positive integer less than or equal to d.
[0021] A distance determination unit for, when obtaining the initial distances between the i-th road section and the d road edge lines respectively, determining the minimum value among the d initial distances as the section distance corresponding to the i-th road section.
[0022] Among them, the intersection area contour line and the road edge line are obtained by recognizing the road image of the traffic road; the distance determination module includes:
[0023] A position acquisition unit for acquiring the section positions of M road sections in the intersection area contour line respectively;
[0024] A coincidence detection unit for performing coincidence detection on the M road sections and the road edge line based on the section positions corresponding to the M road sections respectively;
[0025] The distance determination unit is further configured to determine the section distance of the road section with a coincidence degree greater than or equal to the line coincidence threshold as the first default distance, and determine the section distance of the road section with a coincidence degree less than the line coincidence threshold as the second default distance; the first default distance is less than the second default distance.
[0026] Among them, the edge analysis module includes:
[0027] A section clustering unit for performing clustering processing on the M road sections based on the section distances corresponding to the M road sections respectively, to obtain f section sets; f is a positive integer;
[0028] A section analysis unit for determining the section connection edges and non-section connection edges of the traffic road based on the section distances of the road sections included in the f section sets respectively.
[0029] Among them, the section analysis unit includes:
[0030] A statistical acquisition subunit for acquiring the statistical distances of the section distances of the road sections included in the f section sets respectively; any one statistical distance refers to the statistical value of the section distances of the road sections included in the corresponding section set;
[0031] An edge determination subunit for determining non-section connection edges based on the road sections in the section set corresponding to the first statistical distance, and determining section connection edges based on the road sections in the section set corresponding to the second statistical distance; the first statistical distance refers to the minimum statistical distance among the f statistical distances; the second statistical distance refers to the statistical distances other than the first statistical distance among the f statistical distances.
[0032] Among them, the edge determination subunit includes:
[0033] A first determination subunit for determining the road sections in the section set corresponding to the first statistical distance as non-section connection edges, and determining the road sections in the section set corresponding to the second statistical distance as section connection edges;
[0034] The device further includes:
[0035] A data construction module, configured to determine candidate points as road key points of a traffic road, and construct intersection structure data based on the road key points, intersection area contour lines, road section connection edges, and non-road section connection edges; the intersection structure data is used to label the intersection area contour lines.
[0036] Among them, the edge determination subunit includes:
[0037] A second determination subunit, configured to determine the road sections in the road section set corresponding to the first statistical distance as the first initial edges, and determine the road sections in the road section set corresponding to the second statistical distance as the second initial edges;
[0038] An edge merging subunit, configured to merge the first initial edges with the same candidate points to obtain non-road section connection edges, and merge the second initial edges with the same candidate points to obtain road section connection edges;
[0039] The data construction module is further configured to:
[0040] Delete the first common candidate points included in the first initial edges and the second common candidate points included in the second initial edges among the candidate points to obtain the road key points of the traffic road, and construct intersection structure data based on the road key points, intersection area contour lines, road section connection edges, and non-road section connection edges; the first common candidate points refer to the candidate points that are simultaneously located on at least two first initial edges, and the second common candidate points refer to the candidate points that are simultaneously located on at least two second initial edges; the intersection structure data is used to label the intersection area contour lines.
[0041] Among them, the device further includes:
[0042] A data acquisition module, configured to acquire a road image of a traffic road and acquire an initial intersection parsing model;
[0043] A sample prediction module, configured to input the road image into the initial intersection parsing model for prediction to obtain sample intersection structure data;
[0044] A model training module, configured to adjust the parameters of the initial intersection parsing model based on the intersection structure data and the sample intersection structure data until the parameters converge, to obtain an intersection parsing model for performing intersection structure parsing.
[0045] Among them, the traffic road is an actual traffic road; the device further includes:
[0046] A data sending module, configured to send the intersection structure data to a road labeling device, so that the road labeling device labels the non-road section connection edges in the actual traffic road based on a first labeling style, and labels the road section connection edges in the actual traffic road based on a second labeling style; or,
[0047] A road planning module, configured to integrate intersection structure data into a road planning model corresponding to an actual traffic road, and adjust the road planning model based on the intersection structure data to obtain an actual road planning model.
[0048] Wherein, the traffic road is a game traffic road; the apparatus further includes:
[0049] A route planning module, configured to mark intersection structure data of the game traffic road in a game scene, and plan a road driving route of the game traffic road based on the intersection structure data;
[0050] A rule construction module, configured to construct game rules of the game scene based on the route length and route environment of the road driving route.
[0051] An embodiment of the present application provides a computer device on the one hand, including a processor, a memory, and an input / output interface;
[0052] The processor is respectively connected to the memory and the input / output interface. Wherein, the input / output interface is used to receive and output data, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device including the processor executes the road detection method in an embodiment of the present application on the one hand.
[0053] An embodiment of the present application provides a computer-readable storage medium on the one hand. The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the road detection method in an embodiment of the present application on the one hand.
[0054] An embodiment of the present application provides a computer program product or a computer program on the one hand. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device executes the methods provided in various alternative manners in an embodiment of the present application on the one hand. In other words, when the computer instructions are executed by the processor, the methods provided in various alternative manners in an embodiment of the present application are implemented.
[0055] Implementing the embodiments of the present application will have the following beneficial effects:
[0056] In an embodiment of the present application, the contour line of the intersection area of a traffic road is obtained, and the first angles respectively corresponding to N contour points that make up the contour line of the intersection area are determined; the first angle of any contour point is used to represent the angle of the position of the contour point on the contour line of the intersection area, that is, with this contour point as the vertex, and the first contour points that are c contour points apart from this contour point on both sides of this contour point on the contour line of the intersection area are connected as sides, the angle of the formed included angle; N is a positive integer, and c is a positive integer less than N; based on the first angles respectively corresponding to the N contour points, candidate points are determined from the N contour points, and based on the candidate points, the contour line of the intersection area is divided into M road segments; M is a positive integer; the road edge line of the traffic road is obtained, the segment distances between the M road segments and the road edge line are obtained respectively, and based on the segment distances respectively corresponding to the M road segments, the segment connection edges and non-segment connection edges of the traffic road are determined. Through the above process, based on the existing annotation data, such as the contour line of the intersection area and the road edge line, etc., the existing annotation data can be analyzed to obtain various parameters associated with the existing annotation data, such as segment connection edges and non-segment connection edges, etc., so as to ensure the relevance between the existing annotation data and the analyzed annotation data, so that the obtained various annotation data are equivalent to using the same set of standards, which also makes the overall annotation of the traffic road self-consistent, thereby improving the efficiency and accuracy of road detection, that is, improving the efficiency and accuracy of intersection annotation. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0058] Figure 1 FIG. is a network interaction architecture diagram of a road detection provided by an embodiment of the present application;
[0059] Figure 2 FIG. is a schematic diagram of a road detection scenario provided by an embodiment of the present application;
[0060] Figure 3 FIG. is a flowchart of a method for road detection provided by an embodiment of the present application;
[0061] Figure 4 FIG. is a schematic diagram of an angle determination scenario provided by an embodiment of the present application;
[0062] Figure 5 FIG. is a schematic diagram of a road segment division scenario provided by an embodiment of the present application;
[0063] Figure 6 It is a schematic diagram of a road segment identification scenario provided by an embodiment of the present application;
[0064] Figure 7 It is a schematic diagram of a coincidence detection scenario provided by an embodiment of the present application;
[0065] Figure 8 It is a flowchart of a method for road detection and application provided by an embodiment of the present application;
[0066] Figure 9 It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0067] Figure 10 It is a schematic diagram of a road detection device provided by an embodiment of the present application;
[0068] Figure 11 It is a schematic diagram of the structure of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0069] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0070] Among them, if it is necessary to collect data of an object (such as a user, etc.) in the present application, a prompt interface or a pop-up window is displayed before and during the collection. The prompt interface or the pop-up window is used to prompt the user that XXXX data is currently being collected. Only after obtaining the confirmation operation of the user on the prompt interface or the pop-up window, the relevant steps of data acquisition are started, otherwise it ends. Moreover, the obtained user data will be used in reasonable, legal scenarios or uses, etc. Optionally, in some scenarios where user data needs to be used but the user's authorization has not been obtained, authorization can also be requested from the user, and the user data will be used when the authorization is passed. And in the present application, for the use of all the data involved, it is within the scope permitted by laws, regulations, etc., that is, it complies with the provisions of laws and regulations.
[0071] In the embodiments of the present application, please refer to Figure 1 , Figure 1It is a network interaction architecture diagram for road detection provided by an embodiment of the present application. Among them, the computer device 101 can obtain road information of a traffic road, detect road intersections in the traffic road based on the road information, and determine intersection structure data of the road intersection, including road segment connection edges and non-road segment connection edges, etc., for structurally annotating the road intersection, that is, representing the structural information of the road intersection. Among them, the computer device 101 can obtain road information of the traffic road from its own storage space, or can obtain road information of the traffic road from the road collection device 102a, or can obtain road information of the traffic road from the management device 102b for managing relevant data of the traffic road, etc., which is not limited here. That is to say, the acquisition method of the road information of the traffic road can be considered to depend on the storage location of the road information. Among them, the road information can be a road image including a road intersection, etc. The road image can be an image collected by the road collection device 102a for the traffic road, or an image obtained from the road planning data of the traffic road, etc. For example, in a possible case, the computer device 101 can respond to a road detection request for the traffic road and send a road collection request to the road collection device 102a; the road collection device 102a can execute a collection instruction based on the road collection request, collect road information of the traffic road based on the collection instruction, and send the road information to the computer device 101; the computer device 101 can detect the traffic road based on the road information. Or, in a possible case, the computer device 101 can respond to a road detection request for the traffic road, search for road planning data of the traffic road based on the road detection request, and obtain road information of the traffic road from the road planning data, etc. That is to say, the present application can be applied to any scenario that requires structural analysis of road intersections, and will not be described in detail here.
[0072] Specifically, please refer to Figure 2 , Figure 2 It is a schematic diagram of a road detection scenario provided by an embodiment of the present application. As Figure 2 shown, the computer device can obtain the intersection area contour line 202 of the traffic road 201, where the intersection area contour line 202 can be considered to be identified through existing technologies. Further, the computer device can determine the first angles respectively corresponding to N contour points that make up the intersection area contour line, where the N contour points can be considered to be obtained by traversing the intersection area contour line, such as Figure 2 each contour point in the area 203 shown in (taking the white dots as an example here), of course, Figure 2The partial contour points shown in Region 203 are only some of the N contour points. In fact, the N contour points should be distributed throughout the intersection area contour line 202. Among them, the first angle of any one contour point is used to represent the angle of the position of the contour point on the intersection area contour line, and N is a positive integer. Further, the computer device can determine candidate points from the N contour points based on the first angles respectively corresponding to the N contour points, such as Figure 2 the candidate points 2a, 2b, 2c,..., and 2h shown in Figure 2 . The computer device can divide the intersection area contour line 202 into M road segments based on the candidate points, such as the road segment between candidate point 2a and candidate point 2b on the intersection area contour line 202, the road segment between candidate point 2b and candidate point 2c,..., and the road segment between candidate point 2h and candidate point 2a, etc., where M is a positive integer. The computer device can obtain the road edge line 204 of the traffic road 201 and determine the segment connection edge 2052 and non-segment connection edge 2051 of the traffic road 201 based on the segment distances between the M road segments and the road edge line 204 respectively. Through the above process, it is possible to perform intersection detection on the traffic road on the basis of existing road detection tasks (such as the task of detecting the intersection area contour line and the task of detecting the road edge line, etc.) to obtain the segment connection edge and non-segment connection edge of the traffic road, etc., so that two adjacent edges can share a point, realizing the automatic annotation of the structure of the road intersection, thereby improving the efficiency and accuracy of road detection.
[0073] It can be understood that the computer devices mentioned in the embodiments of the present application include, but are not limited to, terminal devices or servers. In other words, the computer device can be a server or a terminal device, or a system composed of a server and a terminal device. Among them, the above-mentioned terminal device can be an electronic device, including but not limited to mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, in-vehicle devices, augmented reality / virtual reality (AR / VR) devices, head-mounted displays, smart TVs, wearable devices, smart speakers, digital cameras, cameras, and other mobile internet devices (MIDs) with network access capabilities, or terminal devices in scenarios such as trains, ships, and flights. Among them, the above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, vehicle-road coordination, content delivery network (CDN), and big data and artificial intelligence platforms.
[0074] Optionally, the data involved in the embodiments of the present application can be stored in a computer device, or the data can be stored based on cloud storage technology or blockchain network, etc., without limitation here.
[0075] Further, please refer to Figure 3 , Figure 3 which is a flowchart of a road detection method provided by the embodiments of the present application. As Figure 3 shown, the road detection process includes the following steps:
[0076] Step S301, obtain the contour line of the intersection area of the traffic road, and determine the first angles corresponding to N contour points that make up the contour line of the intersection area.
[0077] In the embodiments of the present application, the computer device can respond to a road detection request for a traffic road, obtain road information of the traffic road, parse the road information, and determine the contour line of the intersection area of the traffic road. The road information may include a road image of a road intersection, etc. The road image can be considered a satellite image, or a partial area in a game map in a game application, etc. That is to say, the computer device can obtain satellite data of the traffic road to be detected by the satellite, and obtain a satellite image of the traffic road from the satellite data as the road information; or, it can obtain the game map of the game application and intercept the road image of the traffic road to be detected from the game map as the road information, etc. Specifically, it can be considered to determine the contour line of the intersection area of the road intersection of the traffic road, and the contour line of the intersection area can be considered the intersection polygon of the road intersection. Among them, the contour line of the intersection area can be marked in the road information. Specifically, the computer device can obtain an intersection recognition task for intersection area recognition, call the intersection recognition task, parse the road information, and determine the contour line of the intersection area of the traffic road. Optionally, the intersection recognition task can be an intersection area recognition model. The computer device can call the intersection area recognition model, input the road information into the intersection area recognition model for parsing, and predict the contour line of the intersection area of the traffic road; or, the intersection recognition task can be an intersection parsing algorithm. The computer device can call the intersection parsing algorithm, obtain the intersection position information of the intersection area of the road intersection in the traffic road, and based on the intersection position information and the scale of the road information, map the intersection area to the road information and mark the corresponding contour line of the intersection area in the road information. The scale is used to represent the ratio of the length of a line segment on the map to the actual length of the corresponding line segment on the ground, that is, the scale = the ratio of the map distance to the actual distance. Of course, other intersection recognition tasks can also be used to mark the contour line of the intersection area of the road intersection of the traffic road, which is not limited here. For example, the contour line of the intersection area can be obtained by manual annotation of the road information. Among them, the road information can be a road image. For example, the computer device can obtain the road information captured by a road acquisition device for a road intersection, or the road information collected by a satellite for a road intersection, etc.; or, it can obtain the road planning data of the traffic road and intercept the road information corresponding to the road intersection in the road planning data. The road planning data can be considered the data constructed when distributing buildings and traffic, etc. on the actual ground, and can be considered a model for representing the distribution of the traffic road in the real scene.
[0078] Further, the computer device may determine first angles respectively corresponding to N contour points that form the contour line of the intersection area. Among them, the first angle of any one contour point is used to represent the angle at which the contour line of the intersection area changes at this contour point. It can be considered as the angle of the included angle formed by the first contour point that is c contour points apart from this contour point on both sides of this contour point on the contour line of the intersection area and this contour point. That is, with this contour point as the vertex, and using the connections between this contour point and the first contour points that are c contour points apart from this contour point on both sides of this contour point on the contour line of the intersection area as the connecting sides (that is, connecting this contour point with the first contour points on both sides of this contour point to form sides), the angle of the included angle formed; N is a positive integer, c is a positive integer less than N. Optionally, c can be a positive integer less than or equal to the angle deviation threshold. Among them, c is used to represent the number of contour points between any one contour point and the first contour point corresponding to this contour point. Among them, c can be any positive integer less than or equal to the angle deviation threshold. When c is 1, the first contour point of the contour point can be considered as the adjacent contour point of this contour point. By restricting the angle deviation threshold, the distance between any one contour point and its corresponding first contour point on the contour line of the intersection area will not be too far, so as to ensure that the obtained first angle can be used to represent the angle at the position of the contour point corresponding to this first angle on the contour line of the intersection area, thereby improving the accuracy of angle determination. Of course, optionally, c can also be restricted not to be 1, that is, not to take adjacent contour points, to avoid the situation where it is difficult to construct an included angle due to the contour point and its corresponding first contour point being too close, and improve the efficiency of angle determination.
[0079] Specifically, the computer device may traverse the N contour points that form the contour line of the intersection area, obtain the first contour point of each contour point, and determine the angle of the included angle formed by each contour point and its first contour point as the first angle of this contour point. Optionally, the computer device may perform equally spaced sampling on the contour line of the intersection area to determine the N contour points that form the contour line of the intersection area. For example, taking the contour point X as an example, the computer device may obtain the first contour points that are c contour points apart from this contour point X before and after, that is, obtain the first contour points that are c contour points apart from this contour point X on both sides of this contour point X on the contour line of the intersection area, which can be denoted as the contour point Y and the contour point Z. Among them, c is a positive integer less than or equal to the angle deviation threshold. When c is 1, the first contour point can be considered as the adjacent contour point of the contour point X. The computer device may form an included angle based on the vectors between this contour point X and the first contour points of this contour point X (here referring to the contour point Y and the contour point Z), and determine the angle of this included angle as the first angle of the contour point X, that is, the angle of the included angle between the vector XY and the vector XZ. Specifically, reference can be made to Figure 4 , Figure 4 is a schematic diagram of an angle determination scenario provided by an embodiment of the present application. AsFigure 4 As shown, the computer device can obtain the contour line 402 of the intersection area of the traffic road 401. Taking the contour point 4031 in the contour line of the intersection area as an example, assuming c is 2, the first contour points spaced 2 contour points on both sides of the contour point 4031 are obtained in the contour line 402 of the intersection area, such as the contour point 4032 and the contour point 4033. Taking the contour point 4031 as the vertex, taking the line segment from the contour point 4031 to the contour point 4032 (i.e., connecting the contour point 4031 and the contour point 4032), and the line segment from the contour point 4031 to the contour point 4033 (i.e., connecting the contour point 4031 and the contour point 4033) as the sides (i.e., the angular sides), the included angle 404 corresponding to the contour point 4031 is constructed, and the angle of the included angle 404 is determined as the first angle corresponding to the contour point 4031. Similarly, the first angles corresponding to the N contour points forming the contour line 402 of the intersection area can be determined respectively.
[0080] Step S302: Based on the first angles corresponding to the N contour points respectively, candidate points are determined from the N contour points, and the contour line of the intersection area is divided into M road segments based on the candidate points.
[0081] In the embodiment of the present application, the computer device can determine candidate points from the N contour points based on the first angles corresponding to the N contour points respectively. The number of candidate points is K, and K is a positive integer less than or equal to N. Specifically, the computer device can sort the N contour points according to the first angles corresponding to the N contour points respectively; obtain the intersection point threshold of the traffic scene where the traffic road is located, and determine K candidate points from the sorted N contour points based on the intersection point threshold; K is a positive integer less than or equal to N and K is less than or equal to the intersection point threshold. Specifically, if N is less than or equal to the intersection point threshold, then the N contour points are determined as candidate points, and at this time, K is equal to N; if N is greater than the intersection point threshold, then K candidate points are determined from the sorted N contour points, and at this time, K is equal to the intersection point threshold. Or, the computer device can obtain the angle limit threshold, and obtain the contour points with the first angle less than or equal to the angle limit threshold from the N contour points, obtaining N' contour points, where N' is a positive integer less than or equal to N; further, if N' is less than or equal to the intersection point threshold, then the N' contour points are determined as candidate points, and at this time, K is equal to N'; if N' is greater than the intersection point threshold, then K candidate points are determined from the sorted N' contour points, and at this time, K is equal to the intersection point threshold.
[0082] The intersection point threshold refers to the maximum number of connection points between road sections at a road intersection in a traffic road. If the road intersection is a crossroad, the number of connection points at the road intersection can be considered to be 8. If the road intersection is a three-way intersection, the number of connection points at the road intersection can be considered to be 6, etc. The computer device can obtain the maximum number of connection points existing in the traffic road, that is, the number of connection points corresponding to the road intersection with the most forks, and determine the maximum number of connection points as the intersection point threshold. The intersection point threshold ensures that all connection points of the current road intersection can be detected, and reduces the amount of contour point data that needs to be processed later, thereby improving the efficiency of road detection. For example, if the maximum number of connection points of the traffic road is 8, 8 is determined as the intersection point threshold; if the maximum number of connection points of the traffic road is 10, 10 is determined as the intersection point threshold, etc. Optionally, the computer device can obtain a road type of a traffic road, which road type includes a first road type and a second road type, the first road type is used to indicate that the traffic road is an actual traffic road, and the second road type is used to indicate that the traffic road is a game traffic road. If the road type is the first road type, the first default threshold is determined as the intersection point threshold. For example, actual traffic roads generally include three-way intersections and crossroads, etc., that is, the first default threshold can be 8, etc.; if the road type is the second road type, the maximum number of forks in the game application where the traffic road is located is obtained, and the intersection point threshold is determined based on the maximum number of forks, wherein the intersection point threshold can be considered to be twice the maximum number of forks, that is, one fork includes two points.
[0083] Alternatively, the computer device can obtain an angle limit threshold, determine contour points whose first angle is less than or equal to the angle limit threshold as candidate points, etc. At this time, the number of candidate points is K, and K is a positive integer less than or equal to N.
[0084] The angle limit threshold is used to reduce the number of contour points that need to be processed as much as possible. Since the larger the first angle corresponding to a contour point is, the less likely it is that the contour point is located at the intersection between edges. Therefore, the contour points can be simply screened by limiting the angle limit threshold to improve the efficiency of contour point screening. For example, the intersection point threshold can be 150 degrees, etc., which is not limited here.
[0085] Furthermore, the computer device may divide the intersection area contour line into M road segments based on the candidate points, that is, any two adjacent road segments share a common contour point, and M is a positive integer. For example, see Figure 5 , Figure 5 Schematic diagram of a road segment division scenario provided by an embodiment of the present application. Figure 5As shown, when the computer device can obtain the first angles corresponding to N contour points that make up the contour line 501 of the intersection area, the N contour points can be referred to Figure 5 the white points in the contour line 501 of the intersection area in Figure 5 . Further, based on the first angles corresponding to the N contour points, such as "Contour point 1: First angle 1; Contour point 2: First angle 2; …; Contour point N: First angle N", candidate points are determined from the N contour points. Specifically, the above implementation process in this step can be referred to. For example, assuming that the intersection point threshold is 8 and the angle limit threshold is 150 degrees, assuming that the first angle of contour point 5a is 123 degrees, the first angle of contour point 5b is 149 degrees, the first angle of contour point 5c is 102 degrees, the first angle of contour point 5d is 105 degrees, the first angle of contour point 5e is 105 degrees, the first angle of contour point 5f is 86 degrees, the first angle of contour point 5g is 91 degrees, and the first angles of other contour points are all greater than 150 degrees. At this time, contour points 5a to 5g can be determined as candidate points, that is, the candidate points determined here include candidate point 5a, candidate point 5b, candidate point 5c, …, and candidate point 5g, etc. The computer device can divide the contour line of the intersection area into M road segments based on the candidate points, such as
[0086] the road segments shown in
[0087] Road segment ①, Road segment ②, …, and Road segment ⑦, etc. Among them, any two adjacent road segments can be considered to have a common point at the contour point. For example, Road segment ① and Road segment ② have candidate point 5a as the common point, and Road segment ② and Road segment ③ have candidate point 5b as the common point, etc.
[0086] Step S303: Obtain the road edge line of the traffic road, obtain the segment distances between the M road segments and the road edge line respectively, and determine the segment connection edges and non-segment connection edges of the traffic road based on the segment distances corresponding to the M road segments.
[0087] In an embodiment of the present application, a computer device may detect road information of a traffic road to obtain a road edge line of the traffic road. Specifically, an edge detection task for road edge detection may be obtained, and the edge detection task may be called to identify the road edge line of the traffic road, where the road edge line is used to represent the road edge including road intersections. Optionally, the edge detection task may be an edge detection model, and the computer device may input the road information into the edge detection model for prediction to label the road edge line of the traffic road in the road information. Or, the edge detection task may be an edge acquisition instruction, and the computer device may execute the edge acquisition instruction to obtain the intersection position information of the road intersection in the traffic road, and based on the intersection position information, obtain the actual edge line from the road planning data of the traffic road, map the actual edge line into the road information to obtain the road edge line of the traffic road, etc., and no more limitations are made here. Or, the road edge line may also be obtained by manually making a simple annotation for the road information.
[0088] Furthermore, the section distances between M road sections and the road edge line may be obtained respectively. Specifically, the number of the road edge lines is d, and d is a positive integer. The computer device may obtain the point distances between at least two contour points forming the i-th road section and the j-th road edge line respectively, and determine the statistical value of the point distances corresponding to the at least two contour points as the initial distance between the i-th road section and the j-th road edge line; i is a positive integer less than or equal to M, and j is a positive integer less than or equal to d. Among them, the statistical value may be the average value (such as arithmetic average or geometric average, etc.) of the point distances corresponding to the at least two contour points, or the average of the maximum value and the minimum value of the point distances corresponding to the at least two contour points, or the median value of the point distances corresponding to the at least two contour points or the point distance with the most occurrences, etc. When the initial distances between the i-th road section and the d road edge lines are obtained respectively, the minimum value among the d initial distances is determined as the section distance corresponding to the i-th road section. For example, referring to Figure 6 , Figure 6 is a schematic diagram of a section identification scenario provided by an embodiment of the present application. As Figure 6As shown in the figure, the computer device can obtain the road edge line 603 of the traffic road 601. Assume that the road edge line 603 includes road edge line s1, road edge line s2, and road edge line s3. Among them, assume that M road segments are obtained according to the intersection area contour line 602, such as road segment ①, road segment ②, …, and road segment ⑦. By obtaining the initial distances between each of the M road segments and the j-th road edge line, the initial distances between each road segment and d road edge lines can be obtained. For example, in this example, M is 7 and d is 3. For the i-th road segment, calculate the initial distances between the i-th road segment and road edge line s1, road edge line s2, and road edge line s3, which are denoted as d1, d2, and d3 respectively. The minimum value among the d initial distances is determined as the segment distance corresponding to the i-th road segment. For example, the initial distance between the i-th road segment and road edge line s1 can be considered as the average of the maximum value and the minimum value of the point distances between at least two contour points forming the i-th road segment and road edge line s1 respectively. Through this process, the segment distance corresponding to any road segment can be obtained.
[0089] Alternatively, the intersection area contour line and the road edge line are recognized based on the road image (i.e., road information) of the traffic road. The computer device can obtain the segment positions of each of the M road segments in the intersection area contour line; based on the segment positions corresponding to each of the M road segments, perform coincidence detection on the M road segments and the road edge line to determine the coincidence degrees between each of the M road segments and the road edge line. For example, refer to Figure 7 , Figure 7 which is a schematic diagram of a coincidence detection scenario provided by an embodiment of the present application. As shown in Figure 7As shown in the figure, it is assumed that the contour line 702 of the intersection area and the road edge line 703 of the traffic road 701 are obtained. The candidate points included in the contour line 702 of the intersection area include candidate points 7a to 7g. There are M road segments, such as road segment ① to road segment ⑦. Based on the segment positions corresponding to the M road segments respectively, the M road segments are mapped to the road image. The i-th road segment and the road information carrying the road edge line are input into the edge matching model for prediction to obtain the coincidence degree between the i-th road segment and the road edge line, where the edge matching model is a trained model. Alternatively, the computer device can obtain the first coincidence ratio of the contour points located on the road edge line among at least two contour points that make up the i-th road segment, and determine the first coincidence ratio as the coincidence degree between the i-th road segment and the road edge line. Optionally, the initial distances between at least two contour points that make up the i-th road segment and the road edge line can also be obtained, and the second coincidence ratio of the contour points with the initial distance less than or equal to the coincidence distance threshold among at least two contour points that make up the i-th road segment is determined, and the second coincidence ratio is determined as the coincidence degree between the i-th road segment and the road edge line.
[0090] Furthermore, the first default distance can be determined as the segment distance of the road segment with the coincidence degree greater than or equal to the line coincidence threshold, and the second default distance can be determined as the segment distance of the road segment with the coincidence degree less than the line coincidence threshold; the first default distance is less than the second default distance. At this time, based on the first default distance and the second default distance, the segment connection edges and non-segment connection edges of the traffic road can be determined. Specifically, the road segment with the segment distance being the first default distance can be determined as the non-segment connection edge, and the road segment with the segment distance being the second default distance can be determined as the segment connection edge.
[0091] Alternatively, based on the section distances corresponding to the M road sections, the section connection edges and non-section connection edges of the traffic road can be determined. Specifically, based on the section distances corresponding to the M road sections, clustering processing can be performed on the M road sections to obtain f section sets; f is a positive integer. Among them, since semantic assignment is performed on the sections for the division of section connection and non-connection, f can be considered to be 2, and the f section sets can include a first section set and a second section set. Among them, the clustering processing can be the k-means clustering method. The k-means clustering algorithm is an iterative clustering analysis algorithm. Its steps are to pre-divide the data into K groups, then randomly select K objects as the initial clustering centers, and then calculate the distances between each object and each seed clustering center, and assign each object to the clustering center closest to it. The clustering centers and the objects assigned to them represent a clustering. Alternatively, based on the section division threshold, the road sections less than or equal to the section division threshold can be divided into the first section set, and the road sections greater than the section division threshold can be divided into the second section set.
[0092] Furthermore, based on the section distances of the road sections included in the f section sets respectively, the section connection edges and non-section connection edges of the traffic road are determined. Specifically, the statistical distances of the section distances of the road sections included in the f section sets can be obtained; any one statistical distance refers to the statistical value of the section distances of the road sections included in the corresponding section set, and this statistical value can be considered to be the median or the average value (such as the arithmetic average value, etc.). The non-section connection edges are determined based on the road sections in the section set corresponding to the first statistical distance, and the section connection edges are determined based on the road sections in the section set corresponding to the second statistical distance; the first statistical distance refers to the smallest statistical distance among the f statistical distances; the second statistical distance refers to the statistical distances other than the first statistical distance among the f statistical distances.
[0093] Specifically, the road sections in the section set corresponding to the first statistical distance can be determined as non-section connection edges, and the road sections in the section set corresponding to the second statistical distance can be determined as section connection edges. As Figure 6 shown, non-section connection edges 604 (such as road section ②, road section ③, road section ⑤, and road section ⑦) and section connection edges 605 (such as road section ①, road section ④, and road section ⑥) can be obtained.
[0094] Alternatively, the road segments in the road segment set corresponding to the first statistical distance can be determined as the first initial edges, such as road segment ②, road segment ③, road segment ⑤, and road segment ⑦, and the road segments in the road segment set corresponding to the second statistical distance can be determined as the second initial edges, such as road segment ①, road segment ④, and road segment ⑥. The first initial edges with the same candidate points are merged to obtain non-road segment connection edges, and the second initial edges with the same candidate points are merged to obtain road segment connection edges. As Figure 6 shown, there are the same candidate points (i.e., candidate point 6b) between the first initial edge ② and the first initial edge ③, and the first initial edge ② and the first initial edge ③ can be merged to obtain the non-road segment connection edge ⑧; the unprocessed first initial edges are determined as non-road segment connection edges, and the unprocessed second initial edges are determined as road segment connection edges.
[0095] In the embodiment of the present application, the contour line of the intersection area of the traffic road is obtained, and the first angles corresponding to the N contour points that make up the contour line of the intersection area are determined; the first angle of any contour point is used to represent the angle at which the contour line of the intersection area changes at the contour point; N is a positive integer; based on the first angles corresponding to the N contour points, candidate points are determined from the N contour points, and the contour line of the intersection area is divided into M road segments based on the candidate points; M is a positive integer; the road edge line of the traffic road is obtained, the segment distances between the M road segments and the road edge line are obtained respectively, and based on the segment distances corresponding to the M road segments respectively, the road segment connection edges and non-road segment connection edges of the traffic road are determined. Through the above process, on the basis of the existing annotation data, such as the contour line of the intersection area and the road edge line, etc., the existing annotation data can be parsed to obtain various parameters associated with the existing annotation data, such as road segment connection edges and non-road segment connection edges, etc., so as to ensure the relevance between the existing annotation data and the parsed annotation data, so that the obtained various annotation data are equivalent to using the same set of standards, which also makes the overall annotation of the traffic road self-consistent, thereby improving the efficiency and accuracy of road detection, that is, improving the efficiency and accuracy of intersection annotation.
[0096] Further, please refer to Figure 8 , Figure 8 which is a flowchart of a method for road detection and application provided by an embodiment of the present application. As Figure 8 shown, the method may include the following steps:
[0097] Step S801, obtain the contour line of the intersection area of the traffic road, and determine the first angles corresponding to the N contour points that make up the contour line of the intersection area.
[0098] In the embodiment of the present application, reference can be made to Figure 3 the relevant description of step S301 therein, and details will not be elaborated here.
[0099] Step S802: Based on the first angles corresponding to N contour points respectively, determine candidate points from the N contour points, and divide the intersection area contour line into M road segments based on the candidate points.
[0100] In the embodiment of the present application, reference can be made to Figure 3 the relevant description of step S302 therein, which will not be elaborated here.
[0101] Step S803: Obtain the road edge line of the traffic road, obtain the segment distances between the M road segments and the road edge line respectively, and determine the segment connection edges and non-segment connection edges of the traffic road based on the segment distances corresponding to the M road segments respectively.
[0102] In the embodiment of the present application, reference can be made to Figure 3 the relevant description of step S303 therein, which will not be elaborated here. Among them, the segment connection edge refers to the line segment in the intersection area contour line for connecting segments in the traffic road, and the segment refers to the area in the traffic road where vehicles can travel, such as Figure 6 the segment connection edge 605 shown in Figure 6 ; the non-segment connection edge refers to the line segment in the intersection area contour line for representing the segment boundary, that is, the line segment located at the boundary of the traffic road, such as
[0103] Step S804: Based on the segment connection edges and non-segment connection edges, construct intersection structure data and process the intersection structure data.
[0104] In the embodiment of the present application, in one case, that is, when the road segments are not merged, the candidate points can be determined as the road key points of the traffic road, such as Figure 6 the candidate points 6a to 6g shown in Figure 6Candidate points 6a, 6c to 6g therein; based on road key points, intersection area contour lines, section connection edges and non-section connection edges, construct intersection structure data; wherein, the first common candidate point refers to a candidate point that is simultaneously located on at least two first initial edges, and the second common candidate point refers to a candidate point that is simultaneously located on at least two second initial edges. In this case, due to the actual situation, generally there will be no two consecutive non-section connection edges, and the consecutive non-section connection edges can be merged into one edge, and at the same time, the contour points connecting the consecutive non-section connection edges can be deleted, which can make the prediction result more reasonable, more in line with the actual situation, and improve the accuracy of road detection. Among them, the intersection structure data is used to label the intersection area contour line and represents the structured intersection information of the road intersection of the traffic road.
[0105] Furthermore, the intersection structure data can be processed. That is to say, the intersection structure data obtained in this application can be applied to any application scenario that requires the use of this intersection structure data. Specifically, the application scenarios that this application can be applied to are exemplified as follows:
[0106] For example, in an application scenario, a computer device can obtain a road image of a traffic road and obtain an initial intersection parsing model; input the road image into the initial intersection parsing model for prediction to obtain sample intersection structure data. Based on the intersection structure data and the sample intersection structure data, adjust the parameters of the initial intersection parsing model until the parameters converge to obtain an intersection parsing model for intersection structure parsing. For example, reference can be made to Figure 9 , Figure 9 which is a schematic diagram of an application scenario provided by an embodiment of this application. As Figure 9 shown, area 9a is used to represent the generated intersection structure data annotation, area 9b is used to represent the model inference result, area 9c is used to represent the final post-processing result (before parameterization) of the model, and area 9d is used to represent the post-processing parameterization result of the model. Further, the computer device can obtain a to-be-detected road image to be detected, input the to-be-detected road image into the intersection parsing model for parsing to obtain the target intersection structure data of the to-be-detected road image, and the target intersection structure data is used to represent the road information of the to-be-detected traffic road corresponding to the to-be-detected road image and is used to label the to-be-detected traffic road. Further, the target intersection structure data can be sent to the road rendering engine associated with the to-be-detected traffic road, call the road rendering engine, and use the target intersection structure data to assist in rendering the to-be-detected traffic road, so that the rendered road image corresponding to the to-be-detected traffic road carries the relevant information of the target intersection structure data.
[0107] In an application scenario, a computer device can obtain an initial road detection model, acquire a road image of a traffic road, determine the intersection structure data of the traffic road based on the above steps S801 to S804, use the intersection structure data as the annotation of the road image, and adjust the parameters of the initial road detection model based on the road image carrying the intersection structure data until the parameters converge to obtain a road detection model. Herein, the road detection model can be any model that requires the intersection structure data, that is, the road detection model can be a model for processing any kind of task.
[0108] In an application scenario, the traffic road is an actual traffic road. The computer device can send the intersection structure data to a road annotation device so that the road annotation device annotates the non-segment connection edges in the actual traffic road based on a first annotation style and annotates the segment connection edges in the actual traffic road based on a second annotation style. Alternatively, integrate the intersection structure data into the road planning model corresponding to the actual traffic road and adjust the road planning model based on the intersection structure data to obtain an actual road planning model, which is used to construct the actual traffic road geographically. Or, the intersection structure data can be sent to a map application and integrated into the map application to assist in the navigation of vehicles. Or, the intersection structure data can be sent to an intelligent vehicle system to assist the intelligent vehicle system in intelligent navigation based on the intersection structure data.
[0109] In an application scenario, the traffic road is a game traffic road. The computer device can annotate the intersection structure data of the game traffic road in the game scene and plan the road driving route of the game traffic road based on the intersection structure data. Based on the route length and route environment of the road driving route, construct the game rules of the game scene. For example, assuming that the game scene is used for a racing game, the route obstacle-free driving duration of the road driving route can be determined based on the route length and route environment of the road driving route. Based on the route obstacle-free driving duration, deploy road obstacles on the road driving route so that under the same driving conditions, the route driving duration of the road driving route including road obstacles is the same. Determine the road driving route including road obstacles as the race route and construct the game rules of the racing game in the game scene based on the race route.
[0110] Through the above process, it is possible to very completely structure the road intersection, establish the intersection recognition ability with point-line-plane structure, assist in the realization of other application scenarios, including but not limited to the various application scenarios exemplified above, and improve the practicability and accuracy of road detection.
[0111] Further, please refer to Figure 10 , Figure 10It is a schematic diagram of a road detection device provided by an embodiment of the present application. The road detection device can be a computer program (including program code, etc.) running on a computer device. For example, the road detection device can be an application software; the device can be used to execute the corresponding steps in the method provided by the embodiment of the present application. As Figure 10 shown, the road detection device 1000 can be used for Figure 3 the computer device in the corresponding embodiment. Specifically, the device can include: a contour acquisition module 11, an angle determination module 12, a point screening module 13, a road section division module 14, a distance determination module 15, and an edge analysis module 16.
[0112] The contour acquisition module 11 is used to acquire the contour line of the intersection area of the traffic road;
[0113] The angle determination module 12 is used to determine the first angle corresponding to each of the N contour points that make up the contour line of the intersection area; the first angle of any one contour point is used to represent the angle of the included angle formed by taking this contour point as the vertex and connecting this contour point with the first contour points on both sides of this contour point on the contour line of the intersection area at an interval of c contour points; N is a positive integer, and c is a positive integer less than N;
[0114] The point screening module 13 is used to determine candidate points from the N contour points based on the first angles corresponding to the N contour points;
[0115] The road section division module 14 is used to divide the contour line of the intersection area into M road sections based on the candidate points; M is a positive integer;
[0116] The distance determination module 15 is used to acquire the road edge line of the traffic road and acquire the section distances between the M road sections and the road edge line respectively;
[0117] The edge analysis module 16 is used to determine the section connection edges and non-section connection edges of the traffic road based on the section distances corresponding to the M road sections respectively.
[0118] Among them, the point screening module 13 includes:
[0119] The point sorting unit 131 is used to sort the N contour points according to the first angles corresponding to the N contour points;
[0120] The threshold acquisition unit 132 is used to acquire the intersection point threshold of the traffic scene where the traffic road is located;
[0121] The candidate determination unit 133 is used to determine K candidate points from the sorted N contour points based on the intersection point threshold; K is a positive integer less than or equal to N, and K is less than or equal to the intersection point threshold.
[0122] Among them, the number of road edge lines is d, where d is a positive integer; the distance determination module 15 includes:
[0123] A distance detection unit 151, configured to obtain the point distances between at least two contour points constituting the i-th road segment and the j-th road edge line respectively, and determine the statistical value of the point distances corresponding to the at least two contour points respectively as the initial distance between the i-th road segment and the j-th road edge line; i is a positive integer less than or equal to M, and j is a positive integer less than or equal to d;
[0124] A distance determination unit 152, configured to, when obtaining the initial distances between the i-th road segment and d road edge lines respectively, determine the minimum value among the d initial distances as the segment distance corresponding to the i-th road segment.
[0125] Among them, the intersection area contour line and the road edge line are obtained by recognizing the road image of the traffic road; the distance determination module 15 includes:
[0126] A position acquisition unit 153, configured to acquire the segment positions of M road segments in the intersection area contour line respectively;
[0127] A coincidence detection unit 154, configured to perform coincidence detection on M road segments and road edge lines based on the segment positions corresponding to the M road segments respectively;
[0128] The distance determination unit 152 is further configured to determine the first default distance as the segment distance of the road segment with a coincidence degree greater than or equal to the line coincidence threshold, and determine the second default distance as the segment distance of the road segment with a coincidence degree less than the line coincidence threshold; the first default distance is less than the second default distance.
[0129] Among them, the edge parsing module 16 includes:
[0130] A segment clustering unit 161, configured to perform clustering processing on M road segments based on the segment distances corresponding to the M road segments respectively, to obtain f segment sets; f is a positive integer;
[0131] A segment parsing unit 162, configured to determine the segment connection edges and non-segment connection edges of the traffic road based on the segment distances of the road segments included in the f segment sets respectively.
[0132] Among them, the segment parsing unit 162 includes:
[0133] A statistical acquisition subunit 1621, configured to obtain the statistical distances of the segment distances of the road segments included in the f segment sets respectively; any one statistical distance refers to the statistical value of the segment distances of the road segments included in the corresponding segment set;
[0134] An edge determination subunit 1622 is configured to determine non-road-section connection edges based on road sections in a road-section set corresponding to a first statistical distance, and determine road-section connection edges based on road sections in a road-section set corresponding to a second statistical distance; the first statistical distance refers to the minimum statistical distance among f statistical distances; the second statistical distance refers to the statistical distances among the f statistical distances other than the first statistical distance.
[0135] Wherein, the edge determination subunit 1622 includes:
[0136] A first determination subunit 162a is configured to determine road sections in a road-section set corresponding to the first statistical distance as non-road-section connection edges, and determine road sections in a road-section set corresponding to the second statistical distance as road-section connection edges;
[0137] The apparatus 1000 further includes:
[0138] A data construction module 17 is configured to determine candidate points as key points of a traffic road, and construct intersection structure data based on the key points of the road, the contour line of the intersection area, the road-section connection edges, and the non-road-section connection edges; the intersection structure data is used to label the contour line of the intersection area.
[0139] Wherein, the edge determination subunit 1622 includes:
[0140] A second determination subunit 162b is configured to determine road sections in a road-section set corresponding to the first statistical distance as first initial edges, and determine road sections in a road-section set corresponding to the second statistical distance as second initial edges;
[0141] An edge merging subunit 162c is configured to merge first initial edges with the same candidate points to obtain non-road-section connection edges, and merge second initial edges with the same candidate points to obtain road-section connection edges;
[0142] The data construction module 17 is further configured to:
[0143] Delete first common candidate points included in the first initial edges and second common candidate points included in the second initial edges among the candidate points to obtain key points of the traffic road, and construct intersection structure data based on the key points of the road, the contour line of the intersection area, the road-section connection edges, and the non-road-section connection edges; the first common candidate points refer to candidate points that are simultaneously located on at least two first initial edges, and the second common candidate points refer to candidate points that are simultaneously located on at least two second initial edges; the intersection structure data is used to label the contour line of the intersection area.
[0144] Wherein, the apparatus 1000 further includes:
[0145] A data acquisition module 18 is configured to acquire a road image of a traffic road and acquire an initial intersection parsing model.
[0146] A sample prediction module 19, configured to input a road image into an initial intersection parsing model for prediction to obtain sample intersection structure data;
[0147] A model training module 20, configured to adjust parameters of the initial intersection parsing model based on the intersection structure data and the sample intersection structure data until the parameters converge, so as to obtain an intersection parsing model for performing intersection structure parsing.
[0148] Wherein, the traffic road is an actual traffic road; the apparatus 1000 further includes:
[0149] A data sending module 21, configured to send the intersection structure data to a road annotation device, so that the road annotation device annotates non-road-section connection edges in the actual traffic road based on a first annotation style and annotates road-section connection edges in the actual traffic road based on a second annotation style; or
[0150] A road planning module 22, configured to integrate the intersection structure data into a road planning model corresponding to the actual traffic road, and adjust the road planning model based on the intersection structure data to obtain an actual road planning model.
[0151] Wherein, the traffic road is a game traffic road; the apparatus 1000 further includes:
[0152] A route planning module 23, configured to annotate intersection structure data of the game traffic road in a game scene, and plan a road driving route of the game traffic road based on the intersection structure data;
[0153] A rule construction module 24, configured to construct game rules of the game scene based on the route length and route environment of the road driving route.
[0154] An embodiment of the present application provides a road detection device, which can acquire the contour line of the intersection area of a traffic road, and determine the first angles corresponding to N contour points that make up the contour line of the intersection area; the first angle of any one contour point refers to the angle of the included angle formed by this contour point and its adjacent contour points; N is a positive integer; based on the first angles corresponding to the N contour points, candidate points are determined from the N contour points, and the contour line of the intersection area is divided into M road segments based on the candidate points; M is a positive integer; the road edge line of the traffic road is acquired, the segment distances between the M road segments and the road edge line are acquired respectively, and based on the segment distances corresponding to the M road segments respectively, the segment connection edges and non-segment connection edges of the traffic road are determined. Through the above process, based on the existing annotation data, such as the contour line of the intersection area and the road edge line, etc., the existing annotation data can be parsed to obtain various parameters associated with the existing annotation data, such as segment connection edges and non-segment connection edges, etc., ensuring the relevance between the existing annotation data and the parsed annotation data, so that the obtained various annotation data are equivalent to using the same set of standards, which also makes the overall annotation of the traffic road self-consistent, thereby improving the efficiency and accuracy of road detection, that is, improving the efficiency and accuracy of intersection annotation.
[0155] See Figure 11 , Figure 11 is a schematic structural diagram of a computer device provided by an embodiment of the present application. As Figure 11 shown, the computer device in the embodiment of the present application may include: one or more processors 1101, a memory 1102, and an input / output interface 1103. The processor 1101, the memory 1102, and the input / output interface 1103 are connected through a bus 1104. The memory 1102 is used to store a computer program, the computer program includes program instructions, the input / output interface 1103 is used to receive data and output data, such as for data interaction between the computer device and a road acquisition device, etc.; the processor 1101 is used to execute the program instructions stored in the memory 1102.
[0156] Among them, the processor 1101 can perform the following operations:
[0157] Acquire the contour line of the intersection area of a traffic road, and determine the first angles corresponding to N contour points that make up the contour line of the intersection area; the first angle of any one contour point is used to represent the angle of the included angle formed with this contour point as the vertex, with the first contour points that are c contour points apart from this contour point on both sides of this contour point on the contour line of the intersection area as the sides; N is a positive integer, and c is a positive integer less than N;
[0158] Based on the first angles respectively corresponding to N contour points, candidate points are determined from the N contour points, and based on the candidate points, the intersection area contour line is divided into M road segments; M is a positive integer;
[0159] Obtain the road edge line of the traffic road, obtain the segment distances between the M road segments and the road edge line respectively, and based on the segment distances respectively corresponding to the M road segments, determine the segment connection edges and non-segment connection edges of the traffic road.
[0160] In some possible implementation manners, the processor 1101 may be a central processing unit (CPU), and the processor may also be 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. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0161] The memory 1102 may include a read-only memory and a random access memory, and provide instructions and data to the processor 1101 and the input / output interface 1103. A part of the memory 1102 may also include a non-volatile random access memory. For example, the memory 1102 may also store information about the device type.
[0162] In specific implementation, the computer device may execute the implementation manners provided in each step of the Figure 3 through each built-in functional module thereof. For specific reference, see the implementation manners provided in each step of the Figure 3 and details are not described herein again.
[0163] By providing a computer device in an embodiment of the present application, including: a processor, an input / output interface, and a memory, the processor obtains a computer program in the memory and executes the Figure 3For each step of the method shown in the figure, a road detection operation is performed. In the embodiment of the present application, the contour line of the intersection area of the traffic road is obtained, and the first angles corresponding to N contour points that make up the contour line of the intersection area are determined; the first angle of any one contour point refers to the angle of the included angle formed by the contour point and its adjacent contour point; N is a positive integer; based on the first angles corresponding to the N contour points respectively, candidate points are determined from the N contour points, and the contour line of the intersection area is divided into M road segments based on the candidate points; M is a positive integer; the road edge line of the traffic road is obtained, the segment distances between the M road segments and the road edge line are obtained respectively, and based on the segment distances corresponding to the M road segments respectively, the segment connection edges and non-segment connection edges of the traffic road are determined. Through the above process, based on the existing annotation data, such as the contour line of the intersection area and the road edge line, etc., the existing annotation data can be parsed to obtain various parameters associated with the existing annotation data, such as segment connection edges and non-segment connection edges, etc., so as to ensure the relevance between the existing annotation data and the parsed annotation data, so that the obtained various annotation data are equivalent to using the same set of standards, which also makes the overall annotation of the traffic road self-consistent, thereby improving the efficiency and accuracy of road detection, that is, improving the efficiency and accuracy of intersection annotation.
[0164] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded and executed by the processor Figure 3 in the road detection method provided by each step, and specifically, reference can be made to the Figure 3 implementation manners provided by each step, which will not be elaborated here. In addition, the description of the beneficial effects of using the same method will not be elaborated either. For the technical details not disclosed in the embodiment of the computer-readable storage medium involved in the present application, please refer to the description of the method embodiment of the present application. As an example, the computer program can be deployed to be executed on a computer device, or on multiple computer devices located at one place, or on multiple computer devices distributed at multiple places and interconnected through a communication network.
[0165] The computer-readable storage medium may be the road detection device provided in any of the foregoing embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit and the external storage device of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store the data that has been output or is to be output.
[0166] The embodiments of the present application also provide a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 3 the methods provided in various alternative manners in [reference], realizes parsing the existing annotation data, such as intersection area contour lines and road edge lines, etc., to obtain various parameters associated with the existing annotation data, such as section connection edges and non-section connection edges, etc., ensuring the relevance between the existing annotation data and the parsed annotation data, so that the obtained various annotation data are equivalent to using the same set of standards, and thus the overall annotation of the traffic road can be self-consistent, thereby improving the efficiency and accuracy of road detection, that is, improving the efficiency and accuracy of intersection annotation.
[0167] The terms "first", "second", etc. in the description, claims and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product or equipment that includes a series of steps or units is not limited to the listed steps or modules, but optionally further includes steps or modules not listed, or optionally further includes other step units inherent to these processes, methods, devices, products or equipment.
[0168] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in this description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0169] The methods and related devices provided in the embodiments of this application are described with reference to the method flowcharts and / or structural schematic diagrams provided in the embodiments of this application. Specifically, each process and / or block of the method flowchart and / or structural schematic diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable road detection devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable road detection devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or structural schematic Figure 1 one block or multiple blocks. These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable road detection device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured product including an instruction device, and the instruction device implements the functions specified in Figure 1 one process or multiple processes and / or structural schematic Figure 1 one block or multiple blocks. These computer program instructions can also be loaded onto a computer or other programmable road detection device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one process or multiple processes and / or structural schematic one block or multiple blocks.
[0170] The steps in the methods of the embodiments of this application can be adjusted, combined, and deleted according to actual needs.
[0171] The modules in the devices of the embodiments of this application can be combined, divided, and deleted according to actual needs.
[0172] The above-disclosed are only the preferred embodiments of this application. Of course, the scope of the rights of this application cannot be limited by this. Therefore, equivalent changes made according to the claims of this application still fall within the scope covered by this application.
Claims
1. A road detection method, characterized in that, The method includes: Obtaining the contour line of the intersection area of the traffic road, and determining the first angles corresponding to N contour points that make up the contour line of the intersection area; the first angle of any one contour point is used to represent the angle of the included angle formed by taking this contour point as the vertex and connecting this contour point with the first contour points that are c contour points apart on both sides of this contour point on the contour line of the intersection area; N is a positive integer, and c is a positive integer less than N; Based on the first angles corresponding to the N contour points, determining candidate points from the N contour points, and dividing the contour line of the intersection area into M road segments based on the candidate points; M is a positive integer; Obtaining the road edge line of the traffic road, obtaining the segment distances between the M road segments and the road edge line respectively, and determining the segment connection edges and non-segment connection edges of the traffic road based on the segment distances corresponding to the M road segments respectively.
2. The method according to claim 1, wherein The determining candidate points from the N contour points based on the first angles corresponding to the N contour points includes: Sorting the N contour points according to the first angles corresponding to the N contour points; Obtaining the intersection point threshold of the traffic scene where the traffic road is located, and determining K candidate points from the sorted N contour points based on the intersection point threshold; K is a positive integer less than or equal to N and less than or equal to the intersection point threshold.
3. The method according to claim 1, characterized in that, The number of the road edge lines is d, and d is a positive integer; the obtaining the segment distances between the M road segments and the road edge line respectively includes: Obtaining the point distances between at least two contour points that make up the i-th road segment and the j-th road edge line respectively, and determining the statistical value of the point distances corresponding to the at least two contour points as the initial distance between the i-th road segment and the j-th road edge line; i is a positive integer less than or equal to M, and j is a positive integer less than or equal to d; When the initial distances between the i-th road segment and d road edge lines are obtained, determining the minimum value among the d initial distances as the segment distance corresponding to the i-th road segment.
4. The method according to claim 1, characterized in that The contour line of the intersection area and the road edge line are obtained by recognizing the road image of the traffic road; the obtaining the segment distances between the M road segments and the road edge line respectively includes: Obtaining the segment positions of the M road segments in the contour line of the intersection area respectively; Performing coincidence detection on the M road segments and the road edge line based on the segment positions corresponding to the M road segments respectively; Determining the first default distance as the segment distance of the road segment with a coincidence degree greater than or equal to the line coincidence threshold, and determining the second default distance as the segment distance of the road segment with a coincidence degree less than the line coincidence threshold; the first default distance is less than the second default distance.
5. The method according to claim 1, characterized in that The determining the segment connection edges and non-segment connection edges of the traffic road based on the segment distances corresponding to the M road segments respectively includes: Based on the section distances respectively corresponding to the M road sections, perform clustering processing on the M road sections to obtain f section sets; f is a positive integer; Based on the section distances of the road sections respectively included in the f section sets, determine the section connection edges and non-section connection edges of the traffic road.
6. The method according to claim 5, characterized in that The determining the section connection edges and non-section connection edges of the traffic road based on the section distances of the road sections respectively included in the f section sets includes: Obtain the statistical distances of the section distances of the road sections respectively included in the f section sets; any statistical distance refers to the statistical value of the section distances of the road sections included in the corresponding section set. Determine non-section connection edges based on the road sections in the section set corresponding to the first statistical distance, and determine section connection edges based on the road sections in the section set corresponding to the second statistical distance; the first statistical distance refers to the minimum statistical distance among the f statistical distances; the second statistical distance refers to the statistical distances among the f statistical distances other than the first statistical distance.
7. The method according to claim 6, wherein The determining non-section connection edges based on the road sections in the section set corresponding to the first statistical distance and determining section connection edges based on the road sections in the section set corresponding to the second statistical distance includes: Determine the road sections in the section set corresponding to the first statistical distance as non-section connection edges, and determine the road sections in the section set corresponding to the second statistical distance as section connection edges; The method further includes: Determine the candidate points as the road key points of the traffic road, and based on the road key points, the intersection area contour line, the section connection edges and the non-section connection edges, construct intersection structure data; the intersection structure data is used to label the intersection area contour line.
8. The method according to claim 6, wherein The determining non-section connection edges based on the road sections in the section set corresponding to the first statistical distance and determining section connection edges based on the road sections in the section set corresponding to the second statistical distance includes: Determine the road sections in the section set corresponding to the first statistical distance as the first initial edges, and determine the road sections in the section set corresponding to the second statistical distance as the second initial edges; Merge the first initial edges with the same candidate points to obtain non-section connection edges, and merge the second initial edges with the same candidate points to obtain section connection edges; The method further includes: Delete the first common candidate points included in the first initial edges and the second common candidate points included in the second initial edges among the candidate points to obtain the road key points of the traffic road, and based on the road key points, the intersection area contour line, the section connection edges and the non-section connection edges, construct intersection structure data; the first common candidate points refer to the candidate points that are simultaneously located in at least two first initial edges, and the second common candidate points refer to the candidate points that are simultaneously located in at least two second initial edges; the intersection structure data is used to label the intersection area contour line.
9. The method according to any one of claims 7 or 8, characterized in that The method further includes: Obtain the road image of the traffic road and obtain an initial intersection parsing model. Input the road image into the initial intersection parsing model for prediction to obtain sample intersection structure data; Based on the intersection structure data and the sample intersection structure data, adjust the parameters of the initial intersection parsing model until the parameters converge to obtain an intersection parsing model for intersection structure parsing.
10. The method according to any one of claims 7 or 8, characterized in that, The traffic road is an actual traffic road; the method further includes: Send the intersection structure data to a road annotation device, so that the road annotation device annotates the non-road-section connection edges in the actual traffic road based on a first annotation style and annotates the road-section connection edges in the actual traffic road based on a second annotation style; or, Integrate the intersection structure data into the road planning model corresponding to the actual traffic road, and adjust the road planning model based on the intersection structure data to obtain an actual road planning model.
11. The method according to any one of claims 7 or 8, characterized in that The traffic road is a game traffic road; the method further includes: Annotate the intersection structure data of the game traffic road in the game scene, and plan the road driving route of the game traffic road based on the intersection structure data; Construct the game rules of the game scene based on the route length and route environment of the road driving route.
12. A road detection device, characterized in that, The device includes: A contour acquisition module for acquiring the contour line of the intersection area of the traffic road; An angle determination module for determining the first angle corresponding to each of the N contour points that make up the intersection area contour line; the first angle of any one contour point is used to represent the angle of the included angle formed by taking this contour point as the vertex and connecting this contour point with the first contour points that are c contour points apart on both sides of this contour point on the intersection area contour line; N is a positive integer, and c is a positive integer less than N; A point screening module for determining candidate points from the N contour points based on the first angles corresponding to the N contour points; A road section division module for dividing the intersection area contour line into M road sections based on the candidate points; M is a positive integer; A distance determination module for acquiring the road edge line of the traffic road and acquiring the section distances between the M road sections and the road edge line respectively; An edge parsing module for determining the road-section connection edges and non-road-section connection edges of the traffic road based on the section distances corresponding to the M road sections respectively.
13. A computer device, characterized in that, It includes a processor, a memory, and an input / output interface; The processor is respectively connected to the memory and the input / output interface, wherein the input / output interface is used for receiving and outputting data, the memory is used for storing computer programs, and the processor is used for calling the computer programs so that the computer device executes the method according to any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor so that a computer device with the processor executes the method according to any one of claims 1-11.
15. A computer program product, comprising a computer program / instructions, characterized in that, The computer program / instructions, when executed by the processor, implement the method according to any one of claims 1-11.
Citation Information
Patent Citations
Grid map visual guide line generation method and device
CN114419190A
Road boundary line determination method and device, equipment and storage medium
CN115063765A