A water area division method and device of a map, an electronic device, and a storage medium

By acquiring the water area grid of the game map, calculating the movement parameters of the grid vertices, and controlling their movement to the center, the problem of inaccuracy in water area marking caused by manual marking is solved, realizing automated water area division and improving map accuracy and production efficiency.

CN119963569BActive Publication Date: 2025-11-04GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411514755.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-11-04
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

In existing technologies, the marking of water areas on game maps mainly relies on manual operation, which leads to inconsistent, incomplete, and incorrect markings, resulting in low accuracy of water area markings.

Method used

By acquiring the water area grid map of the target map, the edge distance between the grid vertices and the area edge is determined. Based on this distance, the vertex movement parameters are calculated, and the grid vertices are controlled to move towards the center of the water area until they are determined to be within the center range. The movement distance is then determined and the water area type is classified.

Benefits of technology

The system enables automated marking of water areas, improving the accuracy and flexibility of water area delineation on maps, reducing human error in marking, and saving production time and labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119963569B_ABST
    Figure CN119963569B_ABST
Patent Text Reader

Abstract

The application discloses a water area division method and device of a map, an electronic device and a computer readable storage medium. The application obtains a water area grid map of a target map, the water area grid map comprising at least one water area region of the target map, the water area region being composed of a plurality of grids; determines an edge distance between a grid vertex of a grid and a region edge of the water area region; determines a vertex movement parameter of an edge grid vertex based on the edge distance between the grid vertex and the region edge; controls the edge grid vertex to move to the center of the water area region based on the vertex movement parameter of the edge grid vertex, until it is determined that the edge grid vertex is in the center range of the water area region, and determines the movement distance of the edge grid vertex; and determines the water area region type corresponding to the edge grid vertex based on the movement distance of the edge grid vertex, so that the accuracy of water area division in the map can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of data processing, and particularly relates to a water area division method and device of a map, an electronic device and a storage medium. BACKGROUND

[0002] Under the tide of the Internet, the continuous development and evolution of hardware and software technology promote the emergence of intelligent devices and software. At the same time, a large number of games of different themes emerge to meet the needs of users, and in some games, different water area regions on the game map need to be marked to divide the water area regions on the game map, so as to provide a more real and diversified game environment and improve the user experience.

[0003] At present, the marking of the water area regions on the game map is manually marked by artificial, and due to the different complex conditions of the topographic features of different game maps, abnormal marking of the water area regions in the game map occurs, such as non-uniform marking, incomplete marking, incorrect marking and the like, resulting in low accuracy of the divided water area regions in the game map. SUMMARY

[0004] The embodiments of the present application provide a water area division method and device of a map, an electronic device and a storage medium, which can improve the accuracy of water area division in the map.

[0005] In a first aspect, the embodiments of the present application provide a water area division method of a map, and the method comprises:

[0006] obtaining a water area grid map of a target map, wherein the water area grid map comprises at least one water area region of the target map, and the water area region is composed of a plurality of grids;

[0007] determining an edge distance between a grid vertex of the grid and a region edge of the water area region, wherein the grid vertex comprises an edge grid vertex located at the region edge;

[0008] determining a vertex movement parameter of the edge grid vertex based on the edge distance between the grid vertex and the region edge;

[0009] controlling the edge grid vertex to move to the center of the water area region based on the vertex movement parameter of the edge grid vertex until it is determined that the edge grid vertex is in the center range of the water area region, and determining a movement distance of the edge grid vertex;

[0010] determining a water area region type corresponding to the edge grid vertex based on the movement distance of the edge grid vertex.

[0011] In a second aspect, an embodiment of the present application provides a water area division device of a map, the device comprising:

[0012] an acquisition module configured to acquire a water area grid map of a target map, wherein the water area grid map comprises at least one water area region of the target map, and the water area region is composed of a plurality of grids;

[0013] a distance determination module configured to determine an edge distance between a grid vertex of the grid and a region edge of the water area region, wherein the grid vertex comprises an edge grid vertex located at the region edge;

[0014] a parameter determination module configured to determine a vertex movement parameter of the edge grid vertex based on the edge distance between the grid vertex and the region edge;

[0015] a movement module configured to control the edge grid vertex to move to a center of the water area region based on the vertex movement parameter of the edge grid vertex until it is determined that the edge grid vertex is in a center range of the water area region, and determine a movement distance of the edge grid vertex;

[0016] a type determination module configured to determine a water area region type corresponding to the edge grid vertex based on the movement distance of the edge grid vertex.

[0017] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory storing a plurality of instructions, and a processor loading the instructions from the memory to perform steps of any of the water area division methods of the map provided by the embodiments of the present application.

[0018] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium storing a plurality of instructions, and the instructions are adapted to be loaded by a processor to perform steps of any of the water area division methods of the map provided by the embodiments of the present application.

[0019] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising a computer program or instructions, and the computer program or instructions are executed by a processor to implement steps in any of the water area division methods of the map provided by the embodiments of the present application.

[0020] By adopting the scheme provided in the embodiments of the present application, a water area grid map of a target map can be acquired, wherein the water area grid map comprises at least one water area region of the target map, the water area region is composed of a plurality of grids, and an edge distance between a grid vertex of the grid and a region edge of the water area region is determined, wherein the grid vertex comprises an edge grid vertex located at the region edge. Then, a vertex movement parameter of the edge grid vertex is determined based on the edge distance between the grid vertex and the region edge. Finally, the edge grid vertex is controlled to move to the center of the water area region based on the vertex movement parameter of the edge grid vertex until it is determined that the edge grid vertex is in the center range of the water area region, a movement distance of the edge grid vertex is determined, and a water area region type corresponding to the edge grid vertex is determined based on the movement distance of the edge grid vertex, so that the corresponding water area region type is determined based on the movement distance by automatically controlling the movement of the edge grid vertex, and the marking abnormality in marking the water area region by a person is avoided, thereby improving the accuracy of water area division in the map. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0022] Figure 1 is an embodiment flow diagram of the water area division method of the map provided in the embodiments of the present application;

[0023] Figure 2 is a schematic diagram of a target map provided in the embodiments of the present application;

[0024] Figure 3 is a schematic diagram of a water area grid map provided in the embodiments of the present application;

[0025] Figure 4 is a distribution diagram of an edge grid vertex provided in the embodiments of the present application;

[0026] Figure 5 is a display diagram of a water area region provided in the embodiments of the present application;

[0027] Figure 6 is a calculation example diagram of a vertex movement vector provided in the embodiments of the present application;

[0028] Figure 7 is a vertex movement vector diagram of a grid vertex provided in the embodiments of the present application;

