A line segment aggregation reconstruction and compression optimization method

By setting the line segment classification and aggregation rules and using the RDP algorithm for vector compression, the problem of processing multiple fitting results in the same structural segment in the binary image during the vectorization process of structural information in binary images is solved, and the accurate vector representation of the structural skeleton and the optimization of vectorization results are realized.

CN114596373BActive Publication Date: 2025-05-13FUDAN UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210188473.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-28
Publication Date
2025-05-13
Estimated Expiration
2042-02-28

AI Technical Summary

Technical Problem

In the prior art, in the process of vectorizing structural information in binary images, it is difficult to effectively process multiple fitting results of the same structural segment, resulting in inaccurate vector representation of the structural skeleton.

Method used

By setting the segment classification and aggregation rules, the segments belonging to the same structural segment are classified and processed, and the angle θ of the segment is used as the clustering measure value, and vector compression is optimized in combination with the RDP algorithm.

Benefits of technology

Accurate vector representation of the target structure is achieved, reducing the number of repeated fittings of the structure segments, and improving the authenticity and efficiency of the vectorization results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114596373B_ABST
    Figure CN114596373B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of computer technology applications, and specifically is a line segment aggregation reconstruction and compression optimization method. The present invention includes setting certain line segment classification and aggregation rules, classifying and processing line segments belonging to the same structural segment, and then performing further vector compression based on the coordinate set representation of the line segment to obtain the final vector representation result of the target structure. Among them, the line segment classification and aggregation rule is based on a two-dimensional data structure [k, b] (k is the slope of the line, b is the bias), using the angle θ of the line segment as one of the similarity metrics to cluster different line segments. Different thresholds are set according to various situations such as parallelism and intersection of two line segments. The results of the method of the present invention on experimental data show that after classification and reconstruction of multiple results of the same road section, the effect is still good.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer technology application, and in particular relates to a line segment aggregation reconstruction and compression optimization method. Background Art

[0002] Vectorizing structural information in binary images is a meaningful task, such as vectorizing binary road networks. For structural segments vectorized using the least squares method, if the target structure itself has a certain width, a single structural segment is prone to being fitted multiple times. If the target structure is a single-pixel structural skeleton, since structures such as road networks often have curved features, the structural skeleton can reduce the number of times a single structural segment is repeatedly fitted, but it cannot circumvent the problem.

[0003] In this case, in order to further process the multiple fitting results of the same structural segment, it is necessary to design relevant clustering rules to distinguish the collective representation of different structural segments. Among the multiple line segments representing the same structural segment, they all contribute to the actual feature representation of the target structure. By further processing the coordinate points representing these line segments, a more realistic vector representation of a specific structural segment can be obtained.

[0004] Since the pixel point set of a binary image can also be represented as a set of coordinate points in a two-dimensional plane, based on certain mathematical principles and space geometry theories, the present invention sets certain classification and clustering rules to classify and process the line segments belonging to the same structural segment, and then performs further vector compression based on the coordinate set representation of the line segments to obtain the final vector representation result of the target structure. Summary of the invention

[0005] The object of the present invention is to provide a line segment aggregation reconstruction and compression optimization method with excellent reconstruction effect.

[0006] The present invention provides a line segment aggregation reconstruction and compression optimization method, which includes setting certain line segment classification and aggregation rules, classifying and processing line segments belonging to the same structure segment, and then performing further vector compression according to the coordinate set representation of the line segment to obtain the final vector representation result of the target structure. The specific steps are:

[0007] (I) Establishing line segment classification and aggregation rules.

[0008] In the experiment, the present invention did not consider using the two-dimensional data structure [k, b], where k is the slope of the line and b is the bias, as two-dimensional coordinate points in the traditional sense, and clustering these points using Euclidean distance (equivalent to clustering line segments in disguise). The actual experimental effect of this method is not ideal either, because for two lines whose slopes approach positive infinity, even if they are visually similar, the difference in slope is still large, which is inconsistent with the ideal effect of Euclidean distance as a calculation metric. Therefore, the present invention uses the angle θ of the line segment as one of the similarity metrics to cluster different line segments. The following will define the rules for line segment clustering from the two cases of parallel and intersecting line segments.

[0009] (1) Parallel situation;

[0010] (1.1) If the slopes k of the two line segments are equal but the offsets b are inconsistent, as shown in Figure 1(a), then a threshold th1 is set to determine the relationship between the distance D1 between the two line segments and the threshold; D1 is obtained using Formula 1:

[0011]

