# Detection and Optimization of Photovoltaic Arrays' Tilt Angles Using Remote Sensing Data
## 2 Methodology
### Three-Dimensional Reconstruction of Detected Modules Using LiDAR Data  
At first, the LiDAR point cloud data are classified into buildings, terrain, and vegetation, which can be performed by using any point cloud semantic segmentation model such as FKAConv [43] (see Figure 4a). This point cloud is then inserted into a 2.5D equidistant topological grid \(G\) with a predefined resolution of \(res_{G}\) [m\({}^{2}\)]. This is vital since the point cloud does not inherently possess any topological information. The height and class of each individual cell is determined by the highest point \(p_{j}\) located within a given cell \(c_{i}\in G\), as follows:  
\[(c_{i}.z,\text{class}(c_{i}))=\bigg{(}\max_{p_{j}\in c_{i}}(p_{j}.z),\text{ class}\bigg{(}\arg\max_{p_{j}\in c_{i}}p_{j};z\bigg{)}\bigg{)}. \tag{1}\]  
In case some cells are empty due to varying point cloud densities from artifacts such as multiple laser reflections, the cell's values are filled with Inverse Distance Weighting (IDW) interpolation, as follows:  
\[c_{i}=\bigg{(}\frac{\sum_{k=1}^{\mathcal{N}(c_{i})}|w_{k}\cdot h_{k}}{\sum_{k= 1}^{\mathcal{N}(c_{i})}|w_{k}},\text{ mode }\{\text{class}(c_{k})\mid c_{k}\in\mathcal{N}(c_{i})\}\bigg{)}\text{ if }c_{i}=\emptyset, \tag{2}\]  
where \(\mathcal{N}\) is a set of neighboring cells of \(c_{i}\) and \(w_{k}=\frac{1}{|c_{i}-c_{k}|^{2}}\). Consequently, the grid \(G\) resembles a digital surface model (DSM), but with the added distinction that the cells are classified (see Figure 4b). The normal vector \(\mathbf{n}_{i}\) of each cell \(c_{i}\) is determined using the best-fit plane algorithm [44], considering the points \(P\) located within a given cell and its neighboring cells based on the 8-neighborhood. This is performed by minimizing the  
Figure 4: Visualization of example 3D reconstruction and grouping of modules: (**a**) raw classified point cloud data into terrain, buildings, and vegetation; (**b**) constructed 2.5D grid; (**c**) reconstruction of 3D modules; (**d**) colored by DBSCAN-based grouping (i.e., for each array). sum of squared distances from \(P\) to the plane, where a covariance matrix is constructed, as follows:  
\[C_{i}=\sum_{j=1}^{|P|}(p_{j}-\bar{p})(p_{j}-\bar{p})^{T};\quad p_{j}\in P, \tag{3}\]  
where \(\bar{p}\) is the centroid of \(P\). After the eigendecomposition of \(C_{i}\), the eigenvector corresponding to the smallest eigenvalue of \(C_{i}\) is the normal vector \(\mathbf{n}_{i}\). The tilt (inclination) \(\beta_{i}\) and aspect (orientation) \(\gamma_{i}\) angles of a given cell \(c_{i}\) can then be estimated directly from \(\mathbf{n}_{i}\) as follows:  
\[\beta_{i} = \frac{\pi}{2}-\arccos\left(\frac{\mathbf{n}_{i}.z}{\sqrt{\mathbf{ n}_{i}.x^{2}+\mathbf{n}_{i}.y^{2}+\mathbf{n}_{i}.z^{2}}}\right), \tag{4}\] \[\gamma_{i} = \arccos\left(\frac{\mathbf{n}_{i}.y}{\sqrt{\mathbf{n}_{i}.x^{2}+ \mathbf{n}_{i}.y^{2}}}\right). \tag{5}\]  
The grid retains the geographic coordinate system used by the georeferenced LiDAR point cloud. As a result, it can be seamlessly integrated with information about 2D modules detected in VHR imagery, provided that the VHR and LiDAR datasets share the same geographic coordinate system. The tilt (inclination) and aspect (orientation) angles for a given module \(PVM\) are then estimated as follows:  
\[PVM_{\beta}=\frac{1}{n}\sum_{i}^{n}\beta_{i},\quad PVM_{\gamma}=\frac{1}{n} \sum_{i}^{n}\gamma_{i}, \tag{6}\]  
where \(\beta_{i}\) and \(\gamma_{i}\) belong to \(n\) cells spatially overlapping the given \(PVM\) in the XY plane.