[0029] Figure 8 FIG. 7 is a schematic diagram of a moving process of edge mesh vertices provided in an embodiment of the present application;

[0030] Figure 9 FIG. 8 is a schematic diagram of a distribution of the edge mesh vertices after moving provided in an embodiment of the present application;

[0031] Figure 10 FIG. 9 is another schematic diagram of displaying a water area provided in an embodiment of the present application;

[0032] Figure 11 FIG. 10 is a schematic diagram of a water area type distribution provided in an embodiment of the present application;

[0033] Figure 12 FIG. 11 is a schematic diagram of a water area type distribution after data denoising provided in an embodiment of the present application;

[0034] Figure 13 FIG. 12 is a schematic diagram of a structure of a water area dividing device of a map provided in an embodiment of the present application;

[0035] Figure 14 FIG. 13 is a schematic diagram of a structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person skilled in the art without creative work fall within the scope of protection of the present application. Meanwhile, in the description of the embodiments of the present application, the terms “first”, “second”, etc. are only used for distinguishing description, and cannot be understood as indicating or implying relative importance. Therefore, the features with “first” and “second” can explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of “multiple” is two or more, unless otherwise specifically limited.

[0037] The embodiments of the present application provide a water area dividing method and device of a map, an electronic device and a computer readable storage medium.

[0038] Specifically, the embodiment will be described from the perspective of a water area division device of a map, which can be integrated in an electronic device, i.e., the map water area division method of the embodiment can be executed by an electronic device, which can be associated with Unreal Engine and / or digital content creation tool HOUDINI, for implementing the map water area division method provided by the embodiment. Optionally, the electronic device can include a terminal device. The terminal device can be a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, a game console, or a personal computer (PC) and the like.

[0039] The map water area division method provided by the embodiment can be applied to a map water area division system. The map water area division system can include a player terminal device and a server. The terminal device can be a device that includes receiving and transmitting hardware, i.e., a device with receiving and transmitting hardware capable of performing bidirectional communication on a bidirectional communication link. The player terminal device and the server can perform bidirectional communication through a network.

[0040] Optionally, the server can be a standalone server, or a server network or server cluster composed of servers, including but not limited to a computer, a network host, a single network server, a plurality of network server sets, or a cloud server composed of a plurality of servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.

[0041] The following will be described in detail with reference to the accompanying drawings. In the embodiment, the execution subject is taken as an example of a terminal device. It should be noted that the order of the following embodiments is not limited as the preferred order of the embodiments. Although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown in the accompanying drawings.

[0042] The water area division method in this embodiment obtains a water area grid map of a target map, wherein the water area grid map includes at least one water area of ​​the target map, and the water area is composed of multiple grids; determines the edge distance between the grid vertices of the grids and the edge of the water area, wherein the grid vertices include edge grid vertices located at the edge of the area; determines the vertex movement parameters of the edge grid vertices based on the edge distance between the grid vertices and the edge of the area; controls the edge grid vertices to move towards the center of the water area based on the vertex movement parameters of the edge grid vertices until it is determined that the edge grid vertices are within the center range of the water area, and determines the movement distance of the edge grid vertices; and determines the water area type corresponding to the edge grid vertices based on the movement distance of the edge grid vertices, which can improve the accuracy of water area division in the map.

[0043] Please refer to Figure 1 Taking a terminal as an example, this embodiment provides a method for dividing water areas on a map. The specific process of this method can be summarized in steps 101 to 105, wherein:

[0044] Step 101: Obtain the water area grid map of the target map, wherein the water area grid map includes at least one water area of ​​the target map, and the water area is composed of multiple grids.

[0045] The target map mentioned above is a map of the water area to be delineated. The target map contains at least one water area, which can be an area composed of different types of water resources such as streams, rivers, lakes or oceans.

[0046] In this embodiment, the terminal obtains the water area grid map corresponding to the target map, so as to identify each water area of ​​the target map based on the water area grid map, thereby clarifying the area type of each water area of ​​the target map.

[0047] The grid that forms the water area in the above-mentioned water area grid map can be triangles, rectangles, etc., and can be set according to the needs. There are no restrictions here.

[0048] In some embodiments, the above-mentioned method of obtaining the water area grid map of the target map may include: the terminal can directly obtain the water area grid map corresponding to the target map that has been pre-divided into grids, the size of the water area grid map and the target map are matched, and the size of the water area in the water area grid map and the water area in the target map are matched; and / or, the terminal can generate the water area grid map corresponding to the target map based on the target map.

[0049] Specifically, the terminal can generate a water area grid map corresponding to the target map based on the target map, which can include that the terminal can obtain a target map to be processed, such as Figure 2 The black area in the target map shown in Figure 2 is a water area region. Then, the terminal can determine the water area region in the target map based on water area data in the target map, wherein the water area data can include the position, area, etc. of the water area region, which can be obtained by the terminal or input by the user, and can be set according to requirements, which is not limited here.

[0050] Finally, the terminal can generate a water area mask map based on the water area region in the target map, for example, set the mask information of the water area region in the target map to 1, and set the mask information of the non-water area region in the target map to 0, and then remove the non-water area region by setting a filtering condition, such as mask<0.01, to obtain a water area mask map containing only the water area region. In order to facilitate the identification and processing of the water area region, the terminal can also convert the terrain field in the water area mask map into a grid to generate a plurality of grids in the water area region of the water area mask map to obtain a water area grid map of the target map, as shown in Figure 3 .

[0051] Step 102, determining the edge distance between the grid vertex of the grid and the region edge of the water area region, wherein the grid vertex includes an edge grid vertex located on the region edge.

[0052] In this embodiment, since the water area region in the water area grid map is composed of a plurality of grids, and each grid is composed of a grid vertex, the terminal can determine the edge distance between each grid vertex of each grid and the region edge of the water area region, so that the terminal can further identify the type of the water area region based on the edge distance to divide the water area region in the target map.

[0053] It can be understood that since the water area region in the water area grid map is composed of grids, there are also some edge grids in the grid that are at the region edge of the water area region, and at least one grid vertex in the edge grid is located on the region edge. In this embodiment, the grid vertex of the edge grid located on the region edge is taken as the edge grid vertex, that is, part of the grid vertices of the grid that constitutes the water area region are edge grid vertices.

