3.2.1. Removal of Mixed Pixels

The scan data of a high formwork usually include multiple objects such as vertical poles, horizontal tubes, couplers, braces, bolts, ground, timber formwork, and so on. Construction sites include other unexpected noise, including construction equipment, workers, and etc. In order to retain useful data relating to poles and tubes, the others must be removed. Unfortunately, mixed pixels that are a type of false measurement are always included in the laser scan data [49]. It occurs when a laser beam is split into two parts and falls on two different objects. Hence, the laser scanner obtains two reflective signals that are from two different objects, and then generates the mixed pixel measurements that cannot represent either of the two objects [57–60].

As mixed pixels adversely influence the recognition of the poles and tubes, it is necessary to remove the mixed pixels before further processing of the point data. Since mixed pixels are located at greater distances from their neighbours [57], an algorithm based on the average distance from one point to its k-nearest neighbours was employed in this study. If the average distance is bigger than a threshold value, the point is considered to be a mixed pixel. Moreover, in this study, colour information of the point data was used to filter out the mixed pixels. Steel poles and ledgers usually have substantially different colours so that pixels will experience large colour changes. The proposed method regards both the distance value and the average colour difference *dRGB* between one point and its surrounding *k* neighbours. The colour difference can be calculated in Equation (1).

$$d\_{RGB} = \frac{\sum\_{i=1}^{k} \sqrt{\left(R\_i - R\_0\right)^2 + \left(G\_i - G\_0\right)^2 + \left(B\_i - B\_0\right)^2}}{k},\tag{1}$$

where (*<sup>x</sup>*0, *y*0, *z*0) and (*R*0, *G*0, *B*0) are the coordinates and RGB values of this point, respectively, and (*xi*, *yi*, *zi*) and (*Ri*, *Gi*, *Bi*) are the coordinates and RGB values of the *i*th neighbor, respectively.

Based on distance value and colour difference, a discriminant analysis can be conducted to classify the valid data and mixed pixels clearly, as shown in Figure 4. The irrelevant data can be removed from the scan data. This step aims to retain data associated with standard poles and ledgers and remove other scan data as outliers. The proposed method is expected to generate more reliable results than conventional methods.

**Figure 4.** Remove mixed pixels (**a**) using distance value, (**b**) using both distance and color difference value.

3.2.2. Extraction of Scan Data Associated with Poles and Tubes

As the high formwork mainly composed of vertical cylindrical poles and horizontal cylindrical tubes, upright poles and horizontal tubes have distinctive geometries and positions that differ from other objects. Hence, both geometries and positions of the scan points were used for classification. The proposed data extract method consists of six steps, as shown in Figure 5.

**Figure 5.** Data extraction method.

An array of Z-planes (Parallel to the XY plane) with a certain interval was inserted to the refined point cloud data and the data was projected onto the Z planes, as shown in Figure 6. For each slice, the point cloud data were projected on to the Z plane, as shown in Figure 7.

**Figure 6.** Horizontal slices with a certain interval.

**Figure 7.** X-Y projection of point cloud data of a pole on a slice.

Since a vertical pole is circular in section, the data in every Z plane were clustered in a circle. The region growing algorithm [61] was used to add more points to the points clusters within a certain radius (the radius of a pole). The algorithm iteratively explores the point clusters and adds more neighbor points to the clusters in order to form a circular shape with a certain radius until all the points clusters in the array of Z planes have been checked. If a point does not belong to any of the clusters, it can be seen as an outlier to be removed. The remaining data in every Z plane were corrected in MATLAB by fitting a simple circle based on the section formation of a standard pole. Based on the points the boundary of the poles and tubes can be detected. The centre and diameter of a pole are then fitted according to the detected boundary, as shown in Figure 8. As the same pole has the similar XY coordinates, Equation (2) was used to evaluate whether the point belong to the pole or not.

$$(\mathbf{x} - \mathbf{x}\_i)^2 + (y - y\_i)^2 \le p,\tag{2}$$

where *x*, *y* is the coordinates of the vertical pole; *xi*, *yi* is the coordinate of the *i* point; *p* is the threshold value.

The centre points of the circles on each Z planes belonging to the same pole can be determined, as shown in Figure 9. A line fitting algorithm in MATLAB was used to fit the centre points in each Z plane to obtain the vertical pole, as shown in Figure 10. Every vertical pole can be extracted. If the model set is subjected to deformation, data can be fitted with higher order polynomials for accurate representation. The same methods were used to extract every horizontal tube, although in that case an array of X-planes was inserted for the extraction of the longitudinal tubes and an array of Y-planes were inserted for the extraction of the transverse tubes. The thickness and the interval of the inserted planes are highly related to the size and density of the point data.

**Figure 8.** Boundary detection (**a**) rough boundary, (**b**) fine boundary.

**Figure 9.** The centroid of fitted circles.

**Figure 10.** Identification of a vertical stand pole (**a**) potential line representing a vertical pole, (**b**) 3D line fitting.

This method has several potential advantages. First, it can collect sufficient data for individual poles to facilitate the recognition process. Second, the outliers can be removed effectively. Third, the incomplete scanning of standard poles due to the occlusion of line-of-sight by other objects can be corrected using the region growing technique.

The attained lines representing the poles were checked to determine whether they were vertical to the plane XOY. And the lines indicated tubes were checked to determine whether they were perpendicular to the plane YOZ. The projection of an inclined pole on the XOY plane is shown in Figure 11. If the distance between the leftmost and rightmost centroids are larger than a threshold value, it indicates the pole is not vertical to the XOY plane. Then the pole that is not vertical to the planes should be filtered out to check its inclination value. The pole should be considered a defect that is not follow the building code rule. The rule states that all poles should be perpendicular to the ground and all tubes should be parallel to the ground. Hence, the pole or the tube should be re-installed to correct the defect.

**Figure 11.** Intersections of a pole projected on XOY plane (**a**) inclined pole, (**b**) upright pole.

In this study, a pole and a tube of the small-scale high formwork model were inclined on purpose to validate the proposed method. The proposed method can identify the pole and the tube that are not properly installed. Next, the cross points of lines that represent poles and tubes were generated. The cross points are disk lock nodes, which are considered important points in this study. The further ANN model was developed to generate accurate coordinates of the key points in order to accurately calculate the spacing of the pole and the lift height. Such data are important for building code requirements.

The longitudinal spacing of pole can be calculated in Equation (3).

$$d\_{li} = \sqrt{\left(\mathbf{x}\_{i+1} - \mathbf{x}\_i\right)^2} \tag{3}$$

The transverse spacing of pole can be calculated in Equation (4).

$$d\_{ti} = \sqrt{\left(y\_{i+1} - y\_i\right)^2},\tag{4}$$

The lift height (space between two neighboring tubes) can be calculated in Equation (5).

$$s\_i = \sqrt{\left(z\_{i+1} - z\_i\right)^2},\tag{5}$$

where *xi*, *yi*, *zi* indicate the coordinates of the *i* point.
