Wall structure analysis and reconstruction method for indoor point cloud scene
1. A wall structure analysis and reconstruction method for an indoor point cloud scene is characterized by comprising the following steps:
step 1, carrying out occlusion detection on an indoor scene, and determining an occlusion area on a wall in the scene;
step 2, extracting wall data in the shielding area obtained in the step 1, and dividing the wall structure according to local characteristics;
step 3, identifying the door of the wall data processed in the step 2;
and 4, determining the state of the door of the wall data processed in the step 3, and rebuilding.
2. The method for analyzing and reconstructing the wall structure of the indoor point cloud scene according to claim 1, wherein the step 1 specifically comprises:
step 1.1, setting the voxel size to be 10cm × 10cm × 10cm, representing an indoor scene by using three-dimensional voxels, then approximately displaying other points in the voxels by using the gravity centers of all points in the voxels in each voxel, namely, finally representing all points in the voxel by using one gravity center point, and finally processing all the voxels to obtain a point cloud scene after down sampling, wherein the point cloud scene is used as input data of the next stage;
step 1.2, determining a scanning position, a scanning radius and a scanning point, thereby constructing a scanning ray for detecting shielding, specifically:
step 1.2.1, determining a scanning position O according to the angle of an occlusion area and an object causing occlusion;
step 1.2.2, calculating the scanning radius RscanThe method specifically comprises the following steps:
Vol=LxLyLz (2)
wherein gamma is a scale factor; vol is the volume of the indoor scene; n is the number of points in the indoor scene; l isxIs indoorsThe length of the scene in the X-axis direction; l isyIs the length of the indoor scene in the Y-axis direction; l iszThe length of the indoor scene in the Z-axis direction;
step 1.2.3, determining the scanning point PscanThe method specifically comprises the following steps:
according to the scanning radius RscanDividing the wall in the point cloud data into a plurality of scanning areas with the length of LxHeight of LzThe wall of (1) dividing m × l scanning areas; length LyHeight of LzThe wall of (1), dividing n × L scanning areas, wherein m ═ ceil (L)x/(2×Rscan)),n=ceil(Ly/(2×Rscan)),l=ceil(Lz/(2×Rscan) Ceil (x) is an integer function, and then the center point of each scanning area is calculated, and the center point is a scanning point;
step 1.2.4, regarding the wall parallel to the XOZ, taking the Z-axis coordinate as a reference, and appointing the sequence for the scanning points from the minimum value of the X coordinate to the maximum value of the X coordinate, wherein the sequence is expressed as
For the wall parallel to YOZ, the scanning points are assigned with the sequence from the minimum value of the Y coordinate to the maximum value of the Y coordinate by taking the Z-axis coordinate as a reference, and the sequence is expressed as
Step 1.2.5, after the scanning position, the scanning radius and the scanning points are determined, a ray is emitted from the scanning position O to each scanning point, and therefore scanning light is constructed;
and step 1.3, determining a shielding area on the wall in the scene by using a ray tracing method according to the scanning ray constructed in the step 1.2.
3. The method for analyzing and reconstructing the wall structure of the indoor point cloud scene according to claim 2, wherein the step 1.3 specifically comprises:
step 1.31, obtaining the scanning points which are not searched according to the sequence specified in the step 1.2
Step 1.3.2, searching scanning points by applying KNN algorithmWhether a near neighbor point exists in the scanning radius, if so, indicating that the area is not an occlusion area, and skipping to the step 1.3.1, otherwise, indicating that the area may have occlusion, and skipping to the step 1.3.3;
step 1.3.3, determining a scanning position O and a scanning point according to a two-point three-dimensional linear equation (3)Substituting the formula (4) into the formula (3) to calculate a new scanning point (x, y, z), if the new scanning point is not between the scanning point and the scanning position, indicating that the area is not an occlusion area, and jumping to the step 1.3.1, otherwise, jumping to the step 1.3.4;
in the formula:to scan a spotThe coordinates of (a); (o)x,oy,oz) Is the coordinate of the scanning position O; rscanIs the scanning radius;
step 1.3.4, searching whether a scanning point has a near-neighbor point in a scanning radius by applying a KNN algorithm, if the near-neighbor point exists, indicating that the area is a shielding area, and skipping to step 1.3.1, otherwise skipping to step 1.3.3;
and 1.3.5, until all the scanning points are searched, determining all occlusion areas on the wall in the scene, and marking the hollow area caused by occlusion.
4. The method for analyzing and reconstructing the wall structure of the indoor point cloud scene according to claim 3, wherein the step 2 specifically comprises:
step 2.1, further processing the wall data in the indoor scene by taking the original point cloud scene data as input data;
step 2.2, performing characteristic calculation by using a principal component analysis method;
and 2.3, dividing the wall structure according to the local characteristics.
5. The method for analyzing and reconstructing the wall structure of the indoor point cloud scene according to claim 4, wherein the step 2.1 specifically comprises:
step 2.1.1, randomly selecting three points in the original point cloud scene data as local points, and fitting a plane;
step 2.1.2, setting a distance threshold, judging whether points in the distance threshold around the plane fitted in the step 2.1.1 are local points, if so, adding the points into the plane, and updating the plane;
step 2.1.3, repeatedly executing the operation of the step 2.1.2 on the updated plane until no local point is added into the plane, and outputting the plane if the local point number of the plane is greater than the local point number threshold value;
step 2.1.4, extracting the wall data from the plane output in step 2.1.3, specifically: first, the height H of the entire scanned scene is determinedwhole(ii) a Then, since the wall is a structure supporting the entire scene, its height is equal to the scene height HwholeSimilarly, the height of the door in the scene is generally 3/4, so the threshold H for extracting the height of the wall is set according to the prior knowledgewallIs (H)whole×3/4,Hwhole](ii) a And finally, filtering the planes according to the height threshold value, calculating the height of each plane, and if the height of each plane is within the range of the height threshold value, extracting the plane to obtain wall data.
6. The method for analyzing and reconstructing the wall structure of the indoor point cloud scene according to claim 5, wherein the step 2.2 specifically comprises:
step 2.2.1, establishing a KD-tree for organizing all points in the wall point cloud data extracted in step 2.1, then inquiring k adjacent points of each point p by using the KD-tree, and calculating a covariance matrix by using a formula (5):
in the formula: Σ is a covariance matrix of 3 × 3; piThe ith neighbor of point p;
step 2.2.2, solving a standard eigenvalue equation through singular value decomposition to obtain a normal vector of the point p, wherein the normal vector is a third eigenvector in the eigenvector V matrix and is recorded as npA normal vector representing point p;
λV=∑V (6)
in the formula: v is a feature vector matrix; lambda is an eigenvalue matrix;
step 2.2.3, in the matrix of λ, λ3Represents the curvature value of a point, and thus the curvature value of a point p is λ3And it is denoted as λp。
7. The method for analyzing and reconstructing the wall structure of the indoor point cloud scene according to claim 6, wherein the step 2.3 specifically comprises:
step 2.3.1, defining a plane marker for each point in the wall point cloud data, wherein the initial marker is 0, that is, Index is 0, which indicates that the point is not marked, and if Index is 1, it indicates that the point is marked;
step 2.2.2, a stack for storing points is created;
step 2.3.3, selecting a point with the minimum curvature as a seed point, marking the seed point as Index 1, and then storing the seed point in a stack;
step 2.3.4, if the stack is not empty, taking out the seed point at the top of the stack from the stack, calculating the neighbor point of the seed point, and judging the cosine value cos of the included angle between the seed point and the normal vector of the neighbor point;
step 2.3.5, if the 1-cos is less than 0.1, judging whether the curvature of the adjacent point is less than a set curvature threshold value, if so, determining that the adjacent point is a point in the same plane, and if not, marking the adjacent point as Index being 1 and pressing the Index into the stack; otherwise, jumping to step 2.3.4;
step 2.3.6, if the stack is empty, it represents that a plane has been successfully extracted, and deletes the marked points from the wall point cloud data, then repeats steps 2.3.3-2.3.5 for the remaining unmarked points until there are no unmarked points, and ends the plane segmentation of the wall;
step 2.3.7, after obtaining the different planes on the wall determined by the steps 2.3.1-2.3.6, determining the side length L of the unit grid for dividing the wall according to a formula (7);
in the formula: beta is a scale factor used for adjusting the side length of the small grid; s is the area of the wall; n is the total number of wall points;
step 2.3.8, calculating the number num of grids divided by the wall according to the formula (8)grid;
numgrid=numw×numh (8)
numw=lw/L (9)
numh=lh/L (10)
In the formula: numgridNumber of grids for walls; numwThe number of grids occupied by the wall width; numhThe number of grids occupied by the wall height; lwIs the width of the wall; lhIs the height of the wall.
Step 2.3.9, calculating the number grid of points in each gridnum;
Step 2.3.10, if gridnumIf yes, marking the grid as the shielding and displaying by blue, otherwise, marking the grid as the empty and displaying by red;
step 2.3.11, for gridnumThe grids which are not equal to 0 are represented by the RGB information of the middle points of the grids, the number of the grids is counted according to the RGB information of the grids, the grids are sorted in a descending mode, the grids with the largest number are marked as walls, and black display is carried out; if there is another color other than the wall and the number of such grids is within a given number range, the grid is marked as a candidate door, thereby achieving the division of the wall structure.
8. The method for analyzing and reconstructing the wall structure of the indoor point cloud scene according to claim 7, wherein the step 3 specifically comprises:
step 3.1, deleting the partition planes with the point number smaller than the quantity threshold value in the wall structure divided in the step 2, then analyzing the parallel relation between the rest wall partition planes and the XOZ coordinate axis, and for the plane parallel to the coordinate axis, extracting the plane corner points by applying an AABB bounding box; for a plane which is not parallel to the coordinate axes, extracting the angular points of the plane by applying an OBB bounding box;
step 3.2, calculating the volume V of each plane according to the corner point information of the bounding boxboxCalculating a plane for performing corner detection by using an AABB bounding box by using a formula (11), calculating a plane for performing corner detection by using an OBB bounding box by using a formula (12), and marking the plane with the largest volume as a wall;
Vbox=(max_AABBx-min_AABBx)×(max_AABBy-min_AABBy)×(max_AABBz-min_AABBx) (11)
Vbox=l1×l2×l1 (12)
in the formula: (max _ AABB)x,min_AABBx) Maximum and minimum values of AABB on the x-axis; (max _ AABB)y,min_AABBy) Maximum and minimum values of AABB on the y-axis; (max _ AABB)z,min_AABBz) Maximum and minimum values of AABB on the z-axis; l1,l2,l3Is the length of the three axes of the OBB;
step 3.3, calculating the height of each plane, wherein the height of the wall is recorded as lwallAnd the heights of the rest planes are respectively marked as l1,l2,…;
Step 3.4, analyzing the height ratio of each plane and the wall, and if the height of a certain plane is within the range of 3/4 of the height of the wall, that is to sayThe plane is marked as a door, otherwise the remaining objects, wherein,is the fluctuation range.
9. The method for analyzing and reconstructing the wall structure of the indoor point cloud scene according to claim 8, wherein the step 4 specifically comprises:
step 4.1, extracting the boundary by using the included angle between the normal vectors of the points in each plane determined in the step 3;
step 4.2, projecting the boundary points obtained in the step 4.1, and fitting straight lines to the projection points;
4.3, calculating an included angle formed by the door and the wall according to the straight line which is obtained by the step 4.2 and is fitted with each plane, and analyzing the state of the door;
and 4.4, performing up-sampling on the corner point information of each plane obtained in the step 3.1 according to the door state determined in the step 4.3, and fitting the planes to realize the reconstruction of the wall.
10. The method for analyzing and reconstructing the wall structure of the indoor point cloud scene according to claim 9, wherein the step 4.1 specifically comprises:
step 4.1.1, extracting the normal vectors of the points in each plane determined in the step 3 by using Principal Component Analysis (PCA);
step 4.1.2, assign each point piAnd its k neighbors Nj(j-0, 1, …, k-1) of the point set XiTo its normal vector niProjecting the vertical plane with the projection point set of X'i={(x′i,y′i,z′i) I |, 0,1, … t }, t being the number of projection points;
step 4.1.3, with piProjection point p'iAs a starting point, with its neighbor point NjProjection point N'jTo endpoint, vector p 'is defined'iN′j(j-0, 1, …, k-1) and find each vector p'iN′jCross product with the normal vector of the plane, i.e. ni×p′iN′jWherein the result of the cross product of the two vectors is a vector and the vector is perpendicular to the sum of the two vectors;
step 4.1.4, arbitrarily take a projection vector p'iN′jCalculating the included angle alpha between other projection vectors and the vectorjAnd cross product n with the vectori×p′iN′jAngle of (b) ofjWherein is defined asjNot less than 90 DEG, then alphaj=360°-αj;
Step 4.1.5, apply the fast sequencing method to alphaj(j ═ 0,1, …, k-1) in order from large to small, the angle between adjacent vectors can be represented by formula (13), then, it is estimated whether the maximum angle between adjacent vectors is greater than the angle threshold epsilon, if so, the point is a boundary point;
step 4.1.6, continuously searching the next boundary point until all the boundary points of each plane are found;
the step 4.2 is specifically as follows:
step 4.2.1, determining the maximum value and the minimum value of the z axis of each plane point cloud data obtained in the step 3;
step 4.2.2, taking the average value of the z axis as a projection plane;
step 4.2.3, projecting the boundary points of the wall and the door obtained in the step 4.1 to an XOY plane to obtain point cloud data projection points of the wall and the door;
step 4.2.4, fitting a straight line by a least square method according to the projection points;
the step 4.3 is specifically as follows:
step 4.3.1, two linear equations of the wall and the door fitted in step 4.2 are obtained and are combined as in formula (14), and the intersection point ζ (x) is calculated12,y12);
Step 4.3.2, respectively dividing the point cloud data used for fitting the two straight lines into 10 sections, analyzing the point density of each section, if the difference value between the point density of a certain section and the point density of other sections is greater than a density threshold value, the point density of the section is obviously increased compared with the point density of other sections, if the point density of the certain section is obviously increased compared with the point density of other sections, taking the average value of all points x of the section, obtaining a y coordinate according to a straight line equation, otherwise, if the point density of each section is uniform, randomly selecting the straight line, and obtaining the y coordinate according to the straight line equationOne point of the line, the coordinate obtained in this step is recorded as θ (x)θ,yθ);
Step 4.3.3, according to the intersection point and the coordinate theta (x)θ,yθ) Calculating the slope k of the straight lines by using the formula (15), and calculating the slopes of the two straight lines to be k respectively1,k2;
Step 4.3.4, according to the slope k1And k2Calculating the angle of two straight lines, if k1·k2If the included angle of the straight lines is-1, the included angle of the straight lines is 90 degrees, otherwise, the tangent value tan lambda of the two straight lines is calculated according to the formula (16);
step 4.3.5, if k1·k2If not equal to-1, calculating lambda according to an arctangent function arctan, if the lambda is a negative number, the included angle of the straight line is pi + lambda, otherwise, the included angle of the straight line is lambda;
step 4.3.6, judging the state of the door according to the obtained included angle of the straight lines, and if the included angle of the two straight lines is larger than or equal to 90 degrees, the door is opened; if the included angle of the two straight lines is in the range of [0 degrees and 5 degrees ], the two straight lines are closed doors; if the included angle of the two straight lines is in the range of [5 degrees and 90 degrees ], the door is a half-open door;
the step 4.4 is specifically as follows:
step 4.4.1, according to the corner point information obtained in step 3.1, selecting the side L with the longest length in the corner point connection as the reference, and setting the number N of samples to be sampledupThen, the sampling distance, i.e., the distance between the sampling points, is calculated according to equation (17);
in the formula: disupNamely miningSample distance; l is the longest side in the corner connection; n is a radical ofup-the number of samples.
Step 4.4.2, starting from the point with the minimum coordinate in the corner point information obtained in step 3.1, according to the sampling distance disupSequentially outputting points to realize data up-sampling;
and 4.4.3, fitting the plane by using a random sampling consistency method, namely randomly selecting three points on the up-sampled data, determining a plane, adding points within a set distance of the plane into the plane, updating the plane until all the points are processed, finishing the fitting of the plane and realizing the reconstruction of the wall.
Background
Various scenes of the real world are the most important components of the human perception world, wherein an indoor scene is used as an important component of the real scene, and the establishment of a three-dimensional model of the indoor scene has wide application prospects.
In an indoor scene, walls are used as important constituent elements, and detailed information such as doors and windows exists, so that the fidelity of the wall model is directly influenced. Meanwhile, due to the shielding of the objects on the wall in the scene and the diversity of wall structures such as doors, windows and the like, the reconstruction of the wall has huge challenges. In the current research on wall reconstruction, few methods capable of reconstructing a complete wall model exist, most of the methods are only researched for a certain wall structure, and some methods are only researched for doors in a specific state, while doors in other states are ignored.
Disclosure of Invention
The invention aims to provide a wall structure analysis and reconstruction method for an indoor point cloud scene, and solves the problems of data loss and door state neglect caused by shielding in the prior art.
The invention adopts the technical scheme that a wall structure analysis and reconstruction method of an indoor point cloud scene is implemented according to the following steps:
step 1, carrying out occlusion detection on an indoor scene, and determining an occlusion area on a wall in the scene;
step 2, extracting wall data in the shielding area obtained in the step 1, and dividing the wall structure according to local characteristics;
step 3, identifying the door of the wall data processed in the step 2;
and 4, determining the state of the door of the wall data processed in the step 3, and rebuilding.
The present invention is also characterized in that,
the step 1 specifically comprises the following steps:
step 1.1, setting the voxel size to be 10cm × 10cm × 10cm, representing an indoor scene by using three-dimensional voxels, then approximately displaying other points in the voxels by using the gravity centers of all points in the voxels in each voxel, namely, finally representing all points in the voxel by using one gravity center point, and finally processing all the voxels to obtain a point cloud scene after down sampling, wherein the point cloud scene is used as input data of the next stage;
step 1.2, determining a scanning position, a scanning radius and a scanning point, thereby constructing a scanning ray for detecting shielding, specifically:
step 1.2.1, determining a scanning position O according to the angle of an occlusion area and an object causing occlusion;
step 1.2.2, calculating the scanning radius RscanThe method specifically comprises the following steps:
Vol=LxLyLz (2)
wherein gamma is a scale factor; vol is the volume of the indoor scene; n is the number of points in the indoor scene; l isxThe length of an indoor scene in the X-axis direction; l isyIs the length of the indoor scene in the Y-axis direction; l iszThe length of the indoor scene in the Z-axis direction;
step 1.2.3, determining the scanning point PscanThe method specifically comprises the following steps:
according to the scanning radius RscanDividing the wall in the point cloud data into a plurality of scanning areas with the length of LxHeight of LzThe wall of (1) dividing m × l scanning areas; length LyHeight of LzThe wall of (1), dividing n × L scanning areas, wherein m ═ ceil (L)x/(2×Rscan)),n=ceil(Ly/(2×Rscan)),l=ceil(Lz/(2×Rscan) Ceil (x) is an integer function, and then the center point of each scanning area is calculated, and the center point is a scanning point;
step 1.2.4, regarding the wall parallel to the XOZ, taking the Z-axis coordinate as a reference, and appointing the sequence for the scanning points from the minimum value of the X coordinate to the maximum value of the X coordinate, wherein the sequence is expressed as
For the wall parallel to YOZ, the scanning points are assigned with the sequence from the minimum value of the Y coordinate to the maximum value of the Y coordinate by taking the Z-axis coordinate as a reference, and the sequence is expressed as
Step 1.2.5, after the scanning position, the scanning radius and the scanning points are determined, a ray is emitted from the scanning position O to each scanning point, and therefore scanning light is constructed;
and step 1.3, determining a shielding area on the wall in the scene by using a ray tracing method according to the scanning ray constructed in the step 1.2.
The step 1.3 is specifically as follows:
step 1.3.1, obtaining the scanning points which are not searched according to the sequence specified in step 1.2
Step 1.3.2, searching scanning points by applying KNN algorithmWhether a near neighbor point exists in the scanning radius, if so, indicating that the area is not an occlusion area, and skipping to the step 1.3.1, otherwise, indicating that the area may have occlusion, and skipping to the step 1.3.3;
step 1.3.3, determining a scanning position O and a scanning point according to a two-point three-dimensional linear equation (3)Substituting the formula (4) into the formula (3) to calculate a new scanning point (x, y, z), if the new scanning point is not between the scanning point and the scanning position, indicating that the area is not an occlusion area, and jumping to the step 1.3.1, otherwise, jumping to the step 1.3.4;
in the formula:to scan a spotThe coordinates of (a); (o)x,oy,oz) Is the coordinate of the scanning position O; rscanIs the scanning radius;
step 1.3.4, searching whether a scanning point has a near-neighbor point in a scanning radius by applying a KNN algorithm, if the near-neighbor point exists, indicating that the area is a shielding area, and skipping to step 1.3.1, otherwise skipping to step 1.3.3;
and 1.3.5, until all the scanning points are searched, determining all occlusion areas on the wall in the scene, and marking the hollow area caused by occlusion.
The step 2 specifically comprises the following steps:
step 2.1, further processing the wall data in the indoor scene by taking the original point cloud scene data as input data;
step 2.2, performing characteristic calculation by using a principal component analysis method;
and 2.3, dividing the wall structure according to the local characteristics.
The step 2.1 specifically comprises the following steps:
step 2.1.1, randomly selecting three points in the original point cloud scene data as local points, and fitting a plane;
step 2.1.2, setting a distance threshold, judging whether points in the distance threshold around the plane fitted in the step 2.1.1 are local points, if so, adding the points into the plane, and updating the plane;
step 2.1.3, repeatedly executing the operation of the step 2.1.2 on the updated plane until no local point is added into the plane, and outputting the plane if the local point number of the plane is greater than the local point number threshold value;
step 2.1.4, wall is sealedWall data is extracted from the plane output through step 2.1.3, specifically: first, the height H of the entire scanned scene is determinedwhole(ii) a Then, since the wall is a structure supporting the entire scene, its height is equal to the scene height HwholeSimilarly, the height of the door in the scene is generally 3/4, so the threshold H for extracting the height of the wall is set according to the prior knowledgewallIs (H)whole×3/4,Hwhole](ii) a And finally, filtering the planes according to the height threshold value, calculating the height of each plane, and if the height of each plane is within the range of the height threshold value, extracting the plane to obtain wall data.
The step 2.2 specifically comprises the following steps:
step 2.2.1, establishing a KD-tree for organizing all points in the wall point cloud data extracted in step 2.1, then inquiring k adjacent points of each point p by using the KD-tree, and calculating a covariance matrix by using a formula (5):
in the formula: Σ is a covariance matrix of 3 × 3; piThe ith neighbor of point p;
step 2.2.2, solving a standard eigenvalue equation through singular value decomposition to obtain a normal vector of the point p, wherein the normal vector is a third eigenvector in the eigenvector V matrix and is recorded as npA normal vector representing point p;
λV=∑V (6)
in the formula: v is a feature vector matrix; lambda is an eigenvalue matrix;
step 2.2.3, in the matrix of λ, λ3Represents the curvature value of a point, and thus the curvature value of a point p is λ3And it is denoted as λp。
The step 2.3 is specifically as follows:
step 2.3.1, defining a plane marker for each point in the wall point cloud data, wherein the initial marker is 0, that is, Index is 0, which indicates that the point is not marked, and if Index is 1, it indicates that the point is marked;
step 2.2.2, a stack for storing points is created;
step 2.3.3, selecting a point with the minimum curvature as a seed point, marking the seed point as Index 1, and then storing the seed point in a stack;
step 2.3.4, if the stack is not empty, taking out the seed point at the top of the stack from the stack, calculating the neighbor point of the seed point, and judging the cosine value cos of the included angle between the seed point and the normal vector of the neighbor point;
step 2.3.5, if the 1-cos is less than 0.1, judging whether the curvature of the adjacent point is less than a set curvature threshold value, if so, determining that the adjacent point is a point in the same plane, and if not, marking the adjacent point as Index being 1 and pressing the Index into the stack; otherwise, jumping to step 2.3.4;
step 2.3.6, if the stack is empty, it represents that a plane has been successfully extracted, and deletes the marked points from the wall point cloud data, then repeats steps 2.3.3-2.3.5 for the remaining unmarked points until there are no unmarked points, and ends the plane segmentation of the wall;
step 2.3.7, after obtaining the different planes on the wall determined by the steps 2.3.1-2.3.6, determining the side length L of the unit grid for dividing the wall according to a formula (7);
in the formula: beta is a scale factor used for adjusting the side length of the small grid; s is the area of the wall; n is the total number of wall points;
step 2.3.8, calculating the number num of grids divided by the wall according to the formula (8)grid;
numgrid=numw×numh (8)
numw=lw/L (9)
numh=lh/L (10)
In the formula: numgridNumber of grids for walls; numwThe number of grids occupied by the wall width; numhThe number of grids occupied by the wall height; lwIs the width of the wall; lhIs the height of the wall.
Step 2.3.9, calculating the number grid of points in each gridnum;
Step 2.3.10, if gridnumIf yes, marking the grid as the shielding and displaying by blue, otherwise, marking the grid as the empty and displaying by red;
step 2.3.11, for gridnumThe grids which are not equal to 0 are represented by the RGB information of the middle points of the grids, the number of the grids is counted according to the RGB information of the grids, the grids are sorted in a descending mode, the grids with the largest number are marked as walls, and black display is carried out; if there is another color other than the wall and the number of such grids is within a given number range, the grid is marked as a candidate door, thereby achieving the division of the wall structure.
The step 3 specifically comprises the following steps:
step 3.1, deleting the partition planes with the point number smaller than the quantity threshold value in the wall structure divided in the step 2, then analyzing the parallel relation between the rest wall partition planes and the XOZ coordinate axis, and for the plane parallel to the coordinate axis, extracting the plane corner points by applying an AABB bounding box; for a plane which is not parallel to the coordinate axes, extracting the angular points of the plane by applying an OBB bounding box;
step 3.2, calculating the volume V of each plane according to the corner point information of the bounding boxboxCalculating a plane for performing corner detection by using an AABB bounding box by using a formula (11), calculating a plane for performing corner detection by using an OBB bounding box by using a formula (12), and marking the plane with the largest volume as a wall;
Vbox=(max_AABBx-min_AABBx)×(max_AABBy-min_AABBy)×(max_AABBz-min_AABBx) (11)
Vbox=l1×l2×l1 (12)
in the formula: (max _ AABB)x,min_AABBx) Maximum and minimum values of AABB on the x-axis; (max _ AABB)y,min_AABBy) Maximum and minimum values of AABB on the y-axis; (max _ AABB)z,min_AABBz) Maximum and minimum values of AABB on the z-axis; l1,l2,l3Is the length of the three axes of the OBB;
step 3.3, calculating the height of each plane, wherein the height of the wall is recorded as lwallAnd the heights of the rest planes are respectively marked as l1,l2,…;
Step 3.4, analyzing the height ratio of each plane and the wall, and if the height of a certain plane is within the range of 3/4 of the height of the wall, that is to sayThe plane is marked as a door, otherwise the remaining objects, wherein,is the fluctuation range.
The step 4 specifically comprises the following steps:
step 4.1, extracting the boundary by using the included angle between the normal vectors of the points in each plane determined in the step 3;
step 4.2, projecting the boundary points obtained in the step 4.1, and fitting straight lines to the projection points;
4.3, calculating an included angle formed by the door and the wall according to the straight line which is obtained by the step 4.2 and is fitted with each plane, and analyzing the state of the door;
and 4.4, performing up-sampling on the corner point information of each plane obtained in the step 3.1 according to the door state determined in the step 4.3, and fitting the planes to realize the reconstruction of the wall.
The step 4.1 is specifically as follows:
step 4.1.1, extracting the normal vectors of the points in each plane determined in the step 3 by using Principal Component Analysis (PCA);
step 4.1.2, assign each point piAnd its k neighbors Nj(j-0, 1, …, k-1) of the point set XiTo its normal vector niProjecting the vertical plane with the projection point set of X'i={(x′i,y′i,z′i) I |, 0,1, … t }, t being the number of projection points;
step 4.1.3, with piProjection point p'iAs a starting point, with its neighbor point NjProjection point N'jTo endpoint, vector p 'is defined'iN′j(j-0, 1, …, k-1) and find each vector p'iN′jCross product with the normal vector of the plane, i.e. ni×p′iN′jWherein the result of the cross product of the two vectors is a vector and the vector is perpendicular to the sum of the two vectors;
step 4.1.4, arbitrarily take a projection vector p'iN′jCalculating the included angle alpha between other projection vectors and the vectorjAnd cross product n with the vectori×p′iN′jAngle of (b) ofjWherein is defined asjNot less than 90 DEG, then alphaj=360°-αj;
Step 4.1.5, apply the fast sequencing method to alphaj(j ═ 0,1, …, k-1) in order from large to small, the angle between adjacent vectors can be represented by formula (13), then, it is estimated whether the maximum angle between adjacent vectors is greater than the angle threshold epsilon, if so, the point is a boundary point;
step 4.1.6, continuously searching the next boundary point until all the boundary points of each plane are found;
the step 4.2 is specifically as follows:
step 4.2.1, determining the maximum value and the minimum value of the z axis of each plane point cloud data obtained in the step 3;
step 4.2.2, taking the average value of the z axis as a projection plane;
step 4.2.3, projecting the boundary points of the wall and the door obtained in the step 4.1 to an XOY plane to obtain point cloud data projection points of the wall and the door;
step 4.2.4, fitting a straight line by a least square method according to the projection points;
the step 4.3 is specifically as follows:
step 4.3.1, two linear equations of the wall and the door fitted in step 4.2 are obtained and are combined as in formula (14), and the intersection point ζ (x) is calculated12,y12);
Step 4.3.2, respectively dividing the point cloud data used for fitting the two straight lines into 10 sections, analyzing the point density of each section, if the difference value between the point density of a certain section and the point density of other sections is greater than a density threshold value, the point density of the section is obviously increased compared with the point density of other sections, if the point density of the certain section is obviously increased compared with the point density of other sections, taking the average value of all points x of the section, obtaining a y coordinate according to a straight line equation, otherwise, if the point density of each section is uniform, randomly selecting one point of the straight line, and recording the coordinate obtained in the step as theta (x is the coordinate obtained in the stepθ,yθ);
Step 4.3.3, according to the intersection point and the coordinate theta (x)θ,yθ) Calculating the slope k of the straight lines by using the formula (15), and calculating the slopes of the two straight lines to be k respectively1,k2;
Step 4.3.4, according to the slope k1And k2Calculating the angle of two straight lines, if k1·k2If-1, the included angle of the straight line is 90 °, otherwise, it is calculated according to equation (16)The tangent tan λ of the two lines;
step 4.3.5, if k1·k2If not equal to-1, calculating lambda according to an arctangent function arctan, if the lambda is a negative number, the included angle of the straight line is pi + lambda, otherwise, the included angle of the straight line is lambda;
step 4.3.6, judging the state of the door according to the obtained included angle of the straight lines, and if the included angle of the two straight lines is larger than or equal to 90 degrees, the door is opened; if the included angle of the two straight lines is in the range of [0 degrees and 5 degrees ], the two straight lines are closed doors; if the included angle of the two straight lines is in the range of [5 degrees and 90 degrees ], the door is a half-open door;
step 4.4 is specifically:
step 4.4.1, according to the corner point information obtained in step 3.1, selecting the side L with the longest length in the corner point connection as the reference, and setting the number N of samples to be sampledupThen, the sampling distance, i.e., the distance between the sampling points, is calculated according to equation (17);
in the formula: disup-sampling the distance; l is the longest side in the corner connection; n is a radical ofup-the number of samples.
Step 4.4.2, starting from the point with the minimum coordinate in the corner point information obtained in step 3.1, according to the sampling distance disupSequentially outputting points to realize data up-sampling;
and 4.4.3, fitting the plane by using a random sampling consistency method, namely randomly selecting three points on the up-sampled data, determining a plane, adding points within a set distance of the plane into the plane, updating the plane until all the points are processed, finishing the fitting of the plane and realizing the reconstruction of the wall.
The invention has the beneficial effects that:
the invention solves the problem of data loss caused by shielding and improves the accuracy of the reconstruction result. The wall surface reconstruction work of the invention is greatly improved in effectiveness, stability and accuracy, has better robustness and enriches the method systems of computer graphics and visual intelligence.
According to the invention, the wall structure is divided through shielding detection and plane division, so that the problem of data loss caused by shielding is effectively solved, and the accuracy of dividing the wall structure is improved; then, identifying door elements on the wall with higher accuracy by using a door identification method based on corner detection; and finally, accurately analyzing the state of the door according to a door state identification and reconstruction method of boundary extraction and straight line fitting, completely reconstructing the wall including the closed and opened door, and finally achieving a good reconstruction effect.
Drawings
FIG. 1 is a diagram of raw data input in step 1 of an embodiment of the method of the present invention;
fig. 2 is a down-sampling result obtained in step 1 of an embodiment of a method for analyzing and reconstructing a wall structure of an indoor point cloud scene according to the present invention;
fig. 3 is a scanning ray result constructed in step 1 of the wall structure analysis and reconstruction method for an indoor point cloud scene according to an embodiment of the present invention;
fig. 4 is data of an occlusion marking result obtained in step 1 of an embodiment of a method for analyzing and reconstructing a wall structure of an indoor point cloud scene according to the present invention;
fig. 5 is a scene segmentation result obtained in step 2 of an embodiment of a method for analyzing and reconstructing a wall structure of an indoor point cloud scene according to the present invention;
fig. 6 is extracted data of the wall obtained in step 2 of the wall structure analysis and reconstruction method for an indoor point cloud scene according to an embodiment of the present invention;
fig. 7 is the wall structure division data obtained in step 2 of the wall structure analysis and reconstruction method of the indoor point cloud scene according to the embodiment of the present invention;
fig. 8 is a corner result of point cloud data obtained in step 3 of the wall structure analysis and reconstruction method for an indoor point cloud scene according to an embodiment of the present invention;
fig. 9 is a result of point cloud data boundary points obtained in step 4 of the wall structure analysis and reconstruction method for an indoor point cloud scene according to an embodiment of the present invention;
FIG. 10 shows a result of fitting a straight line based on projection points in step 4 of an embodiment of a method for analyzing and reconstructing a wall structure of an indoor point cloud scene according to the present invention;
fig. 11 is a wall reconstruction result in step 4 of the wall structure analysis and reconstruction method for an indoor point cloud scene according to an embodiment of the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
The invention discloses a wall structure analysis and reconstruction method of an indoor point cloud scene, which is implemented according to the following steps:
step 1, carrying out occlusion detection on an indoor scene, and determining an occlusion area on a wall in the scene; the method specifically comprises the following steps:
step 1.1, setting the voxel size to be 10cm × 10cm × 10cm, representing an indoor scene by using a three-dimensional voxel as shown in fig. 1, then approximately displaying other points in the voxel by using the gravity centers of all points in the voxel in each voxel, namely, finally representing all points in the voxel by using one gravity center point, and finally processing all voxels to obtain a point cloud scene after down sampling as shown in fig. 2, and using the point cloud scene as input data of the next stage;
step 1.2, determining a scanning position, a scanning radius and a scanning point, thereby constructing a scanning ray for detecting shielding, as shown in fig. 3, specifically:
step 1.2.1, determining a scanning position O according to the angle of an occlusion area and an object causing occlusion;
step 1.2.2, calculating the scanning radius Rscan. The shielding result of detection is inaccurate due to the fact that the scanning radius is too large; too small a scanning radius may reduce the detection efficiency, and may cause a program crash in a serious case. Thus, the scanning radius R is calculated herein from the spatial point densityscan. Will scan a radius RscanIs taken to be smaller, in order toThe detection is ensured to be carried out in the most appropriate range, and the detection time is reduced. Thus, the scan radius R is calculatedscanThe method specifically comprises the following steps:
Vol=LxLyLz (2)
wherein gamma is a scale factor; vol is the volume of the indoor scene; n is the number of points in the indoor scene; l isxThe length of an indoor scene in the X-axis direction; l isyIs the length of the indoor scene in the Y-axis direction; l iszThe length of the indoor scene in the Z-axis direction;
step 1.2.3, determining the scanning point PscanThe method specifically comprises the following steps:
according to the scanning radius RscanDividing the wall in the point cloud data into a plurality of scanning areas with the length of LxHeight of LzThe wall of (1) dividing m × l scanning areas; length LyHeight of LzThe wall of (1), dividing n × L scanning areas, wherein m ═ ceil (L)x/(2×Rscan)),n=ceil(Ly/(2×Rscan)),l=ceil(Lz/(2×Rscan) Ceil (x) is an integer function, and then the center point of each scanning area is calculated, and the center point is a scanning point;
and the scanning points are assigned with sequences, so that the subsequent experiments are convenient to carry out. Since most walls are perpendicular to the floor and adjacent walls are perpendicular, there are two categories to assign order to the scan points.
Step 1.2.4, regarding the wall parallel to the XOZ, taking the Z-axis coordinate as a reference, and appointing the sequence for the scanning points from the minimum value of the X coordinate to the maximum value of the X coordinate, wherein the sequence is expressed as
For the wall parallel to YOZ, taking the Z-axis coordinate as a reference, from the minimum value of the Y coordinate to the maximum value of the Y coordinate, the wall is taken as a scanning point fingerIn a certain order, represented as
Step 1.2.5, after the scanning position, the scanning radius and the scanning points are determined, a ray is emitted from the scanning position O to each scanning point, and therefore scanning light is constructed;
step 1.3, determining a shielding area on a wall in a scene by using a ray tracing method according to the scanning ray constructed in the step 1.2, as shown in fig. 4, specifically:
step 1.3.1, obtaining the scanning points which are not searched according to the sequence specified in step 1.2
Step 1.3.2, searching scanning points by applying KNN algorithmWhether a near neighbor point exists in the scanning radius, if so, indicating that the area is not an occlusion area, and skipping to the step 1.3.1, otherwise, indicating that the area may have occlusion, and skipping to the step 1.3.3;
step 1.3.3, determining a scanning position O and a scanning point according to a two-point three-dimensional linear equation (3)Substituting the formula (4) into the formula (3) to calculate a new scanning point (x, y, z), if the new scanning point is not between the scanning point and the scanning position, indicating that the area is not an occlusion area, and jumping to the step 1.3.1, otherwise, jumping to the step 1.3.4;
in the formula:to scan a spotThe coordinates of (a); (o)x,oy,oz) Is the coordinate of the scanning position O; rscanIs the scanning radius;
step 1.3.4, searching whether a scanning point has a near-neighbor point in a scanning radius by applying a KNN algorithm, if the near-neighbor point exists, indicating that the area is a shielding area, and skipping to step 1.3.1, otherwise skipping to step 1.3.3;
step 1.3.5, until all the scanning points are searched, determining all occlusion areas on the wall in the scene, and marking the hollow area caused by occlusion;
step 2, extracting wall data in the shielding area obtained in the step 1, and dividing the wall structure according to local characteristics; the method specifically comprises the following steps:
step 2.1, further processing the wall data in the indoor scene by taking the original point cloud scene data as input data; the method specifically comprises the following steps:
step 2.1.1, randomly selecting three points in the original point cloud scene data as local points, and fitting a plane;
step 2.1.2, setting a distance threshold, judging whether points in the distance threshold around the plane fitted in the step 2.1.1 are local points, if so, adding the points into the plane, and updating the plane;
step 2.1.3, the operation of step 2.1.2 is repeatedly executed on the updated plane until no local point is added into the plane, and if the local point number of the plane is greater than the local point number threshold value, the plane is output, as shown in fig. 5;
step 2.1.4, extracting the wall data from the plane output in step 2.1.3, specifically: firstly, it is sureDefining the height H of the entire scanned scenewhole(ii) a Then, since the wall is a structure supporting the entire scene, its height is equal to the scene height HwholeSimilarly, the height of the door in the scene is generally 3/4, so the threshold H for extracting the height of the wall is set according to the prior knowledgewallIs (H)whole×3/4,Hwhole](ii) a Finally, filtering the planes according to the height threshold value, calculating the height of each plane, and if the height of the plane is within the range of the height threshold value, extracting the plane to obtain wall data, as shown in fig. 6;
step 2.2, performing characteristic calculation by using a principal component analysis method; the method specifically comprises the following steps:
step 2.2.1, establishing a KD-tree for organizing all points in the wall point cloud data extracted in step 2.1, then inquiring k adjacent points of each point p by using the KD-tree, and calculating a covariance matrix by using a formula (5):
in the formula: Σ is a covariance matrix of 3 × 3; piThe ith neighbor of point p;
step 2.2.2, solving a standard eigenvalue equation through singular value decomposition to obtain a normal vector of the point p, wherein the normal vector is a third eigenvector in the eigenvector V matrix and is recorded as npA normal vector representing point p;
λV=∑V (6)
in the formula: v is a feature vector matrix; lambda is an eigenvalue matrix;
step 2.2.3, in the matrix of λ, λ3Represents the curvature value of a point, and thus the curvature value of a point p is λ3And it is denoted as λp;
Step 2.3, dividing the wall structure according to the local characteristics; the method specifically comprises the following steps:
step 2.3.1, defining a plane marker for each point in the wall point cloud data, wherein the initial marker is 0, that is, Index is 0, which indicates that the point is not marked, and if Index is 1, it indicates that the point is marked;
step 2.2.2, a stack for storing points is created;
step 2.3.3, selecting a point with the minimum curvature as a seed point, marking the seed point as Index 1, and then storing the seed point in a stack;
step 2.3.4, if the stack is not empty, taking out the seed point at the top of the stack from the stack, calculating the neighbor point of the seed point, and judging the cosine value cos of the included angle between the seed point and the normal vector of the neighbor point;
step 2.3.5, if the 1-cos is less than 0.1, judging whether the curvature of the adjacent point is less than a set curvature threshold value, if so, determining that the adjacent point is a point in the same plane, and if not, marking the adjacent point as Index being 1 and pressing the Index into the stack; otherwise, jumping to step 2.3.4;
step 2.3.6, if the stack is empty, it represents that a plane has been successfully extracted, and deletes the marked points from the wall point cloud data, then repeats steps 2.3.3-2.3.5 for the remaining unmarked points until there are no unmarked points, and ends the plane segmentation of the wall;
step 2.3.7, after obtaining the different planes on the wall determined by the steps 2.3.1-2.3.6, determining the side length L of the unit grid for dividing the wall according to a formula (7);
in the formula: beta is a scale factor used for adjusting the side length of the small grid; s is the area of the wall; n is the total number of wall points;
step 2.3.8, calculating the number num of grids divided by the wall according to the formula (8)grid;
numgrid=numw×numh (8)
numw=lw/L (9)
numh=lh/L (10)
In the formula: numgridNumber of grids for walls; numwThe number of grids occupied by the wall width; numhThe number of grids occupied by the wall height; lwIs the width of the wall; lhIs the height of the wall.
Step 2.3.9, calculating the number grid of points in each gridnum;
Step 2.3.10, if gridnumIf yes, marking the grid as the shielding and displaying by blue, otherwise, marking the grid as the empty and displaying by red;
step 2.3.11, for gridnumThe grids which are not equal to 0 are represented by the RGB information of the middle points of the grids, the number of the grids is counted according to the RGB information of the grids, the grids are sorted in a descending mode, the grids with the largest number are marked as walls, and black display is carried out; if there is another color other than the wall and the number of such grids is within a given number range, the grid is marked as a candidate door, thereby achieving the division of the wall structure, as shown in fig. 7.
Step 3, identifying the door of the wall data processed in the step 2; the method specifically comprises the following steps:
step 3.1, deleting the partition planes with the point number smaller than the quantity threshold value in the wall structure divided in the step 2, then analyzing the parallel relation between the rest wall partition planes and the XOZ coordinate axis, and for the plane parallel to the coordinate axis, extracting the plane corner points by applying an AABB bounding box; for a plane not parallel to the coordinate axes, extracting the corner points of the plane by using an OBB bounding box, as shown in FIG. 8;
step 3.2, calculating the volume V of each plane according to the corner point information of the bounding boxboxCalculating a plane for performing corner detection by using an AABB bounding box by using a formula (11), calculating a plane for performing corner detection by using an OBB bounding box by using a formula (12), and marking the plane with the largest volume as a wall;
Vbox=(max_AABBx-min_AABBx)×(max_AABBy-min_AABBy)×(max_AABBz-min_AABBx) (11)
Vbox=l1×l2×l1 (12)
in the formula: (max _ AABB)x,min_AABBx) Maximum and minimum values of AABB on the x-axis; (max _ AABB)y,min_AABBy) Maximum and minimum values of AABB on the y-axis; (max _ AABB)z,min_AABBz) Maximum and minimum values of AABB on the z-axis; l1,l2,l3Is the length of the three axes of the OBB;
step 3.3, calculating the height of each plane, wherein the height of the wall is recorded as lwallAnd the heights of the rest planes are respectively marked as l1,l2,…;
Step 3.4, analyzing the height ratio of each plane and the wall, and if the height of a certain plane is within the range of 3/4 of the height of the wall, that is to sayThe plane is marked as a door, otherwise the remaining objects, wherein,is the fluctuation range.
Step 4, determining the door state of the wall data processed in the step 3, and reconstructing the door state, specifically:
step 4.1, performing boundary extraction by using the included angle between the normal vectors of the points in each plane determined in step 3, as shown in fig. 9, specifically:
step 4.1.1, extracting the normal vectors of the points in each plane determined in the step 3 by using Principal Component Analysis (PCA);
step 4.1.2, assign each point piAnd its k neighbors Nj(j-0, 1, …, k-1) of the point set XiTo its normal vector niProjecting on a vertical plane, the projected pointsCollective is X'i={(x′i,y′i,z′i) I |, 0,1, … t }, t being the number of projection points;
step 4.1.3, with piProjection point p'iAs a starting point, with its neighbor point NjProjection point N'jTo endpoint, vector p 'is defined'iN′j(j-0, 1, …, k-1) and find each vector p'iN′jCross product with the normal vector of the plane, i.e. ni×p′iN′jWherein the result of the cross product of the two vectors is a vector and the vector is perpendicular to the sum of the two vectors;
step 4.1.4, arbitrarily take a projection vector p'iN′jCalculating the included angle alpha between other projection vectors and the vectorjAnd cross product n with the vectori×p′iN′jAngle of (b) ofjWherein is defined asjNot less than 90 DEG, then alphaj=360°-αj;
Step 4.1.5, apply the fast sequencing method to alphaj(j ═ 0,1, …, k-1) in order from large to small, the angle between adjacent vectors can be represented by formula (13), then, it is estimated whether the maximum angle between adjacent vectors is greater than the angle threshold epsilon, if so, the point is a boundary point;
step 4.1.6, continuously searching the next boundary point until all the boundary points of each plane are found;
step 4.2, projecting the boundary points obtained in the step 4.1, and fitting straight lines to the projection points; the method specifically comprises the following steps:
step 4.2.1, determining the maximum value and the minimum value of the z axis of each plane point cloud data obtained in the step 3;
step 4.2.2, taking the average value of the z axis as a projection plane;
step 4.2.3, projecting the boundary points of the wall and the door obtained in the step 4.1 to an XOY plane to obtain point cloud data projection points of the wall and the door;
step 4.2.4, fitting a straight line by a least square method according to the projection points, as shown in FIG. 10;
4.3, calculating an included angle formed by the door and the wall according to the straight line which is obtained by the step 4.2 and is fitted with each plane, and analyzing the state of the door; the method specifically comprises the following steps:
step 4.3.1, two linear equations of the wall and the door fitted in step 4.2 are obtained and are combined as in formula (14), and the intersection point ζ (x) is calculated12,y12);
Step 4.3.2, respectively dividing the point cloud data used for fitting the two straight lines into 10 sections, analyzing the point density of each section, if the difference value between the point density of a certain section and the point density of other sections is greater than a density threshold value, the point density of the section is obviously increased compared with the point density of other sections, if the point density of the certain section is obviously increased compared with the point density of other sections, taking the average value of all points x of the section, obtaining a y coordinate according to a straight line equation, otherwise, if the point density of each section is uniform, randomly selecting one point of the straight line, and recording the coordinate obtained in the step as theta (x is the coordinate obtained in the stepθ,yθ);
Step 4.3.3, according to the intersection point and the coordinate theta (x)θ,yθ) Calculating the slope k of the straight lines by using the formula (15), and calculating the slopes of the two straight lines to be k respectively1,k2;
Step 4.3.4, according to the slope k1And k2Calculating the angle of two straight lines, if k1·k2If the included angle of the straight lines is-1, the included angle of the straight lines is 90 degrees, otherwise, the tangent value tan lambda of the two straight lines is calculated according to the formula (16);
step 4.3.5, if k1·k2If not equal to-1, calculating lambda according to an arctangent function arctan, if the lambda is a negative number, the included angle of the straight line is pi + lambda, otherwise, the included angle of the straight line is lambda;
step 4.3.6, judging the state of the door according to the obtained included angle of the straight lines, and if the included angle of the two straight lines is larger than or equal to 90 degrees, the door is opened; if the included angle of the two straight lines is in the range of [0 degrees and 5 degrees ], the two straight lines are closed doors; if the included angle of the two straight lines is in the range of [5 degrees and 90 degrees ], the door is a half-open door;
step 4.4, according to the door state determined in step 4.3 and the corner point information of each plane obtained in step 3.1, performing up-sampling, fitting the planes, and realizing the reconstruction of the wall, specifically:
step 4.4.1, according to the corner point information obtained in step 3.1, selecting the side L with the longest length in the corner point connection as the reference, and setting the number N of samples to be sampledupThen, the sampling distance, i.e., the distance between the sampling points, is calculated according to equation (17);
in the formula: disup-sampling the distance; l is the longest side in the corner connection; n is a radical ofup-the number of samples.
Step 4.4.2, starting from the point with the minimum coordinate in the corner point information obtained in step 3.1, according to the sampling distance disupSequentially outputting points to realize data up-sampling;
and 4.4.3, fitting the plane by using a random sampling consistency method, namely randomly selecting three points on the up-sampled data, determining a plane, adding points within a set distance of the plane into the plane, updating the plane until all the points are processed, completing the fitting of the plane, and realizing the reconstruction of the wall, as shown in fig. 11.