[0054] In some embodiments, the manner of determining the edge grid vertexes can include that the terminal can traverse the unshared edges in the water area region, and take the grid vertexes located on the unshared edges as the edge grid vertexes. Wherein, the terminal can set an unshared attribute in a built-in group method, and determine the unshared edges in the grid region through the unshared attribute, i.e., the region edges of the water area region in Figure 3 , to determine the grid vertexes on the unshared edges in the water area region, and then eliminate the grid vertexes on the shared edges through a Blast method, as shown in Figure 4 , to take the remaining grid vertexes after the elimination in Figure 4 as the edge grid vertexes, so as to take the grid vertexes on the unshared edges as the edge grid vertexes, and store the edge grid vertexes in a preset variable, so as to call the variable when the edge grid vertexes are processed later.

[0055] In some embodiments, the manner of determining the edge distance between the grid vertexes of the grid and the region edges of the water area region can include that the terminal can calculate the nearest distance between the grid vertexes and the region edges, or take the distance between the grid vertexes and the target edge grid vertexes as the edge distance between the grid vertexes and the region edges, wherein the target edge grid vertexes are the edge grid vertexes closest to the grid vertexes.

[0056] In some embodiments, after determining the edge distance between the grid vertexes of the grid and the region edges of the water area region, the terminal can store the edge distance of each grid vertex in the vertex attribute (dist attribute) of each grid vertex, so as to directly obtain the corresponding edge distance from the vertex attribute of the grid vertex when needed.

[0057] In some embodiments, in order to facilitate the relevant user to observe the distribution of each water area region in the water grid graph, the different positions of the water area regions of the water grid graph can be given corresponding color values based on the distances of the grid vertexes to the region edges, so as to present a gradient effect, and facilitate the user to observe the distribution of the water area regions.

[0058] Specifically, after determining the edge distance between the grid vertexes of the grid and the region edges of the water area region, the terminal can further determine the target color value corresponding to the grid vertex based on a preset color mapping relationship and the edge distance of the grid vertex, wherein the color mapping relationship is used to indicate the mapping relationship between the edge distance and the color value. Then, the terminal can display the region color of the water area region in the water grid graph based on the target color value corresponding to the grid vertex.

[0059] The color value can be higher as the edge distance is larger, or the color value can be lower as the edge distance is larger, which can be set according to requirements, and is not limited herein.

[0060] For example, if the mapping relationship between the edge distance and the color value is set as: the edge distance 【0-500】 corresponds to the color value 【0-1】, and if the edge distance exceeds 500, the corresponding color value is 1, the color value corresponding to the edge distance of the grid vertex can be determined, and if 0 is set as black and 1 is set as white, as shown in FIG. 6, in the water area of the water area grid map shown in FIG. 6, the color of the grid vertex farther from the edge of the area is whiter. Figure 5 Figure 5 As shown in FIG. 6, in the water area of the water area grid map shown in FIG. 6, the color of the grid vertex farther from the edge of the area is whiter.

[0061] Step 103, determining the vertex moving parameter of the edge grid vertex based on the edge distance between the grid vertex and the edge of the area.

[0062] In the embodiment, after obtaining the edge distance between the grid vertex and the edge of the area, the distribution of each grid vertex in the corresponding water area can be determined, and the vertex moving parameter of the edge grid vertex at the edge of the water area is determined based on the distribution of each grid vertex in the corresponding water area, so as to explore the water area based on the movement of the edge grid vertex to the center position of the water area, and determine the type of the water area where the edge grid vertex is located.

[0063] The vertex moving parameter is used to control the movement of the edge grid vertex to the center position of the water area.

[0064] The vertex moving parameter is used to indicate the moving direction and the moving distance, for example, the vertex moving parameter can be a vertex moving vector, which is a direction vector and can be used to indicate the moving direction of the vertex, and the length of the vertex moving vector can be used to indicate the moving distance of the vertex, and the longer the length is, the greater the moving distance is. Since the vertex moving parameter is used to control the movement of the edge grid vertex to the center position of the water area, the vertex moving vector is a vector pointing to the center position of the water area.

[0065] In some embodiments, the determination of the vertex moving parameter of the edge grid vertex based on the edge distance between the grid vertex and the edge of the area can include: the terminal can determine at least two first grid vertices adjacent to the edge grid vertex from the grid vertices. Then, the terminal determines the vertex moving parameter of the edge grid vertex based on the relative direction of the edge grid vertex and each of the first grid vertices, and the edge distance of each of the first grid vertices.

[0066] ​It can be understood that, since the edge grid vertex is included in the grid vertex, the first grid vertex adjacent to the edge grid vertex described above can also include other edge grid vertices.

[0067] In the embodiment, the terminal determines how the edge grid vertex moves by the related information of the first grid vertices around the edge grid vertex, so as to make the edge grid vertex move towards the center position of the water area region.

[0068] Specifically, the vertex movement parameter described above includes a vertex movement vector, the vertex movement parameter of the edge grid vertex is determined based on the relative direction between the edge grid vertex and each of the first grid vertices and the edge distance of each of the first grid vertices, and the determination can include that the terminal can determine the direction vector of the edge grid vertex and each of the first grid vertices based on the relative direction between the edge grid vertex and each of the first grid vertices. Then, the terminal calculates the distance difference between the edge distance of the edge grid vertex and the edge distance of each of the first grid vertices. Finally, the terminal can integrate the product of the direction vector of each first grid vertex and the distance difference based on the product to determine the vertex movement vector of the edge grid vertex.

[0069] The integration manner can be to calculate the sum of the products corresponding to each first grid vertex to obtain the vertex movement vector of the edge grid vertex. In addition, in order to facilitate management, the sum of the products corresponding to each first grid vertex can be further subjected to a modulus length normalization process to take the normalized vector as the vertex movement vector.

[0070] Exemplarily, as shown in Figure 6 , the terminal can determine the vertex movement vector of the edge grid vertex by integrating the product of the direction vector of each first grid vertex and the distance difference. Figure 6The grid vertices A, B, C, D, E, F and G are set. When the vertex moving vector of the grid vertex C is calculated, the first direction vector of the grid vertex C and the grid vertex B, the second direction vector of the grid vertex C and the grid vertex A, and the third direction vector of the grid vertex C and the grid vertex D are calculated respectively. If the edge distance of the grid vertex C is set as 0, the edge distance of the grid vertex B is set as 0.5, the edge distance of the grid vertex A is set as 1, and the edge distance of the grid vertex D is set as 0.1, the first product of the first direction vector and -0.5 is calculated, the second product of the second direction vector and -1 is calculated, and the third product of the third direction vector and -0.1 is calculated. Then, the sum of the first product, the second product and the third product is calculated, and the sum of the first product, the second product and the third product is normalized to obtain a normalized vector as the vertex moving vector of the grid vertex C. If the edge distance is mapped to the interval of 0 to 1, the position of the grid vertex A is the center position of the water region, and the vertex moving vector of the grid vertex C is a vector pointing to the center position A.

