Automatic vector mapping method based on indoor three-dimensional point cloud, storage medium and equipment
By transforming the coordinate system using RNASAC and PCA algorithms and combining them with the Hough transform method, indoor 3D point cloud data is processed automatically, solving the problem of low efficiency in traditional mapping and achieving efficient and accurate vector mapping, which is suitable for indoor surveying and digital twins.
Patent Information
- Application Number
- CN202411851970.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-12-16
AI Technical Summary
Traditional indoor mapping methods are inefficient, and manual processing of indoor 3D point cloud data is time-consuming and error-prone. Existing automated mapping methods are difficult to match the data acquisition speed.
The RNASAC algorithm is used to obtain the best-fit plane and lateral surface, which are then transformed to an auxiliary coordinate system. Combined with PCA analysis and Hough transform, point cloud data is layered, denoised, segmented, classified, and line drawn to achieve automatic vector mapping.
It improves the accuracy of floor level division, ensures the precision and aesthetics of vector lines, is suitable for indoor surveying, and provides a digital twin data foundation for complex indoor spaces.
Smart Images

Figure CN119478250A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an automatic vector mapping method based on indoor three-dimensional point cloud, a storage medium and a device. Background Art
[0002] Traditional indoor mapping methods mainly rely on manual measurement and drawing. The measurement process is time-consuming and laborious. For complex indoor spaces, it is necessary to measure different parts multiple times to ensure the accuracy of the data, and then manually draw according to the measured data. The whole process is inefficient. With the rapid development of 3D laser scanning technology, the acquisition of indoor point cloud data has become more efficient and accurate. Mapping based on these point cloud data can greatly shorten the time of field engineering measurement. However, the existing automated mapping methods are difficult to match the existing data acquisition speed, and many mapping methods based on indoor point cloud data still require manual drawing.
[0003] Since indoor 3D point cloud data contains a large number of points, manual drawing requires manual analysis and processing of these points one by one, such as identifying the boundaries of walls, doors, windows and other partitions. For a complex indoor scene, it may contain millions of points. It still takes a lot of time to manually process these data to draw a floor plan. In addition, in the manual drawing process, if there is a large amount of data to be processed, it is very easy to be affected by factors such as visual fatigue and lack of concentration during the long point cloud data processing process, resulting in data drawing errors, and it is also very cumbersome to modify. Therefore, there is an urgent need for an automatic mapping method. Summary of the invention
[0004] In view of the above problems, the present invention provides an automatic vector mapping method, storage medium and device based on indoor three-dimensional point cloud, which can efficiently draw accurate and beautiful vector linear shapes according to original data, and is particularly suitable for indoor surveying and mapping.
[0005] In order to achieve the above technical objectives and the above technical effects, the present invention is implemented through the following technical solutions:
[0006] An automatic vector mapping method based on indoor three-dimensional point cloud comprises the following steps:
[0007] Step 1, obtain the original point cloud data inside the corresponding building, and obtain the best fitting plane and two best fitting sides of the original point cloud data based on the RNASAC algorithm, convert the original building point cloud data into an auxiliary coordinate system based on the plane normal vector of the best fitting plane and the side normal vectors of the two best fitting sides, and stratify the floors;
[0008] Step 2: Data denoising and partition type classification;
[0009] Step 3: Based on the PCA analysis method, the normal vector of the point cloud is estimated to achieve bidirectional partition separation, and each partition point cloud is divided into horizontal and vertical directions at 45°;
[0010] Step 4: Draw lines;
[0011] Step 5: Perform linear correction;
[0012] Step 6: Perform coordinate correction to obtain a vector diagram.
[0013] Preferably, obtaining the best fitting plane and two best fitting sides of the original point cloud data based on the RNASAC algorithm specifically includes the following steps:
[0014] Step A01: For the original n point cloud data of the interior of the building, a normal vector of a target plane is set, and the original point cloud data is iteratively processed using the RANSAC algorithm to obtain a fitting surface point cloud that matches the target normal vector within the angle and distance error range. The plane equation obtained by fitting is set to formula (1):
[0015] ax+by+cz+d=0(1)
[0016] The constraint condition is a 2 +b 2 +c 2 =1, the average coordinates of all points are And satisfy formula (2):
[0017]
[0018] Subtracting formula (1) from formula (2) yields formula (3):
[0019]
[0020] Then formula (3) is the best fitting plane, and the corresponding plane normal vector is (a, b, c);
[0021] Step A02, repeat the above formulas (1)-(3) to obtain the first best fitting side corresponding to the left or right side of the building interior and its corresponding first side normal vector, as well as the second best fitting side corresponding to the front or back of the building interior and its corresponding second side normal vector.
[0022] Preferably, converting the original building point cloud data into an auxiliary coordinate system based on the plane normal vector of the best fitting plane and the side normal vectors of the two best fitting sides specifically includes the following steps:
[0023] Step B01, calculate the rotation angle θ between the plane or side normal vector and the target normal vector, and set the plane or side normal vector to The target normal vector is but:
[0024]
[0025] In the formula,
[0026] Step B02, calculate the rotation axis between the plane or side normal vector and the target normal vector:
[0027]
[0028] In the formula, is the rotation axis coordinate;
[0029] Step B03, calculate the rotation matrix R according to the rotation angle and the rotation axis:
[0030]
[0031] Where R is the rotation matrix and I is the identity matrix;
[0032] Step B04: For any point P(u, v, w) in the original point cloud data, the rotated point P′(u′, v′, w′) is calculated by formula (7):
[0033]
[0034] Preferably, stratifying the floors specifically comprises the following steps:
[0035] Step C01, performing rounding processing on the rotated point cloud elevation coordinates, and counting each corresponding elevation change interval;
[0036] Step C02, using the SG filter to perform denoising on the statistically obtained elevation data;
[0037] Step C03, using a five-point cubic fitting method to perform fitting optimization on the statistical linear shape;
[0038] Step C04: extract the maximum value of the elevation information area, pair the floor maximum value and the ceiling maximum value of the same floor, and increase the floor maximum value to obtain the minimum elevation value Z of the split floor. min , reduce the maximum value of the ceiling to obtain the maximum elevation Z of the split floor max ;
[0039] Step C05: Layer the floors, and the elevation interval of each floor is Z min -Z max .
[0040] Preferably, step 2 specifically comprises the following steps:
[0041] Step D01: After obtaining the target floor point cloud data, project the part of the floor point cloud data onto the best fitting plane, obtain the density of each point in the point cloud data by the neighboring point search method, and remove the point cloud with a point cloud density less than a set threshold;
[0042] Step D02: extract the main partitions of each floor;
[0043] Step D03: Slice the floor point cloud data, and calculate the interval between each slice as shown in formula (8):
[0044]
[0045] Where ΔZ is the interval between slices, D is the set slice thickness, and ψ is the set number of slices;
[0046] Step D04: Calculate the selected range of each slice elevation as shown in formula (9):
[0047] Zmin+(i-1)*(ΔZ+D)≤Di≤Zmin+(i-1)*ΔZ+i*D(9)
[0048] Where D i is the elevation selection range of the i-th slice. The data of each slice is projected onto the best fitting plane respectively. According to the projected point cloud obtained in step D01, a neighboring point search operation is performed for the projected point cloud of each slice. If there are some point clouds that cannot find neighboring points on a specific slice, it is determined that the slice has a vacancy in this part of the area.
[0049] Step D05: classify the partitions based on the characteristics of the space partitions.
[0050] Preferably, step 3 specifically comprises the following steps:
[0051] Step E01, estimating the normal vector of each partition type point cloud by using a local surface fitting method;
[0052] Step E02: find the corresponding m neighboring points by establishing a KD-Tree, construct an m*3 matrix through the coordinates of these m points, and calculate the covariance matrix of the matrix. The process is shown in formula (10):
[0053]
[0054] Where Cov(X) is the covariance matrix of the constructed matrix, m is the number of neighboring points to be searched, and μ x is the average value of each dimension;
[0055] Step E03: Obtain the eigenvalue and its corresponding eigenvector according to the eigenvalue definition. The calculation process is shown in formula (11):
[0056]
[0057] In the formula, λ represents the eigenvalue, and x represents the eigenvector;
[0058] Step E04, obtain the corresponding normal vectors of each type of partition point cloud, and divide each partition point cloud into horizontal and vertical directions according to 45° by solving the angle between the normal vector of each point and the best fitting side normal vector.
[0059] Preferably, step 4 specifically comprises the following steps:
[0060] Step F01, using the European clustering method based on KD-Tree to divide the point cloud data after classification and orientation into point cloud clusters;
[0061] Step F02: transform the coordinates of each cluster point data into Hough space. The coordinate transformation is shown in formula (12):
[0062] r=x cos τ+y sin τ (12)
[0063] Where x, y are the horizontal and vertical coordinates of the point cloud in the cluster that need to be converted to the Hough space, τ is the angle of 1° in the range of 1 to 180°, and r is the Hough coordinate corresponding to different τ in the Hough space;
[0064] Step F03, rounding the corresponding coordinates to two decimal places, counting and sorting the points with the same τ and Hough coordinates, and selecting the point set that meets the set quantity requirement to obtain the points for subsequent linear drawing;
[0065] Step F04, using the least square method to fit the slope of the straight line, and finally obtaining the corresponding straight line;
[0066] Step F05: perform linear intersection and merging.
[0067] Preferably, the coordinate inverse calculation formula in step 6 is as shown in formula (13). For any point The points after backcalculation for:
[0068]
[0069] In the formula, R -1 It is the inverse matrix of the rotation matrix. When you need to draw a two-dimensional vector graph, the Z-axis coordinate is set to 0.
[0070] Correspondingly, a computer-readable storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement any one of the automatic vector mapping methods based on indoor three-dimensional point clouds described above.
[0071] Correspondingly, a computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement any one of the automatic vector mapping methods based on indoor three-dimensional point clouds described above.
[0072] The beneficial effects of the present invention are:
[0073] First, by converting the original coordinates into an auxiliary coordinate system, the present invention can effectively separate the elevation results, significantly reduce the elevation fuzzy area, and thus improve the accuracy of floor stratification. In addition, the Hough transform method for point cloud data proposed in the present invention is not limited by graphic pixels, and can fully process and analyze the target point cloud data, effectively preventing the omission of linear information.
[0074] Second, the vector image drawn by the present invention can accurately express the range and separation information of the target point cloud area, and the line shape drawn by this method is completely based on the original point cloud data, ensuring the accuracy and reliability of the data. It can efficiently and automatically draw accurate and beautiful vector line shapes based on the original data, which is particularly suitable for the field of indoor surveying and mapping, and provides a solid data foundation for the digital twin of complex indoor spaces. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 It is a flow chart of an automatic vector mapping method based on indoor three-dimensional point cloud of the present invention;
[0076] Figure 2 It is a schematic diagram of point cloud elevation comparison after conversion to a rotating coordinate system of the present invention;
[0077] Figure 3 This is a result diagram of line shape recognition based on the point cloud by Hough transform of the present invention;
[0078] Figure 4 Schematic diagram of the Hough space voting matrix of the present invention;
[0079] Figure 5 It is the anisotropic linear drawing result diagram of the present invention;
[0080] Figure 6 It is a schematic diagram of linear intersection identification of the present invention;
[0081] Figure 7 This is the final vectorized result diagram of the present invention. DETAILED DESCRIPTION
[0082] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0083] An automatic vector mapping method based on indoor 3D point cloud, such as Figure 1 As shown, the following steps are included:
[0084] Step 1: First, obtain the original point cloud data of the corresponding building, and obtain the best fitting plane and two best fitting sides of the original point cloud data based on the RNASAC algorithm (RANdom SAmple Consensus). Since the interior of the building is mostly a symmetrical structure, it is only necessary to fit the distribution of three sides, where the bottom or top surface is fitted into a plane, the left side or right side is fitted into a side, and the front or back is fitted into a side. Preferably, the steps include the following:
[0085] Step A01: For the original n point cloud data of the interior of the building, a normal vector of a target plane is set, and the original point cloud data is iteratively processed using the RANSAC algorithm to obtain a fitting surface point cloud that matches the target normal vector within the angle and distance error range. The plane equation obtained by fitting is set to formula (1):
[0086] ax+by+cz+d=0(1)
[0087] The constraint condition is a 2 +b 2 +c 2 =1, the average coordinates of all points are And satisfy formula (2):
[0088]
[0089] Subtracting formula (1) from formula (2) yields formula (3):
[0090]
[0091] Then formula (3) is the best fitting plane, and the corresponding plane normal vector is (a, b, c);
[0092] Step A02, repeat the above formulas (1)-(3) to obtain the first best fitting side corresponding to the left or right side of the building interior and its corresponding first side normal vector, as well as the second best fitting side corresponding to the front or back of the building interior and its corresponding second side normal vector.
[0093] Secondly, the original building point cloud data is converted into an auxiliary coordinate system based on the plane normal vector of the best fitting plane and the side normal vectors of the two best fitting sides. By constructing the auxiliary coordinate system, the original building point cloud data is rotated and transformed so that its contour can be accurately aligned with the coordinate axis of the auxiliary coordinate system, and the spatial orientation of the point cloud data is standardized. Preferably, the method specifically includes the following steps:
[0094] Step B01, calculate the rotation angle θ between the plane or side normal vector and the target normal vector, and set the plane or side normal vector to The target normal vector is but:
[0095]
[0096] In the formula,
[0097] For the best fit plane, its target normal vector is (0,0,1), for the first best fit side, its target normal vector is (1,0,0), and for the second best fit side, its target normal vector is (0,1,0).
[0098] Step B02, calculate the rotation axis between the plane or side normal vector and the target normal vector:
[0099]
[0100] In the formula, is the rotation axis coordinate;
[0101] Step B03, calculate the rotation matrix R according to the rotation angle and the rotation axis:
[0102]
[0103] Where R is the rotation matrix and I is the identity matrix;
[0104] Step B04: For any point P(u, v, w) in the original point cloud data, the rotated point P′(u′, v′, w′) is calculated by formula (7):
[0105]
[0106] Finally, the floors are layered based on the corrected point cloud elevation. The point cloud elevation comparison diagram after conversion to the rotated coordinate system by this method is shown in the figure below: Figure 2 As shown, it is possible to effectively separate the elevation results and significantly reduce the elevation fuzzy area, thereby improving the accuracy of floor stratification. Preferably, floor stratification specifically includes the following steps:
[0107] Step C01, after completing the rotation correction operation of the corresponding coordinates, perform rounding processing on the rotated point cloud elevation coordinates, and count each corresponding elevation change interval;
[0108] Step C02, using the SG filter to perform denoising on the statistically obtained elevation data;
[0109] Step C03, using a five-point cubic fitting method (taking five adjacent data points, a cubic curve can be fitted, and then the data values at the corresponding positions on the cubic curve are used as the filtered result) to perform fitting optimization on the statistical line shape, so as to avoid noise glitches;
[0110] Step C04, after completing the optimization of the elevation signal, start to count the maximum values of the elevation information area. The regional maximum value mentioned here is actually the floor segmentation surface of the building point cloud. Extract the maximum value of the elevation information area. Since the rounding interval is completed by rounding, after obtaining the maximum value of the corresponding area, it is necessary to pair the floor maximum value and the ceiling maximum value of the same floor, and increase the floor maximum value to obtain the minimum elevation value Z of the segmented floor. min , reduce the maximum value of the ceiling to obtain the maximum elevation Z of the split floor max ;
[0111] For example, for the maximum value of the lower elevation area, that is, the floor maximum value, increase ω; and for the maximum value of the higher elevation area, that is, the ceiling maximum value, reduce ω accordingly. For example, in a pair of maximum values, if the lower elevation maximum value is 12.1m and the higher elevation maximum value is 13.4m, and the decimal point is rounded to one decimal place, then ω can be taken as 0.05 with two decimal places (if the decimal point is rounded to two decimal places, then ω can be taken as 0.005 with three decimal places, and so on). Then when the floors are stratified, Z min =12.1+0.05=12.15, Z max =13.4-0.05=13.35.
[0112] Step C05: Layer the floors, and the elevation interval of each floor is Z min -Z max , corresponding to the above example, the elevation range of this floor is 12.15m to 13.35m.
[0113] Step 2: Data denoising and partition type classification. Preferably, step 2 specifically includes the following steps:
[0114] Step D01, after completing the division and separation of each floor, since there are some non-partition furniture on the building floor, it is necessary to remove this part of the point cloud data. After obtaining the point cloud data of the target floor, project the point cloud data of this part of the floor to the best fitting plane, and obtain the density of each point in the point cloud data through the neighboring point search method. The point cloud with a point cloud density less than the set threshold is removed. This part of the point cloud is the point cloud of non-partition furniture;
[0115] Step D02: extract the main partitions of each floor;
[0116] Step D03: Slice the floor point cloud data, and calculate the interval between each slice as shown in formula (8):
[0117]
[0118] Where ΔZ is the interval between slices, D is the set slice thickness, and ψ is the set number of slices;
[0119] Step D04: Calculate the selected range of each slice elevation as shown in formula (9):
[0120] Zmin+(i-1)*(ΔZ+D)≤Di≤Zmin+(i-1)*ΔZ+i*D(9)
[0121] Where D i is the elevation selection range of the i-th slice, and the data of each slice is projected to the best fitting plane respectively, and the neighboring point search operation is performed for the projected point cloud of each slice according to the projected point cloud obtained in step D01. If there are some point clouds that cannot find neighboring points on a specific slice, it is determined that the slice has a vacancy in this part of the area;
[0122] Step D05, classify the partitions based on the characteristics of the spatial partitions. For the main wall structures inside the building, for example, the characteristics of spatial partitions such as walls, windows, doors, and partitions are analyzed and classified. For example, doors may have point cloud gaps in a certain number of slices on the bottom layer and above, windows usually have point cloud gaps in the middle slices, and walls should not have point cloud gaps. However, in view of the fact that there may be a certain degree of occlusion during the data collection process, it is allowed that some areas of a small number of slices have point cloud gaps. For partitions, they usually show point cloud gaps in the upper slices.
[0123] Step 3: First, based on the PCA analysis method (principal component analysis method), the point cloud normal vector is estimated to achieve bidirectional partition separation. Finally, each partition point cloud is divided into horizontal and vertical directions at 45°. Preferably, the method specifically includes the following steps:
[0124] Step E01, after classifying the partition types of the point cloud, a large number of irrelevant point clouds are removed, and at this time, the normal vector of each partition type point cloud is estimated by a local surface fitting method;
[0125] Step E02: find the corresponding m neighboring points by establishing a KD-Tree, construct an m*3 matrix through the coordinates of these m points, and calculate the covariance matrix of the matrix. The process is shown in formula (10):
[0126]
[0127] Where Cov(X) is the covariance matrix of the constructed matrix, m is the number of neighboring points to be searched, and μ x is the average value of each dimension;
[0128] Step E03: Obtain the eigenvalue and its corresponding eigenvector according to the eigenvalue definition. The calculation process is shown in formula (11):
[0129]
[0130] In the formula, λ represents the eigenvalue, and x represents the eigenvector;
[0131] Step E04: From the principal component analysis (PCA), we know that the local surface constructed when selecting neighboring points is roughly flat. Therefore, the direction of the point cloud normal is the eigenvector corresponding to the minimum eigenvalue. The corresponding normal vectors of various partition point clouds are obtained. By solving the angle between the normal vector of each point and the best fitting side normal vector, each partition point cloud is divided into horizontal and vertical directions according to 45°. For example, taking the X-axis and Y-axis coordinate system as an example, a straight line with an angle of 45° is drawn on the X-axis and Y-axis. When the partition point cloud falls between the straight line and the X-axis, it is horizontal; when the partition point cloud falls between the straight line and the Y-axis, it is vertical.
[0132] Step 4: perform linear drawing. Preferably, step 4 specifically includes the following steps:
[0133] Step F01, using the European clustering method based on KD-Tree to divide the point cloud data after classification and orientation into point cloud clusters;
[0134] Step F02: Compared with the traditional Hough transform used for line recognition in an image, the present invention proposes a Hough transform method applied to point cloud data. Specifically, the coordinates of each cluster point data are transformed into the Hough space. The coordinate transformation is shown in formula (12):
[0135] r=x cos τ+y sin τ (12)
[0136] In the formula, x and y are the horizontal and vertical coordinates of the point cloud that needs to be converted to the Hough space in the cluster point, τ is the angle of 1° in the range of 1 to 180°, and r is the Hough coordinate corresponding to different τ in the Hough space. The Hough transform line shape recognition result based on the point cloud is shown in the figure below: Figure 3 As shown;
[0137] Step F03, after solving the Hough coordinates of all points in the cluster, the corresponding coordinates are rounded to two decimal places, and the points with the same τ and Hough coordinates are counted and sorted (i.e., intersection matrix voting, such as Figure 4As shown), these points are point sets with linear relationships, and point sets that meet the set quantity requirements are selected to obtain points for subsequent linear drawing;
[0138] Step F04: Since these points are obtained only according to the 1° angle error, the linear slope obtained cannot meet the actual application requirements. Therefore, after extracting the corresponding cluster points, the ployfit function provided in MATLAB is used to fit the linear slope of the obtained point cloud using the least squares method, and finally the corresponding straight line is obtained, such as Figure 5 As shown;
[0139] Step F05: perform linear intersection and merging.
[0140] Line merging is mainly divided into same-direction merging and different-direction intersection. First, the point cloud lines obtained by the above processing are searched to find out whether there are similar distances and small angle differences in the same-direction lines. If so, the two related point clouds of the lines are clustered and merged, and then the line drawing method in step 4 is used to merge the merged clusters again. For different-direction lines, the two farthest points are found in each line cluster. Since the cluster points are distributed in a straight line shape, the two farthest points are the line endpoints. The horizontal endpoints are searched one by one to find out whether there are longitudinal endpoints with a smaller distance. If so, the corresponding horizontal and longitudinal lines are extended to intersect at the same endpoint, such as Figure 6 shown.
[0141] Step 5: Perform linear correction. After all endpoints are merged, some linear shapes may not be intersected due to occlusion or other factors during the point cloud data collection process. The search threshold for these endpoints is gradually increased to make them intersect with similar linear shapes.
[0142] Step 6: Correct the coordinates to obtain the vector map. After the vectorization is completed, since the vector map is based on the auxiliary coordinate system, it is necessary to inversely calculate the coordinates to obtain the vector map corresponding to the original data. Preferably, the coordinate inverse calculation formula in step 6 is as shown in formula (13). For any point The points after backcalculation for:
[0143]
[0144] In the formula, R -1 is the inverse matrix of the rotation matrix. If you need to draw a two-dimensional vector graph, you only need to set the Z-axis coordinate to 0 to achieve the coordinate inverse calculation of the corresponding two-dimensional image, such as Figure 7 shown.
[0145] Correspondingly, a computer-readable storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement any one of the automatic vector mapping methods based on indoor three-dimensional point clouds described above.
[0146] Correspondingly, a computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement any one of the automatic vector mapping methods based on indoor three-dimensional point clouds described above.
[0147] The beneficial effects of the present invention are:
[0148] First, by converting the original coordinates into an auxiliary coordinate system, the present invention can effectively separate the elevation results, significantly reduce the elevation fuzzy area, and thus improve the accuracy of floor stratification. In addition, the Hough transform method for point cloud data proposed in the present invention is not limited by graphic pixels, and can fully process and analyze the target point cloud data, effectively preventing the omission of linear information.
[0149] Second, the vector image drawn by the present invention can accurately express the range and separation information of the target point cloud area, and the line shape drawn by this method is completely based on the original point cloud data, ensuring the accuracy and reliability of the data. It can efficiently and automatically draw accurate and beautiful vector line shapes based on the original data, which is particularly suitable for the field of indoor surveying and mapping, and provides a solid data foundation for the digital twin of complex indoor spaces.
[0150] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. An automatic vector mapping method based on indoor three-dimensional point cloud, characterized in that: The steps include: Step 1, obtain the original point cloud data inside the corresponding building, and obtain the best fitting plane and two best fitting sides of the original point cloud data based on the RNASAC algorithm, convert the original building point cloud data into an auxiliary coordinate system based on the plane normal vector of the best fitting plane and the side normal vectors of the two best fitting sides, and stratify the floors; Step 2: Data denoising and partition type classification; Step 3: Based on the PCA analysis method, the normal vector of the point cloud is estimated to achieve bidirectional partition separation, and each partition point cloud is divided into horizontal and vertical directions at 45°; Step 4: Draw lines; Step 5: Perform linear correction; Step 6: Perform coordinate correction to obtain a vector diagram.
2. The automatic vector mapping method based on indoor three-dimensional point cloud according to claim 1, characterized in that: The steps of obtaining the best fitting plane and two best fitting sides of the original point cloud data based on the RNASAC algorithm are as follows: Step A01: For the original n point cloud data of the interior of the building, a normal vector of a target plane is set, and the original point cloud data is iteratively processed using the RANSAC algorithm to obtain a fitting surface point cloud that matches the target normal vector within the angle and distance error range. The plane equation obtained by fitting is set to formula (1): ax+by+cz+d=0(1) where the constraint is a 2 +b 2 +c 2 =1, the average coordinates of all points are And satisfy formula (2): Subtracting formula (1) from formula (2) yields formula (3): Then formula (3) is the best fitting plane, and the corresponding plane normal vector is (a, b, c); Step A02, repeat the above formulas (1)-(3) to obtain the first best fitting side corresponding to the left or right side of the building interior and its corresponding first side normal vector, as well as the second best fitting side corresponding to the front or back of the building interior and its corresponding second side normal vector.
3. The automatic vector mapping method based on indoor three-dimensional point cloud according to claim 2, characterized in that: The conversion of the original building point cloud data into an auxiliary coordinate system based on the plane normal vector of the best fitting plane and the side normal vectors of the two best fitting sides specifically includes the following steps: Step B01, calculate the rotation angle θ between the plane or side normal vector and the target normal vector, and set the plane or side normal vector to The target normal vector is but: In the formula, Step B02, calculate the rotation axis between the plane or side normal vector and the target normal vector: In the formula, is the rotation axis coordinate; Step B03, calculate the rotation matrix R according to the rotation angle and the rotation axis: Where R is the rotation matrix and I is the identity matrix; Step B04: For any point P(u, v, w) in the original point cloud data, the rotated point P′(u′, v′, w′) is calculated by formula (7):
4. The automatic vector mapping method based on indoor three-dimensional point cloud according to claim 3 is characterized in that: The specific steps of layering floors are as follows: Step C01, performing rounding processing on the rotated point cloud elevation coordinates, and counting each corresponding elevation change interval; Step C02, using the SG filter to perform denoising on the statistically obtained elevation data; Step C03, using a five-point cubic fitting method to perform fitting optimization on the statistical linear shape; Step C04: extract the maximum value of the elevation information area, pair the floor maximum value and the ceiling maximum value of the same floor, and increase the floor maximum value to obtain the minimum elevation value Z of the split floor. min , reduce the maximum value of the ceiling to obtain the maximum elevation Z of the split floor max ; Step C05: Layer the floors, and the elevation interval of each floor is Z min -Z max .
5. The automatic vector mapping method based on indoor three-dimensional point cloud according to claim 4, characterized in that: Step 2 specifically includes the following steps: Step D01: After obtaining the target floor point cloud data, project the part of the floor point cloud data onto the best fitting plane, obtain the density of each point in the point cloud data by the neighboring point search method, and remove the point cloud with a point cloud density less than a set threshold; Step D02: extract the main partitions of each floor; Step D03: Slice the floor point cloud data, and calculate the interval between each slice as shown in formula (8): Where ΔZ is the interval between slices, D is the set slice thickness, and ψ is the set number of slices; Step D04: Calculate the selected range of each slice elevation as shown in formula (9): Zmin+(i-1)*(ΔZ+D)≤Di≤Zmin+(i-1)*ΔZ+i*D(9) where, D i is the elevation selection range of the i-th slice. The data of each slice is projected onto the best fitting plane respectively. According to the projected point cloud obtained in step D01, a neighboring point search operation is performed for the projected point cloud of each slice. If there are some point clouds that cannot find neighboring points on a specific slice, it is determined that the slice has a vacancy in this part of the area. Step D05: classify the partitions based on the characteristics of the space partitions.
6. The automatic vector mapping method based on indoor three-dimensional point cloud according to claim 5, characterized in that: Step 3 specifically includes the following steps: Step E01, estimating the normal vector of each partition type point cloud by using a local surface fitting method; Step E02: find the corresponding m neighboring points by establishing a KD-Tree, construct an m*3 matrix through the coordinates of these m points, and calculate the covariance matrix of the matrix. The process is shown in formula (10): Where Cov(X) is the covariance matrix of the constructed matrix, m is the number of neighboring points to be searched, and μ x is the average value of each dimension; Step E03: Obtain the eigenvalue and its corresponding eigenvector according to the eigenvalue definition. The calculation process is shown in formula (11): In the formula, λ represents the eigenvalue, and x represents the eigenvector; Step E04, obtain the corresponding normal vectors of each type of partition point cloud, and divide each partition point cloud into horizontal and vertical directions according to 45° by solving the angle between the normal vector of each point and the best fitting side normal vector.
7. The automatic vector mapping method based on indoor three-dimensional point cloud according to claim 6, characterized in that: Step 4 specifically includes the following steps: Step F01, using the European clustering method based on KD-Tree to divide the point cloud data after classification and orientation into point cloud clusters; Step F02: transform the coordinates of each cluster point data into Hough space. The coordinate transformation is shown in formula (12): r=xcosτ+ysinτ (12) Where x, y are the horizontal and vertical coordinates of the point cloud in the cluster that need to be converted to the Hough space, τ is the angle of 1° in the range of 1 to 180°, and r is the Hough coordinate corresponding to different τ in the Hough space; Step F03, rounding the corresponding coordinates to two decimal places, counting and sorting the points with the same τ and Hough coordinates, and selecting the point set that meets the set quantity requirement to obtain the points for subsequent linear drawing; Step F04, using the least square method to fit the slope of the straight line, and finally obtaining the corresponding straight line; Step F05: perform linear intersection and merging.
8. The automatic vector mapping method based on indoor three-dimensional point cloud according to claim 7, characterized in that: The coordinate inverse solution formula in step 6 is shown in formula (13). For any point The points after backcalculation for: In the formula, R -1 It is the inverse matrix of the rotation matrix. When you need to draw a two-dimensional vector graph, the Z-axis coordinate is set to 0.
9. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the automatic vector mapping method based on indoor three-dimensional point cloud as described in any one of claims 1-8.
10. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the automatic vector mapping method based on indoor three-dimensional point cloud as described in any one of claims 1-8.
Citation Information
Patent Citations
Multi-floor indoor structured three-dimensional modeling method and system based on laser point cloud
CN110189412A
Method, device and equipment for constructing wall contour based on point cloud data vectorization
CN118485772A
Indoor building structure extraction and vectorization reconstruction method and device based on laser radar data
CN118799496A
Road scene point cloud identification method and system suitable for inspection robot
CN118887641A