Stain identification method and device applied to photovoltaic panel and medium
Through the combination of generative adversarial network and sparse optical flow algorithm, the stains on the photovoltaic panel are identified, which solves the accuracy and cost of photovoltaic panel stain recognition in light changes and diverse scenarios, and achieves efficient and accurate stain detection.
Patent Information
- Application Number
- CN202510531124.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-15
AI Technical Summary
The prior art cannot effectively identify stains on photovoltaic panels, especially in the changing lighting conditions and diversified application scenarios, and the multi-source image fusion method is costly and complex.
Generative adversarial network is used to generate stain-free reference images, combine grayscale threshold and area segmentation algorithm for stain recognition, and calculate the speed vector through sparse optical flow algorithm to analyze the dynamic characteristics of stains and reflective areas.
It realizes high-precision and low-cost stain recognition, adapts to different lighting conditions and changes in inclination angle of photovoltaic panels, improves detection efficiency and accuracy, and avoids misjudgment caused by lighting changes.
Smart Images

Figure CN120495949A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine vision technology, and in particular to a stain recognition method, device and medium applied to photovoltaic panels. Background Art
[0002] Stains such as bird droppings attached to the surface of photovoltaic panels can significantly reduce power generation efficiency. Specifically, on the one hand, bird droppings block areas that hinder light penetration, resulting in local battery cell current mismatch; at the same time, long-term accumulation may induce hot spot effects, accelerate battery cell aging or even burn out; more notably, distributed stains will damage the anti-reflective coating on the panel surface, causing permanent optical loss.
[0003] Traditional manual inspections are inefficient, especially for large-scale photovoltaic power stations. A single inspection takes too long, so automated detection technology is needed to accurately identify stains.
[0004] Currently, the technologies used to identify stains on photovoltaic panels mainly include static image analysis based on threshold segmentation, image recognition based on deep learning, and detection based on multi-source image fusion. However, these technologies all have certain limitations, as follows: 1. The static image analysis method based on threshold segmentation relies on a fixed grayscale threshold to distinguish stains from normal areas. However, this method is easily affected by changes in lighting conditions. For example, changes in reflection intensity caused by cloud movement may misjudge reflections as stains, thereby reducing detection accuracy.
[0005] 2. Although deep learning-based image recognition methods can automatically extract features, they require a large number of labeled samples for training. However, it is difficult to obtain a sufficient number of stain samples such as bird droppings in actual scenarios. Moreover, when the model is deployed in different regions, due to differences in factors such as ambient lighting and the inclination of photovoltaic panels, its generalization performance is often insufficient, making it difficult to adapt to diverse application scenarios.
[0006] 3. In addition, although the detection method based on multi-source image fusion has improved the detection accuracy to a certain extent, its data acquisition and processing process is relatively complicated and has high requirements for hardware equipment, which increases the cost and complexity of the system. Summary of the Invention
[0007] The present invention provides a stain identification method, device and medium applied to photovoltaic panels, which are used to solve at least one of the above technical problems.
[0008] The present invention adopts the following technical solutions: In a first aspect, the present invention provides a stain recognition method applied to photovoltaic panels, the method comprising: preprocessing an original image in a photovoltaic panel video to generate a preprocessed image, the preprocessing comprising cropping, stretching and grayscale adjustment; using a preset generative adversarial network model to generate a stain-free reference image based on the preprocessed image; extracting a portion of the stain-free reference image whose grayscale is higher than a preset grayscale threshold as a mask, and reducing the grayscale of a portion corresponding to the mask in the preprocessed image to below a preset grayscale threshold to obtain a secondary processed image; in the secondary processed image, extracting a highlight area whose grayscale is higher than the preset grayscale threshold, and using a preset region segmentation algorithm to segment the highlight area into a number of regions to be marked; calculating a velocity vector corresponding to each region to be marked based on a sparse optical flow algorithm, and if the velocity vector corresponding to each region to be marked meets a preset velocity vector condition, then each region to be marked is marked as a stain, otherwise it is marked as a non-stain.
[0009] In a feasible embodiment, training a preset generative adversarial network model includes: obtaining a stain-free photovoltaic panel image as training data; adding simulated stains to the stain-free photovoltaic panel image to generate a stained photovoltaic panel image; and using the stain-free photovoltaic panel image and the stained photovoltaic panel image as training samples, and inputting them into the preset generative adversarial network model for training.
[0010] In one feasible embodiment, adding simulated stains to a stain-free photovoltaic panel image includes: randomly determining the number of stains within a preset stain number range; randomly generating a number of stain images based on the number of stains using a preset physics engine, wherein the grayscale of the stain images is higher than a preset grayscale threshold; and randomly overlaying each stain image on different areas of the stain-free photovoltaic panel image.
[0011] In a feasible embodiment, calculating the velocity vector corresponding to each area to be marked includes: extracting multiple consecutive secondary-processed images containing the secondary-processed image; determining the characteristic pixel points corresponding to each area to be marked in the multiple consecutive secondary-processed images; calculating the velocity vector of the characteristic pixel points corresponding to each area to be marked according to the motion trajectory of the characteristic pixel points corresponding to each area to be marked in the multiple consecutive secondary-processed images; and determining the velocity vector corresponding to each area to be marked according to the motion vector of the characteristic pixel points corresponding to each area to be marked.
[0012] In a feasible embodiment, determining the characteristic pixel points corresponding to each area to be marked in multiple consecutive secondary processed images includes: performing edge detection on the multiple consecutive secondary processed images to extract the edge contour of each area to be marked; and determining, within the edge contour of each area to be marked, multiple corner points corresponding to each area to be marked as the characteristic pixel points corresponding to each area to be marked by a corner detection algorithm.
[0013] In a feasible implementation, a preset region segmentation algorithm is used to segment the highlight region into several regions to be marked, including: performing edge detection on the highlight region to obtain the edge contour of the highlight region; segmenting the highlight region into several sub-regions based on the edge contour of the highlight region; processing the sub-regions to smooth the boundaries of the sub-regions; performing connectivity analysis on the processed sub-regions, and merging adjacent and connected sub-regions into one region to be marked.
[0014] In a feasible embodiment, the original image in the photovoltaic panel video is preprocessed, including: cropping the original image according to a preset cropping boundary line, and retaining the image area corresponding to the area inside the cropping boundary line; stretching the cropped original image into a rectangle; calculating the average grayscale of the stretched original image, and if the average grayscale of the stretched original image exceeds the preset average grayscale range, adjusting the average grayscale of the stretched original image to within the preset average grayscale range.
[0015] In a feasible embodiment, after marking each area to be marked as a stain, the method further includes: calculating the area corresponding to each area to be marked and the circularity corresponding to each area to be marked; if the area corresponding to each area to be marked is smaller than a preset area threshold or the circularity corresponding to each area to be marked is lower than a preset circularity threshold, then marking each area to be marked as a non-stain.
[0016] In a second aspect, the present invention also provides a stain identification device applied to photovoltaic panels, characterized in that the device specifically includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, so that the at least one processor can execute a stain identification method applied to photovoltaic panels as in any of the above-mentioned embodiments.
[0017] In a third aspect, the present invention further provides a non-volatile computer storage medium having computer executable instructions stored thereon, wherein the computer executable instructions are configured to execute a stain identification method applied to a photovoltaic panel as in any of the above embodiments.
[0018] The present invention provides a method, device, and medium for identifying stains on photovoltaic panels, which have the following beneficial effects: 1. The present invention uses only a single-source video image for stain identification. By preprocessing the original image, generating a stain-free reference image, masking, and velocity vector analysis, it achieves high-precision stain detection. This method eliminates the need for complex multi-source image acquisition and fusion processing, reducing system hardware requirements and costs. It also simplifies the data processing process, improves detection efficiency, and addresses the high cost and complexity of multi-source image fusion methods. The present invention uses a generative adversarial network to generate a stain-free reference image and combines it with a grayscale threshold and region segmentation algorithm for stain identification, eliminating the need for large numbers of labeled samples for training. Furthermore, a sparse optical flow algorithm is used to perform velocity vector analysis on stains in dynamic video, adapting to varying lighting conditions and changes in photovoltaic panel inclination angles. This significantly improves the model's generalization capabilities, enabling stable operation in a variety of application scenarios and addressing the sample dependence and generalization deficiencies of deep learning methods. By using a generative adversarial network to generate a stain-free reference image and combining it with a preset grayscale threshold for masking and secondary processing, the present invention can dynamically adjust the grayscale threshold's applicability, avoiding misjudgments due to changing lighting conditions. At the same time, the velocity vector is calculated through the sparse optical flow algorithm to further confirm whether the highlighted area is a stain, thereby significantly improving the accuracy of stain identification and effectively solving the misjudgment problem of traditional threshold segmentation methods under lighting changes.
[0019] 2. The present invention significantly improves the accuracy of photovoltaic panel stain recognition by introducing a sparse optical flow algorithm to calculate the velocity vector of the area to be marked, especially being able to effectively distinguish between stains and reflections. In practical applications, the reflective area on the surface of the photovoltaic panel may be misjudged as a stain due to changes in lighting conditions, but the reflective area usually does not have the static characteristics of a stain. By extracting characteristic pixel points from multiple consecutive secondary processed images and analyzing their motion trajectories, the present invention can accurately identify reflective areas with dynamic characteristics, thereby distinguishing them from static stain areas. This recognition method based on motion information avoids the problem of misjudgment caused by changes in lighting in traditional static image analysis methods, improves the reliability and robustness of stain detection, and further optimizes the performance of the photovoltaic panel stain recognition system. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the present invention or the prior art, the following briefly introduces the drawings required for the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments described in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings: Figure 1 A flow chart of a stain identification method applied to photovoltaic panels provided by the present invention; Figure 2This is a schematic structural diagram of a stain identification device applied to photovoltaic panels provided by the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0022] The method of the present invention is described in detail below with reference to the accompanying drawings.
[0023] Figure 1 The present invention provides a flow chart of a stain identification method for photovoltaic panels, such as Figure 1 As shown, a stain identification method applied to a photovoltaic panel in the present invention includes at least the following steps: Step 101: Preprocess the original image in the photovoltaic panel video to generate a preprocessed image.
[0024] In the present invention, a video of the photovoltaic panels is captured by a cleaning robot mounted on the panels. The cleaning robot, mounted on the panels, primarily removes dust from the panels by spraying water. However, the cleaning robot cannot completely remove some stubborn stains, such as bird droppings. Therefore, a camera is installed on the cleaning robot to capture video of the panels to determine whether the stains have reached a level requiring manual removal. The camera is typically mounted directly in the center of the cleaning robot, positioned along the centerline of a row of panels. Because the camera captures the panels at an angle, the panels appear trapezoidal in the captured image. Furthermore, the captured images may include not only the target photovoltaic panel but also panels on the ground and elsewhere. To accurately extract information about the target photovoltaic panel from these images, the original images must be cropped and stretched. Cropping removes unnecessary portions of the image, such as panels on the ground and elsewhere, thereby preserving the target photovoltaic panel area. Stretching adjusts the cropped image to the actual proportions of the target photovoltaic panel for subsequent processing.
[0025] Specifically, first, the original image is cropped according to the preset cropping boundary line, and only the image area within the cropping boundary line is retained. Since the camera shoots at a fixed angle and the cleaning robot moves in a straight line along the photovoltaic panel track, the position of the photovoltaic panel in the picture is fixed in all frames of the video. This means that the preset cropping boundary line can be used to accurately remove the part of the original image that does not belong to the target photovoltaic panel, thereby retaining the complete area of the target photovoltaic panel. The purpose of the cropping operation is to remove unnecessary background information in the image, such as the ground, other photovoltaic panels, etc., to reduce the complexity of subsequent processing and improve the accuracy of stain recognition.
[0026] After cropping, the cropped image needs to be stretched. Due to the perspective effect of the camera, the photovoltaic panel captured is trapezoidal, and appears larger near the camera and smaller far away. This deformation directly affects the subsequent velocity vector calculation, resulting in significant errors. Therefore, the trapezoidal photovoltaic panel must be adjusted to a rectangle through a stretching operation to restore its true proportions. Specifically, the stretching operation adjusts the aspect ratio of the photovoltaic panel in the image to match the size ratio of the actual photovoltaic panel. This step is crucial for subsequent stain recognition and velocity vector calculation because it ensures that the geometric relationship in the image is consistent with reality, thereby improving the accuracy and reliability of the algorithm.
[0027] After image stretching is completed, the image needs to be grayscale processed. Stain recognition is based on grayscale thresholds, but the grayscale values of images taken at different times may vary greatly due to changes in lighting conditions. In order to ensure the accuracy of subsequent stain recognition, the overall grayscale of the image needs to be adjusted to an appropriate range. The specific steps are as follows: First, calculate the average grayscale value of the stretched image. Next, determine whether the above average grayscale value is within the preset grayscale range. Finally, if the average grayscale value exceeds the preset range, the image is grayscale adjusted so that its average grayscale value is within the preset range. The purpose of grayscale adjustment is to eliminate the influence of lighting conditions on the image and ensure that images taken at different times have a unified grayscale benchmark. This step is crucial for subsequent stain extraction based on grayscale thresholds because it can improve the stability and accuracy of stain recognition.
[0028] Through the aforementioned preprocessing steps of cropping, stretching, and grayscale adjustment, the present invention can extract the target photovoltaic panel area from the original image captured by the cleaning robot and adjust it to a format suitable for subsequent stain identification. These steps not only improve the accuracy of stain identification but also enhance the algorithm's adaptability to varying lighting conditions and shooting angles, providing reliable technical support for automated cleaning and maintenance of photovoltaic panels.
[0029] Step 102: Use a preset generative adversarial network model to generate a stain-free reference image based on the preprocessed image.
[0030] In images of photovoltaic panels, the presence of conductive strips interferes with stain detection. These strips are typically attached to the panels in a fixed arrangement, and their grayscale is significantly higher than other areas. To accurately identify stains, these strips need to be removed from the image. To this end, the present invention employs a generative adversarial network model to generate a stain-free reference image based on a preprocessed image. Through adversarial training, the generative adversarial network model learns to remove stains from an image, thereby generating a stain-free reference image. In subsequent steps, the conductive strips on the photovoltaic panel are removed from the original image based on the generated stain-free reference image.
[0031] The steps for training the aforementioned generative adversarial network model include: First, obtaining images of clean photovoltaic panels as training data. These images can be taken after the panels are first installed, making them relatively easy to obtain. These images serve as real-world samples for the generative adversarial network, training the model to identify clean photovoltaic panels.
[0032] Next, to simulate the stains found in real-world scenarios, simulated stains are added to the stain-free photovoltaic panel image to generate a stained photovoltaic panel image. The specific steps are as follows: First, a random number of stains is determined within a preset range. Then, based on the number of stains, a preset physics engine is used to randomly generate several stained images. The grayscale of these stained images must be above a preset grayscale threshold to ensure they are clearly visible in the image. Finally, each stained image is randomly overlaid on different areas of the stain-free photovoltaic panel image to generate a stained photovoltaic panel image. These stained images serve as fake samples for the generative adversarial network.
[0033] Finally, the generative adversarial network model is trained using both images of clean and stained photovoltaic panels as training samples. The goal is to enable the generator to generate clean images of photovoltaic panels based on images of stained panels. The specific training process is as follows: The generator learns to remove stains and conductive strips from images, generating outputs that approximate realistic clean images. The discriminator continuously improves its discriminative ability through learning. During training, the generator and discriminator compete with each other, with the generator continuously attempting to generate more realistic clean images to deceive the discriminator, while the discriminator strives to improve its ability to identify real images. Through this adversarial training, the generator gradually learns how to remove conductive strips and stains from images, generating high-quality clean reference images. Through these training steps, the generative adversarial network model is able to generate clean reference images based on preprocessed images. This process not only removes the conductive strips from the images but also preserves other important features of the photovoltaic panels. The generated clean reference images provide an important benchmark for subsequent stain detection, ensuring the accuracy and reliability of stain detection. At the same time, the introduction of the generative adversarial network model enables the present invention to adapt to complex scenes with different lighting conditions and stain types, thereby improving the robustness and practicality of the algorithm.
[0034] Step 103 : extract the portion of the stain-free reference image with a grayscale higher than a preset grayscale threshold as a mask, and reduce the grayscale of the portion corresponding to the mask in the pre-processed image to below the preset grayscale threshold, thereby obtaining a secondary processed image.
[0035] Specifically, first, a preset grayscale threshold is set to distinguish between high-light and low-light areas in the image. Since the grayscale value of the conductive strip is usually higher than that of other areas, the location of the conductive strip can be extracted by the grayscale threshold.
[0036] Next, a grayscale analysis is performed on the unstained reference image to extract regions with grayscale values above a preset grayscale threshold. These regions typically correspond to the conductive strips on the photovoltaic panel, which serve as a mask. The mask marks the location of the conductive strips in the image for subsequent processing.
[0037] The extracted mask is then applied to the preprocessed image to locate the locations corresponding to the mask in the preprocessed image. These locations represent the conductive band regions in the preprocessed image. To eliminate interference from the conductive band on subsequent stain detection, grayscale adjustment is performed on these regions. Specifically, the grayscale values at the locations corresponding to the mask in the preprocessed image are lowered to below a preset grayscale threshold. This weakens the high grayscale characteristics of the conductive band, preventing it from misleading subsequent stain detection.
[0038] After the grayscale adjustment, the resulting image is the secondary processed image. This secondary processed image retains the overall characteristics of the photovoltaic panel while eliminating interference from the conductive strips, making the image more suitable for subsequent stain identification steps.
[0039] Step 104 : extracting a highlight region with a grayscale higher than a preset grayscale threshold from the secondary processed image, and using a preset region segmentation algorithm to segment the highlight region into a plurality of regions to be marked.
[0040] Specifically, first, edge detection is performed on the extracted highlight area. Edge detection is an important step in image processing. Its purpose is to identify areas in the image with significant grayscale changes by calculating the image's gradient information, thereby obtaining the edge contours of the highlight area. Algorithms that can be used in the present invention include the Canny edge detection algorithm and the Sobel operator. Through edge detection, the boundaries of the highlight area can be clearly outlined, providing a basis for subsequent region segmentation.
[0041] Next, based on the acquired edge contours, the highlighted area is segmented into several sub-areas. This process is achieved by analyzing the continuity and closure of the edge contours. Specifically, the highlighted area is divided into multiple independent sub-areas based on the shape and distribution of the edge contours. Each sub-area may correspond to a potential stain area or non-stain area, but further processing is required to ensure the accuracy of the segmentation. Since edge detection may be affected by noise or image quality, the boundaries of the segmented sub-areas may be jagged or have other irregular shapes. In order to improve the accuracy of subsequent analysis, the boundaries of the sub-areas need to be smoothed. Commonly used smoothing algorithms include median filtering and morphological operations such as dilation and erosion. Through smoothing, small defects on the boundaries can be eliminated, making the shape of the sub-areas more regular, which is convenient for subsequent analysis and marking.
[0042] After boundary smoothing, connectivity analysis is performed on each subregion. The purpose of connectivity analysis is to determine whether subregions are adjacent and connected. If two subregions are spatially adjacent and connected by edge contours, they are merged into a single region to be labeled. This process can be implemented using an image connectivity labeling algorithm, such as a depth-first search or breadth-first search algorithm, to determine the connectivity between subregions. By merging adjacent and connected subregions, the incorrect segmentation of a single stain region into multiple independent regions can be avoided, thereby improving stain recognition accuracy.
[0043] Through the above steps, the present invention can accurately segment the highlighted area into several areas to be marked, providing more accurate and reliable input for subsequent velocity vector-based stain marking. This method not only improves the accuracy of stain recognition, but also enhances the algorithm's adaptability to different lighting conditions and complex backgrounds.
[0044] Step 105: Calculate the velocity vector corresponding to each area to be marked based on the sparse optical flow algorithm. If the velocity vector corresponding to each area to be marked meets the preset velocity vector condition, mark each area to be marked as a stain; otherwise, mark it as a non-stain.
[0045] In the present invention, since the cleaning robot moves on the photovoltaic panel, the stains in the video it captures will move at the same speed as the robot's movement, while the reflective area will not change position as the robot moves. Therefore, there are significant differences in the motion characteristics of the stains and reflections in the video sequence: the stain has a velocity vector consistent with the robot's movement, while the velocity vector of the reflective area is close to zero or exhibits randomness. Velocity vector analysis based on the sparse optical flow algorithm can capture this difference, thereby achieving accurate distinction between stains and reflections. Specifically, the algorithm extracts the characteristic pixel points of the area to be marked in multiple consecutive frames and calculates the velocity vector of its motion trajectory. If the velocity vector is consistent with the motion velocity vector of the cleaning robot, the area can be judged as a stain; conversely, if the velocity vector does not conform to the robot's motion characteristics, it can be judged as a reflection. This method makes full use of the dynamic information of the cleaning robot in the motion scene, avoids the misjudgment problem caused by changes in lighting in traditional static image analysis methods, and significantly improves the accuracy and reliability of stain identification.
[0046] Specifically, multiple secondary processed images corresponding to consecutive frames of photovoltaic panel video are first extracted. These images contain the areas to be marked for velocity vector calculation. After pre-processing and secondary processing, these consecutive secondary processed images can effectively remove interference factors such as uneven lighting and retain the characteristic information of the stained areas. By analyzing multiple consecutive frames, the dynamic changes of the stained areas over time can be captured.
[0047] In multiple consecutive secondary processed images, the characteristic pixels of each region to be marked are determined. Characteristic pixels are points with significant features within the region, typically detected by corner points and thus identified using common feature point extraction algorithms. These characteristic pixels represent the motion characteristics of the region to be marked, providing a basis for subsequent velocity vector calculations.
[0048] Next, the velocity vector of the characteristic pixel is calculated based on its motion trajectory across multiple consecutive reprocessed images. Specifically, the horizontal and vertical velocities of the characteristic pixel are calculated by tracking its position changes across different frames. The velocity vector reflects the direction and speed of the characteristic pixel's motion and effectively characterizes the dynamic characteristics of the stained area.
[0049] Finally, the velocity vector of the entire area to be marked is determined based on the velocity vectors of the feature pixels. If the velocity vectors of multiple feature pixels within the area to be marked have consistent directions and magnitudes, the area can be considered to have a clear motion trend. Conversely, if the velocity vectors vary significantly, the area may be affected by noise or non-stain factors. By analyzing the distribution and consistency of the velocity vectors, it is possible to further determine whether the area to be marked is a stain.
[0050] Furthermore, the specific steps for determining the characteristic pixel points corresponding to each of the areas to be marked in the multiple consecutive secondary processed images are as follows: first, edge detection is performed on the multiple consecutive secondary processed images to identify areas in the image where the grayscale changes significantly, thereby outlining the boundaries of the areas to be marked. Within the edge contours of each extracted area to be marked, a corner detection algorithm is used to determine multiple corner points. Corner points are points in the image with significant geometric features, usually located at the corners of the object's outline or at locations where the texture changes significantly. The corner detection algorithm can effectively identify these characteristic points and use them as characteristic pixel points.
[0051] Through the above steps, the present invention can effectively extract the characteristic pixel points of each area to be marked. Edge detection ensures the regional accuracy of corner detection, while corner detection provides pixels with significant characteristics that can represent the motion characteristics of the area to be marked. The extraction of characteristic pixels provides a reliable foundation for subsequent velocity vector calculation, enabling the algorithm to more accurately analyze the dynamic changes of the area to be marked, thereby distinguishing between stained and non-stained areas. This method not only improves the accuracy of stain recognition, but also enhances the algorithm's robustness to complex backgrounds and lighting conditions, providing more efficient technical support for photovoltaic panel stain recognition.
[0052] In one feasible embodiment, after completing the preliminary stain marking of the area to be marked, it is necessary to further verify whether there are any conductor strips that are not completely obscured. These conductor strips are usually small in size and long in shape, and may not be completely submerged and covered, which may lead to misjudgment. Therefore, it is necessary to calculate the area and circularity of each area to be marked. Circularity is an indicator that measures the degree to which the shape of an area is close to a circle. If the area of an area to be marked is very small or the circularity is very low, this indicates that the shape of the area is closer to a long strip than a circle, and it is likely that there is a conductor strip that is not completely obscured. In this case, it should be marked as non-stain to avoid misjudgment, thereby improving the accuracy and reliability of stain identification.
[0053] Based on the same inventive concept, the present invention also provides a stain identification device for photovoltaic panels, the structure of which is as follows: Figure 2 shown.
[0054] Figure 2 This is a schematic diagram of the structure of a stain identification device for photovoltaic panels provided by the present invention. Figure 2 As shown, the stain identification device 200 applied to photovoltaic panels in the present invention specifically includes: at least one processor 201; and a memory 203 communicatively connected to the at least one processor (connected via a bus 202); wherein the memory 203 stores instructions that can be executed by the at least one processor 201, so that the at least one processor 201 can execute a stain identification method applied to photovoltaic panels as described in the above embodiment.
[0055] In one or more possible implementations of the present invention, the aforementioned processor is used to perform preprocessing on the original image in the photovoltaic panel video to generate a preprocessed image, where the preprocessing includes cropping, stretching, and grayscale adjustment; using a preset generative adversarial network model to generate a stain-free reference image based on the preprocessed image; extracting the portion of the stain-free reference image whose grayscale is higher than a preset grayscale threshold as a mask, and reducing the grayscale of the portion corresponding to the mask in the preprocessed image to below the preset grayscale threshold to obtain a secondary processed image; in the secondary processed image, extracting a highlight area whose grayscale is higher than the preset grayscale threshold, and using a preset region segmentation algorithm to segment the highlight area into several regions to be marked; based on a sparse optical flow algorithm, calculating the velocity vector corresponding to each region to be marked, and if the velocity vector corresponding to each region to be marked meets a preset velocity vector condition, then each region to be marked is marked as stain, otherwise it is marked as non-stain.
[0056] In addition, the present invention also provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute a stain identification method applied to a photovoltaic panel as described in any one of the above embodiments.
[0057] In one or more possible implementations of the present invention, the aforementioned computer executable instructions are configured to execute, preprocess the original image in the photovoltaic panel video to generate a preprocessed image, the preprocessing including cropping, stretching and grayscale adjustment; use a preset generative adversarial network model to generate a stain-free reference image based on the preprocessed image; extract the portion of the stain-free reference image with a grayscale higher than a preset grayscale threshold as a mask, and reduce the grayscale of the portion corresponding to the mask in the preprocessed image to below the preset grayscale threshold to obtain a secondary processed image; in the secondary processed image, extract the highlight area with a grayscale higher than the preset grayscale threshold, and use a preset region segmentation algorithm to segment the highlight area into several regions to be marked; based on the sparse optical flow algorithm, calculate the velocity vector corresponding to each region to be marked, and if the velocity vector corresponding to each region to be marked meets the preset velocity vector condition, then each region to be marked is marked as stain, otherwise it is marked as non-stain.
[0058] The various embodiments of the present invention are described in a progressive manner. Similar portions between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the IoT device and medium embodiments are generally similar to the method embodiments, so their description is relatively simple. For relevant portions, refer to the description of the method embodiments.
[0059] The device and medium provided by the present invention correspond one-to-one to the method. Therefore, the device and medium also have similar beneficial technical effects to their corresponding methods. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the system and medium will not be repeated here.
[0060] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0061] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0062] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0063] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0064] The above are merely embodiments of the present invention and are not intended to limit the present invention. It will be apparent to those skilled in the art that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A stain identification method applied to photovoltaic panels, characterized in that: The method comprises: Preprocessing an original image in the photovoltaic panel video to generate a preprocessed image, wherein the preprocessing includes at least one of cropping, stretching, and grayscale adjustment; Using a preset generative adversarial network model, generating a stain-free reference image based on the preprocessed image; Extracting a portion of the stain-free reference image with a grayscale higher than a preset grayscale threshold as a mask, and reducing the grayscale of a portion of the pre-processed image corresponding to the mask to below the preset grayscale threshold to obtain a secondary processed image; In the secondary processed image, a highlight area with a grayscale higher than the preset grayscale threshold is extracted, and a preset region segmentation algorithm is used to segment the highlight area into a plurality of regions to be marked; Based on the sparse optical flow algorithm, the velocity vector corresponding to each area to be marked is calculated. If the velocity vector corresponding to each area to be marked meets the preset velocity vector condition, the area to be marked is marked as a stain, otherwise it is marked as a non-stain.
2. The stain identification method applied to photovoltaic panels according to claim 1, characterized in that: Calculating the velocity vector corresponding to each of the areas to be marked includes: extracting a plurality of continuous secondary-processed images including the secondary-processed image; Determining characteristic pixel points corresponding to each of the to-be-marked areas in the plurality of consecutive secondary-processed images; Calculating the velocity vectors of the characteristic pixel points corresponding to the respective regions to be marked according to the motion trajectories of the characteristic pixel points corresponding to the respective regions to be marked in the plurality of consecutive secondary processed images; The velocity vector corresponding to each of the areas to be marked is determined according to the motion vectors of the characteristic pixel points corresponding to each of the areas to be marked.
3. The stain identification method applied to photovoltaic panels according to claim 2, characterized in that: Determining characteristic pixel points corresponding to the respective areas to be marked in the plurality of consecutive secondary-processed images includes: Performing edge detection on the plurality of consecutive secondary processed images to extract edge contours of the respective areas to be marked; Within the edge contour of each area to be marked, a plurality of corner points corresponding to each area to be marked are determined by a corner point detection algorithm as feature pixel points corresponding to each area to be marked.
4. The stain identification method for photovoltaic panels according to claim 1, characterized in that: Training the preset generative adversarial network model includes: Obtaining non-staining photovoltaic panel images as training data; adding simulated stains to the non-stain photovoltaic panel image to generate a stained photovoltaic panel image; The unstained photovoltaic panel image and the stained photovoltaic panel image are used as training samples and input into the preset generative adversarial network model for training.
5. The stain identification method applied to photovoltaic panels according to claim 4, characterized in that: Adding simulated stains to the non-stain photovoltaic panel image, including: Randomly determine the number of stains within a preset range of stains; According to the number of stains, a preset physical engine is used to randomly generate a plurality of stain images, wherein the grayscale of the stain images is higher than the preset grayscale threshold; Each stain image is randomly overlaid on different areas of the stain-free photovoltaic panel image.
6. The stain identification method applied to photovoltaic panels according to claim 1, characterized in that: Use a preset region segmentation algorithm to segment the highlighted region into several regions to be marked, including: Performing edge detection on the highlighted area to obtain an edge contour of the highlighted area; Dividing the highlighted area into a plurality of sub-areas according to the edge contour of the highlighted area; Processing the sub-region to smooth the boundary of the sub-region; Connectivity analysis is performed on the processed sub-regions, and adjacent and connected sub-regions are merged into one region to be marked.
7. The stain identification method applied to photovoltaic panels according to claim 1, characterized in that: Preprocess the original images in the photovoltaic panel video, including: Cropping the original image according to a preset cropping boundary line, and retaining the image area corresponding to the area inside the cropping boundary line; Stretch the cropped original image into a rectangle; The average grayscale of the stretched original image is calculated. If the average grayscale of the stretched original image exceeds a preset average grayscale range, the average grayscale of the stretched original image is adjusted to be within the preset average grayscale range.
8. The stain identification method applied to photovoltaic panels according to claim 1, characterized in that: After marking each of the to-be-marked areas as a stain, the method further includes: Calculating the area corresponding to each of the to-be-marked regions and the circularity corresponding to each of the to-be-marked regions; If the area corresponding to each of the regions to be marked is smaller than a preset area threshold or the circularity corresponding to each of the regions to be marked is lower than a preset circularity threshold, each of the regions to be marked is marked as non-stain.
9. A stain identification device applied to photovoltaic panels, characterized in that: The device specifically includes: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, so that the at least one processor can execute the stain identification method applied to a photovoltaic panel according to any one of claims 1 to 8.
10. A non-volatile computer storage medium having computer executable instructions stored thereon, characterized in that: The computer executable instructions are configured to execute a stain identification method applied to a photovoltaic panel according to any one of claims 1 to 8.
Citation Information
Patent Citations
Photovoltaic panel defect detection method and device and computer equipment
CN114897807A
Photovoltaic panel hot spot detection method and device and medium
CN115994908A
Conveyor belt electronic fence detection method, device and equipment and storage medium
CN119359689A
Method and apparatus for training cyclegan model for generating defect images of photovoltaic panel
WO2024007602A1
Cited By
Plateau photovoltaic panel smudginess identification method based on remote sensing and AI
CN121582236A
Self-adaptive cleaning control method of cleaning robot based on image texture analysis
CN121767759A
Self-adaptive cleaning control method of cleaning robot based on image texture analysis
CN121767759B