[0012] (1.2) If the slopes k of the two line segments are equal, the biases b are also equal, as shown in Figure 1(b); consider two cases:

[0013] (1.2.1) When two line segments intersect, they are directly classified into the same category;

[0014] (1.2.2) The two line segments are far apart, and the threshold th2 is set. The relationship between the distance D2 and the threshold is determined. D2 is obtained using formula 2:

[0015] D2=min {distance(B1,A2),distance(A1,B2)} (2)

[0016] (2) Intersection situation, the intersection point is p; set the angle threshold th θ ;

[0017] (2.1) If the angle θ between two line segments is greater than the threshold, they must not be of the same type. The angle θ is calculated using Formula 3;

[0018]

[0019] (2.2) If the angle between the two line segments is less than the threshold, the position of the intersection is considered, where the x and y coordinates of the intersection are obtained by formula 4, and the following cases are considered:

[0020] (2.2.1) If the intersection point is on two line segments at the same time, it is directly classified into the same category and the coordinates of the intersection point are retained, as shown in Figure 2(a);

[0021]

[0022] (2.2.2) If the intersection point is on one of the line segments, but the two line segments intersect in the x-value domain, they are classified into the same category, but the coordinates of the intersection point are not retained; as shown in Figure 2(b);

[0023] (2.2.3) The intersection point is located on one of the line segments. The two line segments do not intersect in the x value domain. Set the distance threshold thr3. If the distance between the endpoints of the two line segments is less than the threshold, they are of the same type, as shown in Figure 2(c). The method for calculating D3 is similar to that of D2.

[0024] (2.2.4) If the intersection point is not on any line segment, but is located between two line segments, as shown in Figure 2(d), the threshold th3 and distance D3 are also used here to determine whether the two line segments are of the same class;

[0025] (2.2.5) The last case is that the intersection point is not on any line segment. Ideally, the same category is satisfied as shown in Figure 2(e). However, in reality, it may be as shown in Figure 2(f), that is, the intersection point of the two line segments is far outside the image range. Therefore, the present invention sets a distance threshold thr4, and calculates the vertical distances D4 and D5 from A1 and B1 to another line segment respectively. If D4 and D5 are both less than the threshold, they are classified into the same category; D4 or D5 is calculated using Formula 5:

[0026]

[0027] (II) Vector Compression Optimization. After the line segments are classified according to the line segment classification rule, the line segment set of each category is represented as L = {l1,l2,…,l n}, where l i =[point a ,point b ], that is, a certain structural segment is finally represented by a series of discrete coordinate points. Since the number of coordinate points is at least 2 (the first and last ends of the line segment), when there are more than 2 coordinate points, all points are sorted according to the coordinate size, and the discrete coordinate points make the structural segment vectorized in a certain direction. However, in order to further optimize the vectorization representation effect, the present invention uses the RDP algorithm to compress the path of the ordered coordinate points in the experiment. The compression effect of the RDP algorithm on a set of ordered coordinate points in the test is as follows: Figure 3 As shown in the figure, it can be seen that by setting a certain threshold, the more abrupt and unnecessary coordinates in the original coordinate point set are deleted after path compression. Applying RDP to the point set representing the road segment, the final retained point set is connected to obtain the final vector result of the target structure. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Table 1 shows the relevant parameters set for line segment clustering and reconstruction rules in the present invention.

[0029] FIG1 is a sample description of the line segment parallelism in the line segment clustering rule of the present invention, where (a) two line segments k are equal but b are not equal, and (b) two straight lines k and b are equal.

[0030] FIG2 is a sample description of the line segment intersection in the line segment clustering rule of the present invention, wherein (a) two line segments intersect (1), (b) two line segments intersect (2); (c) two line segments intersect (3), (d) two line segments intersect (4), (e) two line segments intersect (5), and (f) two line segments intersect (6).

[0031] Figure 3 This is a demonstration of the effect of the RDP algorithm cited in the present invention on sample data.

[0032] Figure 4 This is the experimental result of the line segment clustering and reconstruction method of the present invention on 600×600 size data.

[0033] Figure 5 This is the experimental result of the line segment clustering and reconstruction method of the present invention on 1000×1000 size data (1).

[0034] Figure 6 This is the experimental result of the line segment clustering and reconstruction method of the present invention on 1000×1000 size data (2). DETAILED DESCRIPTION

[0035] The present invention provides a line segment aggregation reconstruction and compression optimization method, the specific steps are:

[0036] (I) Establishing line segment classification and aggregation rules.

