# Thermal Image and Inverter Data Analysis for Fault Detection and Diagnosis of PV Systems
## 3 Method and Analysis
### Thermal Imaging, Panels Settlement, and Fault Detection  
In this study, a DJI Matrice 300 drone equipped with a DJI Zenmuse H20 T camera developed by FLIR (Wilsonville, OR, USA) was used to capture the thermal images with 640 \(\times\) 512 pixel resolution, at a relative flight height of 35 to 65 m. In the study, varied quantities of images were employed for each site, with the quantity of photos differing based on factors like field size and overlay rates. The drone operated at altitudes of either 35 or 65 m, contingent on the field's features such as slope. The mapping process was facilitated by the utilization of the WebODM 1.9.16 software. Image processing was coded in the Python 3 language using the principal libraries of NumPy, OpenCV, Pillow, and the Detectron 2 package was used for object detection. To conduct an aerial thermal inspection for testing our proposed algorithm, and detect potential faults, the data collected from a total of 10 MWp PV farms in Malatya, Turkive, will hereinafter be referred to as Site-1. Panel detection primarily revolves around the task of recognizing rectangular structures. But as mentioned by [PERSON] et al. [38], accomplishing this task becomes challenging when applied to thermal images. This difficulty arises due to the partial visibility of panel edges, coupled with the interference of irregularities like shadows from weeds, reflections  
Figure 2: Top 15 countries in 2022 for annual installed PV capacity [36]. caused by sunlight, and thermal hot spots. These diagnostic challenges are compounded by various other factors, including variations in flight altitudes, shifts in lighting conditions, the presence of structures resembling panels, the existence of energy lines, and the occurrence of lens distortion in images, as shown in Figure 3. All these factors collectively contribute to the complexity of the background against which the panel detection must be performed. Panel detection is essential for defining the region of interest required in identifying and categorizing anomalies. This is because accurate classification relies on the geometric characteristics within panels or the spaces between them. Rectangular structures are detected and roughly fixed as panels (Figure 4). Since thermal images are raw, that is, under real conditions, they are of poor quality, and therefore, some corners and edges are not fully visible. Therefore, to obtain the exact corner coordinates is needed (Figure 5). In order to attain an accurate estimation, a geometric model for the PV modules is established. The segmented contour is then adjusted to conform to this assumed model, as shown in Figure 6. The resulting rectangular shape possesses distinctive attributes like its longer/shorter edges, center point, and angle. The angle value holds significant importance in this context. It is used to properly find coordinates of each panel. In this rectangular structure, a center point is assigned for each panel with the help of the mask (Figure 7) used from the OpenCV library as in Figure 8. Nevertheless, it is evident that there exists a discrepancy among the designated centers for each panel within the panel block. Despite the accurate count of center points, they fail to accurately represent the actual layout. As can be seen from Figure 9, panel dimensions need to be harmonized with the image. The panel drawing is rearranged to reflect the real situation by using the upper left and lower right corner coordinates of the rectangular structure covering the block and the number of center points assigned to each panel (Figure 10). Hence, the arrangement of the panels is established using thermal images acquired through drone assistance. After placing the panels on the map, the existing faulty panels are marked. The examination of hotspot and bypass diode failures relies on color identification with the aid of OpenCV. Initially, colors are categorized into distinct color groups, and color histograms are generated for a detailed color analysis.