Curve fitting optimization method for hand-drawn micro map under touch screen interaction

By segmenting, classifying and fitting the hand-drawn micromap curves on mobile devices, and regularizing the direction, the error problems caused by finger occlusion and touch accuracy problems in touch screen operations are solved, and the user experience and The visual and practicality of the map.

CN119399310APending Publication Date: 2025-02-07LANZHOU JIAOTONG UNIV +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411284243.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

When drawing map lines, the touch screen operation of mobile devices is prone to unnecessary shaking and errors due to finger occlusion and touch accuracy problems, resulting in a gap between the finished map and the user's expectations.

Method used

Using the idea of ​​'dividing and conquer', the spatial and temporal characteristics and geometric characteristics of the user's hand-drawn curve are statistically analyzed, and the segmentation and classification of complex hand-drawn curves are achieved. Different fitting optimization strategies are adopted for different line segment types, and the main direction is used as constraints. The optimized set of line segments is regularized to express the direction.

Benefits of technology

Improve the user experience of using touch screen to interactively draw complex curves on mobile devices, improve the visual effect and practicality of line elements in hand-drawn micromap, and ensure that the optimized geometric shape and geographic information are in line with user's operating habits and Psychological expectations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399310A_ABST
    Figure CN119399310A_ABST
Patent Text Reader

Abstract

The invention provides a curve fitting optimization method for a hand-drawn micro map under touch screen interaction, relates to the field of map data preparation, and is essentially a complex curve fitting optimization method. The method aims at optimizing the geometric morphology of the user hand-drawn micro map curve on a mobile terminal platform, solving the problems of hand-drawn curve shaking and the like caused by factors such as finger shielding and touch screen precision, and improving the visual effect and the geographic information practicability of the hand-drawn micro map. The method comprises the following steps: selecting segmentation points by analyzing spatial and temporal characteristics of a hand-drawn curve, and segmenting a complex curve; using a support vector machine to classify line segments; carrying out fitting optimization on different types of line segments by adopting least square estimation or a Bezier curve; performing direction regularization expression on the optimized line segments by taking the main direction as a constraint; and finally, combining the optimized line segments into a complete curve based on the significant datum line. The method can effectively improve the aesthetics and the information expression accuracy of the hand-drawn micro map, reduces the creation threshold of the user, and enhances the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0002] The present invention relates to the field of map data preparation, and in particular to a curve fitting optimization method for a hand-drawn micro map under touch screen interaction. Background Art

[0004] Maps, as a tool for humans to know and understand the world, have a long history. Like language and writing, they record the changes of civilization. Entering the 21st century, with the tremendous progress of communication technology, map making has ushered in a new era - the era of self-media. This era is characterized by diversity and personalization. Ordinary people can also easily create and share their own content. Among them, personalized maps have become a hot trend. In this context, Professor Yan Haowen introduced the concept of "micro-maps" in order to cater to the needs of the self-media era and enable the public to easily create and share maps of their own design.

[0005] Hand-drawn micromaps are a branch of micromaps. They use simple drawing tools to allow users to depict various features on the map, such as streets, water and houses, to convey geographic information. This method, that is, user-generated content, gives hand-drawn micromaps obvious advantages in freedom of expression and user experience. However, at present, the production of hand-drawn micromaps mostly still relies on computers, and after completion, they are uploaded to mobile devices such as mobile phones for sharing. This process increases the technical difficulty and affects the continuity and overall experience of the creation. The main problem is that when the touch screen operation of a mobile device draws map lines, such as roads, rivers and building boundaries, it is easy to produce unnecessary shaking and errors due to finger occlusion and touch accuracy problems, resulting in a gap between the finished map and the user's expectations.

[0006] Therefore, how to optimize the line elements of hand-drawn micro-maps on mobile terminals so that their geometric shapes can express the results expected by users has become an urgent problem to be solved in the process of micro-map drawing. By solving this problem, it can not only improve the efficiency of hand-drawn micro-maps by users, but also reduce the threshold for user mapping, improve the aesthetics and practicality of hand-drawn micro-maps, and thus greatly improve the user's micro-map creation experience. Summary of the invention

[0008] In view of this, the present invention proposes a curve fitting optimization method for hand-drawn micro-maps under touch screen interaction. The method adopts the idea of ​​"divide and conquer". By statistically analyzing the spatiotemporal characteristics of the user's hand-drawn curves and the geometric characteristics of the line elements in the hand-drawn micro-maps, the complex hand-drawn curves are segmented and classified. After that, different fitting optimization strategies are adopted for different line segment types. Then, the main direction is used as a constraint to regularize the direction of the optimized line segment set. In essence, it is a complex curve fitting optimization method. This method not only improves the user experience of users using touch screen interaction to draw complex curves on mobile devices, but also improves the visual effects of line elements in hand-drawn micro-maps and the practicality of geographic information.

