CN116212392A - Virtual intersection generation method and device, electronic equipment and storage medium - Google Patents

Virtual intersection generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116212392A
CN116212392A CN202310508520.2A CN202310508520A CN116212392A CN 116212392 A CN116212392 A CN 116212392A CN 202310508520 A CN202310508520 A CN 202310508520A CN 116212392 A CN116212392 A CN 116212392A
Authority
CN
China
Prior art keywords
intersection
point
edge
points
road
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310508520.2A
Other languages
Chinese (zh)
Other versions
CN116212392B (en
Inventor
闫广赫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202310508520.2A priority Critical patent/CN116212392B/en
Publication of CN116212392A publication Critical patent/CN116212392A/en
Application granted granted Critical
Publication of CN116212392B publication Critical patent/CN116212392B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Remote Sensing (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Navigation (AREA)
  • Traffic Control Systems (AREA)

Abstract

The application relates to the technical field of computers, in particular to a virtual intersection generation method, a virtual intersection generation device, electronic equipment and a storage medium, which are used for improving intersection generation efficiency. The method comprises the following steps: acquiring at least two intersection curves corresponding to an intersection to be generated and each associated road-in-road curve, acquiring an intersection end point set corresponding to the intersection curve based on the intersection point of each intersection curve and each associated road-in-road curve, moving each intersection end point in the intersection end point set according to the set direction of the road curve based on the road width corresponding to the road curve of the intersection end point set, and respectively acquiring two intersection edge points corresponding to each intersection end point; and obtaining an intersection region based on the obtained intersection connection line between the intersection edge points, and filling the intersection region to obtain the intersection to be generated. Because the method only needs to acquire the intersection curve and the road center curve on the road curve, the intersection to be generated is obtained through operation, and compared with the way of manually manufacturing the intersection, the method and the device can improve the intersection generation efficiency.

Description

Virtual intersection generation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a virtual intersection generating method, device, electronic apparatus, and storage medium.
Background
With the rapid development of the game industry, the game player's demand for game quality is gradually increased, and the opening of world game scenes is gradually becoming the mainstream of the current game field. Along with the gradual increase of game scenes, the complexity of road networks in games is increased, various roads with different widths and directions often exist in the road networks, and a large number of intersections formed by crossing roads are also required to be generated in the process of constructing the road networks.
In the related art, a game developer is mainly used for manually splicing road curves, chamfering and other operations are performed on a formed intersection, and a geometric body of a virtual intersection is manufactured.
However, the manual manufacturing method is difficult to ensure uniformity and smoothness of the intersections, affects visual effects, and is difficult to obtain experience similar to a real intersection scene when a game player browses in the manufactured virtual intersections, so that the actual operation effect of the game player is affected, and further the game quality is reduced.
Further, because the road network is often large in scale and needs to be frequently modified, once modification is involved, all relevant virtual intersections need to be manually adjusted one by one, and the efficiency of generating intersections is low.
Therefore, how to improve the intersection generation efficiency is a problem to be solved.
Disclosure of Invention
The embodiment of the application provides a virtual intersection generation method, a virtual intersection generation device, electronic equipment and a storage medium, which are used for improving intersection generation efficiency.
The virtual intersection generation method provided by the embodiment of the application comprises the following steps:
acquiring at least two intersection curves corresponding to an intersection to be generated and road curves respectively associated with the at least two intersection curves, wherein the intersection curves and the associated road curves belong to the same road curve;
based on curve intersection points of the at least two intersection curves and the associated road curves, respectively obtaining intersection end point sets corresponding to the at least two intersection curves, wherein the intersection end points are used for forming the intersection to be generated;
for the at least two intersection endpoint sets, respectively executing the following operations: based on the road width corresponding to a road curve in which one intersection endpoint set is positioned, moving each intersection endpoint in the one intersection endpoint set according to the set direction of the road curve, and respectively obtaining two intersection edge points corresponding to each intersection endpoint;
and obtaining an intersection region based on the obtained intersection connection line between the intersection edge points, and filling the intersection region to obtain the intersection to be generated.
The virtual intersection generating device provided by the embodiment of the application comprises:
the system comprises an acquisition unit, a storage unit and a control unit, wherein the acquisition unit is used for acquiring at least two intersection curves corresponding to an intersection to be generated and road curves respectively associated with the at least two intersection curves, and the intersection curves and the associated road curves belong to the same road curve;
the composition unit is used for respectively obtaining intersection end point sets corresponding to the at least two intersection curves based on curve intersection points of the at least two intersection curves and the associated road curves, and the intersection end points are used for composing the intersection to be generated;
the mobile unit is used for respectively executing the following operations aiming at the at least two intersection endpoint sets: based on the road width corresponding to a road curve in which one intersection endpoint set is positioned, moving each intersection endpoint in the one intersection endpoint set according to the set direction of the road curve, and respectively obtaining two intersection edge points corresponding to each intersection endpoint;
the connecting unit is used for obtaining an intersection area based on the obtained intersection connection between the intersection edge points, filling the intersection area and obtaining the intersection to be generated.
Optionally, the intersection connecting line is a first type connecting line, two intersection edge points connected by the first type connecting line correspond to different intersection end points, the positions of the two intersection edge points on the first polygon are adjacent, and each vertex of the first polygon is each intersection edge point;
the connection unit is specifically adapted to:
connecting two intersection edge points corresponding to the first type of connecting line to obtain an initial connecting line;
and adjusting the shape of the initial connecting line based on control points on the tangent lines of the corresponding intersection endpoints of the two intersection edge points to obtain the first type connecting line, wherein the tangent line of each control point is tangent to the road curve of the corresponding intersection endpoint at the corresponding intersection endpoint.
Optionally, the two intersection edge points are an edge starting point and an edge ending point respectively, the edge starting point corresponds to an intersection starting end point, and the edge ending point corresponds to an intersection ending end point;
the connection unit is specifically adapted to:
moving rays determined based on the intersection starting end point according to the setting direction of the tangent line of the intersection starting end point based on the road width corresponding to the intersection starting end point to obtain starting point rays, and moving rays determined based on the intersection terminal end point according to the setting direction of the tangent line of the intersection terminal end point based on the road width corresponding to the intersection terminal end point to obtain terminal point rays;
Respectively projecting the starting point rays and the end point rays to a projection plane of the intersection to be generated to obtain a starting point projection line and an end point projection line, wherein the projection plane is perpendicular to the road surface direction of the intersection to be generated;
and taking a point corresponding to the starting point ray as a transition starting point, a point corresponding to the ending point ray as a transition ending point, and obtaining the first type connecting line based on the edge starting point, the transition ending point and the edge ending point.
Optionally, the two intersection edge points include an edge starting point and an edge ending point, the edge starting point corresponds to an intersection starting point, and the edge ending point corresponds to an intersection ending point; the connection unit is further adapted to:
based on the intersection starting point and the intersection ending point, adjusting the positions of a control starting point corresponding to the intersection starting point and a control ending point corresponding to the intersection ending point to obtain an adjusted control starting point and an adjusted control ending point;
the adjusting the shape of the initial connecting line based on the control points on the tangent line of the intersection end points corresponding to the two intersection edge points respectively, to obtain the connecting line of the first type, includes:
And adjusting the shape of the initial connecting line based on the adjusted control starting point and the adjusted control ending point to obtain the first type connecting line.
Optionally, the distance between the intersection starting point and the adjusted control starting point, the distance between the adjusted control starting point and the adjusted control ending point, and the distance between the adjusted control ending point and the intersection ending point are equal;
and the dot product of the line connecting the adjusted control start point and the intersection start end point with the tangent line of the intersection start end point is larger than a preset threshold value, and the dot product of the line connecting the adjusted control end point and the intersection end point with the tangent line of the intersection end point is larger than the preset threshold value.
Optionally, the connection unit is further configured to:
based on the edge starting point and the edge ending point, the positions of the transition starting point and the transition ending point are adjusted to obtain an adjusted transition starting point and an adjusted transition ending point, wherein,
the distance between the edge starting point and the adjusted transition starting point, the distance between the adjusted transition starting point and the adjusted transition ending point, and the distance between the adjusted transition ending point and the transition ending point are equal; the dot product of the line connecting the adjusted transition starting point and the edge starting point with the tangent of the edge starting point is larger than a preset threshold, and the dot product of the line connecting the adjusted transition ending point and the edge ending point with the tangent of the edge ending point is larger than the preset threshold;
The obtaining the first type of connection line based on the edge starting point, the transition ending point, and the edge ending point includes:
and obtaining the first type connecting line based on the edge starting point, the adjusted transition ending point and the edge ending point.
Optionally, the connection unit is further configured to:
for the two intersection edge points, the following operations are respectively executed:
acquiring a target projection tangent corresponding to an intersection edge point, and intersecting points of the target projection tangent and projection tangents except the target projection tangent in the projection tangents and intersecting points of the target projection tangent and reference edges in each edge of a second polygon; the projection tangent lines are projections of tangent lines of end points of each intersection on a projection plane of the intersection to be generated, the projection plane is perpendicular to the road surface direction of the intersection to be generated, each vertex of the second polygon is a projection of end points of each intersection on the projection plane, and the reference edges are: among the sides, the target intersection endpoint is an intersection endpoint corresponding to the intersection edge point except for the side where the projection of the target intersection endpoint on the projection plane is located;
And obtaining a control point corresponding to the edge point of the intersection based on the distance between each intersection point and the target projection point, wherein the target projection point is the projection of the end point of the target intersection on the target projection tangent line.
Optionally, the connection unit is specifically configured to:
when the minimum distance in the distances belongs to a preset distance interval, the intersection point corresponding to the minimum distance is used as the control point corresponding to the edge point of the intersection at the point corresponding to the tangent of the end point of the target intersection.
Optionally, the connection unit is further configured to:
when the minimum distance in each distance is determined not to belong to a preset distance interval, if the minimum distance is smaller than the left interval endpoint value of the preset distance interval, the point on the target projection tangent line, where the distance between the intersection endpoints corresponding to the intersection edge points is the left interval endpoint value, and the point corresponding to the tangent line of the target intersection endpoint is used as the control point corresponding to the intersection edge point;
and if the minimum distance is greater than the right interval endpoint value of the preset distance interval, projecting a point on the target projection tangent line, wherein the distance between the intersection endpoints corresponding to the intersection edge points is the right interval endpoint value, and the point corresponding to the tangent line of the target intersection endpoint is used as the intersection endpoint control point corresponding to the intersection edge point.
Optionally, the intersection connection line is a second type connection line, and two intersection edge points connected by the second type connection line correspond to the same intersection end point.
Optionally, the composition unit is specifically configured to:
respectively projecting each curve intersection point to a projection plane of the intersection to be generated to obtain each projection point, wherein the projection plane is perpendicular to the road surface direction of the intersection to be generated;
constructing a third polygon based on each projection point, wherein each projection point is a vertex of the third polygon or is positioned in the third polygon;
and when the projection points are determined to be the vertexes of the third polygon, respectively taking the intersection points of the curves as intersection endpoints contained in the intersection endpoint sets corresponding to the corresponding intersection curves.
Optionally, the composition unit is further configured to:
when the projection points which are not the vertexes of the third polygon exist in the projection points, extending the third polygon along the road surface direction and the opposite direction of the road surface direction to obtain a target geometrical body;
and respectively taking the intersection points of curves in the road where the intersection points of the target geometric body and the curves corresponding to the projection points are located and the intersection points of the curves except the intersection points of the curves corresponding to the projection points in the intersection points of the curves as intersection end points contained in the intersection end point sets corresponding to the corresponding intersection curves.
The electronic device provided by the embodiment of the application comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to execute the steps of any one of the virtual intersection generation methods.
The embodiment of the application provides a computer readable storage medium, which comprises a computer program, wherein when the computer program runs on electronic equipment, the computer program is used for enabling the electronic equipment to execute the steps of any one of the virtual intersection generation methods.
Embodiments of the present application provide a computer program product comprising a computer program stored in a computer readable storage medium; when the processor of the electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps of any one of the virtual intersection generating methods described above.
The beneficial effects of the application are as follows:
the embodiment of the application provides a virtual intersection generation method, device, electronic equipment and storage medium, which are characterized in that at least two intersection curves corresponding to an intersection to be generated and road curves respectively associated with the at least two intersection curves are only required to be obtained, road curves where different intersection curves are located can be disjoint or can be located in different planes, three-dimensional intersection generation can be supported, the requirement on input road curves is extremely low, and the method is applicable to generating intersections to be generated among most road curves; then, based on the curve intersection point of the intersection curve and the associated in-road curve, an intersection end point set of the intersection curve is obtained, intersection edge points are obtained by moving intersection end points, and based on intersection connecting lines among the intersection edge points, intersection areas are obtained and filled, so that the intersection to be generated is obtained. Based on the mode, the to-be-generated intersection can be generated only by acquiring the intersection curve and the road center curve, the intersection generation efficiency can be effectively improved, when the corresponding intersection curve and the road center curve are required to be modified, the editing efficiency of the intersection can be effectively improved, when the virtual intersection in a game is generated, the online time of the game is shortened, the uncertainty caused by the fact that the intersection is manufactured manually on the quality of the intersection is avoided, the effect stability of the generated intersection is improved, and the game quality is further improved.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1A is a schematic illustration of an intersection scope in an embodiment of the present application;
FIG. 1B is a schematic diagram of an intersection curve and a road center curve according to an embodiment of the present application;
fig. 1C is a schematic diagram of road information in an embodiment of the present application;
FIG. 1D is a schematic view of a fold line in an embodiment of the present application;
FIG. 2A is a schematic diagram of a virtual intersection in the related art;
FIG. 2B is a schematic view of a curved road surface according to the related art;
FIG. 2C is a schematic diagram of another virtual intersection in the related art;
FIG. 3A is a schematic diagram of a broken road edge line in an embodiment of the present application;
FIG. 3B is a schematic diagram of a road curve with multiple points of intersection according to an embodiment of the present application;
FIG. 4 is an alternative schematic diagram of an application scenario in an embodiment of the present application;
FIG. 5 is a flowchart of an implementation of a virtual intersection generation method according to an embodiment of the present application;
FIG. 6A is a schematic diagram of another intersection curve and a road center curve in an embodiment of the present application;
FIG. 6B is a schematic illustration of yet another intersection curve and a road-in-road curve in an embodiment of the present application;
FIG. 7A is a schematic diagram of vectors in an embodiment of the present application;
fig. 7B is a schematic diagram of an acquisition method of an intersection edge point in an embodiment of the present application;
fig. 7C is a schematic diagram of an intersection to be generated in an embodiment of the present application;
FIG. 8A is a schematic view of a third polygon according to one embodiment of the present application;
FIG. 8B is a schematic view of another third polygon according to an embodiment of the present application;
FIG. 9A is a schematic diagram of a control point according to an embodiment of the present application;
FIG. 9B is a schematic illustration of another intersection area in an embodiment of the present application;
FIG. 9C is a schematic view of a projected tangent line in an embodiment of the present application;
FIG. 10A is a schematic diagram of a hub in an embodiment of the present application;
FIG. 10B is a schematic diagram of the control start point and the control end point after adjustment in the embodiment of the present application;
FIG. 10C is a schematic diagram of a Bezier curve in an embodiment of the present application;
FIG. 11 is a schematic view of a three-dimensional intersection in an embodiment of the present application;
FIG. 12A is a schematic view of another three-dimensional intersection in an embodiment of the present application;
FIG. 12B is a schematic diagram of another intersection to be created in an embodiment of the present application;
fig. 13 is a logic schematic diagram of a virtual intersection generating method in an embodiment of the present application;
fig. 14 is a schematic structural diagram of a virtual intersection generating device in an embodiment of the present application;
fig. 15 is a schematic diagram of a hardware composition structure of an electronic device to which the embodiments of the present application are applied;
fig. 16 is a schematic diagram of a hardware composition structure of another electronic device to which the embodiments of the present application are applied.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the technical solutions of the present application, but not all embodiments. All other embodiments, which can be made by a person of ordinary skill in the art without any inventive effort, based on the embodiments described in the present application are intended to be within the scope of the technical solutions of the present application.
Intersection range: the range covered by the intersection to be generated is indicated, two road center lines (namely, road curves) are input, the road width of the road curves is specified, the intersection range is shown in fig. 1A, wherein the solid line part of the road curves is an intersection curve, and the dotted line part is a non-intersection curve.
Intersection curve: one road curve can be used for generating a plurality of intersections, and each intersection corresponds to one intersection curve in the road curves.
Curve in road: the curve of the road curve which is not located in the intersection range of the intersection to be generated can also be called a non-intersection curve, the curve in the road and the intersection curve intersect at a curve intersection point, as shown in fig. 1B, all solid lines are intersection curves, the broken lines are road curves, one middle point mid_point is taken from the road curves, one road curve is divided into two road curves, the starting point mid_point of each divided road curve is the curve intersection point, and thus each curve intersection point corresponds to one intersection curve and one road curve. In the embodiment of the present application, the starting point of the curve in the road is mainly taken as the middle point, and the end point is taken as the curve intersection point of the associated intersection curve as an example.
Intersection end point: and if not, extending the third polygon to obtain a target geometrical body, and taking the intersection point of the curve in the road where the target geometrical body and the projection point which is not the vertex are located as the intersection end point.
Intersection edge points: and moving the point obtained by the end point of the intersection, regarding the intersection area as a geometrical body, taking the edge point of the intersection as the vertex of the geometrical body, obtaining the intersection area by connecting the edge points of the intersection, and filling to obtain the intersection to be generated.
Procedural based content generation (Procedural Content Generation, PCG): refers to a technique in which a user inputs parameters, basic materials, etc., and then generates content in large quantities in real time or off-line through a series of established rules and algorithms. The virtual intersection generation method can be applied to PCG, and a user can obtain the intersection to be generated only by inputting the intersection curve with width and rotation information and the road center curve into an algorithm according to the requirements. As shown in fig. 1C, which is a schematic illustration of input information required for a road, the method includes:
Three-dimensional geometric data of a road curve, left and right side widths of each point (dots in the figure) on the road curve are used for generating an upward direction (upward rays in the figure) perpendicular to the road curve on each point of the road curve (wire frames in the figure), and the intersection curves belonging to an intersection curve or a non-intersection curve belong to the same intersection, and the same identifications (Identity Document, IDs) are set on the intersection curves belonging to the same intersection.
Polyline (Polyline): a multi-segment line obtained by connecting points in a three-dimensional space using straight segments in a specific order. FIG. 1D is a schematic diagram of a fold line according to an embodiment of the present application.
Normalization of vector (normal): in the embodiment of the application, the width of each point on the intersection curve is taken as a weight, and the direction vector (up_direction) perpendicular to the road curved surface on each point is normalized, weighted average and normalized to obtain the average vertical direction (average_up_direction) of the intersection to be generated, namely the intersection direction.
The following briefly describes the design concept of the embodiment of the present application:
with the rapid development of the game industry, the game player's demand for game quality is gradually increased, and the opening of world game scenes is gradually becoming the mainstream of the current game field. Along with the gradual increase of game scenes, the complexity of road networks in games is increased, various roads with different widths and directions often exist in the road networks, and a large number of intersections formed by crossing roads are also required to be generated in the process of constructing the road networks.
In the related art, the virtual intersection is mainly generated by the following two modes:
mode one: the game developer manually splices the road curves, performs operations such as chamfering on the formed intersection, and makes the geometry of the virtual intersection.
However, the manual modeling is also difficult to ensure unified and smooth curves, the obtained results are often difficult to control, the visual effect is affected, and when a game player is visiting in a manufactured virtual intersection, experience similar to a real intersection scene is difficult to obtain, so that the actual operation effect of the game player is affected, and the game quality is further reduced. For the manual intersection marking scheme, once modification is involved, a great deal of related work is restarted, so that the efficiency is extremely low, and a great deal of manpower is required. The road system is just a part of the related games, which is numerous and frequently modified. Because the road network is often huge in scale and needs to be frequently modified, once modification is involved, all related virtual intersections need to be manually adjusted one by one, and the efficiency of generating intersections is low.
Mode two: programming to generate a virtual intersection;
(1) Projecting the curved surface of the road at the intersection to the same plane, carrying out Boolean operation intersection, and then carrying out smoothing treatment on the obtained road edge line to obtain the virtual intersection shown in FIG. 2A;
However, this method requires that both the input intersection curve and the output intersection geometry are on the same plane, and therefore, the generation of a three-dimensional intersection is not supported, and since the algorithm needs to smooth the road edge line after boolean, if the road edge is broken as shown in fig. 3A, the intersection cannot be normally generated.
(2) The intersection curves are projected onto the same plane and are ordered clockwise (or counterclockwise) for each intersection endpoint, centered on the intersection point. Then, for every two adjacent intersection endpoints: and connecting the initial intersection end points, the road center points and the end road end points in sequence to obtain one Polyline, obtaining the other Polyline according to the width deviation of each intersection end point, smoothing, connecting the two polylines into a curved surface to obtain the result shown in fig. 2B, and obtaining the virtual intersection shown in fig. 2C after the operation of all the adjacent intersection end points is finished.
In this way, the input intersection curve and the output intersection geometry are required to be in the same plane, the generation of the three-dimensional intersection is not supported, the intersection curve is required to intersect at one point, namely the intersection point, flexibility is lost in actual operation, and the virtual intersection cannot be generated correctly due to the fact that two intersection points exist between the intersection curves, such as the intersection shown in fig. 3B.
In view of this, the embodiments of the present application provide a virtual intersection generating method, apparatus, electronic device, and storage medium, where at least two intersection curves corresponding to an intersection to be generated and at least two intersection curves are required to be obtained, and road curves where different intersection curves are located may not intersect or may be located in different planes, so that it is possible to support to generate a three-dimensional intersection, and the requirement on the input road curves is extremely low, and the virtual intersection generating method is applicable to generating intersections between most road curves; then, based on the curve intersection point of the intersection curve and the associated in-road curve, an intersection end point set of the intersection curve is obtained, intersection edge points are obtained by moving intersection end points, and based on intersection connecting lines among the intersection edge points, intersection areas are obtained and filled, so that the intersection to be generated is obtained. Based on the mode, the to-be-generated intersection can be generated only by acquiring the intersection curve and the road center curve, the intersection generation efficiency can be effectively improved, when the corresponding intersection curve and the road center curve are required to be modified, the editing efficiency of the intersection can be effectively improved, when the virtual intersection in a game is generated, the game on-line time is shortened, the uncertainty caused by the fact that the intersection is manufactured manually on the road quality is avoided, the effect stability of the generated intersection is improved, and the game quality is further improved.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it being understood that the preferred embodiments described herein are for illustration and explanation only, and are not intended to limit the present application, and embodiments and features of embodiments of the present application may be combined with each other without conflict.
Fig. 4 is a schematic view of an application scenario in an embodiment of the present application. The application scenario diagram includes two terminal devices 410 and a server 420.
In the embodiment of the application, the terminal equipment comprises, but is not limited to, mobile phones, tablet computers, notebook computers, desktop computers, electronic book readers, intelligent voice interaction equipment, intelligent home appliances, vehicle-mounted terminals and other equipment; the terminal device may be provided with a client related to virtual intersection generation, where the client may be software (for example, a browser, virtual intersection generation software, etc.), or may be a web page, an applet, etc., and the server may be a background server corresponding to the software or the web page, the applet, etc., or a server specifically used for virtual intersection generation, and the application is not limited specifically. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), basic cloud computing services such as big data and artificial intelligent platforms, and the like.
It should be noted that, the virtual intersection generating method in the embodiment of the present application may be executed by an electronic device, and the electronic device may be a server or a terminal device, that is, the method may be executed by the server or the terminal device alone or may be executed by both the server and the terminal device together. For example, when the server and the terminal equipment execute together, the terminal equipment acquires an intersection curve corresponding to an intersection to be generated and an in-road curve related to the intersection curve, and sends the intersection curve and the in-road curve to the server, the server obtains an intersection end point set based on curve intersections of the intersection curves and the related in-road curve respectively, moves each intersection end point in the intersection end point set according to a set direction of the road curve based on a road width corresponding to the road curve where the intersection end point set is located, acquires an intersection area based on intersection connecting lines among the obtained intersection edge points, fills the intersection area to obtain the intersection to be generated, and finally sends data of the intersection to be generated to the terminal equipment, and the terminal equipment displays the intersection to be generated.
In an alternative embodiment, the communication between the terminal device and the server may be via a communication network.
In an alternative embodiment, the communication network is a wired network or a wireless network.
It should be noted that, the number of terminal devices and servers shown in fig. 4 is merely illustrative, and the number of terminal devices and servers is not limited in practice, and is not specifically limited in the embodiments of the present application.
In the embodiment of the present application, when the number of servers is plural, plural servers may be configured as a blockchain, and the servers are nodes on the blockchain; the virtual intersection generating method disclosed by the embodiment of the application, wherein the related intersection curve data can be stored on a blockchain.
In addition, the embodiment of the application can be applied to various scenes, including not only virtual intersection generation scenes, but also cloud technology, artificial intelligence, intelligent traffic, auxiliary driving and other scenes. For example, when the embodiment of the application is applied to an auxiliary driving scene, the virtual intersection corresponding to the intersection existing in the real world can be generated by the virtual intersection generation method, and the user can obtain the feeling of being in the scene by displaying the virtual intersection for the user to navigate, so that the situation of open-circuit is reduced, the driving safety of the vehicle is improved, and the traffic accident rate is reduced.
The virtual intersection generating method provided in the exemplary embodiments of the present application will be described below with reference to the accompanying drawings in conjunction with the application scenario described above, and it should be noted that the application scenario described above is only shown for the convenience of understanding the spirit and principles of the present application, and embodiments of the present application are not limited in any way in this respect.
As shown in fig. 5, a flowchart of an implementation of a virtual intersection generating method according to an embodiment of the present application is taken as an example, and the specific implementation flow of the method includes the following steps S51-S54:
s51: the method comprises the steps that a server obtains at least two intersection curves corresponding to an intersection to be generated and road curves respectively associated with the at least two intersection curves;
the intersection curve and the associated road curve belong to the same road curve, the road curve associated with the intersection curve is a curve intersecting with the intersection curve on the road curve and does not contain other intersection curves, as shown in fig. 6A, on the road curve 1, the intersection 1 is to be generated to correspond to the intersection curve 1, the intersection 2 is to be generated to correspond to the intersection curve 2, the curve 3 can be respectively used as the road curve associated with the intersection curve 1 and the intersection curve 2, a point can be taken on the curve 3, the curve 3 is divided into the curve 4 and the curve 5, the curve 4 is used as the road curve associated with the intersection curve 1, and the curve 5 is used as the road curve associated with the intersection curve 2, so that different intersection curves are associated with different road curves.
The point of dividing the curve 3 into two on the curve 3 may be any point on the curve 3 except for the end points, and in the embodiment of the present application, the curve 3 is mainly described as being divided into two by taking the midpoint of the curve 3.
Each intersection curve can be associated with one in-road curve or can be associated with a plurality of in-road curves, as shown in fig. 6B, the intersection curve 1 is associated with two in-road curves, including an in-road curve 1a and an in-road curve 1B, and the intersection curve 3 is associated with only one in-road curve, which is an in-road curve 3a.
S52: the server obtains intersection end point sets corresponding to at least two intersection curves respectively based on curve intersection points of the at least two intersection curves and the associated road curves respectively;
the intersection end point set includes intersection end points for forming an intersection to be generated, the intersection end point set may include one or more intersection end points, still taking fig. 6B as an example, the intersection curve 1 is associated with two in-path curves, and each of the two in-path curves has a curve intersection point, so that the intersection end point set corresponding to the intersection curve 1 includes two intersection end points, the intersection curve 3 is associated with one in-path curve, and each of the two in-path curves has a curve intersection point, so that the intersection end point set corresponding to the intersection curve 3 includes one intersection end point.
S53: the server performs the following operations for at least two intersection endpoint sets: based on the road width corresponding to the road curve where one intersection endpoint set is located, moving each intersection endpoint in the intersection endpoint set according to the set direction of the road curve, and respectively obtaining two intersection edge points corresponding to each intersection endpoint;
specifically, the tangent vector (tangent) of the intersection endpoint is 1 meter in modular length, and points to the corresponding intersection curve along the corresponding in-path curve, then the setting direction of the road curve may be the direction of rotating the tangent vector 90 degrees clockwise along the up_direction of the intersection endpoint, and the direction of the right direction vector (right direction), and the opposite direction of the right direction, as shown in fig. 7A, for the intersection endpoint 1 on the intersection curve 1, the corresponding tangent points to the intersection curve 1 along the direction of the in-path curve 1, and the right direction is rotated 90 degrees clockwise for the tangent, and is perpendicular to the intersection endpoint 1.
In the embodiment of the present application, the setting direction of the road curve is mainly taken as the direction of the right_direction and the opposite direction of the right_direction as an example for explanation, and actually the setting direction of the road curve may be the direction in which the angle degree between the setting direction and the direction of the right_direction is within the preset angle range, and the direction in which the angle degree between the setting direction and the opposite direction of the right_direction is within the preset angle range, which is not limited specifically herein.
Two intersection edge points are obtained by moving one intersection end point, as shown in fig. 7B, the intersection end point set 1 comprises an intersection end point 1 and an intersection end point 2, and is located on a road curve 1, the road width is 4 meters, the intersection end point set 2 comprises an intersection end point 3, and is located on the road curve 2, the road width is 2 meters, the intersection end point 1 is moved 2 meters along the direction of the right_direction to obtain an intersection edge point 1, the intersection edge point 2 is moved 2 meters along the opposite direction of the right_direction, the intersection end point 2 is moved 2 meters along the direction of the right_direction to obtain an intersection edge point 3, and the intersection edge point 4 is obtained by moving 2 meters along the opposite direction of the right_direction. When the intersection end point is moved, the intersection end point may be moved by half the road width to obtain the intersection edge point, that is, the case shown by the intersection end point 1 and the intersection end point 2, but not limited thereto, and the distance that the intersection end point moves in the direction of right_direction and the opposite direction may be actually added to the road width, for example, the intersection end point 3 may be moved by 1.1 m in the direction of right_direction to obtain the intersection edge point 5, and moved by 0.9 m in the opposite direction of right_direction to obtain the intersection edge point 6.
S54: the server obtains an intersection area based on the obtained intersection connection lines among the intersection edge points, fills the intersection area and obtains the intersection to be generated.
Specifically, the intersection connecting line is obtained by connecting the edge points of the intersection, the area surrounded by the closed curve formed by each intersection connecting line is the intersection area, and the intersection curve can be a straight line, a curve and a broken line, which is not particularly limited. Filling, re-topology and smoothing are performed on the intersection area to obtain the intersection to be generated, and the specific algorithm is not limited in this step, as shown in fig. 7C, which is a schematic diagram of the intersection to be generated in the embodiment of the present application. For example, intersection edge points 1 and 2 in fig. 7B are connected to obtain an intersection line 1, intersection edge points 2 and 5 are connected to obtain an intersection line 2, intersection edge points 5 and 6 are connected to obtain an intersection line 3, intersection edge points 6 and 3 are connected to obtain an intersection line 4, intersection edge points 4 and 3 are connected to obtain an intersection line 5, intersection edge points 4 and 1 are connected to obtain an intersection line 6, intersection lines 1-6 form a closed curve, and the area enclosed by the closed curve is an intersection area.
In the embodiment of the application, as only at least two intersection curves corresponding to the intersection to be generated and the road curves in which the at least two intersection curves are respectively associated are required to be obtained, road curves in which different intersection curves are located can be disjointed or can be located in different planes, the three-dimensional intersection can be supported to be generated, the requirement on the input road curves is extremely low, and the method is applicable to the generation of the intersection to be generated among most road curves; then, based on the curve intersection point of the intersection curve and the associated in-road curve, an intersection end point set of the intersection curve is obtained, intersection edge points are obtained by moving intersection end points, and based on intersection connecting lines among the intersection edge points, intersection areas are obtained and filled, so that the intersection to be generated is obtained. Based on the mode, the to-be-generated intersection can be generated only by acquiring the intersection curve and the road center curve, the intersection generation efficiency can be effectively improved, when the corresponding intersection curve and the road center curve are required to be modified, the editing efficiency of the intersection can be effectively improved, when the virtual intersection in a game is generated, the game on-line time is shortened, the uncertainty caused by the fact that the intersection is manufactured manually on the road quality is avoided, the effect stability of the generated intersection is improved, and the game quality is further improved.
Alternatively, step S52 may be implemented as the following steps S521 to S523:
s521: respectively projecting each curve intersection point to a projection plane of an intersection to be generated to obtain each projection point;
s522: constructing a third polygon based on each projection point, wherein each projection point is a vertex of the third polygon or is positioned in the third polygon;
s523: when the projection points are determined to be the vertexes of the third polygon, the intersection points of the curves are respectively used as intersection end points contained in the intersection end point set corresponding to the corresponding intersection curve.
The projection plane is perpendicular to the road surface direction of the intersection to be generated, and the road surface direction may also be referred to as an average vertical direction (average_up_direction). A plane (project_plane) is set, which is perpendicular to the average_up_direction of the intersection to be generated, and the project_plane is recorded as the projection plane of the intersection to be generated.
And recording the position original_position of the three-dimensional space of all curve intersection points, then projecting the position original_position onto a projection plane of the intersection point to obtain each projection point, and solving a two-dimensional convex hull (contour hull) Polyline hull (third polygon) of all the projection points on the projection plane.
If each projection point is the vertex of the third polygon, each curve intersection point is directly taken as an intersection endpoint, all the intersection endpoints are connected in the sequence of the corresponding projection points in the third polygon, and the obtained third polygon is three-dimensional. As shown in fig. 8A, for the intersection end point 4, the intersection end point 5, the intersection end point 6, and the intersection end point 7, the third polygon is a three-dimensional figure in three-dimensional space, and is marked according to the order of the intersection end points in the third polygon, and any one of the intersection end points is marked as a starting point in sequence according to the clockwise order or the counterclockwise order, so that adjacent intersection end points are adjacent in sequence numbers and have a certain order.
And if the projection points which are not the vertexes of the third polygon exist in the projection points, extending the third polygon along the road surface direction and the opposite direction of the road surface direction to obtain a target geometrical body, and taking the intersection points of curves in the road where the intersection points of the curves corresponding to the projection points are positioned and the intersection points of the curves except the intersection points of the curves corresponding to the projection points as intersection end points included in the intersection end point set corresponding to the corresponding intersection curve.
Specifically, as shown in fig. 8B, the projection point 4 is not the vertex of the third polygon, the third polygon is infinitely extruded along the average_up_direction and the opposite direction thereof to obtain a target geometric body, the curve in the road where the projection point 4 is located is cut by using the target geometric body to obtain an intersection point 1, the intersection point 1 and the curve intersection points 0-3 are respectively used as intersection end points, and the positions in the third polygon are ordered, for example, the sequence number of the curve intersection point 0 is 0, the sequence number of the curve intersection point 1 is 1, the sequence number of the intersection point 1 is 2, the sequence number of the curve intersection point 2 is 3, and the sequence number of the curve intersection point 3 is 4. The third polygon here refers to a three-dimensional polygon obtained by connecting the curve intersections except the curve intersection corresponding to the projection point 4 in the order of the projection points, that is, a polygon obtained by connecting the curve intersection 0, the curve intersection 1, the curve intersection 2 and the curve intersection 3 in the order of the projection points.
Based on the mode, the rationality of the intersection area determined based on each curve end point is ensured by limiting each curve end point to be the point on the third polygon, and the intersection to be generated can be correctly generated when no intersection exists between intersection curves corresponding to the intersection to be generated or no intersection exists between part of intersection curves and other intersection curves.
The intersection connecting lines between the intersection edge points can be divided into a first type connecting line and a second type connecting line, wherein the two intersection edge points connected by the first type connecting line correspond to different intersection end points, the two intersection edge points are adjacent to each other on the first polygon, and the two intersection edge points connected by the second type connecting line correspond to the same intersection end point.
In which, each vertex of the first polygon is an edge point of each intersection, and still taking fig. 7B as an example, the intersection line 2, the intersection line 4, and the intersection line 6 are first type lines, and the intersection line 1, the intersection line 3, and the intersection line 5 are second type lines.
The first type of connection is obtained by the following steps S61-S62:
s61: connecting two intersection edge points corresponding to the first type of connecting line to obtain an initial connecting line;
s62: and adjusting the shape of the initial connecting line based on the control points on the tangent line of the corresponding intersection end points of the two intersection edge points, and obtaining the connecting line of the first type.
Taking the intersection end point 4 and the intersection end point 5 in fig. 8A as an example, the intersection end point 4 is moved to obtain an intersection edge point 7 and an intersection edge point 8, the intersection end point 5 is moved to obtain an intersection edge point 9 and an intersection edge point 10, and taking two intersection edge points in step S61 as the intersection edge point 8 and the intersection edge point 9 as examples, as shown in fig. 9A, the intersection edge point 8 and the intersection edge point 9 are connected to obtain an initial connection line 1, a tangent line where the control point 1 is located and a road curve where the intersection end point 4 is located are tangent at the corresponding intersection end points, that is, the control point 1 is located on a tangent vector of the intersection end point 4, and the control point 2 is located on a tangent vector of the intersection end point 5.
In order to enhance the effect of the first type of connection, a Bezier curve (cube Bezier) may be constructed by using the intersection edge point 8, the intersection edge point 9, the control point 1 and the control point 2, and the intersection edge point 8 is designated as the start point of the Bezier curve, and the intersection edge point 9 is designated as the end point of the Bezier curve.
After the first type of connection line and the second type of connection line are constructed based on the above manner, as shown in fig. 9B, a schematic diagram of another intersection area in the embodiment of the present application is shown, where the curve portions are all the first type of connection line, and the straight portions are all the second type of connection line.
Alternatively, step S62 may be implemented as:
moving rays determined based on the intersection starting end point according to the set direction of the tangent line of the intersection starting end point based on the road width corresponding to the intersection starting end point to obtain starting point rays, and moving rays determined based on the intersection ending end point according to the set direction of the tangent line of the intersection ending end point based on the road width corresponding to the intersection ending end point to obtain ending point rays; respectively projecting a starting point ray and an end point ray to a projection plane of an intersection to be generated to obtain a starting point projection line and an end point projection line; and taking a projection intersection point between the starting point projection line and the end point projection line, taking a corresponding point on the starting point ray as a transition starting point, taking a corresponding point on the end point ray as a transition end point, and obtaining a first type connecting line based on the edge starting point, the transition end point and the edge end point.
Specifically, the two intersection edge points in step S62 are respectively referred to as an edge start point and an edge end point, the edge start point corresponds to an intersection start end point, and the edge end point corresponds to an intersection end point. For example, the intersection edge point 8 is an edge start point, the intersection edge point 9 is referred to as an edge end point, the intersection end point 4 is an intersection start end point, and the intersection end point 5 is an intersection end point. Based on a ray 1 determined by an intersection endpoint 4, taking the intersection endpoint 4 as an endpoint and passing through a control point 1, based on a ray 2 determined by an intersection endpoint 5, taking an intersection endpoint 5 as an endpoint and passing through the control point 2, setting the tangential setting direction of the intersection endpoint 4 as the direction of the rig_direction, moving half of the road width along the rig_direction of the intersection endpoint 4 to obtain a start ray (start_ray), moving half of the road width along the rig_direction of the intersection endpoint 5 to obtain an end ray (end_ray), setting the intersection point position as a projection intersection point if the projection of the start projection line and the end projection line on the projection plane intersect, moving the control point 1 to the projection position of the projection intersection point on the start ray to obtain a transition starting point, and moving the control point 2 to the projection position of the projection intersection point on the end ray to obtain a transition end point.
Optionally, the positions of the transition start point and the transition end point may be adjusted based on the edge start point and the edge end point, so as to obtain an adjusted transition start point and an adjusted transition end point, and then the first type connection line is obtained based on the edge start point, the adjusted transition end point and the edge end point.
The distance between the edge starting point and the adjusted transition starting point, the distance between the adjusted transition starting point and the adjusted transition ending point, and the distance between the adjusted transition ending point and the transition ending point are equal, so that the obtained first type curve is smoother. The dot product of the tangent line between the adjusted transition starting point and the edge starting point is greater than a preset threshold, the dot product of the tangent line between the adjusted transition ending point and the edge ending point is greater than the preset threshold, the preset threshold is close to 1, for example, 0.999, the dot product is not particularly limited herein, and the adjusted transition starting point can be ensured to be still positioned on the tangent line of the intersection starting point or to be relatively close to the intersection ending point by limiting the dot product to be greater than the preset threshold.
Based on the mode, the positions of the transition starting point and the transition ending point are adjusted, so that the obtained first type connecting line is smoother, and the quality of the constructed intersection to be generated is improved.
Taking a Polyline obtained by sequentially connecting an edge starting point, a transition ending point and an edge ending point as Polyline, and taking two points of point1 and point2 on the Polyline, so that the distances from the edge starting point (start_point) to the point1, from the point1 to the point2 and from the point2 to the edge ending point (end_point) are equal. And assuming that the unit vector from the start_point to the point1 is the start_point ', the dot product of the start_point and the start_point' is greater than 0.999, moving the start_point to the position of the point1, assuming that the unit vector from the end_point to the point2 is the end_point ', the dot product of the end_point and the end_point' is greater than 0.999, and moving the end_point to the position of the point 2. In order to improve the effect of the first type of curve, the above steps can be repeated for a plurality of times to adjust the positions of the transition starting point and the transition ending point.
Optionally, the positions of the control start point corresponding to the intersection start point and the control end point corresponding to the intersection end point can be adjusted based on the intersection start point and the intersection end point to obtain an adjusted control start point and an adjusted control end point, and then the shape of the initial connecting line is adjusted based on the adjusted control start point and the adjusted control end point to obtain the first type connecting line.
Specifically, the distance between the intersection starting point and the adjusted control starting point, the distance between the adjusted control starting point and the adjusted control ending point, and the distance between the adjusted control ending point and the intersection ending point are equal, the dot product of the connecting line of the adjusted control starting point and the intersection starting point and the tangent line of the intersection starting point is larger than a preset threshold, and the dot product of the connecting line of the adjusted control ending point and the intersection ending point and the tangent line of the intersection ending point is larger than the preset threshold. With specific reference to the foregoing embodiments, details are not described herein.
After the adjusted control starting point and the adjusted control end point are obtained, a Bezier curve is constructed by using two intersection edge points forming an initial connecting line, the adjusted control starting point and the adjusted control end point as control points, and the Bezier curve is used as a first type connecting line, wherein the two intersection edge points forming the initial connecting line are designated as a starting point and an end point respectively.
In a specific implementation, the positions of the control start point and the control end point can be adjusted first, and then the adjusted control start point is over-adjusted based on the rays determined by the intersection start end point, and the adjusted control end point is over-adjusted based on the rays determined by the intersection end point.
The following is performed for each line segment in the hull formed by the connection between the intersection endpoints:
(1) Creating a point start_point and an end_point (control end point) at each point start_point and end_point corresponding to each point start_point and end_point, creating a new Polyline road_connection_polyline, and enabling the Polyline to be sequentially connected with the start_point, the end_point and the end_point. As shown in fig. 10A, there are four segments in the whole, each of which generates a corresponding Polyline, each Polyline passes through the start point and the end point of the corresponding Polyline, and controls the start point and the control terminal, the segment 1 corresponds to Polyline1, the segment 2 corresponds to Polyline2, the segment 3 corresponds to Polyline3, and the segment 4 corresponds to Polyline4.
(2) For all the road_connection_polylines, the following steps are repeated for a plurality of times (5-10 times are recommended):
1) Taking two points of point1 and point2 on the Polyline, so that the distances from start_point to point1, from point1 to point2 and from point2 to end_point are equal;
2) Let the unit vector from start_point to point1 be start_point'. If the dot product of start_point and start_point' is greater than 0.999, then moving start_point to the position of point1, and if point1 is located on the rectangular side where the starting point is located, then taking point1 as the starting point;
3) Let the unit vector from end_point to point2 be end_point'. If the dot product of end_point 'and end_point' is greater than 0.999, then end_point is moved to the position of point 2.
After the above operations are performed on all the road_connection_polylines, the result shown in fig. 10B is obtained.
(3) The following steps are performed for each head_connection_polyline in fig. 10B:
1) Letting the start_agent_point inherit the up_direction and the right width of the start_point;
2) Make end_instant_point inherit up_direction and left width left_width of end_point
3) A cube Bezier curve is established, so that the curve is a Bezier curve taking four vertexes of a road_connection_polyline as control points, a start_point is a starting point of the Bezier curve, an end_point is an end point, and the Bezier curve is marked as the road_connection_spline.
After the above operation is performed for each road_connection_poly in fig. 10B, 4 bezier curves are obtained, and as shown in fig. 10C, the bezier curves in fig. 10C may be used to divide the intersection region into a plurality of sections. Filling, re-topology and smoothing the intersection area in fig. 10C, and the resulting intersection to be generated is shown in fig. 11.
Optionally, in step S62, the control point on the tangent line of the intersection endpoint corresponding to one intersection edge point is obtained by:
acquiring a target projection tangent corresponding to an intersection edge point, and intersecting points of the target projection tangent and projection tangents except the target projection tangent in the projection tangents and intersecting points of the target projection tangent and reference edges in each edge of the second polygon; and obtaining a control point corresponding to the intersection edge point based on the distance between each intersection point and the target projection point.
The projection tangent lines are the projections of the tangent lines of the end points of each intersection on the projection plane of the intersection to be generated, and the edge points of the intersection are the projections of the corresponding target projection tangent lines of the end points of the corresponding intersection on the projection plane. Each vertex of the second polygon is the projection of each intersection endpoint on the projection plane, and the reference edge is: each side is an edge except for an intersection end point corresponding to an intersection edge point and the projection of the intersection end point on the projection plane; the target projection point is the projection of the target intersection endpoint on the target projection tangent line. As shown in fig. 9C, the intersection point of the projected tangent line of the target and the projected tangent line 1 is the intersection point 1, the intersection point of the projected tangent line 3 and the reference edge 1 is the intersection point 2, and the intersection point of the projected tangent line and the reference edge 1 is the intersection point 3, so that the distances 1, 2, 3 between the intersection points 1, 2, 3 and the projected point of the target are obtained, and the control point is determined from the intersection points 1-3.
If the smallest distance in the distances belongs to a preset distance interval, the intersection point corresponding to the smallest distance is used as a control point corresponding to an intersection edge point, wherein the point corresponds to a tangent line of the target intersection end point. Namely, the point corresponding to the tangent line of the end point of the target intersection is projected to the intersection point corresponding to the minimum distance after the projection plane.
If the smallest distance in the distances does not belong to the preset distance interval, the following two conditions can be classified:
(1) If the minimum distance is smaller than the left interval endpoint value of the preset distance interval, the point on the target projection tangent line, where the distance between the intersection endpoints corresponding to one intersection edge point is the left interval endpoint value, is the point corresponding to the tangent line of the target intersection endpoint, and is used as the control point corresponding to one intersection edge point;
(2) If the minimum distance is greater than the right interval endpoint value of the preset distance interval, the point on the target projection tangent line, where the distance between the intersection endpoints corresponding to one intersection edge point is the right interval endpoint value, is the point corresponding to the tangent line of the target intersection endpoint, and is used as the control point corresponding to one intersection edge point.
For example, the preset distance interval is 1 m-2 m, the end point value of the left interval is 1 m, the end point value of the right interval is 2 m, the intersection point 1 corresponds to the distance 1, if 1 m is less than the distance 1 and less than 2 m, the intersection point 1 is taken as a control point, if the distance 1 is less than or equal to 1 m, the target projection point is moved by 1 m along the direction of the target projection tangent line, the point on the tangent line of the target intersection end point corresponding to the point X is taken as the control point, if the distance 1 is more than or equal to 2 m, the target projection point is moved by 2 m along the direction of the target projection tangent line, and the point on the tangent line of the target intersection end point corresponding to the point X1 is taken as the control point.
Based on the mode, the distance between the control point and the intersection endpoint is limited, so that the situation that the distance between the control point and the intersection endpoint is too short or too long is avoided, and the shape of the first type curve constructed based on the control point is more reasonable.
For another example, for each intersection endpoint point and its corresponding ray (tangent line), let the projection of the ray on the project_plane intersect with the projections of the ray on the project_plane of other intersection endpoints, if there is an intersection point, the intersection point position is put into the geometric intersection_positions, let the projection of the ray on the project_plane intersect with the projections of all the line segments not taking the point as endpoints on the project_plane, if there is an intersection point, the intersection point position is put into the geometric intersection_positions as each acquired intersection point. If the points are not empty, taking the element of the points closest to the projection distance of the points on the project-plane in the points, and marking the projection position of the points on the ray as the point-position;
if the intersectional_positions are empty or the distance from the point position to the point position is smaller than the specified length min_point_length (the end value of the left interval), the point is moved along the direction of the point by the specified length min_point_length and the point position is marked as the point position, if no target point exists or the distance between the target point and the projection point is smaller than the preset threshold, the point on the projection line, which is far from the projection point by the preset threshold, is taken as the target point
If the distance from the point position to the point position is greater than the specified length max_point_length (right-hand section end point value), the point is moved in the point direction by the specified length max_point_length and the position is referred to as the point position. Wherein, the max_agent_length is required to be larger than the min_agent_length.
Based on the above manner, after the calculation of flattening to the projection plane for intersection is performed in the present application, the obtained intersection point is projected to a correct position in the three-dimensional space, so that the generated intersection or the input intersection curve is not required to be located on the same plane, and the generation of the three-dimensional intersection can be supported, as shown in fig. 12A, which is a schematic diagram of the intersection to be generated in the embodiment of the present application. And the Boolean operation is not needed, the performance is good, the instability caused by calculation errors is avoided, and the full-automatic algorithm is adopted, so that the labor cost is greatly saved, and the efficiency is improved. The intersection geometry is generated independently of the shape of the intersection curve, so that the influence of the damage of the road edge line on the generation result is avoided, and as shown in fig. 12B, when the road edge line is damaged, the complete intersection can still be generated.
As shown in fig. 13, a logic schematic diagram of a virtual intersection generating method in the embodiment of the present application is shown, where an intersection is to be generated, corresponding to an intersection curve 10 and an intersection curve 20, where the intersection curve 10 associates an in-road curve 10 with an in-road curve 11, intersects the intersection curve 10 with the intersection endpoint 11, where the intersection curve 20 associates the in-road curve 20 with the in-road curve 21, intersects the intersection endpoint 20 with the intersection endpoint 21, respectively moves the intersection endpoint 10 and the intersection endpoint 11 according to the set direction of the located road curve, obtains an intersection edge point 01, an intersection edge point 02, an intersection edge point 05, and an intersection edge point 06, respectively moves the intersection endpoint 20 and the intersection endpoint 21 according to the set direction of the located road curve, four second-type curves are obtained by connecting the intersection edge point 01 with the intersection edge point 02, connecting the intersection edge point 03 with the intersection edge point 04, connecting the intersection edge point 05 with the intersection edge point 06, connecting the intersection edge point 07 with the intersection edge point 08, and obtaining four second-type curves by respectively taking the intersection edge point 02 with the intersection edge point 03, the intersection edge point 04 with the intersection edge point 05, the intersection edge point 06 with the intersection edge point 07, and connecting the intersection edge point 08 with the intersection edge point 01 as starting points and ending points, and constructing 4 Bezier curves which are first-type curves, wherein the area surrounded by the 4 second-type curves and the first-type curves is an intersection area, and filling the intersection area to obtain the intersection to be generated.
Based on the same inventive concept, the embodiment of the application also provides a virtual intersection generating device. As shown in fig. 14, which is a schematic structural diagram of the virtual intersection generating device 1400, may include:
an obtaining unit 1401, configured to obtain at least two intersection curves corresponding to an intersection to be generated, and an in-road curve associated with each of the at least two intersection curves, where the intersection curves and the associated in-road curves belong to the same road curve;
a composition unit 1402, configured to obtain, based on curve intersections of at least two intersection curves and associated curves in the road, respectively, intersection end point sets corresponding to the at least two intersection curves, where the intersection end points are used to compose an intersection to be generated;
a moving unit 1403 for performing the following operations for at least two intersection endpoint sets, respectively: based on the road width corresponding to the road curve where one intersection endpoint set is located, moving each intersection endpoint in the intersection endpoint set according to the set direction of the road curve, and respectively obtaining two intersection edge points corresponding to each intersection endpoint;
and a connection unit 1404, configured to obtain an intersection region based on the obtained intersection connection between the edge points of each intersection, and fill the intersection region to obtain the intersection to be generated.
Optionally, the intersection connecting line is a first type connecting line, two intersection edge points connected by the first type connecting line correspond to different intersection end points, the two intersection edge points are adjacent to each other on the first polygon, and each vertex of the first polygon is each intersection edge point;
the connection unit 1404 is specifically configured to:
connecting two intersection edge points corresponding to the first type of connecting line to obtain an initial connecting line;
based on control points on tangent lines of corresponding intersection endpoints of two intersection edge points, the shape of an initial connecting line is adjusted, and a first type connecting line is obtained, wherein a tangent line where each control point is located is tangent to a road curve where the corresponding intersection endpoint is located, and the tangent line is tangent to the corresponding intersection endpoint.
Optionally, the two intersection edge points are an edge starting point and an edge ending point respectively, the edge starting point corresponds to an intersection starting end point, and the edge ending point corresponds to an intersection ending end point;
the connection unit 1404 is specifically configured to:
moving rays determined based on the intersection starting end point according to the set direction of the tangent line of the intersection starting end point based on the road width corresponding to the intersection starting end point to obtain starting point rays, and moving rays determined based on the intersection ending end point according to the set direction of the tangent line of the intersection ending end point based on the road width corresponding to the intersection ending end point to obtain ending point rays;
Respectively projecting a starting point ray and an end point ray to a projection plane of an intersection to be generated to obtain a starting point projection line and an end point projection line, wherein the projection plane is perpendicular to the road surface direction of the intersection to be generated;
and taking a projection intersection point between the starting point projection line and the end point projection line, taking a corresponding point on the starting point ray as a transition starting point, taking a corresponding point on the end point ray as a transition end point, and obtaining a first type connecting line based on the edge starting point, the transition end point and the edge end point.
Optionally, the two intersection edge points include an edge starting point and an edge ending point, the edge starting point corresponds to an intersection starting point, and the edge ending point corresponds to an intersection ending point; the connection unit 1404 is also for:
based on the intersection starting point and the intersection ending point, adjusting the positions of the control starting point corresponding to the intersection starting point and the control ending point corresponding to the intersection ending point to obtain an adjusted control starting point and an adjusted control ending point;
the shape of the initial connecting line is adjusted based on the control points on the tangent line of the corresponding intersection end points of the two intersection edge points, so as to obtain a first type connecting line, which comprises the following steps:
and adjusting the shape of the initial connecting line based on the adjusted control starting point and the adjusted control ending point to obtain the connecting line of the first type.
Optionally, the distance between the intersection starting point and the adjusted control starting point, the distance between the adjusted control starting point and the adjusted control ending point, and the distance between the adjusted control ending point and the intersection ending point are equal;
the dot product of the adjusted connection line of the control starting point and the intersection starting point and the tangent line of the intersection starting point is larger than a preset threshold value, and the dot product of the adjusted connection line of the control ending point and the intersection ending point and the tangent line of the intersection ending point is larger than the preset threshold value.
Optionally, the connection unit 1404 is further configured to:
based on the edge starting point and the edge ending point, the positions of the transition starting point and the transition ending point are adjusted to obtain an adjusted transition starting point and an adjusted transition ending point, wherein,
the distance between the edge starting point and the adjusted transition starting point, the distance between the adjusted transition starting point and the adjusted transition ending point, and the distance between the adjusted transition ending point and the transition ending point are equal; the dot product of the adjusted connecting line of the transition starting point and the edge starting point and the tangent line of the edge starting point is larger than a preset threshold value, and the dot product of the adjusted connecting line of the transition ending point and the edge ending point and the tangent line of the edge ending point is larger than the preset threshold value;
Then a first type of link is obtained based on the edge start point, the transition end point, and the edge end point, including:
and obtaining the first type connecting line based on the edge starting point, the adjusted transition ending point and the edge ending point.
Optionally, the connection unit 1404 is further configured to:
for two intersection edge points, the following operations are respectively executed:
acquiring a target projection tangent corresponding to an intersection edge point, and intersecting points of the target projection tangent and projection tangents except the target projection tangent in the projection tangents and intersecting points of the target projection tangent and reference edges in each edge of the second polygon; the projection tangent lines are the projections of the tangent lines of the endpoints of each intersection on the projection plane of the intersection to be generated, the projection plane is perpendicular to the road surface direction of the intersection to be generated, the vertexes of the second polygon are the projections of the endpoints of each intersection on the projection plane, and the reference edges are as follows: in each side, the target intersection endpoint is an intersection endpoint corresponding to an intersection edge point except for the side where the projection of the target intersection endpoint on the projection plane is located;
and obtaining a control point corresponding to the intersection edge point based on the distance between each intersection point and the target projection point, wherein the target projection point is the projection of the target intersection end point on the target projection tangent line.
Optionally, the connection unit 1404 is specifically configured to:
when the minimum distance in the distances belongs to a preset distance interval, the intersection point corresponding to the minimum distance is determined to be a point corresponding to a tangent line of the end point of the target intersection, and the point is used as a control point corresponding to the edge point of the intersection.
Optionally, the connection unit 1404 is further configured to:
when the minimum distance in the distances does not belong to the preset distance interval, if the minimum distance is smaller than the left interval endpoint value of the preset distance interval, the point on the target projection tangent line, where the distance between the intersection endpoints corresponding to one intersection edge point is the left interval endpoint value, is the corresponding point on the tangent line of the target intersection endpoint and is used as the corresponding control point of one intersection edge point;
if the minimum distance is greater than the right interval endpoint value of the preset distance interval, the point on the target projection tangent line, where the distance between the intersection endpoints corresponding to one intersection edge point is the right interval endpoint value, is taken as the intersection endpoint control point corresponding to one intersection edge point.
Optionally, the intersection connection line is a second type connection line, and two intersection edge points connected by the second type connection line correspond to the same intersection endpoint.
Optionally, the component unit 1402 is specifically configured to:
respectively projecting each curve intersection point to a projection plane of the intersection to be generated to obtain each projection point, wherein the projection plane is perpendicular to the road surface direction of the intersection to be generated;
constructing a third polygon based on each projection point, wherein each projection point is a vertex of the third polygon or is positioned in the third polygon;
when the projection points are determined to be the vertexes of the third polygon, the intersection points of the curves are respectively used as intersection end points contained in the intersection end point set corresponding to the corresponding intersection curve.
Optionally, the composition unit 1402 is further configured to:
when the projection points which are not the vertexes of the third polygon exist in the projection points, the third polygon is extended along the road surface direction and the opposite direction of the road surface direction, and a target geometrical body is obtained;
and respectively taking the intersection points of the curves in the road where the intersection points of the target geometry and the curves corresponding to the projection points are located and the intersection points of the curves except the intersection points of the curves corresponding to the projection points in the intersection points of the curves as intersection points contained in the intersection point sets corresponding to the corresponding intersection curves.
For convenience of description, the above parts are described as being functionally divided into modules (or units) respectively. Of course, the functions of each module (or unit) may be implemented in the same piece or pieces of software or hardware when implementing the present application.
Those skilled in the art will appreciate that the various aspects of the present application may be implemented as a system, method, or program product. Accordingly, aspects of the present application may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
The embodiment of the application also provides electronic equipment based on the same inventive concept as the embodiment of the method. In one embodiment, the electronic device may be a server, such as the server shown in FIG. 4. In this embodiment, the structure of the electronic device may include a memory 1501, a communication module 1503, and one or more processors 1502 as shown in fig. 15.
A memory 1501 for storing computer programs executed by the processor 1502. The memory 1501 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, a program required for running an instant communication function, and the like; the storage data area can store various instant messaging information, operation instruction sets and the like.
The memory 1501 may be a volatile memory (RAM) such as a random-access memory (RAM); the memory 1501 may also be a nonvolatile memory (non-volatile memory), such as a read-only memory, a flash memory (flash memory), a hard disk (HDD) or a Solid State Drive (SSD); or memory 1501, is any other medium capable of carrying or storing a desired computer program in the form of instructions or data structures and capable of being accessed by a computer, but is not limited thereto. The memory 1501 may be a combination of the above memories.
The processor 1502 may include one or more central processing units (central processing unit, CPU) or digital processing units, or the like. A processor 1502 for implementing the virtual intersection generation method described above when calling a computer program stored in the memory 1501.
The communication module 1503 is used for communicating with the terminal device and other servers.
The specific connection medium between the memory 1501, the communication module 1503, and the processor 1502 is not limited in the embodiments of the present application. In the embodiment of the present application, the memory 1501 and the processor 1502 are connected by the bus 1504 in fig. 15, and the bus 1504 is depicted in a bold line in fig. 15, and the connection manner between other components is only schematically illustrated, but not limited to. The bus 1504 may be divided into an address bus, a data bus, a control bus, and the like. For ease of description, only one thick line is depicted in fig. 15, but only one bus or one type of bus is not depicted.
The memory 1501 stores therein a computer storage medium in which computer executable instructions for implementing the virtual intersection generation method of the embodiment of the present application are stored. The processor 1502 is configured to perform the virtual intersection generation method described above, as shown in fig. 5.
In another embodiment, the electronic device may also be other electronic devices, such as the terminal device shown in fig. 4. In this embodiment, the structure of the electronic device may include, as shown in fig. 16: communication component 1610, memory 1620, display unit 1630, camera 1640, sensor 1650, audio circuitry 1660, bluetooth module 1670, processor 1680, and the like.
The communication component 1610 is for communicating with a server. In some embodiments, a circuit wireless fidelity (Wireless Fidelity, wiFi) module may be included, where the WiFi module belongs to a short-range wireless transmission technology, and the electronic device may help the user to send and receive information through the WiFi module.
Memory 1620 may be used to store software programs and data. The processor 1680 performs various functions of the terminal device and data processing by executing software programs or data stored in the memory 1620. The memory 1620 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. The memory 1620 stores an operating system that enables the terminal device to operate. The memory 1620 in the present application may store an operating system and various application programs, and may also store a computer program for executing the virtual intersection generation method according to the embodiment of the present application.
The display unit 1630 may also be used to display information input by a user or information provided to the user and a graphical user interface (graphical user interface, GUI) of various menus of the terminal device. Specifically, the display unit 1630 may include a display screen 1632 disposed on the front surface of the terminal device. The display 1632 may be configured in the form of a liquid crystal display, light emitting diodes, or the like. The display unit 1630 may be used to display a virtual intersection generation user interface or the like in the embodiment of the present application.
The display unit 1630 may also be used to receive input numeric or character information, generate signal inputs related to user settings and function control of the terminal device, and in particular, the display unit 1630 may include a touch screen 1631 disposed on the front of the terminal device, and may collect touch operations on or near the user, such as clicking buttons, dragging scroll boxes, and the like.
The touch screen 1631 may cover the display screen 1632, or the touch screen 1631 may be integrated with the display screen 1632 to implement input and output functions of the terminal device, and after integration, the touch screen may be abbreviated as touch screen. The display unit 1630 may display application programs and corresponding operation steps.
The camera 1640 may be used to capture still images, and a user may post comments on the image captured by the camera 1640 through an application. The camera 1640 may be one or a plurality of cameras. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive elements convert the optical signals to electrical signals, which are then passed to the processor 1680 for conversion to digital image signals.
The terminal device may further include at least one sensor 1650, such as an acceleration sensor 1651, a distance sensor 1652, a fingerprint sensor 1653, a temperature sensor 1654. The terminal device may also be configured with other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, light sensors, motion sensors, and the like.
Audio circuitry 1660, speakers 1661, and microphone 1662 may provide an audio interface between the user and the terminal device. The audio circuit 1660 may transmit the received electrical signal converted from audio data to the speaker 1661, and convert the electrical signal into an audio signal by the speaker 1661 to be output. The terminal device may also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 1662 converts the collected sound signals into electrical signals, which are received by the audio circuit 1660 and converted into audio data, which are output to the communication component 1610 for transmission to, for example, another terminal device, or to the memory 1620 for further processing.
The bluetooth module 1670 is used to exchange information with other bluetooth devices having bluetooth modules through bluetooth protocols. For example, the terminal device may establish a bluetooth connection with a wearable electronic device (e.g., a smart watch) that also has a bluetooth module through bluetooth module 1670, thereby performing data interaction.
The processor 1680 is a control center of the terminal device, connects various parts of the entire terminal using various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs stored in the memory 1620 and calling data stored in the memory 1620. In some embodiments, the processor 1680 may include one or more processing units; the processor 1680 may also integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., and a baseband processor that primarily handles wireless communications. It will be appreciated that the baseband processor described above may not be integrated into the processor 1680. The processor 1680 in the present application may run an operating system, an application program, a user interface display, and a touch response, and a virtual intersection generation method according to an embodiment of the present application. In addition, a processor 1680 is coupled to the display unit 1630.
In some possible embodiments, various aspects of the virtual intersection creating method provided herein may also be implemented in the form of a program product comprising a computer program for causing an electronic device to perform the steps in the virtual intersection creating method according to various exemplary embodiments of the present application described herein above when the program product is run on the electronic device, for example, the electronic device may perform the steps as shown in fig. 5.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product of embodiments of the present application may employ a portable compact disc read only memory (CD-ROM) and comprise a computer program and may be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with a command execution system, apparatus, or device.
The readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave in which a readable computer program is embodied. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with a command execution system, apparatus, or device.
A computer program embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer programs for performing the operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer program may execute entirely on the consumer electronic device, partly on the consumer electronic device, as a stand-alone software package, partly on the consumer electronic device and partly on a remote electronic device or entirely on the remote electronic device or server. In the case of remote electronic devices, the remote electronic device may be connected to the consumer electronic device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external electronic device (e.g., connected through the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. Indeed, the features and functions of two or more of the elements described above may be embodied in one element in accordance with embodiments of the present application. Conversely, the features and functions of one unit described above may be further divided into a plurality of units to be embodied.
Furthermore, although the operations of the methods of the present application are depicted in the drawings in a particular order, this is not required to or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having a computer-usable computer program embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program commands may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the commands executed by the processor of the computer or other programmable data processing apparatus produce means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program commands may also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the commands stored in the computer readable memory produce an article of manufacture including command means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (16)

1. A method of virtual intersection generation, the method comprising:
acquiring at least two intersection curves corresponding to an intersection to be generated and road curves respectively associated with the at least two intersection curves, wherein the intersection curves and the associated road curves belong to the same road curve;
based on curve intersection points of the at least two intersection curves and the associated road curves, respectively obtaining intersection end point sets corresponding to the at least two intersection curves, wherein the intersection end points are used for forming the intersection to be generated;
for the at least two intersection endpoint sets, respectively executing the following operations: based on the road width corresponding to a road curve in which one intersection endpoint set is positioned, moving each intersection endpoint in the one intersection endpoint set according to the set direction of the road curve, and respectively obtaining two intersection edge points corresponding to each intersection endpoint;
And obtaining an intersection region based on the obtained intersection connection line between the intersection edge points, and filling the intersection region to obtain the intersection to be generated.
2. The method of claim 1, wherein the intersection connection is a first type connection, two intersection edge points connected by the first type connection correspond to different intersection end points, and the two intersection edge points are adjacent to each other on a first polygon, and each vertex of the first polygon is each intersection edge point;
the first type of connection is obtained by:
connecting two intersection edge points corresponding to the first type of connecting line to obtain an initial connecting line;
and adjusting the shape of the initial connecting line based on control points on the tangent lines of the corresponding intersection endpoints of the two intersection edge points to obtain the first type connecting line, wherein the tangent line of each control point is tangent to the road curve of the corresponding intersection endpoint at the corresponding intersection endpoint.
3. The method of claim 2, wherein the two intersection edge points are an edge start point and an edge end point, respectively, the edge start point corresponding to an intersection start endpoint and the edge end point corresponding to an intersection end endpoint;
The adjusting the shape of the initial connecting line based on the control points on the tangent line of the intersection end points corresponding to the two intersection edge points respectively, to obtain the connecting line of the first type, includes:
moving rays determined based on the intersection starting end point according to the setting direction of the tangent line of the intersection starting end point based on the road width corresponding to the intersection starting end point to obtain starting point rays, and moving rays determined based on the intersection terminal end point according to the setting direction of the tangent line of the intersection terminal end point based on the road width corresponding to the intersection terminal end point to obtain terminal point rays;
respectively projecting the starting point rays and the end point rays to a projection plane of the intersection to be generated to obtain a starting point projection line and an end point projection line, wherein the projection plane is perpendicular to the road surface direction of the intersection to be generated;
and taking a point corresponding to the starting point ray as a transition starting point, a point corresponding to the ending point ray as a transition ending point, and obtaining the first type connecting line based on the edge starting point, the transition ending point and the edge ending point.
4. The method of claim 2, wherein the two intersection edge points comprise an edge starting point and an edge ending point, the edge starting point corresponding to an intersection starting point and the edge ending point corresponding to an intersection ending point; the method further comprises:
based on the intersection starting point and the intersection ending point, adjusting the positions of a control starting point corresponding to the intersection starting point and a control ending point corresponding to the intersection ending point to obtain an adjusted control starting point and an adjusted control ending point;
the adjusting the shape of the initial connecting line based on the control points on the tangent line of the intersection end points corresponding to the two intersection edge points respectively, to obtain the connecting line of the first type, includes:
and adjusting the shape of the initial connecting line based on the adjusted control starting point and the adjusted control ending point to obtain the first type connecting line.
5. The method of claim 4, wherein a distance between the intersection starting point and the adjusted control starting point, a distance between the adjusted control starting point and the adjusted control ending point, and a distance between the adjusted control ending point and the intersection ending point are equal;
And the dot product of the line connecting the adjusted control start point and the intersection start end point with the tangent line of the intersection start end point is larger than a preset threshold value, and the dot product of the line connecting the adjusted control end point and the intersection end point with the tangent line of the intersection end point is larger than the preset threshold value.
6. The method of claim 3, further comprising, prior to said obtaining said first type of link based on said edge start point, said transition end point, and said edge end point:
based on the edge starting point and the edge ending point, the positions of the transition starting point and the transition ending point are adjusted to obtain an adjusted transition starting point and an adjusted transition ending point, wherein,
the distance between the edge starting point and the adjusted transition starting point, the distance between the adjusted transition starting point and the adjusted transition ending point, and the distance between the adjusted transition ending point and the transition ending point are equal; the dot product of the line connecting the adjusted transition starting point and the edge starting point with the tangent of the edge starting point is larger than a preset threshold, and the dot product of the line connecting the adjusted transition ending point and the edge ending point with the tangent of the edge ending point is larger than the preset threshold;
The obtaining the first type of connection line based on the edge starting point, the transition ending point, and the edge ending point includes:
and obtaining the first type connecting line based on the edge starting point, the adjusted transition ending point and the edge ending point.
7. The method according to any one of claims 2 to 6, wherein the control points on the tangent line of the intersection end point corresponding to each of the two intersection edge points are obtained by:
for the two intersection edge points, the following operations are respectively executed:
acquiring a target projection tangent corresponding to an intersection edge point, and intersecting points of the target projection tangent and projection tangents except the target projection tangent in the projection tangents and intersecting points of the target projection tangent and reference edges in each edge of a second polygon; the projection tangent lines are projections of tangent lines of end points of each intersection on a projection plane of the intersection to be generated, the projection plane is perpendicular to the road surface direction of the intersection to be generated, each vertex of the second polygon is a projection of end points of each intersection on the projection plane, and the reference edges are: among the sides, the target intersection endpoint is an intersection endpoint corresponding to the intersection edge point except for the side where the projection of the target intersection endpoint on the projection plane is located;
And obtaining a control point corresponding to the edge point of the intersection based on the distance between each intersection point and the target projection point, wherein the target projection point is the projection of the end point of the target intersection on the target projection tangent line.
8. The method of claim 7, wherein obtaining a control point corresponding to the one intersection edge point based on a distance between each intersection point and the target projection point, comprises:
when the minimum distance in the distances belongs to a preset distance interval, the intersection point corresponding to the minimum distance is used as the control point corresponding to the edge point of the intersection at the point corresponding to the tangent of the end point of the target intersection.
9. The method of claim 7, wherein the method further comprises:
when the minimum distance in each distance is determined not to belong to a preset distance interval, if the minimum distance is smaller than the left interval endpoint value of the preset distance interval, the point on the target projection tangent line, where the distance between the intersection endpoints corresponding to the intersection edge points is the left interval endpoint value, and the point corresponding to the tangent line of the target intersection endpoint is used as the control point corresponding to the intersection edge point;
And if the minimum distance is greater than the right interval endpoint value of the preset distance interval, projecting a point on the target projection tangent line, wherein the distance between the intersection endpoints corresponding to the intersection edge points is the right interval endpoint value, and the point corresponding to the tangent line of the target intersection endpoint is used as the intersection endpoint control point corresponding to the intersection edge point.
10. The method of any one of claims 1-6, wherein the intersection connection is a second type connection, and two intersection edge points connected by the second type connection correspond to the same intersection end point.
11. The method of any one of claims 1 to 6, wherein the obtaining, based on the curve intersection points of the at least two intersection curves and the associated in-road curves, respectively, the intersection endpoint sets corresponding to the at least two intersection curves respectively includes:
respectively projecting each curve intersection point to a projection plane of the intersection to be generated to obtain each projection point, wherein the projection plane is perpendicular to the road surface direction of the intersection to be generated;
constructing a third polygon based on each projection point, wherein each projection point is a vertex of the third polygon or is positioned in the third polygon;
And when the projection points are determined to be the vertexes of the third polygon, respectively taking the intersection points of the curves as intersection endpoints contained in the intersection endpoint sets corresponding to the corresponding intersection curves.
12. The method of claim 11, wherein the method further comprises:
when the projection points which are not the vertexes of the third polygon exist in the projection points, extending the third polygon along the road surface direction and the opposite direction of the road surface direction to obtain a target geometrical body;
and respectively taking the intersection points of curves in the road where the intersection points of the target geometric body and the curves corresponding to the projection points are located and the intersection points of the curves except the intersection points of the curves corresponding to the projection points in the intersection points of the curves as intersection end points contained in the intersection end point sets corresponding to the corresponding intersection curves.
13. A virtual intersection generating device, comprising:
the system comprises an acquisition unit, a storage unit and a control unit, wherein the acquisition unit is used for acquiring at least two intersection curves corresponding to an intersection to be generated and road curves respectively associated with the at least two intersection curves, and the intersection curves and the associated road curves belong to the same road curve;
the composition unit is used for respectively obtaining intersection end point sets corresponding to the at least two intersection curves based on curve intersection points of the at least two intersection curves and the associated road curves, and the intersection end points are used for composing the intersection to be generated;
The mobile unit is used for respectively executing the following operations aiming at the at least two intersection endpoint sets: based on the road width corresponding to a road curve in which one intersection endpoint set is positioned, moving each intersection endpoint in the one intersection endpoint set according to the set direction of the road curve, and respectively obtaining two intersection edge points corresponding to each intersection endpoint;
the connecting unit is used for obtaining an intersection area based on the obtained intersection connection between the intersection edge points, filling the intersection area and obtaining the intersection to be generated.
14. An electronic device comprising a processor and a memory, wherein the memory stores a computer program which, when executed by the processor, causes the processor to perform the steps of the method of any of claims 1 to 12.
15. A computer readable storage medium, characterized in that it comprises a computer program for causing an electronic device to execute the steps of the method according to any one of claims 1-12 when said computer program is run on the electronic device.
16. A computer program product comprising a computer program, the computer program being stored on a computer readable storage medium; when the computer program is read from the computer readable storage medium by a processor of an electronic device, the processor executes the computer program, causing the electronic device to perform the steps of the method of any one of claims 1-12.
CN202310508520.2A 2023-05-08 2023-05-08 Virtual intersection generation method and device, electronic equipment and storage medium Active CN116212392B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310508520.2A CN116212392B (en) 2023-05-08 2023-05-08 Virtual intersection generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310508520.2A CN116212392B (en) 2023-05-08 2023-05-08 Virtual intersection generation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116212392A true CN116212392A (en) 2023-06-06
CN116212392B CN116212392B (en) 2023-08-08

Family

ID=86579115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310508520.2A Active CN116212392B (en) 2023-05-08 2023-05-08 Virtual intersection generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116212392B (en)

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930624A (en) * 2009-06-23 2010-12-29 比亚迪股份有限公司 Modeling method and device of three-dimensional road intersection
CN102436678A (en) * 2010-09-29 2012-05-02 比亚迪股份有限公司 Method and system for generating three-dimensional road model
US20120268794A1 (en) * 2011-04-21 2012-10-25 Canon Kabushiki Kaisha Curve vectorization with preserved tangents at endpoints
CN105913483A (en) * 2016-03-31 2016-08-31 百度在线网络技术(北京)有限公司 Method and device for generating three-dimensional crossing road model
CN110404261A (en) * 2019-08-20 2019-11-05 网易(杭州)网络有限公司 The construction method and device of virtual networks in game
CN111035925A (en) * 2019-11-21 2020-04-21 网易(杭州)网络有限公司 Method and device for generating virtual traffic road network model in game and electronic device
CN111535099A (en) * 2020-04-20 2020-08-14 杭州优云软件有限公司 Three-dimensional microscopic road network generation method capable of realizing real-time interaction
CN111841010A (en) * 2019-04-26 2020-10-30 网易(杭州)网络有限公司 Urban road network generation method and device, storage medium, processor and terminal
US20210052976A1 (en) * 2019-08-22 2021-02-25 NantG Mobile, LLC Virtual and real-world content creation, apparatus, systems, and methods
CN112530013A (en) * 2021-02-09 2021-03-19 腾讯科技(深圳)有限公司 Intersection region determination method and device, storage medium and electronic device
KR20210038489A (en) * 2020-06-10 2021-04-07 바이두 온라인 네트웍 테크놀러지 (베이징) 캄파니 리미티드 Method and device for drawing a three-dimensional road network map, apparatus, medium, and program
CN113012255A (en) * 2019-12-19 2021-06-22 百度在线网络技术(北京)有限公司 Road sideline extraction method, apparatus, device and medium
CN115187734A (en) * 2022-02-22 2022-10-14 京东方科技集团股份有限公司 Road network model generation method and device, storage medium and electronic equipment
CN115346012A (en) * 2022-08-19 2022-11-15 腾讯科技(深圳)有限公司 Intersection surface generation method, apparatus, device, storage medium and program product
CN115641415A (en) * 2022-12-26 2023-01-24 成都国星宇航科技股份有限公司 Method, device, equipment and medium for generating three-dimensional scene based on satellite image

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930624A (en) * 2009-06-23 2010-12-29 比亚迪股份有限公司 Modeling method and device of three-dimensional road intersection
CN102436678A (en) * 2010-09-29 2012-05-02 比亚迪股份有限公司 Method and system for generating three-dimensional road model
US20120268794A1 (en) * 2011-04-21 2012-10-25 Canon Kabushiki Kaisha Curve vectorization with preserved tangents at endpoints
CN105913483A (en) * 2016-03-31 2016-08-31 百度在线网络技术(北京)有限公司 Method and device for generating three-dimensional crossing road model
CN111841010A (en) * 2019-04-26 2020-10-30 网易(杭州)网络有限公司 Urban road network generation method and device, storage medium, processor and terminal
CN110404261A (en) * 2019-08-20 2019-11-05 网易(杭州)网络有限公司 The construction method and device of virtual networks in game
US20210052976A1 (en) * 2019-08-22 2021-02-25 NantG Mobile, LLC Virtual and real-world content creation, apparatus, systems, and methods
CN111035925A (en) * 2019-11-21 2020-04-21 网易(杭州)网络有限公司 Method and device for generating virtual traffic road network model in game and electronic device
CN113012255A (en) * 2019-12-19 2021-06-22 百度在线网络技术(北京)有限公司 Road sideline extraction method, apparatus, device and medium
CN111535099A (en) * 2020-04-20 2020-08-14 杭州优云软件有限公司 Three-dimensional microscopic road network generation method capable of realizing real-time interaction
KR20210038489A (en) * 2020-06-10 2021-04-07 바이두 온라인 네트웍 테크놀러지 (베이징) 캄파니 리미티드 Method and device for drawing a three-dimensional road network map, apparatus, medium, and program
CN112530013A (en) * 2021-02-09 2021-03-19 腾讯科技(深圳)有限公司 Intersection region determination method and device, storage medium and electronic device
CN115187734A (en) * 2022-02-22 2022-10-14 京东方科技集团股份有限公司 Road network model generation method and device, storage medium and electronic equipment
CN115346012A (en) * 2022-08-19 2022-11-15 腾讯科技(深圳)有限公司 Intersection surface generation method, apparatus, device, storage medium and program product
CN115641415A (en) * 2022-12-26 2023-01-24 成都国星宇航科技股份有限公司 Method, device, equipment and medium for generating three-dimensional scene based on satellite image

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ZHU, CHUN-GANG 等: "Self-intersections of rational Bezier curves", GRAPHICAL MODELS, pages 312 - 320 *
不负红颜: "贝塞尔曲线绘制路径", Retrieved from the Internet <URL:https://blog.csdn.net/MouXiaoxiong/article/details/52254235> *
刘玲: "基于单目视频的交叉路口场景理解建模方法研究", 赤峰学院学报 *

Also Published As

Publication number Publication date
CN116212392B (en) 2023-08-08

Similar Documents

Publication Publication Date Title
CN111127304B (en) Cross-domain image conversion
CN112233212A (en) Portrait editing and composition
CN111739141B (en) 3D cloud rendering method for light terminal
WO2020077913A1 (en) Image processing method and device, and hardware device
US11688115B2 (en) Systems, methods, and devices for creating a spline-based video animation sequence
CN108170282A (en) For controlling the method and apparatus of three-dimensional scenic
CN112927339A (en) Graphic rendering method and device, storage medium and electronic equipment
WO2023169095A1 (en) Data processing method and apparatus, device, and medium
CN113113045A (en) Scene picture display method, device, terminal and storage medium
CN113827965A (en) Rendering method, device and equipment of sample lines in game scene
CN113313832A (en) Semantic generation method and device of three-dimensional model, storage medium and electronic equipment
US10657682B2 (en) Drawing curves in space guided by 3-D objects
JP2002183228A (en) System and method for simplifying surface description and wire-frame description of geometric model
WO2020077912A1 (en) Image processing method, device, and hardware device
CN114708374A (en) Virtual image generation method and device, electronic equipment and storage medium
CN116212392B (en) Virtual intersection generation method and device, electronic equipment and storage medium
EP2618312A2 (en) System and method for snapping normals to create fair 3D surfaces from edge curves
CN114219001A (en) Model fusion method and related device
KR20230094185A (en) Method and system for providing automated 3d modeling for xr online platform
CN110502305A (en) Method and device for realizing dynamic interface and related equipment
US10521938B1 (en) System and method for smoothing computer animation curves
CN112106339B (en) Backward dough sheet rejection under displacement
WO2022146681A1 (en) Three-dimensional modeling for use in generating a realistic garmented avatar
CN111652024B (en) Face display and live broadcast method and device, electronic equipment and storage medium
WO2023185228A1 (en) Grid model processing method and apparatus, device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40086952

Country of ref document: HK