A method for generating high-quality geodesic contours

By using an Apollonius graph-based method and a cubic interpolation function, the problem of inaccurate geodesic contour lines in existing technologies is solved, generating high-quality geodesic contour lines suitable for computer graphics and 3D printing.

CN115496875BActive Publication Date: 2025-12-16QINGDAO UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211263995.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-17
Publication Date
2025-12-16
Estimated Expiration
2042-10-17

AI Technical Summary

Technical Problem

Existing technologies struggle to generate high-quality geodetic contour lines, especially in the presence of sharp bends or topological changes, leading to inaccurate extracted contour lines.

Method used

A method based on Apollonius diagrams is adopted, which divides the triangular mesh into multiple parts by calculating a weighted Voronoi diagram and assuming that the geodesic distance is linear within each part. By combining cubic interpolation function and triangulation of Apollonius diagram, high-quality geodesic contour lines are extracted.

Benefits of technology

It significantly improves the accuracy of geodetic contour lines, reduces the average error, overcomes the flat ridge defect and partial differential equation sensitivity problem caused by the piecewise linear method, and generates contour lines that are closer to the actual situation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115496875B_ABST
    Figure CN115496875B_ABST
Patent Text Reader

Abstract

The application provides a high-quality geodesic contour line generation method, which comprises the following steps: pre-processing image data to obtain triangular mesh data of the image; calculating geodesic line distances to mesh vertices and all trisection points of triangular mesh edges; generating a cubic interpolation function for each triangular mesh edge; taking k uniformly spaced sample points from each trisection line edge and inferring approximate geodesic line distances at the sample points; calculating an Apollonius graph according to distance-weighted sample points, dividing the triangle into several parts, and extracting geodesic contour lines of each part to obtain high-quality geodesic contour lines; and the sample points are trisection points and sample points. The application can improve the accuracy of geodesic contour line extraction, and can be applied to the technical field of image extraction.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image extraction, and particularly relates to a method for generating high-quality geodesic contour lines. BACKGROUND

[0002] Geodesic lines, also known as geodesics or brachistochrones, can be defined as locally shortest or longest paths between two points in space. The name geodesic comes from the field of geodesy, which measures the size and shape of the Earth. Objects like the Earth do not move in curved orbits due to forces called gravity, but rather they move along paths called geodesics that are the straightest possible in curved space. For example, the surface of the Earth is a two-dimensional curved space. Geodesics on the Earth, called great circles, are the shortest paths between two points. Since geodesics are the shortest distances between two airports, this is the route that pilots are instructed to fly. In general relativity, objects always move along geodesics of four-dimensional spacetime. Nonetheless, in our three-dimensional space it appears that they move along curved paths (just as a plane flying over a very mountainous landscape appears to follow a curved path on the two-dimensional ground, even though it is flying along a straight line in three-dimensional space).

[0003] Contour lines are solutions to a given scalar field that have the same scalar value. Contour lines provide an intuitive way to visualize a given scalar field and have many applications in engineering. For example, meteorologists often use contour plots to show temperature differences in different regions. The hottest regions are usually colored red, the warmest regions are colored yellow, and the coldest regions are colored blue. Thus, contour lines provide an intuitive way to visualize the behavior of a scalar field over a given domain. In general, there is no explicit form for an arbitrary input scalar function. Therefore, a common approach is to discretize the given domain into a set of simple or small cells and then extract contour lines for each cell. Geodesic distance fields, as a special kind of scalar field, have wide applications in computer graphics and geography. Similarly, one can observe the behavior of geodesic distance metrics by visualizing geodesic contour lines.

[0004] In practical applications, there are also cases of using geodesic contours. 3D printing is a good example. With the increasing popularity of additive manufacturing and 3D printing in computer graphics, people should not ignore the fact that in most cases, subtractive manufacturing is faster, more cost-effective, has a wider range of materials, and can achieve excellent surface finish at the same product precision level compared to additive manufacturing. In addition, subtractive manufacturing is mainly achieved through computer numerical control (CNC) machining tools. A CNC machine operates a cylindrical tool to cut material from a shape stock in 3D space to "expose" the target 3D object. The tool head traces a spatial curve called a tool path, which must completely fill the object surface. The ideal characteristics of the tool path for efficient CNC machining, especially high-speed machining (HSM), include fairness (i.e., low curvature) and continuity (i.e., fewer on / off switches or tool retractions), similar to additive manufacturing, so the tool path calculation needs to be more accurate. In general, the tool path of 3D printing mainly includes ① extraction of geodesic contours ② connecting contours to continuous tool paths ③ smoothing tool paths while keeping gap changes as small as possible. The role of geodesic contour extraction in 3D printing is self-evident.