[0009] To achieve the above object, the present invention adopts the following technical solution:

[0010] Step S1: setting the hyperparameters for segment point selection, including the threshold for speed approaching 0 (the speed below the threshold is judged as 0, in pixels / second) α, the minimum visible distance threshold (the minimum distance that the human eye can distinguish line elements, in pixels) β; the hyperparameters for Bezier curve fitting optimization, the proportion of control point selection (the proportion of control points in a line segment, in dimensionless percentage, ranging from 0-100%) γ; the hyperparameters for direction regularization expression, including the rotation step of the main direction (when calculating the main direction, the angle step of the candidate reverse rotation from 0-90°, in degrees) δ, the angle deviation coefficient (the deviation amount for judging whether two angles are the same, in degrees) ε;

[0011] Step S2: based on the given threshold α of the speed approaching 0 and the minimum visible distance threshold β combined with the spatiotemporal characteristics of the hand-drawn data, segmentation points are selected for the complex hand-drawn curve and segmented into a set of simple line segments;

[0012] Step S3: Calculate eigenvalues ​​of the line segments in the simple line segment set, and classify the line segments in the simple line segment set based on the calculated eigenvalues ​​and a support vector machine (SVM);

[0013] Step S4: performing fitting optimization on line segments of the straight line segment and arc segment category in the set based on least squares estimation, and performing fitting optimization on line segments of the curve segment category based on the Bezier curve function and the ratio γ selected by the given control points;

[0014] Step S5: Solve the main direction based on the given rotation step δ of the main direction, then regularize the direction of the optimized simple line segment set based on the main direction and the given angular deviation coefficient ε, and merge the simple line segment set into a complex curve based on the significant baseline.

[0015] Compared with the prior art, the present invention can optimize the geometric shape of complex curves more accurately and efficiently, and the geometric shape effect after optimization and the geographical information contained meet the public psychological expectations. Specifically, it has the following beneficial effects:

[0016] 1. The present invention statistically analyzes the spatiotemporal characteristics of a large number of user hand-drawn curves, accurately identifies turning points and type conversion points, and realizes accurate segmentation point selection. It identifies three basic line segment types: straight line segment, curve segment, and arc segment, and uses support vector machine for classification, which improves the accuracy and reliability of segmentation and classification, making the optimized geometric form more in line with the user's operating habits and psychological expectations;

[0017] 2. The present invention adopts the idea of ​​"divide and conquer" to optimize complex hand-drawn curves. By segmenting and classifying complex curves, different optimization strategies are adopted for different types of curves. For straight line segments and arc segments, the least squares estimation is used for fitting optimization; for curve segments, the Bezier curve function is used for fitting optimization. This method can greatly improve the accuracy and efficiency of optimization, ensuring that each curve segment can obtain the best processing effect;

[0018] 3. The present invention uses the main direction to regularize the direction of the optimized simple line segment set, and merges the simple line segment set into a complex curve based on the significant baseline. This not only optimizes the geometric form, but also improves the expression effect of geographic information. This processing method improves the visual effect of the curve and the practicality of geographic information, ensuring that the optimized curve can more accurately convey the required geographic information.

[0019] In the above-mentioned hand-drawn micro-map curve fitting optimization method under touch screen interaction, the step S1 sets the hyperparameters for segment point selection, including the threshold value of speed tending to 0 (the speed below the threshold is judged to be 0, in pixels / milliseconds) α, the minimum visible distance threshold (the minimum distance that the human eye can distinguish line elements, in pixels) β; the hyperparameters of Bezier curve fitting optimization, the proportion of control point selection (the proportion of control points in a line segment, in units of dimensionless percentage, ranging from 0-100%) γ; the hyperparameters of direction regularization expression, including the rotation step of the main direction (when calculating the main direction, the angle step of the candidate reverse rotation from 0-90°, in degrees) δ, the angle deviation coefficient (the deviation amount for judging whether two angles are the same, in degrees) ε;

[0020] In the above-mentioned hand-drawn micro-map curve fitting optimization method under touch screen interaction, the step S2 selects segmentation points of the complex hand-drawn curve C and segments it into a simple line segment set Sc based on the given threshold α of the speed tending to 0 and the minimum visible distance threshold β combined with the spatiotemporal characteristics of the hand-drawn data. The specific steps are as follows:

