Method for automatic registration of building point clouds based on two-dimensional projection line segments
By using an automatic registration method for building point clouds based on two-dimensional projection line segments, the problems of low efficiency and poor accuracy in existing technologies are solved, and rapid and accurate registration of large-scale building point clouds is achieved. This method is suitable for applications such as integrated indoor and outdoor modeling and Building Information Modeling (BIM).
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANYANG NORMAL UNIV
- Filing Date
- 2022-10-14
- Publication Date
- 2026-06-02
AI Technical Summary
Existing building point cloud registration methods are inefficient, have poor accuracy, and are prone to getting trapped in local optima and failing to converge, especially in large-scale building point cloud registration.
An automatic registration method for building point clouds based on two-dimensional projection line segments is adopted. Through preprocessing, extraction of two-dimensional point cloud line segments, calculation of intersections and included angles, comparison of angle differences, counter comparison and singular value decomposition, the point cloud can be registered quickly and accurately.
It enables rapid and accurate registration of large-scale building point clouds, improving the efficiency and accuracy of registration, and is suitable for applications such as integrated indoor and outdoor modeling, building information modeling (BIM), and rapid indoor navigation.
Smart Images

Figure CN116091562B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of three-dimensional laser scanning technology, specifically relating to a method for automatic registration of building point clouds based on two-dimensional projection line segments. Background Technology
[0002] While terrestrial laser scanners can acquire detailed 3D information about object surfaces, point cloud data acquired from a single viewpoint is insufficient to cover the entire scene. Therefore, it is necessary to register point cloud data acquired from multiple viewpoints to the same coordinate system. This process includes two steps: coarse registration and fine registration. Fine registration typically employs the Iterative Closest Point (ICP) algorithm or its variants. Currently, numerous coarse point cloud registration methods exist, which calculate transformation parameters by extracting different geometric features (points, lines, planes, and specific objects). Generally, point-based methods are more versatile because they are applicable to various scenes. They first extract key points from two point clouds to be matched, then calculate local shape descriptors for these key points, and establish correspondences between key points in different point clouds by comparing the similarity of these descriptors. While these methods can achieve good registration results, they are computationally complex. Line- or plane-based methods are more robust to noise and variations in point density. For scenes with man-made objects, where numerous line and surface features exist, extracting line / surface features for point cloud registration is a good choice. However, most existing line- or surface-based methods extract 3D structural lines / 3D planes. This means that these methods process point cloud data in 3D space, and extracting 3D structural lines / 3D planes is quite time-consuming, which limits the accuracy and speed of 3D point cloud registration and seriously affects its application. Summary of the Invention
[0003] This invention addresses the problems of low efficiency, poor accuracy, susceptibility to local optima, and non-convergence in the registration of large-scale building point clouds. The aim is to provide a method for automatic registration of building point clouds based on two-dimensional projection line segments, enabling rapid registration of large-scale building point clouds.
[0004] To achieve the above objectives, the present invention employs the following solution:
[0005] This invention provides a method for automatic registration of building point clouds based on two-dimensional projection line segments, characterized by the following steps: Step 1. Let the target point cloud be P. t The point cloud to be registered is P s , for P t and P s The following preprocessing steps are performed sequentially: uniform spatial downsampling, filtering the main horizontal planes in the Z direction, and projecting onto the XY plane to obtain a two-dimensional point cloud. and
[0006] Step 2. Set the farthest distance from a point to a line, the radius of the nearest neighbor search during clustering, the minimum number of points contained in a qualified line segment, and the shortest length of a qualified line segment as extraction requirements, respectively from... and Extract the two-dimensional point cloud line segments that meet the extraction requirements to form a two-dimensional point cloud line segment set L. t and L s , for L t and L s The point cloud segments are arranged in descending order of length;
[0007] Step 3. Obtain the qualified intersection points, associated virtual points, and included angles of the 2D point cloud line segment set: For L t First, calculate the longest point cloud line segment. The line containing L t any point in the cloud segment The angle formed by the line like If the intersection point is deemed valid, calculate the intersection point of the two lines and the two associated virtual points, and compare them: Let the intersection point of the two intersecting lines be p. inters Given the line (c1, c2), let p(x, y) be a virtual point on the line at a distance r from the intersection point. Then the following relationship exists:
[0008]
[0009] Substituting the first term in equation (7) into the second term, we can obtain the value of x:
[0010]
[0011] in,
[0012]
[0013] For each straight line, two virtual points are calculated. Then, for each straight line, the distance from each virtual point to p is calculated. ,ent The distances d1 and d2, and the distance p on each straight line. cent The nearest virtual point is the virtual point attached to the required qualified intersection point, p. cent Let be the centroid of the two intersecting point cloud segments;
[0014] Once two line segments have been compared, they are marked to avoid repeated comparisons. This process is repeated for any two line segments to determine L. t All qualified intersections form the intersection set I. t Each valid intersection point is accompanied by two virtual points. The angles between each valid intersection point and its two virtual points are calculated to form an angle set θ. tUsing the aforementioned L t Using the same method, obtain L s The set of all qualified intersection points in I s Each valid intersection point is accompanied by two virtual points and the corresponding set of included angles θ. s ;
[0015] Step 4. Compare θ t any angle With θ s any angle difference 1≤i≤n1, n1 is I t The number of subsets of P, 1≤j≤n2, where n2 is the subset of P. s The number of qualified intersection points. If |Δθ| < 1°, then the corresponding pair of intersection points and their respective attached virtual points are considered to be corresponding points, and the corresponding corresponding point relationship is the first type. and and and Or it could be the second type. and and and There are two combination forms; the transformation parameters of different combinations are very different, so it is necessary to consider the two combinations of corresponding points separately and solve for the transformation parameters corresponding to each combination of corresponding points: rotation matrix R, translation vector T and transformation matrix A between the two coordinate systems;
[0016] Step 5. Set counter C 1 The corresponding first form is and and and Given a combination of points with the same name, use the transformation matrix A of this combination to transform p. s Unified to p t In the coordinate system in which it is located, next, for I s Each intersection point starts from I t Find the nearest one that belongs to I. t intersection Calculate the distance d between these two points. If d < length threshold ε7, then treat the two points as a pair of corresponding intersection points. As a qualified interior point, and the counter C is set... 1 The number of interior points increases by 1, and the process of traversing I is completed. s After each intersection point, a counter C is obtained. 1 The cumulative number of all interior points and the corresponding pairs of intersections for each qualified interior point; following this method, the counter C for the second form of corresponding point combinations is obtained. 2The cumulative number of all qualified interior points and the corresponding intersection pairs with each qualified interior point; from C 1 and C 2 Find the corresponding intersection pairs in the counter that satisfy the requirement of the largest cumulative number of interior points or exceeds a certain threshold. These are then used as the intersection pairs that meet the registration criteria for registration. Note that the cumulative value used to select intersection points is relative to C. 1 and C 2 All elements are compared, not individually. Generally, there is more than one set of matching points that meet the conditions, and C 1 and C 2 The element with the largest cumulative value has a small difference from several subsequent elements; if there are multiple pairs of corresponding intersection points that meet the registration conditions, singular value decomposition is used to solve the transformation parameters for overall registration, and the obtained rotation matrix and translation vector are used to register P. s With P t Align the two point clouds on the XY plane, then calculate the translation ΔZ, P of the two point clouds along the Z-axis. s With P t After alignment in the XY plane and translation in the Z direction, the final registration result is obtained.
[0017] Furthermore, the automatic registration method for building point clouds based on two-dimensional projection line segments provided by the present invention may also have the following characteristics: In step 4, the method for solving the transformation parameters is as follows: For the first type of corresponding point combination and and and First, calculate the rotation matrix R:
[0018]
[0019] In the formula, i = 1, 2;
[0020] Then the translation vector T is:
[0021]
[0022] The transformation matrix A between the two coordinate systems is:
[0023]
[0024] Using the same method as above, the second type of combination of corresponding points can be solved. and and and The conversion parameters.
[0025] Furthermore, the automatic registration method for building point clouds based on two-dimensional projection line segments provided by the present invention may also have the following features: In step 4, at least three pairs of intersection points that may be homonymous points and their respective attached virtual points are obtained; each pair of intersection points and its respective attached virtual points correspond to two combination forms, and the corresponding two sets of transformation parameters are solved; in step 5, for each pair of intersection points obtained in step 4, the counters C for the two forms of homonymous point combinations are obtained respectively. 1 and C 2 The sub-counter corresponding to the k-th group of identical point combinations in the first type of identical point combination is denoted as element. 1≤k≤n3, where n3 is the number of all combinations of identical vertices contained in the first form; the second form uses the same method; then from all C 1 and C 2 Find the corresponding intersection pairs of elements with the largest cumulative number of interior points or those exceeding a certain threshold, and use them as the corresponding intersection pairs that meet the registration conditions for registration.
[0026] Furthermore, the automatic registration method for building point clouds based on two-dimensional projection line segments provided by the present invention may also have the following features: In step 5, when there are multiple pairs of corresponding intersection points that meet the registration conditions, in order to solve the coordinate transformation when multiple pairs of corresponding point combinations exist, let... and P respectively t and P s For the u-th pair of points with the same name, with rotation matrix R and translation vector T, we have:
[0027]
[0028] make and The centers of mass are respectively and Will and Centralization includes:
[0029]
[0030] Considering the impact of errors, we use a method that reduces the error function to solve for the transformation parameters. The total error equation during coordinate transformation is:
[0031]
[0032] In the formula, n is the number of pairs of points with the same name.
[0033] The total error equation after centering is:
[0034]
[0035] When the value of Δ is minimized, it corresponds to the desired rotation matrix R and translation vector T. Appropriate transformations are then performed on Δ:
[0036]
[0037] Therefore, finding the minimum value of Δ is equivalent to finding the maximum value of Δ′, where Δ′ is:
[0038]
[0039] in,
[0040]
[0041] Performing singular value decomposition on H, we have:
[0042] [U ∑ V]=SVD(H) (5-7)
[0043] The rotation matrix R can then be expressed as:
[0044] R = VU T (5-8)
[0045] After calculating the value of the rotation matrix R, the translation vector T can be obtained from equation (12):
[0046]
[0047] The transformation matrix A between the two coordinate systems is:
[0048]
[0049] Using the obtained rotation parameters, r s With r t Align the two point clouds on the XY plane, and then calculate the translation ΔZ of the two point clouds along the Z-axis.
[0050] Furthermore, the automatic registration method for building point clouds based on two-dimensional projection line segments provided by the present invention may also have the following features: the translation amount ΔZ is obtained by: statistically calculating the average elevations h1 and h2 of the two point cloud ground flat areas, and taking the difference between h1 and h2 as ΔZ; or by using the difference in elevation measured by the GPS of the scanner as ΔZ.
[0051] Furthermore, the automatic registration method for building point clouds based on two-dimensional projection line segments provided by the present invention may also have the following features: In step 5, when performing overall registration using multiple sets of corresponding intersection point pairs that meet the registration conditions, corresponding intersection point pairs are first uniformly selected in the survey area, and then the transformation parameters are obtained by using singular value decomposition on the selected corresponding point combinations.
[0052] Furthermore, the automatic registration method for building point clouds based on two-dimensional projection line segments provided by the present invention may also have the following features: in step 5, registration is performed based on the same intersection point pair corresponding to the counter with the most internal points; if there are multiple counters with the most internal points, one is randomly selected.
[0053] Furthermore, the automatic registration method for building point clouds based on two-dimensional projection line segments provided by the present invention may also have the following features: in step 5, ε7 is 0.01m.
[0054] Furthermore, in the automatic registration method for building point clouds based on two-dimensional projection line segments provided by this invention, step 1 can be preprocessed as follows to obtain... and Assume the target point cloud is P t The point cloud to be registered is P s For P respectively t and P s Spatially uniform downsampling is performed, and a length threshold ε1 is set as the minimum sampling interval to ensure that the distance between any two points in the downsampled point cloud is not less than ε1, thus obtaining the downsampled point cloud. and Next, we will calculate the results by step size. and The distribution histogram of points along the Z-direction is used to automatically remove the main horizontal planes along the Z-direction based on the histogram distribution pattern, and statistical analysis is performed at certain step sizes. and The histogram of point distribution along the Z-direction in the cloud typically shows two main peaks in the Z-direction for points on the ground and ceiling. Based on this significant characteristic, the main horizontal planes are removed using the Z-direction coordinate values. If the point cloud of a certain layer is significantly larger than the average value by several times (e.g., twice the average value), it is considered to have a main horizontal plane and is removed, thus obtaining the filtered point cloud. and right and The projection equation is as follows:
[0055] ax + by + cz + d = 0 (1)
[0056] In the formula, a = b = d = 0, c = 1, that is to say, and The points are projected onto the XY plane, thus yielding a two-dimensional point cloud. and
[0057] Furthermore, in the automatic registration method for building point clouds based on two-dimensional projection line segments provided by this invention, step 2 can extract L in the following manner. tand L s Use the Random Sample Consensus Algorithm (RANSAC) to extract respectively and In the 2D point cloud line segment extraction, the number of iterations for executing the RANSAC algorithm is set to ε2, the length threshold ε3 is set as the farthest distance from the point to the line, the length threshold ε4 is set as the radius of the nearest neighbor search during clustering, and the numerical threshold ε is set. ; As the minimum number of points contained in a qualified line segment, a length threshold ε6 is set as the shortest length of a qualified line segment. The extracted two-dimensional point cloud line segment sets are L. t and L s , for L t and L s The point cloud segments are arranged in descending order of length. For example, randomly from Select two points A(x) a ,y a ,z a ) and B(x b ,y b ,z b ), then from A(x) a ,y a ,z a ) and B(x b ,y b ,z b The defined straight line L can be expressed as:
[0058]
[0059] Suppose there is a plane ψ c Passing through the spatial point P(x) c ,y c ,z c And with Let plane ψ be its normal vector. c The intersection point with line AB is C(x). d ,y d ,z d If ), then point C(x) d ,y d ,z d Each coordinate value of ) can be calculated as follows:
[0060]
[0061] Based on the fact that CP⊥AB, t can be represented as:
[0062]
[0063] Then point P(x)p ,y p ,z p ) to point C(x) c ,y c ,z c The distance d) pc for:
[0064]
[0065] Set the maximum number of iterations to ε2, and set a threshold ε3 (e.g., 0.01m) as the farthest distance from the point to the line. If d pc If ≤ε3, then the corresponding point is considered to be a point inside the line. (This is for the point cloud to be processed.) A point p in i Perform a k-nearest neighbor search to find the corresponding nearest neighbor (represented as...). ), then d aver The following can be calculated:
[0066]
[0067] In the formula, K is The number of points, 1 ≤ i ≤ K. For example, n can be set to 2.
[0068] Each collinear point P is extracted col Then, establish P col The kd-tree structure is used, and an empty cluster set E and an empty queue Q are created, then P... col The points in Q are stored in Q; for each point in Q, Q... i Perform a k-nearest neighbor search and store the search results in Q. i k In the middle, calculate Q i k Each point in Q i distance d ik Set a length threshold ε4 as the farthest distance between two adjacent points. If d i k ≤ε4, the corresponding point will be with Q i They are stored together in cluster set E; the distance between clusters in E is calculated according to equation (6), and clusters whose distance to each other is no greater than ε4 are merged until the distance between any two clusters is greater than ε4; if the clustering result is not empty, the result is stored in P. seg In the middle, calculate P seg Each subset P seg i Length L seg i And the number of points N seg i Set a threshold ε; As the minimum number of points per unit length, a threshold ε6 is set as the shortest length of a qualified line segment. If N seg i / L seg i ≥ε ; And L seg i ≥ε6, P seg i It is considered a valid line segment, then P seg The points corresponding to the qualified line segments in the diagram are from... Remove them; The remaining points are used as the original data, and the above process is repeated to enter the next loop. The iteration ends when the cluster is empty for 5 consecutive times. On the other hand, if the remaining points are only the initial ones... For a portion (e.g., 5%), the iteration process is also forcibly terminated, and all qualified line segments are stored in the 2D point cloud line segment set L. t Similarly, the middle part is obtained in the same way. The set of line segments L in the two-dimensional point cloud s , for L t and L s The two-dimensional point cloud line segments are arranged in descending order of length.
[0069] The role and effect of invention
[0070] The proposed method for automatic registration of building point clouds based on two-dimensional projection line segments utilizes the features of two-dimensional projection line segments to automatically and quickly perform targetless registration of building point cloud data from different perspectives using projection line segment information. This method addresses the common problems of low efficiency, poor accuracy, susceptibility to local optima, and non-convergence in existing methods. Its advantages are particularly evident when registering large-scale building point clouds, meeting practical requirements in terms of accuracy, applicability, robustness, and automation level. This allows it to serve subsequent applications such as integrated indoor and outdoor modeling, Building Information Modeling (BIM), and rapid indoor navigation and positioning. Attached Figure Description
[0071] Figure 1 This is a flowchart of a method for automatic registration of building point clouds based on two-dimensional projection line segments, as described in an embodiment of the present invention.
[0072] Figure 2 This is a schematic diagram of the target point cloud and source point cloud involved in the embodiments of the present invention, wherein (a) is the target point cloud data and (b) is the source point cloud data;
[0073] Figure 3 This is a flowchart illustrating the data preprocessing process involved in an embodiment of the present invention;
[0074] Figure 4 This is a histogram of point cloud distribution along the Z direction involved in this embodiment of the invention;
[0075] Figure 5 This is a diagram illustrating the extraction effect of two-dimensional projection line segments according to an embodiment of the present invention.
[0076] Figure 6 These are the extracted point cloud line segments and intersections involved in the embodiments of the present invention;
[0077] Figure 7 The following is a comparison between the registration result of the method of the present invention and the original fine registration result in the embodiments of the present invention, wherein (a) is the original fine registration result and (b) is the registration result of the method of the present invention. Detailed Implementation
[0078] The following describes in detail, with reference to the accompanying drawings, the specific implementation scheme of the method for automatic registration of building point clouds based on two-dimensional projection line segments involved in this invention.
[0079] <Example>
[0080] like Figure 1 As shown, the method for automatic registration of building point clouds based on two-dimensional projection line segments provided in this embodiment includes the following steps:
[0081] Step 1. To verify the proposed method, the automatic registration algorithm proposed in this invention is demonstrated using real point cloud data, such as... Figure 2 As shown, point cloud data for Apartment from the open-source Indoor Lidar-rgbd Scan Dataset was selected. Apartment was scanned using a FARO Focus 3D X330 HDR terrestrial 3D laser scanner, with a total of 7 stations scanned and well registered. Here, scan_00 and scan_01 were selected for the experiment, with scan_01 as the target point cloud P. t Point cloud P with scan_00 as the source s Since the original data has already undergone excellent registration, to verify the effectiveness of the proposed automatic point cloud registration method based on two-dimensional projection line segments, a rotation and translation in the XY plane are applied to scan_00:
[0082]
[0083] Then its inverse transformation matrix is:
[0084]
[0085] With target point cloud P t For example, Figure 3 As shown, for Pt Spatially uniform downsampling is performed at intervals of ε1 = 0.01m to obtain the downsampled point cloud. A total of 626,373 points were used to calculate... The minimum value along the Z direction is -25.94m, and the maximum value is -23.20m. The downsampled point cloud is divided into 27 parts along the Z direction with a step size of 0.1m. The average number of points in each layer is 23199. A histogram of point distribution along the Z direction is then generated, as shown below. Figure 4 As shown, the four peaks correspond to the ground, bed, corridor ceiling, and ceiling in the target point cloud, respectively, and are significantly larger than the average number of points. These four parts of the point cloud are removed. The remaining point cloud may still contain some small horizontal planes, which can be filtered again to obtain the filtered point cloud. The filtered point cloud is projected onto the XY plane to obtain the projected two-dimensional point cloud. Similarly, repeat the above process on the source point cloud to obtain the projected two-dimensional point cloud.
[0086] Step 2. Use the improved Random Sample Consensus Algorithm (RANSAC) to extract the results respectively. and In the 2D point cloud line segment extraction, the number of iterations for executing the RANSAC algorithm is set to ε2 = 200, the length threshold ε3 = 0.01m is set as the farthest distance from a point to a line, the length threshold ε4 = 0.05m is set as the radius of the nearest neighbor search during clustering, and the numerical threshold ε is set... ; =50 is set as the minimum number of points contained in a qualified line segment. A length threshold ε6 = 0.3m is set as the shortest length of a qualified line segment. Assume that the extracted two-dimensional point cloud line segment set is L. t and L s , for L t and L s The point cloud segments are arranged in descending order of length, such as... Figure 5 As shown.
[0087] Step 3. Calculate L respectively t and L s The qualified intersection points and their associated virtual points corresponding to the line segments in the diagram. Figure 6 The image only shows the intersections of the line segments, with some intersections magnified. There are 55 red dots (the grayscale of the dots in the box indicated by the arrow on the upper left of the image corresponds to red), representing the intersections using L... t The calculated intersection points, including the 30 blue points (the grayscale of the points in the box indicated by the arrow on the lower left of the image corresponds to blue), represent the points obtained using L... s Find the intersection points.
[0088] Step 4. Compare θ t any angle (1≤i≤n1, n1 is I) t The number of subsets) and θ s any angle (1≤j≤n2, n2 is P) s The difference between the number of qualified intersection points If |Δθ| < 1°, then P is considered to be... t and P s A pair of intersection points and their respective associated virtual points may be related as points of the same name. Let's assume these three pairs of points are respectively... and and and Since the correspondence between line segments is not explicitly defined, another correspondence exists here, namely, points with the same name are respectively... and and and The transformation parameters calculated for different combinations of three pairs of points vary greatly, therefore these two cases need to be considered separately for combination. and and and For example, calculate the rotation matrix R, translation vector T, and transformation matrix A between the two coordinate systems; similarly, for combinations... and and and The rotation matrix R, translation vector T, and transformation matrix A between the two coordinate systems are also calculated.
[0089] Step 5. Utilize combinations and and and The transformation matrix A will P s Unified to P t In the coordinate system in which it is located, next, for I s Each intersection in (1≤i≤n2, n2 is P) s The number of qualified intersections in I) t Find the point closest to it. Calculate the distance d between the two points. If d < ε7 (where ε7 is the length threshold, which can be set according to the actual situation, generally 0.01m is sufficient), then set the counter C. 1 elements in The value increases by 1 (1≤k≤n3, n3 is the sum of all values of k and n3). and and and The total number of pairs that are of the form and whose angle difference is less than the threshold of 1°. The initial values are uniformly set to 0), and the registration residuals for each combination are calculated simultaneously with the counting. The results are obtained using this method. and and and A counter C in the form of combination 2 And the registration residuals for each combination, for C 1 and C 2 Sort the elements in descending order, find the element with the largest cumulative value and its corresponding intersection. Generally, there is more than one pair of matching points (each pair contains three pairs of points with the same name), and C 1 and C 2 If the difference between the element with the largest cumulative value and several subsequent elements is small, and if multiple valid pairings exist, singular value decomposition is used to solve for the parameters. The obtained rotation and translation parameters are then used to transform P... s With P t Align the two point clouds on the XY plane. Finally, calculate the translation ΔZ of the two point clouds along the Z-axis. A simple way is to calculate the average elevations h1 and h2 of the two point clouds at flat ground. The translation can be regarded as the difference between h1 and h2. Alternatively, the difference in elevation measured by the scanner's built-in GPS can be used. After rotating the XY plane and translating in the Z direction, the final registration result can be obtained.
[0090] In this embodiment, in order to compare the accuracy of the final registration result and to illustrate the case of multiple pairs, 736 pairs of intersection points and their respective virtual points were obtained in step 4 (there are 736 pairs of corresponding points in each of the two combination forms, totaling 1650 combinations). In the actual calculation process, it is only necessary to obtain one or a few pairs of intersection points and their respective virtual points, without having to traverse and compare all angles to obtain all possible corresponding points.
[0091] Specifically, in steps 4 and 5: a total of [number] [units] are calculated. and and and A total of 736 pairs of combinations with an angle difference less than the threshold of 1° were identified. Similarly, using... and and and The total number of pairs in the formal combinations is also 736. Without angular constraints, the total number of pairs in a single combination is 1650. Table 1 shows the two counters C. 1 and C 2 The statistical value, C 1 and C 2The number in the column represents the number of pairs of corresponding intersections with the same total number of interior points. A number of 1 indicates that there is 1 pair of corresponding intersections, and 4 indicates that there are 4 pairs of corresponding intersections. It can be seen that the corresponding intersections with 25, 24, and 23 interior points are most likely to be used for registration, that is, at least 18 pairs of corresponding intersections that can be used for registration have been found.
[0092] Table 1
[0093]
[0094]
[0095] To verify the reliability of the algorithm of this invention, the first 5 pairs of intersection points and their associated virtual points are simply selected for testing to prove that the method can automatically find a variety of correct pairings. Table 2 shows the coordinate values of these 5 pairs of intersection points.
[0096] Table 2
[0097]
[0098] First, the transformation matrix is calculated using the five pairs of intersection points and their associated virtual points:
[0099]
[0100]
[0101]
[0102]
[0103]
[0104] Then, registration is performed using the five different transformation matrices obtained above. Figure 7 The comparison between the registration result using transformation matrix A1 and the original fine registration result is shown. The red portion (light gray in the figure) represents the target point cloud, and the blue portion (dark gray in the figure) represents the source point cloud. It can be seen that the automated registration method proposed in this invention can achieve a good coarse registration effect. To further quantitatively evaluate the registration results, the accuracy is assessed using equations (VIII) and (IX):
[0105] The rotational error is calculated as follows:
[0106]
[0107] In the formula, R true R represents the actual rotation matrix, and R represents the calculated rotation matrix.
[0108] Translation error is defined as follows:
[0109]
[0110] Table 3 shows a comparison of the registration accuracy of five different combinations. It can be seen that the rotation error is within 1.5°, the translation error in the X direction is less than 0.02m, the translation error in the Y direction is less than 0.005m, and the total translation error is less than 0.02m. This indicates that the automatic registration method based on two-dimensional projection line segments proposed in this invention can not only automatically calculate multiple optimal pairing combinations, but also has high accuracy and reliability.
[0111] Table 3
[0112]
[0113]
[0114] The above embodiments are merely illustrative examples of the technical solution of the present invention. The method for automatic registration of building point clouds based on two-dimensional projection line segments involved in the present invention is not limited to the content described in the above embodiments, but is subject to the scope defined by the claims. Any modifications, additions, or equivalent substitutions made by those skilled in the art based on these embodiments are within the scope of protection claimed by the claims of the present invention.
Claims
1. A method for automatic registration of building point clouds based on two-dimensional projection line segments, characterized in that, Includes the following steps: Step 1, let the target point cloud be... The point cloud to be registered is ,right and The following steps are performed sequentially: uniform spatial downsampling, filtering the main horizontal planes in the Z direction, and preprocessing by projecting onto the XY plane to obtain a two-dimensional point cloud. and Among them, the main horizontal planes are removed by using the Z-direction coordinate values. If the point cloud of a certain layer is greater than twice the average value, it is considered that the layer has a main horizontal plane and is removed. Step 2: Set the farthest distance from a point to a line, the radius of the nearest neighbor search during clustering, the minimum number of points contained in a qualified line segment, and the shortest length of a qualified line segment as extraction requirements, respectively from... and Extract the two-dimensional point cloud line segments that meet the extraction requirements to form a two-dimensional point cloud line segment set. and ,right and The point cloud segments are arranged in descending order of length; Step 3, obtain the qualified intersection points, attached virtual points, and included angles of the 2D point cloud line segment set: For First, calculate the longest point cloud line segment. The line containing and any point in the cloud segment The angle formed by the line If 10°≤ If the angle is ≤170°, the intersection point is considered acceptable. Calculate the intersection point of the two lines and two associated virtual points, and compare them. Let the intersection point of the two intersecting lines be... ( , Let the distance from the intersection point on the straight line be . A virtual point is If (x, y), then the following relationship exists: (3-1) Substituting the first term in equation (3-1) into the second term, we can find the value of x: (3-2) in, For each straight line, two virtual points are calculated. Then, for each straight line, the distance from each virtual point to the next virtual point is calculated. distance and Distance on each straight line The nearest virtual point is the virtual point attached to the required qualified intersection point. Let be the centroid of the two intersecting point cloud segments; Once two line segments have been compared, they are marked to avoid repeated comparisons. This process is repeated for any two line segments to determine the result. All qualified intersections form an intersection set. Each valid intersection point is accompanied by two virtual points. The angles between each valid intersection point and its two virtual points are calculated to form an angle set. ; Using the aforementioned Using the same method, obtain intersection gather Each qualified intersection point is accompanied by two virtual points and the corresponding set of included angles. ; Step 4, Compare any angle and any angle difference , 1≤α≤ , for The number of subsets, 1 ≤ ≤ , for The number of qualified intersections, if If the angle is less than 1°, then the corresponding pair of intersection points and their respective attached virtual points are considered to be points of the same name, and the corresponding relationship between the points of the same name is the first type. and , and , and Or the second type and , and , and Two combination forms are considered; for each of these two combinations of corresponding points, the transformation parameters corresponding to each combination of corresponding points are solved: the rotation matrix. Translation vector and the transformation matrix between the two coordinate systems ; Step 5, set the counter The corresponding first form is and , and , and Given a combination of points with the same name, use the transformation matrix of that combination of points. Will Unified to In the coordinate system in which it is located, next, for Each intersection point is from Find the nearest one that belongs to intersection And calculate the distance between these two points. ,once <Length threshold Then the two points are considered as a pair of intersection points with the same name. As a qualified interior point, and the counter is set... The number of interior points increases by 1, and the process is repeated after traversing the entire system. A counter is obtained after each intersection point. The cumulative number of all interior points and the corresponding pairs of intersections for each qualified interior point; following this method, a counter for the second type of intersection combinations is obtained. The cumulative value of the number of all qualified interior points and the corresponding intersection pairs with the same name for each qualified interior point; from and The system identifies the corresponding intersection pairs that satisfy the condition of having the largest cumulative number of interior points or exceeding a certain threshold. These are then used for registration. If multiple pairs of corresponding intersection pairs meet the registration conditions, singular value decomposition is used to solve for the transformation parameters for overall registration. The obtained rotation matrix and translation vector are then used to... and Align the two point clouds on the XY plane, and then calculate the translation of the two point clouds along the Z-axis. , and After alignment in the XY plane and translation in the Z direction, the final registration result is obtained; In step 4, at least three pairs of intersection points that may be points with the same name are obtained, along with their respective virtual points; each pair of intersection points and its respective virtual points correspond to two combination forms, and the corresponding two sets of transformation parameters are solved. In step 5, for each pair of intersection points obtained in step 4, two sets of transformation parameters are used to obtain counters for the combinations of corresponding points in two different forms. The sub-counter corresponding to the k-th group of identical point combinations in the first type of identical point combination is denoted as element. ,1≤ ≤ , Let be the number of all combinations of identical vertices contained in the first form; the second form uses the same method; then from all and Find the element with the largest cumulative number of interior points or that exceeds a certain threshold, and use the corresponding corresponding intersection point pairs as the matching intersection point pairs to perform registration.
2. The method for automatic registration of building point clouds based on two-dimensional projection line segments according to claim 1, characterized in that: in, In step 4, the method for solving the transformation parameters is as follows: For the first type of combination of corresponding points... and , and , and First, calculate the rotation matrix. : (4-1) In the formula, = , = , =1, 2; Then the translation vector for: (4-2) Transformation matrix between two coordinate systems for: (4-3) Using the same method as above, the transformation parameters of the second type of combination of corresponding points are solved.
3. The method for automatic registration of building point clouds based on two-dimensional projection line segments according to claim 2, characterized in that: in, In step 5, when there are multiple pairs of corresponding intersection points that meet the registration conditions, the coordinate transformation relationship is solved. Let... and They are respectively and For the u-th pair of intersection points with the same name, with rotation matrix R and translation vector T, we have: (5-1) make and The centers of mass are respectively and ,Will and Centralization includes: (5-2) The total error equation during coordinate transformation is: (5-3) In the formula, n is the number of pairs of points with the same name; The total error equation after centering is: (5-4) when The minimum value corresponds to the desired rotation matrix R and translation vector T. Make appropriate transformations: (5-5) Therefore, to find The minimum value is equivalent to finding The maximum value, for: (5-6) in, Performing singular value decomposition on H, we have: (5-7) The rotation matrix R can then be expressed as: (5-8) After calculating the value of the rotation matrix R, the translation vector T can be obtained from equation (4-2): (5-9) Transformation matrix between two coordinate systems for: (5-10) Using the obtained rotation parameters and Align the two point clouds on the XY plane, and then calculate the translation of the two point clouds along the Z-axis. .
4. The method for automatic registration of building point clouds based on two-dimensional projection line segments according to claim 1, Its features are: Among them, translation amount The average elevation of the two flat points on the ground was calculated. and ,Will and The difference as Alternatively, the difference in elevation measured by the scanner's built-in GPS can be used as... .
5. The method for automatic registration of building point clouds based on two-dimensional projection line segments according to claim 1, characterized in that: in, In step 5, when performing overall registration using multiple sets of corresponding intersection point pairs that meet the registration conditions, corresponding intersection point pairs are first selected evenly in the survey area, and then the transformation parameters are obtained from the selected corresponding intersection point pairs using singular value decomposition.
6. The method for automatic registration of building point clouds based on two-dimensional projection line segments according to claim 1, characterized in that: in, In step 5, registration is performed based on the corresponding intersection pairs of the counter with the most interior points. If there are multiple counters with the most interior points, one is randomly selected.
7. The method for automatic registration of building point clouds based on two-dimensional projection line segments according to claim 1, characterized in that: in, In step 5, Take 0.01m.