Generation of preset template library and noise recognition method and device for photovoltaic string image
By generating a preset template library and utilizing feature clustering and matching, the accuracy problem of photovoltaic string image noise recognition was solved, and the accuracy and robustness of string segmentation were improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUNGROW SMART MAINTENANCE TECH CO LTD
- Filing Date
- 2023-09-15
- Publication Date
- 2026-04-24
AI Technical Summary
Existing technologies cannot accurately identify noise in photovoltaic string images, leading to inaccurate string segmentation, especially in cases of frameless strings and mountain power plants affected by solar reflection.
By generating a preset template library, positive and negative templates are determined using feature clustering and feature matching methods to identify noise in photovoltaic string images.
It achieves accurate identification of noise in photovoltaic string images, improves the accuracy and robustness of string segmentation, and is suitable for various complex scenarios.
Smart Images

Figure CN117315265B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition, and more specifically, to a method and apparatus for generating a preset template library and for noise recognition of photovoltaic string images. Background Technology
[0002] Intelligent analysis of drone inspections is of great significance for the refined operation and maintenance of power plants, while fully automatic string segmentation lays a very important foundation for drone inspections of power plants and the quantification of string component indicators.
[0003] Currently, deep learning-based semantic segmentation algorithms can effectively segment photovoltaic (PV) strings in panoramic maps. However, deep learning algorithms are strongly coupled with the amount of data samples. This means that for segmenting PV strings in power plants, a large number of visible light images from various types of power plants under different seasonal conditions need to be collected for algorithm training to ensure the algorithm model has better segmentation robustness in each scenario. However, in PV power plant scenarios, the number of PV panels produced by manufacturers is relatively limited. Focusing on the texture features of the limited number of PV strings themselves and removing misidentified noise can maximize the scene generalization ability of the segmentation model. Based on this, a denoising scheme for PV string segmentation results can be adopted. Currently, a common denoising method for PV string images is based on orthogonal line detection. This scheme is based on the characteristic of horizontal and vertical alignment of the components in the PV string, a characteristic not considered in noisy regions. It can greatly remove noise from string segmentation, but it will have problems with strings with the following two characteristics:
[0004] Figure 1 This is a schematic diagram of photovoltaic string image denoising based on orthogonal line detection, according to existing technology. Figure 1 ,like Figure 1 As shown, the component boundaries in borderless strings are unclear. When using orthogonal lines to detect borderless strings, they are misidentified as noise, resulting in the problem of missing segmentation of borderless strings.
[0005] Figure 2 This is a schematic diagram of photovoltaic string image denoising based on orthogonal line detection, according to existing technology. Figure 2 ,like Figure 2 As shown, the drone footage of the mountain power station was affected by sunlight reflection, resulting in unclear boundaries of the components in the string. During orthogonal line detection, these components were also misidentified as noise, leading to the problem of missing string segmentation.
[0006] There is currently no effective solution to the problem that existing technologies cannot accurately identify noise in photovoltaic string images. Summary of the Invention
[0007] This invention provides a method and apparatus for generating a preset template library and identifying noise in photovoltaic string images, so as to at least solve the technical problem that the prior art cannot accurately identify noise in photovoltaic string images.
[0008] According to one aspect of the present invention, a method for generating a preset template library is provided, comprising: acquiring multiple sample slice images of a photovoltaic region where a photovoltaic string is located, wherein the sample slice images include: photovoltaic slice images of the photovoltaic string and background noise slice images; performing feature clustering on the multiple sample slice images according to image features to obtain multiple target clusters, wherein each target cluster corresponds to at least one photovoltaic slice image; determining positive templates based on the photovoltaic slice images in the target clusters; assigning a corresponding noise slice image as a negative template to each positive template, and using the set of positive templates and negative templates as a preset template library.
[0009] According to one aspect of the present invention, another method for noise identification of photovoltaic string images is provided, comprising: acquiring a plurality of slice images to be identified in a target region, wherein the target region includes photovoltaic strings; performing feature matching between the slice images to be identified and positive and negative templates in a preset template library, and statistically determining the voting result of the slice images to be identified, wherein the preset template library is obtained by applying the above-described method for generating the preset template library, and is used to vote according to the feature matching result of the slice images to be identified with the positive and negative templates, the voting result including: a first number of votes indicating that the slice images to be identified match the positive template, and a second number of votes indicating that the slice images to be identified match the negative template; determining a noise slice image from the plurality of slice images to be identified in the target region according to the voting result, or determining the slice images to be identified as photovoltaic slice images according to the voting result.
[0010] According to one aspect of the present invention, another apparatus for generating a preset template library is provided, comprising: a first acquisition module, configured to acquire multiple sample slice images of a photovoltaic region where a photovoltaic string is located, wherein the sample slice images include: photovoltaic slice images of the photovoltaic string and background noise slice images; a clustering module, configured to perform feature clustering on the multiple sample slice images according to image features to obtain multiple target clusters, wherein each target cluster corresponds to at least one photovoltaic slice image; a first determination module, configured to determine positive templates based on the photovoltaic slice images in the target clusters; and a second determination module, configured to assign a corresponding noise slice image as a negative template to each positive template, and to use the set of positive templates and negative templates as a preset template library.
[0011] According to one aspect of the present invention, another noise identification device for photovoltaic string images is provided, comprising: a second acquisition module, configured to acquire a plurality of slice images to be identified in a target region, wherein the target region includes photovoltaic strings; a statistics module, configured to perform feature matching between the slice images to be identified and positive and negative templates in a preset template library, and to statistically determine the voting result of the slice images to be identified, wherein the preset template library is obtained by applying the aforementioned preset template library generation device, and is configured to vote according to the feature matching result of the slice images to be identified with the positive and negative templates, the voting result including: a first number of votes indicating that the slice images to be identified match the positive template, and a second number of votes indicating that the slice images to be identified match the negative template; and a third determination module, configured to determine a noise slice image from the plurality of slice images to be identified in the target region according to the voting result, or to determine the slice images to be identified as photovoltaic slice images according to the voting result.
[0012] According to one aspect of the present invention, another non-volatile storage medium is provided, the non-volatile storage medium being used to store a program, wherein, when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned method for generating the preset template library, or the above-mentioned method for noise recognition of photovoltaic string images.
[0013] According to one aspect of the present invention, another electronic device is provided, comprising: a memory and a processor, the processor being configured to run a program stored in the processor, wherein the program, when running, executes the above-described method for generating a preset template library, or the above-described method for noise recognition of photovoltaic string images.
[0014] In this embodiment of the invention, by using feature clustering and annotated photovoltaic slice images in sample slice images, positive templates in a preset template library can be automatically determined. By using annotated noise slice images in the sample slice images to assign negative templates to the determined positive templates, a preset template library based on the set of positive and negative templates can be obtained. Then, when it is necessary to determine the image category of the slice image to be identified, the image category of the slice image to be identified can be determined based on the positive and negative templates in the preset template library. The slice image to be identified that is closer to the negative template than the positive template is identified as a noise slice image. Thus, the accurate identification of noise slice images can be completed using a small number of annotated positive and negative templates, and the accuracy of the identification results can be ensured. This achieves the technical effect of accurately identifying noise slice images and solves the technical problem that the prior art cannot accurately identify the noise in photovoltaic string images. Attached Figure Description
[0015] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0016] Figure 1 This is a schematic diagram of photovoltaic string image denoising based on orthogonal line detection, according to existing technology. Figure 1 ;
[0017] Figure 2 This is a schematic diagram of photovoltaic string image denoising based on orthogonal line detection, according to existing technology. Figure 2 ;
[0018] Figure 3 This is a flowchart of a method for generating a preset template library according to an embodiment of the present invention;
[0019] Figure 4 This is a flowchart of a method for noise identification of photovoltaic string images according to an embodiment of the present invention;
[0020] Figure 5 This is a schematic diagram of a denoising process based on SIFT feature clustering and matching voting according to an embodiment of the present invention;
[0021] Figure 6 This is a schematic diagram illustrating the construction of an adaptive template library according to an embodiment of the present invention;
[0022] Figure 7 This is a schematic diagram of an adaptive clustering algorithm according to an embodiment of the present invention;
[0023] Figure 8 This is a schematic diagram illustrating a template selection principle according to an embodiment of the present invention;
[0024] Figure 9 This is a schematic diagram of a feature matching voting strategy according to an embodiment of the present invention;
[0025] Figure 10A This is a schematic diagram of the effect before segmentation and denoising according to an embodiment of the present invention. Figure 1 ;
[0026] Figure 10B This is a schematic diagram of the segmentation and denoising effect according to an embodiment of the present invention. Figure 1 ;
[0027] Figure 11A This is a schematic diagram of the effect before segmentation and denoising according to an embodiment of the present invention. Figure 2 ;
[0028] Figure 11B This is a schematic diagram of the segmentation and denoising effect according to an embodiment of the present invention. Figure 2 ;
[0029] Figure 12A This is a schematic diagram of the effect before segmentation and denoising according to an embodiment of the present invention. Figure 3 ;
[0030] Figure 12B This is a schematic diagram of the segmentation and denoising effect according to an embodiment of the present invention. Figure 3 ;
[0031] Figure 13A This is a schematic diagram of the effect before segmentation and denoising according to an embodiment of the present invention. Figure 4 ;
[0032] Figure 13B This is a schematic diagram of the segmentation and denoising effect according to an embodiment of the present invention. Figure 4 ;
[0033] Figure 14 This is a schematic diagram of a device for generating a preset template library according to an embodiment of the present invention;
[0034] Figure 15 This is a schematic diagram of a noise recognition device for photovoltaic string images according to an embodiment of the present invention;
[0035] Figure 16 This is a structural block diagram of a computer terminal according to an embodiment of the present invention. Detailed Implementation
[0036] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0037] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0038] According to an embodiment of the present invention, a method for denoising photovoltaic string images is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0039] Figure 3 This is a flowchart of a method for generating a preset template library according to an embodiment of the present invention, such as... Figure 3 As shown, the method includes the following steps:
[0040] Step S302: Obtain multiple sample slice images of the photovoltaic region where the photovoltaic string is located, wherein the sample slice images include: photovoltaic slice images of the photovoltaic string and noise slice images of the background;
[0041] Step S304: Cluster the multiple sample slice images according to image features to obtain multiple target clusters, wherein each target cluster corresponds to at least one photovoltaic slice image;
[0042] Step S306: Determine the positive template based on the photovoltaic slice image in the target cluster;
[0043] Step S308: Assign a corresponding noise slice image as a negative template to each positive template, and use the set of positive and negative templates as a preset template library.
[0044] In this embodiment of the invention, by using feature clustering and annotated photovoltaic slice images in sample slice images, positive templates in a preset template library can be automatically determined. By using annotated noise slice images in the sample slice images to assign negative templates to the determined positive templates, a preset template library based on the set of positive and negative templates can be obtained. Then, when it is necessary to determine the image category of the slice image to be identified, the image category of the slice image to be identified can be determined based on the positive and negative templates in the preset template library. The slice image to be identified that is closer to the negative template than the positive template is identified as a noise slice image. Thus, the accurate identification of noise slice images can be completed using a small number of annotated positive and negative templates, and the accuracy of the identification results can be ensured. This achieves the technical effect of accurately identifying noise slice images and solves the technical problem that the prior art cannot accurately identify the noise in photovoltaic string images.
[0045] In step S302 above, the photovoltaic region is a region where photovoltaic strings are pre-determined, and the sample slice image determined based on the photovoltaic region is the photovoltaic slice image.
[0046] In step S304 above, when the sample slice image is a photovoltaic slice image, images with the same or similar image features represent photovoltaic strings; when the sample slice image is a noisy slice image, images with the same or similar image features represent noise. Then, the sample slice images are clustered through adaptive learning, which can cluster sample slice images with the same or similar image features into one cluster, resulting in multiple target clusters. Then, based on the sample slice images in the multiple target clusters, positive templates and negative templates can be determined.
[0047] In step S306 above, determining the positive template based on the photovoltaic slice images in the target cluster includes: determining the cluster center of the target cluster; determining the cluster distance of each photovoltaic slice image relative to the cluster center; determining photovoltaic slice images with a cluster distance lower than a preset distance threshold as being close to the cluster center, and determining the photovoltaic slice image as the positive template.
[0048] In step S308 above, assigning a corresponding negative template to each positive template includes: determining a pre-determined noise slice image as a negative template; and assigning a corresponding negative template to each positive template.
[0049] Optionally, the number of positive templates and negative templates in the preset template library is the same.
[0050] Optionally, the preset area includes a photovoltaic area and a non-photovoltaic area. The photovoltaic area is marked as having photovoltaic strings, while the non-photovoltaic area is marked as not having photovoltaic strings. Positive templates in the preset template library can be determined based on sample slice images in the photovoltaic area, and negative templates in the preset template library can be determined based on sample slice images in the non-photovoltaic area.
[0051] Optionally, the background area of the photovoltaic strings in the non-photovoltaic area can be preset.
[0052] It should be noted that the image features used for feature clustering can be SIFT features in the sample slice image. SIFT stands for Scale-invariant feature transform, which is a machine vision algorithm used to detect and describe local features in images.
[0053] As an optional embodiment, obtaining multiple sample slice images of the photovoltaic region where the photovoltaic string is located includes: obtaining a preset map image including the photovoltaic region, wherein the preset map image is a visible light map image or an invisible light map image; performing masking processing on the preset map image to obtain a preset mask image, wherein the preset mask image is used to distinguish between the photovoltaic region and non-photovoltaic regions; performing contour segmentation on the preset mask image according to semantic segmentation to determine the photovoltaic region image of the photovoltaic region; and slicing the photovoltaic region image to determine sample slice images.
[0054] Optionally, the preset map image can be a map image of a preset area acquired by visible or invisible light, and the preset area may include photovoltaic areas and non-photovoltaic areas.
[0055] In the above embodiments of this application, during the process of obtaining multiple sample slice images of a photovoltaic region, a preset map image can be first masked to distinguish between photovoltaic and non-photovoltaic regions. Then, the preset mask image after masking is contour segmented by semantic segmentation to obtain a photovoltaic region image that can represent the characteristics of the photovoltaic string. Subsequently, the photovoltaic region image is sliced to obtain sample slice images, thereby realizing the determination of the sample slice images.
[0056] Optionally, masking the preset map image includes: binarizing the preset map image to obtain a black and white map of the preset area.
[0057] Optionally, contour segmentation can be performed on the preset mask image according to semantic segmentation to determine the non-photovoltaic region image of the non-photovoltaic region; the non-photovoltaic region image can be sliced to determine the noise slice image as the negative template.
[0058] As an optional embodiment, clustering multiple sample slice images according to image features to obtain multiple target clusters includes: performing multiple feature clustering operations on the multiple sample slice images according to image features to obtain multiple preset clusters with different preset numbers of clusters; evaluating the silhouette coefficients of the multiple preset clusters with preset numbers of clusters to determine the correlation between the preset number of clusters and the silhouette coefficients; determining the preset number of clusters that maximizes the silhouette coefficient as the target number of clusters; and determining the multiple preset clusters with the target number of clusters as the target clusters.
[0059] In the above embodiments of this application, feature clustering can be performed on multiple sample slice images according to different preset cluster numbers, resulting in multiple preset clusters with different preset cluster numbers. Then, by evaluating the contour coefficients of multiple preset clusters with different preset cluster numbers, a suitable target cluster can be selected, and the target cluster can be determined according to the target cluster, thereby realizing the acquisition of the target cluster and enabling the determined target cluster data to reflect the image features of the photovoltaic module.
[0060] Optionally, the image features can be SIFT features. SIFT features, short for Scale Invariant Feature Transform, are local features of an image that remain unchanged by rotation, scaling, and brightness changes, and also maintain a certain degree of stability against viewpoint changes, affine transformations, and noise.
[0061] Optionally, feature clustering can be performed using the k-means algorithm to adaptively cluster the SIFT features of the sample slice image. The preset number of clusters can be the k value in the k-means algorithm, which represents the number of cluster centers. Then, based on the k number of cluster centers, the k number of preset clusters can be obtained.
[0062] Optionally, the preset number of clusters can be pre-set. During the process of clustering multiple sample slice images according to image features, cluster centers can be selected from multiple sample slice images according to the preset number of clusters. Then, the similarity between each sample slice image and each cluster center is determined according to the Euclidean distance between each sample slice image and each distance center. If the Euclidean distance is less than the distance threshold, that is, if the sample slice image and the cluster center are similar, the sample slice image is assigned to that cluster center. By assigning multiple sample slice images to their corresponding cluster centers, multiple preset clusters with the preset number of clusters can be obtained.
[0063] Optionally, the preset number of clusters can represent the number of categories of the image features. For example, when the image features represent photovoltaic strings, the preset number of clusters can be determined based on the number of categories of photovoltaic strings, where photovoltaic strings of the same category have the same image features.
[0064] Optionally, the number of photovoltaic strings can be determined based on their color differences in the image. For example, the same type of photovoltaic string may exhibit color differences in images under different lighting conditions. Therefore, photovoltaic strings with smaller color differences can be grouped into one category. Thus, based on the color differences of the photovoltaic strings in the image, they can be classified into multiple categories, thereby determining the number of photovoltaic string categories.
[0065] Optionally, in order to enable the target cluster to represent the image features of various photovoltaic modules, feature clustering can be performed multiple times according to different preset cluster numbers. Then, contour analysis is performed on the preset clusters obtained after multiple feature clustering to determine the most suitable number of target clusters, and then the target clusters obtained based on the target clustering data are determined.
[0066] It's important to note that in the k-means algorithm, the silhouette coefficient (ch) is a clustering performance evaluation metric used to assess the quality of clustering. The silhouette coefficient (ch) stands for Calinski-Harabasz, and it is calculated based on the differences within and between clusters.
[0067] Optionally, the silhouette coefficient ch = (BSS / (k-1)) / (WSS / (nk)), where k represents the preset number of clusters, n represents the total number of sample slice images, BSS stands for Between-Cluser Sum of Squares, which represents the mean square error between clusters, BSS(i) represents the mean square error within the i-th cluster, WSS stands for Within-Cluser Sum of Squares, which represents the mean square error within a cluster, and WSS(i) represents the mean square error between the i-th cluster and other clusters. The larger the silhouette coefficient ch, the better the clustering effect.
[0068] As an optional embodiment, the set of positive and negative templates is used as a preset template library, including: using a positive template and a negative template as a preset template group, wherein the preset template group is used to vote based on the feature matching results between the slice image to be identified and the positive and negative templates; determining a preset template library based on multiple preset template groups, wherein the preset template library is used to determine the image category of the slice image to be identified based on the voting of multiple preset template groups, and the image category includes: a noise slice image or a photovoltaic slice image.
[0069] In the above embodiments of the present invention, the preset template library records positive and negative templates through preset template groups. Each preset template group is based on a pair of positive and negative templates, with the positive template representing a photovoltaic slice image and the negative template representing a noise slice image. Then, based on the matching results between the slice image to be identified and the positive and negative templates in each preset template group, it is determined whether the slice image to be identified is approximately a positive or negative template. Then, a vote is given for the preset template group. The voting result can be obtained by statistically analyzing the votes given by multiple preset template groups.
[0070] It should be noted that if the positive and negative templates in the preset template library are not grouped, the slice image to be identified cannot be accurately classified when both the positive and negative templates are very similar. For example, if the same slice image to be identified has a 52% similarity to the positive template and a 51.2% similarity to the negative template, both the positive and negative templates may vote for it, making accurate identification impossible. However, by dividing the positive and negative templates in the preset template library into multiple preset template groups, and each preset template group can only cast one vote, when the same slice image to be identified has a 52% similarity to the positive template and a 51.2% similarity to the negative template, the vote of the preset template group can only indicate that the slice image to be identified is closer to the positive template. Thus, the classification of the slice image to be identified can be completed based on the vote of the preset template group.
[0071] Optionally, each preset template group may include one positive template and one negative template; it may also include two or more positive templates and two or more negative templates, wherein the number of positive templates and negative templates in the same preset template group is the same.
[0072] Figure 4 This is a flowchart of a method for noise recognition of photovoltaic string images according to an embodiment of the present invention, such as... Figure 4 As shown, the method includes the following steps:
[0073] Step S402: Obtain multiple slice images of the target area to be identified, wherein the target area includes photovoltaic strings;
[0074] Step S404: Perform feature matching between the slice image to be identified and the positive and negative templates in the preset template library, and count the feature matching results to determine the voting result of the slice image to be identified. The preset template library is obtained by applying the above-described method for generating the preset template library, and is used to vote based on the feature matching results between the slice image to be identified and the positive and negative templates. The voting result includes: a first number of votes indicating that the slice image to be identified matches the positive template, and a second number of votes indicating that the slice image to be identified matches the negative template.
[0075] Step S406: Among multiple slice images to be identified in the target area, determine the noisy slice image based on the voting results, or determine the slice image to be identified as a photovoltaic slice image based on the voting results.
[0076] In this embodiment of the invention, the slice image to be identified is matched with positive and negative templates in a preset template library, and the voting result of the slice image to be identified is determined based on the matching result of the slice image to be identified with the positive or negative template. It can be determined that the slice image to be identified that is closer to the negative template than the positive template is a noise slice image. Thus, the accurate identification of noise slice images can be completed using a small number of labeled positive and negative templates, and the accuracy of the identification result can be ensured. This achieves the technical effect of accurately identifying noise slice images and solves the technical problem that the prior art cannot accurately identify the noise in photovoltaic string images.
[0077] In step S402 above, the target area can be the region where photovoltaic strings are deployed, and the slice image to be identified can be the slice image to be identified obtained by semantic segmentation of the map of the target area.
[0078] Optionally, the process of performing feature matching between the slice image to be identified and the positive and negative templates in the preset template library, and statistically analyzing the feature matching results to determine the voting result of the slice image to be identified, includes: matching the slice image to be identified with each positive template in the preset template library respectively; if the matching result meets a preset condition, such as the similarity of the matching is higher than a preset similarity, then the first vote of the positive template for the slice image to be identified is obtained; matching the slice image to be identified with each negative template in the preset template library respectively; if the matching result meets a preset condition, such as the similarity of the matching is higher than a preset similarity, then the second vote of the negative template for the slice image to be identified is obtained; and the number of the first vote and the second vote is counted to obtain the voting result of the slice image to be identified.
[0079] As an optional embodiment, determining the voting result of the slice image to be identified by statistical feature matching results includes: identifying the features of the slice image to be identified; extracting the photovoltaic string features of the positive template and the noise region features of the negative template in each preset template group, wherein the preset template group is obtained by pairing positive templates and negative templates in a preset template library, and the preset template group includes positive templates and negative templates; determining the vote for each preset template group according to the feature matching results of the image features to be identified with the photovoltaic string features and the noise region features respectively, wherein the vote includes: a first vote to indicate that the slice image to be identified matches the positive template, or a second vote to indicate that the slice image to be identified matches the negative template; and counting the number of votes for multiple preset template groups to obtain the voting result.
[0080] In the above embodiments of the present invention, during the feature matching process between the slice image to be identified and the positive and negative templates in the preset template library, the features to be identified in the slice image to be identified, as well as the photovoltaic string features of the positive template and the noise region features of the negative template in each preset template group, can be determined first. Then, the features to be identified are compared with the photovoltaic string features and the noise region features respectively to determine whether the features to be identified are similar to the photovoltaic string features or the noise region features, thereby obtaining the feature matching result. Based on the feature matching result, the vote of the preset template group for the slice image to be identified is determined. Then, the votes of multiple preset template groups in the preset template library for the slice image to be identified are counted to obtain the voting result of the slice image to be identified. Based on the votes of multiple preset template groups in the preset template library for the slice image to be identified, the accurate classification of the features to be identified in the slice image to be identified can be achieved.
[0081] It should be noted that the positive and negative templates in different preset template groups are different. Therefore, the classification results of the slice image to be identified will also be different based on different preset template groups. Thus, the votes of multiple preset template groups will also be different. However, the content expressed by the votes of multiple preset template groups is nothing more than: whether the slice image to be identified is similar to the positive template or the negative template. By statistically analyzing the votes of multiple preset template groups, the classification of the slice image to be identified can be completed based on the votes that express the same result, avoiding the adverse effects of accidental erroneous votes on the classification results, thereby improving the accuracy of classification.
[0082] Optionally, the preset template group may include only positive templates or only negative templates. For example, if the preset template group includes only positive templates, the matching degree between the image feature to be identified and the positive template can be calculated. If the matching degree is higher than the preset matching degree, it is determined that the image feature to be identified matches the positive template, and then the preset template group votes; otherwise, the preset template group does not vote.
[0083] Optionally, if the preset template group only includes negative templates, the voting method for the preset template group is similar to the above-mentioned factual method, and will not be repeated here.
[0084] As an optional embodiment, determining the vote for each preset template group based on the feature matching results of the image features to be identified with the photovoltaic string features and the noise region features respectively includes: determining the positive matching degree between the image features to be identified and the photovoltaic string features, and the negative matching degree between the image features to be identified and the noise region features; when the positive matching degree is higher than the negative matching degree, the vote of the preset template group is determined as the first vote; when the negative matching degree is higher than the positive matching degree, the vote of the preset template group is determined as the second vote.
[0085] In the above embodiments of the present invention, each preset template group in the preset template library can express its classification opinion on the features of the image to be identified through voting. By statistically analyzing the voting types of multiple preset template groups in the preset template library, the tendency of the preset template library to express the classification results of the image to be identified can be known. Thus, the classification opinions of each preset template group in the preset template library can be quickly collected by statistically analyzing the voting, which facilitates the summarization of the classification opinions of multiple preset template groups.
[0086] Optionally, determining the positive matching degree between the image features to be identified and the photovoltaic string features includes: determining the similarity between the image features to be identified and the photovoltaic string features; determining the negative matching degree between the image features to be identified and the noise region features includes: determining the similarity between the image features to be identified and the noise region features.
[0087] As an optional embodiment, counting the number of votes for multiple preset template groups to obtain the voting result includes: counting the number of first votes to determine the first vote count; counting the number of second votes to determine the second vote count; and determining the voting result based on the first vote count and the second vote count.
[0088] In the above embodiments of the present invention, the first vote represents a photovoltaic slice image that the preset template group believes belongs to the positive template, and the second vote represents a noise slice image that the preset template group believes belongs to the negative template. By counting the first vote count of the first vote and the second vote count of the second vote, the tendency of the multiple preset template groups in the preset template library to classify the slice image to be identified can be known. Then, based on the first vote count and the second vote count, it can be determined whether the slice image to be identified belongs to the photovoltaic slice image or the noise slice image, thus realizing the classification of the slice image to be identified.
[0089] As an optional embodiment, determining a noisy slice image based on voting results among multiple slice images to be identified in the target area includes: determining the slice image to be identified as a noisy slice image when the second number of votes is greater than the first number of votes; or determining the slice image to be identified as a noisy slice image when the second number of votes is greater than a preset voting threshold; or determining the slice image to be identified as a photovoltaic slice image when the first number of votes is greater than the first number of votes; and removing the photovoltaic slice image from the multiple slice images to be identified in the target area to obtain the noisy slice image.
[0090] In the above embodiments of the present invention, to denoise the target area, it is necessary to identify the noise slice image among multiple slice images to be identified in the target area. In the process of identifying the noise slice image, the noise slice image can be directly determined from multiple slice images to be identified, or the photovoltaic slice image can be determined from multiple slice images to be identified first, and then the other slice images to be identified can be used as noise slice images.
[0091] It should be noted that, whether the noise slice image is determined directly or the photovoltaic slice image is determined first and then the noise slice image is determined, it is necessary to identify each of the multiple slice images to be identified in the target area.
[0092] Optionally, the identification of each of the multiple slice images to be identified in the target area includes: obtaining the voting result of each slice image to be identified, determining the first number of votes and the second number of votes for the slice image to be identified, and if the second number of votes is greater than the first number of votes, it indicates that more than half of the preset template groups in the preset template library consider the slice image to be identified to be a noisy slice image.
[0093] Furthermore, when the number of first and second votes is very close, comparing the second and first votes may not yield accurate results. For example, if the ratio of first to second votes is 45:55, even if the second vote is greater than the first, the small difference in vote count can severely interfere with the voting results, making accurate classification impossible.
[0094] Optionally, a preset voting threshold is set according to the number of preset template groups in the preset template library. If the number of votes for a certain type of vote is greater than the preset voting threshold, the tendency of the preset template library to classify the slice image to be identified can be determined.
[0095] Optionally, the preset voting threshold can be set to 80% of the number of preset template groups in the preset template library. If the number of second votes is greater than the preset voting threshold, it means that the preset template groups in the preset template library basically consider the slice image to be identified to be a noisy slice image, and the classification result is highly accurate.
[0096] Optionally, among the multiple slice images to be identified in the target area, there are photovoltaic slice images and noise slice images. Since there are obvious photovoltaic module features in the photovoltaic slice images, if the noise slice images cannot be accurately determined from the slice images to be identified, the photovoltaic slice images in the slice images to be identified can be determined first, and then all the remaining slice images to be identified in the target area can be regarded as noise slice images, thereby realizing the distinction between photovoltaic slice images and noise slice images.
[0097] As an optional embodiment, the method further includes: filling the noisy slice image with a preset background image of the target region.
[0098] In the above embodiments of the present invention, the preset background image can be a noise-free background image, such as using an image that is significantly different from the characteristics of the photovoltaic string as the preset background image, or using a preset background image with uniform color.
[0099] The present invention also provides an optional embodiment, which provides a photovoltaic string denoising method based on SIFT feature clustering and matching voting. This method solves the problem of noise in string segmentation and achieves consistently excellent denoising results in image segmentation applications of power stations in mountainous areas, water surfaces, rooftops, and flatlands based on UAVs.
[0100] Figure 5 This is a schematic diagram of a SIFT-based feature clustering and matching voting denoising process according to an embodiment of the present invention, as shown below. Figure 5As shown, typical photovoltaic panels and noise libraries are obtained through SIFT feature extraction and clustering. Then, a matching vote is performed on each photovoltaic panel and noise level to filter the noise. The specific steps are as follows:
[0101] Step S501: Extract all possible photovoltaic string regions in the mask.
[0102] Step S502: Perform SIFT feature extraction on each block.
[0103] Step S503: Cluster all features and select the clustering result with the best result.
[0104] Step S504: Select the block closest to the cluster center as the positive template.
[0105] Step S505: Select a negative template from the non-string regions in the mask.
[0106] Step S506: Divide all positive and negative templates into template groups one by one.
[0107] Step S507: Each block must be SIFT+FLANN matched with the positive and negative templates within each template group.
[0108] Step S508: Calculate the nearest matching result to determine whether there are more positive template matches or negative template matches within the template group.
[0109] Step S509: Based on the matching results of the template group, use a voting method to determine whether the block is a string region or noise.
[0110] Step S510: Fill the background in the noise area.
[0111] Figure 6 This is a schematic diagram illustrating the construction of an adaptive template library according to an embodiment of the present invention, such as... Figure 6 As shown, for steps S501 to S506 above, before constructing the adaptive template library, a segmentation mask corresponding to the panoramic map 62 is obtained through a semantic segmentation algorithm to obtain a mask image 64. Then, sample slice images corresponding to all segmentation contours are obtained from the semantic segmentation mask image. The sample slice images include photovoltaic slice images of photovoltaic strings and noise slice images of noise. The SIFT features (i.e., image features) of these masks are calculated. Each mask can be described by a set of SIFT features (i.e., image features). Then, a clustering algorithm is used to adaptively cluster all masks to obtain several clusters. The strings (i.e., photovoltaic slice images) near the center of these clusters are used as positive templates for constructing the template library. In addition, a portion of non-mask regions of equal size (such as noise slice images) are randomly selected from the image as negative templates.
[0112] In practical applications, to improve the matching effect of negative templates, the same method used to generate positive templates can be used to perform feature clustering on non-masked regions to obtain negative templates.
[0113] In this embodiment, the method of using positive and negative template matching to screen components and noise only requires labeling the characteristics of photovoltaic panels produced by different manufacturers. In other words, only a limited number of photovoltaic panels are labeled, without the need to use a large amount of prior data as in the prior art. This embodiment reduces the dependence on prior data, thereby reducing the amount of data labeling and lowering the application cost.
[0114] Optionally, the gradient of pixel value change from each adjacent string (i.e., photovoltaic slice image) to the cluster center can be calculated. If the gradient is too large, it will not be selected, which can further ensure the accuracy of the positive template and avoid using a positive template with insufficient features.
[0115] For example, such as Figure 6 As shown, the mask image 64 includes a photovoltaic string region 642 and a background region 644, wherein the background region may contain noise.
[0116] Optionally, in such Figure 6 In the mask image shown, the corresponding photovoltaic string in the visible light image is extracted based on the pixel labels of the 642 photovoltaic string region. Then, SIFT is used to extract the feature points of each string to obtain the photovoltaic string features. Because there are multiple strings, and there may be color differences due to shooting or the strings themselves, the k-means algorithm is used to cluster all the photovoltaic string features extracted by SIFT.
[0117] It should be noted that since the number of photovoltaic strings with large color differences is unknown, we can limit the maximum clustering value K, where K represents the number of photovoltaic strings classified according to color difference. Then, we evaluate the silhouette coefficient ch value for each K value, and select the optimal ch value. The K value corresponding to the largest ch value is taken as the number of clusters. Then, we can select K photovoltaic strings with color differences based on the cluster centers.
[0118] Optionally, by limiting the maximum clustering K value, the number of templates in the final template library can be guaranteed to be within a certain range.
[0119] Optionally, once the cluster center is known, the photovoltaic string features that serve as the cluster center are also known. By calculating the Euclidean distance between the image features in each sample slice image in the cluster and the photovoltaic string features of the cluster center, the approximation between the image features and the photovoltaic string features can be determined. The minimum Euclidean distance indicates that the image features are closest to the photovoltaic string features, and the sample slice image with the Euclidean distance can then be used as a positive template.
[0120] Alternatively, based on the above method, a positive template can be determined in each of the K clusters.
[0121] It should be noted that the process of selecting positive templates can be achieved through a simple distance metric. If there are positive templates with insufficient features, it is likely due to a problem with the number of positive and negative templates during clustering.
[0122] Figure 7 This is a schematic diagram of an adaptive clustering algorithm according to an embodiment of the present invention, as shown below. Figure 7 As shown, since the number of photovoltaic strings to be divided into is unknown beforehand, an adaptive clustering algorithm is used. The silhouette coefficient (ch) value is used as an indicator to select the optimal number of clusters, and a template library is constructed based on this number of clusters. Through the adaptive clustering algorithm, the silhouette coefficient is used to analyze various cluster combinations with different numbers of clusters (i.e., K values) to determine the number of clusters (i.e., K values) with the best clustering effect. Clustering based on this number of clusters (i.e., K values) can obtain multiple clusters that best reflect the characteristics of photovoltaic strings, and thus determine the positive template that best reflects the characteristics of photovoltaic strings.
[0123] Figure 8 This is a schematic diagram illustrating a template selection principle according to an embodiment of the present invention, such as... Figure 8 As shown, the selection of typical photovoltaic strings and noise levels is based on the following considerations:
[0124] 1) Although photovoltaic strings differ in terms of illumination and tilt angle, they are generally similar.
[0125] It's important to note that photovoltaic (PV) panels from the same power plant won't differ significantly. If PV panels were all different, they wouldn't share any common, finite characteristics. Therefore, subsequent matching tests between noise and PV panels would be meaningless. In reality, the surface texture of PV panels doesn't vary drastically.
[0126] 2) When clustering photovoltaic strings, there are more slice images of photovoltaic strings than slice images of noise. Otherwise, during the feature-based clustering process, cluster centers for photovoltaic strings and cluster centers for noise will appear simultaneously.
[0127] It should be noted that if the number of photovoltaic string slice images is not greater than the number of noisy slice images, the process of segmenting photovoltaic slice images needs to be considered. Therefore, even if noisy slice images are needed to verify the clustering results, only a small portion of the noisy slice images are used for verification.
[0128] 3) Different types of photovoltaic strings may exist in the image, so there may be multiple cluster centers.
[0129] Figure 9This is a schematic diagram of a feature matching voting strategy according to an embodiment of the present invention. As shown in Figure 9, the positive and negative templates in the template library are first divided into template groups, and then the sliced image and the template library are matched with SIFT-FLANN to give the category of the current mask.
[0130] Optionally, during the process of assigning negative templates to positive templates, since the positive templates have already been obtained, an equal number of negative templates can be randomly selected from the background noise of the mask, which actually meets the requirements.
[0131] Optionally, the negative template can also be clustered, with the number of clusters for the negative template being the same as the number of clusters for the positive template, and multiple noise slice images that are closest to the cluster centers of the noise can be selected as negative templates.
[0132] Optionally, when the voting results represent a noisy slice image, the noise slice image of the mask can be filled with a background color (such as a preset background image) to achieve the purpose of noise removal in the segmentation of photovoltaic strings.
[0133] Optionally, the mask image can use black to represent the background and white to represent the photovoltaic string. For each contour region to be identified slice image, it is determined whether it is a photovoltaic string or noise. The determination of photovoltaic string and noise can be completed based on the voting of multiple template groups in the template library. Then, the label of the noise slice image in the mask image is replaced, that is, the white corresponding to the noise (pixel value 255) is replaced with the background (pixel value 0), which achieves the purpose of noise removal.
[0134] Figure 10A This is a schematic diagram of the effect before segmentation and denoising according to an embodiment of the present invention. Figure 1 ,like Figure 10A As shown, there is a noisy slice image in the lower right corner of the image that affects the photovoltaic strings, which may misidentify the building on the right as a photovoltaic string. Figure 10B This is a schematic diagram of the segmentation and denoising effect according to an embodiment of the present invention. Figure 1 ,like Figure 10B As shown, replace with a preset background image. Figure 10A The image shown is a noisy slice on the lower right side. If the image is then segmented, the building on the right side of the image will not be misidentified as a photovoltaic string for segmentation. Figure 11A This is a schematic diagram of the effect before segmentation and denoising according to an embodiment of the present invention. Figure 2 ,like Figure 11A As shown, there is a noisy slice image on the right side of the image that affects the photovoltaic strings, which may cause the building on the right to be misidentified as a photovoltaic string. Figure 11B This is a schematic diagram of the segmentation and denoising effect according to an embodiment of the present invention. Figure 2 ,like Figure 11B As shown, replace with a preset background image. Figure 11A The noise slice image on the right side of the image shown is then segmented to avoid misidentifying the buildings on the right side of the image as photovoltaic strings during segmentation. Figure 12A This is a schematic diagram of the effect before segmentation and denoising according to an embodiment of the present invention. Figure 3 ,like Figure 12A As shown, there is a noisy slice image at the bottom of the image that affects the photovoltaic strings, which may misidentify the villages along the road at the bottom as photovoltaic strings. Figure 12B This is a schematic diagram of the segmentation and denoising effect according to an embodiment of the present invention. Figure 3 ,like Figure 12B As shown, replace with a preset background image. Figure 12A The image shown is a noisy slice at the bottom. If the image is then segmented, the villages at the bottom of the image will not be misidentified as photovoltaic strings for segmentation. Figure 13A This is a schematic diagram of the effect before segmentation and denoising according to an embodiment of the present invention. Figure 4 ,like Figure 13A As shown, there is a noisy slice image on the right side of the image that affects the photovoltaic string, which may cause the stone on the right to be identified as the photovoltaic string. Figure 13B This is a schematic diagram of the segmentation and denoising effect according to an embodiment of the present invention. Figure 4 ,like Figure 13B As shown, replace with a preset background image. Figure 13A The image shown is a noisy slice on the right side. If the image is then segmented, the stones on the right side of the image will not be identified as photovoltaic strings and segmented accordingly.
[0135] According to an embodiment of the present invention, a denoising device for a photovoltaic string image is also provided. It should be noted that the denoising device for the photovoltaic string image can be used to execute the denoising method for the photovoltaic string image in the embodiment of the present invention, and the denoising method for the photovoltaic string image in the embodiment of the present invention can be executed in the denoising device for the photovoltaic string image.
[0136] Figure 14 This is a schematic diagram of a preset template library generation device according to an embodiment of the present invention, such as... Figure 14 As shown, the device may include: a first acquisition module 142, used to acquire multiple sample slice images of the photovoltaic area where the photovoltaic string is located, wherein the sample slice images include: photovoltaic slice images of the photovoltaic string and background noise slice images; a clustering module 144, used to perform feature clustering on the multiple sample slice images according to image features to obtain multiple target clusters, wherein each target cluster corresponds to at least one photovoltaic slice image; a first determination module 146, used to determine positive templates based on the photovoltaic slice images in the target clusters; and a second determination module 148, used to assign a corresponding noise slice image as a negative template to each positive template, and use the set of positive templates and negative templates as a preset template library.
[0137] It should be noted that the first acquisition module 142 in this embodiment can be used to execute step S302 in this application embodiment, the clustering module 144 in this embodiment can be used to execute step S304 in this application embodiment, the first determination module 146 in this embodiment can be used to execute step S306 in this application embodiment, and the second determination module 148 in this embodiment can be used to execute step S308 in this application embodiment. The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments.
[0138] In this embodiment of the invention, by using feature clustering and annotated photovoltaic slice images in sample slice images, positive templates in a preset template library can be automatically determined. By using annotated noise slice images in the sample slice images to assign negative templates to the determined positive templates, a preset template library based on the set of positive and negative templates can be obtained. Then, when it is necessary to determine the image category of the slice image to be identified, the image category of the slice image to be identified can be determined based on the positive and negative templates in the preset template library. The slice image to be identified that is closer to the negative template than the positive template is identified as a noise slice image. Thus, the accurate identification of noise slice images can be completed using a small number of annotated positive and negative templates, and the accuracy of the identification results can be ensured. This achieves the technical effect of accurately identifying noise slice images and solves the technical problem that the prior art cannot accurately identify the noise in photovoltaic string images.
[0139] As an optional embodiment, the first acquisition module includes: a first acquisition unit, configured to acquire a preset map image including a photovoltaic region, wherein the preset map image is a visible light map image or an invisible light map image; a masking unit, configured to perform masking processing on the preset map image to obtain a preset mask image, wherein the preset mask image is used to distinguish between photovoltaic regions and non-photovoltaic regions; a first determination unit, configured to perform contour segmentation on the preset mask image according to semantic segmentation to determine a photovoltaic region image of the photovoltaic region; and a second determination unit, configured to slice the photovoltaic region image to determine a sample slice image.
[0140] As an optional embodiment, the clustering module includes: a clustering unit, used to perform multiple feature clusterings on multiple sample slice images according to image features, to obtain multiple preset clusters with different preset numbers of clusters; a third determining unit, used to evaluate the silhouette coefficients of the multiple preset clusters with preset numbers of clusters, and determine the correlation between the preset number of clusters and the silhouette coefficients; a fourth determining unit, used to determine the preset number of clusters that maximizes the silhouette coefficient as the target number of clusters; and a fifth determining unit, used to determine the multiple preset clusters with the target number of clusters as the target clusters.
[0141] As an optional embodiment, the second determining module includes: a first determining submodule, used to take a positive template and a negative template as a preset template group, wherein the preset template group is used to vote based on the feature matching results between the slice image to be identified and the positive and negative templates; and a second determining submodule, used to determine a preset template library based on multiple preset template groups, wherein the preset template library is used to determine the image category of the slice image to be identified based on the voting of multiple preset template groups, and the image category includes: a noise slice image or a photovoltaic slice image.
[0142] Figure 15 This is a schematic diagram of a noise recognition device for photovoltaic string images according to an embodiment of the present invention, such as... Figure 15 As shown, the device may include: a second acquisition module 152, used to acquire multiple slice images to be identified in a target area, wherein the target area includes photovoltaic strings; a statistics module 154, used to perform feature matching between the slice images to be identified and positive and negative templates in a preset template library, and to statistically determine the voting result of the slice images to be identified, wherein the preset template library is obtained by applying the aforementioned preset template library generation device, and is used to vote according to the feature matching result of the slice images to be identified and the positive and negative templates, the voting result including: a first number of votes indicating that the slice images to be identified match the positive template, and a second number of votes indicating that the slice images to be identified match the negative template; and a third determination module 156, used to determine a noisy slice image or a photovoltaic slice image from the multiple slice images to be identified in the target area according to the voting result.
[0143] It should be noted that the second acquisition module 152 in this embodiment can be used to execute step S402 in this application embodiment, the statistics module 154 in this embodiment can be used to execute step S404 in this application embodiment, and the third determination module 156 in this embodiment can be used to execute step S406 in this application embodiment. The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments.
[0144] In this embodiment of the invention, the slice image to be identified is matched with positive and negative templates in a preset template library, and the voting result of the slice image to be identified is determined based on the matching result of the slice image to be identified with the positive or negative template. It can be determined that the slice image to be identified that is closer to the negative template than the positive template is a noise slice image. Thus, the accurate identification of noise slice images can be completed using a small number of labeled positive and negative templates, and the accuracy of the identification result can be ensured. This achieves the technical effect of accurately identifying noise slice images and solves the technical problem that the prior art cannot accurately identify the noise in photovoltaic string images.
[0145] As an optional embodiment, the statistics module includes: an identification unit for identifying the features of the slice image to be identified; an extraction unit for extracting the photovoltaic string features of the positive template and the noise region features of the negative template in each preset template group, wherein the preset template group is obtained by pairing positive and negative templates in a preset template library, and the preset template group includes positive and negative templates; a matching unit for determining the vote for each preset template group based on the feature matching results of the image features to be identified with the photovoltaic string features and the noise region features, wherein the vote includes: a first vote indicating that the slice image to be identified matches the positive template, or a second vote indicating that the slice image to be identified matches the negative template; and a statistics unit for counting the number of votes for multiple preset template groups to obtain the voting results.
[0146] As an optional embodiment, the matching unit includes: a sixth determining unit, used to determine the positive matching degree between the image features to be identified and the photovoltaic string features, and the negative matching degree between the image features to be identified and the noise region features; a seventh determining unit, used to determine the vote of the preset template group as the first vote when the positive matching degree is higher than the negative matching degree; and an eighth determining unit, used to determine the vote of the preset template group as the second vote when the negative matching degree is higher than the positive matching degree.
[0147] As an optional embodiment, the third determining module includes: a third determining submodule, used to determine the slice image to be identified as a noise slice image when the second number of votes is greater than the first number of votes based on the voting results; or a fourth determining submodule, used to determine the slice image to be identified as a noise slice image when the second number of votes is greater than a preset voting threshold based on the voting results; or a fifth determining submodule, used to determine the slice image to be identified as a photovoltaic slice image when the first number of votes is greater than the first number of votes based on the voting results; and in the multiple slice images to be identified in the target area, the photovoltaic slice image is removed to obtain the noise slice image.
[0148] As an optional embodiment, the apparatus further includes a filling module for filling the noisy slice image with a preset background image of the target region.
[0149] Embodiments of the present invention can provide a computer terminal, which can be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the computer terminal can also be replaced by a mobile terminal or other terminal device.
[0150] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.
[0151] In this embodiment, the computer terminal described above can execute the program code for the following steps in the method for denoising photovoltaic string images: acquiring multiple sample slice images of the photovoltaic region where the photovoltaic string is located, wherein the sample slice images include: photovoltaic slice images of the photovoltaic string and noise slice images of the background; clustering the multiple sample slice images according to image features to obtain multiple target clusters, wherein each target cluster corresponds to at least one photovoltaic slice image; determining positive templates based on the photovoltaic slice images in the target clusters; assigning a corresponding noise slice image as a negative template to each positive template, and using the set of positive and negative templates as a preset template library.
[0152] In this embodiment, the computer terminal described above can execute the program code for the following steps in the method for denoising photovoltaic string images: acquiring multiple slice images to be identified in a target region, wherein the target region includes photovoltaic strings; performing feature matching between the slice images to be identified and positive and negative templates in the preset template library, and statistically analyzing the feature matching results to determine the voting results of the slice images to be identified, wherein the preset template library is used to vote based on the feature matching results between the slice images to be identified and the positive and negative templates, and the voting results include: a first number of votes indicating that the slice images to be identified match the positive template, and a second number of votes indicating that the slice images to be identified match the negative template; and determining noisy slice images among the multiple slice images to be identified in the target region based on the voting results.
[0153] Optionally, Figure 16 This is a structural block diagram of a computer terminal according to an embodiment of the present invention. Figure 16 As shown, the computer terminal 1600 may include one or more (only one is shown in the figure) processors 1602 and memory 1604.
[0154] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the photovoltaic string image denoising method and apparatus in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned photovoltaic string image denoising method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal 1600 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0155] The processor can invoke information and application programs stored in the memory through the transmission device to perform the following steps: acquiring multiple sample slice images of the photovoltaic area where the photovoltaic string is located, wherein the sample slice images include: photovoltaic slice images of the photovoltaic string and noise slice images of the background; clustering the multiple sample slice images according to image features to obtain multiple target clusters, wherein each target cluster corresponds to at least one photovoltaic slice image; determining positive templates based on the photovoltaic slice images in the target clusters; assigning a corresponding noise slice image as a negative template to each positive template, and using the set of positive and negative templates as a preset template library.
[0156] Optionally, the processor may also execute program code for the following steps: acquiring a preset map image including the photovoltaic region, wherein the preset map image is a visible light map image or an invisible light map image; performing masking processing on the preset map image to obtain a preset mask image, wherein the preset mask image is used to distinguish between the photovoltaic region and the non-photovoltaic region; performing contour segmentation on the preset mask image according to semantic segmentation to determine the photovoltaic region image; and slicing the photovoltaic region image to determine sample slice images.
[0157] Optionally, the processor may also execute program code for the following steps: performing multiple feature clustering operations on multiple sample slice images according to image features to obtain multiple preset clusters with different preset numbers of clusters; evaluating the silhouette coefficients of the multiple preset clusters with preset numbers of clusters to determine the correlation between the preset number of clusters and the silhouette coefficients; determining the preset number of clusters that maximizes the silhouette coefficient as the target number of clusters; and determining the multiple preset clusters with the target number of clusters as the target clusters.
[0158] Optionally, the processor may also execute program code for the following steps: taking a positive template and a negative template as a preset template group, wherein the preset template group is used to vote based on the feature matching results between the slice image to be identified and the positive and negative templates; determining a preset template library based on multiple preset template groups, wherein the preset template library is used to determine the image category of the slice image to be identified based on the voting of multiple preset template groups, and the image category includes: noisy slice image or photovoltaic slice image.
[0159] This invention provides a scheme for generating a preset template library. By using feature clustering and annotated photovoltaic slice images in sample slice images, positive templates in the preset template library can be automatically determined. By using annotated noise slice images in the sample slice images to assign negative templates to the determined positive templates, a preset template library based on the set of positive and negative templates can be obtained. Then, when it is necessary to determine the image category of a slice image to be identified, the image category can be determined based on the positive and negative templates in the preset template library. Slices that are closer to the negative templates than the positive templates are identified as noise slice images. Thus, accurate identification of noise slice images is achieved using a small number of annotated positive and negative templates, ensuring the accuracy of the identification results. This achieves the technical effect of accurately identifying noise slice images and solves the problem of existing technologies being unable to accurately identify noise in photovoltaic string images.
[0160] The processor can invoke information and application programs stored in the memory via a transmission device to perform the following steps: acquiring multiple slice images to be identified in a target area, wherein the target area includes photovoltaic strings; performing feature matching between the slice images to be identified and positive and negative templates in the preset template library, and statistically analyzing the feature matching results to determine the voting results of the slice images to be identified, wherein the preset template library is used to vote based on the feature matching results between the slice images to be identified and the positive and negative templates, and the voting results include: a first number of votes indicating that the slice images to be identified match the positive templates, and a second number of votes indicating that the slice images to be identified match the negative templates; and determining noisy slice images among the multiple slice images to be identified in the target area based on the voting results.
[0161] Optionally, the processor may also execute program code for the following steps: identifying the features of the slice image to be identified; extracting the photovoltaic string features of the positive template and the noise region features of the negative template in each preset template group, wherein the preset template group is obtained by pairing positive and negative templates in a preset template library, and the preset template group includes positive and negative templates; determining the vote for each preset template group based on the feature matching results of the image features to be identified with the photovoltaic string features and the noise region features, wherein the vote includes: a first vote to indicate that the slice image to be identified matches the positive template, or a second vote to indicate that the slice image to be identified matches the negative template; and counting the number of votes for multiple preset template groups to obtain the voting result.
[0162] Optionally, the processor may also execute program code that performs the following steps: determining the positive matching degree between the image features to be identified and the photovoltaic string features, and the negative matching degree between the image features to be identified and the noise region features; when the positive matching degree is higher than the negative matching degree, determining the vote of the preset template group as the first vote; when the negative matching degree is higher than the positive matching degree, determining the vote of the preset template group as the second vote.
[0163] Optionally, the processor may also execute program code for the following steps: if the second number of votes is greater than the first number of votes based on the voting results, determine the slice image to be identified as a noisy slice image; or if the second number of votes is greater than a preset voting threshold based on the voting results, determine the slice image to be identified as a noisy slice image; or if the first number of votes is greater than the first number of votes based on the voting results, determine the slice image to be identified as a photovoltaic slice image; and remove the photovoltaic slice image from the multiple slice images to be identified in the target area to obtain the noisy slice image.
[0164] Optionally, the processor may also execute program code that fills the noisy slice image with a preset background image of the target region.
[0165] This invention provides a noise identification scheme for photovoltaic string images. The method involves performing feature matching between the image to be identified and positive and negative templates in a preset template library. Based on the matching results, the voting result of the image to be identified is determined. This allows identifying images that are closer to the negative template than the positive template as noise images. Thus, accurate identification of noise images is achieved using a small number of labeled positive and negative templates, ensuring the accuracy of the identification results. This achieves the technical effect of accurately identifying noise images and solves the problem of existing technologies being unable to accurately identify noise in photovoltaic string images.
[0166] Those skilled in the art will understand that Figure 16 The structure shown is for illustrative purposes only. The computer terminal can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a mobile internet device (MID), a PAD, and other terminal devices. Figure 16 This does not limit the structure of the aforementioned electronic device. For example, the computer terminal 1600 may also include components that are more advanced than those described above. Figure 16 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 16 The different configurations shown.
[0167] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a non-volatile storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0168] Embodiments of the present invention also provide a non-volatile storage medium. Optionally, in this embodiment, the aforementioned non-volatile storage medium can be used to store the program code executed by the denoising method for photovoltaic string images provided in the above embodiments.
[0169] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0170] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: acquiring multiple sample slice images of the photovoltaic region where the photovoltaic string is located, wherein the sample slice images include: photovoltaic slice images of the photovoltaic string and noise slice images of the background; clustering the multiple sample slice images according to image features to obtain multiple target clusters, wherein each target cluster corresponds to at least one photovoltaic slice image; determining positive templates based on the photovoltaic slice images in the target clusters; assigning a corresponding noise slice image as a negative template to each positive template, and using the set of positive and negative templates as a preset template library.
[0171] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: acquiring multiple slice images to be identified in a target region, wherein the target region includes photovoltaic strings; performing feature matching between the slice images to be identified and positive and negative templates in the preset template library, and statistically analyzing the feature matching results to determine the voting results of the slice images to be identified, wherein the preset template library is used to vote based on the feature matching results between the slice images to be identified and the positive and negative templates, and the voting results include: a first number of votes indicating that the slice images to be identified match the positive template, and a second number of votes indicating that the slice images to be identified match the negative template; and determining a noisy slice image among the multiple slice images to be identified in the target region based on the voting results.
[0172] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0173] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0174] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0175] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0176] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0177] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a non-volatile storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned non-volatile storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0178] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for generating a preset template library, characterized in that, include: Multiple sample slice images of the photovoltaic region where the photovoltaic string is located are obtained, wherein the sample slice images include: photovoltaic slice images of the photovoltaic string and noise slice images of the background; Multiple sample slice images are clustered according to image features to obtain multiple target clusters, wherein each target cluster corresponds to at least one photovoltaic slice image; A positive template is determined based on the photovoltaic slice image in the target cluster; Each positive template is assigned a corresponding noise slice image as a negative template, and the set of positive and negative templates is used as a preset template library; The step of using the set of positive and negative templates as a preset template library includes: A positive template and a negative template are used as a preset template group, wherein the preset template group is used to vote based on the feature matching results between the slice image to be identified and the positive template and the negative template, and each preset template group can only cast one vote; The preset template library is determined based on multiple preset template groups, wherein the preset template library is used to determine the image category of the slice image to be identified based on the voting of multiple preset template groups, and the image category includes: the noise slice image or the photovoltaic slice image.
2. The method according to claim 1, characterized in that, Obtaining multiple sample slice images of the photovoltaic area where the photovoltaic strings are located includes: Obtain a preset map image including the photovoltaic area, wherein the preset map image is a visible light map image or an invisible light map image; The preset map image is masked to obtain a preset mask image, wherein the preset mask image is used to distinguish between the photovoltaic region and the non-photovoltaic region; The preset mask image is contour segmented according to semantic segmentation to determine the photovoltaic region image of the photovoltaic region. The photovoltaic region image is sliced to determine the sample slice image.
3. The method according to claim 1, characterized in that, Multiple sample slice images are clustered according to image features to obtain multiple target clusters, including: Multiple sample slice images are subjected to feature clustering multiple times according to image features to obtain multiple preset clusters with different preset numbers of clusters; The silhouette coefficients of multiple preset clusters with the preset number of clusters are evaluated to determine the correlation between the preset number of clusters and the silhouette coefficients. The preset number of clusters that maximizes the silhouette coefficient is determined as the target number of clusters. The multiple preset clusters that represent the target number of clusters are determined as the target clusters.
4. A method for noise recognition in photovoltaic string images, characterized in that, include: Acquire multiple slice images of a target region to be identified, wherein the target region includes photovoltaic strings; The slice image to be identified is matched with positive and negative templates in a preset template library for feature matching, and the voting result of the feature matching results is statistically analyzed to determine the voting result of the slice image to be identified. The preset template library is obtained by applying the method for generating the preset template library as described in any one of claims 1-3, and is used to vote according to the feature matching result of the slice image to be identified with the positive and negative templates. The voting result includes: a first number of votes indicating that the slice image to be identified matches the positive template, and a second number of votes indicating that the slice image to be identified matches the negative template. Among the multiple slice images to be identified in the target area, a noisy slice image is determined based on the voting results, or a photovoltaic slice image is determined based on the voting results.
5. The method according to claim 4, characterized in that, The statistical feature matching results determine the voting results of the slice image to be identified, including: Identify the features of the slice image to be identified; Extract the photovoltaic string features of the positive template and the noise region features of the negative template in each preset template group. The preset template group is obtained by pairing positive and negative templates in the preset template library. The preset template group includes positive templates and negative templates. Based on the feature matching results of the image features to be identified with the photovoltaic string features and the noise region features respectively, a vote is determined for each preset template group, wherein the vote includes: a first vote indicating that the slice image to be identified matches the positive template, or a second vote indicating that the slice image to be identified matches the negative template; The voting results are obtained by counting the number of votes for multiple preset template groups.
6. The method according to claim 5, characterized in that, Based on the feature matching results between the features of the image to be identified and the features of the photovoltaic string and the features of the noise region, the voting for each preset template group is determined as follows: Determine the positive matching degree between the image features to be identified and the photovoltaic string features, and the negative matching degree between the image features to be identified and the noise region features; If the positive matching degree is higher than the negative matching degree, the vote of the preset template group is determined to be the first vote; If the negative matching degree is higher than the positive matching degree, the vote of the preset template group is determined to be the second vote.
7. The method according to claim 4, characterized in that, Among the multiple slice images to be identified in the target region, determining the noisy slice image based on the voting result includes: If, based on the voting results, the second number of votes is determined to be greater than the first number of votes, the slice image to be identified is determined to be the noisy slice image; or If, based on the voting results, the second number of votes is determined to be greater than a preset voting threshold, the slice image to be identified is determined to be the noisy slice image; or If the first number of votes is determined to be greater than the first number of votes based on the voting results, the slice image to be identified is determined to be the photovoltaic slice image; among the multiple slice images to be identified in the target area, the photovoltaic slice image is removed to obtain the noise slice image.
8. The method according to claim 4, characterized in that, The method further includes: The noise slice image is filled with a preset background image of the target region.
9. A device for generating a preset template library, characterized in that, include: The first acquisition module is used to acquire multiple sample slice images of the photovoltaic area where the photovoltaic string is located, wherein the sample slice images include: photovoltaic slice images of the photovoltaic string and noise slice images of the background; The clustering module is used to perform feature clustering on multiple sample slice images according to image features to obtain multiple target clusters, wherein each target cluster corresponds to at least one photovoltaic slice image; The first determining module is used to determine a positive template based on the photovoltaic slice image in the target cluster; The second determining module is used to assign a corresponding noise slice image as a negative template to each positive template, and to use the set of positive templates and negative templates as a preset template library; The second determining module includes: The first determining submodule is used to take one positive template and one negative template as a preset template group, wherein the preset template group is used to vote according to the feature matching results between the slice image to be identified and the positive template and the negative template, and each preset template group can only cast one vote; The second determining submodule is used to determine the preset template library based on multiple preset template groups, wherein the preset template library is used to determine the image category of the slice image to be identified based on the voting of multiple preset template groups, and the image category includes: the noise slice image or the photovoltaic slice image.
10. A noise recognition device for photovoltaic string images, characterized in that, include: The second acquisition module is used to acquire multiple slice images of a target region to be identified, wherein the target region includes photovoltaic strings; A statistics module is used to perform feature matching between the slice image to be identified and positive and negative templates in a preset template library, and to statistically determine the voting result of the slice image to be identified by calculating the feature matching results. The preset template library is obtained by applying the preset template library generation device as described in claim 9. The module is used to vote based on the feature matching results of the slice image to be identified and the positive and negative templates. The voting result includes: a first number of votes indicating that the slice image to be identified matches the positive template, and a second number of votes indicating that the slice image to be identified matches the negative template. The third determining module is used to determine a noisy slice image from among the multiple slice images to be identified in the target area based on the voting results, or to determine the slice image to be identified as a photovoltaic slice image based on the voting results.
11. A non-volatile storage medium, characterized in that, The non-volatile storage medium is used to store a program, wherein, when the program is running, the device where the non-volatile storage medium is located is controlled to execute the method for generating the preset template library as described in any one of claims 1 to 3, or the method for noise recognition of photovoltaic string images as described in any one of claims 4 to 8.
12. An electronic device, characterized in that, include: A memory and a processor, the processor being configured to run a program stored in the processor, wherein the program, when running, executes the method for generating a preset template library as described in any one of claims 1 to 3, or the method for noise recognition of photovoltaic string images as described in any one of claims 4 to 8.
Citation Information
Patent Citations
Power transmission line bird detection algorithm based on YOLOv3
CN110889841A
Power station modeling map string segmentation method and device
CN115880307A
Adaptive scale invariant feature clustering solar panel mask noise filtering method
CN116664897A