[0005] Currently, there are few methods for extracting geodesic contours. In this regard, based on the MMP algorithm, Liu et al. proposed a practical algorithm for extracting accurate contours, bisectors, and Voronoi diagrams. This method first uses MMP to precompute the geodesic distance field, then maintains all propagation windows on each edge of the grid, and then recursively divides each edge into monotonic sub-edges and searches for arcs in each newly subdivided triangle. This process is used as precomputation along with interval tree construction, and then O(log n' + k log k) binary search retrieval plus marching process is used to solve the contour of any genus-r model, where n' is the number of newly subdivided triangles, and k is the number of triangles through which the contour passes. In addition, Gehre et al. proposed geodesic contour features (GICS), which can capture the length of the geodesic contour with a certain radius to a point x on the surface. GICS computes a robust approximation of the geodesic distance and finds the intersection of contour segments and triangles. GICS uses the cumulative distance of these segments to identify topological events, so it significantly depends on the accuracy of the contour. These algorithms do not provide accurate contours because the edge-based segment intersection calculation ignores the ridge points inside the triangle and generates inaccurate contour lengths or false topologies.

[0006] Geodesic contours reflect both the input accuracy and the geometric variation of the input surface. In computer graphics, geodesic field is first computed on a triangle mesh consisting of thousands of triangles, and then the desired spatial geodesic contours are extracted, and finally the geodesic line contours are extracted triangle by triangle, assuming that the geodesic field is linear on each triangle. However, it is found that even if the geodesic method is accurate, the contours extracted by this method often have obvious defects, especially when the real contours have sharp bends or topological changes. The main reason is that the geodesic distance field is not a smooth field and may contain "ridges". Therefore, it is difficult to reconstruct the sharp corners or topological changes of high-quality geodesic contours by simply piecewise linearizing the geodesic distance field. SUMMARY

[0007] The purpose of the present application is to provide a high-quality geodesic contour generation method to make up for the shortcomings of the prior art.

[0008] The sharp bends of geodesic contours are closely related to ridge points, and there are at least two geodesic paths to the source point for each ridge point. The ridge curve is represented by calculating the weighted Voronoi diagram, also known as the Apollonius diagram. It is calculated that the geodesic distance is continuous but not smooth. Therefore, the ridge line divides △ABC into several parts, and it is considered that the variation of geodesic distance inside each part is linear. At the same time, the ridge line can also determine where the geodesic contour may have sharp turns or topological changes. Therefore, the present application can approximately determine the position of the ridge point and then better generate the geodesic contour.

[0009] The present application extracts geodesic contours from the existing vertex-based geodesic distance field in order to extract geodesic contours. The quality and running performance of geodesic contours depend largely on the calculation of the distance field.

[0010] To achieve the above purpose, based on the above technical solution, the specific technical scheme adopted by the present application is:

[0011] A high-quality geodesic contour generation method, comprising the following steps:

[0012] S1: pre-processing the image data to obtain triangle mesh data of the image;

[0013] S2: calculating the geodesic line distance to the mesh vertex and all trisection points of the triangle mesh edge;

[0014] S3: generating a cubic interpolation function for each triangle mesh edge;

[0015] S4: taking k uniformly spaced sample points from each trisection line edge, and inferring the approximate geodesic line distance at the sample points;

[0016] S5: According to the distance weighted calculation of the sampling point, the Apollonius graph is calculated, the triangle is divided into several parts, and the geodesic contour line of each part is extracted, that is, the high-quality geodesic contour line is obtained; the sampling point is a trisection point and a sample point.

[0017] Further, in S2, the calculation of the geodesic distance includes the methods of computational geometry, partial differential equation and graph-based method; the method is used to calculate the geodesic distance of all grid vertices.

[0018] Further, in S3, since the distance prediction using quadratic interpolation is less accurate than cubic interpolation, less prior distance information is required, and the key properties of the distance field can be maintained with a small amount of additional calculation cost, the geodesic distance of the grid edge is inferred by cubic interpolation; the cubic interpolation function is specifically:

[0019] (1) two trisection points are taken on the grid edge, (2) the existing algorithm is run to calculate the geodesic distance of the trisection, (3) a cubic interpolation function is generated to simulate the distance change along the grid edge; let e=v1v2 be the grid edge, d1, d2, d3, d4 be the distance values of v1, (2v1+v2) / 3, (v1+2v2) / 3, v2 respectively;

[0020] The cubic interpolation function is:

[0021]

[0022] Further, in S5, the Apollonius is defined as

[0023] Ω i : {x∈Ω|||x-x i ||-w i ≤||x-x j ||-w j , j≠i}. After the Apollonius graph is completed, the Apollonius vertex and the sampling point are constructed for triangulation.

[0024] Further, in S5, the contour line of the geodesic distance field is calculated and extracted, the geodesic contour line of all regions in a single triangular grid is extracted first, then the geodesic contour line of each part is extracted for each triangular grid, and all contour line elements are combined into a complete contour line element; specifically:

[0025] (1) define the linear function of each sub-region, and observe that the geodesic distance field in each region is basically linear;

[0026] (2) Then all sub-regions are collected and a graph is used to encode adjacency relations; this graph allows the computation of geodesic distances between any pair of points (not necessarily grid vertices) in constant time O(1);

[0027] (3) Each sub-region is taken as a node and isoline elements are kept in the corresponding node, and the complete isoline is generated by visiting the nodes:

[0028] 1) Suppose the isoline at d is extracted;

