Disclosure of Invention
In view of the above, the present invention aims to provide a method, an apparatus, a device and a medium for detecting group hot spots, which can improve generalization and accuracy of group hot spot detection, and the specific scheme is as follows:
in a first aspect, the present application discloses a method for detecting a cluster hot spot, including:
acquiring an initial visible light image and an initial infrared image of a photovoltaic array, and preprocessing the initial infrared image to obtain a preprocessed infrared image;
determining each photovoltaic module of each group of photovoltaic group strings in the preprocessed infrared image;
taking the difference value between the average gray values of the photovoltaic modules as a distance, and clustering the photovoltaic modules by using a distance clustering algorithm to divide each group of photovoltaic group strings, so as to obtain a module cluster with higher gray value and a module cluster with lower gray value;
if the absolute value of the difference value between the cluster centers of the component clusters with higher gray values and the component clusters with lower gray values in the photovoltaic group strings is larger than a clustering threshold value, marking the component clusters with higher gray values as initial group string hot spot areas so as to obtain initial group string hot spot images marked with all the initial group string hot spot areas;
Calculating the difference value between the region average temperature of each initial group of hot spot regions and the global average temperature in the initial infrared image;
and removing the initial group of hot spot areas with the difference value smaller than the temperature threshold value, and removing the part, overlapped with the light reflection area of the initial visible light image, of each initial group of hot spot areas to obtain corresponding target group of hot spot areas and target group of hot spot images marked with all the target group of hot spot areas.
Optionally, the preprocessing the initial infrared image to obtain a preprocessed infrared image includes:
performing image whitening treatment on the initial infrared image to obtain a whitened infrared image;
and filtering the whitened infrared image by using a median filtering method to remove noise and obtain a preprocessed infrared image.
Optionally, the determining each photovoltaic module of each group of photovoltaic group strings in the preprocessed infrared image includes:
image segmentation is carried out on the preprocessed infrared image based on a UNet neural network model to obtain a photovoltaic array mask image, and a photovoltaic group string covering rectangular frame in the photovoltaic array mask image is determined;
And extracting a single component from the photovoltaic group strings corresponding to the covering rectangular frame of each photovoltaic group string through an edge detection algorithm and morphological closing operation to obtain a component boundary frame of each photovoltaic component so as to determine each photovoltaic component of each group of photovoltaic group strings in the preprocessed infrared image.
Optionally, before extracting the single component from the photovoltaic group strings corresponding to the covering rectangular frame of each photovoltaic group string by using an edge detection algorithm and a morphological closing operation to obtain the component bounding frame of each photovoltaic component, determining each photovoltaic component of each group of the photovoltaic group strings in the preprocessed infrared image, the method further includes:
and correcting each photovoltaic group string in the covering rectangular frame through perspective transformation.
Optionally, the clustering the photovoltaic modules by using a distance clustering algorithm to divide each group of photovoltaic group strings to obtain a module cluster with a higher gray value and a module cluster with a lower gray value, including:
and clustering the photovoltaic components by using a K mean value++ clustering algorithm with a cluster of 2 to divide the component cluster with higher gray value and the component cluster with lower gray value in each group of photovoltaic group strings.
Optionally, before removing the initial group of hot spot areas with the difference value smaller than the temperature threshold and removing a portion of each initial group of hot spot areas overlapping with the reflective area of the initial visible light image to obtain a corresponding target group of hot spot areas and a target group of hot spot images marking all the target group of hot spot areas, the method further includes:
taking the preprocessed infrared image as a matching template, and performing image registration on the initial visible light image and the preprocessed infrared image to obtain homography matrixes of the initial visible light image and the preprocessed infrared image;
determining a light reflecting area in the initial visible light image;
and transforming the light reflection area to the initial group of serial hot spot images by utilizing a homography matrix, and determining the part, overlapping with the light reflection area, of the initial group of serial hot spot areas in the initial group of serial hot spot images.
Optionally, the performing image registration on the initial visible light image and the preprocessed infrared image to obtain a homography matrix of the initial visible light image and the preprocessed infrared image includes:
Scaling the initial visible light image to obtain a scaled visible light image with a scaling ratio of the pre-processed infrared image being a target height scaling ratio and a target width scaling ratio;
performing image registration on the scaled visible light image and the preprocessed infrared image by using a normalization correlation coefficient matching method to obtain a cross correlation coefficient matrix between the scaled visible light image and the preprocessed infrared image;
determining a maximum value in the cross-correlation coefficient matrix, determining a target position of an upper left corner of the preprocessed infrared image corresponding to the maximum value in a visible light image coordinate system of the scaled visible light image, and determining a horizontal translation amount and a vertical translation amount between the scaled visible light image and the preprocessed infrared image based on the target position; the visible light image coordinate system is a coordinate system taking the upper left corner of the zoomed visible light image as an origin;
and obtaining homography matrixes of the initial visible light image and the preprocessed infrared image based on the target height scaling ratio, the target width scaling ratio, the horizontal translation amount and the vertical translation amount.
In a second aspect, the present application discloses a cluster hot spot detection device, comprising:
the image acquisition module is used for acquiring an initial visible light image and an initial infrared image of the photovoltaic array;
the image preprocessing module is used for preprocessing the initial infrared image to obtain a preprocessed infrared image;
the component determining module is used for determining each photovoltaic component of each group of photovoltaic group strings in the preprocessed infrared image;
the clustering module is used for taking the difference value between the average gray values of the photovoltaic modules as a distance, and clustering the photovoltaic modules by using a distance clustering algorithm to divide each group of photovoltaic group strings so as to obtain a module cluster with higher gray value and a module cluster with lower gray value;
the initial group string hot spot image determining module is used for marking the component cluster with higher gray value as an initial group string hot spot area if the absolute value of the difference value between the cluster centers of the component cluster with higher gray value and the component cluster with lower gray value in the photovoltaic group string is larger than a clustering threshold value so as to obtain an initial group string hot spot image marked with all the initial group string hot spot areas;
the difference value calculation module is used for calculating the difference value between the region average temperature of each initial group of hot spot region and the global average temperature in the initial infrared image;
The target group cluster hot spot image determining module is used for removing the initial group cluster hot spot areas with the difference value smaller than a temperature threshold value, and removing the part, overlapped with the light reflection area of the initial visible light image, of each initial group cluster hot spot area so as to obtain corresponding target group cluster hot spot areas and target group cluster hot spot images marked with all the target group cluster hot spot areas.
In a third aspect, the present application discloses an electronic device comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the group string hot spot detection method disclosed by the prior art.
In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the previously disclosed cluster hot spot detection method.
The method comprises the steps of obtaining an initial visible light image and an initial infrared image of a photovoltaic array, and preprocessing the initial infrared image to obtain a preprocessed infrared image; determining each photovoltaic module of each group of photovoltaic group strings in the preprocessed infrared image; taking the difference value between the average gray values of the photovoltaic modules as a distance, and clustering the photovoltaic modules by using a distance clustering algorithm to divide each group of photovoltaic group strings, so as to obtain a module cluster with higher gray value and a module cluster with lower gray value; if the absolute value of the difference value between the cluster centers of the component clusters with higher gray values and the component clusters with lower gray values in the photovoltaic group strings is larger than a clustering threshold value, marking the component clusters with higher gray values as initial group string hot spot areas so as to obtain initial group string hot spot images marked with all the initial group string hot spot areas; calculating the difference value between the region average temperature of each initial group of hot spot regions and the global average temperature in the initial infrared image; and removing the initial group of hot spot areas with the difference value smaller than the temperature threshold value, and removing the part, overlapped with the light reflection area of the initial visible light image, of each initial group of hot spot areas to obtain corresponding target group of hot spot areas and target group of hot spot images marked with all the target group of hot spot areas. Therefore, the method and the device can use the existing gray values for clustering no matter what scene is based on, judge based on the clustering threshold value, and do not consider external limitation, so that the external limitation does not need to be changed under different environments, and the generalization is strong, so that the method and the device are suitable for different environments; in addition, the area with high gray value caused by reflection is eliminated, the area with insufficient temperature is also eliminated, the false alarm is reduced, and the accuracy is improved.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The existing photovoltaic power station group string hot spot detection method has the following defects: firstly, the generalization of a detection algorithm is not strong, a photovoltaic power station can be distributed in scenes such as the ground, the water surface and the desert, the temperature of the infrared images acquired by different scenes can have larger difference due to the factors such as the ambient temperature, the gray values on the infrared images can also be different, the existing method for taking a plurality of components with the gray value larger than 200 as the serial hot spots is provided, when the scene changes, for example, the scene changes from the ground scene to the desert scene, the gray threshold value needs to be changed again, and the generalization is poor; second, the existing method for identifying the group string hot spots based on Grubbs hypothesis test and Dixon hypothesis test has low omission rate, but high false alarm rate, so that the accuracy is low.
Therefore, the embodiment of the application provides a group string hot spot detection scheme which can improve generalization and accuracy of group string hot spot detection.
The embodiment of the application discloses a group string hot spot detection method, which is shown in fig. 1 and comprises the following steps:
step S11: and acquiring an initial visible light image and an initial infrared image of the photovoltaic array, and preprocessing the initial infrared image to obtain a preprocessed infrared image.
In this embodiment, the obtained initial visible light image and the initial infrared image of the photovoltaic array are images of the same scene; the scene can be various scenes such as ground, water surface, desert and the like, and is not particularly limited herein.
It should be noted that the images may be acquired in sunny weather using an unmanned aerial vehicle carrying visible and infrared image sensors; the images may be acquired by a multi-sensor camera drone, which may have a flying height of about 50 meters. Specifically, referring to fig. 2, an initial infrared image is shown, and referring to fig. 3, an initial visible image is shown.
In this embodiment, the preprocessing the initial infrared image to obtain a preprocessed infrared image includes: performing image whitening treatment on the initial infrared image to obtain a whitened infrared image; and filtering the whitened infrared image by using a median filtering method to remove noise and obtain a preprocessed infrared image.
It should be noted that image whitening can be used to process an over-exposed or under-exposed picture, changing the average pixel value of the infrared image to 0, the variance to 1, and the calculation formula is as follows:
;
;
;
wherein,for mean value->For variance->Is standard deviation (S)>For infrared image +.>The gray value at which the color is to be changed,for the image width +.>For image height +.>The whitened gray value. The infrared image coordinate system takes the upper left corner of the infrared image as the origin.
It should be noted that since the infrared image contains noise, we use median filtering for noise removal. Firstly, selecting a sliding window with odd width, replacing the value of the central point of the window with the median value of each point in the window, and moving the window by changing the position of the central point of the window until the window finishes smoothing all the pixel points, namely finishing noise removal.
Step S12: and determining each photovoltaic module of each group of photovoltaic group strings in the preprocessed infrared image.
In this embodiment, the determining each photovoltaic module of each group of photovoltaic group strings in the preprocessed infrared image includes: image segmentation is carried out on the preprocessed infrared image based on a UNet neural network model to obtain a photovoltaic array mask image, and a photovoltaic group string covering rectangular frame in the photovoltaic array mask image is determined; and extracting a single component from the photovoltaic group strings corresponding to the covering rectangular frame of each photovoltaic group string through an edge detection algorithm and morphological closing operation to obtain a component boundary frame of each photovoltaic component so as to determine each photovoltaic component of each group of photovoltaic group strings in the preprocessed infrared image.
It should be noted that, because there is a large difference between the infrared image backgrounds acquired in different scenes, this puts forward a higher requirement on the robustness of the string segmentation algorithm, so the UNet neural network model needs to be a model trained by using the image segmentation dataset after the image segmentation dataset is built by acquiring the infrared images of the photovoltaic string in different scenes. UNet adopts a U-shaped network structure, and takes the first half part as an encoder and the second half part as a decoder. The encoder gradually reduces the image size and extracts the image features, the decoder gradually enlarges the feature map through the up-sampling operation, and meanwhile, the feature map of the encoder is connected with the feature map of the decoder through the jump connection, so that a segmentation result with the same size as the input image is finally generated, and the specific process is shown in fig. 4, which is a structural schematic diagram based on the UNet neural network model. The structure can effectively extract high-level characteristics of the image and keep space information, thereby improving the accuracy and the robustness of the segmentation of the photovoltaic group strings.
In this embodiment, referring to fig. 5, a schematic diagram of a mask image of a photovoltaic array is shown. It should be noted that in the figure, the photovoltaic string region is white, and the background region is black, so that the mask image of the photovoltaic array is obtained, and the influence of other background regions outside the photovoltaic string on the noise generated in the determined photovoltaic string can be reduced.
In this embodiment, before extracting, by using an edge detection algorithm and a morphological closing operation, a single component of the photovoltaic group string corresponding to the covering rectangular frame of each photovoltaic group string to obtain a component bounding box of each photovoltaic component, so as to determine each photovoltaic component of each group of the photovoltaic group strings in the preprocessed infrared image, the method further includes: and correcting each photovoltaic group string in the covering rectangular frame through perspective transformation. Specifically, the outline of the mask image is extracted, the minimum circumscribed rotating rectangular frame of the outline is calculated, and the photovoltaic string in the rectangular frame is corrected through perspective transformation. It is noted that the correction is also more positive even for a tilted rectangular frame.
In this embodiment, the filtering processing may be further performed on a portion of each photovoltaic string covering rectangular frame before determining each photovoltaic module of each group of photovoltaic strings in the preprocessed infrared image by extracting a single module of the photovoltaic string corresponding to each photovoltaic string covering rectangular frame through an edge detection algorithm and a morphological closing operation, so as to reduce noise influence.
It should be noted that the photovoltaic string is formed by vertically and horizontally arranging components, and small gaps exist between the components, and the components are represented as about 3 low gray pixels on the infrared image, so that the purpose of splitting the photovoltaic components can be achieved by extracting the contour lines of the gaps. The edge detection algorithm is sensitive to background noise, and the noise needs to be filtered by using Gaussian filter with the filter kernel size of 3×3, and then the edges of the component are extracted by using the Canny edge detection algorithm. Since break points exist between the extracted edge lines, edge break points are connected through morphological closing operation, and then the minimum circumscribed rectangle of each contour line is calculated to obtain a boundary frame of each photovoltaic module, and a schematic diagram is determined for one photovoltaic module, as shown in fig. 6.
Step S13: and clustering the photovoltaic modules by using a distance clustering algorithm to divide each group of photovoltaic group strings to obtain a module cluster with higher gray value and a module cluster with lower gray value.
In this embodiment, the gray value is higher and the gray value is lower in the higher gray value component cluster and the lower gray value component cluster, specifically, the two clusters are higher and lower compared.
In this embodiment, the average gray value of a single photovoltaic module is calculated according to the following formula:
;
wherein,indicating assembly(s)>For the assembly->Gray value at->For the assembly->Width (L)/(L)>For the assembly->Height, may be expressed based on the component coordinate system +.>The component coordinate system may be represented by the image coordinate system with the upper left corner of the component as the origin>The image coordinate system takes the upper left corner of the image as the origin.
In this embodiment, the clustering the photovoltaic modules by using a distance clustering algorithm to divide each group of photovoltaic group strings to obtain a module cluster with a higher gray value and a module cluster with a lower gray value includes: and clustering the photovoltaic components by using a K mean value++ clustering algorithm with a cluster of 2 to divide the component cluster with higher gray value and the component cluster with lower gray value in each group of photovoltaic group strings.
It should be noted that the brightness of the photovoltaic module generating the group string hot spots in the infrared image is higher than that of the normal module, based on the characteristic, K-means++ clustering with cluster number of 2 is performed according to the average gray value of the module, and the abnormal module and the normal module are divided. Abnormal components, i.e., higher gray value components, and normal components, i.e., lower gray value components.
Step S14: and if the absolute value of the difference value between the cluster centers of the component clusters with higher gray values and the component clusters with lower gray values in the photovoltaic group strings is larger than a clustering threshold value, marking the component clusters with higher gray values as an initial group string hot spot area so as to obtain an initial group string hot spot image marked with all the initial group string hot spot areas.
In this embodiment, the initial set of series hot spot areas are determined based on the following formula:
;
wherein,and->Gray values of two cluster centers, < >>Is a cluster threshold. If the above formula is satisfied, it is indicated that there is string hot spot on the photovoltaic string. Since the gray value of the hot spot area is higher than that of a normal component, clusters with larger cluster center values are used as cluster hot spot clusters.
In this embodiment, when the number of gray values is not specifically defined, the hot spots are clustered, but the clustering is performed based on the existing gray values, and the clustering can be performed using the existing gray values regardless of the scene, regardless of the external restrictions, so that the generalization is strong.
Step S15: and calculating a difference value between the region average temperature of each initial group of hot spot regions and the global average temperature in the initial infrared image, removing the initial group of hot spot regions with the difference value smaller than a temperature threshold value, and removing a part of each initial group of hot spot regions, which is overlapped with the light reflection region of the initial visible light image, so as to obtain a corresponding target group of hot spot regions and a target group of hot spot images marking all the target group of hot spot regions.
In this embodiment, the temperature of the group hot spot is higher than that of the normal component, and the temperature of a part of the false alarms does not satisfy this point, so the detected group hot spot can be screened according to the temperature. The average temperature of the normal photovoltaic strings on the same batch of infrared images collected by the unmanned aerial vehicle is similar, the occurrence frequency of the strings of hot spots is low, the average temperature distribution of the strings of the whole data set is similar to Gaussian distribution, and the average temperature distribution of the strings is shown in fig. 7. Obtaining the average temperature of the global photovoltaic module according to the temperature distribution, and filtering out the temperature as a false alarm if the temperature of the group of hot spots does not meet the following formula; the formula is as follows:
the method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Is the average temperature of the area>Is global average temperature, +.>Is a temperature threshold.
In this embodiment, since the packaging material on the surface of the photovoltaic module is made of glass, when the unmanned aerial vehicle carrying the infrared imager is patrolled and examined in a time period when sunlight irradiates more strongly, the collected image may include a reflective area with high brightness. The characteristics of the reflection and the series of hot spots are similar, and if the reflection is not treated, a large number of false alarms are likely to be generated, so that the reflection area needs to be eliminated.
In this embodiment, the region with high gray value due to reflection is eliminated, and the region with insufficient temperature is also eliminated, thereby reducing false alarm and improving accuracy.
In this embodiment, referring to fig. 8, a schematic diagram of a detection result is shown, in which the central cluster hot spots are correctly detected, and the reflective area has no false alarm.
The method comprises the steps of obtaining an initial visible light image and an initial infrared image of a photovoltaic array, and preprocessing the initial infrared image to obtain a preprocessed infrared image; determining each photovoltaic module of each group of photovoltaic group strings in the preprocessed infrared image; taking the difference value between the average gray values of the photovoltaic modules as a distance, and clustering the photovoltaic modules by using a distance clustering algorithm to divide each group of photovoltaic group strings, so as to obtain a module cluster with higher gray value and a module cluster with lower gray value; if the absolute value of the difference value between the cluster centers of the component clusters with higher gray values and the component clusters with lower gray values in the photovoltaic group strings is larger than a clustering threshold value, marking the component clusters with higher gray values as initial group string hot spot areas so as to obtain initial group string hot spot images marked with all the initial group string hot spot areas; calculating the difference value between the region average temperature of each initial group of hot spot regions and the global average temperature in the initial infrared image; and removing the initial group of hot spot areas with the difference value smaller than the temperature threshold value, and removing the part, overlapped with the light reflection area of the initial visible light image, of each initial group of hot spot areas to obtain corresponding target group of hot spot areas and target group of hot spot images marked with all the target group of hot spot areas. Therefore, the method and the device can use the existing gray values for clustering no matter what scene is based on, judge based on the clustering threshold value, and do not consider external limitation, so that the external limitation does not need to be changed under different environments, and the generalization is strong, so that the method and the device are suitable for different environments; in addition, the area with high gray value caused by reflection is eliminated, the area with insufficient temperature is also eliminated, the false alarm is reduced, and the accuracy is improved.
The embodiment of the application discloses a specific group string hot spot detection method, and compared with the previous embodiment, the technical scheme is further described and optimized. Referring to fig. 9, the method specifically includes:
step S21: and performing image registration on the initial visible light image and the preprocessed infrared image by taking the preprocessed infrared image as a matching template so as to obtain homography matrixes of the initial visible light image and the preprocessed infrared image.
In this embodiment, the temperature of the group hot spots is high, and because the temperature of the reflective area is also high, such false alarms cannot be filtered out by temperature constraint, and the group hot spot false alarms need to be suppressed by detecting the reflective area in the visible light image. The resolution of the visible light image sensor and the infrared image sensor are different from the viewing angle, and image registration is needed before further processing.
In this embodiment, the homography matrix is as follows:
;
wherein,for width scaling ratio +.>For a high scaling ratio +.>For horizontal translation amount, +.>Is the vertical translation.
In this embodiment, the performing image registration on the initial visible light image and the preprocessed infrared image to obtain a homography matrix of the initial visible light image and the preprocessed infrared image includes: scaling the initial visible light image to obtain a scaled visible light image with a scaling ratio of the pre-processed infrared image being a target height scaling ratio and a target width scaling ratio; performing image registration on the scaled visible light image and the preprocessed infrared image by using a normalization correlation coefficient matching method to obtain a cross correlation coefficient matrix between the scaled visible light image and the preprocessed infrared image; determining a maximum value in the cross-correlation coefficient matrix, determining a target position of an upper left corner of the preprocessed infrared image corresponding to the maximum value in a visible light image coordinate system of the scaled visible light image, and determining a horizontal translation amount and a vertical translation amount between the scaled visible light image and the preprocessed infrared image based on the target position; the visible light image coordinate system is a coordinate system taking the upper left corner of the zoomed visible light image as an origin; and obtaining homography matrixes of the initial visible light image and the preprocessed infrared image based on the target height scaling ratio, the target width scaling ratio, the horizontal translation amount and the vertical translation amount.
It should be noted that, the target height scaling ratio and the target width scaling ratio are scaling ratios of the camera corresponding to the initial visible light image; the shooting delay of the visible light and the infrared image of the same frame may be different, so the horizontal and vertical translation amounts need to be calculated by registration.
It should be noted that the resolution of the gray-scale image (scaled visible light image) obtained by scaling and converting the visible light image is higher than that of the infrared image, and thus the infrared image is used as a template.
In this embodiment, the formula corresponding to the normalized correlation coefficient matching method is as follows:
;
wherein,is infrared image>Is a grayed visible light image, < >>Is the gray-scale mean value of the template (infrared image,)>Is +.>Gray mean value of>Is the cross-correlation coefficient, and the position of the maximum value of the cross-correlation coefficient matrix is +.>,/>Dots representing infrared images +.>Representing points on the visible light image.
Step S22: and determining the light reflection area in the initial visible light image.
In this embodiment, the brightness of the reflective area is high, and the color is close to white, so that the visible light image is changed from RGB space to HSV space, the area with high brightness and low saturation is extracted, the influence of the white frame on the photovoltaic string is eliminated by using the on operation, and the adjacent reflective areas are combined by the off operation. And then extracting the contour lines of the areas and calculating the minimum circumscribed rectangle to obtain the reflective bounding box on the visible light image.
Step S23: and transforming the light reflection area to the initial group of serial hot spot images by utilizing a homography matrix, and determining the part, overlapping with the light reflection area, of the initial group of serial hot spot areas in the initial group of serial hot spot images.
In this embodiment, finally, the homography matrix is used to transform the reflective bounding box onto the infrared image coordinate system, and the series of hot spots overlapping with the reflective are removed, so as to complete the suppression of the false alarm.
As can be seen, the method and the device take the preprocessed infrared image as a matching template, and perform image registration on the initial visible light image and the preprocessed infrared image so as to obtain homography matrixes of the initial visible light image and the preprocessed infrared image; determining a light reflecting area in the initial visible light image; and transforming the light reflection area to the initial group of serial hot spot images by utilizing a homography matrix, and determining the part, overlapping with the light reflection area, of the initial group of serial hot spot areas in the initial group of serial hot spot images. Therefore, the method and the device calculate the overlapping part of the initial group hot spot region and the light reflecting region in the initial group hot spot image so as to facilitate the subsequent removal of the part, and improve the accuracy of group hot spot detection.
Referring to fig. 10, a schematic diagram of a group string hot spot detection flow is shown; in the figure, a photovoltaic array image is firstly collected by an unmanned plane carrying visible light and an infrared sensor, and then the infrared image is preprocessed, including image whitening and median filtering. And then the infrared image is segmented by the UNet neural network to obtain a photovoltaic group string, and the extraction of the photovoltaic module is realized by a Canny edge detection algorithm. Based on the characteristic that the gray value difference between the cluster hot spots and the normal component is large, the K-Mems++ clustering algorithm is used for finishing the primary detection of the cluster hot spots. Finally, image registration is completed through a normalization correlation coefficient template matching method, and false alarm suppression is realized according to temperature information and a reflection area on a visible light image; the extraction of the photovoltaic module is realized through a Canny edge detection algorithm, and specifically comprises Gaussian filtering, canny edge detection, closing operation and contour extraction, which are not specifically described herein; the specific process of image registration is completed by a normalized correlation coefficient template matching method, which comprises the steps of scaling visible light images, matching, searching the position of the maximum value in a matching result matrix (cross correlation coefficient matrix) and constructing a homography matrix, and the specific content is not specifically described.
In sum, the method and the device effectively realize detection of the group hot spots by combining the gray characteristics of the group hot spots on the infrared image, the detection is independent of the scene of the photovoltaic power station, meanwhile, the suppression of the group hot spot false alarm is realized by utilizing temperature difference information and the light reflection area in the visible light image, the problem of high group hot spot false alarm rate is solved, and the group hot spots and the light reflection are accurately distinguished.
The results of the scene tests are shown in the table one, the average accuracy of the group hot spot detection algorithm on a plurality of data sets can be up to 96.77%, the average recall rate is up to 93.13%, the accuracy and universality of the algorithm are verified, the accuracy of the data sets affected by reflection is smaller than that of the normal data sets, and the fact that the reflection area in the visible light image is used for inhibiting the group hot spot false alarm is feasible is shown; the recall rate indicates the removal rate of the false detection area through temperature and reflection after false detection is the initial group string hot spot area.
List one
Correspondingly, the embodiment of the application also discloses a group string hot spot detection device, as shown in fig. 11, which comprises:
an image acquisition module 11, configured to acquire an initial visible light image and an initial infrared image of the photovoltaic array;
An image preprocessing module 12, configured to preprocess the initial infrared image to obtain a preprocessed infrared image;
a component determining module 13, configured to determine each photovoltaic component of each group of photovoltaic group strings in the preprocessed infrared image;
the clustering module 14 is configured to take a difference value between average gray values of the photovoltaic modules as a distance, and cluster the photovoltaic modules by using a distance clustering algorithm to divide each group of the photovoltaic group strings, so as to obtain a cluster of modules with higher gray values and a cluster of modules with lower gray values;
the initial group string hot spot image determining module 15 is configured to label the component cluster with higher gray value as an initial group string hot spot area if the absolute value of the difference value between the cluster centers of the component cluster with higher gray value and the component cluster with lower gray value in the photovoltaic group string is greater than a clustering threshold value, so as to obtain an initial group string hot spot image labeled with all the initial group string hot spot areas;
a difference calculating module 16, configured to calculate a difference between an area average temperature of each of the initial set of hot spot areas and a global average temperature in the initial infrared image;
the target group cluster hot spot image determining module 17 is configured to remove the initial group cluster hot spot areas with the difference value smaller than the temperature threshold, and remove a portion of each initial group cluster hot spot area overlapping with the reflective area of the initial visible light image, so as to obtain a corresponding target group cluster hot spot area and a target group cluster hot spot image labeled with all the target group cluster hot spot areas.
The more specific working process of each module may be the same as that disclosed in the foregoing embodiment, and will not be described herein.
The method comprises the steps of obtaining an initial visible light image and an initial infrared image of a photovoltaic array, and preprocessing the initial infrared image to obtain a preprocessed infrared image; determining each photovoltaic module of each group of photovoltaic group strings in the preprocessed infrared image; taking the difference value between the average gray values of the photovoltaic modules as a distance, and clustering the photovoltaic modules by using a distance clustering algorithm to divide each group of photovoltaic group strings, so as to obtain a module cluster with higher gray value and a module cluster with lower gray value; if the absolute value of the difference value between the cluster centers of the component clusters with higher gray values and the component clusters with lower gray values in the photovoltaic group strings is larger than a clustering threshold value, marking the component clusters with higher gray values as initial group string hot spot areas so as to obtain initial group string hot spot images marked with all the initial group string hot spot areas; calculating the difference value between the region average temperature of each initial group of hot spot regions and the global average temperature in the initial infrared image; and removing the initial group of hot spot areas with the difference value smaller than the temperature threshold value, and removing the part, overlapped with the light reflection area of the initial visible light image, of each initial group of hot spot areas to obtain corresponding target group of hot spot areas and target group of hot spot images marked with all the target group of hot spot areas. Therefore, the method and the device can use the existing gray values for clustering no matter what scene is based on, judge based on the clustering threshold value, and do not consider external limitation, so that the external limitation does not need to be changed under different environments, and the generalization is strong, so that the method and the device are suitable for different environments; in addition, the area with high gray value caused by reflection is eliminated, the area with insufficient temperature is also eliminated, the false alarm is reduced, and the accuracy is improved.
Further, the embodiment of the application also provides electronic equipment. Fig. 12 is a block diagram of an electronic device 20, according to an exemplary embodiment, and the contents of the diagram should not be construed as limiting the scope of use of the present application in any way.
Fig. 12 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a display screen 23, an input output interface 24, a communication interface 25, a power supply 26, and a communication bus 27. The memory 22 is configured to store a computer program, where the computer program is loaded and executed by the processor 21 to implement the relevant steps in the group string hot spot detection method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 26 is used to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 24 is used for obtaining external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application needs, which is not limited herein.
The memory 22 may be a read-only memory, a random access memory, a magnetic disk, an optical disk, or the like, and the resources stored thereon may include the computer program 221, which may be stored in a temporary or permanent manner. The computer program 221 may further include a computer program for performing other specific tasks in addition to the computer program for performing the group string hot spot detection method performed by the electronic device 20 disclosed in any of the foregoing embodiments.
Further, the embodiment of the application also discloses a computer readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the previously disclosed cluster hot spot detection method.
The specific steps of the method may be referred to as corresponding matters disclosed in the foregoing embodiments, and will not be described herein.
In this application, each embodiment is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same or similar parts between the embodiments refer to the devices disclosed in the embodiments, so that the description is relatively simple because it corresponds to the method disclosed in the embodiments, and the relevant parts refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above describes in detail a method, apparatus, device and storage medium for detecting hot spots in strings, and specific examples are applied to illustrate the principles and embodiments of the present application, and the description of the above examples is only used to help understand the method and core ideas of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.