[0021] Step 2.1, traverse the screen coordinate set Sp in the complex hand-drawn curve C, for each set of continuous coordinate points Sp(i) and Sp(i+1), where i=0 to n-2, calculate the drawing speed v(i) between these two points, and add the calculated speed value v(i) to the speed set Sv;

[0022] Step 2.2, traverse the speed set Sv and identify the local minimum speed points therein. If any speed point v(j) is lower than the threshold α where the speed tends to 0, where j=0 to n-2, then the coordinate point Sp(j) corresponding to the speed point v(j) is added to the extreme point set Sa as a potential segmentation point;

[0023] Step 2.3, when the extreme point set Sa is not empty, perform the following operations: find the point a with the minimum speed in Sa min ; For each point a in Sa, if a and a min If the distance between is less than or equal to the minimum visible distance threshold β, a is removed from Sa; min Add to the segmentation point set Sc as the determined segmentation point;

[0024] Step 2.4, repeat step 2.3 until the extreme point set Sa is empty, at which point the screen coordinate point in the segmentation point set Sc is the segmentation point;

[0025] Step 2.5, starting from the starting point of the complex hand-drawn curve C, for each segmentation point p(k) in the segmentation point set Sc, where k=1 to m (m is the number of elements in the segmentation point set Sc), define the line segment from the previous segmentation point (or starting point) to the current segmentation point p(k) as a simple line segment L(k). Collect all these simple line segments L(k) into the simple line segment set Sc;

[0026] Step 2.6, when the end point of the complex hand-drawn curve C is reached, the line segment from the last segmentation point to the end point is also defined as a simple line segment and added to the simple line segment set Sc, thereby completing the process of segmentation point selection and segmentation of the entire complex hand-drawn curve C into a simple line segment set Sc.

[0027] In the above-mentioned hand-drawn micro-map curve fitting optimization method under touch screen interaction, the step S3, for the simple line segment set Sc after segmentation, classifies the line segments in the simple line segment set Sc based on the calculated eigenvalues ​​and the support vector machine and obtains the simple line segment type set St, and the specific steps are as follows:

[0028] Step 3.1, traverse the simple line segments in the simple line segment set Sc and calculate the required feature values, including: the ratio of the distance from the start point to the end point to the curve length, the root mean square error (RMSE) of the fitted circle, the variance of the curvature, and the distance between the first and last points and the farthest point; for each line segment L(k) in the simple line segment set Sc, k=1 to m, construct a feature vector F(k), which includes the following feature items: the ratio ρ(k) of the Euclidean distance from the start point to the end point to the actual curve path length, the root mean square error RMSE(k) of the fitted circle, the variance of the curvature change σ²(k), and the distance d between the line segment endpoint and the position on the line segment farthest from the endpoint max (k);

[0029] Step 3.2, normalize the acquired eigenvalues ​​to ensure that all features are in the same order of magnitude and avoid model bias caused by numerical scale differences. Use the normalization formula shown in formula (1), where f(x) represents the original eigenvalue and f´(x) is the normalized eigenvalue;

[0030]

[0031] Step 3.3, loading a pre-trained support vector machine (SVM) classifier, which is trained based on a large number of labeled data sets and is designed to distinguish between straight line segments, circular arc segments, and curved segments;

[0032] Step 3.4, input the standardized feature vector F(k) into the SVM model to obtain the classification label t(k) of each simple line segment L(k), thereby forming a simple line segment type set St, where St contains the classification identifiers of all simple line segments.

[0033] In the above-mentioned hand-drawn micro-map curve fitting optimization method under touch screen interaction, the step S4, for the simple line segment set Sc and the simple line segment type set St, performs fitting optimization on the line segments of the set classified as straight line segments and circular arc segments based on least squares estimation, and performs fitting optimization on the line segments of the class classified as curve segments based on the Bezier curve function and the given control point selection ratio γ, and the specific steps are as follows:

[0034] Step 4.1, according to the classification result of the simple line segment type set St, the line segments in the simple line segment set Sc are divided into three subsets: a straight line segment set Scl, an arc segment set Sca, and a curve segment set Scc;

[0035] Step 4.2, for each line segment Lcl(i) of the line segment set Scl, use the least squares estimation method to solve the optimal line equation. Specifically, minimize the sum of the squares of the vertical distances from all points to the fitted line to obtain the coordinate point set Sclo of the fitted optimized line segment;