[0071] In some embodiments, since the grid vertex may move multiple times to approach the center position of the water region, the vertex moving parameters of the grid vertices can be determined at the same time as the vertex moving parameters of the edge grid vertices are determined, so that after the edge grid vertices move, the vertex moving parameters of the grid vertices can be used to determine the vertex moving parameters of the edge grid vertices.

[0072] As shown in FIG. 1, Figure 7 As shown in FIG. 2, Figure 7 As shown in FIG. 3, the vertex moving vectors of the grid vertices in the water region are shown. Figure 7 As shown in FIG. 3, the vertex moving vectors of the grid vertices in the water region are shown.

[0073] In step 104, the edge grid vertices are controlled to move to the center of the water region based on the vertex moving parameters of the edge grid vertices, until the edge grid vertices are determined to be in the center range of the water region, and the moving distance of the edge grid vertices is determined.

[0074] In this embodiment, the terminal can control the edge grid vertices to move to the center position of the water region based on the vertex moving parameters of the edge grid vertices, so as to realize the conversion of the edge of the water region into a point. The point is continuously pushed to the center of the water region until the center of the water region is reached. The moving distance of the point, i.e. the moving distance of the edge grid vertices, is determined. Based on the moving distance of the edge grid vertices, the water region where the edge grid vertices are located is explored, so as to determine the type of the water region where the edge grid vertices are located.

[0075] It can be understood that when the edge grid vertex is in the central range of the water area region, it means that the edge grid vertex is adjacent to the center of the water area region, wherein the central range can be understood as a range divided by the center of the water area region, for example, the center position of the water area region in the moving direction of the edge grid vertex.

[0076] Exemplarily, as shown in Figure 8 , the grid vertex at the edge of the water area grid map moves to the center position of the water area region, as shown in Figure 8 , the edge grid vertex around the arrow moves to the center position of the water area region according to the direction of the arrow, until the edge grid vertex moves to the position close to the center of the water area region, as shown in Figure 9 , the edge grid vertex of the water area region moves to the position close to the center of the water area region. Figure 9

[0077] It can be understood that since one movement of the edge grid vertex does not necessarily be in the above-mentioned central range of the water area region, there can be multiple movements, so when it is determined that the above-mentioned edge grid vertex is not in the above-mentioned central range of the water area region, the vertex movement parameter of the moved edge grid vertex needs to be re-determined in order to control the edge grid vertex to continue moving based on the re-determined vertex movement parameter.

[0078] The above-mentioned way of re-determining the vertex movement parameter can include that the terminal can return to execute the step of determining the vertex movement parameter of the edge grid vertex based on the edge distance between the above-mentioned grid vertex and the above-mentioned region edge to obtain the vertex movement parameter of the moved edge grid vertex; or the terminal can determine the vertex movement parameter of the moved edge grid vertex based on the pre-determined vertex movement parameter of each grid vertex; or the two can be combined, that is, the terminal returns to execute the step of determining the vertex movement parameter of the edge grid vertex based on the edge distance between the above-mentioned grid vertex and the above-mentioned region edge, and at the same time, determines the vertex movement parameter of at least part of the grid vertices based on the edge distance between the grid vertex and the above-mentioned region edge, so as to determine the vertex movement parameter of the moved edge grid vertex based on the vertex movement parameter of at least part of the grid vertices.

[0079] ​Specifically, the determination condition that the edge grid vertex is at the center of the water region can include: determining whether the edge grid vertex is at the center of the water region based on a movement distance indicated by the vertex movement parameter, or determining whether the edge grid vertex is at the center of the water region based on the number of movements of the edge grid vertex, that is, if the movement distance indicated by the vertex movement parameter is less than or equal to a preset distance threshold, it is determined that the edge grid vertex is at the center of the water region; and / or, if the number of movements of the edge grid vertex is not less than a preset number threshold, it is determined that the edge grid vertex is at the center of the water region.

[0080] The preset distance threshold and the preset number threshold can be set according to requirements, which are not limited herein, for example, the preset distance threshold can be set to 0.5 units, and the preset number threshold can be set to 60 times.

[0081] In some embodiments, after controlling the movement of the edge grid vertex to the center of the water region based on the vertex movement parameter of the edge grid vertex, the terminal can further obtain a target position of the edge grid vertex after movement; if it is determined that the edge grid vertex is not at the center of the water region, the step of determining the vertex movement parameter of the edge grid vertex based on the edge distance between the grid vertex and the region edge is executed again based on the target position.

[0082] In some embodiments, the step of determining the vertex movement parameter of the edge grid vertex based on the edge distance between the grid vertex and the region edge based on the target position can include: the terminal determines at least two second grid vertices adjacent to the edge grid vertex at the target position from the grid vertices. Then, the terminal determines the vertex movement parameter of each of the second grid vertices based on the edge distance between the grid vertex and the region edge. Finally, the terminal determines the vertex movement parameter of the edge grid vertex at the target position based on the vertex movement parameters of each of the second grid vertices.

[0083] It can be understood that, since the grid vertices include edge grid vertices, the first grid vertices adjacent to the second grid vertices can also include edge grid vertices. And the terminal determines the vertex movement parameter of the moved edge grid vertex when it moves again by determining the vertex movement parameters of the second grid vertices around the moved edge grid vertex.

[0084] The terminal can average the vertex movement parameters of the second grid vertices to obtain the vertex movement parameter of the edge grid vertex when the edge grid vertex moves again at the target position, or the terminal can interpolate the vertex movement parameters of the second grid vertices based on the relative positions of the edge grid vertex between the second grid vertices to obtain the vertex movement parameter of the edge grid vertex when the edge grid vertex moves again at the target position, etc. The specific determination manner can be set according to requirements, and is not limited herein.

[0085] In some embodiments, the vertex movement parameter includes a vertex movement vector, and the determination of the vertex movement parameter of each second grid vertex based on the edge distance between the grid vertex and the region edge can include that the terminal can determine at least two third grid vertices adjacent to the second grid vertex from the grid vertices. Then, the terminal determines the vertex movement vector of the second grid vertex based on the relative directions of the second grid vertex and each third grid vertex and the edge distances of each third grid vertex.

[0086] It can be understood that, since the grid vertices include the edge grid vertices, the third grid vertices adjacent to the second grid vertex can also include other edge grid vertices. And the terminal determines how the second grid vertex moves through the related information of the third grid vertices around the second grid vertex to promote the second grid vertex to move to the center position of the water area region, so as to determine the movement mode of the edge grid vertex in each second grid vertex based on the movement mode of the second grid vertex.

