Road model construction method and device, equipment, storage medium and program product
By dynamically matching the coordinate information and sub-node segmentation of road path points and adjusting cross-section parameters in combination with road types, static modeling in the existing technology cannot meet the problem of intelligent driving model construction in dynamic environments, and a more flexible and adaptable road model construction method is realized.
Patent Information
- Application Number
- CN202510408162.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-07-11
AI Technical Summary
In the prior art, static modeling based on data acquired in advance cannot meet the real-time modeling requirements in dynamic environments, resulting in poor user experience of intelligent driving systems in complex and dynamically changing driving environments.
By obtaining the coordinate information of the road path point, dynamically match the target cross-section model, combining the interpolation subdivision of the distance values of the child nodes, refine the road geometry, and adjusting the cross-section parameters based on the road type to build the target road model.
实现了在复杂多变的道路环境中构建灵活、适应性强的道路模型,能够反映不同地形和交通状况的变化,提高了模型的实用性和适用性。
Smart Images

Figure CN120296978A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of model construction, and particularly relates to a method and device for constructing a road model, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the continuous improvement of the intelligence level of automobiles, the interaction between intelligent driving vehicles and the surrounding driving environment through environmental perception is also increasing continuously, and the driving environment has become an important and inseparable part of intelligent driving. The driving environment of an automobile involves roads, meteorological conditions, and traffic conditions, and its complexity and dynamic changes are the most critical factors affecting the performance of an automobile intelligent driving system.
[0003] In the prior art, there is mainly a static model solution that is constructed when the software is not running based on the length, width, etc. of the current model and objects that are known in advance. However, for the static modeling solution, since the data is obtained in advance during operation, it cannot meet the real-time modeling solution when dynamically obtaining data, nor can it construct a continuous model, which affects the user experience. Summary of the Invention
[0004] To solve the above technical problems, embodiments of the present application provide a method and device for constructing a road model, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] According to one aspect of the embodiments of the present application, a method for constructing a road model is provided, including: obtaining a set of path points corresponding to the road to be modeled, where the set of path points includes multiple path points and coordinate information corresponding to the multiple path points; determining a target cross-sectional model corresponding to a path point based on the coordinate information, and determining an initial road model of the road to be modeled based on the target cross-sectional model; determining a plurality of sub-nodes divided between two adjacent path points in the initial road model, and determining a target sub-cross-sectional model corresponding to each of the plurality of sub-nodes; obtaining the road type corresponding to the road to be modeled, and constructing a target road model based on the road type, the target sub-cross-sectional model, and the initial road model.
[0006] According to one aspect of the embodiments of the present application, the method further includes: determining the model type of the target sub-cross-sectional model corresponding to the sub-node and the rotation attitude corresponding to the target sub-cross-sectional model; determining the target attitude of the target sub-cross-sectional model of the sub-node based on the model type and the rotation attitude; optimizing the initial road model based on the target attitudes corresponding to the plurality of target sub-cross-sectional models to obtain an optimized initial road model.
[0007] According to one aspect of the embodiments of the present application, the method further includes: obtaining the node coordinate information corresponding to the child node and the adjacent node coordinate information corresponding to two adjacent child nodes of the child node; determining the slope information of the child node based on the node coordinate information and the adjacent node coordinate information; determining the target attitude corresponding to the target sub-cross-sectional model of the child node based on the slope information and the rotation attitude.
[0008] According to one aspect of the embodiments of the present application, the method further includes: obtaining the road type corresponding to the road to be modeled, so as to determine the texture image corresponding to the initial road model based on the road type; determining the texture coordinates of the target sub-cross-sectional model based on the slope information; determining the texture stretching value corresponding to the texture coordinates based on the texture image; rendering the optimized initial road model based on the texture stretching value, the texture image, and the texture coordinates to obtain the target road model.
[0009] According to one aspect of the embodiments of the present application, the method further includes: determining the horizontal coordinate component of the child node based on the model type corresponding to the target sub-cross-sectional model; determining the total distance value between two adjacent nodes, and determining the vertical coordinate component of the child node based on the total distance value; determining the texture coordinates corresponding to the target sub-cross-sectional model based on the horizontal component information and the vertical component information.
[0010] According to one aspect of the embodiments of the present application, optimizing the initial road model based on the target attitudes corresponding to multiple target sub-cross-sectional models includes: determining multiple vertices in the target sub-cross-sectional model, and determining multiple triangular cross-sections in the target sub-cross-sectional model based on the multiple vertices; determining the orientation information corresponding to each of the multiple triangular cross-sections based on the target attitude information; adding the multiple triangular cross-sections to the target sub-cross-sectional model based on the orientation information to obtain a triangular face model, and optimizing the initial road model based on the triangular face model.
[0011] According to one aspect of the embodiments of the present application, determining the initial road model of the road to be modeled based on the target cross-sectional model further includes: obtaining the adjacent target cross-sectional models corresponding to two adjacent path points and the model vertices corresponding to each of the adjacent target cross-sectional models; connecting the model vertices of the adjacent target cross-sectional models according to a preset strategy to obtain multiple triangular top surfaces; determining the initial road model of the road to be modeled based on the multiple triangular top surfaces.
[0012] According to one aspect of the embodiments of the present application, a road model construction device is provided, including: an acquisition module, configured to acquire a set of path points corresponding to the road to be modeled, where the set of path points includes a plurality of path points and coordinate information corresponding to the plurality of path points; a determination module, configured to determine a target cross-section model corresponding to a path point based on the coordinate information, and determine an initial road model of the road to be modeled based on the target cross-section model; a sub-node module, configured to determine a plurality of sub-nodes divided between two adjacent path points in the initial road model, and determine a target sub-cross-section model corresponding to each of the plurality of sub-nodes; a construction module, configured to acquire the road type corresponding to the road to be modeled, and construct a target road model based on the road type, the target sub-cross-section model, and the initial road model.
[0013] According to one aspect of the embodiments of the present application, an electronic device is provided, including: one or more processors; a storage device, configured to store one or more programs, when the one or more programs are executed by the one or more processors, enabling the electronic device to implement the road model construction method as described above.
[0014] According to one aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored, when the computer-readable instructions are executed by a processor of a computer, causing the computer to execute the road model construction method as described above.
[0015] According to one aspect of the embodiments of the present application, a computer program product is further provided, including a computer program, when the computer program is executed by a processor, implementing the steps in the road model construction method as described above.
[0016] In the technical solution provided by the embodiments of the present application, by dynamically matching the target cross-section model based on the path point coordinates, combined with the interpolation subdivision of the sub-node distance values, the refined expression of the road geometric shape is realized, and the cross-section parameters are dynamically adjusted based on the road type to adapt to more complex and changeable road shapes. On the basis of the initial road model, by dividing a plurality of sub-nodes between two adjacent path points, the road model can be further refined, and the target sub-cross-section model corresponding to each sub-node allows for fine-tuning of the road model in a local area, thereby enhancing the flexibility and adaptability of the model. This flexibility enables the model to better adapt to changes in different terrains, traffic flows, and road types, and can model according to the road type, ensuring that the target road model can reflect the characteristics and requirements of different types of roads, and improving the practicality and applicability of the model.
[0017] It should be understood that the above general description and subsequent detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings here are incorporated into the description and form a part of this description, showing embodiments consistent with this application, and are used together with the description to explain the principles of this application. Obviously, the accompanying drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, other accompanying drawings can be obtained based on these drawings without creative efforts. In the accompanying drawings:
[0019] Figure 1 is a schematic diagram of an implementation environment for constructing a road model shown in an exemplary embodiment of this application;
[0020] Figure 2 is a flowchart of a road model construction method shown in an exemplary embodiment of this application;
[0021] Figure 3 is a brief schematic diagram of path point splicing shown in an exemplary embodiment;
[0022] Figure 4 is a flowchart of a road model construction method shown in another exemplary embodiment of this application;
[0023] Figure 5 is a flowchart of a road model construction method shown in another exemplary embodiment of this application;
[0024] Figure 6 is a brief schematic diagram of splitting multiple sub-nodes between adjacent path points shown in an exemplary embodiment;
[0025] Figure 7 is a flowchart of a road model construction method shown in another exemplary embodiment of this application;
[0026] Figure 8 is a flowchart of a road model construction method shown in another exemplary embodiment of this application;
[0027] Figure 9 is a flowchart of a road model construction method shown in another exemplary embodiment of this application;
[0028] Figure 10 is a brief schematic diagram of a sub-node cross-section model shown in another exemplary embodiment of this application;
[0029] Figure 11 is a flowchart of a road model construction method shown in another exemplary embodiment of this application;
[0030] Figure 12 is a brief schematic diagram of road cross-section model splicing shown in another exemplary embodiment of this application;
[0031] Figure 13 It is a schematic diagram of the brief process for constructing a road model in an exemplary application scenario;
[0032] Figure 14 It is a block diagram of a road model construction device shown in an exemplary embodiment of the present application;
[0033] Figure 15 It shows a schematic diagram of the structure of a computer system of an electronic device suitable for implementing the embodiments of the present application. Detailed implementation manners
[0034] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0035] The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0036] The flowcharts shown in the drawings are only exemplary descriptions, and do not necessarily include all contents and operations / steps, nor do they necessarily need to be executed in the described order. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined. Therefore, the actual execution order may change according to the actual situation.
[0037] In the present application, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0038] With the rapid development of the automotive industry and the continuous progress of intelligent technologies, intelligent driving has become an important development direction in the automotive industry. Intelligent driving technology enables vehicles to autonomously perceive the surrounding environment, understand traffic rules, and make corresponding driving decisions by integrating advanced sensors, computer vision, artificial intelligence and other algorithms. Among them, 3D road model construction, as an important part of intelligent driving technology, provides accurate environmental perception and decision-making basis for vehicles.
[0039] Please refer toFigure 1 , Figure 1 is a schematic diagram of an implementation environment for road model construction during vehicle operation shown in an exemplary embodiment of the present application. As Figure 1 shown, during vehicle driving, a set of path points of the road to be modeled is obtained through the intelligent terminal 110 or the server terminal 120. Among them, the path points can be obtained according to the vehicle's navigation system, and the set of path points collectively includes multiple path points and coordinate information corresponding to the multiple path points. Then, the intelligent terminal 110 or the server terminal 120 determines the target cross-sectional model corresponding to the path node according to the coordinate information of the path node, and then splices the target cross-sectional models corresponding to the multiple path nodes to obtain the initial road model of the road to be modeled. Then, multiple sub-nodes can be divided between two adjacent path points in the initial road model, and then the distance values between the multiple sub-nodes and the starting point of the road to be modeled are determined. Then, the intelligent terminal 110 or the server terminal 120 constructs the target road model according to the road type corresponding to the road to be modeled, the distance values of the sub-nodes, and the initial road model, thereby realizing the dynamic construction of the road model. In addition, the implementation environment of the present application can also be realized through the joint implementation of the intelligent terminal 110 and the server terminal 120.
[0040] Among them, Figure 1 the intelligent terminal 110 shown can be any terminal device that can realize dynamic road model construction, such as a smart phone, an in-vehicle computer, a tablet computer, a laptop computer, or a wearable device, but is not limited thereto. Figure 1 The server terminal 120 shown, for example, can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, and is not limited here either.
[0041] With the continuous improvement of the intelligence level of automobiles, the interaction between intelligent driving vehicles and the surrounding driving environment through environmental perception is also increasing continuously. The driving environment has become an important and inseparable part of intelligent driving. The driving environment of automobiles involves roads, meteorological conditions, and traffic conditions, and its complexity and dynamic changes are the most critical factors affecting the performance of the intelligent driving system of automobiles.
[0042] In the prior art, there is mainly a static model solution that is constructed when the software is not running, based on the length, width, etc. of the current model and the object that are known in advance. However, for the static modeling solution, since the data is obtained in advance during runtime, it cannot meet the real-time modeling solution for dynamically obtaining data, nor can it construct continuous models of different types, thus affecting the user experience.
[0043] The problems pointed out above are generally applicable in the general road modeling scenario. It can be seen that static modeling based on known model data in the non-running state cannot meet the need to construct continuous models, affecting the user experience. To solve these problems, embodiments of the present application respectively propose a road model construction method, a road model construction device, an electronic device, a computer-readable storage medium, and a computer program product. The following will describe these embodiments in detail.
[0044] Please refer to Figure 2 , Figure 2 which is a flowchart of the road model construction method shown in an exemplary embodiment of the present application. This method can be applied to Figure 1 the implementation environment shown, and can be executed independently by the intelligent terminal 110 or the server side 120 in this implementation environment, or jointly executed by the intelligent terminal 110 and the server side 120. It should be understood that this method can also be applicable to other exemplary implementation environments and be specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment applicable to this method.
[0045] As Figure 2 shown, in an exemplary embodiment, the road model construction method at least includes steps S210 to S240, which are introduced in detail as follows:
[0046] Step S210, obtain a set of path points corresponding to the road to be modeled, where the set of path points includes multiple path points and coordinate information corresponding to the multiple path points.
[0047] Exemplarily, the set of path points corresponding to the road to be modeled can be obtained through the road name, the starting point and the ending point of the road, or by accessing the navigation system. Among them, the set of path points includes multiple path points on the road to be modeled and the coordinate information corresponding to the path points. Among them, the coordinate information usually includes the longitude and latitude information corresponding to the path points, and in this embodiment, the data obtained and used are all legally obtained in compliance with privacy and data protection regulations.
[0048] Step S220, determine the target cross-sectional model corresponding to the path point based on the coordinate information, and determine the initial road model of the road to be modeled based on the target cross-sectional model.
[0049] Continuing from the above-described embodiments, after determining the coordinate information corresponding to the path points, the target cross-sectional model corresponding to each path point can be determined according to the path point coordinate information. The target cross-sectional model describes the shape and dimensions of the road in the direction perpendicular to the path. Generally, the number of lanes, width, shoulder width, position of the drainage ditch, etc. are included in the target cross-sectional model. Furthermore, after having the set of path points and the target cross-sectional model corresponding to each path point, the initial road model can be pieced together according to the geographical relationship of the path points based on the target cross-sectional model corresponding to each path point.
[0050] Exemplarily, please refer to Figure 3 , according to the positional relationship of each path point in the set of path points, the target cross-sectional models of multiple path points are pieced together to obtain the initial road model corresponding to the road to be modeled. As Figure 3 shown, each path point corresponds to a cross-sectional model. Among them, the target cross-sectional model can be determined according to the road type corresponding to the path point. For example, if the road type corresponding to the path point includes road surface, bridge deck or tunnel, then if it is a road surface, the target cross-sectional model corresponding to the road surface is selected. If it is a bridge deck, the target cross-sectional model corresponding to the bridge deck is selected. Similarly, if it is a bridge deck, the target cross-sectional model corresponding to the bridge deck is selected.
[0051] Step S230, determine multiple sub-nodes divided between two adjacent path points in the initial road model, and determine the target sub-cross-sectional model corresponding to each of the multiple sub-nodes.
[0052] Exemplarily, in order to ensure a smooth transition between path points, especially the curved connection part between path points, multiple sub-nodes can be divided between two adjacent path points. Among them, the density and number of sub-nodes can be determined according to factors such as the road type, road curvature, and road length between two adjacent path points.
[0053] Optionally, in some implementable embodiments, it is also possible to introduce the Bezier curve algorithm between two adjacent path points in the initial road model, thereby realizing the subdivision of multiple sub-nodes between two adjacent path points. Among them, the Bezier curve is defined by a set of control points. The starting point and the ending point of the Bezier curve coincide with the first and the last control points respectively, while the intermediate control points affect the bending direction and degree of the curve through "interpolation". Among them, the core principle of the Bezier curve algorithm is based on the Bernstein polynomial, and the generation process of the curve is controlled by the parameter t (0 ≤ t ≤ 1). For example, for each pair of adjacent path points (P0, P1), at least one additional control point (usually called P') needs to be selected, and this control point will determine the bending direction and degree of the curve. Using the parametric equation of the Bezier curve, calculate the points on the curve according to the parameter t (0 ≤ t ≤ 1). In this embodiment, in order to obtain a smoother transition between adjacent path points, the value of the parameter t can be subdivided into multiple small segments between 0 and 1, and the points on the curve corresponding to each small segment are calculated. These subdivided points will become new path points (sub-nodes), and they will be distributed evenly or unevenly along the Bezier curve. In addition, by observing the generated curve and the subdivided path points, it may be necessary to adjust the positions of the control points to further optimize the smoothness of the curve, and through iteration until satisfied with the shape and smoothness of the curve, multiple control points are obtained. Take these multiple control points as the multiple sub-nodes between two adjacent path points, and then the target sub-cross-section model corresponding to the sub-node can be determined according to the coordinate information corresponding to the divided sub-node and the road type.
[0054] Step S240, obtain the road type corresponding to the road to be modeled, and construct the target road model based on the road type, the target sub-cross-section model, and the initial road model.
[0055] Exemplarily, the road type corresponding to the road to be modeled can be obtained. Among them, if there are multiple road types in the road to be modeled, then the multiple road types and the positional relationship of the multiple road types on the initial road model can be obtained, and then the initial road model is corrected according to the target sub-cross-section model corresponding to multiple sub-nodes to construct the target road model of the road to be modeled.
[0056] Optionally, in some feasible embodiments, the road type can be determined based on various factors such as the width of the road, design speed, traffic flow, functional classification, etc., such as highways, arterial roads, secondary arterial roads, branch roads, pedestrian streets, rural roads, etc. Next, based on the obtained road type, the given distance value (which may refer to the length of the road, the distance between certain key points, or the relative distance from other roads or landmarks, etc.) and an initial road model, a target road model will be constructed. The initial road model may be a road model simply spliced according to the target cross-sectional models of waypoints. After that, according to the road type, parameters such as the number of lanes, lane width, sidewalk width, and slope of the connection between waypoints of the initial road model are adjusted. For example, highways usually have more lanes and wider driving spaces, while rural roads may only have a single lane with a narrower driving space. Based on the initial road model, the structure and shape of the road can also be refined according to the positions and distance values of the child nodes, including features such as the bending, undulation, and intersection of the road, as well as the smooth connection between the target cross-sectional models in the initial road model.
[0057] In some embodiments of the present application, by dynamically matching the target cross-sectional model with waypoint coordinates and combining the interpolation subdivision of the child node distance values, the refined expression of the road geometry is realized, and the cross-sectional parameters are dynamically adjusted based on the road type to adapt to more complex and variable road shapes. Based on the initial road model, by dividing multiple child nodes between two adjacent waypoints, the road model can be further refined, and the target sub-cross-sectional model corresponding to each child node allows for fine-tuning of the road model in a local area, thereby enhancing the flexibility and adaptability of the model. This flexibility enables the model to better adapt to changes in different terrains, traffic flows, and road types, and modeling according to the road type can ensure that the target road model can reflect the characteristics and requirements of different types of roads, improving the practicality and applicability of the model.
[0058] Based on the above embodiments, please refer to Figure 4 , in one exemplary embodiment provided by the present application, the specific implementation process of the above road model construction method may further include steps S410 to S430, which are introduced in detail as follows:
[0059] Step S410, determining the model type of the target sub-cross-sectional model corresponding to the child node and the rotation attitude corresponding to the target sub-cross-sectional model;
[0060] Step S420, determining the target attitude of the target sub-cross-sectional model of the child node based on the model type and the rotation attitude;
[0061] Step S430, optimizing the initial road model based on the target attitudes corresponding to multiple target sub-cross-sectional models to obtain an optimized initial road model.
[0062] Continuing with the above embodiments, between two adjacent path points, a plurality of sub-nodes are divided according to the Bessel function, and the target sub-cross-sectional model corresponding to the sub-node is determined. Then, the rotation attitude corresponding to each target sub-cross-sectional model can be calculated, where the rotation attitude can be determined according to the vertex information in the target sub-cross-section. Optionally, according to the world coordinate information of the vertices (especially the coordinates of adjacent vertices), the normal information of each vertex in the target sub-cross-sectional model is calculated. This usually involves cross-multiplication and normalization operations of vectors. For example, according to the normal information of the vertices, the coordinate values in the horizontal direction, and the coordinate values in the vertical direction, geometric transformations (such as rotation matrices) are used to determine the rotation attitude of the target sub-cross-sectional model. Then, by traversing each vertex of the target sub-cross-sectional model and obtaining its original coordinate information (such as the coordinate relative to the model origin). The original coordinates of the vertices are converted into world coordinates. Then, the total distance from the starting point of each vertex to the ending point of each starting point in the target sub-cross-sectional model is calculated, which can be achieved by accumulating the straight-line distances between adjacent vertices, and the distance from the current vertex position to the starting point of the vertices in the target sub-cross-sectional model is calculated. Divide the current distance by the total distance to obtain the corresponding proportional value, and this proportional value will be used to determine the coordinate value in the vertical direction of the vertex. In some implementable embodiments, the proportional value can be multiplied by the maximum or minimum height in the vertical direction of the target sub-cross-sectional model (depending on the specific situation) to obtain the coordinate value in the vertical direction of the vertex.
[0063] In some implementable embodiments, the total number of vertices of the target sub-cross-section can be determined according to the model type corresponding to the target sub-cross-sectional model. According to the number of vertices, the triangular face model formed by the vertices in the target sub-cross-sectional model is determined. Furthermore, according to the triangular face model, the orientation value corresponding to each vertex can be determined. Then, according to the orientation value, the Euler rotation value corresponding to each vertex in the target sub-cross-section is calculated. The Euler angles usually consist of three angles, respectively representing rotations around three different axes. These three axes are usually perpendicular to each other and can be fixed (external rotation) or relative to the object itself (internal rotation). After obtaining the Euler rotation value of each vertex, the orientation value of the target sub-cross-sectional model can be calculated. Then, according to the orientation value of the target sub-cross-sectional model, its corresponding Euler rotation value is determined. Then, according to the Euler rotation value, the rotation attitude corresponding to the target sub-cross-sectional model is determined. Furthermore, according to the model type corresponding to the sub-node and its rotation attitude, the target attitude of the target sub-cross-sectional model can be determined. Furthermore, according to the target attitudes of the target sub-cross-sectional models corresponding to multiple sub-nodes, the initial road model is optimized, and then the optimized initial road model is obtained.
[0064] In some embodiments of the present application, by determining the model type of the target sub-cross-sectional model of each sub-node, it can be ensured that the road model can adopt the most suitable cross-sectional design under different road sections, different traffic flows, different topographies, etc. This precise matching helps to improve the overall accuracy and applicability of the road model, and through the multiple sub-nodes cut out, the rigid connection between path points during the modeling process can be avoided, and the smoothness of the connection of the cross-sectional models of the path points can be improved.
[0065] Based on the above embodiments, please refer to Figure 5 , in one exemplary embodiment provided by the present application, the specific implementation process of the above road model construction method may further include steps S510 to S530, which are introduced in detail as follows:
[0066] Step S510, obtain the node coordinate information corresponding to the sub-node and the adjacent node coordinate information corresponding to the two sub-nodes adjacent to the sub-node;
[0067] Step S520, determine the slope information of the sub-node based on the node coordinate information and the adjacent node coordinate information;
[0068] Step S530, determine the target posture corresponding to the target sub-cross-sectional model of the sub-node based on the slope information and the rotation posture.
[0069] Exemplarily, first, it is necessary to obtain the coordinate information of each child node in the three-dimensional space, and this coordinate information can be obtained through various means such as measurement and Geographic Information System (GIS) data. In addition to the coordinates of the child node itself, it is also necessary to obtain the coordinate information of two adjacent child nodes to the child node. The coordinates of these adjacent nodes will be used to calculate the slope of the child node. With the coordinate information of the child node and its adjacent nodes, geometric methods or numerical methods can be used to calculate the slope of the child node. The slope is usually defined as the angle between the road direction (i.e., the direction of the line connecting adjacent nodes) and the horizontal plane, or more simply, it can be expressed as the ratio between the projection of the line connecting adjacent nodes on the horizontal plane and the vertical direction. In the three-dimensional space, the calculation of the slope may be more complex because the change of the Z-axis (elevation) needs to be considered. However, for most road modeling, the main concern is the slope change on the horizontal plane, so the calculation process can be simplified. According to the calculated slope information, the rotation angle that the target sub-cross-section model corresponding to the child node needs to rotate can be determined, and this angle should make the direction of the cross-section model consistent with the road direction to ensure the continuity and smoothness of the road. In addition to the slope, other factors such as road type, design standards, and traffic demands need to be considered when determining the rotation attitude. These factors may affect the selection of the cross-section model and the determination of the rotation attitude. Finally, the determined rotation attitude is applied to the target sub-cross-section model to correctly place and orient it in the three-dimensional space.
[0070] Optionally, please refer to Figure 6 , following the above embodiments, multiple child nodes are divided between two adjacent path points, and then the target sub-cross-section model of the child node can be determined according to the corresponding coordinate information of the child node, and the slope information of the child node can be calculated according to two adjacent child nodes to the child node. As Figure 6 shown, the left slope of child node a2 can be calculated based on child node a1, and the right slope of child node a2 can be calculated based on child node a3. Furthermore, the slope information corresponding to child node a2 can be determined according to the left slope and right slope of child node a2, and then the target attitude corresponding to the target sub-cross-section model can be determined according to the slope information and the rotation attitude corresponding to the target sub-cross-section model of the child node.
[0071] In some embodiments of the present application, determining the slope information according to the coordinate information of the child node helps to determine the position and state of the child node in the road model, and the slope information and the rotation attitude jointly determine the target attitude of the target sub-cross-section model of the child node. And the model constructed in this way is more in line with the actual situation and can more accurately reflect the stress state and deformation of the child node in the overall structure.
[0072] Based on the above embodiments, please refer toFigure 7 , in one exemplary embodiment provided by the present application, the specific implementation process of the above road model construction method may further include steps S710 to S740, which are introduced in detail as follows:
[0073] Step S710, obtain the road type corresponding to the road to be modeled, so as to determine the texture image corresponding to the initial road model based on the road type;
[0074] Step S720, determine the texture coordinates of the target sub-cross-section model based on the slope information;
[0075] Step S730, determine the texture stretching value corresponding to the texture coordinates based on the texture image;
[0076] Step S740, render the optimized initial road model based on the texture stretching value, the texture image, and the texture coordinates to obtain the target road model.
[0077] Exemplarily, it is necessary to determine the road type corresponding to the road to be modeled (such as highway, urban road, rural path, etc.). According to the road type, the corresponding texture image is selected from the texture library. These texture images usually contain information such as road surface materials, colors, and marking lines that match the road type. The slope information usually refers to the inclination degree of the road cross-section, which can be obtained through geometric analysis of the road model. To ensure that the texture can be correctly mapped onto the road model and stretched or compressed correctly as the road inclines, the corresponding coordinates of the target sub-cross-section model (i.e., the part to be rendered) on the texture image can also be calculated based on the slope information. Then, analyze the texture image, and according to the shape and size of the target sub-cross-section model, as well as the preset texture mapping rules, calculate the stretching value corresponding to each texture coordinate. These stretching values ensure that the texture looks continuous, non-distorted, and matches the shape of the model on the model. Considering the slope information, the texture may need more stretching in the inclined part, while remaining the same or slightly stretched in the flat part. Finally, the optimized initial road model can be rendered according to the texture stretching value, the texture information, and the texture coordinates. During the rendering process, ensure that the texture is correctly mapped to each part of the road model and stretched or compressed appropriately according to the slope information. The final obtained target road model will have a visual effect similar to that of a real road, including correct texture mapping and stretching effects.
[0078] In some embodiments of the present application, the texture image of the road type matching model can be more visually consistent with the characteristics of the actual road, enhancing the realism of the model. Then, based on the slope information, the texture coordinates of the target sub-cross-section model are determined, which can ensure the correct mapping of the texture on the model and avoid texture misalignment or breakage. According to the texture image and texture coordinates, the texture stretching value is calculated, which can ensure the uniform distribution and appropriate size of the texture on the model surface, guaranteeing the clarity and detail performance of the texture.
[0079] Based on the above embodiments, please refer to Figure 8 , in one exemplary embodiment provided by the present application, the specific implementation process of the above road model construction method may further include steps S810 to S830, which are introduced in detail as follows:
[0080] Step S810: Determine the horizontal coordinate information of the sub-node based on the model type corresponding to the target sub-cross-section model;
[0081] Step S820: Determine the total distance value between two adjacent nodes, and determine the vertical coordinate component of the sub-node based on the total distance value;
[0082] Step S830: Determine the texture component corresponding to the target sub-cross-section model based on the horizontal coordinate information and the vertical coordinate information.
[0083] Exemplarily, in 3D modeling and computer graphics, texture coordinates (also known as UV coordinates) are the key information for mapping a 2D texture onto the surface of a 3D model. When it comes to determining the texture coordinates of the target sub-cross-section model based on slope information, in the UV coordinate system, U and V are two basic coordinate components, which together define the position of a point on the texture image relative to the texture origin; U coordinate: Usually represents the position of the texture image in the horizontal direction (width). The range of U values is from 0 to 1 (in some cases, such as when using texture repetition or mirroring, the U value may exceed this range), where 0 represents the leftmost end of the texture and 1 represents the rightmost end of the texture. By changing the U value, the point can be horizontally moved on the texture image; V coordinate: Represents the position of the texture image in the vertical direction (height). Similar to the U coordinate, the range of V values is also from 0 to 1 (similarly, it may exceed this range in specific cases), where 0 represents the lowermost end of the texture and 1 represents the uppermost end of the texture. By adjusting the V value, the point can be vertically moved on the texture image.
[0084] In some realizable embodiments, the U value corresponding to the child node, i.e., the horizontal coordinate component, can be determined according to the model type corresponding to the target sub-cross-sectional model of the child node. Then, based on the total length of the child node and the distance value from the vertex in the child node to the starting point, according to the ratio between this distance value and the total length, the V value in the UV value, i.e., the vertical coordinate component, can be determined. Combining the previously determined horizontal coordinate component and vertical coordinate component to generate the texture coordinates of the target sub-cross-sectional model. Texture coordinates are usually used to map a 2D texture image onto a 3D model. Each child node will have a corresponding texture coordinate, which indicates the part of the texture image that should be used to render the child node. By converting the horizontal coordinate component and vertical coordinate component into coordinates in the texture space (usually U and V coordinates), it can be ensured that the texture is correctly mapped onto each child node of the model, and the accuracy and consistency of the texture coordinates can be ensured, so as to obtain high-quality visual effects during the rendering process.
[0085] In some embodiments of the present application, the horizontal coordinate component of the child node is accurately determined by the model type. This step ensures the accuracy of the model in the horizontal direction, and the vertical coordinate component is determined based on the total distance value between adjacent nodes, ensuring the accuracy of the model in the vertical direction. This precise coordinate determination method helps to construct a model that highly matches the actual structure, improving the user experience.
[0086] Based on the above embodiments, please refer to Figure 9 , in one exemplary embodiment provided by the present application, the specific implementation process of optimizing the initial road model based on the target postures corresponding to multiple target sub-cross-sectional models may further include steps S910 to S930, which are introduced in detail as follows:
[0087] Step S910: Determine multiple vertices in the target sub-cross-sectional model, and determine multiple triangular cross-sections in the target sub-cross-sectional model based on the multiple vertices;
[0088] Step S920: Determine the orientation information corresponding to each of the multiple triangular cross-sections based on the target posture information;
[0089] Step S930: Add the multiple triangular cross-sections to the target sub-cross-sectional model based on the orientation information to obtain a triangular mesh model, and optimize the initial road model based on the triangular mesh model.
[0090] Exemplarily, please refer to Figure 10 , in the target sub-cross-sectional model, there are multiple vertices. Among them, a triangular cross-section can be generated based on three adjacent vertices in sequence, such as Figure 10As shown, adjacent vertex a, vertex b, and vertex c can form a triangular cross-section. Similarly, adjacent vertex b, vertex c, and vertex d can also form a triangular cross-section. The orientation information corresponding to multiple triangular cross-sections can be determined based on the target pose information corresponding to the child nodes. Then, multiple triangular cross-sections are added to the target sub-cross-section model according to the orientation information, thereby obtaining an optimized initial road model.
[0091] Optionally, as Figure 10 shown, three adjacent vertices (such as a, b, c) are selected to form a triangular cross-section. This triangular cross-section represents a local area of the road cross-section. In sequence, the next set of three adjacent vertices (such as b, c, d) is selected to form another triangular cross-section, and this process is repeated until all adjacent vertices are used to generate triangular cross-sections. For each triangular cross-section, its orientation needs to be determined according to the target pose information corresponding to the child nodes. The target pose information may include the inclination angle, curvature, direction, etc. of the road. Among them, the orientation information can be obtained by calculating the vectors between vertices, normal vectors, or using other geometric methods. Then, according to the determined orientation information, each triangular cross-section is correctly added to the target sub-cross-section model. By adding multiple triangular cross-sections to the model, a more refined and accurate representation of the road cross-section can be constructed. This optimized initial road model can be used for subsequent road design, simulation, analysis, or visualization tasks.
[0092] In some realizable embodiments, once the vertices of the sub-cross-section model are determined, the next step is to use these vertices to create triangular cross-sections. A triangular cross-section is a planar figure defined by three vertices, and they together form the surface of the model. The process of creating triangular cross-sections usually involves connecting the vertices into a triangular mesh. Therefore, the pose information of the target sub-cross-section model needs to be considered. The pose information may include the rotation, inclination, or other deformations of the model. For each triangular cross-section, its orientation information, that is, its direction in three-dimensional space, needs to be determined. This usually involves calculating the normal vector of the triangular cross-section, which is perpendicular to the plane of the triangular cross-section. The orientation information is crucial for subsequent rendering, lighting, and shadow calculations. Therefore, the triangular cross-sections with orientation information can be combined to form a complete triangular face model. This model now contains the geometric shape, surface details, and orientation information of the target sub-cross-section. Among them, the triangular face model is a commonly used representation in computer graphics because it can effectively render complex three-dimensional shapes. The triangular face model is used to optimize the initial road model. By combining the details of the triangular face model and the overall structure of the initial road model, a more refined and realistic road model can be created.
[0093] In some embodiments of the present application, by determining multiple vertices in the target sub-cross-sectional model, the contour and shape of the model can be accurately constructed. Moreover, the multiple triangular cross-sections constructed based on these vertices can more precisely describe the surface features of the model, improve the accuracy of the model, and optimize the initial road model through the triangular surface model, thereby reducing the redundant information of the model and improving the efficiency of generating the road model.
[0094] Based on the above embodiments, please refer to Figure 11 , in one exemplary embodiment provided by the present application, the specific implementation process of determining the initial road model of the road to be modeled based on the target cross-sectional model may further include steps S1110 to S1130, which are introduced in detail as follows:
[0095] Step S1110: Obtain the adjacent target cross-sectional models corresponding to two adjacent path points and the model vertices corresponding thereto on each of the adjacent target cross-sectional models.
[0096] Step S1120: Connect the model vertices of the adjacent target cross-sectional models according to a preset strategy to obtain multiple triangular top surfaces.
[0097] Step S1130: Determine the initial road model of the road to be modeled based on the multiple triangular top surfaces.
[0098] Please refer to Figure 12 , Figure 12 is a schematic diagram showing the connection of two target cross-sectional models shown in an exemplary embodiment of the present application. Among them, the number of vertices on each target cross-sectional model is fixed, and the total number of model vertices composed of the cross-sections of multiple target cross-sectional models can be calculated. The composition of the entire road model can be regarded as composed of different cross-sectional vertices on this model, which are grouped into triangular top surfaces in groups of three and in different orders, and the adjacent cross-sections are connected to form the final overall model. As Figure 12 shown, in the clockwise direction, the 7th vertex, 60th vertex, and 8th vertex on two adjacent target cross-sectional models can form a triangular top surface. Similarly, the target cross-sectional models corresponding to multiple path points can be connected to finally obtain the initial road model.
[0099] Optionally, in some feasible embodiments, first, based on road design or measurement data, two adjacent path points (usually representing key turning points or control points of the road) are determined. For each path point, a corresponding target cross-sectional model is selected or generated, and these cross-sectional models usually represent the width, shape, and characteristics of the road at the given path point. Then, model vertices are extracted from each target cross-sectional model, where these vertices define the boundaries and internal details of the cross-section. With the vertices of adjacent target cross-sectional models, the next step is to connect these vertices according to a preset strategy to form multiple triangular top surfaces. In this embodiment, the preset strategy may include selecting a specific vertex connection method (such as directly connecting adjacent vertices, generating smooth transitions using interpolation points, etc.), and determining the direction of the triangular top surface (usually determined by calculating the normal vector). Furthermore, by connecting the vertices of all adjacent cross-sectional models and generating triangular top surfaces, a continuous, three-dimensional road surface can be obtained, and this surface constitutes the initial road model of the road to be modeled. In addition, the model can be smoothed, texture mapped, and other detail optimizations can be performed to meet the final visual effects and performance requirements.
[0100] In some embodiments of the present application, by connecting the model vertices of adjacent target cross-sectional models according to a preset strategy, the continuity of the road model in the longitudinal and transverse directions can be ensured. Precise vertex connection helps to avoid problems such as breaks, misalignments, or overlaps in the model, thereby improving the accuracy and credibility of the model. And by forming multiple triangular top surfaces with the model vertices of adjacent cross-sectional models, the surface characteristics of the road model can be described more flexibly, and the smoothness of the splicing of the target cross-sectional models can be improved.
[0101] Figure 13 It is a schematic diagram of a brief process for constructing a road model in an exemplary application scenario. In Figure 13In the application scenario shown, obtain the set of path points corresponding to the road to be modeled. The set of path points includes multiple path points and the coordinate information corresponding to the multiple path points. Furthermore, based on the coordinate information corresponding to the path points, determine the target cross-sectional model corresponding to the path points. Then, based on the target cross-sectional models corresponding to each path point, determine the initial road model of the road to be modeled. And multiple sub-nodes can be divided between two adjacent path points in the initial road model, and determine the target sub-cross-sectional model corresponding to the sub-nodes. Determine the model type of the target sub-cross-sectional model corresponding to the sub-nodes and the rotation posture corresponding to the target sub-cross-sectional model; determine the target posture of the target sub-cross-sectional model of the sub-nodes based on the model type and the rotation posture; optimize the initial road model based on the target postures corresponding to the multiple target sub-cross-sectional models to obtain the optimized initial road model. Obtain the road type corresponding to the initial road model to determine the texture image corresponding to the initial road model based on the road type; determine the texture coordinates of the target sub-cross-sectional model based on the slope information; determine the texture stretching value corresponding to the texture coordinates based on the texture image; render the optimized initial road model based on the texture stretching value, the texture image, and the texture coordinates to obtain the target road model. For the detailed implementation process, please refer to the descriptions in the foregoing embodiments, and details will not be repeated here.
[0102] Figure 14 It is a block diagram of a road model construction device shown in an exemplary embodiment of the present application. This device can be applied to Figure 1 the implementation environment shown, and is specifically configured in the intelligent terminal 110 or the server 120. This device can also be applicable to other exemplary implementation environments and is specifically configured in other devices. This embodiment does not limit the implementation environment applicable to this device.
[0103] As Figure 14 shown, this exemplary road model construction device includes: an acquisition module 1410, configured to acquire a set of path points corresponding to the road to be modeled, where the set of path points includes multiple path points and the coordinate information corresponding to the multiple path points; a determination module 1420, configured to determine the target cross-sectional model corresponding to the path points based on the coordinate information, and determine the initial road model of the road to be modeled based on the target cross-sectional model; a sub-node module 1430, configured to determine multiple sub-nodes divided between two adjacent path points in the initial road model, and determine the target sub-cross-sectional model corresponding to each of the multiple sub-nodes; a construction module 1440, configured to acquire the road type corresponding to the road to be modeled, and construct a target road model based on the road type, the target sub-cross-sectional model, and the initial road model.
[0104] According to one aspect of the embodiments of the present application, the construction module 1440 is further configured to determine the model type of the target sub-cross-sectional model corresponding to the sub-node and the rotation attitude corresponding to the target sub-cross-sectional model; determine the target attitude of the target sub-cross-sectional model of the sub-node based on the model type and the rotation attitude; optimize the initial road model based on the target attitudes corresponding to multiple target sub-cross-sectional models to obtain an optimized initial road model.
[0105] According to one aspect of the embodiments of the present application, the construction module 1440 is further configured to obtain the node coordinate information corresponding to the sub-node and the adjacent node coordinate information corresponding to two adjacent sub-nodes of the sub-node; determine the slope information of the sub-node based on the node coordinate information and the adjacent node coordinate information; determine the target attitude corresponding to the target sub-cross-sectional model of the sub-node based on the slope information and the rotation attitude.
[0106] According to one aspect of the embodiments of the present application, the above-mentioned construction module 1440 is further configured to obtain the road type corresponding to the road to be modeled, so as to determine the texture image corresponding to the initial road model based on the road type; determine the texture coordinates of the target sub-cross-sectional model based on the slope information; determine the texture stretching value corresponding to the texture coordinates based on the texture image; render the optimized initial road model based on the texture stretching value, the texture image and the texture coordinates to obtain a target road model.
[0107] According to one aspect of the embodiments of the present application, the above-mentioned construction module 1440 is further configured to determine the horizontal coordinate component of the sub-node based on the model type corresponding to the target sub-cross-sectional model; determine the total distance value between two adjacent nodes, and determine the vertical coordinate component of the sub-node based on the total distance value; determine the texture coordinates corresponding to the target sub-cross-sectional model based on the horizontal component information and the vertical component information.
[0108] According to one aspect of the embodiments of the present application, the above-mentioned construction module 1440 is further configured to optimize the initial road model based on the target attitudes corresponding to multiple target sub-cross-sectional models, including: determining multiple vertices in the target sub-cross-sectional model, and determining multiple triangular cross-sections in the target sub-cross-sectional model based on the multiple vertices; determining the orientation information corresponding to each of the multiple triangular cross-sections based on the target attitude information; adding the multiple triangular cross-sections to the target sub-cross-sectional model based on the orientation information to obtain a triangular surface model, and optimizing the initial road model based on the triangular surface model.
[0109] According to one aspect of the embodiments of the present application, the above-mentioned determination module 1420 is further configured to obtain the adjacent target cross-sectional models corresponding to two adjacent path points and the model vertices corresponding to each of the adjacent target cross-sectional models; connect the model vertices of the adjacent target cross-sectional models according to a preset strategy to obtain multiple triangular top surfaces; determine the initial road model of the road to be modeled based on the multiple triangular top surfaces.
[0110] It should be noted that the road model construction device provided in the above embodiments and the road model construction method provided in the above embodiments belong to the same concept. The specific ways in which each module and unit perform operations have been described in detail in the method embodiments and will not be elaborated here. In practical applications, the road model construction device provided in the above embodiments can, as needed, allocate the above functions to different functional modules, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here either.
[0111] An embodiment of the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the road model construction method provided in each of the above embodiments.
[0112] Figure 15 The structural schematic diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application is shown. It should be noted that Figure 15 The computer system 1500 of the electronic device shown is only an example and should not impose any restrictions on the functions and usage scope of the embodiments of the present application.
[0113] As Figure 15 shown, the computer system 1500 includes a central processing unit (CPU) 1501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1502 or the program loaded from the storage section 1508 into the random access memory (RAM) 1503, such as executing the method in the above embodiments. In the RAM 1503, various programs and data required for system operations are also stored. The CPU 1501, ROM 1502, and RAM 1503 are connected to each other through a bus 1504. The input / output (I / O) interface 1505 is also connected to the bus 1504.
[0114] The following components are connected to the I / O interface 1505: an input section 1506 including a keyboard, a mouse, etc.; an output section 1507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. The drive 1510 is also connected to the I / O interface 1505 as needed. A removable medium 1511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1510 as needed so that a computer program read from it can be installed into the storage section 1508 as needed.
[0115] Specifically, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1509, and / or installed from the removable medium 1511. When the computer program is executed by the central processing unit (CPU) 1501, various functions defined in the system of the present application are executed.
[0116] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a 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 above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0117] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0118] The units involved in the embodiments described in this application can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not constitute a limitation on the units themselves in some cases.
[0119] Another aspect of this application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for constructing a road model as described above is implemented. The computer-readable storage medium can be included in the electronic device described in the above embodiments, or can exist alone without being assembled into the electronic device.
[0120] Another aspect of this application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for constructing a road model provided in the above embodiments.
[0121] The above content is only a preferred exemplary embodiment of this application and is not used to limit the implementation of this application. Those of ordinary skill in the art can easily make corresponding adaptations or modifications according to the main concept and spirit of this application. Therefore, the protection scope of this application should be subject to the protection scope required by the claims.
Claims
1. A method for constructing a road model, characterized in that Including: Obtain a set of path points corresponding to the road to be modeled, where the set of path points includes multiple path points and coordinate information corresponding to the multiple path points; Determine a target cross-section model corresponding to a path point based on the coordinate information, and determine an initial road model of the road to be modeled based on the target cross-section model; Determine multiple sub-nodes divided between two adjacent path points in the initial road model, and determine a target sub-cross-section model corresponding to each of the multiple sub-nodes; Obtain the road type corresponding to the road to be modeled, and construct a target road model based on the road type, the target sub-cross-section model, and the initial road model.
2. The method according to claim 1, wherein The method further includes: Determine the model type of the target sub-cross-section model corresponding to the sub-node and the rotation posture corresponding to the target sub-cross-section model; Determine the target posture of the target sub-cross-section model of the sub-node based on the model type and the rotation posture; Optimize the initial road model based on the target postures corresponding to multiple target sub-cross-section models to obtain an optimized initial road model.
3. The method according to claim 2, wherein The method further includes: Obtain the node coordinate information corresponding to the sub-node and the adjacent node coordinate information corresponding to two adjacent sub-nodes of the sub-node; Determine the slope information of the sub-node based on the node coordinate information and the adjacent node coordinate information; Determine the target posture corresponding to the target sub-cross-section model of the sub-node based on the slope information and the rotation posture.
4. The method according to claim 3, wherein The method further includes: Obtain the road type corresponding to the road to be modeled, so as to determine the texture image corresponding to the initial road model based on the road type; Determine the texture coordinates of the target sub-cross-section model based on the slope information; Determine the texture stretching value corresponding to the texture coordinates based on the texture image; Render the optimized initial road model based on the texture stretching value, the texture image, and the texture coordinates to obtain a target road model.
5. The method according to claim 4, wherein The method further includes: Determine the horizontal coordinate component of the sub-node based on the model type corresponding to the target sub-cross-section model; Determine the total distance value between two adjacent nodes, and determine the vertical coordinate component of the sub-node based on the total distance value; Determine the texture coordinates corresponding to the target sub-cross-section model based on the horizontal component information and the vertical component information.
6. The method according to claim 5, wherein The optimizing the initial road model based on the target postures corresponding to multiple target sub-cross-section models includes: Determine multiple vertices in the target sub-cross-section model, and determine multiple triangular cross-sections in the target sub-cross-section model based on the multiple vertices; Determine the orientation information corresponding to each of the multiple triangular cross-sections based on the target posture information; Add the multiple triangular cross-sections to the target sub-cross-section model based on the orientation information to obtain a triangular face model, and optimize the initial road model based on the triangular face model.
7. The method according to claim 1, characterized in that, The determining the initial road model of the road to be modeled based on the target cross-section model further includes: Obtain the adjacent target cross-section models corresponding to the two adjacent path points and the model vertices corresponding to the adjacent target cross-section models respectively; Connect the model vertices of the adjacent target cross-section models according to a preset strategy to obtain a plurality of triangular top surfaces; Determine an initial road model of the road to be modeled based on the plurality of triangular top surfaces.
8. A road model construction device, characterized in that, The device includes: An acquisition module, configured to acquire a set of path points corresponding to a road to be modeled, where the set of path points includes a plurality of path points and coordinate information corresponding to the plurality of path points; A determination module, configured to determine a target cross-section model corresponding to a path point based on the coordinate information, and determine an initial road model of the road to be modeled based on the target cross-section model; A sub-node module, configured to determine a plurality of sub-nodes divided between two adjacent path points in the initial road model, and determine a target sub-cross-section model corresponding to each of the plurality of sub-nodes; A construction module, configured to acquire a road type corresponding to the road to be modeled, and construct a target road model based on the road type, the target sub-cross-section model, and the initial road model.
9. An electronic device, characterized in that, Includes: One or more processors; A storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, enable the electronic device to implement the road model construction method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer-readable instruction is stored thereon, and when the computer-readable instruction is executed by a processor of a computer, the computer executes the road model construction method according to any one of claims 1 to 7.