Weighted Voronoi graph vector generation method and device, equipment and medium
By triangulating the initial seed point set and contour generation, filtering the target contour set and maximum weight focus set, weighted Voronoi division is used using the Apolloni circle method, and updating the parameters through iterative calculation, the problem of low generation efficiency of weighted Voronoi graphs in the existing technology is solved, and efficient and high-precision vector generation is achieved.
Patent Information
- Application Number
- CN202510704798.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-07-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing weighted Voronoi graph algorithm is difficult to balance the vector generation efficiency and accuracy, resulting in low generation efficiency.
By triangulating the initial seed point set and contour generation, the target contour set and maximum weight focus set are filtered, the weighted Voronoi division is performed using the Apolloni circle method, and the parameters are updated through iterative calculations until the complete vector diagram is generated.
The vector generation efficiency of weighted Voronoi graphs is improved, while ensuring high-precision generation results, taking into account both efficiency and accuracy.
Smart Images

Figure CN120236034A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of graphics processing, and in particular to a method, device, equipment and medium for generating a weighted Voronoi diagram vector. Background Art
[0002] As an irregular division method of space, the Voronoi diagram is an important tool for spatial layout, path planning, crystal structure analysis, and computer graphics processing, and is widely used in modern scientific fields. The research history of the Voronoi diagram algorithm is relatively long. The research on the Voronoi diagram algorithm can be classified into two categories. One is the vector space generation method, such as the Delaunay triangulation method, the incremental method, and the divide-and-conquer method. The other is the grid space generation method, such as the discrete construction method, the distance change method, and the point-by-point scanning method, etc. The research on the algorithm of the weighted Voronoi diagram is basically an adaptive improvement of the Voronoi diagram algorithm. The mainstream weighted Voronoi diagram algorithms are divided into the grid generation method and the vector generation method. Currently, both of these two types of algorithms have certain disadvantages: the grid generation method is faster, but the accuracy is very low. The grid generation method divides the entire space into N cells of equal size, and determines the Voronoi diagram by calculating the attribution of the cells. The size of the cells seriously affects the accuracy of the result; the vector generation method has high accuracy, but the calculation amount is very large, especially the need to repeatedly perform arc polygon intersection and cutting calculations, and the processing of irregular arc polygons is time-consuming and resource-consuming, resulting in a low vector generation efficiency of the weighted Voronoi diagram.
[0003] Currently, when the weights of the seed points are relatively balanced, the Voronoi region of the seed points is only related to the points on its first ring. When the weights of all seed points are the same, it is an ordinary Voronoi diagram; however, in practical applications, the weights of the seed points often vary greatly. A seed point with a very large weight value may affect the points on its Nth ring. To ensure correctness, the ordinary algorithm needs to calculate in pairs, and the calculation amount is relatively large; it can be seen that the difficulty of the weighted Vonoroi diagram lies in dividing the influence range of the seed points. Improper division easily leads to a low vector generation efficiency of the weighted Voronoi diagram. Therefore, how to balance the vector generation efficiency and vector generation accuracy of a good weighted Voronoi diagram is a technical problem to be solved urgently. Summary of the Invention
[0004] This application aims to solve at least one of the technical problems existing in the prior art. For this reason, this application proposes a method, device, equipment and medium for generating a weighted Voronoi diagram vector, which can simultaneously ensure good vector generation efficiency and vector generation accuracy of the weighted Voronoi diagram.
[0005] In a first aspect, an embodiment of this application provides a method for generating a weighted Voronoi diagram vector, including: Perform triangulation generation processing and contour line generation processing on the first initial seed point set to obtain a first initial contour line set; Generate a first initial area to be divided according to the coordinates of the first initial seed point set; Screen the first initial contour line set to obtain a first target contour line set, determine a maximum weight point set based on the first target contour line set and the first initial seed point set, and perform weighted Voronoi division processing based on the Apollonius circle method according to the maximum weight point set and the first initial area to be divided to obtain a maximum weight point area; When the current maximum weight point set does not include all points in the first initial seed point set, perform parameter update processing according to the first initial contour line set, the first target contour line set, the first initial seed point set and the maximum weight point set to determine an updated second initial contour line set, a second initial area to be divided, and a second initial seed point set; Screen the second initial contour line set to obtain a second target contour line set, determine a new maximum weight point set based on the second target contour line set and the second initial seed point set, and perform weighted Voronoi division processing based on the Apollonius circle method according to the new maximum weight point set and the second initial area to be divided to obtain a new maximum weight point area; Until the current maximum weight point set includes all points in the current initial seed point set, output a vector map of the current latest maximum weight point area.
[0006] In a second aspect, an embodiment of the present application provides a weighted Voronoi diagram vector generation device, including at least one processor and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the weighted Voronoi diagram vector generation method according to any one of the embodiments of the first aspect.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, including the weighted Voronoi diagram vector generation device according to the embodiment of the second aspect.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, storing computer-executable instructions, where the computer-executable instructions are used to implement the weighted Voronoi diagram vector generation method according to the first aspect when executed by a processor.
[0009] Embodiments of the present application include: First, perform triangulation generation processing and contour line generation processing on the first initial seed point set to obtain the first initial contour line set; secondly, generate the first initial area to be divided according to the first initial seed point set through coordinate processing; then, screen the first target contour line set according to the first initial contour line set, determine the maximum weight point set based on the first target contour line set and the first initial seed point set, and perform weighted Voronoi division processing in the Apollonius circle manner according to the maximum weight point set and the first initial area to be divided to obtain the maximum weight point area; divide the influence domain through the contour line, and use the influence domain as the calculation unit of the divide-and-conquer method, reducing a large amount of invalid calculations, thereby improving the vector generation efficiency of the weighted Voronoi diagram; next, when the current maximum weight point set does not include all points in the first initial seed point set, perform parameter update processing according to the first initial contour line set, the first target contour line set, the first initial seed point set and the maximum weight point set to determine the updated second initial contour line set, the second initial area to be divided, and the second initial seed point set; then, screen the second target contour line set according to the second initial contour line set, determine the new maximum weight point set based on the second target contour line set and the second initial seed point set, and perform weighted Voronoi division processing in the Apollonius circle manner according to the new maximum weight point set and the second initial area to be divided to obtain the new maximum weight point area; finally, until the current maximum weight point set includes all points in the current initial seed point set, output the vector diagram of the current latest maximum weight point area; the vector generation accuracy of the weighted Voronoi diagram is ensured through the iterative calculation method. That is to say, the embodiments of the present application can simultaneously ensure good vector generation efficiency and vector generation accuracy of the weighted Voronoi diagram. Description of the Drawings
[0010] Figure 1 It is a schematic flowchart of a method for generating a vector of a weighted Voronoi diagram provided by an embodiment of the present application; Figure 2 It is a schematic diagram of the neighboring ring of points provided by an embodiment of the present application; Figure 3 It is a schematic diagram of the maximum weight point of the contour line provided by an embodiment of the present application; Figure 4 It is a schematic diagram of the Apollonius circle and the Apollonius circle division provided by an embodiment of the present application; Figure 5 It is a schematic flowchart of the specific process for generating the first initial area to be divided provided by an embodiment of the present application; Figure 6 It is a schematic flowchart of the specific process of the weighted Voronoi division processing in the Apollonius circle manner provided by an embodiment of the present application; Figure 7 It is a schematic diagram of the specific process of parameter update processing provided by an embodiment of the present application; Figure 8 It is a schematic diagram of the structure of a weighted Voronoi diagram vector generation device provided by an embodiment of the present application. Detailed implementation manners
[0011] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments.
[0012] It should be noted that although the logical order is shown in the flowchart in the description of the present application, in some cases, the steps shown or described may be executed in an order different from that in the flowchart. In the description of the present application, the meaning of "several" is one or more, and the meaning of "multiple" is two or more. The descriptions of "first" and "second" are only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or implicitly indicating the sequence of the indicated technical features.
[0013] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0014] First, several nouns involved in the present application are explained: Voronoi diagram: Given a point set Q in a plane, for each point p in the Voronoi diagram, there is a region. The distance from any point in this region to p is the minimum distance to all points in Q. The union of these regions constitutes the Voronoi diagram of Q.
[0015] Bowyer-Watson algorithm: It is an incremental Delaunay triangulation algorithm that uses the Voronoi diagram to maintain the Delaunay triangulation; it can also be called the point-by-point insertion algorithm. The Bowyer-Watson algorithm mainly includes: First, construct a large triangle so that all points in the point set to be triangulated fall inside this triangle; Second, insert each new point one by one. When inserting a point, it is necessary to search for the triangles of the points located inside the circumcircle; Then, delete these triangles from the triangle queue, and a polygon cavity can be formed; Finally, connect the inserted point and the polygon cavity to form several new triangles with the inserted point as the common vertex.
[0016] The ISO (isoline) algorithm refers to common isoline generation algorithms, such as Marching Squares (a 2D isoline generation algorithm).
[0017] Delaunay triangulation: A set of connected but non-overlapping triangles, and the circumcircles of these triangles do not contain any other points in this region. Given a set of points P on a plane, the Delaunay triangulation divides the point set into several non-overlapping triangles such that the circumcircle of any triangle does not contain other points.
[0018] Proximity ring of a point: In the Delaunay triangulation, the convex polygon contour formed by the points directly connected to point A is called the first ring of A, and the polygon contour formed by the points directly connected to the first ring is called the second ring of A, and so on up to the Nth ring, as Figure 2 shown.
[0019] Isoline: A smooth curve formed by connecting points with equal index values, usually a closed curve in non-edge regions.
[0020] This application provides a method for generating a weighted Voronoi diagram vector, a device for generating a weighted Voronoi diagram vector, an electronic device, and a computer-readable storage medium, which relates to the field of graphics processing technology. The method includes generating a first initial isoline set, a first initial region to be divided, a first target isoline set, and a set of maximum weight points based on a first initial seed point set; performing weighted Voronoi division on the set of maximum weight points and the first initial region to be divided to obtain a maximum weight point region; when the current set of maximum weight points does not include all the points in the first initial seed point set, performing weighted Voronoi division on the updated second initial isoline set, the second initial region to be divided, and the second initial seed point set to obtain a new maximum weight point region; until the current set of maximum weight points includes all the points in the first initial seed point set, outputting a vector diagram of the current maximum weight point region. It can ensure both good vector generation efficiency and vector generation accuracy of the weighted Voronoi diagram.
[0021] Next, in combination with the accompanying drawings, the embodiments of this application will be further described.
[0022] In the first aspect, as Figure 1 shown, the method for generating a weighted Voronoi diagram vector may include but is not limited to steps S110 to S160.
[0023] Step S110: Perform triangulation generation processing and isoline generation processing on the first initial seed point set to obtain a first initial isoline set.
[0024] Step S120: Perform coordinate processing based on the first initial seed point set to generate the first initial area to be partitioned.
[0025] Step S130: Screen the first target contour line set from the first initial contour line set, determine the maximum weight point set based on the first target contour line set and the first initial seed point set, and perform weighted Voronoi partitioning based on the Apollonius circle method according to the maximum weight point set and the first initial area to be partitioned to obtain the maximum weight point area.
[0026] Step S140: When the current maximum weight point set does not include all points in the first initial seed point set, perform parameter update processing according to the first initial contour line set, the first target contour line set, the first initial seed point set, and the maximum weight point set to determine the updated second initial contour line set, the second initial area to be partitioned, and the second initial seed point set.
[0027] Step S150: Screen the second target contour line set from the second initial contour line set, determine the new maximum weight point set based on the second target contour line set and the second initial seed point set, and perform weighted Voronoi partitioning based on the Apollonius circle method according to the new maximum weight point set and the second initial area to be partitioned to obtain the new maximum weight point area.
[0028] Step S160: Until the current maximum weight point set includes all points in the current initial seed point set, output the vector diagram of the current latest maximum weight point area.
[0029] It can be understood that the maximum weight point of the contour line refers to: the edges included in the same contour line interval and the edges intersecting the contour line in the Delaunay triangulation, and the set of vertices of these two types of edges is the maximum weight point of the contour line, as Figure 3 shown.
[0030] It can be understood that the Apollonius circle refers to: given two points A and B on a plane, and a positive ratio k (k≠1), the set of all points P that satisfy the ratio of the distances to points A and B being k forms a circle, and this circle is the Apollonius circle, as Figure 4 shown.
[0031] It should be noted that the first initial seed point set is presented in the form of a list.
[0032] Specifically, after obtaining the maximum weight point area by executing step S130, when the maximum weight point set includes all points in the first initial seed point set, steps S140 to S150 are not continued, but the vector diagram of the current latest maximum weight point area is output, and the method for generating the weighted Voronoi diagram vector ends.
[0033] It should be noted that as the parameters are updated and the number of iterative calculations increases, the current initial seed point set refers to the current initial seed point set used to determine the maximum weight point set. In the first weighted Voronoi partitioning process, the current initial seed point set refers to the first initial seed point set; in the second weighted Voronoi partitioning process, the current initial seed point set refers to the second initial seed point set; and so on.
[0034] In the embodiment of the present application, through steps S110 to S160, first, triangulation generation processing and contour line generation processing are performed on the first initial seed point set parent_points_1 to obtain the first initial contour line set parent_contours_1; secondly, coordinate processing is performed according to the first initial seed point set parent_points_1 to generate the first initial region to be divided parent_region_1; then, the first target contour line set max_contours_1 is screened according to the first initial contour line set parent_contours_1, the maximum weight point set max_points is determined based on the first target contour line set max_contours_1 and the first initial seed point set parent_points_1, and weighted Voronoi division processing based on the Apollonius circle method is performed according to the maximum weight point set max_points and the first initial region to be divided parent_region_1 to obtain the maximum weight point region; by dividing the influence domain by contour lines and using the influence domain as the calculation unit of the divide-and-conquer method, a large amount of invalid calculations are reduced, thereby improving the vector generation efficiency of the weighted Voronoi diagram; then, when the current maximum weight point set max_points does not include all the points in the first initial seed point set parent_points_1, parameter update processing is performed according to the first initial contour line set parent_contours_1, the first target contour line set max_contours_1, the first initial seed point set parent_points_1 and the maximum weight point set max_points to determine the updated second initial contour line set parent_contours_2, the second initial region to be divided, and the second initial seed point set child_pointsparent_points_2; then, the second target contour line set max_contours_2 is screened according to the second initial contour line set parent_contours_2, a new maximum weight point set max_points is determined based on the second target contour line set max_contours_2 and the second initial seed point set child_pointsparent_points_2, and weighted Voronoi division processing based on the Apollonius circle method is performed according to the new maximum weight point set max_points and the second initial region to be divided to obtain a new maximum weight point region; finally, until the current maximum weight point set max_points includes all the points in the current initial seed point set child_points, the vector diagram of the current latest maximum weight point region is output; the vector generation accuracy of the weighted Voronoi diagram is ensured through iterative calculation. That is to say, the embodiment of the present application can ensure both good vector generation efficiency and vector generation accuracy of the weighted Voronoi diagram.
[0035] According to some embodiments of the present application, step S110 is further described. Step S110: Perform triangulation generation processing and contour line generation processing on the first initial seed point set to obtain the first initial contour line set, including but not limited to steps S111 to S116.
[0036] Step S111: Perform triangulation generation processing on the first initial seed point set parent_points_1 to be processed through an incremental Delaunay triangulation algorithm to obtain a Delaunay triangulation network.
[0037] Step S112: Traverse the first initial seed point set parent_points_1 to obtain the initial maximum weight value and the initial minimum weight value.
[0038] Step S113: Multiply the initial maximum weight value by a first preset coefficient to obtain the target maximum weight value.
[0039] Step S114: Multiply the initial minimum weight value by a second preset coefficient to obtain the target minimum weight value.
[0040] Step S115: Divide the difference between the target maximum weight value and the target minimum weight value by a preset number of levels to obtain the contour line step size.
[0041] Step S116: Traverse the Delaunay triangulation network and generate the first initial contour line set parent_contours_1 based on the contour line step size and a preset contour line generation algorithm; wherein, the first initial contour line set parent_contours_1 includes multiple candidate contour lines.
[0042] Specifically, in step S11, the incremental Delaunay triangulation algorithm adopted in the embodiments of the present application is the Bowyer-Watson algorithm. Processing the first initial seed point set parent_points_1 through the Bowyer-Watson algorithm to generate a Delaunay triangulation network lays a foundation for subsequent generation of contour lines.
[0043] Specifically, the first preset coefficient is greater than the second preset coefficient; the first preset coefficient in step S113 is 1.1; the second preset coefficient in step S114 is: 0.9.
[0044] Specifically, the preset number of levels in step S115 is used to indicate the number of levels of the contour lines to be divided; the preset number of levels is specifically 10.
[0045] It should be noted that the contour interval refers to the difference between two adjacent contour lines. After determining the contour interval, the first initial contour set parent_contours_1 can be generated based on the Delaunay triangulation network according to the preset contour generation algorithm.
[0046] Through steps S111 to S116, the first initial contour set parent_contours_1 is generated, laying a data foundation for subsequent determination of the first target contour set max_contours_1.
[0047] According to some embodiments of the present application, step S120 is further described. Step S120: Generate the first initial region to be divided according to the first initial seed point set, including but not limited to steps S121 to S124.
[0048] Step S121: Obtain the maximum initial abscissa, minimum initial abscissa, maximum initial ordinate, and minimum initial ordinate from the first initial seed point set parent_points_1.
[0049] Step S122: Perform threshold comparison processing and update processing on the maximum initial abscissa, minimum initial abscissa, maximum initial ordinate, and minimum initial ordinate respectively to obtain the updated maximum target abscissa, minimum target abscissa, maximum target ordinate, and minimum target ordinate.
[0050] Step S123: Determine four coordinate points according to the maximum target abscissa, minimum target abscissa, maximum target ordinate, and minimum target ordinate.
[0051] Step S124: Connect the four coordinate points in sequence to obtain the rectangular first initial region to be divided parent_region_1.
[0052] Specifically, step S121 includes: traversing the first initial seed point set parent_points_1 to obtain the maximum initial abscissa max_x1, minimum initial abscissa min_x1, maximum initial ordinate max_y1, and minimum initial ordinate min_y1; laying a foundation for subsequent calculation of the target coordinates.
[0053] In one embodiment, step S122 includes: according to the first comparison result between the initial maximum abscissa value max_x1 and the preset threshold, updating the initial maximum abscissa value max_x1 to the target maximum abscissa value through coordinate update processing; according to the second comparison result between the initial minimum abscissa value min_x1 and the preset threshold, updating the initial minimum abscissa value min_x1 to the target minimum abscissa value through coordinate update processing; according to the third comparison result between the initial maximum ordinate value max_y1 and the preset threshold, updating the initial maximum ordinate value max_y1 to the target maximum ordinate value through coordinate update processing; according to the fourth comparison result between the initial minimum ordinate value min_y1 and the preset threshold, updating the initial minimum ordinate value min_y1 to the target minimum ordinate value through coordinate update processing.
[0054] Specifically, in combination with Figure 5 , steps S122 to S124 are further described. When the preset threshold is 0, the parameters participating in the coordinate update processing include: a first preset coefficient and a second preset coefficient. The first preset coefficient is 1.1; the second preset coefficient is: 0.9.
[0055] After traversing the first initial seed point set parent_points_1 to obtain the initial maximum abscissa value max_x1, the initial minimum abscissa value min_x1, the initial maximum ordinate value max_y1, and the initial minimum ordinate value min_y1, step S122 is executed. Step S122 specifically includes: First, determine whether max_x1 is less than 0. If so, let max_x2 = max_x1 * 0.9; if not, let max_x2 = max_x1 * 1.1. Next, determine whether min_x1 is greater than 0. If so, let min_x2 = min_x1 * 0.9; if not, let min_x2 = min_x1 * 1.1. Then, determine whether max_y1 is less than 0. If so, let max_y2 = max_y1 * 0.9; if not, let max_y2 = max_y1 * 1.1. Next, determine whether min_y1 is greater than 0. If so, let min_y2 = min_y1 * 0.9; if not, let min_y2 = min_y1 * 1.1. Thus, step S122 is completed, and the target maximum abscissa value max_x2, the target minimum abscissa value min_x2, the target maximum ordinate value max_y2, and the target minimum ordinate value min_y2 are obtained.
[0056] Next, step S123 is executed. Step S123 includes: determining four coordinate points according to the maximum value of the target abscissa max_x2, the minimum value of the target abscissa min_x2, the maximum value of the target ordinate max_y2, and the minimum value of the target ordinate min_y2: (min_x2, min_y2), (max_x2, min_y2), (max_x2, max_y2), (min_y2, max_y2). Finally, step S124 is executed. Specifically: connecting the four coordinate points in sequence: (min_x2, min_y2), (max_x2, min_y2), (max_x2, max_y2), (min_y2, max_y2) to obtain a closed rectangle, and this closed rectangle is the first initial region to be partitioned parent_region_1.
[0057] Through steps S121 to S124, the first initial region to be partitioned parent_region_1 is determined based on the first initial seed point set parent_points_1, laying a data foundation for subsequent weighted Voronoi partitioning processing based on the Apollonius circle method.
[0058] According to some embodiments of the present application, step S130 is further described. Among them, screening the first target contour set from the first initial contour set includes, but is not limited to, steps S1301 to S1303.
[0059] Step S1301: Traverse the weight values of the candidate contours in the first initial contour set parent_contours_1 to determine the maximum weight index value.
[0060] Step S1302: Determine all candidate contours in the first initial contour set parent_contours_1 whose weight values are equal to the maximum weight index value as target contours.
[0061] Step S1303: Add the target contours to the preset empty set of target contours to generate the first target contour set max_contours_1; where the first target contour set max_contours_1 includes at least one target contour.
[0062] It can be understood that when the first initial seed point set parent_points_1 is small, there may be only one target contour line with the largest value in the first target contour line set max_contours_1; when the first initial seed point set parent_points_1 is large, there may be multiple target contour lines with the largest value in the first target contour line set max_contours_1; therefore, the embodiments of the present application do not specifically limit the number of target contour lines in the first target contour line set max_contours_1.
[0063] Through steps S1301 to S1303, the first target contour line set max_contours_1 is screened to lay a data foundation for subsequent determination of the maximum weight point set max_points.
[0064] According to some embodiments of the present application, step S130 is further described. Among them, determining the maximum weight point set max_points based on the first target contour line set max_contours_1 and the first initial seed point set parent_points_1 includes, but is not limited to, steps S1304 to S1305.
[0065] Step S1304: Traverse each target contour line in the first target contour line set max_contours_1, and determine the maximum weight point of each target contour line from the first initial seed point set parent_points_1.
[0066] Step S1305: Add the maximum weight point of each target contour line to a preset empty set to obtain the maximum weight point set max_points.
[0067] It should be noted that the maximum weight point of the target contour line refers to the adjacent point of the target contour line, as Figure 3 shown.
[0068] Determining the maximum weight point set max_points through steps S1304 to S1305 lays a data foundation for subsequent weighted Voronoi partitioning processing based on the Apollonius circle method.
[0069] Combined with Figure 6 Step S130 is further described. Among them, based on the maximum weight point set and the first initial area to be partitioned, weighted Voronoi partitioning processing based on the Apollonius circle method is performed to obtain the maximum weight point area, including, but not limited to, steps S1306 to S1319.
[0070] Step S1306: Create an empty list max_point_regions and determine the number of maximum weight points max_pointscount. The max_point_regions list is the list of maximum weight point regions.
[0071] Step S1307: Initialize the counter i = 0.
[0072] Step S1308: Determine whether: i < max_points.count; if so, jump to execute Steps S1309 to S1311; if not, end the process.
[0073] Step S1309: Let point_i = max_points[i]. That is, let point_i be equal to the i-th maximum weight point in the set of maximum weight points max_points.
[0074] Step S1310: Initialize the initial region region_i of point_i = parent_region; add region_i to the max_point_regions list; parent_region is the first initial region to be divided parent_region_1.
[0075] Step S1311: Initialize the counter j = 0.
[0076] Step S1312: Determine whether: j < max_points.count, if so, jump to execute Step S1313, if not, jump to execute Step S1319.
[0077] Step S1313: Determine whether: i = j; if not, execute Steps S1314 to S1318; if so, execute Step S1318.
[0078] Step S1314: Let point_j = max_point[j]. That is, let point_j be equal to the j-th maximum weight point in the set of maximum weight points max_points.
[0079] Step S1315: Use the Apollonius circle to divide the range regions of point_i and point_j to obtain the range region of point_i as tmp_region.
[0080] Step S1316: Intersect the i-th neighboring point region max_point_regions[i] in the max_point_regions list with tmp_region to obtain the overlapping region tmp_region_i.
[0081] Step S1317: Update max_point_regions[i] = tmp_region_i.
[0082] Step S1318: j = j + 1, and return to execute Step S1312.
[0083] Step S1319: i = i + 1, and return to execute Step S1308.
[0084] Step S130 specifically includes: Step S1301 to Step S1319. Among them, the single - time weighted Voronoi partition processing based on the Apollonius circle method is realized through Step S1306 to Step S1319.
[0085] According to some embodiments of the present application, Step S140 is further described. Among them, parameter update processing is performed according to the first initial contour set, the first target contour set, the first initial seed point set, and the maximum weight point set to determine the updated second initial contour set, the second initial region to be partitioned, and the second initial seed point set, including but not limited to Step S141 to Step S145.
[0086] Step S141: Using the target contour in the first target contour set max_contours_1 as the cutting line, divide the first initial region to be partitioned parent_region_1 into different influence regions block.
[0087] Step S142: Perform maximum weight point grouping processing and region merging processing according to the maximum weight point set max_points and the influence region block to obtain the edge region border_regions.
[0088] Step S143: Remove the first target contour set max_contours_1 from the first initial contour set parent_contours_1 to obtain the remaining contour set left_contours.
[0089] Step S144: Traverse the edge region border_regions, intersect each edge region border_regions with the remaining contour set left_contours to obtain the child contour set child_contours; intersect the edge region border_regions with the first initial seed point set parent_points_1 to obtain the child point set child_points.
[0090] Step S145: Determine the edge regions border_regions as the new second initial region to be divided, determine the child contour set child_contours as the new second initial contour set parent_contours_2, and determine the child point set child_points as the second initial seed point set child_pointsparent_points_2.
[0091] It should be noted that in step S141, each target contour is used as a cutting line to divide the region. Based on the spatial correlation theory, the influence domain is divided by the contour, and the influence domain is used as the calculation unit of the divide-and-conquer method, which reduces a large amount of invalid calculations; it is beneficial to improve the vector generation efficiency of the weighted Voronoi diagram.
[0092] According to some embodiments of the present application, step S142 is further described. Step S142: Perform maximum weight point grouping processing and region merging processing on the maximum weight point set max_points and the influence region block to obtain the edge region border_regions, including but not limited to steps S1421 to S1422.
[0093] Step S1421: Group the maximum weight point set max_points according to the influence region block to which they belong based on the influence region block to obtain the grouped maximum weight points.
[0094] Step S1422: Merge the maximum weight point regions corresponding to the maximum weight points in the same group to obtain the edge region border_regions.
[0095] Through steps S141 to S145, when the maximum weight point set max_points does not include all the points in the first initial seed point set parent_points_1, use the updated second initial contour set parent_contours_2, the second initial region to be divided, and the second initial seed point set child_pointsparent_points_2 as the calculation parameters of the divide-and-conquer method, and perform iterative calculations based on the calculation parameters of the divide-and-conquer method to ensure the vector generation accuracy of the weighted Voronoi diagram through iterative calculations.
[0096] For example, in combination with Figure 7 , the specific steps of the parameter update process include but are not limited to steps S701 to S717.
[0097] Step S701: Cut the first initial region to be divided parent_region_1 with the target contour lines in the first target contour line set max_contours_1 to obtain a blocks list including different influence regions block.
[0098] Step S702: Remove the first target contour line set max_contours_1 from the first initial contour line set parent_contours_1 to obtain the remaining contour line set left_contours.
[0099] Step S703: Initialize the counter i = 0.
[0100] Step S704: Determine whether: i < blocks count; if so, jump to execute Step S705; if not, end the parameter update process. Here, blocks count refers to the number of influence regions block in the blocks list.
[0101] Step S705: Let block_i = blocks[i]. Here, blocks[i] refers to the i-th influence region block in the blocks list.
[0102] Step S706: Establish an empty region border_region_i based on block_i.
[0103] Step S707: Initialize the counter j = 0.
[0104] Step S708: Determine whether: j < max_points count; if so, execute Step S709; if not, jump to execute Step S714. Here, max_points count refers to the maximum number of weighted points.
[0105] Step S709: Let max_point_j = max_points[j]; max_points[j] refers to the j-th maximum weighted point.
[0106] Step S710: Determine whether: max_point_j is within the range of block_i; if so, execute Step S711; if not, execute Step S714.
[0107] Step S711: Let max_point_region_j = max_point_regions[j]. Here, max_point_regions[j] refers to the j-th maximum weighted point region.
[0108] Step S712: Merge border_region_i and max_point_region_j to obtain the edge region tmp_border_region_i.
[0109] Step S713: Let border_region_i = tmp_border_region_i.
[0110] Step S714: Let j = j + 1; return to Step S708.
[0111] Step S715: Intersect the edge region border_region_i with the remaining contour set left_contours to obtain the sub - contour set child_contours_i, and intersect the edge region border_region_i with the first initial seed point set parent_points_1 to obtain the sub - point set child_points_i.
[0112] Step S716: Use the edge region border_region_i, the sub - point set child_points_i, and the sub - contour set child_contours_i as the new divide - and - conquer calculation parameters, and recursively call the new divide - and - conquer calculation parameters for weighted Voronoi region division processing. Among them, determine the edge region border_region_i as the new second initial region to be divided, determine the sub - contour set child_contours_i as the new second initial contour set parent_contours_2, and determine the sub - point set child_points_i as child_points; child_points is the second initial seed point set parent_points_2.
[0113] Step S717: Let i = i + 1, return to Step S704.
[0114] Through Steps S701 to S717, the parameter iterative update of the divide - and - conquer calculation parameters is realized, so as to further realize the weighted Voronoi region division processing again. By means of iterative calculation, the vector generation accuracy of the weighted Voronoi diagram is ensured.
[0115] To further explain step S150, after obtaining the updated second initial contour set parent_contours_2, the second initial region to be partitioned, and the second initial seed point set child_pointsparent_points_2, iterative calculation processing is performed. During the iteration, based on the updated second initial contour set parent_contours_2, the second initial region to be partitioned, and the second initial seed point set child_pointsparent_points_2, steps S1306 to S1319 are re-executed to implement the weighted Voronoi partitioning processing based on the Apollonius circle method once again. It can be understood that during the iterative calculation, the updated second initial contour set parent_contours_2 is equivalent to the first initial contour set parent_contours_1 in steps S1306 to S1319, the updated second initial region to be partitioned is equivalent to the first initial region to be partitioned parent_region_1 in steps S1306 to S1319, and the updated second initial seed point set child_pointsparent_points_2 is equivalent to the first initial seed point set parent_points_1 in steps S1306 to S1319.
[0116] As Figure 8 shown, the present invention also provides a weighted Voronoi diagram vector generation device, including: A processor 801, which can be implemented by using a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present application; A memory 802, which can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory 802 can store an operating system and other application programs. When implementing the technical solutions provided by the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 802 and are called by the processor 801 to execute the weighted Voronoi diagram vector generation method of the embodiments of the present application; An input / output interface 803, which is used to implement information input and output; A communication interface 804 for implementing communication interaction between this device and other devices, which can achieve communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.); A bus 805 for transmitting information between various components of the device (such as a processor 801, a memory 802, an input / output interface 803, and a communication interface 804); Among them, the processor 801, the memory 802, the input / output interface 803, and the communication interface 804 are communicatively connected to each other inside the device through the bus 805.
[0117] An embodiment of this application also provides an electronic device, including the weighted Voronoi diagram vector generation device as described above.
[0118] An embodiment of this application also provides a storage medium, which is a computer-readable storage medium. This storage medium stores a computer program, and when the computer program is executed by a processor, it implements the above-mentioned weighted Voronoi diagram vector generation method.
[0119] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include high-speed random access memory, and can also include non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory optionally includes a memory remotely located relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0120] Those of ordinary skill in the art will appreciate that all or some of the steps and systems disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and that can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically includes computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery media.
[0121] The above is a specific description of the preferred embodiments of the present application. However, the present application is not limited to the above embodiments. Those skilled in the art can make various equivalent deformations or substitutions without departing from the spirit of the present application, and these equivalent deformations or substitutions are all included within the scope defined by the present application.
Claims
1. A method for generating a weighted Voronoi diagram vector, characterized in that Including: Performing triangulation generation processing and contour line generation processing on the first initial seed point set to obtain a first initial contour line set; Generating a first initial region to be divided according to the first initial seed point set through coordinate processing; Screening a first target contour line set according to the first initial contour line set, determining a maximum weight point set based on the first target contour line set and the first initial seed point set, and performing weighted Voronoi division processing in the Apollonius circle manner according to the maximum weight point set and the first initial region to be divided to obtain a maximum weight point region; When the current maximum weight point set does not include all points in the first initial seed point set, performing parameter update processing according to the first initial contour line set, the first target contour line set, the first initial seed point set and the maximum weight point set to determine an updated second initial contour line set, a second initial region to be divided, and a second initial seed point set; Screening a second target contour line set according to the second initial contour line set, determining a new maximum weight point set based on the second target contour line set and the second initial seed point set, and performing weighted Voronoi division processing in the Apollonius circle manner according to the new maximum weight point set and the second initial region to be divided to obtain a new maximum weight point region; Until the current maximum weight point set includes all points in the current initial seed point set, outputting a vector map of the current latest maximum weight point region.
2. The weighted Voronoi diagram vector generation method according to claim 1, wherein The performing triangulation generation processing and contour line generation processing on the first initial seed point set to obtain a first initial contour line set includes: Performing triangulation generation processing on the first initial seed point set to be processed through an incremental Delaunay triangulation algorithm to obtain a Delaunay triangulation network; Traversing the first initial seed point set to obtain an initial maximum weight value and an initial minimum weight value; Multiplying the initial maximum weight value by a first preset coefficient to obtain a target maximum weight value; Multiplying the initial minimum weight value by a second preset coefficient to obtain a target minimum weight value; Dividing the difference between the target maximum weight value and the target minimum weight value by a preset number of levels to obtain a contour line step size; Traversing the Delaunay triangulation network and generating the first initial contour line set based on the contour line step size and a preset contour line generation algorithm; wherein, the first initial contour line set includes a plurality of candidate contour lines.
3. The weighted Voronoi diagram vector generation method according to claim 1, wherein The generating a first initial region to be divided according to the first initial seed point set through coordinate processing includes: Obtaining an initial maximum abscissa value, an initial minimum abscissa value, an initial maximum ordinate value, and an initial minimum ordinate value from the first initial seed point set; Performing threshold comparison processing and update processing on the initial maximum abscissa value, the initial minimum abscissa value, the initial maximum ordinate value, and the initial minimum ordinate value respectively to obtain an updated target maximum abscissa value, a target minimum abscissa value, a target maximum ordinate value, and a target minimum ordinate value; Determine four coordinate points according to the maximum value of the target abscissa, the minimum value of the target abscissa, the maximum value of the target ordinate, and the minimum value of the target ordinate; Connect the four coordinate points in sequence to obtain the first initial region to be divided of the rectangle.
4. The weighted Voronoi diagram vector generation method according to claim 2, wherein The screening of the first target contour line set according to the first initial contour line set includes: Traverse the weight values of the candidate contour lines in the first initial contour line set to determine the maximum weight index value; Determine all candidate contour lines in the first initial contour line set whose weight values are equal to the maximum weight index value as the target contour lines; Add the target contour lines to a preset empty set of target contour lines to generate the first target contour line set; wherein, the first target contour line set includes at least one target contour line.
5. The weighted Voronoi diagram vector generation method according to claim 4, wherein The determination of the maximum weight point set based on the first target contour line set and the first initial seed point set includes: Traverse each target contour line in the first target contour line set, and determine the maximum weight point of each target contour line from the first initial seed point set; Add the maximum weight points of each target contour line to a preset empty set to obtain the maximum weight point set.
6. The weighted Voronoi diagram vector generation method according to claim 4, wherein, The parameter update process is performed according to the first initial contour line set, the first target contour line set, the first initial seed point set, and the maximum weight point set to determine the updated second initial contour line set, the second initial region to be divided, and the second initial seed point set, including: Use the target contour lines in the first target contour line set as cutting lines to divide the first initial region to be divided into different influence regions; Perform maximum weight point grouping processing and region merging processing according to the maximum weight point set and the influence regions to obtain the edge regions; Remove the first target contour line set from the first initial contour line set to obtain the remaining contour line set; Traverse the edge regions, and intersect each edge region with the remaining contour line set to obtain a sub-contour line set; intersect the edge regions with the first initial seed point set to obtain a sub-point set; Determine the edge regions as the new second initial regions to be divided, determine the sub-contour line sets as the new second initial contour line sets, and determine the sub-point sets as the second initial seed point sets.
7. The weighted Voronoi diagram vector generation method according to claim 6, wherein The performing maximum weight point grouping processing and region merging processing according to the maximum weight point set and the influence regions to obtain the edge regions includes: According to the influence regions, group the maximum weight point set according to the belonging influence regions to obtain the grouped maximum weight points; Merge the maximum weight point regions corresponding to the maximum weight points in the same group to obtain the edge regions.
8. A weighted Voronoi diagram vector generation device, characterized in that, Includes at least one processor and a memory for communicatively connecting with the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the weighted Voronoi diagram vector generation method according to any one of claims 1 to 7.
9. An electronic device, characterized in that, Includes the weighted Voronoi diagram vector generation device according to claim 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to execute the weighted Voronoi diagram vector generation method according to any one of claims 1 to 7.
Citation Information
Cited By
Unmanned aerial vehicle inspection area division method and device, equipment and medium
CN120852585A