[0087] Specifically, the vertex movement parameter includes a vertex movement vector, and the determination of the vertex movement vector of the second grid vertex based on the relative directions of the second grid vertex and each third grid vertex and the edge distances of each third grid vertex can include that the terminal can determine the direction vector of the second grid vertex and each third grid vertex based on the relative directions of the second grid vertex and each third grid vertex. Then, the terminal calculates the distance difference between the edge distance of the second grid vertex and the edge distance of each third grid vertex. Finally, the terminal can comprehensively process the product of the direction vector of each third grid vertex and the distance difference based on the product to determine the vertex movement vector of the second grid vertex.

[0088] The comprehensive processing manner can be to calculate the sum of the products corresponding to each third grid vertex to obtain the vertex movement vector of the second grid vertex. In addition, in order to facilitate management, the sum of the products corresponding to each third grid vertex can be further subjected to a modulus length normalization process to take the normalized vector as the vertex movement vector.

[0089] In step 105, the type of the water area corresponding to the edge grid vertex is determined based on the moving distance of the edge grid vertex.

[0090] It can be understood that, since different types of water areas correspond to different water area sizes, for example, a stream is usually a small water flow formed from a spring or rainfall in a mountainous or hilly area, and is characterized by a narrow width and fast water flow; while a lake is usually a large water body formed by a river, stream or underground water and accumulated on the ground surface, and is characterized by a large area and slow water flow.

[0091] Therefore, in this embodiment, the terminal can determine the type of the water area corresponding to the edge grid vertex based on the moving distance of the edge grid vertex, and set the water area before and after the movement of the edge grid vertex to the corresponding water area type, so as to automatically divide different types of water area, thereby improving the accuracy of water area division in the map, and ensuring the consistency and authenticity of the terrain feature due to the division by the movement of the edge grid vertex.

[0092] The determination of the type of the water area based on the moving distance of the edge grid vertex can include setting a threshold interval, such as a stream with a width less than a certain value (e.g., less than 1 m), a river with a width in a certain range (e.g., greater than or equal to 1 m and less than 50 m), a lake with a width in a larger range (e.g., greater than or equal to 50 m and less than 200 m), and an ocean with a larger width (e.g., greater than or equal to 200 m); or a pre-established recognition model can be established to recognize the matching water area type through the moving distance of the edge grid vertex, etc., which can be set as required and is not limited herein.

[0093] It can be understood that, since the complex conditions of the terrain features of different game maps are different, if artificial manual marking is used, it will be very difficult to modify or adjust the river once it is designed, and artificial re-marking is required, which greatly limits the variety and diversity of the game map. The water area division method mentioned in this embodiment can realize automatic marking of the water area in the map, greatly improving the flexibility of the water area division of the map, so that when the map changes, the changed water area of the map can be automatically re-divided, and the method mentioned in this embodiment can be used in the corresponding engine through the graphical interface platform, reducing the adaptation problem in the development process.

[0094] In addition, due to the way that the human being marks the water area of the map, a large amount of production time and labor cost is required, especially for a large-scale game map, which is inefficient. By using the water area division method of the map mentioned in the embodiment, the water area of the map can be automatically marked to improve the production efficiency and save human resources.

[0095] In some embodiments, after determining the water area type corresponding to the edge grid vertex, the terminal can further set a corresponding group for each water area type, and store the edge grid vertex of the determined water area type into the corresponding group, so as to record the water area type corresponding to each water area of the target map.

[0096] In some embodiments, in order to facilitate the user to view the water area type of the water area of the target map, a corresponding color can be set for each water area type, as shown in Figure 10 Different water areas are provided with corresponding colors.

[0097] In some embodiments, since the water area of the same water area type can also have a wide and thin situation, the division of the water area type of the water area region is interlaced, which is not particularly smooth, resulting in that the determined water area type of the water area region is relatively fragmented and incomplete, as shown in Figure 11 Figure 11 The same water area region contains colors corresponding to different water area types, that is, the water area type set at part of the position in the same water area region is different from the corresponding water area type as a whole, so that the terminal can use the method of data transmission between adjacent regions to normalize and integrate the data, so as to obtain more complete and continuous water area region of the same type by data denoising.

[0098] Specifically, after determining the water area type corresponding to the edge grid vertex, the terminal can further obtain the water area types corresponding to a preset number of edge grid vertices around the edge grid vertex. Then, the terminal can update the water area type of the edge grid vertex to a target water area type based on the preset number of water area types, wherein the target water area type is the water area type with the largest number in the preset number of water area types.

[0099] ​For example, the terminal can set corresponding colors for different water area region types, such as red, green, and blue. Then, the terminal obtains the colors corresponding to 100 edge grid vertices around the edge grid vertex of the target map, and accumulates the colors to obtain the result values after accumulation of each color, such as 89 for blue, 11 for green, and 0 for red. Then, the terminal can take the water area region type corresponding to blue as the target water area region type, and update the water area region type of the current edge grid vertex to the target water area region type, such as Figure 12 as shown, Figure 12 The figure shows the water area region type diagram after data denoising.

[0100] It can be understood that, because the water area regions of different water area region types are distributed differently in the target map, for example, the water area regions of the “ocean” type are only distributed in the edge part of the target map, and the water area regions of the “river” type can be distributed around the terrain of the target map, therefore, data denoising can be performed based on the distribution position of the water area region, that is, the water area regions distributed in the inland area in the center of the target map can only compare part of the water area region types, for example, set red as the color corresponding to the water area region of the “ocean” type, and then, when updating the water area region type of the water area region in the center of the target map, only the result values corresponding to green and blue can be accumulated to speed up the calculation.

[0101] Finally, the terminal can write the water area region types of each edge vertex after data denoising into the vertex color attribute of the corresponding water area region. By writing different numerical values or color information on the vertex color, it is convenient to distinguish and color different types of water area regions on the material.

[0102] As can be seen from the above, by obtaining a water grid map of a target map, wherein the water grid map includes at least one water area region of the target map, and the water area region is composed of multiple grids, and determining the edge distance between the grid vertex of the grid and the region edge of the water area region, wherein the grid vertex includes an edge grid vertex located on the region edge. Then, based on the edge distance between the grid vertex and the region edge, the vertex movement parameter of the edge grid vertex is determined. Finally, based on the vertex movement parameter of the edge grid vertex, the edge grid vertex is controlled to move to the center of the water area region until it is determined that the edge grid vertex is within the center range of the water area region. The movement distance of the edge grid vertex is determined, and based on the movement distance of the edge grid vertex, the water area region type corresponding to the edge grid vertex is determined, so that by automatically controlling the movement of the edge grid vertex, the corresponding water area region type is determined based on the movement distance, avoiding the labeling abnormality when manually labeling the water area region, and improving the accuracy of water area division in the map.