[0036] Step 4.3, for each line segment Lca(i) in the arc segment set Sca, use the least squares method to estimate the coordinates of the center O and the radius R. By solving the coordinates of the center and the radius, the sum of the squares of the distances from all points on the arc segment to the circumference is minimized. Then, the starting angle and the ending angle of each arc segment are determined according to the starting point of the line segment Lca(i), and the coordinate point set Scoo of the fitting optimized arc segment is calculated;

[0037] Step 4.4, for each line segment Lcc(i) in the curve segment set Scc, select control points uniformly on the line segment Lcc(i) according to the given control point selection ratio γ. Using the selected control points and the mathematical model of the Bezier curve, calculate the coordinate point set Scco of the fitting optimization curve segment;

[0038] Step 4.5, the simple line segments in the optimized straight line segment coordinate point set Sclo, arc segment coordinate point set Scoo, and curve segment coordinate point set Scco are merged into a simple line segment fitting optimization set So according to their order in the simple line segment set Sc.

[0039] In the above-mentioned hand-drawn micro-map curve fitting optimization method under touch screen interaction, the step S5, for the simple line segment fitting optimization set So after segment optimization, solves the main direction based on the given rotation step δ of the main direction, and then regularizes the direction of the optimized simple line segment set based on the main direction and the given angle deviation coefficient ε, and merges the simple line segment set into a complex curve Co based on the significant baseline. The specific steps are as follows:

[0040] Step 5.1, according to the specified main direction rotation step δ, generate a series of candidate directions Ca in the range of 0° to 90°, that is, Ca = {0° + δ, 0° + 2δ, ..., 90°};

[0041] Step 5.2: for each candidate direction, evaluate the contribution value of the conforming line segments (including straight line segments, arc segments and curve segments, the latter are replaced by the line connecting their first and last points) in the simple line segment fitting optimization set So to the direction. The conforming line segments refer to the line segments or the perpendicular lines of the line segments within the positive and negative ε angle deviation range of the candidate direction. The specific contribution value calculation formula is shown in formula (2), where Li represents the contribution value of the line segment i to the candidate direction, ε is the angle deviation coefficient, φ is the angle between the line segment i and the candidate direction, and li is the length of the line segment;

[0042]

[0043] Step 5.3, among all candidate directions, select the direction with the largest sum of simple line segment contribution values ​​as the reference direction of the main direction, and derive four main directions based on the reference direction: the reference direction itself, its opposite direction, and two directions perpendicular to the reference direction;

[0044] Step 5.4, traverse each item in the optimized simple line segment set So, check whether the angle between it and the four main directions is less than or equal to the angle deviation coefficient ε, if the angle between a line segment and any main direction meets the standard, rotate it to the corresponding direction; otherwise, generate eight new main directions based on the angle bisectors of the current four main directions, and repeat the above process until all line segments are aligned with the main directions. At this time, the simple line segment set after the direction regularization is recorded as Sr;

[0045] Step 5.5, in the simple line segment set Sr after the direction regularization is completed, select the longest line segment as the significant baseline, translate the preceding and succeeding line segments of the significant baseline to make them coincide with the starting and ending points of the significant baseline to form an extended significant baseline, repeat the above translation operation to ensure that all line segments are integrated into the significant baseline, thereby constructing the final optimized complex curve Co. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0048] Figure 1 is a flow chart of the steps of the present invention;

[0049] Figure 2 This is a display diagram of the original complex hand-drawn curve C in an embodiment of the present invention;

[0050] Figure 3 Result diagram of the selected segmentation points when the parameters are (α=100, β=50) in the embodiment of the present invention;

[0051] Figure 4 This is a diagram showing the classification results of a simple line segment set Sc using a support vector machine in an embodiment of the present invention;

[0052] Figure 5 It is a result diagram of segmented fitting optimization when the parameter is (γ=20%) in the embodiment of the present invention;

[0053] Figure 6Result diagram of regular expression when the parameters are (δ=1°, ε=1°) in the embodiment of the present invention;

[0054] Figure 7 This is a result diagram of merging optimized simple line segments into a complex curve Co based on a significant baseline in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The present invention is further described below with reference to the accompanying drawings and embodiments. Figure 2 As shown; the basic tools required for this implementation case use the corresponding third-party toolkit in the programming language Python.

[0057] Reference Figure 1 The present invention provides a hand-drawn micro-map curve fitting optimization method under touch screen interaction, which specifically includes the following steps:

[0058] Step S1: setting the hyper parameters of segment point selection, Bezier curve fitting optimization, and direction regularization expression, including the threshold value of speed approaching 0 α=100 pixels / second, the minimum visible distance threshold β=50 pixels, the proportion of control point selection γ=20%, the rotation step of the main direction δ=1°, and the angle deviation coefficient ε=1°;

[0059] Step S2: based on the given threshold α of the speed approaching 0 and the minimum visible distance threshold β combined with the spatiotemporal characteristics of the hand-drawn data, segmentation points are selected for the complex hand-drawn curve and segmented into a set of simple line segments;

[0060] Step S3: Calculate eigenvalues ​​of the line segments in the simple line segment set, and classify the line segments in the simple line segment set based on the calculated eigenvalues ​​and a support vector machine (SVM);

[0061] Step S4: performing fitting optimization on line segments of the straight line segment and arc segment category in the set based on least squares estimation, and performing fitting optimization on line segments of the curve segment category based on the Bezier curve function and the ratio γ selected by the given control points;

[0062] Step S5: Solve the main direction based on the given rotation step δ of the main direction, then regularize the direction of the optimized simple line segment set based on the main direction and the given angular deviation coefficient ε, and merge the simple line segment set into a complex curve based on the significant baseline.

[0063] In this example, step S1 sets the hyperparameters of segment point selection, Bezier curve fitting optimization, and direction regularization expression, including the threshold value α=100 pixels / second for the speed approaching 0, the minimum visible distance threshold β=50 pixels, the proportion of control point selection γ=20%, the rotation step length of the main direction δ=1°, and the angle deviation coefficient ε=1°;

[0064] In this example, step S2 selects segmentation points for the complex hand-drawn curve C and segments it into a simple line segment set Sc based on the given speed threshold α=100 pixels / second and the minimum visible distance threshold β=50 pixels combined with the spatiotemporal characteristics of the hand-drawn data. The specific steps are as follows:

[0065] Step 2.1, traverse the screen coordinate set Sp in the complex hand-drawn curve C, for each set of continuous coordinate points Sp(i) and Sp(i+1), where i=0 to 392, calculate the drawing speed v(i) between these two points, and add the calculated speed value v(i) to the speed set Sv; the operation of calculating the speed set Sv is performed using the "for loop, arithmetic operator, list:append() function" in the programming language Python.

[0066] Step 2.2, traverse the speed set Sv and identify the local minimum speed points therein. If any speed point v(j) is lower than the threshold α=100 pixels / second where the speed tends to 0, where j=0 to 392, then the coordinate point Sp(j) corresponding to the speed point v(j) is added to the extreme point set Sa as a potential segmentation point; the operation of calculating the extreme point set Sa is performed using the "for loop, comparison operator, list:append() function" in the programming language Python.

[0067] Step 2.3, when the extreme point set Sa is not empty, perform the following operations: find the point a with the minimum speed in Sa min ; For each point a in Sa, if a and a min If the distance between is less than or equal to the minimum visible distance threshold β=50 pixels, remove a from Sa; min Add to the segmentation point set Sc as the determined segmentation point; the operation of calculating the segmentation point set Sc is performed using the "comparison operator, min() function, list:append() function" in the programming language Python.

[0068] Step 2.4, repeat step 2.3 until the extreme point set Sa is empty, at which point the screen coordinate point in the segmentation point set Sc is the segmentation point;

[0069] Step 2.5, starting from the starting point of the complex hand-drawn curve C, for each segmentation point p(k) in the segmentation point set Sc, where k=1 to 5, define the line segment from the previous segmentation point (or starting point) to the current segmentation point p(k) as a simple line segment L(k). Collect all these simple line segments L(k) into the simple line segment set Sc; the segmentation of the complex hand-drawn curve C into the simple line segment set Sc is performed using the "for loop, list slicing" in the programming language Python.

[0070] Step 2.6, when the end point of the complex hand-drawn curve C is reached, the line segment from the last segmentation point to the end point is also defined as a simple line segment and added to the simple line segment set Sc, thereby completing the process of selecting segmentation points and segmenting the entire complex hand-drawn curve C into a simple line segment set Sc. Finally, the operation of adding the segmented line segment to the simple line segment set Sc is performed using the "list:append() function and comparison operator" in the programming language Python. Figure 3 This is the result diagram of selecting segmentation points.

[0071] In this embodiment, the step S3, for the segmented simple line segment set Sc, classifies the line segments in the simple line segment set Sc based on the calculated eigenvalues ​​and the support vector machine to obtain the simple line segment type set St, and the specific steps are as follows:

[0072] Step 3.1, traverse the simple line segments in the simple line segment set Sc and calculate the required feature values, including: the ratio of the distance from the start point to the end point to the curve length, the root mean square error (RMSE) of the fitted circle, the variance of the curvature, and the distance between the first and last points and the farthest point; for each line segment L(k) in the simple line segment set Sc, k=1 to 5, construct a feature vector F(k), which includes the following feature items: the ratio ρ(k) of the Euclidean distance from the start point to the end point to the actual curve path length, the root mean square error RMSE(k) of the fitted circle, the variance of the curvature change σ²(k), and the distance d between the line segment endpoint and the position on the line segment farthest from the endpoint max (k); The root mean square error RMSE of the fitted circle is calculated using "scipy:curve_fit(), numpy.mean(), numpy.std()" in the programming language Python, the ratio of the Euclidean distance from the start point to the end point to the actual curve path length ρ, the distance d between the end point of the line segment and the position farthest from the end point on the line segment maxThe calculation is performed using "numpy: diff(), numpy:sum(), numpy:sqrt()" in the programming language Python, and the calculation of the variance σ² of the curvature change is performed using "numpy: diff(), numpy:sum(), numpy:sqrt()" in the programming language Python.

[0073] Step 3.2, normalize the acquired eigenvalues ​​to ensure that all features are in the same order of magnitude and avoid model bias caused by numerical scale differences. The standardization formula of formula (1) is used, where f(x) represents the original eigenvalue and f´(x) is the standardized eigenvalue; the eigenvalue normalization is constructed using the function in the third-party toolkit "scikit-learn:StandardScaler()" in the programming language Python.

[0074] Step 3.3, load a pre-trained support vector machine (SVM) classifier, which is trained based on a large number of labeled data sets and is designed to distinguish between straight line segments, arc segments, and curve segments; the loading of the pre-trained model is constructed using the function in the "scikit-learn:joblib.load()" third-party toolkit in the programming language Python.

[0075] Step 3.4, input the standardized feature vector F(k) into the SVM model to obtain the classification label t(k) of each simple line segment L(k), thereby forming a simple line segment type set St, where St contains the classification identifiers of all simple line segments. The line segment classification is constructed using the function in the third-party toolkit "scikit-learn: predict()" in the programming language Python. Figure 4 The figure shows the classification results of the simple line segment set Sc using the support vector machine.

[0076] In this example, step S4, for the simple line segment set Sc and the simple line segment type set St, performs fitting optimization on the line segments of the set classified as straight line segments and circular arc segments based on least squares estimation, and performs fitting optimization on the line segments of the set classified as curve segments based on the Bezier curve function and a given control point selection ratio γ=20%. The specific steps are as follows:

[0077] Step 4.1, according to the classification results of the simple line segment type set St, the line segments in the simple line segment set Sc are divided into three subsets: the straight line segment set Scl, the arc segment set Sca, and the curve segment set Scc; the operation of dividing the simple line segment type set St into three subsets is performed using the "comparison operator, list:append() function" in the programming language Python.

[0078] Step 4.2, for each line segment Lcl(i) of the line segment set Scl, the least squares estimation method is used to solve the optimal line equation. Specifically, the sum of the squares of the vertical distances from all points to the fitted line is minimized to obtain the coordinate point set Sclo of the fitted optimized line segment; the least squares estimation method for solving the optimal line equation is constructed using the function in the third-party tool package "numpy:linalg.lstsq()" in the programming language Python, and the coordinate point set Sclo calculated by the line equation is constructed using the functions in the third-party tool package "numpy: linspace(), numpy: column_stack()" in the programming language Python.

[0079] Step 4.3, for each line segment Lca(i) in the arc segment set Sca, use least squares to estimate the coordinates of the center O and the radius R. By solving the coordinates of the center and the radius, the sum of the squares of the distances from all points on the arc segments to the circumference is minimized. Afterwards, the starting angle and the ending angle of each arc segment are determined according to the starting point of the line segment Lca(i), and the coordinate point set Scoo of the fitted optimized arc segment is calculated; the coordinates of the center O and the radius R are solved by least squares estimation using the function in the third-party tool package "numpy:linalg.lstsq()" in the programming language Python, and the starting angle and the ending angle of each arc segment are determined according to the starting point of the line segment Lca(i), and the functions in the third-party tool package "numpy: arctan2(), numpy: mod(), numpy: argsort()" in the programming language Python are constructed; the operation of calculating the coordinate point set Scoo of the fitted optimized arc segment is performed using the "arithmetic operators, numpy: linspace(), numpy: column_stack()" in the programming language Python.

