Route generation method and device in panoramic map
By generating strip-shaped target routes in panoramic maps and utilizing triangular facets and direction marker rendering techniques, the problem of unclear trajectory lines in panoramic maps is solved, thus improving the user experience.
Patent Information
- Application Number
- CN202411921736.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-12-24
AI Technical Summary
Existing technologies for generating trajectory lines in panoramic maps do not produce a clear display effect, resulting in a poor user experience.
By generating route coordinate points based on the first curve in the panoramic map, determining the second line segment of a preset length, and using triangular patches to expand and generate a strip-shaped target route, the display effect is improved by combining direction indicators and border color information.
This makes the route more clearly displayed on the panoramic map, improving the user experience.
Smart Images

Figure CN119779332B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of Internet, and in particular, to a route generation method and device in a panoramic map. BACKGROUND
[0002] In the existing map trajectory display process, trajectory data is usually converted into a geojson format, and then loaded and rendered through a JS SDK to generate a trajectory line map and display it. SUMMARY
[0003] Embodiments of the present disclosure provide a route generation method and device in a panoramic map.
[0004] According to an aspect of an embodiment of the present disclosure, a route generation method in a panoramic map is provided, comprising:
[0005] obtaining a first number of route coordinate points based on a first curve included in the panoramic map;
[0006] determining a second number of line segments of a preset length according to the first number of route coordinate points;
[0007] determining a second number of triangular facets based on the first number of second line segments;
[0008] determining a target route in the form of a strip corresponding to the first curve based on the second number of triangular facets; wherein the width of the target route in the form of a strip is the preset length.
[0009] Optionally, the determining of the second number of triangular facets based on the first number of second line segments comprises:
[0010] determining whether there are adjacent second line segments having intersection points;
[0011] in response to there being multiple second line segments having intersection points between adjacent second line segments, replacing the multiple second line segments having intersection points with multiple third line segments, and determining the second number of triangular facets based on the multiple third line segments and the second line segments not having intersection points.
[0012] Optionally, the determining of the second number of triangular facets based on the first number of second line segments further comprises:
[0013] in response to there being no intersection points between adjacent second line segments, determining a quadrilateral based on each two adjacent second line segments to obtain a third number of quadrilaterals;
[0014] determining the second number of triangular facets based on the third number of quadrilaterals.
[0015] Optionally, the replacing the plurality of second line segments having intersection points by a plurality of third line segments, determining the second number of triangular patches based on the plurality of third line segments and the second line segments without intersection points comprises:
[0016] Determining an end point on one side of the plurality of second line segments having intersection points as an inner end point and an end point on the other side as an outer end point;
[0017] Determining a target point based on a plurality of the inner end points;
[0018] Connecting a plurality of the outer end points and the target point respectively to determine the plurality of third line segments;
[0019] Determining the second number of triangular patches based on the plurality of third line segments and the second line segments without intersection points.
[0020] Optionally, the determining the target point based on a plurality of the inner end points comprises:
[0021] Connecting a plurality of the inner end points in the order of the route coordinate points corresponding to the inner end points in the first curve to obtain a second curve;
[0022] Determining the target point based on an intersection point of the second curve.
[0023] Optionally, the determining the second number of triangular patches based on the plurality of third line segments and the second line segments without intersection points comprises:
[0024] Connecting outer end points of adjacent third line segments in the plurality of third line segments to obtain at least one triangular patch;
[0025] Determining a quadrilateral based on each two adjacent second line segments without intersection points to obtain a plurality of quadrilaterals;
[0026] Determining the second number of triangular patches based on a plurality of the quadrilaterals and at least one triangular patch.
[0027] Optionally, the determining the strip-shaped target route corresponding to the first curve based on the second number of triangular patches comprises:
[0028] Determining a route direction based on direction information corresponding to the first curve;
[0029] Determining a corresponding direction sign and color information corresponding to the direction sign from a preset sign library according to the route direction;
[0030] Determining frame coordinate information and frame color information of the strip-shaped target route based on vertex coordinate information corresponding to the triangular patch.
[0031] Determine a target strip route corresponding to the first curve based on the direction sign, color information of the direction sign, the frame coordinates, and the frame color information.
[0032] Optionally, the determining the target strip route corresponding to the first curve based on the direction sign, the color information of the direction sign, the frame coordinates, and the frame color information comprises:
[0033] Render the direction sign based on the color information of the direction sign to obtain a target direction sign;
[0034] Map the target direction sign in a first layer corresponding to the target strip route;
[0035] Determine two frames corresponding to the target strip route based on the frame coordinates, and render the two frames based on the frame color information to obtain a target frame;
[0036] Map the target frame in a second layer corresponding to the target strip route;
[0037] Superimpose the first layer and the second layer to obtain the target strip route.
[0038] Optionally, the determining the target strip route corresponding to the first curve based on the direction sign, the color information of the direction sign, the frame coordinates, and the frame color information further comprises:
[0039] Determine a background area corresponding to the target strip route based on the frame coordinates and the background color information;
[0040] Render the background area based on the background color information to obtain a target background area;
[0041] Map the target background area in a third layer corresponding to the target strip route;
[0042] The superimposing the first layer and the second layer to obtain the target strip route comprises:
[0043] Superimpose the first layer, the second layer, and the third layer to obtain the target strip route.
[0044] Optionally, the obtaining a first number of route coordinate points based on the first curve included in the panoramic map comprises:
[0045] Coordinate point sampling is performed on the first curve to obtain the first number of route coordinate points; wherein a preset number of coordinate points in each unit length of the first curve are sampled as the route coordinate points.
[0046] Optionally, the determining, according to the first quantity of route coordinate points, a first quantity of second line segments of a preset length comprises:
[0047] For each of the first quantity of route coordinate points, determining a normal line of the first curve at the route coordinate point;
[0048] generating a second line segment of the preset length along the normal line direction with the route coordinate point as a midpoint. According to another aspect of the embodiments of the present disclosure, a route generation device in a panoramic map is provided, comprising:
[0049] a coordinate point determination module configured to obtain a first quantity of route coordinate points based on a first curve included in a panoramic map;
[0050] a second line segment module configured to determine a first quantity of second line segments of a preset length according to the first quantity of route coordinate points;
[0051] a triangular facet module configured to determine a second quantity of triangular facets based on the first quantity of second line segments;
[0052] a route generation module configured to determine a target route in a strip shape corresponding to the first curve based on the second quantity of triangular facets; wherein a width of the target route in the strip shape is the preset length.
[0053] Optionally, the triangular facet module comprises:
[0054] an intersection confirmation unit configured to determine whether there are adjacent second line segments having an intersection point;
[0055] a first facet determination unit configured to, in response to there being an intersection point between a plurality of adjacent second line segments, replace the plurality of second line segments having the intersection point with a plurality of third line segments, and determine the second quantity of triangular facets based on the plurality of third line segments and the second line segments not having the intersection point.
[0056] Optionally, the triangular facet module further comprises:
[0057] a second facet determination unit configured to, in response to there being no intersection point between adjacent second line segments, determine a quadrilateral based on each two adjacent second line segments to obtain a third quantity of quadrilaterals, and determine the second quantity of triangular facets based on the third quantity of quadrilaterals.
[0058] Optionally, the first patch determining unit is specifically configured to determine an end point on a side close to a center of a curvature circle as an inner end point and an end point on another side as an outer end point among the plurality of second line segments having intersection points; determine a target point based on a plurality of the inner end points; connect a plurality of the outer end points and the target point respectively to determine a plurality of third line segments; and determine the second number of triangular patches based on the plurality of third line segments and the second line segments without intersection points.
[0059] Optionally, when determining the target point based on a plurality of the inner end points, the first patch determining unit is configured to connect a plurality of the inner end points in an order corresponding to the route coordinate points in the first curve to obtain a second curve; and determine the target point based on an intersection point of the second curve.
[0060] Optionally, when determining the second number of triangular patches based on the plurality of third line segments and the second line segments without intersection points, the first patch determining unit is configured to connect outer end points of adjacent third line segments in the plurality of third line segments to obtain at least one triangular patch; determine a plurality of quadrilaterals based on every two adjacent second line segments without intersection points to obtain the plurality of quadrilaterals; and determine the second number of triangular patches based on the plurality of quadrilaterals and the at least one triangular patch.
[0061] Optionally, the route generation module comprises:
[0062] a direction determining unit configured to determine a route direction based on direction information corresponding to the first curve;
[0063] a first color determining unit configured to determine a corresponding direction identifier and color information corresponding to the direction identifier from a preset identifier library according to the route direction;
[0064] a second color determining unit configured to determine border coordinate information and border color information of the target route based on vertex coordinate information corresponding to the triangular patch.
[0065] a route color determining unit configured to determine a target route corresponding to the first curve based on the direction identifier, the color information of the direction identifier, the border coordinate information, and the border color information.
[0066] Optionally, the route color determination unit is specifically configured to render the direction identifier based on the color information of the direction identifier to obtain a target direction identifier; map the target direction identifier in a first layer corresponding to the target route; determine two borders corresponding to the target route based on the border coordinates, and render the two borders based on the border color information to obtain a target border; map the target border in a second layer corresponding to the target route; and superimpose the first layer and the second layer to obtain the target route.
[0067] Optionally, the route color determination unit is further configured to determine a background area corresponding to the target route based on the border coordinates and the background color information; render the background area based on the background color information to obtain a target background area; map the target background area in a third layer corresponding to the target route; and superimpose the first layer, the second layer, and the third layer to obtain the target route.
[0068] Optionally, the coordinate point determination module is specifically configured to perform coordinate point sampling on the first curve to obtain a first quantity of route coordinate points; and each unit length of the first curve is sampled with a preset quantity of coordinate points as the route coordinate points.
[0069] Optionally, the second line segment module is specifically configured to, for each route coordinate point in the first quantity of route coordinate points, determine a normal line of the first curve at the route coordinate point; and generate a second line segment of the preset length along the normal line direction with the route coordinate point as a midpoint.
[0070] According to still another aspect of the embodiments of the present disclosure, an electronic device is provided, comprising:
[0071] a memory configured to store a computer program product;
[0072] a processor configured to execute the computer program product stored in the memory, and when the computer program product is executed, implement the route generation method in a panoramic map according to any one of the above embodiments.
[0073] According to still another aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, which stores computer program instructions, and when the computer program instructions are executed by a processor, implement the route generation method in a panoramic map according to any one of the above embodiments.
[0074] According to still another aspect of the embodiments of the present disclosure, a computer program product is provided, which comprises computer program instructions, and when the computer program instructions are executed by a processor, implement the route generation method in a panoramic map according to any one of the above embodiments.
[0075] The method and apparatus for generating routes in a panoramic map based on the above embodiments of this disclosure include: obtaining a first number of route coordinate points based on a first curve included in the panoramic map; determining a first number of second line segments of a preset length based on the first number of route coordinate points; determining a second number of triangular patches based on the first number of second line segments; and determining a strip-shaped target route corresponding to the first curve based on the second number of triangular patches; wherein the width of the strip-shaped target route is the preset length. The embodiments of this disclosure expand the originally given first curve into a first number of second line segments, determine a second number of triangular patches based on the second line segments, and obtain a strip-shaped target route through the triangular patches, making the route more clearly displayed in the panoramic map. Furthermore, the strip-shaped target route is more readable than the original first curve in terms of display, thus improving the user experience.
[0076] The technical solutions of this disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0077] The accompanying drawings, which form part of this specification, illustrate embodiments of this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0078] This disclosure will become clearer with reference to the accompanying drawings and the following detailed description, wherein:
[0079] Figure 1 This is a flowchart illustrating a route generation method in a panoramic map provided by an exemplary embodiment of this disclosure;
[0080] Figure 2 This is a public announcement Figure 1 A flowchart illustrating step 104 in the illustrated embodiment;
[0081] Figure 3 This is a schematic diagram of determining normals in a route generation method for a panoramic map provided in an exemplary embodiment of this disclosure;
[0082] Figure 4 This is a public announcement Figure 1 A flowchart illustrating step 106 in the illustrated embodiment;
[0083] Figure 5a This is a schematic diagram of two second line segments in an optional example of this disclosure;
[0084] Figure 5b This is a schematic diagram of two second line segments in another optional example of this disclosure;
[0085] Figure 6 This is a public announcement Figure 4 A flowchart illustrating step 1062 in the illustrated embodiment;
[0086] Figure 7a is a schematic diagram of recording a second line segment with multiple continuous intersection points in another optional example of the present disclosure;
[0087] Figure 7b is a schematic diagram of recording a second line segment with multiple continuous intersection points in an example of the present disclosure; Figure 7a is a schematic diagram of identifying an inner endpoint of the second line segment in the example shown in FIG. 8;
[0088] Figure 7c is a schematic diagram of connecting the endpoints in the red circle in FIG. 9 to obtain a second curve; Figure 7b
[0089] Figure 8a is a schematic diagram of step 108 in an example shown in FIG. 10; Figure 1
[0090] Figure 8b is a target direction sign obtained by color rendering of a target sign in another optional example of the present disclosure;
[0091] Figure 8c is a UV coordinate schematic diagram obtained by coordinate conversion of a vertex of a triangular patch in another optional example of the present disclosure;
[0092] Figure 8d is a schematic diagram of a strip-shaped target route obtained in another optional example of the present disclosure;
[0093] Figure 9 is a schematic diagram of a structure of a route generation device in a panoramic map according to an example embodiment of the present disclosure;
[0094] Figure 10 illustrates a block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0095] Hereinafter, example embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the example embodiments described herein.
[0096] It should be noted that: unless otherwise specified, the relative arrangement, numerical expressions and values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.
[0097] Those skilled in the art can understand that the terms "first", "second" and the like in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, and do not represent any specific technical meaning, nor do they represent the inevitable logical sequence between them.
[0098] It should also be understood that, in the embodiments of the present disclosure, "multiple" can refer to two or more, and "at least one" can refer to one, two or more.
[0099] It should also be understood that, for any component, data or structure mentioned in the embodiments of the present disclosure, one or more can be generally understood without explicit limitation or in the context of the opposite implication.
[0100] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. In addition, the character " / " in the present disclosure generally represents an "or" relationship between the front and rear associated objects. The data referred to in the present disclosure can include unstructured data such as text, images, and videos, and can also be structured data.
[0101] It should also be understood that the description of the present disclosure for each embodiment emphasizes the differences between each embodiment, and the same or similar parts can be referred to each other, and for the sake of brevity, will not be repeated.
[0102] At the same time, it should be understood that, for the convenience of description, the size of each part shown in the drawings is not drawn according to the actual proportional relationship.
[0103] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application or uses.
[0104] Techniques, methods, and devices known to those of ordinary skill in the relevant art can not be discussed in detail, but should be considered part of the specification where appropriate.
[0105] It should be noted that: similar signs and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
[0106] The embodiments of the present disclosure can be applied to terminal devices, computer systems, servers and other electronic devices, which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with terminal devices, computer systems, servers and other electronic devices include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, mainframe computer systems and distributed cloud computing technology environments including any of the above systems, etc.
[0107] Electronic devices such as terminal devices, computer systems, servers, and the like can be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules can include routines, programs, objects, components, logic, data structures, and the like that perform particular tasks or implement particular abstract data types. Computer systems / server can be practiced in distributed cloud computing environments with other computer systems coupled via communication networks. The program modules can be stored in the local or remote computer system memory devices.
[0108] Exemplary method
[0109] Figure 1 FIG. 1 is a flow diagram of a route generation method in a panoramic map according to an example embodiment of the present disclosure. The example embodiment can be applied to an electronic device, such as a server, a terminal device, a computer system, and the like. Figure 1 As shown in FIG. 1, the method includes the following steps:
[0110] At step 102, a first number of route coordinate points are obtained based on a first curve included in the panoramic map.
[0111] In the example embodiment, the first curve is a route with known length and coordinates in the panoramic map, and the first curve includes a plurality of panoramic points with large intervals, each of which has a known three-dimensional coordinate (x, y, z). The first number of route coordinate points are determined from the first curve by sampling and other operations. Optionally, a certain number (for example, 100) of route coordinate points are obtained for each preset length of the first curve. In combination with the known length of the first curve, the first number of route coordinate points are obtained. For example, 100 route coordinate points are generated for each 1 meter of the curve, and 500 route coordinate points are obtained for a first curve of 5 meters.
[0112] At step 104, a first number of second line segments of a preset length are determined based on the first number of route coordinate points.
[0113] In an example embodiment, in order to generate a strip-shaped route with a certain width, width expansion is performed on each route coordinate point, and a second line segment of a preset length is determined at the position of each route coordinate point, so as to facilitate subsequent generation of a strip-shaped route with the preset length as the width. The preset length can be set according to a specific application scenario.
[0114] At step 106, a second number of triangular patches are determined based on the first number of second line segments.
[0115] A triangle patch is a two-dimensional geometric figure composed of three vertices and three edges, each edge connecting two vertices, eventually forming a closed triangle. Triangle patches are often used to describe the surface of a three-dimensional object, which can be constructed by a large number of adjacent triangle patches to form a complex shape. Based on the characteristics of the triangle patch, it is ensured that all edges and vertices in a triangle patch are in the same plane. In a panoramic map, it is more convenient to determine a strip-shaped route based on a triangle patch.
[0116] In step 108, a strip-shaped target route corresponding to the first curve is determined based on the second number of triangle patches.
[0117] The width of the strip-shaped target route is a preset length.
[0118] In this embodiment, the strip-shaped target route is obtained by connecting the second number of continuous triangle patches. Optionally, the second number and the first number have a correlation relationship, for example, the second number is represented by n and the first number is represented by m, n = (m-1) x 2.
[0119] The route generation method in the panoramic map provided by the above-mentioned embodiments of the present disclosure is based on the first curve included in the panoramic map to obtain a first number of route coordinate points; according to the first number of route coordinate points, a first number of second line segments with a preset length are determined; based on the first number of second line segments, a second number of triangle patches are determined; based on the second number of triangle patches, a strip-shaped target route corresponding to the first curve is determined; wherein the width of the strip-shaped target route is the preset length; the embodiment of the present disclosure expands the originally given first curve into a first number of second line segments, determines a second number of triangle patches based on the second line segments, and obtains a strip-shaped target route through the triangle patches, so that the display of the route in the panoramic map is more obvious, and the strip-shaped target route is more readable in display compared to the original first curve, thereby improving the user experience.
[0120] In some optional embodiments, step 102 in the above-mentioned embodiments can include:
[0121] The first curve is sampled for coordinate points to obtain a first number of route coordinate points.
[0122] A preset number of coordinate points in each unit length of the first curve are sampled as route coordinate points.
[0123] Optionally, the first curve in the embodiment can be converted into a smooth curve by a method provided by the THREE.js library (for simplifying the process of creating and displaying 3D graphics on a webpage) from a set of relatively sparse known three-dimensional coordinates of points in the panoramic map, denoted as the first curve, for example, curve = new THREE.CatmullRomCurve3(positions); and the first curve is converted into a plurality of route coordinate points by a method provided by the THREE.js library, for example, the set of route coordinate points is denoted as L, L = curve.length*100; indicating that 100 route coordinate points are generated for every 1 meter of the first curve, and the number of coordinate points that need to be generated to calculate the complete first curve (corresponding to the first number in the embodiment) is achieved. In the embodiment, the number of route coordinate points generated is much larger than the initial known three-dimensional coordinate points, that is, the sparse and large-interval panoramic points are used to generate continuous, small-interval, and smooth route coordinate points, and the first number of route coordinate points is used to generate a more smooth and more beautiful display effect of the belt-shaped route.
[0124] As shown in Figure 2 the above Figure 1 embodiment, in step 104, for each route coordinate point in the first number of route coordinate points, the following steps can be performed:
[0125] Step 1041, determining the normal line of the first curve at the route coordinate point.
[0126] The normal line (normal line) is a straight line that is always perpendicular to a certain plane. In geometry, the normal line refers to a line that is perpendicular to the tangent of a curve at a point on the plane.
[0127] In an optional example, as shown in Figure 3 at the route coordinate point P, a tangent L1 is determined, passing through the point P, and a normal line L2 perpendicular to the tangent L1 is determined.
[0128] Step 1042, generating a second line segment of a preset length in the normal direction with the route coordinate point as the midpoint.
[0129] In the embodiment, the direction of the second line segment is determined based on the normal line corresponding to the route coordinate point. In order to determine the second line segment with a length of a preset length, a half length of the preset length is cut on the normal line on both sides of the route coordinate point with the route coordinate point as the midpoint, and the second line segment corresponding to the route coordinate point is obtained, for example, as shown in Figure 3The line segment p1p2 in the illustrated embodiment. Based on the method provided in this embodiment, a corresponding second line segment can be determined for each route coordinate point, i.e., a first number of second line segments are obtained. In this embodiment, the width of the strip-shaped route is expanded in the normal direction of each route coordinate point by intercepting the second line segment in the normal direction, which ensures that each angle in the subsequently obtained strip-shaped route coincides with the first curve.
[0130] As shown in the above Figure 4 embodiment, step 106 can include the following steps: Figure 1
[0131] Step 1061, determine whether there are adjacent second line segments with intersection points, if there are multiple adjacent second line segments with intersection points, execute step 1062; otherwise, execute step 1063.
[0132] Alternatively, whether each two adjacent second line segments intersect can be determined by the curvature corresponding to each route coordinate point. Curvature is the rate of rotation of the tangent direction angle to the arc length for a point on a curve (in this embodiment, a route coordinate point), which is defined by differentiation, indicating the degree to which the curve deviates from a straight line. The greater the curvature, the greater the degree of curvature of the curve.
[0133] If the curvature of the first curve at two adjacent route coordinate points (for example, the first route coordinate point and the second route coordinate point, since the route coordinate point density is large in this embodiment of the disclosure, the curvature difference between two adjacent route coordinate points is small) is less than a preset curvature (the preset curvature is related to the preset length), the two adjacent second line segments (corresponding to the first route coordinate point and the second route coordinate point) do not intersect, for example, as shown in the example of Figure 5a The curvatures of the two second line segments p1p2 and p3p4 are less than the preset curvature, and there is no intersection point between p1p2 and p3p4; and when the curvatures of the first route coordinate point and the second route coordinate point are greater than or equal to the preset curvature, the two adjacent second line segments have intersection points, for example, as shown in the example of Figure 5b The curvatures of the two second line segments p5p6 and p7p8 are greater than the preset curvature, and there is an intersection point between p5p6 and p7p8.
[0134] Step 1062, replace the second line segments with intersection points with a plurality of third line segments based on the plurality of third line segments, and determine a second number of triangular patches based on the plurality of third line segments and the second line segments without intersection points.
[0135] When there are intersections between multiple second line segments, it is not possible to directly determine the triangular facets based on the multiple second line segments. Therefore, this embodiment proposes to replace the second line segments with third line segments, and the corresponding triangular facets can be determined based on multiple third line segments. By combining other second line segments that do not have intersections, a second number of triangular facets can be obtained. Optionally, the method for determining triangular facets based on second line segments that do not have intersections can refer to steps 1063 and 1064.
[0136] Step 1063: Determine a quadrilateral based on every two adjacent second line segments to obtain the third number of quadrilaterals; proceed to step 1064.
[0137] Alternatively, connecting two adjacent second line segments to two vertices on the same side of the first curve yields a rectangle, such as... Figure 5a In the embodiment shown, connecting p1p3 and p2p4 yields the rectangle p1p2p4p3.
[0138] Step 1064: Based on the third number of quadrilaterals, determine the second number of triangular facets.
[0139] Optionally, a corresponding triangular facet can be obtained based on one diagonal of the rectangle. Connecting any diagonal of the rectangle (e.g., p1p4 or p2p3) yields two corresponding triangles (e.g., p1p2p4 and p1p4p3, or p1p2p3 and p2p3p4). Using these two triangles as triangular facets, a second number of triangular facets can be obtained. This embodiment overcomes the problem of overlapping triangular facets when using the same processing to determine triangular facets on second line segments with intersections and those without intersections by performing different processing on the second line segments with intersections. Furthermore, by combining the determined triangular facets with the replaced third line segment, all obtained triangular facets are non-overlapping, improving the accuracy of the obtained strip route.
[0140] like Figure 6 As shown above, in the above Figure 4 Based on the illustrated embodiment, step 1062 may include the following steps:
[0141] Step 601: Determine the endpoint closer to the center of curvature of the second line segment with multiple intersection points as the inner endpoint and the endpoint on the other side as the outer endpoint.
[0142] Optionally, the reciprocal of the curvature at point M on the curve, referred to as the radius of curvature p at this point, based on the radius of curvature and the curvature, a point D can be determined, satisfying DM equal to the radius of curvature p, with the center of the circle D, the radius of curvature p is the radius of the circle, called the curvature circle of the curve at point M, the center of curvature D is called the curvature center of the curve at M. And the point M adjacent to the curve has the same concave direction, therefore, the corresponding curvature centers of the plurality of second line segments with continuous intersection points are on the same side of the first curve.
[0143] Step 602, determining the target point based on the plurality of inner endpoints.
[0144] In some optional embodiments, step 602 can include: connecting the plurality of inner endpoints in the order of the route coordinate points corresponding to the plurality of inner endpoints in the first curve to obtain a second curve; and determining the target point based on the intersection point of the second curve.
[0145] Optionally, when the two tangent lines generated at adjacent route coordinate points have a large angle (for example, the first curve has a turn), the two second line segments intersect, and because the first curve is smooth, the change of the angle of the two adjacent tangent lines is also smooth, so it can be known that the plurality of second line segments with intersection points are continuous. For example, as shown in FIG. 6B; this embodiment records a plurality of continuous second line segments with intersection points, and uniformly processes the plurality of continuous second line segments with intersection points, as shown in FIG. 6C, connecting all the inner endpoints in the order of the route coordinate points corresponding to the inner endpoints in the first curve, a second curve can be obtained, for example, connecting the endpoints in the red circle in FIG. 6C, a second curve as shown in FIG. 6D can be obtained, and the second curve necessarily has an intersection point, which is taken as the target point. Figure 7a Figure 7b Figure 7b Figure 7c
[0146] Step 603, connecting the plurality of outer endpoints and the target point respectively to determine a plurality of third line segments.
[0147] This embodiment replaces all the inner endpoints with the target point, and connects the plurality of outer endpoints and the target point, so that a plurality of triangular patches without overlap can be obtained, which can ensure that there is no overlap between all the triangular patches in the generated strip-shaped route.
[0148] Step 604, determining a second number of triangular patches based on the plurality of third line segments and the second line segment without intersection point.
[0149] Optionally, in some optional examples, connecting the outer endpoints of adjacent third line segments in the plurality of third line segments obtains at least one triangular patch.
[0150] Since multiple third line segments have the same inner endpoint (target point), a triangular facet can be obtained based on the two third line segments and the connecting line simply by connecting the outer endpoints of two adjacent third line segments.
[0151] A quadrilateral is determined based on each pair of adjacent second line segments that do not intersect, resulting in multiple quadrilaterals.
[0152] A second number of triangular facets is determined based on multiple quadrilaterals and at least one triangular facet.
[0153] In this embodiment, the method for obtaining triangular facets based on quadrilaterals can refer to steps 1063 and 1064 in the above embodiments, and will not be repeated here. By combining the triangular facets obtained based on the target point and the triangular facets obtained based on the quadrilaterals, the second number of triangular facets can be determined. In this embodiment, by using the target point to replace the inner endpoint of the second line segment with an intersection point, the obtained second number of triangular facets do not overlap, thereby improving the display effect of the strip route.
[0154] like Figure 8a As shown above, in the above Figure 1 Based on the illustrated embodiment, step 108 may include the following steps:
[0155] Step 1081: Determine the route direction based on the direction information corresponding to the first curve.
[0156] In addition to its known length and coordinates, the first curve also has known directional information, indicating that one end of the first curve is the starting point and the other end is the ending point. Based on this directional information, the route direction corresponding to the strip route can be determined. Optionally, since the first curve corresponds to different directions at different locations, a set of route directions can be obtained.
[0157] Step 1082: Determine the corresponding directional marker and its corresponding color information from the preset marker library based on the route direction.
[0158] Optionally, a preset identifier library stores directional identifiers in multiple modes (e.g., arrow mode, icon mode, etc.), multiple directions, and multiple colors. Based on the route direction, directional identifiers of the corresponding direction can be selected from the preset identifier library, or directional identifiers of any direction can be obtained, and the direction of the directional identifiers can be adjusted based on the route direction (e.g., obtaining arrows in a uniform direction and adjusting the arrow direction based on the route direction corresponding to different positions on the strip route). Optionally, the determination of the directional identifiers and their color information can be based on specific application scenarios or determined according to received instruction information.
[0159] Step 1083: Based on the vertex coordinate information corresponding to the triangular facet, determine the border coordinate information and border color information of the strip target route.
[0160] Optionally, in the strip-shaped target route formed by connecting the triangular facets, the border is obtained by connecting the edges of each triangular facet in sequence. Therefore, after the coordinates of the vertices of the triangular facets are determined, the coordinate information of the border of the strip-shaped target route can be determined. In order to highlight the display effect of the strip-shaped target route, the color of the border and the color of the background can be set to different colors. In this embodiment, the color information of the border can be determined according to the application scenario, or the color information of the border can be determined according to the received instruction information.
[0161] In step 1084, the strip-shaped target route corresponding to the first curve is determined based on the direction identifier, the color information of the direction identifier, the border coordinates, and the border color information.
[0162] Any model is composed of a geometry and a texture. The geometry describes the shape of the model (determined based on the second number of triangular facets connected in this embodiment), and the texture describes the color and / or style of the geometry. Any geometry is composed of a plurality of triangles (corresponding to triangular facets), and each triangle has three vertices and three-dimensional coordinates thereof. On the basis of the geometry determined by the triangular facets determined in the above embodiment, the direction information and the color information are added in this embodiment, so that the obtained strip-shaped target route includes more visualized information, and the readability of the strip-shaped target route is improved.
[0163] In some optional embodiments, step 1084 can include:
[0164] In step a1, the direction identifier is rendered based on the color information of the direction identifier, to obtain a target direction identifier.
[0165] Optionally, the color rendering of the direction identifier is implemented based on a fragment shader. After the rendering is completed, the target direction identifier with color is obtained. For example, as shown in FIG. 8, it is a schematic diagram of a direction identifier obtained by color rendering (white). Figure 8b
[0166] In step a2, the target direction identifier is mapped in the first layer corresponding to the strip-shaped target route.
[0167] In this embodiment, since the direction identifier, the border, and the background included in the strip-shaped target route have different color information, in order to avoid the identification being unclear due to color mixing, the direction identifier is mapped in the first layer to be distinguished from the border and the background.
[0168] In step a3, two borders corresponding to the strip-shaped target route are determined based on the border coordinates, and the two borders are rendered based on the border color information, to obtain a target border.
[0169] UV mapping is a technique of mapping 2D texture coordinates (U, V) to points on the surface of a 3D model (in this embodiment, corresponding to the vertices of a triangular face). The range of UV coordinates is 0-1. When a computer GPU draws a triangular face, in addition to the spatial position of the triangular face, the color of the triangular face is also needed; in this embodiment, first, the vertices of each triangular face are mapped to UV coordinates by UV mapping, that is, the UV of each vertex of the triangular face is defined, and when the computer processes the triangular face, the UV coordinates of each pixel point in the triangular face are calculated according to the pre-defined vertex UV coordinates (such as 0.1, 0.2, etc.), and the expected color of the pixel point is output according to the UV coordinates provided by the computer, so as to achieve the desired effect.
[0170] In some optional examples, the UV coordinates corresponding to the vertices of each triangular face are preset, and in this example, as shown in the following table, the UV coordinates of the three vertices of the lower triangular face are (0, 0), (1, 0) and (1, 1), and the UV coordinates of the three vertices of the upper triangular face are (0, 0), (0, 1) and (1, 1). Figure 8c
[0171] Step a4, map the target frame to the second layer corresponding to the strip-shaped target route.
[0172] Step a5, superimpose the first layer and the second layer to obtain the strip-shaped target route.
[0173] Optionally, the first layer is on top and the second layer is on the bottom.
[0174] In this embodiment, the direction identifier and the target frame are respectively mapped to different layers, and the first layer is arranged above the second layer, so that the shape and color of the direction identifier are not blocked, and the display effect of the obtained strip-shaped target route is better, and the user can intuitively understand the route direction.
[0175] Optionally, step 1084 can further include:
[0176] Step b1, determining the background area corresponding to the strip-shaped target route and the background color information based on the frame coordinates.
[0177] In this embodiment, the background area can be determined based on the frame coordinates converted to UV coordinates, for example, the background area color confirmation and frame color determination can be realized based on the following pseudo code:
[0178] Calculate the background color of the current UV coordinate, set as background:
[0179] float u = uv.x;
[0180] if(u>borderWidth&&u<1.0-borderWidth){ / / If not on the border, output the background color return vec4(backgroundColor,backgroundOpacity);
[0181] }
[0182] Calculate the border color at the current UV coordinates and set it as the border:
[0183] fl oat u = uv.x;
[0184] if(u<borderWi dth||u> 1.0-borderWidth){ / / If on a border, output the border color return vec4(borderColor, borderOpacity);
[0185] }
[0186] Here, borderWidth represents the ratio of the set border width to the strip line. For example, setting it to 0.2, 1.0 represents the full width of the strip line, and 0.2 means that one side of the border occupies 1 / 5 of the strip line.
[0187] Step b2: Render the background area based on the background color information to obtain the target background area.
[0188] Optionally, the background area is rendered using a fragment shader, and after rendering, a target background area with color is obtained.
[0189] Step b3: Apply the target background area texture to the third layer corresponding to the strip target route.
[0190] Step a5 may include:
[0191] By overlaying the first, second, and third layers, a strip-shaped target route is obtained.
[0192] In this embodiment, the colors of the non-targeted areas have different priorities. For example, the border color overrides the background color; the direction indicator color overrides both the border and background colors. To visualize this priority, this embodiment maps the rendered target direction indicator, target border, and target background area onto different layers, and then overlays these layers according to priority. For example, the first layer is on top, the second layer is between the first and third layers, and the third layer is on the bottom. In an optional example, rendering, mapping, and layer overlay can achieve the following: Figure 8d The diagram shows a strip-shaped target route.Figure 8d In the embodiment shown, the direction identifier is in the shape of an arrow, white in color, with a white border and a blue background.
[0193] Any of the route generation methods in the panoramic map provided by the embodiments of the present disclosure can be executed by any appropriate device with data processing capability, including but not limited to terminal devices and servers, etc. Alternatively, any of the route generation methods in the panoramic map provided by the embodiments of the present disclosure can be executed by a processor, such as a processor executing any of the route generation methods in the panoramic map mentioned by the embodiments of the present disclosure by calling corresponding instructions stored in a memory. Details are not described herein.
[0194] Exemplary apparatus
[0195] Figure 9 FIG. 1 is a structural schematic diagram of a route generation device in a panoramic map provided by an example embodiment of the present disclosure. As shown in the figure, Figure 9 The device provided by the embodiment includes:
[0196] The coordinate point determination module 91 is configured to obtain a first number of route coordinate points based on a first curve included in the panoramic map.
[0197] The second line segment module 92 is configured to determine a first number of second line segments of a preset length according to the first number of route coordinate points.
[0198] The triangular facet module 93 is configured to determine a second number of triangular facets based on the first number of second line segments.
[0199] The route generation module 94 is configured to determine a target route in the shape of a strip corresponding to the first curve based on the second number of triangular facets.
[0200] The width of the target route in the shape of a strip is the preset length.
[0201] The route generation device in the panoramic map provided by the above embodiments of the present disclosure obtains a first number of route coordinate points based on a first curve included in the panoramic map, determines a first number of second line segments of a preset length according to the first number of route coordinate points, determines a second number of triangular facets based on the first number of second line segments, and determines a target route in the shape of a strip corresponding to the first curve based on the second number of triangular facets. The width of the target route in the shape of a strip is the preset length. The embodiments of the present disclosure expand the originally given first curve into a first number of second line segments, determine a second number of triangular facets based on the second line segments, and obtain a target route in the shape of a strip through the triangular facets, so that the display of the route in the panoramic map is more obvious, and the target route in the shape of a strip is more readable relative to the original first curve in display, thereby improving the user experience.
[0202] In some optional embodiments, the coordinate point determination module 91 is specifically configured to sample coordinate points of the first curve to obtain the first quantity of route coordinate points.
[0203] In some optional embodiments, the first curve is sampled at a preset number of coordinate points per unit length as the route coordinate points.
[0204] In some optional embodiments, the second line segment module 92 is specifically configured to, for each route coordinate point in the first quantity of route coordinate points, determine a normal line of the first curve at the route coordinate point, and generate a second line segment of a preset length in the direction of the normal line with the route coordinate point as a midpoint.
[0205] In some optional embodiments, the triangular patch module 93 includes:
[0206] The intersection confirmation unit is configured to determine whether there are adjacent second line segments having an intersection point.
[0207] The first patch determination unit is configured to, in response to there being an intersection point between the plurality of adjacent second line segments, replace the plurality of second line segments having the intersection point with a plurality of third line segments, and determine the second quantity of triangular patches based on the plurality of third line segments and the second line segments not having the intersection point.
[0208] Optionally, the triangular patch module 93 further includes:
[0209] The second patch determination unit is configured to, in response to there being no intersection point between the adjacent second line segments, determine a quadrilateral based on each two adjacent second line segments to obtain a third quantity of quadrilaterals, and determine the second quantity of triangular patches based on the third quantity of quadrilaterals.
[0210] Optionally, the first patch determination unit is specifically configured to determine an end point on one side of the plurality of second line segments having the intersection point as an inner end point, and an end point on the other side as an outer end point, determine a target point based on the plurality of inner end points, connect the plurality of outer end points and the target point respectively to determine the plurality of third line segments, and determine the second quantity of triangular patches based on the plurality of third line segments and the second line segments not having the intersection point.
[0211] Optionally, when determining the target point based on the plurality of inner end points, the first patch determination unit is configured to connect the plurality of inner end points in the order of the route coordinate points corresponding to the plurality of inner end points in the first curve to obtain a second curve, and determine the target point based on an intersection point of the second curve.
[0212] Optionally, the first patch determining unit is configured to, when determining the second number of triangular patches based on the plurality of third line segments and the second line segments without intersection points, connect outer end points of adjacent third line segments in the plurality of third line segments to obtain at least one triangular patch, determine a quadrilateral based on each two adjacent second line segments without intersection points to obtain a plurality of quadrilaterals, and determine the second number of triangular patches based on the plurality of quadrilaterals and the at least one triangular patch.
[0213] In some optional embodiments, the route generation module 94 includes:
[0214] The direction determining unit is configured to determine a route direction based on the direction information corresponding to the first curve.
[0215] The first color determining unit is configured to determine a corresponding direction mark and color information corresponding to the direction mark from a preset mark library according to the route direction.
[0216] The second color determining unit is configured to determine the coordinate information and color information of the frame of the target route based on the vertex coordinate information corresponding to the triangular patch.
[0217] The route color determining unit is configured to determine the target route of the target route based on the direction mark, the color information of the direction mark, the coordinate of the frame, and the color information of the frame.
[0218] Optionally, the route color determining unit is specifically configured to render the target direction mark based on the color information of the direction mark, obtain a target direction mark, map the target direction mark in a first layer corresponding to the target route, determine two frames corresponding to the target route based on the coordinate of the frame, render the two frames based on the color information of the frame, obtain a target frame, map the target frame in a second layer corresponding to the target route, and superimpose the first layer and the second layer to obtain the target route.
[0219] Optionally, the route color determining unit is further configured to determine a background area and background color information corresponding to the target route based on the coordinate of the frame, render the background area based on the background color information, obtain a target background area, map the target background area in a third layer corresponding to the target route, and superimpose the first layer, the second layer, and the third layer to obtain the target route.
[0220] Exemplary electronic device
[0221] Hereinafter, an electronic device according to embodiments of the disclosure will be described with reference to the accompanying drawings. Figure 10 The electronic device can be either or both of the first device and the second device, or a single device independent of them, which can communicate with the first device and the second device to receive the acquired input signals therefrom.
[0222] Figure 10 FIG. 1 illustrates a block diagram of an electronic device according to an embodiment of the disclosure.
[0223] As Figure 10 illustrated, the electronic device includes one or more processors and a memory.
[0224] The processor can be a central processing unit (CPU) or other form of processing unit having data processing and / or instruction execution capabilities, and can control other components in the electronic device to perform desired functions.
[0225] The memory can store one or more computer program products, which can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory, for example, can include random access memory (RAM), cache memory, and / or the like. The non-volatile memory, for example, can include read-only memory (ROM), hard disk, flash memory, and / or the like. One or more computer program products can be stored on the computer-readable storage media, and the processor can execute the computer program products to implement the route generation method in a panoramic map and / or other desired functions of various embodiments of the disclosure described above.
[0226] In one example, the electronic device can further include an input device and an output device, which are interconnected through a bus system and / or other forms of connection mechanisms (not shown).
[0227] In addition, the input device can further include, for example, a keyboard, a mouse, and / or the like.
[0228] The output device can output various information, including determined distance information, direction information, and / or the like, to the outside. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and / or the like.
[0229] Of course, in order to simplify, Figure 10 only some of the components related to the disclosure among the electronic device are illustrated, and components such as buses, input / output interfaces, and / or the like are omitted. In addition, the electronic device can further include any other appropriate components according to specific application cases.
[0230] In addition to the above-described method and device, embodiments of the disclosure can be a computer program product including computer program instructions that, when executed by a processor, cause the processor to perform the steps of the route generation method in a panoramic map according to various embodiments of the disclosure described in the above parts of the specification.
[0231] The computer program product can 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 program code can execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server.
[0232] Furthermore, embodiments of the present disclosure can also be a computer readable storage medium, having stored thereon computer program instructions which, when executed by a processor, cause the processor to perform the steps described in the foregoing method of route generation in panoramic map according to various embodiments of the present disclosure.
[0233] The computer readable storage medium can be any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0234] The above describes the basic principles of the present disclosure in combination with specific embodiments, but it should be noted that the advantages, benefits, effects and the like mentioned in the present disclosure are only examples and are not limiting, and these advantages, benefits, effects and the like cannot be considered as the must-haves of each embodiment of the present disclosure. In addition, the above specific details are only for the purpose of example and understanding, and are not limiting, and the above details do not limit the present disclosure to the must-haves of the above specific details.
[0235] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between each embodiment can be referred to each other. For system embodiments, since they basically correspond to method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0236] The block diagrams of devices, apparatuses, equipment, systems referred to in this disclosure are merely illustrative examples and are not intended to require or imply that the connection, arrangement, configuration must be as shown in the block diagrams. These devices, apparatuses, equipment, systems can be connected, arranged, configured in any manner as will be appreciated by those skilled in the art. Words such as "include," "contain," "have," and the like are open-ended words that are to be interpreted to mean "including but not limited to," and are not to be interpreted as limiting the described embodiment to features, elements, and / or steps disclosed herein. The words "or" and "and" as used herein are to be interpreted as the word "and / or," and are not to be interpreted as requiring both features, elements, and / or steps disclosed herein. The word "such as" as used herein is to be interpreted as the phrase "such as but not limited to," and is not to be interpreted as limiting the described embodiment to features, elements, and / or steps disclosed herein.
[0237] The methods and apparatuses of this disclosure can be implemented in a number of ways. For example, the methods and apparatuses of this disclosure can be implemented using software, hardware, firmware, or any combination of these. The above described order of steps for the methods is merely illustrative, and the steps of the methods of this disclosure are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, the disclosure can also be implemented as a program recorded in a recording medium, which includes machine readable instructions for implementing the methods according to the disclosure. Thus, the disclosure also covers a recording medium storing a program for executing the methods according to the disclosure.
[0238] It is also important to note that the devices, equipment, and methods of this disclosure can be embodied in a variety of ways. These variations are contemplated as being within the scope of the present disclosure.
[0239] The above description of the disclosed aspects is given for illustrative purposes and is not intended to limit the scope of the disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0240] The above description has been given for illustrative and descriptive purposes. In addition, this description is not intended to limit embodiments of the disclosure to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain modifications, permutations, additions, and sub-combinations thereof.
Claims
1. A method for generating routes in a panoramic map, characterized in that, include: Based on the first curve included in the panoramic map, obtain the first number of route coordinate points; Based on the first number of route coordinate points, determine the first number of second line segments of a preset length; A second number of triangular facets are determined based on a first number of the second line segments; Based on the second number of triangular facets, a strip-shaped target route corresponding to the first curve is determined; wherein, the width of the strip-shaped target route is the preset length; The step of determining the second number of triangular facets based on the first number of second line segments includes: Determine whether there are adjacent second line segments that intersect; In response to the existence of multiple adjacent second line segments having intersection points, the multiple second line segments having intersection points are replaced with multiple third line segments, and the second number of triangular facets are determined based on the multiple third line segments and the second line segments not having intersection points.
2. The method according to claim 1, characterized in that, The method of determining the second number of triangular facets based on the first number of second line segments further includes: In response to the absence of intersections between adjacent second line segments, a quadrilateral is determined based on every two adjacent second line segments, resulting in a third number of quadrilaterals. Based on the third number of quadrilaterals, the second number of triangular facets are determined.
3. The method according to claim 1, characterized in that, The step of replacing the plurality of second line segments with intersection points based on the plurality of third line segments, and determining the second number of triangular facets based on the plurality of third line segments and second line segments without intersection points, includes: In the plurality of second line segments with intersection points, the endpoint closer to the center of curvature is designated as the inner endpoint, and the endpoint on the other side is designated as the outer endpoint. The target point is determined based on multiple said inner endpoints; By connecting the multiple outer endpoints to the target point, the multiple third line segments are determined; The second number of triangular facets is determined based on the plurality of third line segments and the second line segments that do not intersect. The determination of the target point based on multiple inner endpoints includes: By connecting the multiple inner endpoints in the order of their corresponding route coordinates in the first curve, a second curve is obtained. The target point is determined based on the intersection of the second curve.
4. The method according to claim 3, characterized in that, The step of determining the second number of triangular facets based on the plurality of third line segments and the second line segments that do not intersect includes: Connecting the outer endpoints of adjacent third segments among the plurality of third segments yields at least one of the triangular facets; A quadrilateral is determined based on each pair of adjacent second line segments that do not intersect, resulting in multiple quadrilaterals. The second number of triangular facets is determined based on the plurality of quadrilaterals and at least one of the triangular facets.
5. The method according to any one of claims 1-4, characterized in that, Determining the strip-shaped target route corresponding to the first curve based on the second number of triangular facets includes: Based on the direction information corresponding to the first curve, the route direction is determined; Based on the route direction, determine the corresponding direction identifier and the color information corresponding to the direction identifier from the preset identifier library; Based on the vertex coordinate information corresponding to the triangular facet, the border coordinate information and border color information of the strip-shaped target route are determined; Based on the direction marker, the color information of the direction marker, the border coordinates, and the border color information, the strip target route corresponding to the first curve is determined.
6. The method according to claim 5, characterized in that, The step of determining the strip-shaped target route corresponding to the first curve based on the direction identifier, the color information of the direction identifier, the border coordinates, and the border color information includes: The direction identifier is rendered based on its color information to obtain the target direction identifier; The target direction marker is mapped onto the first layer corresponding to the strip-shaped target route; Based on the border coordinates, determine the two borders corresponding to the strip target route, and render the two borders based on the border color information to obtain the target border; The target border is mapped onto the second layer corresponding to the strip-shaped target route; The first layer and the second layer are superimposed to obtain the strip-shaped target route.
7. The method according to claim 6, characterized in that, The step of determining the strip target route corresponding to the first curve based on the direction identifier, the color information of the direction identifier, the border coordinates, and the border color information further includes: The background area and background color information corresponding to the strip target route are determined based on the border coordinates. The background area is rendered based on the background color information to obtain the target background area; The target background area is mapped onto the third layer corresponding to the strip-shaped target route; The process of overlaying the first layer and the second layer to obtain the strip-shaped target route includes: The first layer, the second layer, and the third layer are superimposed to obtain the strip-shaped target route.
8. The method according to any one of claims 1-4, characterized in that, The first number of route coordinate points are obtained based on the first curve included in the panoramic map, including: The first curve is sampled to obtain a first number of route coordinate points; wherein a preset number of coordinate points are sampled from each unit length of the first curve as the route coordinate points. The step of determining a first number of second line segments of a preset length based on the first number of route coordinate points includes: For each of the first number of route coordinate points, determine the normal of the first curve at that route coordinate point; Using the coordinate point of the route as the midpoint, generate a second line segment of the preset length along the normal direction.
9. A route generation device for panoramic maps, characterized in that, include: The coordinate point determination module is used to obtain a first number of route coordinate points based on a first curve included in the panoramic map. The second line segment module is used to determine a first number of second line segments of a preset length based on the first number of route coordinate points. The triangular facet module is used to determine a second number of triangular facets based on a first number of the second line segments; The route generation module is used to determine the strip-shaped target route corresponding to the first curve based on the second number of triangular facets; wherein the width of the strip-shaped target route is the preset length; The triangular facet module includes: An intersection confirmation unit is used to determine whether there are adjacent second line segments with an intersection point; The first facet determination unit is configured to, in response to the existence of multiple adjacent second line segments having intersection points, replace the multiple second line segments having intersection points with multiple third line segments, and determine the second number of triangular facets based on the multiple third line segments and the second line segments not having intersection points.
Citation Information
Patent Citations
Road depicting method and device and computer storage medium
CN111598970A
Three-dimensional path display method and device, readable storage medium and electronic equipment
CN114170381A