[0103] The embodiment further provides a water area division device of a map, which can be integrated in a terminal device. For example, as shown in the figure, the water area division device of the map can include: Figure 13

[0104] The acquisition module 1301 is configured to acquire a water area grid map of a target map, where the water area grid map includes at least one water area of the target map, and the water area is composed of a plurality of grids.

[0105] The distance determination module 1302 is configured to determine an edge distance between a grid vertex of the grid and a region edge of the water area, where the grid vertex includes an edge grid vertex located at the region edge.

[0106] The parameter determination module 1303 is configured to determine a vertex movement parameter of the edge grid vertex based on the edge distance between the grid vertex and the region edge.

[0107] The movement module 1304 is configured to control the edge grid vertex to move to the center of the water area based on the vertex movement parameter of the edge grid vertex until it is determined that the edge grid vertex is in the center range of the water area, and determine a movement distance of the edge grid vertex.

[0108] The type determination module 1305 is configured to determine a water area type corresponding to the edge grid vertex based on the movement distance of the edge grid vertex.

[0109] In some embodiments, the parameter determination module 1303 is specifically configured to:

[0110] From the grid vertices, at least two first grid vertices adjacent to the edge grid vertex are determined.

[0111] Based on the relative directions of the edge grid vertex and each of the first grid vertices and the edge distances of each of the first grid vertices, the vertex movement parameter of the edge grid vertex is determined.

[0112] In some embodiments, the vertex movement parameter includes a vertex movement vector, and the parameter determination module 1303 is specifically configured to:

[0113] Based on the relative directions of the edge grid vertex and each of the first grid vertices, direction vectors of the edge grid vertex and each of the first grid vertices are determined.

[0114] The distance difference between the edge distance of the edge grid vertex and the edge distances of each of the first grid vertices is calculated.

[0115] ​Determine a vertex moving vector of the edge grid vertex based on a product of a direction vector of each first grid vertex and a distance difference value.

[0116] In some embodiments, the water area dividing device further comprises an execution module configured to:

[0117] Obtain a target position of the edge grid vertex after moving;

[0118] If it is determined that the edge grid vertex is not in the central range of the water area region, return to execute the step of determining the vertex moving parameter of the edge grid vertex based on the edge distance between the grid vertex and the region edge based on the target position.

[0119] In some embodiments, the execution module is configured to:

[0120] From the grid vertices, determine at least two second grid vertices adjacent to the edge grid vertex at the target position;

[0121] Determine a vertex moving parameter of each second grid vertex based on the edge distance between the grid vertex and the region edge;

[0122] Determine the vertex moving parameter of the edge grid vertex at the target position based on the vertex moving parameter of each second grid vertex.

[0123] In some embodiments, the vertex moving parameter comprises a vertex moving vector, and the execution module is configured to:

[0124] From the grid vertices, determine at least two third grid vertices adjacent to the second grid vertex;

[0125] Determine a vertex moving vector of the second grid vertex based on the relative direction of the second grid vertex and each third grid vertex and the edge distance of each third grid vertex.

[0126] In some embodiments, the determination condition that the edge grid vertex is in the central range of the water area region comprises:

[0127] If the moving distance indicated by the vertex moving parameter is less than or equal to a preset distance threshold, it is determined that the edge grid vertex is in the central range of the water area region; and / or,

[0128] If the number of movements of the edge grid vertex is not less than a preset number threshold, it is determined that the edge grid vertex is in the central range of the water area region.

[0129] In some embodiments, the water area division apparatus of the map further comprises a display module, and the display module is specifically configured to:

[0130] determine a target color value corresponding to the grid vertex based on the preset color mapping relationship and the edge distance of the grid vertex, wherein the color mapping relationship is used to indicate a mapping relationship between the edge distance and the color value;

[0131] display a region color of the water area region in the water area grid map based on the target color value corresponding to the grid vertex.

[0132] In some embodiments, the distance determination module 1302 is specifically configured to:

[0133] take the distance between the grid vertex and the target edge grid vertex as the edge distance between the grid vertex and the region edge, wherein the target edge grid vertex is the edge grid vertex closest to the grid vertex.

[0134] In some embodiments, the water area division apparatus of the map further comprises a type updating module, and the type updating module is specifically configured to:

[0135] obtain a water area region type corresponding to a preset number of edge grid vertices around the edge grid vertex;

[0136] update the water area region type of the edge grid vertex to a target water area region type based on the preset number of water area region types, wherein the target water area region type is the water area region type with the largest number in the preset number of water area region types.

[0137] As can be seen from the above, by obtaining a water area grid map of a target map, wherein the water area grid map comprises at least one water area region of the target map, and the water area region is composed of a plurality of grids, and then determining an edge distance between a grid vertex of the grid and a region edge of the water area region, wherein the grid vertex comprises an edge grid vertex located on the region edge. Then, based on the edge distance between the grid vertex and the region edge, a vertex movement parameter of the edge grid vertex is determined. Finally, based on the vertex movement parameter of the edge grid vertex, the edge grid vertex is controlled to move to the center of the water area region until it is determined that the edge grid vertex is in the center range of the water area region. The movement distance of the edge grid vertex is determined, and based on the movement distance of the edge grid vertex, a water area region type corresponding to the edge grid vertex is determined, so that by automatically controlling the movement of the edge grid vertex, the corresponding water area region type is determined based on the movement distance, avoiding the labeling abnormality when labeling the water area region manually, so as to improve the accuracy of water area division in the map.

[0138] Accordingly, this application also provides an electronic device, which can be a terminal, such as a smartphone, tablet computer, laptop computer, touch screen, game console, personal computer (PC), personal digital assistant (PDA), or other terminal device. Alternatively, the electronic device can be a server.

[0139] like Figure 14 As shown, Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 1400 includes a processor 1401 with one or more processing cores, a memory 1402 with one or more computer-readable storage media, and a computer program stored on the memory 1402 and executable on the processor. The processor 1401 and the memory 1402 are electrically connected. Those skilled in the art will understand that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0140] The processor 1401 is the control center of the electronic device 1400. It connects various parts of the electronic device 1400 via various interfaces and lines. By running or loading software programs and / or units stored in the memory 1402, and by calling data stored in the memory 1402, it executes various functions and processes data of the electronic device 1400, thereby providing overall monitoring of the electronic device 1400. The processor 1401 can be a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), etc., and can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application.

