Automatic planes segmentation MATERIALS AND METHODS 1 Equipment

2.2.2 3D point cloud reconstruction

The image-based modelling technique based on the combination of photogrammetry and computer vision algorithms allows the reconstruction of dense 3D point clouds. The absolute orientation position and attitude of each image is known because the position of the imaging sensors is registered with respect to the GNSSIMU navigation devices of the aerial trike, and data acquisition is synchronized with the navigation. For this reason, only the dense matching process is required, taking as basis the semi-global matching technique SGM Deseilligny and Clery, 2011; Gehrke et al., 2010; Hirschmuller, 2005. This procedure allows the generation of a dense and scaled 3D model Figure 4 resulting from the determination of the 3D coordinates of each pixel using homologous points between images. This process is performed using the RGB images because their higher resolution provides a 3D point cloud with higher point density than the point cloud generated from the thermographic images. On the other hand, the transmission of the thermographic texture to the point cloud is developed through the computation of the spatial resection Kraus, 1993 of the thermographic images using as reference the 3D point cloud obtained from the RGB images, identifying homologous entities key points between each image and the point cloud. The identification of homologous entities entails great complexity since the radiometry of the thermographic images represents a temperature value not directly related to the intensity level represented in the point cloud. For this reason, the identification of the maximum number of significant features possible in each thermographic image is essential to minimize the error in the computation of the external orientation parameters. The result obtained is a 3D dense point cloud with the thermographic information mapped of the study case from a bird’s eye view Figure 5. Figure 4: Example of 3D point cloud 2.179.610 points generated from images captured with the RGB camera. Area: 23040m 2 . Resolution: 100 pointsm 2 . Figure 5: Previous 3D point cloud 2.179.610 points with the thermographic texture mapped on the roofs. In order to generate additional metric products to support the study from the dataset captured orthoimages which integrated thermographic information were generated. The process to generate these orthothermograms consists on the projection of the texture of the images to the mesh generated from the point cloud. Then the texture of the mesh is projected in a horizontal reference plane using an orthogonal projection, obtaining an image with geometric scale and no distortion, in such way that the measurement of a distance on the image, multiplied by the scale, results in the measurement in the reality.

2.2.3 Automatic planes segmentation