[0029] 2) Find the pending isoline element at distance d and mark this element as "fixed";

[0030] 3) As long as the isoline is not closed or has not reached the surface boundary, the isoline elements in the adjacent nodes are continuously searched and connected to the existing isoline segment.

[0031] A 3D printing method based on high-quality geodesic isolines, comprising the following steps:

[0032] (1) Obtain the input model of the 3D printing image;

[0033] (2) Generate high-quality geodesic isolines;

[0034] (3) Connect the geodesic isolines obtained in step (2) into continuous tool paths;

[0035] (4) Smooth the tool path while keeping the gap change as small as possible;

[0036] (5) Finally, complete the 3D printing.

[0037] Further, the step (2) is the method for generating the high-quality geodesic isolines.

[0038] Compared with the prior art, the advantages and beneficial effects of the present application are:

[0039] The present application can calculate high-quality geodesic distance field isolines on a triangular mesh, and in order to visualize the quality, the results are superimposed with a baseline (a more accurate solution calculated on a subdivided mesh). The present application ensures that geodesic backtracking cannot cross ridge curves, thereby achieving ideal accuracy. Compared with the piecewise linear method, the present application significantly reduces the average error and consumes less memory, and overcomes the problems of flat ridge defects generated by the piecewise linear method and the inaccuracy of some isolines caused by the sensitivity of partial differential equations to triangulation.

[0040] The present application can improve the accuracy of geodesic isoline extraction, and apply the method to the technical field of image extraction. BRIEF DESCRIPTION OF DRAWINGS

[0041] Figure 1 A basic flowchart of generating geodesic contour lines for the image in Example 1.

[0042] Figure 2 An Apollonius diagram of two sites is shown.

[0043] Figure 3 An Apollonius diagram of a set of 9 sites is shown.

[0044] Figure 4 A tool path diagram in which the contour lines are connected to form a continuous tool path in Example 2.

[0045] Figure 5 A tool path generation diagram in Example 2. DETAILED DESCRIPTION

[0046] The present application is further explained and described by way of specific examples and with reference to the accompanying drawings.

[0047] Example 1: The method is illustrated by taking a specific image as an example.

[0048] A high-quality geodesic contour line generation method, as shown in the figure, includes the following steps: Figure 1

[0049] S1: Preprocess the image data to obtain the triangular mesh data of the image;

[0050] S2: Calculate the geodesic distance to the mesh vertex and all the trisection points of the triangular mesh edge; The calculation of the geodesic distance includes the methods of computational geometry, partial differential equation and graphics-based; The method is used to calculate the geodesic distance of all mesh vertices.