[0080] Step 4.4, for each line segment Lcc(i) in the curve segment set Scc, select the control points uniformly on the line segment Lcc(i) according to the given control point selection ratio γ. Using the selected control points and the mathematical model of the Bezier curve, the coordinate point set Scco of the fitting optimization curve segment is calculated; the control point selection is performed using the "list slicing" in the programming language Python, and the Bezier curve fitting is constructed using the function in the "scipy: special.comb()" third-party toolkit in the programming language Python.

[0081] Step 4.5, the simple line segments in the optimized straight line segment coordinate point set Sclo, arc segment coordinate point set Scoo, and curve segment coordinate point set Scco are merged into a simple line segment fitting optimization set So in order in the simple line segment set Sc. The operation of merging into a simple line segment fitting optimization set So in order is performed using "numpy:flipud(), list slicing" in the programming language Python. Figure 5 This is a result graph of piecewise fitting optimization.

[0082] In the above-mentioned hand-drawn micro-map curve fitting optimization method under touch screen interaction, the step S5, for the simple line segment fitting optimization set So after segment optimization, solves the main direction based on the given rotation step δ=1° of the main direction, and then regularizes the direction of the optimized simple line segment set based on the main direction and the given angle deviation coefficient ε=1°, and merges the simple line segment set into a complex curve Co based on the significant baseline. The specific steps are as follows:

[0083] Step 5.1: Rotate according to the specified main direction with a step size of δ=1 º , at 0 º to 90 º A series of candidate directions Ca are generated within the range, that is, Ca = {0º, 1º, 1º, …, 89º, 90º}; the operation of generating candidate directions is constructed using the function in the third-party toolkit "numpy: linspace()" in the programming language Python.

[0084] Step 5.2, for each candidate direction, evaluate the contribution value of the conforming line segments (including straight line segments, arc segments and curve segments, the latter are replaced by the line connecting their starting and ending points) in the simple line segment fitting optimization set So to the direction. The conforming line segment refers to the line segment or the perpendicular line of the line segment within the angle deviation range of plus or minus ε=1° in the candidate direction. The specific contribution value calculation formula is shown in formula (2), where Li represents the contribution value of line segment i to the candidate direction, ε is the angle deviation coefficient, φ is the angle between line segment i and the candidate direction, and li is the length of the line segment; the operation of calculating the contribution value of the candidate direction is performed using the "arithmetic operators, numpy:linalg.norm(), numpy:arctan2()" in the programming language Python.

[0085] Step 5.3, among all candidate directions, select the direction with the largest sum of simple line segment contribution values ​​as the reference direction of the main direction. Based on the reference direction, four main directions are derived: the reference direction itself, its opposite direction, and two directions perpendicular to the reference direction. The operation of calculating the contribution values ​​of the candidate directions is performed using "arithmetic operators, numpy: cos(), numpy: sin()" in the programming language Python.

[0086] Step 5.4, traverse each item in the optimized simple line segment set So, and check whether the angle between it and the four main directions is less than or equal to the angle deviation coefficient ε=1°. If the angle between a line segment and any main direction meets the standard, rotate it to the corresponding direction; otherwise, generate eight new main directions based on the angular bisectors of the current four main directions, and repeat the above process until all line segments are aligned with the main directions. At this time, the simple line segment set after the direction regularization is recorded as Sr; the operation of calculating the contribution value of the candidate direction is performed using the "arithmetic operators, comparison operators, numpy:cos(), numpy:sin()" in the programming language Python. Figure 6 This is the result graph of regularized expression.

[0087] Step 5.5, in the simple line segment set Sr after the direction regularization is completed, the longest line segment is selected as the significant baseline, and the preceding and succeeding line segments of the significant baseline are translated to coincide with the start and end points of the significant baseline to form an extended significant baseline, and the above translation operation is repeated to ensure that all line segments are integrated into the significant baseline, thereby constructing the final optimized complex curve Co. The operation of integrating line segments into the significant baseline is performed using "arithmetic operators, comparison operators, for loops, iterable:len()" in the programming language Python. Figure 7 The result graph of Co is to merge the optimized simple line segments into a complex curve based on the significant baseline.

[0088] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any changes and modifications made to the above embodiment based on the technical essence of the present invention are within the scope of the present invention.

Claims

