Photovoltaic dirt thermodynamic diagram generation method for cleaning unmanned aerial vehicle
By combining the YOLO algorithm and morphological methods, a heat map of contamination on photovoltaic panels is generated, solving the problem of quantifying contamination on photovoltaic panels and realizing automated decision support for photovoltaic panel cleaning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies make it difficult to quantify the level of dirt on photovoltaic panels, leading to difficulties in cleaning decisions and impacting power generation efficiency.
A method combining the YOLO algorithm and morphology is used to identify photovoltaic modules and array frames. Adaptive threshold segmentation is used to generate photovoltaic contamination heat maps, which are divided into module-level and array-level categories.
It enables automated quantification of the dirt status of photovoltaic panels, generating accurate module-level and array-level thermal maps, supporting efficient cleaning decisions by cleaning drones.
Smart Images

Figure CN121746959A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of photovoltaic module cleaning identification, and particularly relates to a photovoltaic dirt thermal map generation method for cleaning unmanned aerial vehicles. BACKGROUND
[0002] When the surface of a photovoltaic panel in a photovoltaic system is covered with dirt, the power generation efficiency will decrease, and cleaning is needed. However, both cleaning and judging the dirt state require quantitative mastery of the dirt condition of the photovoltaic panel under the photovoltaic scene to provide decision-making reference for subsequent cleaning. In view of the problem that the dirt condition of the photovoltaic panel under the photovoltaic scene is difficult to quantify, the present application provides a photovoltaic dirt thermal map generation method for cleaning unmanned aerial vehicles. SUMMARY
[0003] The present application aims to overcome the problems existing in the prior art and provide a photovoltaic dirt thermal map generation method for cleaning unmanned aerial vehicles. First, a method combining the YOLO algorithm and morphology is used to identify and position the photovoltaic module frame and array frame. Then, a self-adaptive threshold method is used to extract the photovoltaic dirt. Finally, the dirt proportion is calculated, and a photovoltaic panel dirt distribution thermal map is generated.
[0004] To achieve the above technical purposes and achieve the above technical effects, the present application is implemented through the following technical solutions: A photovoltaic dirt thermal map generation method for cleaning unmanned aerial vehicles, which comprises the following steps: Step S1: input and normalization: reading the aerial image and normalizing; Step S2: array boundary extraction: using YOLO to detect the photovoltaic module bounding rectangle, using overlapping block reasoning for super-large images and fusing the results with global non-maximum suppression; using deep learning and morphology to extract the photovoltaic module frame and array frame, so that the array frame and the module frame perfectly fit without gaps, for accurate calculation; generating a binary mask based on the photovoltaic module bounding rectangle and performing morphological dilation / closing operation to realize spatial bridging of adjacent modules, obtaining array-level candidate regions through connected domain labeling, and finally generating array-level outer boundaries through contour extraction+RDP polygon approximation; Step S3: physical segmentation shielding grid: constructing a physical segmentation shielding grid inside each module bounding rectangle, inserting shielding strips in the row direction and column direction according to the equal division rule, and calculating the pixel thickness of the shielding strips from the ratio of the physical width to the ground sampling distance GSD, and performing zero on the pixels covered by the strips; Step S4: three types of dirt species determination: obtaining dirt candidate boxes in the module based on target detection, and dividing the dirt into three types of point, line and sheet according to the threshold of the area of the candidate box relative to the area of the module and the aspect ratio; Step S5: Adaptive threshold segmentation and component-level contamination: Threshold segmentation is performed on the pixels inside each dirty candidate box under the constraint of the shielding grid, only the area of pixels inside the threshold is counted, and the component-level contamination is obtained by normalizing the component area; Step S6: Component-level heat map: The original position of the component bounding rectangle is colored according to the component-level contamination, and a component-level dirty heat map is generated; Step S7: Array-level aggregation and heat map: The threshold pixel area is aggregated in the array range, and the array-level contamination is obtained by normalizing the array area. The array polygon is colored in situ according to the same hierarchical strategy as step S6 to generate an array-level dirty heat map.
[0005] Further, in step S2, the specific steps of array boundary extraction are as follows: Step S21: Masking: rasterize all component rectangular frames to a full zero mask: , for uniform discrete vector frame to pixel domain, facilitate subsequent morphological and topological operation; Step S22: Morphological bridging + connected component segmentation: use rectangular structure element BBB to do dilation / closing operation, stick adjacent components in the array into a whole: , then do 8-neighbor connected component labeling CCL on the result, the same connected block is an array; Step S23: Contour extraction + RDP polygonization: take the outer contour of each array connected block, and simplify it to a polygon with a small number of vertices under the error ε constraint: .
[0006] Further, in step S3, the white lines on the photovoltaic panel background are shielded in a physical way to accurately calculate the effective proportion of dirty pollution on the total area of the photovoltaic panel.
[0007] Further, in step S3, a shielding grid is constructed inside each component frame b=[x1, y1, x2, y2] to suppress the interference of white grid lines on threshold segmentation: Step S31: The number of shielding lines in the row direction is 5, and the frame height is divided into 6 segments; the number of shielding lines in the column direction is 10, and the frame width is divided into 11 segments; Step S32: Let the physical shielding width be the nominal width of the battery grid line or the shielding bandwidth W phys , the pixel thickness of the shielding line is: ; Step S33: Perform a zero operation on the pixel strip covered by each shielding line to achieve the effect of background shielding.
[0008] Further, in step S4, YOLO outputs a set of dirty candidate boxes D in the component, for each candidate box b∈D and its belonging component: set the component area A c , the box width and height w, h, the box area A b =w*h, the aspect ratio AR=max(w, h) / min(w, h), the relative area a=A b / A c , the normalized minimum side: ; Three types of dirt determination method is as follows: Point: And ; Line: And ; Sheet: the rest is classified as sheet.
[0009] Further, in step S5, on the gray scale image after step S3 shielding, the adaptive threshold otsu+threshold bias method is performed in each candidate box, and only the threshold mask pixels inside the candidate box are counted: ; Then the component level pollution degree is: ; And according to three types, A pt , A ln , A pa and the proportion P pt , P ln , P pa are accumulated respectively.
[0010] Further, in step S6, a white background canvas with the same size as the original picture is constructed, and each component is filled with pure color according to f panel .
[0011] Further, in step S7, the array polygon P i , the area: ; Aggregating the threshold area of all candidate boxes under the component: ; Get the array level pollution degree: ; On the same size canvas, P i is colored in place according to the same grading threshold as the component level, and the array level heat map is output, and the array level three type proportion , , .
[0012] The beneficial effects of this invention are: The method of this invention can output component-level / array-level heat maps that are registered to the same size as the original image. It has a high degree of automation and divides the contamination heat maps into component-level and array-level categories, allowing for the use of the appropriate heat map level for different needs. Attached Figure Description
[0013] Figure 1 This is a TIFF orthophoto image read in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the principle of overlapping block inference and global NMS fusion processing of TIFF graphs in this invention. Figure 3 The YOLO detection frame for photovoltaic modules is the present invention. Figure 4 This is a component array diagram of the present invention; Figure 5 This is a flowchart of the photovoltaic array frame extraction process of the present invention; Figure 6 The physical segmentation of the shielding mesh lines in this invention; Figure 7 This is a schematic diagram illustrating the calculation of the area ratio of the white background line in this invention; Figure 8 This is a schematic diagram illustrating the background white line interference with dirt detection in this invention. Figure 9 This is a schematic diagram illustrating the determination of the three types of dirt categories according to the present invention; Figure 10 This is a schematic diagram illustrating the calculation of the percentage of dirt on photovoltaic modules / arrays according to the present invention; Figure 11 This is a schematic diagram of the photovoltaic dirt mask generation according to the present invention; Figure 12 The present invention provides heat maps of contamination at the photovoltaic module level and array level, wherein (a) is a heat map of contamination at the photovoltaic module level and (b) is a heat map of contamination at the photovoltaic array level. Detailed Implementation
[0014] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0015] A method for generating photovoltaic dirt heat maps for cleaning drones, the method comprising the following steps: Step S1: Input and Normalization: Read and normalize the aerial survey images. In this embodiment, images such as TIFF / PNG / JPG can be read. Figure 1The image shown is a TIFF orthophoto; the 16 / 32-bit TIFF was normalized to 8 bits using quantile stretching, unified to BGR and generated as a grayscale image; the ground sampling distance GSD (unit: mm / pixel) was recorded, and the YOLOv8 model was used to train and detect the component boxes; Step S2: Array Boundary Extraction: YOLOv8 is used to detect the bounding rectangle of the photovoltaic module. Overlapping block inference is used for the ultra-large image, and global nonmaximum suppression is applied to suppress the fusion result. Deep learning and morphological methods are used to extract the photovoltaic module box and array box, so that the array box and the module box fit perfectly without gaps, so as to facilitate accurate calculation. A binary mask is generated based on the bounding rectangle of the photovoltaic module and morphological dilation / closing operations are performed to realize the spatial bridging of neighboring modules. The array-level candidate region is obtained by connecting component labeling. Finally, the array-level outer boundary is generated by contour extraction + RDP polygon approximation. Step S3: Physically divide the shielding mesh (i.e., shielding line pixel thickness = physical width / GSD): Construct a physically divided shielding mesh inside the bounding rectangle of each component, insert shielding strips in the row and column directions according to the equal division rule, and calculate the pixel thickness of the shielding strip by the ratio of the physical width to the ground sampling distance GSD, and set the pixels covered by the strip to zero. Step S4: Determination of three types of dirt: Based on target detection, candidate dirt boxes are obtained within the component, and dirt is classified into three types: point-like, line-like, and sheet-like, according to the threshold of the area of the candidate box relative to the area of the component and the aspect ratio. Step S5: Adaptive threshold segmentation and component-level contamination: Under the constraint of the masked mesh, threshold segmentation is performed on the pixels inside each contamination candidate box. Only the area of pixels within the threshold is counted, and the component-level contamination is obtained by normalizing the component area. Step S6: Component-level heat map: Color the original position of the outer rectangle of the component according to the component-level contamination degree and generate a component-level contamination heat map; Step S7: Array-level aggregation and heatmap: Aggregate the pixel area within the threshold within the array range and normalize it with the array area to obtain the array-level contamination degree. Generate an array-level contamination heatmap by in-situ coloring the array polygons according to the same hierarchical strategy as in step S6.
[0016] In step S2, to ensure the accuracy of the photovoltaic contamination ratio calculation, the four sides of the array detection frame should completely coincide with the outermost component frame. However, common target detection algorithms such as YOLO cannot achieve this. To address this issue, this invention employs a processing method combining deep learning and morphological operations: such as... Figure 2 As shown, the YOLO algorithm is first used to perform component-level object detection (sliding window + NMS deduplication) on the ultra-large TIFF image, and then the detection boxes are rasterized into a binary mask, as shown. Figure 3As shown, spatial bridging of neighboring components is achieved using morphological dilation / closing operations. Array-level candidate regions are obtained through connected component labeling. Finally, array-level outer boundaries are generated using contour extraction and RDP polygon approximation. Figure 3 As shown; this design combines the robust detection capabilities of YOLO with the interpretability and controllability of traditional methods at the geometric and topological level. The specific steps for array boundary extraction are as follows: Step S21: Masking: Rasterize all component rectangles onto a single all-zero mask. This is used to unify discrete vector boxes into the pixel domain, which facilitates subsequent morphological and topological operations. Step S22: Morphological bridging + connected component partitioning: Use the rectangular structuring element BBB to perform dilation / closing operations to glue adjacent components within the array into a whole: Then, perform 8-neighborhood (i.e., a pixel and its neighbors in 8 directions including top, bottom, left, right and four diagonals) CCL (Connected Component Labeling) on the results. The same connected component is an array. Step S23: Contour Extraction + RDP (Ramer–Douglas–Peucker) Polygonization: Take the outer contour of each array connected component and simplify it into a polygon with a small number of vertices using RDP under the error ε constraint, such as... Figure 4 and Figure 5 As shown: .
[0017] In step S3, the white lines on the background of the photovoltaic panel are physically shielded to accurately calculate the effective proportion of dirt to the total area of the photovoltaic panel.
[0018] In step S3, such as Figure 7 and Figure 8 As shown, a masking mesh is constructed inside each component box b=[x1,y1,x2,y2] to suppress the interference of white grid lines on threshold segmentation: Step S31: The number of shielding lines in the row direction is 5, and the frame height is divided into 6 equal segments; the number of shielding lines in the column direction is 10, and the frame width is divided into 11 equal segments; Step S32: Set the physical shielding width to the nominal width of the battery grid line or the required shielding bandwidth W. phys The pixel thickness of the shielding line is: ; Step S33: Perform a zeroing operation on the pixel strips covered by each shielding line to achieve the effect of background shielding, such as... Figure 6 As shown.
[0019] In step S4, YOLO outputs a set D of dirty candidate boxes within the component. For each candidate box b∈D and its component: let the component area A c Frame width and height w, h, frame area A b =w*h, aspect ratio AR=max(w,h) / min(w,h), relative area a=A b / A c Normalized minimum edge: ; There are two types of contamination heatmaps: component-level and array-level. The appropriate heatmap level is used for different needs. The contamination level thresholds for component-level and array-level heatmaps are the same, and the heatmaps are displayed in situ on a canvas of the same size as the original image. Figure 9 As shown, the methods for determining the three types of dirt are as follows: Dot-like: and (like , ); Linear: and (like , ); Flake-like: The rest are classified as flake-like.
[0020] In step S5, on the grayscale image after masking in step S3, as follows: Figure 10 As shown, an adaptive thresholding method (otsu + threshold bias) is applied to the interior of each candidate box, counting only the threshold mask pixels within the candidate box. ; The component-level contamination level is then: ; And A is obtained by accumulating the results according to the three categories respectively. pt A ln A pa With proportion P pt P ln P pa .
[0021] In step S6, a white canvas of the same size as the original image is constructed, and f is pressed. panel Fill the outer rectangle of each component with a solid color in its original position, such as Figure 11 and Figure 12 As shown. Examples of tiered thresholds: L0: ≤5%, L1: 5–15%, L2: 15–30%, L3: ≥30%.
[0022] In step S7, the array polygon P i ,area: ; Aggregate the threshold area of all candidate boxes of its components: ; Array-level contamination level is obtained: ; P on the same size canvas i The array-level heatmap is output using in-situ coloring with the same hierarchical threshold as the component level, as shown below. Figure 12 As shown, the proportions of the three types of arrays are statistically analyzed. , , .
[0023] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for generating photovoltaic dirt heat maps for cleaning drones, characterized in that, The method includes the following steps: Step S1: Input and Normalization: Read and normalize the aerial survey images; Step S2: Array Boundary Extraction: YOLO is used to detect the bounding rectangle of the photovoltaic module. Overlapping block inference is used for the ultra-large image, and global non-maximum suppression is applied to suppress the fusion result. Deep learning and morphological methods are used to extract the photovoltaic module box and array box, so that the array box and the module box fit perfectly without gaps, so as to facilitate accurate calculation. A binary mask is generated based on the bounding rectangle of the photovoltaic module, and morphological dilation / closing operations are performed to realize the spatial bridging of neighboring modules. The array-level candidate region is obtained by connecting component labeling. Finally, the array-level outer boundary is generated by contour extraction + RDP polygon approximation. Step S3: Physically divide the shielding mesh: Construct a physically divided shielding mesh inside the bounding rectangle of each component, and insert shielding strips in the row and column directions according to the equal division rule. The pixel thickness of the shielding strip is calculated by the ratio of the physical width to the ground sampling distance GSD, and the pixels covered by the strip are set to zero. Step S4: Determination of three types of dirt: Based on target detection, candidate dirt boxes are obtained within the component, and dirt is classified into three types: point-like, line-like, and sheet-like, according to the threshold of the area of the candidate box relative to the area of the component and the aspect ratio. Step S5: Adaptive threshold segmentation and component-level contamination: Under the constraint of the masked mesh, threshold segmentation is performed on the pixels inside each contamination candidate box. Only the area of pixels within the threshold is counted, and the component-level contamination is obtained by normalizing the component area. Step S6: Component-level heat map: Color the original position of the outer rectangle of the component according to the component-level contamination degree and generate a component-level contamination heat map; Step S7: Array-level aggregation and heatmap: Aggregate the pixel area within the threshold within the array range and normalize it with the array area to obtain the array-level contamination degree. Generate an array-level contamination heatmap by in-situ coloring the array polygons according to the same hierarchical strategy as in step S6.
2. The method for generating photovoltaic dirt heatmaps for cleaning drones according to claim 1, characterized in that, In step S2, the specific steps for array boundary extraction are as follows: Step S21: Masking: Rasterize all component rectangles onto a single zero mask: M[y1:y2, x1:x2] = 1, used to unify discrete vector boxes into the pixel domain, facilitating subsequent morphological and topological operations; Step S22: Morphological bridging + connected component partitioning: Use the rectangular structuring element BBB to perform dilation / closing operations to glue adjacent components within the array into a whole: The results are then labeled with 8-neighbor connected components (CCL), with each connected component forming an array. Step S23: Contour Extraction + RDP Polygonization: Extract the outer contour of each array connected component and simplify it into a polygon with a small number of vertices using RDP under the error ε constraint.
3. The method for generating photovoltaic dirt heatmaps for cleaning drones according to claim 2, characterized in that, In step S3, the white lines on the background of the photovoltaic panel are physically shielded to accurately calculate the effective proportion of dirt to the total area of the photovoltaic panel.
4. The method for generating photovoltaic dirt heat maps for cleaning drones according to claim 3, characterized in that, In step S3, a masking mesh is constructed inside each component box b = [x1, y1, x2, y2] to suppress the interference of white grid lines on threshold segmentation. Step S31: The number of shielding lines in the row direction is 5, and the frame height is divided into 6 equal segments; the number of shielding lines in the column direction is 10, and the frame width is divided into 11 equal segments; Step S32: Set the physical shielding width to the nominal width of the battery grid line or the required shielding bandwidth W. phys The pixel thickness of the shielding line is: thickness px =w phys / GSD; Step S33: Perform a zeroing operation on the pixel strips covered by each shielding line to achieve the effect of background shielding.
5. The method for generating photovoltaic dirt heatmaps for cleaning drones according to claim 4, characterized in that, In step S4, YOLO outputs a set D of dirty candidate boxes within the component. For each candidate box b∈D and its component: let the component area A c Frame width and height w, h, frame area A b =w*h, aspect ratio AR = max(w,h) / min(w,h), relative area a = A b / A c Normalized minimum edge: The methods for determining the three types of dirt are as follows: Dot-like: and Linear: and Flake-like: The rest are classified as flake-like.
6. The method for generating photovoltaic dirt heatmaps for cleaning drones according to claim 5, characterized in that, In step S5, on the grayscale image after masking in step S3, an adaptive thresholding method (ot su + threshold bias) is applied to the interior of each candidate box, and only the threshold mask pixels inside the candidate box are counted. The component-level contamination level is then: And A is obtained by accumulating the results according to the three categories respectively. pt A ln A pa With proportion P pt P ln P pa .
7. The method for generating photovoltaic dirt heatmaps for cleaning drones according to claim 6, characterized in that, In step S6, a white canvas of the same size as the original image is constructed, and f is pressed. panel Fill the outer rectangle of each component with a solid color in its original position.
8. The method for generating photovoltaic dirt heatmaps for cleaning drones according to claim 7, characterized in that, In step S7, the array polygon P i ,area: Aggregate the threshold area of all candidate boxes of its components: Array-level contamination level is obtained: P on the same size canvas i The array-level heatmap is output using the same hierarchical threshold as the component-level heatmap, and the proportions of the three array-level categories are statistically analyzed.