[0051] S3: Generate a cubic interpolation function for each triangular mesh edge;

[0052] S4: Take k uniformly spaced sample points from each trisection edge, and infer the approximate geodesic distance at the sample points;

[0053] S5: Calculate the Apollonius diagram according to the distance-weighted sampling points, divide the triangle into several parts, and then extract the geodesic contour lines of each part, that is, obtain the high-quality geodesic contour lines; The sampling points are trisection points and sample points.

[0054] In S3, since the distance prediction using quadratic interpolation is less accurate than cubic interpolation, less prior distance information is needed, and the key properties of the distance field can be maintained with a small amount of additional calculation cost, the geodesic distance of the mesh edge is inferred by cubic interpolation; The cubic interpolation function is specifically:

[0055] ​(1) take two trisection points on the edge of the grid, (2) run the existing algorithm to calculate the geodesic distance of the trisection, (3) generate a cubic interpolation function to simulate the distance change along the edge of the grid; Let e = v1v2 be the edge of the grid, d1, d2, d3, d4 be the distance values of v1, (2v1+v2) / 3, (v1+2v2) / 3, v2 respectively;

[0056] The cubic interpolation function is:

[0057]

[0058] Further, in the S5,

[0059] A Voronoi diagram is a partition of a given domain Ω into regions based on the straight-line distance to a set of points {xi∈Ω}ni=1 (called sites or generators), where xi dominates the sub-region Ω i : {x∈Ω|||x-x i ||≤||x-x j ||, j≠i}. This is called the Voronoi cell of site xi. Apollonius diagram is a variant of Voronoi.

[0060] Apollonius is defined as Ω i : {x∈Ω|||x-x i ||-w i ≤||x-x j ||-w j , j≠i}. After the Apollonius diagram is completed, the Apollonius vertices and the points taken in steps (2-2, 3) are triangulated;

[0061] Figure 2 An Apollonius diagram of two sites is shown. When {wi} coincides with each other, the Apollonius diagram is simplified to the traditional Voronoi diagram. The set of connection points that belong to exactly two Apollonius cells is called Apollonius edge, which is a hyperbola, while the points that belong to more than two Apollonius cells are called Apollonius vertices. Figure 3 An Apollonius diagram of a set of 9 sites is shown. If the weights are positive, the Apollonius diagram can be viewed as a Voronoi diagram of a set of circles. Points outside the circle have positive distances, while points inside the circle have negative distances. However, unlike the sites in the Voronoi diagram, a site Pi can have an empty cell. If this is the case, we call the site hidden. Unhidden sites will be called visible sites. If all weights add up to the same value, the Apollonius diagram will not change.

[0062] Among them, it is worth noting that unlike traditional Voronoi diagram, Apollonius diagram is composed of straight line segments and hyperbolic segments. Generally speaking, a site in the Apollonius diagram may dominate a multiply connected cell. Each cell must be connected individually, which can be attributed to the same reason: geodesics cannot pass through ridge points.

[0063] Therefore, it can be proved that as long as the triangular face f does not contain a source point, f can be divided into m regions, where m cannot exceed the number of sample points on the bounded edge of f (there may be hidden points in the Apollonius diagram). By accessing each non-hidden point one by one, the triangular face f can be divided into several parts, each part is surrounded by straight line segments and hyperbolic curve segments. In fact, by taking the master site as a pseudo-source, it is easy to deduce the geodesic distance of each part. It can be proved that for any destination point p, the geodesic path from p to the nearest source point cannot pass through a ridge point except that the ridge point is an apical point, that is, the ridge curve is a dividing wave crest. Points on different sides of the ridge curve define different gradient directions. With the help of the Apollonius diagram, it can be ensured that the geodesic backtracking cannot cross the ridge curve, so as to achieve the ideal accuracy.

[0064] In the S5, the contour lines of the geodesic distance field are calculated and extracted, the geodesic contour lines of all regions in a single triangular mesh are extracted first, then the geodesic contour lines of each part are extracted one by one triangular mesh, and all contour line elements are merged into a complete contour line element; Specifically:

[0065] (1) Define the linear function of each sub-region, and it is observed that the geodesic distance field in each region is basically linear;

[0066] (2) Then collect all sub-regions and use a graph to encode the adjacency relationship; This graph allows the geodesic distance between any pair of points (not necessarily mesh vertices) to be calculated in fixed time O(1);