1. A curve fitting optimization method for hand-drawn micro-maps under touch screen interaction, characterized in that: The method comprises: Step S1: setting the hyper parameters for segment point selection, including the threshold α for speed approaching 0, the minimum visible distance threshold β, the control point selection ratio γ for Bezier curve fitting optimization, the main direction rotation step δ for direction regularization expression, and the angle deviation coefficient ε; Step S2: Based on the threshold α of the speed approaching 0 and the minimum visible distance threshold β, the spatiotemporal characteristics of the hand-drawn data are analyzed, the segmentation points of the complex hand-drawn curve are identified, and the complex hand-drawn curve is segmented into a simple line segment set Sc; Step S3: Calculate the eigenvalues ​​of the line segments in the simple line segment set Sc, and classify the line segments using a support vector machine to form a simple line segment type set St; Step S4: For the straight line segment and the circular arc segment, the least squares estimation is used to perform fitting optimization, and for the curve segment, the Bezier curve function and the control point selection ratio γ are used to perform fitting optimization to form a fitting optimization set So; Step S5: Solve the main direction based on the main direction rotation step δ, regularize the direction of the optimized simple line segment set according to the angle deviation coefficient ε, and merge the simple line segment set into a complex curve Co based on the significant baseline.

2. A touch screen interactive hand-drawn micro map curve fitting optimization method as claimed in claim 1, characterized in that: The step S2 comprises: Step 2.1, traverse the screen coordinate set Sp in the complex hand-drawn curve, calculate the drawing speed between consecutive coordinate points, and identify the local minimum speed point as the potential segmentation point; Step 2.2, for each potential segmentation point, determine the segmentation point set Sc according to the minimum visible distance threshold β; Step 2.3, split the complex hand-drawn curve into a set of simple line segments Sc according to the segmentation points.

3. A touch screen interactive hand-drawn micro map curve fitting optimization method as claimed in claim 1, characterized in that: The step S3 comprises: Step 3.1, calculate the characteristic values ​​of each line segment, including the ratio of the distance from the starting point to the end point to the curve length, the root mean square error of the fitted circle, the variance of the curvature, and the distance between the first and last points and the farthest point; Step 3.2, normalize the eigenvalues; Step 3.3, use the pre-trained support vector machine model to classify the line segments in the simple line segment set Sc to obtain the simple line segment type set St.

4. A touch screen interactive hand-drawn micro map curve fitting optimization method as claimed in claim 1, characterized in that: The step S4 comprises: Step 4.1, according to the classification result of the simple line segment type set St, the line segments in the simple line segment set Sc are divided into three subsets: a straight line segment set Scl, an arc segment set Sca, and a curve segment set Scc; Step 4.2, for the straight line segments in the straight line segment set, the least squares estimation is used to solve the optimal straight line equation to obtain the coordinate point set Sclo of the fitted optimized straight line segment; Step 4.3, for the arc segments in the arc segment set, the least squares estimation is used to solve the optimal center coordinates and radius, and the starting angle and middle finger angle of each arc segment are determined according to the starting point of the arc segment, and the coordinate point set Scoo of the fitting optimized arc segment is calculated; Step 4.4, uniformly selecting control points on the curve segment according to the control point selection ratio γ, and using the mathematical model of the Bezier curve to calculate the coordinate point set Scco of the fitting optimization curve segment; Step 4.5, merge the optimized line segment coordinate point set into a simple line segment fitting optimization set So in order in the simple line segment set Sc.

5. A touch screen interactive hand-drawn micro map curve fitting optimization method as claimed in claim 1, characterized in that: The step S5 comprises: Step 5.1, generate a series of candidate directions Ca according to the specified main direction rotation step δ; Step 5.2, calculating the sum of the contribution values ​​of the conforming line segments in the simple line segment fitting optimization set So to each candidate direction; Step 5.3, selecting the reference direction of the main direction of the seat with the largest total contribution value among the candidate directions, and deriving four main directions from it: the reference direction itself, its opposite direction, and two directions perpendicular to the reference direction; Step 5.4, calculate whether the angle between the line segments in the simple line segment set So and the four main directions is less than or equal to the angle deviation coefficient ε. If so, rotate it to the corresponding direction; otherwise, generate eight new main directions based on the angle bisectors of the current four main directions, and repeat the above process until all line segments are aligned with the main directions. At this time, the simple line segment set after the direction regularization is recorded as Sr; Step 5.5, in the simple line segment set Sr, select the longest line segment as the significant baseline, translate the preceding and succeeding line segments of the significant baseline to make them coincide with the starting and ending points of the significant baseline to form an extended significant baseline, repeat the above translation operation to ensure that all line segments are integrated into the significant baseline, thereby constructing the final optimized complex curve Co.