Verification of buildings’ structure means inspection (comparison to the design) the position, orientation (including verticality), dimensions, in case of planar surfaces (e.g., of walls) the flatness of a given structural element, and the relationship to other structures in terms of geometry. In the following, we describe the developed approach to enable verification of wall structures using point clouds and BIM models.
To ensure the highest possible level of automation, information about the planned geometry of buildings’ structural elements must be presented in digital form. This requirement is fulfilled using a BIM model, where data is stored in the graphic data of the information model. One of the key requirements of the entire BIM process is interoperability. The solution in this field is the use of a common data environment for sharing all the data related to the BIM process. In terms of geometry generation, it is also very important to use a “readable” data exchange format, which simplifies the procedure. Several file formats ensure appropriate storage of the model’s data, such as CAD formats, CIS/2, CityGML, etc. All of them are focusing on data for specific use. One of the most widespread data exchange formats worldwide is Industry Foundation Classes (IFC). IFC is an ASCII text file format that aims to provide open and neutral access to the storage and exchange of BIM models between different software. The format is developed by a non-profit organization buildingSMART, and it is defined by the standard ISO 16739-1:2018 Industry Foundation Classes (IFC) for data sharing in the construction and facility management industries—Part 1: Data schema.
2.1. Geometry Identification from BIM Model
As mentioned above, the geometry of the verified structure is derived from the IFC file, which is a standardized (ISO 16739-1:2018) digital description of the building. It is a gradually evolving exchange format, and its current version is IFC4. Since IFC is formatted as a text file, it can be read using a text editor, which simplifies the procedure of the information derivation. For this purpose, it is necessary to know the structure of the data arrangement in IFC.
The IFC file consists of two main parts: the header and the data in the model. Within the data part are defined both the coordinate system and the system of units, which had been used. The coordinate system is a planar orthogonal, right-handed Cartesian coordinate system, which means that the coordinates X and Y are defined in the IFC but the Z coordinate, necessary for the definition of 3D space, is expressed by the height of the structural element. The form of coordinate definition does not correspond to the ones used in surveying, because it does not take into consideration map projection (Earth’s surface curvature, cartographic distortion) [
32]. There is an IFC entity dealing with the map coordinate system called
IfcMapConversion. However, its use only allows placement of the object at one point (easting, northing, orthogonal height) and orientation of the object towards the initial direction (north). For practical use, when modeling a larger area, it is necessary to divide it into parts (in local horizons) or apply coordinate corrections.
After defining the coordinate system and the units, the heights of individual floors of the building are defined and listed. The number of lines in this section depends on the total number of floors. The floors are defined by the IfcCartesianPoint and the IfcAxis2Placement3D entities. The first one defines the X, Y coordinates of the origin, which are in case of floors equal to 0, and the height of the floor. The IfcAxis2Placement3D entity defines the position in the coordinate system of the BIM model.
After this follows the definition of the building structures included in the given BIM model (
Figure 2). Depending on the content of the model (e.g., foundations, walls, doors, windows, beams, columns, etc.), several sections are defining the structural parts, while the individual elements are defined in separate sections. It is not possible to directly estimate the length of the section, but the beginning and the end of each one can be identified. The section always starts with a coordinate of the origin of the geometric element, i.e., an
IfcCartesianPoint line, and ends with the element name such as
IfcWall,
IfcDoor,
IfcBeam, etc. Specific objects of interest of our approach are the walls, which in the IFC format are referred to as
IfcWall. In the corresponding line, there is a specific wall number, which is a unique identifier. Subsequently, within the row, there is the thickness of the wall and the connection to the previous row, therefore, it is possible to identify where the wall is located and in which direction it is oriented. For each wall to be verified, it is necessary to obtain the coordinates of the reference point (origin), the direction vector of the wall, length, width, and height from the IFC file.
The coordinates of the reference point are obtained from the
IfcCartesianPoint line (
Figure 2). The direction is extracted from the line
IfcDirection, which contains components of the unit direction vector. This line is missing in the case when the wall is oriented into the direction of the X or Y axis of the model’s coordinate system. This can be solved by comparison of the origin of two walls, where the direction can be derived from the changing X or Y coordinate of the origins. The height of the wall is in the
IfcExtrudeAreaSolid line, while the length is defined by
IfcRectangleProfileDef. In the case of a wall, we need an additional parameter which is thickness, defined in the
IfcWall line.
From the five wall parameters directly derived from the IFC (coordinates of the reference point, direction, height, thickness, and length) the mathematical definition of the walls must be determined for verification of their geometry. Therefore, coordinates of the center point (center of gravity), and the coefficients of the general equation of the plane (wall surface) are estimated. The coefficients of the general equation include the components of the normal vector. Both planes of a wall are calculated, as both can be used in the further procedure. It depends on whether both planes were scanned and have to be verified or not. To calculate the center of gravity of a plane, first, we need to calculate the four boundary points (corners). The calculation is based on the well-known orthogonal surveying method using the coordinates of the reference point (origin) of the wall, from which we subtract or add the half of the wall’s thickness h recalculated to the direction of the coordinate system axis using the Equation (1):
where X
ref, Y
ref are the coordinates of the reference point, h is thickness of the wall, and X
dir, Y
dir are the elements of the unit vector defining the direction of the wall. The plus or minus sign in the above equations is chosen according to whether we determine the inner or outer planes of the wall.
The remaining three boundary points (2, 3, 4) can be calculated similarly using Equation (1).
The center of gravity of the plane is calculated as the arithmetic mean of the four corners of the plane using the Equation (2):
where X, Y, and Z are the coordinates of the corners. Subsequently, two auxiliary vectors are calculated from three points of the plane according to (3):
As the vector product of the vectors
u and
v, the normal vector n of the plane is calculated using Equation (4). Then, the general equation of the plane (5) can be defined from the calculated elements of the normal vector.
where d calculated by (6) is the scalar product of the normal vector of the plane and the position vector of the center of gravity.
The results of the algorithm for identification of the geometry of structural elements from IFC are the coordinates of the center points (centers of gravity) of individually verified walls, the unit normal vectors of walls’ planes, and the general equations of planes (
Figure 3). After the wall plane segments are extracted from the as-planned IFC model, the corresponding planes are segmented from the as-built point cloud data. The procedure of this segmentation is described in the following section.
2.2. Plane Segmentation from Point Clouds
Segmentation is often the first step in gaining information from a point cloud. It means a division of a point cloud into several subsets of points based on predefined criteria. In most cases, the subsets contain points lying on the surface of the same geometric primitive (cylinder, sphere, plane, torus), lying on an irregular smooth surface, or forming edges of objects. The segmentation process, in this case, is the identification of geometric shapes in point clouds, and also the determination of their size, position, and orientation [
33]. Based on the used algorithm, methods and approaches for point cloud segmentation can be divided into five groups [
34,
35,
36,
37]:
Edge-based methods,
Model-based methods,
Surface-based methods, region-based methods,
Clustering-based methods,
Graph-based methods.
The algorithm for plane segmentation from point clouds, used in the presented approach, is partially inspired by the region-based segmentation method, while plane parameters are estimated by the least square method. The first step of the algorithm is the selection of a distance threshold. Points that are closer to the estimated plane than the selected threshold, are considered as inliers, and so points that are lying on the surface of the estimated plane. The segmentation process starts by selecting a small number of the nearest points (
k-NN, e.g., 10 points, depending on the point cloud density) to a selected seed point. The seed point is the nearest point of the point cloud to the center point (center of gravity) of the extracted plane from the IFC model. Followingly, the parameters of a plane created by these points are estimated using orthogonal regression, which minimizes perpendicular distances to the estimated plane. The solution is based on the general equation of a plane [
38].
The singular value decomposition (SVD) of the matrix of the reduced coordinates is used to calculate the components of the normal vector using (7):
where
An×3 is the matrix of reduced coordinates (reduced to the subsets centroid), n is the number of the selected number of neighboring points, the column vectors of
Un×n are normalized eigenvectors of the matrix
AAT, the column vectors of
V3×3 are normalized eigenvectors of the matrix
ATA. The matrix
Σn×3 is a diagonal matrix with the first three singular numbers of the matrix
ATA on the main diagonal. Therefore, the normal vector of the regression plane is the column vector of
V, which belongs to the smallest singular number of the matrix
ATA [
38]. The components of the normal vector are the coefficients a, b, and c of the general equation of the estimated plane. The coefficient d is calculated by fitting the coordinates of the centroid point (X
mean, Y
mean, Z
mean), and the components of the normal vector to the Equation (8):
Then, the estimated plane model is tested against the selected neighbors, while points lying in this plane (volume defined by the plane and the distance threshold) are identified. This process is performed iteratively, with a gradual increase in the number of points tested. The gradual selection of the closest points for testing is illustrated in
Figure 4. It shows the input point cloud (a), next to the 102,400 nearest neighbors (all the points inside the yellow circle) to the selected seed point (b), followed by the 1,638,400 nearest neighbors (colored by yellow and cyan) (c), and the inlier points (d) with red color for the chosen plane with the selected threshold value.
In every iteration, the inlier points are updated (from the nearest neighbors) based on distance criterion, and parameters of the plane are re-estimated using all the inlier points. The calculation (plane re-estimation) is repeated until the number of inliers stops increasing, so there are no more inliers for the selected plane.
The steps described above automatically segment the point cloud to subsets containing points lying on the surface of the verified walls. Depending on the selected threshold value, also points in the close surroundings are segmented to the given subset. As
Figure 5 shows, often there is a lot of other objects close to the scanned surface, especially when the building is in operation, but also on the construction site of a building under construction. The individual steps of our approach are demonstrated in an example of a studio in a theatre.
During the first step of the segmentation process, most of the furniture was removed, as these points do not meet the criterion defined by the distance threshold. The parts of the wall structure behind the removed objects (from the point of view of the laser scanner) are the empty areas in
Figure 6. The points are colored, based on images taken by the instrument (RGB). The figure shows that the resulting subset of the point cloud also contains points not lying on the surface of the wall, e.g., posters, electrical sockets, and switches. The subset also contains doors. To solve the issue and to isolate points belonging to the surface of the walls, additional filtration procedures were created. These are based on local normal vectors and radiometric information (intensity, RGB) derived from the point cloud. The filtration can be divided into two main steps:
Figure 6.
Segmented point cloud—only distance-based filtering.
Figure 6.
Segmented point cloud—only distance-based filtering.
2.2.1. Normal Vector-Based Filtration
The plane segmentation procedure, depicted in the previous section, uses distance-based filtering for inlier identification as the distance threshold is needed for the definition of the close surroundings of the wall. In practice, points of the objects close to the wall are also considered as inliers, if only the distance-based filtering is executed. However, these points are not lying on the surface of the verified wall (plane) as is shown in
Figure 6.
After the initial plane segmentation, normal vectors at each point of the resulting subset of the point cloud are estimated using small local planes (calculated from the
k-nearest neighbors). The selected number of
k-nearest points depends on the point cloud density and noise. The value of
k is set globally according to the average density of the point cloud. The calculated normal vectors are multiplied by the normal vector of the respective planes obtained after segmentation (9), and then the angle between them is quantified.
where n
point is the normal vector of the local plane calculated from
k-nearest neighbors, n
PoC is the normal vector of the corresponding regression plane of the point cloud and α is the angle that the two vectors make at each other.
In order to perform the normal vector-based filtration, an angle threshold has to be defined. This threshold defines the maximum deviation of the local normal from the normal vector of the previously estimated regression plane. The recommended value of maximum deviation, based on our experience, is a small value between 2° and 4°. The choice of the threshold depends on the inspected wall. The proposed values mean deviations along 1 m of the structure 35 mm for 2° (in an extreme case it can be caused by nonflatness of the wall) and 70 mm for 4° (means that the subset of the point does not belong to a flat wall). This step removes the points from the segmented cloud that belong to the boundaries and curved parts of structural elements not directly related to the wall plane, e.g., the planes of the floor, ceiling, door frame, etc. (
Figure 7).
However, after normal vector-based filtration, some points are still included in the inliers, while these are not belonging to the wall plane, e.g., points on doors, electrical sockets, paintings on the wall, etc. Therefore, a novel filtration approach based on evolving curves was proposed.
2.2.2. Curve Segmentation
The basic idea is to place a small segmentation curve (usually a circle) into the segmented region and expand the curve until it surrounds all points which belong to the surface of the wall. The evolution of the segmentation curves is driven by the properties of the points in the point cloud, e.g., color, intensity (of reflected laser beams), or distance from the regression plane.
The curve segmentation process consists of three main steps:
Preprocessing: Creation of the input images from the planar point cloud.
Evolution: Curve segmentation of the plane using images.
Postprocessing: Creation of point cloud segments and selection of wall segment.
Preprocessing
To reduce the dimension of the problem, the almost planar point cloud is transformed (rotated and moved) to the new coordinate system in which the first two dimensions span the fitting plane. If we have a point with coordinates
x = (x
1,x
2,x
3), the coordinates x
1 and x
2 describe the position of the point in the plane and the x
3 axis is orthogonal to the regression plane. First, we create a regular square mesh in the x
1, x
2 plane. Then, we represent the properties of the point cloud by a set of pixels (bitmap) images, one image for each property. For example, we take the R (red) channel of color and define the value of each pixel (square of the mesh) as the mean value of the R channel of all points which lie in the pixel. Finally, we rescale the values in each image to the interval [0,1].
Figure 8 shows the image for the intensity channel.
Evolution
The mathematical model is a modification and extension of the model described in more detail in [
39]. The segmentation curve is an evolving closed planar curve with a position vector of its points denoted by
x = (x
1,x
2). The evolution is driven by a suitably designed velocity field
v, therefore, the basic evolution model is:
where ∂
x/∂t denotes the time derivative of the position vector, i.e., the velocity of the point
x. The equation is coupled with an initial condition—the initial curve is a small circle (or multiple circles) placed inside the segmented region.
The velocity
v is considered in the form:
where
N(
x) denotes the positively oriented normal vector at point
x of the curve,
k(
x) is the signed curvature at
x, and ∇ is the gradient operator. The role of the first term
BN is to expand the segmentation curve in the normal direction from its initial shape through the segmented region towards its border, the “blowing” function
B controls the speed of the expansion and is defined using the bitmap images. The idea behind computing the value of
B(
x) for a point x on the curve is to compare the properties at point x to the average of the properties inside the evolving curve. If the properties are similar, the value of
B(
x) is large (the point
x should move fast), if they differ a lot,
B(
x) is small (i.e.,
x should move slowly).
The second term attracts the points of the curve towards the borders of the segmented region. Information regarding borders is contained in the edge detector function
E, which is computed using the gradients of the images (created in preprocessing step). The values of the edge detector
E are close to 0 near edges and close to 1 in homogeneous regions (
Figure 9). The negative gradient of
E points towards the lower values (i.e., edges) and therefore is suitable to attract the segmentation curve towards the edges.
The time-dependent parameter λ(t) ∈ [0,1] serves as a weight between expansion and edge attraction term. The standard approach is to set λ(t) at the beginning of the evolution (t = 0) to a number 0 < λ0 ≪ 1 (i.e., the edge attraction does not dominate), keep it unchanged until the curve is close to the border (moving very slowly) and then switch λ(t) to 1, which turns off the expansion and attracts the curve towards the edges.
The last term kN is called curvature regularization and has a smoothing effect. We use it to deal with the noise and to smooth sharp edges of the segmentation curve, mainly during the expansion phase. The parameter δ(t) weighs the influence of the term.
In practice, we can place many initial curves in the regression plane as well as create new initial curves during the segmentation. As the curves evolve, they can merge (if they have similar average properties inside) and split, too.
Figure 10 shows the final segmentation curves.
Postprocessing
After the evolution process is stopped, the subsets (segments) of the point cloud are created. For each final curve, the corresponding segment of the point cloud by selecting all points that lie in pixels inside the curve is created (in
Figure 10 these pixels are colored by a specific color). As the last step, the segments that correspond to the segmented wall are chosen to obtain the result—the subset of the point cloud containing the points lying on the surface of the verified wall (
Figure 11).
The parameters of the regression plane for wall flatness inspection are estimated from the subset of points after the above-described segmentation procedure. Orthogonal distances are calculated for each point of the segmented subset of points using (12). From the distances, a standard deviation is calculated which reflects the precision of the plane surface determination.
2.3. Creation of Deviation Maps
The last step of the approach for building structures’ geometry verification according to the flowchart in
Figure 1 is the comparison of the as-planned data derived from the BIM model and the as-built data from the point cloud. The deviations are expressed in the form of tables and deviation maps. Two deviation maps are generated for each wall plane. The first deviation map is created by comparison of the plane determined from IFC and the corresponding segmented subset of the point cloud (
Figure 12). The distance of each point from the as-planned plane is calculated in the direction of the plane’s normal vector. The distances are calculated as a dot product of vectors containing the coordinate differences between the given point and the centroid point and the normal vector of the plane. The distances are positive if the point is on the same side of the plane as the normal vector and negative if it is on the opposite side. Considering the general equation of the plane (5) and the fact that the normal vector of the plane is normalized (with length equal to 1), the distances are calculated using Equation (12):
where X
P, Y
P, and Z
P are the coordinates of a given point of the subset.
Subsequently, the points are colored according to the signed distances of the points from the plane. For practical use, especially in case of dense point clouds, the deviation map can be downsampled (e.g., 20 mm × 20 mm) to present the deviation map in the form of more homogeneously distributed points. It can be performed using grid average method, which means that the points within the same grid box are merged to a single point.
In addition to the deviation map, the rotation (difference between the orientation of normal vectors) and the deviation between both planes’ coefficient d are calculated. The rotation of the planes is calculated according to Equation (13):
where n
IFC is the normal vector of the wall plane from the BIM model and n
PoC is the normal vector of the estimated regression plane from the segmented point cloud. The deviation between the two models’ coefficient d is calculated using Equation (14):
where d
IFC is the distance of the IFC plane from the origin of the coordinate system and d
PoC is the distance of the estimated regression plane from the origin of the coordinate system.
The second deviation map (generated for the same wall) quantifies the flatness of the wall (
Figure 13). The flatness of the wall is calculated as the orthogonal distance of each point of the point cloud from the estimated regression plane using (12).
The advantage of the approach described above over existing methods is that a detailed segmentation and filtration of the point cloud is performed. Deleting points not directly related to the surface of the inspected wall increases the accuracy of the results. The biggest contribution of the paper in this field is the developed extended evolving plane curve segmentation, which identifies the openings and the objects not creating the surface of the wall. This is crucial in case of the flatness inspection of the walls, otherwise, the deviation maps will contain false information.