Electronic Map Rendering Method, Device, Equipment and Computer Program Product
By calculating and dissolving the projection distance of pixel points in a three-dimensional electronic map, the problem of high buildings blocking roads is solved, the effect of displaying blocked roads is achieved, and navigation interactivity and intelligence are improved.
Patent Information
- Application Number
- CN202110181984.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-09
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2041-02-09
AI Technical Summary
In the three-dimensional electronic map, tall buildings block the road, causing users to be unable to see the blocked road, affecting the navigation effect.
By obtaining the center coordinates of the current field of view range, the forward direction of the field of view and the vertex coordinates of the object under the coordinate system of the three-dimensional map, the projection distance of the pixel points in the pixel area is calculated, and the pixel points whose projection distance meets the set conditions are dissolved to show a path with a low degree of occlusion.
It realizes displaying blocked roads while maintaining the presence of the building, improving the interactivity and intelligence of electronic map rendering.
Smart Images

Figure CN112800162B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technologies, and in particular, to a method, device, equipment, and computer program product for rendering an electronic map. Background Art
[0002] Currently, people often use electronic maps for navigation during travel. Traditional electronic maps are two-dimensional maps. In order to enable users to obtain a more intuitive and vivid visual experience, three-dimensional electronic maps have emerged, that is, in the electronic map, objects such as buildings are three-dimensional.
[0003] When a user uses an electronic map, it is necessary to render the electronic map based on the user's position, that is, to render the objects within the field of view that match the user's position in the electronic map. Although in the three-dimensional field of view, the display of objects such as buildings makes the rendering effect of the map more vivid and realistic, however, in the three-dimensional field of view, objects such as buildings with height will block the display of nearby roads, making users unable to see the blocked roads and affecting the navigation effect.
[0004] Currently, assuming that a three-dimensional building blocks a road, one solution is to not display the building that blocks the road, or to set the transparency of the building that blocks the road to 0 during rendering, that is, to display the building transparently. This solution is imperceptible to the user, that is, the user cannot perceive the existence of the corresponding building, with poor interactivity and low intelligence level. Summary of the Invention
[0005] Embodiments of the present invention provide a method, device, equipment, and computer program product for rendering an electronic map, which can improve the interactive experience and intelligence level of electronic map rendering.
[0006] In a first aspect, an embodiment of the present invention provides a method for rendering an electronic map, the method including:
[0007] Obtaining the central coordinate, the field-of-view forward direction, and the vertex coordinates of the objects included in the electronic map to be displayed on the screen corresponding to the current field of view in a three-dimensional map coordinate system;
[0008] Determining the projection distance of the vector line segment formed by the vertex coordinates and the central coordinate in the horizontal projection direction of the field-of-view forward direction;
[0009] Determining the pixel area corresponding to the object on the screen according to the vertex coordinates;
[0010] Determining the projection distance corresponding to the pixel points in the pixel area according to the projection distance corresponding to the vertex coordinates;
[0011] Dissolve the pixel points within the pixel region whose projection distance meets the set conditions.
[0012] In a second aspect, an embodiment of the present invention provides an electronic map rendering device, which includes:
[0013] An acquisition module, configured to acquire the central coordinates of the current field of view range, the forward direction of the field of view, and the vertex coordinates of the objects included in the electronic map to be displayed on the screen corresponding to the current field of view range in the three-dimensional map coordinate system;
[0014] A first determination module, configured to determine the projection distance of the vector line segment formed by the vertex coordinates and the central coordinates in the horizontal projection direction of the forward direction of the field of view;
[0015] A second determination module, configured to determine the pixel region corresponding to the object on the screen according to the vertex coordinates;
[0016] A third determination module, configured to determine the projection distance corresponding to the pixel points in the pixel region according to the projection distance corresponding to the vertex coordinates;
[0017] A rendering module, configured to dissolve the pixel points within the pixel region whose projection distance meets the set conditions.
[0018] In a third aspect, an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a screen; wherein, an executable code is stored on the memory, and when the executable code is executed by the processor, the processor can at least implement the electronic map rendering method as described in the first aspect, and the processor includes a graphics processor.
[0019] In a fourth aspect, an embodiment of the present invention provides a computer program product, including: a computer program, when the computer program is executed by the processor of an electronic device, the processor can at least implement the electronic map rendering method as described in the first aspect.
[0020] During the rendering process of a three-dimensional electronic map, it can be imagined that there is a virtual camera in the air of the three-dimensional space. When a certain user triggers the display of the electronic map, the camera follows the user to display an electronic map containing map elements (such as buildings, roads, bridges, etc.) within a set range around the user on the terminal screen.
[0021] Based on this, during the process of displaying an electronic map on a screen, first, the central coordinate of the current field of view range, the forward direction of the field of view, and the vertex coordinates of the objects included in the electronic map to be displayed on the screen corresponding to the current field of view range are obtained in the three-dimensional map coordinate system. Herein, the field of view in this article is the field of view of the above-mentioned camera, and the current field of view range corresponds to the physical area corresponding to the electronic map currently required to be displayed on the screen; the central coordinate of the current field of view range can be considered to be close to the user's position; the forward direction of the field of view refers to the direction in which the field of view should move as the user moves. The above-mentioned objects refer to objects with a certain height that fall within the current field of view range, such as buildings.
[0022] After that, determine the projection distance of the vector line segment formed by the vertex coordinates of the object and the central coordinate in the horizontal projection direction of the forward direction of the field of view (that is, obtain the projection distance corresponding to the vertex coordinates of the object), and determine the pixel area corresponding to the object on the screen according to the vertex coordinates of the object, and determine the projection distance corresponding to each pixel point in the pixel area according to the projection distance corresponding to the vertex coordinates. That is to say, it is necessary to obtain the pixel area corresponding to the objects within the current field of view range on the screen and the projection distance of each pixel point in the forward direction of the field of view. The projection distance of a certain pixel point indicates the degree of occlusion of the pixel point to the user's line of sight: the smaller the projection distance, the greater the degree of occlusion of the line of sight; the larger the projection distance, the smaller the degree of occlusion of the line of sight.
[0023] Therefore, when rendering the electronic map, dissolve the pixel points whose projection distances in the pixel area meet the set conditions (such as being less than the set distance threshold) based on the projection distances corresponding to each pixel point in the pixel area. In this way, some pixel points in the pixel area (the pixel points with a large degree of occlusion of the line of sight) will be dissolved, while some pixel points (the pixel points with a small degree of occlusion of the line of sight) will be normally displayed.
[0024] Based on the above solution, assuming that there is a building that blocks the road within the current field of view range, through the above solution, the pixel points with a large degree of occlusion of the line of sight in the building will be dissolved so that the user can see the blocked road, while the pixel points with a small degree of occlusion of the line of sight in the building are still normally displayed so that the user can perceive the existence of the building. Finally, the building that blocks the road presents a dynamic effect of gradual dissolution, improving the interactive experience and intelligence level of electronic map rendering. Description of the Drawings
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to these drawings.
[0026] Figure 1a and Figure 1b is a schematic diagram of a traditional electronic map rendering result provided by an embodiment of the present invention;
[0027] Figure 2 is a flowchart of an electronic map rendering method provided by an embodiment of the present invention;
[0028] Figure 3 is a schematic diagram of the determination process of the center point of the field of view provided by an embodiment of the present invention;
[0029] Figure 4a and Figure 4b is a schematic diagram of an electronic map rendering result provided by an embodiment of the present invention;
[0030] Figure 5 is a flowchart of a method for dissolving pixels within a pixel region provided by an embodiment of the present invention;
[0031] Figure 6 is a schematic diagram of the process of dissolving pixels within a pixel region provided by an embodiment of the present invention;
[0032] Figure 7 is a schematic diagram of the structure of an electronic map rendering apparatus provided by an embodiment of the present invention;
[0033] Figure 8 is corresponding to Figure 7 is a schematic diagram of the structure of an electronic device corresponding to the electronic map rendering apparatus shown in the embodiment; Detailed implementation manners
[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0035] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said", and "the" used in the embodiments of the present invention and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. "Plural" generally includes at least two.
[0036] Depending on the context, as used herein, the words "if" and "when" may be interpreted as "when" or "while" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if it is determined" or "if (the stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when (the stated condition or event) is detected" or "in response to detecting (the stated condition or event)".
[0037] In addition, the step timings in the following method embodiments are only examples and not strictly limited.
[0038] In practical applications, after a user triggers an operation to display an electronic map, an electronic map containing many map elements existing around the user will be displayed on the screen of the user's terminal device so that the user can see the surrounding environment. These map elements include, for example, roads, bridges, buildings, and other traffic facilities, and so on.
[0039] The operation to display the electronic map may be an operation for the user to open the electronic map, or an operation for the user to use the navigation function after opening the electronic map, and is not limited thereto.
[0040] The terminal device for displaying the electronic map may be the user's mobile phone, in-vehicle terminal, or other devices.
[0041] It can be understood that for two users A and B who are relatively far apart, when both of these users trigger an operation to display the electronic map, the display results they see on the screens of their respective terminal devices are different, that is, user A sees the environment around his own position, and user B also sees the environment around his own position. This shows that the display of the electronic map is related to the user's position. In addition, it can be understood that in fact, the physical distance corresponding to the electronic map that can be displayed on the screen of the terminal device is also affected by parameters such as the screen size and scale.
[0042] In practical applications, the service provider of the electronic map application will pre-generate a complete electronic map. For the sake of description, taking city X as an example, the service provider will pre-generate an electronic map corresponding to city X. When user A in city X uses the electronic map application, for example, user A wants to navigate from address L1 to address L2, and both address L1 and address L2 are addresses within city X. At this time, a navigation interface will be displayed on the screen of user A's terminal device, and the electronic map displayed in the navigation interface will be updated following the position of user A.
[0043] Based on this, it is worth noting that the display and rendering of the electronic map in this article refer to the display of the electronic map within a certain physical distance range corresponding to the user's location on the screen of the user's terminal device based on the user's location, rather than the display of the complete electronic map corresponding to, for example, City X in the above example.
[0044] In an embodiment of the present invention, taking the urban scenario as an example, a certain city will include several objects such as roads, buildings, bus stops, subway stations, etc. When creating an electronic map corresponding to the city, three-dimensional modeling can be performed on objects with a certain height relative to the road surface, such as buildings, bus stops, subway stations, etc., so as to add three-dimensional models of these objects to the electronic map. The generated electronic map is a three-dimensional electronic map. It can be understood that the three-dimensional model corresponding to an object can be associated with the marking information of the object, such as name, address, etc.
[0045] The electronic map involved in the embodiment of the present invention refers to a three-dimensional electronic map. At this time, the coordinate system corresponding to the electronic map is called a three-dimensional map coordinate system.
[0046] For the convenience of introducing the solution provided by the embodiment of the present invention in the following text, first combine Figure 1a and Figure 1b to briefly illustrate the display process of the traditional electronic map.
[0047] During the rendering process of the electronic map, it can be imagined that there is a virtual camera in the air of the three-dimensional space. When a user triggers the display of the electronic map, the camera follows the user to display an electronic map containing map elements within a set range around the user on the screen of the user's terminal device, such as buildings, roads, bridges, etc.
[0048] As Figure 1a shown, assuming a user drives out, when the user opens the electronic map application, an electronic map 101 as shown in Figure 1a is displayed on the screen of the user's terminal device. As can be seen from the schematic diagram in Figure 1a , the environment within a certain range around the current user's location is displayed in the electronic map 101, such as multiple buildings and roads shown in the figure. As Figure 1a shown, some roads will be blocked by buildings, so that from the user's perspective, the blocked roads cannot be seen.
[0049] The rendering and display process of this electronic map 101 is simply: the electronic map 101 is rendered by a rendering engine, and the rendering engine will include a virtual camera, which can be figuratively considered to be at a relatively high position above the user, so as to capture objects suitable for display on the screen of the user's terminal device from the complete electronic map corresponding to the city. As Figure 1aAs shown in the figure, the camera can be located at a position above and behind the user's position L1. The camera can rotate. For example, by controlling the camera to rotate 360 degrees horizontally, all the objects that fall within the field of view of the camera during the rotation process can be captured and rendered on the screen of the terminal device, so as to obtain the electronic map 101.
[0050] As Figure 1b shown in the figure, when the user moves from the user's position L1 to the user's position L2, the electronic map displayed on the screen will also be updated accordingly. For example, it will be updated to Figure 1b the electronic map 102 as shown in the figure. As shown in the electronic map 102, at this time, some buildings (such as building 1) that were originally shown in the electronic map 101 will move out of the field of view of the camera, and some buildings (such as building 2) that were originally shown in the electronic map 101 will update the display size because of the user's approach. In addition, some new buildings (such as building 6) may also appear in the electronic map 102.
[0051] In practical applications, the real-time position of the user can be collected at regular time intervals (such as 1 s). When the user's position is updated, the position of the camera can also be updated accordingly to keep the positional relationship between the camera and the user's position unchanged. Of course, the update strategy of the camera position is not limited to this. Generally speaking, the position of the camera will follow the user's position.
[0052] The above briefly introduces the traditional electronic map rendering process.
[0053] When a user drives out, they often need to be able to see the road ahead far enough so that they have enough time to clarify the next driving behavior and ensure safe driving. However, as Figure 1a shown in the figure, based on the above electronic map rendering process, if a certain section of the road ahead is blocked by a building, the user will not be able to see the blocked road. At this time, the traditional method is to directly hide or display the building that blocks the road transparently when rendering the electronic map, that is, not to display the building or set the transparency of the building to 0. Whether it is hiding or transparent display, it makes the user unable to perceive the existence of the building.
[0054] The embodiment of the present invention provides a new electronic map rendering method. Based on this electronic map rendering method, the user can perceive the existence of the above building, and at the same time, the user can see the road ahead, improving the interactive experience and intelligence level of the electronic map rendering.
[0055] The electronic map rendering method provided by the embodiment of the present invention can be executed by an electronic device. The electronic device can be a terminal device such as a PC, a laptop, a smart phone, a vehicle-mounted terminal, etc., and an electronic map is displayed on the screen of the terminal device. The electronic device can also be a server in the cloud. The server completes the rendering of the electronic map and sends the rendered electronic map to the user's terminal device for display on the screen of the terminal device. The server can be a physical server including an independent host, or can also be a virtual server, or can also be a cloud server.
[0056] Specifically, the electronic map rendering method is executed by a processor in the above-mentioned electronic device. Optionally, the processor can be a Central Processing Unit (CPU) or a Graphics Processing Unit (GPU). Of course, it can also be other types of processors.
[0057] The execution process of the electronic map rendering method provided by the embodiment of the present invention will be described in detail below.
[0058] Figure 2 is a flowchart of an electronic map rendering method provided by an embodiment of the present invention. As Figure 2 shown, the method includes the following steps:
[0059] 201. Obtain the center coordinates of the current field of view range, the forward direction of the field of view, and the vertex coordinates of the objects included in the electronic map to be displayed on the screen corresponding to the current field of view range in the three-dimensional map coordinate system.
[0060] 202. Determine the projection distance of the vector line segment formed by the vertex coordinates and the center coordinates in the horizontal projection direction of the forward direction of the field of view.
[0061] 203. Determine the pixel area corresponding to the object on the screen according to the vertex coordinates of the object.
[0062] 204. Determine the projection distance corresponding to the pixel points in the pixel area according to the projection distance corresponding to the vertex coordinates.
[0063] 205. Dissolve the pixel points in the pixel area whose projection distances meet the set conditions.
[0064] First, in combination with Figure 3 to exemplarily illustrate the concepts of the center coordinates of the above-mentioned field of view range, the forward direction of the field of view, and the horizontal projection direction.
[0065] As Figure 3As shown, it is assumed that the user is currently at position X (when the user is driving, the position of the vehicle can be considered as X). As described above, the camera is located at a certain position above and behind the user. The camera is pre-configured with a set field of view angle. Optionally, the coordinates of the intersection of the ray along the forward direction of the field of view and the ground in the three-dimensional map coordinate system can be determined as the central coordinates of the current field of view range.
[0066] Among them, the word "current" can be considered to correspond to the current user position X. That is to say, as the user's position changes, the central coordinates of the field of view range will also change accordingly.
[0067] From Figure 3 As shown in the schematic diagram, the above central coordinates and the user position X tend to be relatively close. Therefore, optionally, the current user position (such as the vehicle position) can also be directly used as the central coordinates of the current field of view range, that is, the position of the user's positioning in the map. At this time, generally, the perspective of the camera needs to be adjusted so that the intersection of the ray in the forward direction of the field of view and the horizontal ground is exactly the user position.
[0068] As Figure 3 As shown, it is assumed that the vector line segment between the camera and the determined central coordinates at the current moment is represented as Q1, and this vector line segment Q1 represents the current forward direction of the field of view. In Figure 3 As shown, it is assumed that the vector line segment obtained after projecting the vector line segment Q1 onto the ground is represented as Q2, then the direction of Q2 is the horizontal projection direction of the forward direction of the field of view. In practical applications, the unit vector in the direction of Q2 can be used to represent this horizontal projection direction.
[0069] Simply put, the main functions of the above central coordinates and the forward direction of the field of view are as follows: taking the central coordinates as the origin, traversing the objects to be displayed along the horizontal projection direction of the forward direction of the field of view, the closer the object is to the central coordinates, the greater the degree of occlusion of the user's line of sight, and the farther the object is from the central coordinates, the smaller the degree of occlusion of the user's line of sight.
[0070] Therefore, after obtaining the central coordinates and the forward direction of the field of view within the current field of view range, first, it is necessary to obtain the projection distances of each object falling within the current field of view range relative to the above central coordinates in the horizontal projection direction of the above forward direction of the field of view, so as to perform rendering processing of the objects in combination with the projection distances.
[0071] In Figure 3In this case, it is assumed that there are object 1 and object 2 within the current field of view. Two vertex coordinates of object 1 are represented as V1 and V2, and two vertex coordinates of object 2 are represented as V3 and V4. Taking the center coordinate as the origin and the Q2 direction as the positive direction of the coordinate axis, the projection values of the vertices of these two objects on the coordinate axis are calculated, and the calculation results are as follows: the projection values of V1 and V2 are positive, and the projection values of V3 and V4 are negative. At this time, based on the solution provided in the embodiments of the present invention, the pixel points corresponding to V3 and V4 on the screen tend to be dissolved, and the pixel points corresponding to V1 and V2 on the screen tend to be retained.
[0072] Based on the above definition, after obtaining the vertex coordinates of the objects included in the electronic map to be displayed on the screen corresponding to the current field of view, the following takes any object existing within the current field of view as an example to illustrate how to perform rendering processing on this object. Assume that this any object is Figure 1a the building 3 shown in
[0073] First, determine the projection distance of the vector line segment formed by the vertex coordinates of building 3 and the center coordinate in the horizontal projection direction of the field of view forward direction.
[0074] Secondly, according to the vertex coordinates of building 3, determine the pixel area corresponding to building 3 on the screen of the user terminal device, and this pixel area is defined by the pixel points corresponding to the vertex coordinates of building 3.
[0075] Finally, according to the projection distance corresponding to the vertex coordinates of building 3, determine the projection distance corresponding to the pixel points within the above pixel area. In this way, the projection distances corresponding to each pixel point within the pixel area corresponding to building 3 on the screen are obtained.
[0076] After that, based on the projection distances corresponding to each pixel point within the pixel area corresponding to building 3, dissolve the pixel points that meet the set conditions.
[0077] In practical applications, in the three-dimensional map coordinate system, building 3 has multiple vertices (such as 8 vertices), and it is necessary to calculate the projection distance corresponding to each vertex coordinate, that is, it is necessary to calculate the projection distance of each vertex coordinate in the above horizontal projection direction.
[0078] Among them, when initially constructing the electronic map, the spatial position coordinates of each modeled object are known, so the vertex coordinates of each object can be obtained.
[0079] Specifically, taking any vertex coordinate in building 3 as an example, the projection distance corresponding to this any vertex coordinate can be obtained through the following method:
[0080] Determine the distance vector between this any vertex coordinate and the center coordinate;
[0081] Project on the horizontal projection direction of the distance vector towards the forward direction of the field of view to obtain the projection distance corresponding to the coordinate of any vertex.
[0082] The above calculation process can be expressed by the following formula:
[0083] vDistance = dot[g_directionNorm, (position.xy - g_centerPosition.xy)].
[0084] Wherein, vDistance represents the projection distance corresponding to the coordinate of any vertex, dot is the dot product operator, g_directionNorm is the unit vector on the horizontal projection direction representing the forward direction of the field of view, position.xy is the coordinate value of the coordinate of any vertex, and g_centerPosition.xy represents the center coordinate.
[0085] After obtaining the projection distances corresponding to the respective vertex coordinates of Building 3 in the above manner, rasterize Building 3 to determine the pixel area corresponding to Building 3 on the screen. Among them, rasterization is actually a process of converting geometric primitives into two-dimensional images. The detailed execution process of rasterization can refer to the introduction of existing related technologies and will not be elaborated here. The rasterization result of Building 3 is the pixel area determined on the screen for displaying Building 3.
[0086] After that, determine the pixel points corresponding to the respective vertex coordinates of Building 3 in this pixel area. In this way, the pixel points corresponding to the respective vertex coordinates and the projection distances are known, that is, the projection distance corresponding to a vertex coordinate is used as the projection distance corresponding to the pixel point corresponding to the vertex coordinate.
[0087] For other pixel points in the pixel area except the pixel points corresponding to the vertex coordinates, the projection distances corresponding to the respective other pixel points can be obtained by interpolation according to the projection distances corresponding to the multiple pixel points corresponding to the multiple vertex coordinates. The interpolation method can adopt any one of the existing interpolation algorithms.
[0088] The projection distance of a certain pixel point indicates the degree of occlusion of the pixel point by the user's line of sight: the smaller the projection distance, the greater the degree of occlusion of the line of sight; the larger the projection distance, the smaller the degree of occlusion of the line of sight.
[0089] After obtaining the projection distances corresponding to each pixel point in the above pixel area, dissolve the pixel points in the pixel area whose projection distances meet the set conditions, and the pixel points that do not meet the set conditions can be normally rendered and displayed.
[0090] Optionally, the above set condition can be: the projection distance is less than or equal to a preset distance threshold.
[0091] Based on this, optionally, the rendering scheme for the above pixel region may be: for a target pixel point within the pixel region, if the projection distance corresponding to the target pixel point is less than or equal to the distance threshold, dissolve the target pixel point; if the projection distance corresponding to the target pixel point is greater than the distance threshold, display the target pixel point. Wherein, the target pixel point may be any pixel point within the pixel region.
[0092] For ease of understanding the above rendering effect, in combination with Figure 4a and Figure 4b it is exemplarily illustrated.
[0093] Suppose the user is driving, and is currently at the position L1 shown in Figure 4a . At this time, the objects falling within the current field of view include multiple buildings shown in the figure. For each building, the processing procedures of steps 202 - 205 in the above text can be executed. In Figure 4a , the building blocking the road is Building 3.
[0094] Below, only the rendering result after performing the processing procedures of steps 202 - 205 in the above text on Building 3 is taken as an example for illustration, and the same applies to other buildings.
[0095] The projection distances corresponding to different pixel points within the pixel region corresponding to Building 3 are different. By dissolving the pixel points whose projection distances are less than or equal to the set distance threshold, and normally displaying the pixel points whose projection distances are greater than the set distance threshold, the rendering effect shown in Figure 4a can be obtained. Among them, the black dots within the pixel region of Building 3 represent the pixel points that are not dissolved, and the pixel points within the region except the black dots are all dissolved.
[0096] After that, as shown in Figure 4b , suppose the user drives from position L1 to position L2, and position L2 is a position closer to Building 3. At this time, repeat the processing procedures of steps 202 - 205 on Building 3. It can be understood that since the user's position is closer to Building 3, within the pixel region corresponding to Building 3 finally obtained through the above calculation and processing procedures, there will be more pixel points whose corresponding projection distances are less than or equal to the set distance threshold. At this time, as shown in Figure 4b , more pixel points within the pixel region of Building 3 will be dissolved.
[0097] It can be seen that, generally speaking, the closer a building is to the user's location, the greater the degree of dissolution, so as to avoid the occlusion of the user's line of sight by the buildings near the user's location; the farther a building is from the user's location, the smaller the degree of dissolution. In other words, for the same building, as the distance between the user's location and the building changes, the dissolution degree of the building will also change dynamically.
[0098] In summary, during the rendering and display process of the electronic map, assuming that there is a building blocking the road within the current field of view, through the above solution, the pixel points in the building with a large degree of line-of-sight occlusion will be dissolved, so that the user can see the blocked road, while the pixel points in the building with a small degree of line-of-sight occlusion are still normally displayed, so that the user can perceive the existence of the building. Finally, the building blocking the road presents a dynamic effect of gradual dissolution, improving the interactive experience and intelligence level of the electronic map rendering.
[0099] In the above embodiments, the dissolution process of the pixel points within the pixel region is directly implemented with the pixel points initially included in the pixel region as the dissolution objects. In an alternative embodiment, the dissolution process of the pixel points within the pixel region can also be implemented as the steps shown in Figure 5 as follows:
[0100] 501. Combine a preset number of adjacent pixel points within the pixel region to obtain multiple combined pixel points.
[0101] 502. Determine the projection distance corresponding to the combined pixel points.
[0102] 503. Dissolve the combined pixel points whose projection distances meet the set conditions.
[0103] For easy understanding, for example, assume that the pixel region includes N*N pixel points (i.e., N rows and N columns of pixel points). The above-mentioned preset number of adjacent pixel points is, for example, 3*3 pixel points, that is, 9 pixel points composed of 3 rows and 3 columns of pixel points. For each group of these 9 pixel points, perform a combination process to obtain a combined pixel point.
[0104] For any obtained combined pixel point, its corresponding projection distance can be determined in the following manner:
[0105] Determine the average projection distance of the projection distances respectively corresponding to the preset number of pixel points (i.e., the pixel points combined into this combined pixel point);
[0106] Determine the projection distance corresponding to this any combined pixel point as the average projection distance.
[0107] Assume that any merged pixel is obtained by merging 9 pixels, and the projection distances corresponding to these 9 pixels are known. Calculate the average value of the 9 projection distances corresponding to these 9 pixels, and the obtained average projection distance can be used as the projection distance corresponding to the merged pixel.
[0108] As described above, similarly, optionally, dissolving the merged pixels among the obtained multiple merged pixels whose projection distances meet the set conditions can be implemented as follows:
[0109] If the projection distance corresponding to a merged pixel is less than or equal to the distance threshold, then dissolve the merged pixel; if the projection distance corresponding to the merged pixel is greater than the distance threshold, then display the merged pixel.
[0110] Through the above pixel merging process, the task amount of the dissolving process can be reduced.
[0111] In another optional embodiment, dissolving the merged pixels whose projection distances meet the set conditions can also be implemented as follows:
[0112] Divide the pixel area into pixel units to obtain multiple pixel units, where one pixel unit is composed of a preset number of adjacent merged pixels in position;
[0113] Randomly number the merged pixels included in the first pixel unit, and the first pixel unit is any one of the multiple pixel units;
[0114] Reuse the random numbering result on the merged pixels included in the second pixel unit, and the second pixel unit is any one of the multiple pixel units other than the first pixel unit;
[0115] If the projection distance corresponding to the first merged pixel in the first pixel unit is less than or equal to the distance threshold, then dissolve the first merged pixel and the second merged pixel in the second pixel unit that has the same number as the first merged pixel, and the first merged pixel is any merged pixel included in the first pixel unit;
[0116] If the projection distance corresponding to the first merged pixel is greater than the distance threshold, then display the first merged pixel and the second merged pixel.
[0117] Among them, one pixel unit is composed of a preset number of adjacent merged pixels in position. For example, a pixel unit can be composed of 4*4 merged pixels.
[0118] For ease of understanding, in combination with Figure 6 to exemplarily illustrate the above pixel dissolving process.
[0119] In Figure 6 , it is assumed that a pixel unit is composed of 4×4 merged pixel points, and it is assumed that the above pixel region is finally divided into 4 pixel units, namely Figure 6 the pixel units 1 to 4 shown in. Among them, the 16 grids included in each pixel unit represent the 4×4 merged pixel points contained therein.
[0120] Taking pixel unit 1 as the above-mentioned first pixel unit, randomly number the 16 grids (i.e., 16 merged pixel points) included in pixel unit 1. Assume that the numbering result is as shown in Figure 6 .
[0121] As shown in Figure 6 , taking the remaining other pixel units as the second pixel unit respectively, the numbering result of pixel unit 1 is reused in each of the remaining other pixel units, that is, the number corresponding to the grid at a certain position in other pixel units is the same as the number corresponding to the grid at the same position in pixel unit 1.
[0122] For pixel unit 1, assume that the projection distances corresponding to the grids (i.e., merged pixel points) numbered 2, 11, 15, and 4 therein are less than or equal to the set distance threshold, then it is necessary to dissolve the merged pixel points corresponding to these four numbers in pixel unit 1. Similarly, for the other three pixel units, it is also necessary to dissolve the merged pixel points corresponding to these four numbers in these three pixel units.
[0123] Through the above solution, the processing efficiency of pixel point dissolution can be further improved.
[0124] The following will detail an electronic map rendering device according to one or more embodiments of the present invention. Those skilled in the art can understand that these devices can all be configured by using commercially available hardware components through the steps taught by this solution.
[0125] Figure 7 is a schematic structural diagram of an electronic map rendering device provided by an embodiment of the present invention. As shown in Figure 7 , the device includes: an acquisition module 11, a first determination module 12, a second determination module 13, a third determination module 14, and a rendering module 15.
[0126] The acquisition module 11 is used to acquire the central coordinates of the current field of view range, the forward direction of the field of view, and the vertex coordinates of the objects included in the electronic map to be displayed on the screen corresponding to the current field of view range in the three-dimensional map coordinate system.
[0127] The first determination module 12 is used to determine the projection distance of the vector line segment formed by the vertex coordinates and the central coordinates in the horizontal projection direction of the forward direction of the field of view.
[0128] A second determination module 13, configured to determine a pixel region corresponding to the object on the screen according to the vertex coordinates.
[0129] A third determination module 14, configured to determine a projection distance corresponding to a pixel point in the pixel region according to the projection distance corresponding to the vertex coordinates.
[0130] A rendering module 15, configured to dissolve pixel points in the pixel region whose projection distances meet a set condition.
[0131] Optionally, the second determination module 13 may specifically be configured to: perform rasterization processing on the object according to the vertex coordinates to determine a pixel region corresponding to the object on the screen, where the pixel region is defined by pixel points corresponding to the vertex coordinates respectively.
[0132] Optionally, the third determination module 14 may specifically be configured to: determine pixel points corresponding to the vertex coordinates in the pixel region; and determine projection distances corresponding to other pixel points in the pixel region respectively by interpolation according to the projection distance and the pixel points corresponding to the vertex coordinates.
[0133] Optionally, the acquisition module 11 may specifically be configured to: determine the coordinates of the intersection point of the ray along the forward direction of the field of view and the ground in the three-dimensional map coordinate system as the central coordinates.
[0134] Optionally, the rendering module 15 may specifically be configured to: for a target pixel point in the pixel region, if the projection distance corresponding to the target pixel point is less than or equal to a distance threshold, dissolve the target pixel point; if the projection distance corresponding to the target pixel point is greater than the distance threshold, display the target pixel point, where the target pixel point is any pixel point in the pixel region.
[0135] Optionally, the rendering module 15 may specifically be configured to: perform a merging process on a preset number of adjacent pixel points in the pixel region to obtain merged pixel points; determine the projection distance corresponding to the merged pixel points; and dissolve the merged pixel points whose projection distances meet a set condition.
[0136] Optionally, the rendering module 15 may specifically be configured to: if the projection distance corresponding to the merged pixel points is less than or equal to a distance threshold, dissolve the merged pixel points; if the projection distance corresponding to the merged pixel points is greater than the distance threshold, display the merged pixel points.
[0137] Optionally, the rendering module 15 may specifically be configured to: determine the average projection distance of the projection distances respectively corresponding to a preset number of pixel points merged into the merged pixel point; determine that the projection distance corresponding to the merged pixel point is the average projection distance.
[0138] Optionally, the rendering module 15 may specifically be configured to: divide the pixel area into pixel units to obtain a plurality of pixel units, where one pixel unit is composed of a preset number of merged pixel points adjacent in position; randomly number the merged pixel points included in the first pixel unit, where the first pixel unit is any one of the plurality of pixel units; reuse the random numbering result to the merged pixel points included in the second pixel unit, where the second pixel unit is any one of the plurality of pixel units other than the first pixel unit; if the projection distance corresponding to the first merged pixel point in the first pixel unit is less than or equal to the distance threshold, dissolve the first merged pixel point and the second merged pixel point having the same number as the first merged pixel point in the second pixel unit, where the first merged pixel point is any merged pixel point included in the first pixel unit; if the projection distance corresponding to the first merged pixel point is greater than the distance threshold, display the first merged pixel point and the second merged pixel point.
[0139] Figure 7 The device shown can execute the electronic map rendering method provided in the foregoing FIGS. 1 to Figure 6 The detailed execution process and technical effects of the embodiments shown can be seen in the descriptions in the foregoing embodiments, and will not be elaborated here.
[0140] In a possible design, the structure of the foregoing Figure 7 shown electronic map rendering device can be implemented as an electronic device, as Figure 8 shown, the electronic device may include: a processor 21, a memory 22, and a screen 23. Among them, executable code is stored on the memory 22, and when the executable code is executed by the processor 21, the processor 21 can at least implement the electronic map rendering method provided in the foregoing FIGS. 1 to Figure 6 shown embodiments.
[0141] Optionally, the electronic device may further include a communication interface 24 for communicating with other devices.
[0142] Optionally, the processor 21 includes: a graphics processor.
[0143] In addition, an embodiment of the present invention provides a computer program product, where a computer program is stored in the computer program product, and when the computer program is executed by a processor of an electronic device, the processor can at least implement the method as described in the foregoing FIGS. 1 toFigure 6 The electronic map rendering method provided in the illustrated embodiment.
[0144] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative effort.
[0145] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of adding a necessary general hardware platform. Of course, it can also be implemented by a combination of hardware and software. Based on such an understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a computer product. The present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An electronic map rendering method, including: obtaining the central coordinate of the current field of view range, the forward direction of the field of view, and the vertex coordinates of the objects included in the electronic map to be displayed on the screen corresponding to the current field of view range in the three-dimensional map coordinate system; determining the projection distance of the vector line segment formed by the vertex coordinates and the central coordinate in the horizontal projection direction of the forward direction of the field of view; determining the pixel area corresponding to the object on the screen according to the vertex coordinates; determining the projection distance corresponding to the pixel points in the pixel area according to the projection distance corresponding to the vertex coordinates; dissolving the pixel points in the pixel area whose projection distances meet the set conditions.
2. The method according to claim 1, wherein, the determining the pixel area corresponding to the object on the screen according to the vertex coordinates includes: performing rasterization processing on the object according to the vertex coordinates to determine the pixel area corresponding to the object on the screen, and the pixel area is defined by the pixel points corresponding to the vertex coordinates respectively.
3. The method according to claim 1, wherein, the determining the projection distance corresponding to the pixel points in the pixel area according to the projection distance corresponding to the vertex coordinates includes: determining the pixel points corresponding to the vertex coordinates in the pixel area; determining the projection distance corresponding to each of the other pixel points in the pixel area by interpolation according to the projection distance and the pixel points corresponding to the vertex coordinates.
4. The method according to claim 1, wherein, the obtaining the central coordinate of the current field of view range in the three-dimensional map coordinate system includes: determining the coordinate of the intersection point of the ray along the forward direction of the field of view and the ground in the three-dimensional map coordinate system as the central coordinate.
5. The method according to any one of claims 1 to 4, wherein, the dissolving the pixel points in the pixel area whose projection distances meet the set conditions includes: for the target pixel points in the pixel area, if the projection distance corresponding to the target pixel points is less than or equal to the distance threshold, then dissolving the target pixel points; if the projection distance corresponding to the target pixel points is greater than the distance threshold, then displaying the target pixel points, and the target pixel points are any pixel points in the pixel area.
6. The method according to any one of claims 1 to 4, wherein, the dissolving the pixel points in the pixel area whose projection distances meet the set conditions includes: performing a merging process on a preset number of adjacent pixel points in the pixel area to obtain merged pixel points; determining the projection distance corresponding to the merged pixel points; dissolving the merged pixel points whose projection distances meet the set conditions.
7. The method according to claim 6, wherein, the dissolving the merged pixel points whose projection distances meet the set conditions includes: if the projection distance corresponding to the merged pixel points is less than or equal to the distance threshold, then dissolving the merged pixel points; if the projection distance corresponding to the merged pixel points is greater than the distance threshold, then displaying the merged pixel points.
8. The method according to claim 7, wherein, The determining of the projection distance corresponding to the merged pixel point includes: Determining the average projection distance of the projection distances respectively corresponding to a preset number of pixel points merged into the merged pixel point; Determining the projection distance corresponding to the merged pixel point as the average projection distance.
9. The method according to claim 6, wherein, The dissolving of the merged pixel points whose projection distances meet the set conditions includes: Dividing the pixel area into pixel units to obtain a plurality of pixel units, wherein one pixel unit is composed of a preset number of merged pixel points adjacent in position; Randomly numbering the merged pixel points included in the first pixel unit, where the first pixel unit is any one of the plurality of pixel units; Reusing the random numbering result to the merged pixel points included in the second pixel unit, where the second pixel unit is any one of the plurality of pixel units other than the first pixel unit; If the projection distance corresponding to the first merged pixel point in the first pixel unit is less than or equal to the distance threshold, dissolving the first merged pixel point and the second merged pixel point having the same number as the first merged pixel point in the second pixel unit, where the first merged pixel point is any merged pixel point included in the first pixel unit; If the projection distance corresponding to the first merged pixel point is greater than the distance threshold, displaying the first merged pixel point and the second merged pixel point.
10. An electronic map rendering device, including: An acquisition module, configured to acquire the central coordinate, the viewing direction of advance, and the vertex coordinates of the objects included in the electronic map to be displayed on the screen corresponding to the current viewing range in the three-dimensional map coordinate system; A first determination module, configured to determine the projection distance of the vector line segment formed by the vertex coordinates and the central coordinate in the horizontal projection direction of the viewing direction of advance; A second determination module, configured to determine the pixel area corresponding to the object on the screen according to the vertex coordinates; A third determination module, configured to determine the projection distance corresponding to the pixel points in the pixel area according to the projection distance corresponding to the vertex coordinates; A rendering module, configured to dissolve the pixel points in the pixel area whose projection distances meet the set conditions.
11. An electronic device, including: A memory, a processor, and a screen; wherein, an executable code is stored on the memory, and when the executable code is executed by the processor, the processor executes the electronic map rendering method according to any one of claims 1 to 9, and the processor includes a graphics processor.
12. A computer program product, including: A computer program, when the computer program is executed by the processor of an electronic device, the processor executes the electronic map rendering method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Image processing method and device
CN105513112A
Lane line determination method and device, positioning precision evaluation method and device and equipment
CN111860319A