[0141] In this embodiment, the processor 1401 in the electronic device 1400 loads the instructions corresponding to the processes of one or more applications into the memory 1402 according to the following steps, and the processor 1401 runs the applications stored in the memory 1402 to realize various functions, such as:

[0142] Obtain a water area grid map of the target map, wherein the water area grid map includes at least one water area of ​​the target map, and the water area is composed of multiple grids;

[0143] Determine the edge distance between the grid vertices of the aforementioned grid and the region edge of the aforementioned water area, wherein the aforementioned grid vertices include edge grid vertices located at the edge of the aforementioned region;

[0144] determine a vertex movement parameter of the edge grid vertex based on the edge distance between the grid vertex and the edge of the region;

[0145] control the edge grid vertex to move to the center of the water region based on the vertex movement parameter of the edge grid vertex until it is determined that the edge grid vertex is in the center range of the water region, and determine a movement distance of the edge grid vertex;

[0146] determine a water region type corresponding to the edge grid vertex based on the movement distance of the edge grid vertex.

[0147] Therefore, the electronic device 1400 provided in this embodiment can improve the accuracy of water region division in a map.

[0148] The specific implementation of each operation can refer to the foregoing embodiments, which will not be described here.

[0149] Optionally, as shown in Figure 14 The electronic device 1400 further includes a touch display screen 1403, a radio frequency circuit 1404, an audio circuit 1405, an input unit 1406, and a power supply 1407. The processor 1401 is electrically connected with the touch display screen 1403, the radio frequency circuit 1404, the audio circuit 1405, the input unit 1406, and the power supply 1407, respectively. Those skilled in the art can understand that Figure 14 The electronic device structure shown in the foregoing embodiments does not constitute a limitation on the electronic device, and can include more or fewer components than those shown, or combine certain components, or different component arrangements.

[0150] The touch display screen 1403 can be used to display a graphical user interface and receive operation instructions generated by user acting on the graphical user interface. The touch display screen 1403 can include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, which can be composed of graphics, text, icons, video and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect touch operations (such as user operations on or near the touch panel using a finger, a stylus or any suitable object or accessory) of the user thereon or therearound, and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel can include two parts of a touch detection device and a touch controller. The touch detection device detects the touch position of the user and detects the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, and converts it into touch coordinates, and then sends it to the processor 1401, and can receive and execute the commands sent by the processor 1401. The touch panel can cover the display panel, and when the touch panel detects a touch operation thereon or therearound, it transmits to the processor 1401 to determine the type of touch event, and then the processor 1401 provides corresponding visual output on the display panel according to the type of touch event. In the embodiments of the present application, the touch panel and the display panel can be integrated into the touch display screen 1403 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can realize the input and output functions as two independent components. That is, the touch display screen 1403 can also realize the input function as part of the input unit 1406.

[0151] The radio frequency circuit 1404 can be used to transceive radio frequency signals to establish wireless communication with network devices or other electronic devices, and transceive signals between network devices or other electronic devices.

[0152] The audio circuit 1405 can be used to provide an audio interface between a user and the electronic device through a speaker and a microphone. The audio circuit 1405 can convert received audio data into an electrical signal and transmit the electrical signal to the speaker for conversion into a sound signal and output by the speaker. On the other hand, the microphone can collect a sound signal and convert the sound signal into an electrical signal, which is received by the audio circuit 1405 and converted into audio data. The audio data is output to the processor 1401 for processing, transmitted to another electronic device through the radio frequency circuit 1404, or output to the memory 1402 for further processing. The audio circuit 1405 can also include a jack for a headset to provide communication between the headset and the electronic device.

[0153] The input unit 1406 can be used to receive inputted digital, character information or user feature information (e.g., fingerprint, iris, face information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0154] The power supply 1407 is used to supply power to various components of the electronic device 1400. Optionally, the power supply 1407 can be logically connected to the processor 1401 through a power management system, so that the power management system can be used to manage charging, discharging, and power consumption management, etc. The power supply 1407 can also include one or more direct current or alternating current power sources, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, etc.

[0155] Although Figure 14 The electronic device 1400 can also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which are not shown in the figure.

[0156] In the above embodiments, the description of each embodiment focuses on different aspects, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0157] Those skilled in the art can understand that all or part of the steps in the methods of the above embodiments can be completed by instructions, or by related hardware controlled by the instructions, which can be stored in a computer readable storage medium and loaded and executed by a processor.

[0158] To this end, the embodiments of the present application provide a computer readable storage medium, which stores a plurality of computer programs. The computer programs can be loaded by a processor to execute any of the map water area division methods provided by the embodiments of the present application. The computer programs can execute the steps of the map water area division method as follows:

[0159] acquire a water area grid map of a target map, wherein the water area grid map comprises at least one water area region of the target map, and the water area region is composed of a plurality of grids;

[0160] determine an edge distance between a grid vertex of the grid and a region edge of the water area region, wherein the grid vertex comprises an edge grid vertex located at the region edge;

[0161] determine a vertex movement parameter of the edge grid vertex based on the edge distance between the grid vertex and the region edge;

[0162] control the edge grid vertex to move to a center of the water area region based on the vertex movement parameter of the edge grid vertex until it is determined that the edge grid vertex is in a center range of the water area region, and determine a movement distance of the edge grid vertex;

[0163] determine a water area region type corresponding to the edge grid vertex based on the movement distance of the edge grid vertex.

[0164] It can be seen that the computer program can be loaded by the processor to execute any one of the water area division methods of the map provided by the embodiments of the present application, thereby bringing the following technical effects: the accuracy of water area division in the map can be improved.

[0165] The specific implementation of each operation can be referred to the foregoing embodiments, which will not be described here.

[0166] The computer readable storage medium can include a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0167] Due to the computer program stored in the computer readable storage medium, any one of the water area division methods of the map provided by the embodiments of the present application can be executed, and thus the beneficial effects of any one of the water area division methods of the map provided by the embodiments of the present application can be achieved. Details are described in the foregoing embodiments, which will not be described here.

[0168] According to an aspect of the present application, a computer program product or computer program is also provided, which includes computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the electronic device to perform the method provided in various optional implementation manners in the foregoing embodiments.

[0169] In the above map water area division device, computer readable storage medium, electronic device, computer program product embodiments, the description of each embodiment has its own emphasis, and the part not described in detail in a certain embodiment can refer to the related description of other embodiments. Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described map water area division device, computer readable storage medium, computer program product, electronic device and its corresponding unit and the beneficial effects brought by it can refer to the description of the above embodiments of the map water area division method, and will not be described here in detail.