[0067] (3) Each sub-region is taken as a node, and the contour line element is kept in the corresponding node, and the complete contour line is generated by accessing the node:

[0068] 1) Assume that the contour line at d is extracted;

[0069] 2) Find the pending contour line element with a distance of d, and mark the element as "fixed";

[0070] 3) As long as the contour line is not closed or has not reached the boundary of the surface, the contour line element in the adjacent node will be continuously searched and connected to the existing contour line segment.

[0071] Embodiment 2:

[0072] A 3D printing method based on high-quality geodesic contour lines, comprising the following steps:

[0073] (1) Obtain the input model of the 3D printing image;

[0074] (2) Generate high-quality geodesic contour lines;

[0075] (3) Connect the geodesic contour lines obtained in step (2) into a continuous tool path; use Fermat spiral generation technology to connect the contour lines into a continuous tool path, as shown in Figure 4

[0076] (4) Smooth the tool path while keeping the gap change as small as possible; use traditional Laplace smoothing technology to express the smoothness requirement, and require that the widest space between adjacent parts of the path Π at p cannot exceed the gap constraint g(p,Π) (written as g for simplicity), or equivalently, the radius of the largest empty circle is not greater than g / 2, (ii) the narrowest space at p is as close to g as possible. Let {xi}ni=1 be the point sequence representing the tool path. So far, the tool path is generated, as shown in Figure 5

[0077] (5) Finally, 3D printing is completed.

[0078] The accuracy of image extraction using the present application is higher, and it can be applied to different scenarios.

[0079] On the basis of the above-mentioned embodiments, the technical features involved therein and the functions and effects of the technical features in the present application are described in detail to help those skilled in the art to fully understand the technical solutions of the present application and to reproduce them.

[0080] Finally, although the present specification is described in terms of embodiments, not every embodiment contains only one independent technical solution, and the description manner of the specification is only for the sake of clarity, those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can be appropriately combined to form other embodiments that those skilled in the art can understand.​​

Claims

1. A method for generating high quality geodesic contours, characterized by, The generation method includes the following steps: S1: Preprocess the image data to obtain the triangular mesh data of the image; S2: Calculate the geodesic distance to the grid vertex, and all trisection points of the edge of the triangular grid; S3: Generate a cubic interpolation function for each triangular mesh edge; the cubic interpolation function is specifically: (1) Take two trisection points on the edge of the grid, (2) Run the existing algorithm to calculate the geodesic distance of the trisection, (3) Generate a third interpolation function to simulate the distance change along the edge of the grid; Let e ​​= v1v2 be the grid edge, and d1, d2, d3, and d4 be the distance values ​​of v1, (2v1+v2) / 3, (v1+2v2) / 3, and v2, respectively. The cubic interpolation function is: S4: Take k uniformly spaced sample points from the edge of each trisection line and infer the approximate geodesic distance at the sample points; S5: according to the distance weighted calculation of the sampling points, the Apollonius graph is obtained, the triangle is divided into several parts, and the geodesic contour line of each part is extracted, that is, the high-quality geodesic contour line is obtained; the sampling points are trisection points and sample points; Apollonius is defined as Ω i :{x∈Ω|||x-x i ||-w i ≤||x-x j ||-w j ,j≠i}.; after the Apollonius graph is completed, the Apollonius vertex and the sampling point are constructed to carry out the triangulation. In step S5, the contour lines of the geodesic distance field are calculated and extracted. First, the geodesic contour lines of all regions in a single triangular grid are extracted. Then, the geodesic contour lines of each part of each triangular grid are extracted, and all contour line elements are merged into a complete contour line element. Specifically: (1) Define a linear function for each sub-region. It is observed that the geodesic distance field within each region is basically linear. (2) Then all subregions are collected and the adjacency relationships are encoded using a graph; the graph allows the geodesic distance between any pair of points to be calculated in a fixed time O(1); (3) Treat each sub-region as a node and keep the contour elements in the corresponding node. Generate complete contour lines by accessing the nodes.

2. The generation method as described in claim 1, characterized in that, In S2, the calculation of geodesic distance includes computational geometry, partial differential equations, and graphical methods; this method is used to calculate the geodesic distance of all grid vertices.