A method for determining the minimum and maximum buffer distances of annotations based on two-degree-of-freedom space
By dividing the text height into n segments, setting the minimum and maximum buffer distances for annotations, and using curve fitting to determine the appropriate buffer distance, the problems of ambiguity and overlay in annotation configuration are solved, achieving more efficient automatic annotation configuration.
Patent Information
- Application Number
- CN202211491113.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-25
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-11-25
AI Technical Summary
The lack of objective standards for determining annotation distance in existing technologies leads to poor annotation configuration quality and is prone to ambiguity or overprinting issues.
Using a two-degree-of-freedom space-based method, the text height is divided into n segments. The minimum buffer distance for annotations is set to 1/n, and the maximum buffer distance is set to 2/n to n/n. A suitable buffer distance range is determined by curve fitting, and the minimum and maximum buffer distances are determined using theoretical limits and fitted curves.
It improves the efficiency of automatic annotation configuration, reduces annotation overwriting and ambiguity, and enhances the quality of annotation configuration.
Abstract
Description
Technical Field
[0001] This invention belongs to the field of map annotation technology, specifically relating to a method for determining the minimum and maximum buffer distances for annotations based on a two-degree-of-freedom space. Background Technology
[0002] Map elements can be categorized into three types: point elements, line elements, and polygon elements. Correspondingly, annotations are also categorized into point annotations, line annotations, and polygon annotations. Many scholars have proposed different candidate location generation schemes for these three types of element annotations, which have been successfully applied in actual automatic annotation configuration. For example, point elements generate multiple candidate locations (4, 5, 8, 16, etc.) around the element; line elements generate candidate locations at a certain distance from the line element itself; and polygon elements generate candidate locations on the in-plane skeleton line or outside the polygon.
[0003] In these methods, candidate locations are generated within a certain distance from the feature. However, there is no good solution for determining this distance; it is all a subjectively set value. The distance between the annotation and the feature affects the quality of the annotation configuration. If it is too far, it can easily cause ambiguity; if it is too close, it can easily cause annotation overlay. Therefore, determining an appropriate buffer distance is very important for improving the quality of annotation configuration. Summary of the Invention
[0004] The purpose of this invention is to provide a method for determining the minimum and maximum buffer distances of annotations based on a two-degree-of-freedom space, so as to solve the problems in the prior art mentioned in the background section.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] A method for determining the minimum and maximum buffer distances of annotations based on a two-degree-of-freedom space is proposed. This method divides a text height into n segments, takes 1 / n / n of the text height as a candidate range for buffer distances, sets the minimum buffer distance of an annotation to 1 / n of the text height, and sets the maximum buffer distance to 2 / n, 3 / n, 4 / n, ..., n / n of the text height. The method includes the following steps:
[0007] (1): Input experimental vector map data Map0. This map contains different layers of points, lines and polygons. Each layer has multiple features. Set the input parameter n = 8.
[0008] (2): Output the minimum and maximum buffer distances that the candidate annotation positions should be from the feature to be annotated, i.e., b min and b max The possible values of ;
[0009] (3): Determination of minimum and maximum buffer distances.
[0010] Furthermore, the process of determining the minimum and maximum buffer distances includes the following steps:
[0011] (3-1): Parameter definition and setting;
[0012] (3-2): Candidate position generation and determination;
[0013] (3-3): Set different buffer distance parameters;
[0014] (3-4): Determine a suitable value for the maximum buffer distance;
[0015] (3-5): Output b determined in steps (3-3) and (3-4-5) min and b max The output value represents the minimum and maximum buffer distances that the candidate annotation locations on the input map should be from the features.
[0016] Furthermore, the steps for defining and setting the parameters are as follows:
[0017] (3-1-1): Define the height value of a text annotation as D;
[0018] (3-1-2): Define the minimum buffer distance for annotation candidate positions as b. min Define the maximum buffer distance for annotation candidate positions as b. max ;
[0019] (3-1-3): Define a one-dimensional list List1 = [], containing three fields, namely b min 、b max F, where b min and b max represents the minimum and maximum buffer distances for annotation candidate positions, and F represents the theoretical limit value under the minimum and maximum buffer distance conditions;
[0020] (3-1-4): Define a two-dimensional list List2 = [], List2 is used to store all different buffer distance values and their theoretical limit value F; proceed to (3-1-5);
[0021] (3-1-5): Define arrays Ld and Fd, each with a length of (n-1).
[0022] Furthermore, the generation and determination of candidate locations includes generating and determining the appropriate number of candidate locations for point, line, and polygon features based on the vector map Map0, laying the groundwork for the next step of calculating the theoretical limit value.
[0023] Further, setting different buffer distance parameters includes setting the minimum buffer distance of the annotation to 1 / n of the text height, and setting the maximum buffer distance to 2 / n, 3 / n, 4 / n,......, n / n of the text height, that is, b min = D / 8, b max = 2*D / n, 3*D / n, 4*D / n, ……, n*D / n, calculate the theoretical limit value F of the annotation score corresponding to different minimum and maximum buffer distances (b min and b max ), represented by List1, List1 = [b min , b max , F]; and use the (for i in range) loop function to store all the lists List1 in the list List2, that is, List2 = [[D / n, 2*D / n, F1], [D / n, 3*D / n, F2], [D / n, 4*D / n, F3], ……, [D / n, n*D / n, F n-1 .
[0024] Further, to determine the appropriate value of the maximum buffer distance, the steps are as follows:
[0025] (3 - 4 - 1): Fill the values of b max from 2*D / n, 3*D / n, 4*D / n, ……, n*D / n into the array Ld, Ld = [2*D / n, 3*D / n, 4*D / n, ……, n*D / n], as the abscissa data for the next step of fitting the curve;
[0026] (3 - 4 - 2): Fill the theoretical limit values F corresponding to different buffer distances in List2 into the array Fd, Fd = [F1, F2, F3, ……, F n-1 , as the ordinate data for the next step of fitting the curve;
[0027] (3 - 4 - 3): Use the data in the array Ld as the abscissa and the data in the array Fd as the ordinate to perform a cubic polynomial function fitting of the curve, and find the expression P1 of the cubic polynomial curve fitting equation, P1 = AX 3 + BX 2 + CX + D;
[0028] (3 - 4 - 4): Take the derivative of the cubic polynomial P1 to obtain the first derivative function P2 = 3AX 2 + 2BX + C, set it to 0, and find the positive solution x1; if there are two positive solutions x1 and x2 (x1 < x2), take the smaller value x1 as the solution, x represents the stationary point under this curve;;
[0029] (3-4-5): Calculate the number in the array Ld = [2*D / n, 3*D / n, 4*D / n, ..., n*D / n] with the smallest absolute value of the difference from x1, and use it as the appropriate maximum buffer distance b. max .
[0030] Technical effects and advantages of the present invention: The method for determining the minimum and maximum buffer distances of annotations based on two-degree-of-freedom space proposed in this invention has the following advantages compared with the prior art:
[0031] This invention, by drawing on the N-segmentation method of reference location, divides the range from minimum to maximum buffer distance into n segments, calculates the theoretical limit value and variation under different buffer distances, and uses curve fitting to determine the appropriate minimum and maximum buffer distances between candidate locations and features in the map. This can improve the efficiency of automatic annotation configuration and reduce annotation overlay and annotation ambiguity to a certain extent. Detailed Implementation
[0032] The technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The specific embodiments described herein are merely used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0033] This invention provides a method for determining the minimum and maximum buffer distances of annotations based on a two-degree-of-freedom space. By referencing the N-segmentation method in the direction of the reference position, a text height is divided into n segments. The middle segment's height (1 / n) is taken as a candidate range for the buffer distance. The minimum buffer distance of the annotation is set to 1 / n of a text height, and the maximum buffer distance is set to 2 / n, 3 / n, 4 / n, ..., n / n of a text height. Referring to theoretical limits and curve fitting methods, the range from the minimum to the maximum buffer distance is divided into n segments. The theoretical limits corresponding to different buffer distances are calculated, and the range of the annotation's buffer distance is determined based on the changes in the theoretical limits.
[0034] The detailed process is described below:
[0035] (1): Input experimental vector map data Map0. This map contains different layers of points, lines and polygons. Each layer has multiple features. Set the input parameter n = 8.
[0036] (2): Output the minimum and maximum buffer distances that the candidate annotation positions should be from the feature to be annotated, i.e., b min and b max The possible values of ;
[0037] (3): Determination of minimum and maximum buffer distances.
[0038] (3-1) Parameter definition and setting:
[0039] (3-1-1) Define a text height value of D for the annotation; proceed to (3-1-2);
[0040] (3-1-2) Define the minimum buffer distance for annotation candidate positions as b. min Define the maximum buffer distance for annotation candidate positions as b. max ; Enter (3-1-3);
[0041] (3-1-3) Define a one-dimensional list List1 = [], containing three fields, namely b min 、b max F, where b min and b max Represents the minimum and maximum buffer distances for annotation candidate positions, and F represents the theoretical limit value under the minimum and maximum buffer distance conditions; proceed to (3-1-4);
[0042] (3-1-4) Define a two-dimensional list List2 = [], List2 is used to store all different buffer distance values and their theoretical limit value F; proceed to (3-1-5);
[0043] (3-1-5) Define arrays Ld and Fd, each with a length of (n-1); proceed to (3-2);
[0044] (3-2) Candidate Location Generation and Determination. Based on the vector map Map0, the patents "A Method and Device for Generating Multiple Candidate Locations for Map Feature Annotations" and "A Method for Selecting the Number of Candidate Locations for Multi-Feature Map Annotations Based on Two Degrees of Freedom Space" are used to generate and determine the appropriate number of candidate locations for point, line, and polygon features respectively, laying the groundwork for the next step of calculating the theoretical limit value; proceed to (3-3);
[0045] (3-3) Set different buffer distance parameters. Set the minimum buffer distance of the annotation to 1 / n of the text height, and the maximum buffer distance to 2 / n, 3 / n, 4 / n, ..., n / n of the text height, i.e., b min =D / 8, b max =2*D / n, 3*D / n, 4*D / n, ..., n*D / n, calculate the different minimum and maximum buffer distances (b) min and b max The corresponding theoretical limit value F of the annotation scoring is denoted by List1, where List1 = [b min ,b max,F]; and use the (for i in range) loop function to store all the elements of list List1 into list List2, i.e., List2 = [[D / n, 2*D / n, F1], [D / n, 3*D / n, F2], [D / n, 4*D / n, F3], ……, [D / n, n*D / n, F n-1 ; Enter (3 - 4);
[0046] (3 - 4) Determine the appropriate value of the maximum buffer distance. As the maximum buffer distance increases, it means that the range of available space for the annotation candidate positions increases. Then, there will be fewer annotation overlapping conflicts, and the corresponding theoretical limit value will gradually decrease. Theoretically, when the maximum buffer distance keeps increasing, the theoretical limit value shows a decreasing trend. Therefore, we can use the method of fitting a curve to find the curve equation and then find the point where the first derivative is 0. This point is the stable point of the curve. The specific process is as follows:
[0047] (3 - 4 - 1) Fill the values of 2*D / n, 3*D / n, 4*D / n, ……, n*D / n into the array Ld, Ld = [2*D / n, 3*D / n, 4*D / n, ……, n*D / n], which will be used as the x - coordinate data for the next step of curve fitting; Enter (3 - 4 - 2); max Fill the theoretical limit values F corresponding to different buffer distances in List2 into the array Fd, Fd = [F1, F2, F3, ……, F
[0048] (3 - 4 - 2) Fill the theoretical limit values F corresponding to different buffer distances in List2 into the array Fd, Fd = [F1, F2, F3, ……, F n-1 , which will be used as the y - coordinate data for the next step of curve fitting; Enter (3 - 4 - 3);
[0049] (3 - 4 - 3) Use the data in the array Ld as the x - coordinate and the data in the array Fd as the y - coordinate to perform a cubic polynomial curve fitting, and find the expression P1 of the cubic polynomial curve fitting equation, P1 = AX 3 + BX 2 + CX + D; Enter (3 - 4 - 4);
[0050] (3 - 4 - 4) Take the derivative of the cubic polynomial P1 to obtain the first - order derivative function P2 = 3AX 2 + 2BX + C, and set it to 0. Solve for the positive solution x1. If there are two positive solutions x1 and x2 (x1 < x2), take the smaller value x1 as the solution. x represents the stable point of the curve; Enter (3 - 4 - 5);
[0051] (3 - 4 - 5) Calculate the number in the array Ld = [2*D / n, 3*D / n, 4*D / n, ……, n*D / n] with the smallest absolute difference from x1, and take it as the appropriate maximum buffer distance bmax Enter (3-5);
[0052] (3-5) Output b as determined in (3-3) and (3-4-5). min and b max The output value represents the minimum and maximum buffer distances that the candidate annotation locations on the input map should be from the features.
[0053] During annotation configuration, if the maximum buffer distance exceeds one text height, annotations for other features may be inserted into the gap between the annotation and the feature. Ideally, the maximum buffer distance should not exceed one text height. The minimum buffer distance cannot be zero; otherwise, the annotation and feature will be connected. Therefore, in the two-degree-of-freedom space of the annotation, the minimum and maximum buffer distances are limited to values greater than zero and less than one annotation text height. By referencing the N-segmentation method of the reference position, the range from the minimum to the maximum buffer distance is divided into n segments. Calculating the theoretical limits and variations under different buffer distances allows for the rapid determination of the optimal buffer distance range for the map. This improves the efficiency of automatic annotation configuration and reduces annotation overlap and ambiguity to some extent.
[0054] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for determining the minimum and maximum buffer distances of annotations based on a two-degree-of-freedom space, characterized in that, This method divides a text height into n segments, takes 1 / n / n of the text height as the candidate range of buffer distances, sets the minimum buffer distance of the annotation to 1 / n of the text height, and sets the maximum buffer distance to 2 / n, 3 / n, 4 / n, ..., n / n of the text height, respectively. The method includes the following steps: (1): Input experimental vector map data Map0, which contains different layers of points, lines and polygons. Each layer has multiple features. Set the input parameter n = 8. (2): Output the minimum and maximum buffer distances that the candidate annotation positions should be from the feature to be annotated, i.e., b min and b max The value of ; (3): Determining the minimum and maximum buffer distances; It also includes parameter settings for different buffer distances, specifically: setting the minimum buffer distance for annotations to 1 / n of a text height, and setting the maximum buffer distance accordingly to 2 / n, 3 / n, 4 / n, ..., n / n of a text height, i.e., b max =2*D / n, 3*D / n, 4*D / n, ..., n*D / n, calculate the minimum and maximum buffer distances b for different values. min and b max The corresponding theoretical limit value F of the annotation scoring is denoted by List1, List1 = [b min ,b max The `for iin range` loop is used to store all elements of List1 into List2, i.e., List2 = [[D / n, 2*D / n, F1], [D / n, 3*D / n, F2], [D / n, 4*D / n, F3], ..., [D / n, n*D / n, F1]. n-1 ]]; The steps to determine a suitable maximum buffer distance are as follows: b max The values of 2*D / n, 3*D / n, 4*D / n, ..., n*D / n are filled into the array Ld, Ld = [2*D / n, 3*D / n, 4*D / n, ..., n*D / n], which will be used as the x-axis data for the next step of finding the fitted curve; Fill the array Fd with the theoretical limit values F corresponding to different buffer distances in List2, where Fd = [F1, F2, F3, ..., F n-1 [ ], which will be used as the ordinate data for the next step of finding the fitted curve; Using the data in array Ld as the x-axis and the data in array Fd as the y-axis, a cubic polynomial function is fitted to the curve to obtain the expression P1 of the cubic polynomial curve fitting equation, P1 = AX. 3 +BX 2 +CX+D; Differentiate the cubic polynomial P1 to obtain the first derivative function P2 = 3Ax 2 + 2Bx + C, set it to 0, and the positive solution x1 can be obtained; if there are two positive solutions x1 and x2, where x1 < x2, take the smaller value x1 as the solution, and x represents the stationary point under this curve; Calculate the number in the array Ld = [2*D / n, 3*D / n, 4*D / n, ..., n*D / n] with the smallest absolute value of the difference from x1, and use it as the appropriate maximum buffer distance b. max .
2. The method for determining the minimum and maximum buffer distances of annotations based on a two-degree-of-freedom space according to claim 1, characterized in that: The process of determining the minimum and maximum buffer distances includes the following steps: (3-1): Parameter definition and setting; (3-2): Candidate position generation and determination; (3-3): Set different buffer distance parameters; (3-4): Determine a suitable value for the maximum buffer distance; (3-5): Output b determined in steps (3-3) and (3-4-5) min and b max The output value represents the minimum and maximum buffer distances that the candidate annotation locations on the input map should be from the features.
3. The method for determining the minimum and maximum buffer distances of annotations based on a two-degree-of-freedom space according to claim 2, characterized in that: The steps for defining and setting parameters are as follows: (3-1-1): Define the height value of a text annotation as D; (3-1-2): Define the minimum buffer distance for annotation candidate positions as b. min Define the maximum buffer distance for annotation candidate positions as b. max ; (3-1-3): Define a one-dimensional list List1 = [], containing three fields, namely b min b max F, where b min and b max represents the minimum and maximum buffer distances for annotation candidate positions, and F represents the theoretical limit value under the minimum and maximum buffer distance conditions; (3-1-4): Define a two-dimensional list List2 = [], List2 is used to store all different buffer distance values and their theoretical limit value F; proceed to (3-1-5); (3-1-5): Define arrays Ld and Fd, each with a length of n-1.
4. The method for determining the minimum and maximum buffer distances of annotations based on a two-degree-of-freedom space according to claim 3, characterized in that: The generation and determination of candidate locations includes generating and determining the appropriate number of candidate locations for point, line, and polygon features based on the vector map Map0, laying the groundwork for the next step of calculating the theoretical limit value.
Citation Information
Patent Citations
An Automatic Classification and Configuration Method for Map Annotations Based on Visual Variables
CN102289991A