# Wall Structure Geometry Verification Using TLS Data and BIM Model
## 2 Building Structures' Geometry Verification
### Plane Segmentation from Point Clouds
#### 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:  
1. Preprocessing: Creation of the input images from the planar point cloud. 2. Evolution: Curve segmentation of the plane using images. 3. 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 \(\mathbf{x}=(\mathbf{x}_{1}\),\(\mathbf{x}_{2}\),\(\mathbf{x}_{3})\), the coordinates \(\mathbf{x}_{1}\) and \(\mathbf{x}_{2}\) describe the position of the point in the plane and the \(\mathbf{x}_{3}\) axis is orthogonal to the regression plane. First, we create a regular square mesh in the \(\mathbf{x}_{1}\), \(\mathbf{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. Figure 8: Image of intensity (of reflected laser beams). Figure 7: Segmented point cloud—after the normal-based filtration. 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 \(\mathbf{x}=(x_{1},x_{2})\). The evolution is driven by a suitably designed velocity field \(\mathbf{v}\), therefore, the basic evolution model is:  
\[\frac{\partial\mathbf{x}}{\partial\mathbf{t}}=\mathbf{v}, \tag{10}\]  
where \(\partial\mathbf{x}/\partial\mathbf{t}\) denotes the time derivative of the position vector, i.e., the velocity of the point \(\mathbf{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 \(\mathbf{v}\) is considered in the form:  
\[\mathbf{v}=(1-\lambda(\mathbf{t}))B(\mathbf{x})\mathbf{N}(\mathbf{x})+\lambda( \mathbf{t})(-\
abla E(\mathbf{x}))+\delta(\mathbf{t})k(\mathbf{x})\mathbf{N}( \mathbf{x}), \tag{11}\]  
where \(\mathbf{N}(\mathbf{x})\) denotes the positively oriented normal vector at point \(\mathbf{x}\) of the curve, \(k(\mathbf{x})\) is the signed curvature at \(\mathbf{x}\), and \(\
abla\) is the gradient operator. The role of the first term \(B\mathbf{N}\) 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(\mathbf{x})\) for a point \(\mathbf{x}\) on the curve is to compare the properties at point \(\mathbf{x}\) to the average of the properties inside the evolving curve. If the properties are similar, the value of \(B(\mathbf{x})\) is large (the point \(\mathbf{x}\) should move fast), if they differ a lot, \(B(\mathbf{x})\) is small (i.e., \(\mathbf{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).