[0170] The above describes in detail a map water area division method, device, electronic device, computer readable storage medium and computer program product provided by the embodiments of the present application. The principle and implementation mode of the present application are described by applying specific examples. The above embodiment description is only used to help understand the method and its core idea of the present application. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A method of water area division of a map, characterized by, The method comprises: acquiring a water area grid map of a target map, wherein the water area grid map comprises at least one water area region of the target map, and the water area region is composed of a plurality of grids; determining an edge distance between a grid vertex of the grid and a region edge of the water area region, wherein the grid vertex comprises an edge grid vertex located at the region edge; determining a vertex movement parameter of the edge grid vertex based on the edge distance between the grid vertex and the region edge; controlling the edge grid vertex to move to the center of the water area region based on the vertex movement parameter of the edge grid vertex until it is determined that the edge grid vertex is in the center range of the water area region, determining a movement distance of the edge grid vertex; determining a water area region type corresponding to the edge grid vertex based on the movement distance of the edge grid vertex; wherein the vertex movement parameter comprises a vertex movement vector, and the determining of the vertex movement parameter of the edge grid vertex based on the edge distance between the grid vertex and the region edge comprises: determining at least two first grid vertices adjacent to the edge grid vertex from the grid vertices; determining a direction vector of the edge grid vertex and each of the first grid vertices based on the relative directions of the edge grid vertex and each of the first grid vertices; calculating a distance difference value between the edge distance of the edge grid vertex and the edge distance of each of the first grid vertices; determining the vertex movement vector of the edge grid vertex based on the product of the direction vector of each of the first grid vertices and the distance difference value.

2. The method of water area division of a map according to Claim 1, wherein After the controlling of the edge grid vertex to move to the center of the water area region based on the vertex movement parameter of the edge grid vertex, the method further comprises: acquiring a target position of the edge grid vertex after movement; if it is determined that the edge grid vertex is not in the center range of the water area region, returning to execute the step of determining the vertex movement parameter of the edge grid vertex based on the edge distance between the grid vertex and the region edge based on the target position.

3. The method of water area division of a map according to claim 2, wherein The returning to execute the step of determining the vertex movement parameter of the edge grid vertex based on the edge distance between the grid vertex and the region edge based on the target position comprises: determining at least two second grid vertices adjacent to the edge grid vertex at the target position from the grid vertices; determining a vertex movement parameter of each of the second grid vertices based on the edge distance between the grid vertex and the region edge; determining the vertex movement parameter of the edge grid vertex at the target position based on the vertex movement parameter of each of the second grid vertices.

4. The method of water area division of a map according to Claim 3, wherein The vertex movement parameter comprises a vertex movement vector, and the determining of the vertex movement parameter of each of the second grid vertices based on the edge distance between the grid vertex and the region edge comprises: determining at least two third grid vertices adjacent to the second grid vertex from the grid vertices; determine a vertex moving vector of the second mesh vertex based on relative directions of the second mesh vertex and each of the third mesh vertices, and edge distances of each of the third mesh vertices.

5. The method of water area division of a map according to Claim 1, wherein The determination condition that the edge mesh vertex is in the central range of the water area region comprises: if the moving distance indicated by the vertex moving parameter is less than or equal to a preset distance threshold, it is determined that the edge mesh vertex is in the central range of the water area region; and / or, if the number of movements of the edge mesh vertex is not less than a preset number threshold, it is determined that the edge mesh vertex is in the central range of the water area region.

6. The method of water area division of a map according to Claim 1, wherein After determining the edge distance between the mesh vertex of the mesh and the region edge of the water area region, further comprising: determine a target color value corresponding to the mesh vertex based on a preset color mapping relationship and the edge distance of the mesh vertex, wherein the color mapping relationship is used to indicate a mapping relationship between the edge distance and the color value; display a region color of the water area region in the water area mesh graph based on the target color value corresponding to the mesh vertex.

7. The method of water area division of a map according to Claim 1, wherein The determination of the edge distance between the mesh vertex of the mesh and the region edge of the water area region comprises: taking a distance between the mesh vertex and a target edge mesh vertex as the edge distance between the mesh vertex and the region edge, wherein the target edge mesh vertex is the closest edge mesh vertex to the mesh vertex.

8. The method of water area division of a map according to any one of claims 1 to 7, characterized in that, After determining the water area region type corresponding to the edge mesh vertex, further comprising: obtain the water area region types corresponding to a preset number of edge mesh vertices around the edge mesh vertex; update the water area region type of the edge mesh vertex to a target water area region type based on a preset number of water area region types, wherein the target water area region type is the water area region type with the largest number in the preset number of water area region types.

9. A water area dividing apparatus of a map, characterized by comprising: The device comprises: an acquisition module configured to acquire a water area mesh graph of a target map, wherein the water area mesh graph comprises at least one water area region of the target map, and the water area region is composed of a plurality of meshes; a distance determination module configured to determine an edge distance between a mesh vertex of the mesh and a region edge of the water area region, wherein the mesh vertex comprises an edge mesh vertex located at the region edge; a parameter determination module configured to determine a vertex moving parameter of the edge mesh vertex based on the edge distance between the mesh vertex and the region edge; a moving module configured to control the edge mesh vertex to move to the center of the water area region based on the vertex moving parameter of the edge mesh vertex until it is determined that the edge mesh vertex is in a central range of the water area region, and determine a moving distance of the edge mesh vertex; a type determination module configured to determine a water area region type corresponding to the edge mesh vertex based on the moving distance of the edge mesh vertex; wherein the vertex moving parameter comprises a vertex moving vector, and the determination of the vertex moving parameter of the edge mesh vertex based on the edge distance between the mesh vertex and the region edge comprises: determining at least two first grid vertices adjacent to the edge grid vertex from the grid vertices; determining a direction vector of the edge grid vertex and each of the first grid vertices based on relative directions of the edge grid vertex and each of the first grid vertices; calculating a distance difference between an edge distance of the edge grid vertex and an edge distance of each of the first grid vertices; determining a vertex moving vector of the edge grid vertex based on a product of the direction vector of each of the first grid vertices and the distance difference.

10. An electronic device, comprising: A processor and a memory are included, and the memory stores a plurality of instructions; the processor loads the instructions from the memory to execute the steps of the water area division method of the map according to any one of claims 1-8.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to execute the steps of the water area division method of the map according to any one of claims 1-8.

Citation Information

Patent Citations

  • Method and device for rendering water flow area in virtual scene and computer equipment

    CN115193034A

  • Mesh division boundary adsorption method and device for geographic information system

    CN115601525A