Once the 3D point cloud is generated from the RGB images and the thermographic texture is mapped, the following procedure is the segmentation of the roofs. This will be performed in different steps using the Point Cloud Library PCL Rusu and Cousins, 2011, open source and licensed under BSD Berkeley Software Distribution terms, which includes a collection of state-of-the- art algorithms and tools useful for 3-D processing, computer vision and robotic perception. First, ground and vegetation are removed using a pass through filter with a Z coordinate restriction. A pass through filter performs a simple filtering along a specified dimension removing the elements that are either inside or outside a given range. In this case the filter gets the minimum Z value of the point cloud and removes all points with a Z value close to the minimum Z. The distance threshold is established as a parameter set for the user, being 5 m a recommendable value, established experimentally by the authors after the segmentation of several point clouds. In addition, although the presence of points belonging to the facades is minimal due to the vertical configuration of the capture, a conditional filter based on the angle between the normal vector of each point and the vertical axis is applied to remove these points. Then, the point cloud representing all roofs is segmented using a Euclidean cluster segmentation Figure 6 allowing better and faster results for the subsequent extraction of the different planes of each roof Gallo et al., 2011; Hulik et al., 2014 by dividing the point cloud in individual roofs. This way, RANSAC Random Sample Consensus algorithm is applied to each roof individually for the extraction of the composing planes, with an important reduction in the number of iterations given that the number of planes per roof is limited. RANSAC is an iterative method used to estimate parameters of a mathematical model from a dataset Fischler and Bolles, 1981. The RANSAC algorithm assumes that all the data is comprised of both inliers and outliers. Inliers can be explained by a model with a particular set of parameter values, while outliers do not fit that model under any circumstance. The input to the RANSAC algorithm is the dataset to evaluate, a parameterized model which can explain or be fitted to the dataset and some confidence parameters to adjust the results of the algorithm to the desired output. RANSAC achieves its goal by iteratively selecting a random subset of the original data that will be hypothetical inliers and this hypothesis is then tested as follows: A model is fitted to the hypothetical inliers, i.e. all free parameters of the model are reconstructed from the inliers. All other data are then tested against the fitted model and, if a point fits well to the estimated model, it is also considered as a hypothetical inlier. The estimated model is reasonably good if there are a considerable number of points classified as hypothetical inliers. Then, the model is recalculated using all the hypothetical inliers, improving the results of the initial computation performed from the initial set of hypothetical inliers. Finally, the model is evaluated by estimating the error of the inliers relative to the model. This procedure is repeated a This contribution has been peer-reviewed. doi:10.5194isprsarchives-XL-5-W4-171-2015 174 fixed number of times, each time producing either a model which is rejected because the number of points classified as inliers is too limited or a refined model together with a corresponding error value. The process finishes when the mathematical model fits the dataset according to the parameters specified. Once each roof is clustered in different planes Figure 7, and the coefficients that describe each surface in a Cartesian coordinate system by the general equation of the plane are known eq. 2, the geometric evaluation is performed, resulting in the orientation, slope and energy loss values for each surface. Figure 6: Result of the extraction of each roof using the Euclidean cluster extraction algorithm. Figure 7: Results of the extraction of each planar surface using the RANSAC algorithm applied in different roofs. Ax By Cz D    2 From the components A, B and C of the general equation of the plane that match with the values of the vector normal to the plane Eq. 3 we can proceed to compute the orientation and slope values. To obtain the orientation of the surface is necessary calculate the angle between the projection of the vector v on the horizontal plane and the Y Cartesian axis Eq. 4 evaluating the quadrant to which it belongs to obtain de orientation angle Eq. 5 to 8 Figure 8. , , v A B C  3 A arcTan B   4 1st Quadrant: 180º Or    5 2nd Quadrant: Or    6 3rd Quadrant: Or   7 4th Quadrant: 200 Or    8 Where: v = vector normal to the plane. , A B and C = parameters from the general equation of the plane.  = Angle between the horizontal projection of the normal vector and the Y Cartesian axis. Or = Orientation of the plane. Figure 8: Absolute orientation of the slope from the angle between the projection of the vector v on the horizontal plane and the Y Cartesian axis. The slope of the surface is calculated by a simple trigonometric process in a right-angled triangle where the normal vector is considered the hypotenuse and its projection on the Z = 0 plane and C value the adjacent and opposite legs respectively Figure 9 Eq. 9 to 11. This contribution has been peer-reviewed. doi:10.5194isprsarchives-XL-5-W4-171-2015 175 Figure 9: Inclination of the slope from the values of the normal vector of the plane. 2 2 d A B   9 C arcTan d   10 90º Incl    11 Where: v = vector normal to the plane. , A B and C = parameters from the general equation of the plane. d = Module of the vector v projected on the horizontal plane Z = 0.  = Angle between the horizontal plane Z = 0 and the normal vector of the surface. Incl = Inclination of the plane. 2.2.4 Geometric analysis and classification Once the different planes of the roofs are detected and segmented, its area, slope and orientation is analysed in order to perform their geometric classification. The roofs with an area smaller than the necessary for the installation of solar panels and those with North orientation are discarded. The remaining roofs are classified in different groups according to their theoretical productivity due to their inclination and orientation Figure 10 and 11, taking into account the possibilities of integrating the solar panels in the roof and installing them in configurable supports. The CTE sets the South orientation as the optimum position for these elements, with a slope equal to the latitude where they are installed. However, the limits on the inclination can be computed according to the minimum efficiency allowed for the orientation of the surface using the method explained by the IDAE Institute for Diversification and Saving of Energy Eq. 12 and 13 IDAE, 12 Jan. 2015. These limits allow the evaluation of the suitability of the surface under study and the computation of the ideal geometry of the support platforms if needed, taking into account that losses cannot exceed the 20 if solar panels are installed using the overlapping which implies the installation of solar panels directly over the roofs not changing the angle of solar incidence regarding to the slope of the surface where they are installed technique and the 10 using the general method which implies the installation of solar panels in supports to modify the angle of solar incidence regarding to the slope of the surface where they are installed. Figure 10: Diagram for the estimation of solar losses by orientation and inclination Latitude 41º IDAE. The radial lines set the orientation of the surface. The concentric circles sets the slope of the surface. The texture found in the intersection of these parameters gives the losses by inclination and orientation of the roof Source: IDAE. Figure 11. Details of the previous point cloud segmented and classified by its suitability to install solar panels. Green Surfaces suitable to install solar panels without supports. Yellow Surfaces suitable to install solar panels using a support to modify the solar incidence angle. Red Surfaces not suitable to install solar panels. This contribution has been peer-reviewed. doi:10.5194isprsarchives-XL-5-W4-171-2015 176 If 5     2 4 5 2 100 1.2 10 10 3.5 10 Losses                   If 5     2 4 100 1.2 10 10 Losses              13 Where = slope = azimuth � = latitude.

2.2.5 Thermographic refinement of surfaces