[0037] The present invention uses the angle θ of the line segments as one of the similarity measurement values ​​to cluster different line segments. The following defines the line segment clustering rules from the two situations of parallel and intersecting line segments.

[0038] (1) Parallel situation;

[0039] (1.1) If the slopes k of the two line segments are equal but the offsets b are inconsistent, as shown in Figure 1(a), then a threshold th1 is set to determine the relationship between the distance D1 between the two line segments and the threshold; D1 is obtained using Formula 1:

[0040]

[0041] (1.2) If the slopes k of the two line segments are equal, the biases b are also equal, as shown in Figure 1(b); consider two cases:

[0042] (1.2.1) When two line segments intersect, they are directly classified into the same category;

[0043] (1.2.2) The two line segments are far apart, and the threshold th2 is set. The relationship between the distance D2 and the threshold is determined. D2 is obtained using formula 2:

[0044] D2=min {distance(B1, A2), distance(A1, B2)} (2)

[0045] (2) Intersection situation, the intersection point is p; set the angle threshold th θ ;

[0046] (2.1) If the angle θ between two line segments is greater than the threshold, they must not be of the same type. The angle θ is calculated using Formula 3;

[0047]

[0048] (2.2) If the angle between the two line segments is less than the threshold, the position of the intersection is considered, where the x and y coordinates of the intersection are obtained by formula 4, and the following cases are considered:

[0049] (2.2.1) If the intersection point is on two line segments at the same time, it is directly classified into the same category and the coordinates of the intersection point are retained, as shown in Figure 2(a);

[0050]

[0051] (2.2.2) If the intersection point is on one of the line segments, but the two line segments intersect in the x-value domain, they are classified into the same category, but the coordinates of the intersection point are not retained; as shown in Figure 2(b);

[0052] (2.2.3) The intersection point is located on one of the line segments. The two line segments do not intersect in the x value domain. Set the distance threshold thr3. If the distance between the endpoints of the two line segments is less than the threshold, they are of the same type, as shown in Figure 2(c). The method for calculating D3 is similar to that of D2.

[0053] (2.2.4) If the intersection point is not on any line segment, but is located between two line segments, as shown in Figure 2(d), the threshold th3 and distance D3 are also used here to determine whether the two line segments are of the same class;

[0054] (2.2.5) The last case is that the intersection point is not on any line segment. Ideally, the same category is satisfied as shown in Figure 2(e). However, in reality, it may be as shown in Figure 2(f), that is, the intersection point of the two line segments is far outside the image range. Therefore, the present invention sets a distance threshold thr4, and calculates the vertical distances D4 and D5 from A1 and B1 to another line segment respectively. If D4 and D5 are both less than the threshold, they are classified into the same category; D4 or D5 is calculated using Formula 5:

[0055]

[0056] (II) Vector Compression Optimization. After the line segments are classified according to the line segment classification rule, the line segment set of each category is represented as L = {l1,l2,…,l n}, where l i =[point a ,point b ], that is, a certain structural segment is finally represented by a series of discrete coordinate points. Since the number of coordinate points is at least 2 (the first and last ends of the line segment), when there are more than 2 coordinate points, all points are sorted according to the coordinate size, and the discrete coordinate points make the structural segment vectorized in a certain direction. However, in order to further optimize the vectorization representation effect, the present invention uses the RDP algorithm to compress the path of the ordered coordinate points in the experiment. The compression effect of the RDP algorithm on a set of ordered coordinate points in the test is as follows: Figure 3 As shown in the figure, it can be seen that by setting a certain threshold, the more abrupt and unnecessary coordinates in the original coordinate point set are deleted after path compression. Applying RDP to the point set representing the road segment, the final retained point set is connected to obtain the final vector result of the target structure.

[0057] Since there may be multiple fitting results for the same structure segment in the binary target structure vector fitting, the corresponding threshold parameters are shown in Table 1 corresponding to the line segment clustering rule in the present invention. gap It is set to 60. It is worth mentioning that the present invention makes a simple repair on the small line segments that are very likely to be connected but disconnected based on RDP vector compression. gap This is where parameters come in.

[0058] Table 1. Parameter settings for line segment classification and reconstruction

[0059] Parameter name Parameter settings <![CDATA[ReconstructNovxThr d1 ]]> 40 <![CDATA[ReconstructNovxThr d2 ]]> 80 <![CDATA[ReconstructNovxThr θ ]]> 15 <![CDATA[ReconstructNovxThr d3 ]]> 50 <![CDATA[ReconstructVxThr d1 ]]> 35 <![CDATA[Rdp gap ]]> 60 <![CDATA[Fix gap ]]> 100 .

[0060] Results of clustering reconstruction and compression optimization on 600×600 size data. Figure 4 As can be seen from the first sub-graph of , for multiple line segments fitted from the same structural segment, it is necessary to further cluster the line segment set, and then use the RDP path compression algorithm and repair rules to perform the final processing on the vector line segment set, and finally the vector coordinate representation of the structural segment can be retained. The corresponding results are shown in Figure 4 As shown in the second sub-figure.

[0061] Results of clustering reconstruction and compression optimization on 1000×1000 size data. Figure 5 , Figure 6It can be seen that after the classification and reconstruction of multiple results of the same road section, the effect is still good.

Claims

1. A line segment aggregation reconstruction and compression optimization method, characterized in that: First, the line segment classification and aggregation rules are set to classify and process the line segments belonging to the same structure segment; then, vector compression is performed based on the coordinate set representation of the line segment to obtain the final vector representation result of the target structure; The specific method of setting the line segment classification and aggregation rules is as follows: Consider the two-dimensional data structure [k,b], where k is the slope of the line and b is the bias. The angle θ of the line segment is used as one of the similarity measures to cluster different line segments. Specifically, the line segment clustering rules are set based on the two cases of parallelism and intersection. The two line segments are represented by l1 and l2 respectively. The two endpoints of l1 are A1 and B1 respectively, and the two endpoints of l2 are A2 and B2 respectively. (1) Parallel situation; (1.1) If the slopes k of the two line segments l1 and l2 are equal, but the biases b are inconsistent, then a threshold th1 is set to determine the relationship between the distance D1 between the two line segments and the threshold; D1 is obtained using formula 1: (1.2) If the slopes k of the two line segments l1 and l2 are equal, and the biases b are also equal, consider two cases: (1.2.1) When two line segments intersect, they are directly classified into the same category; (1.2.2) The two line segments are far apart, and the threshold th2 is set. The relationship between the distance D2 and the threshold is determined. D2 is obtained using formula 2: D2=min{distance(B1,A2),distance(A1,B2)} (2) (2) Intersection, the intersection point is p; Set the angle threshold th θ ; (2.1) If the angle θ between two line segments l1 and l2 is greater than the threshold, they must not be of the same type. The angle θ is calculated using Formula 3; (2.2) If the angle between the two line segments l1 and l2 is less than the threshold, the position of the intersection is considered, where the x and y coordinates of the intersection are obtained by formula 4, and the following cases are considered: (2.2.1) If the intersection point is on two line segments at the same time, it is directly classified into the same category and the coordinates of the intersection point are retained; (2.2.2) If the intersection point is on one of the line segments, but the two line segments intersect in the x-value domain, they are classified into the same category, but the coordinates of the intersection point are not retained; (2.2.3) The intersection point is located on one of the line segments. The two line segments do not intersect in the x value domain. Set the distance threshold thr3. If the distance between the endpoints of the two line segments is less than the threshold, they are of the same type. The method of calculating D3 is similar to that of D2. (2.2.4) If the intersection point is not on any line segment, but is located between two line segments, the threshold th3 and distance D3 are also used to determine whether the two line segments are of the same type; (2.2.5) In the last case, the intersection point is not on any line segment. Set the distance threshold thr4 and calculate the vertical distances D4 and D5 from A1 and B1 to the other line segment respectively. If D4 and D5 are both less than the threshold, they are classified into the same category. D4 is calculated using formula 5:

2. The line segment aggregation reconstruction and compression optimization method according to claim 1, characterized in that: The vector compression optimization is specifically performed as follows: After the line segments are classified according to the line segment classification rules, the line segment set of each category is represented as L = {l1,l2,…,l n }, where l i =[point a ,point b ], that is, a certain structural segment is finally represented by a series of discrete coordinate points; the number of coordinate points is at least 2, when there are more than 2 coordinate points, all points are sorted according to the size of the coordinates, and the discrete coordinate points make the structural segment vectorized in a certain direction; the RDP algorithm is used to compress the ordered coordinate points; by setting a certain threshold, the more abrupt and unnecessary coordinates in the original coordinate point set are deleted after the path compression; RDP is used to represent the point set of the road section, and the final retained point set is connected to obtain the final vector result of the target structure.

Citation Information

Patent Citations

  • Vector data compression method and device thereof based on curvilinear characteristic variation

    CN101561933A