A rooftop distributed photovoltaic identification method, system, device and storage medium

By introducing technologies such as pixel feature extraction, cluster analysis, Bayesian classifier, and morphological operation optimization into roof detection and segmentation, the problems of insufficient roof detection accuracy and poor robustness in the existing technology are solved, and a higher level of performance is achieved. Accuracy and robustness of roof segmentation effects.

CN119027517BActive Publication Date: 2025-01-24STATE GRID JIANGSU ELECTRIC POWER CO LTD RESEARCH INSTITUTE +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411510610.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-01-24
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

The prior art has problems of insufficient accuracy and poor robustness in roof detection and segmentation, especially under the influence of complex backgrounds and noise in satellite images.

Method used

Through the introduction of pixel feature extraction, clustering analysis, Bayesian classifier, optimization of morphological operation and fusion of segmentation results, the accuracy and robustness of the roof segmentation are improved. Specific steps include roof position marking, pixel feature extraction, clustering analysis, Bayesian classifier calculation after calculation probability, morphological operation optimization, and final weighted fusion.

Benefits of technology

It significantly improves the accuracy and robustness of roof segmentation, ensures accurate identification and segmentation of roof areas, can effectively process large-scale satellite image data, and is suitable for large-scale roof detection tasks at the city level.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119027517B_ABST
    Figure CN119027517B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, device and storage medium for identifying rooftop distributed photovoltaics, and belongs to the field of image recognition technology. The method comprises: marking the rooftop position of satellite images and extracting pixel features; performing cluster analysis on the extracted pixel features to obtain initial pixel classification results; based on the initial pixel classification results, using a Bayesian classifier to calculate the posterior probability that each pixel belongs to the roof category to obtain a probability map; performing morphological operations on the probability map to obtain an optimized roof area detection result; performing weighted fusion on the optimized roof area detection result and the initial segmentation result obtained by semantic segmentation to obtain the final roof segmentation result. The present invention improves the accuracy and robustness of roof segmentation by introducing technologies such as pixel feature extraction, cluster analysis, Bayesian classifier, morphological operation optimization and segmentation result fusion, and realizes accurate identification of building roofs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a rooftop distributed photovoltaic identification method, system, device and storage medium, belonging to the technical field of image recognition. Background Art

[0002] With the acceleration of urbanization and the increase in environmental awareness, satellite imagery technology is becoming increasingly important in the monitoring and management of urban buildings. In particular, this technology is of significant importance in the identification of distributed rooftop photovoltaic potential. Accurately identifying and evaluating the photovoltaic potential of rooftop areas is essential to optimizing energy utilization, promoting sustainable development, and achieving environmental protection goals.

[0003] Distributed rooftop photovoltaic systems can not only optimize the allocation of solar energy resources, but also significantly improve the overall efficiency of photovoltaic power generation. By accurately identifying the roof area, the installation location and capacity of the photovoltaic system can be scientifically planned to ensure that each rooftop photovoltaic system can achieve its maximum efficiency. This not only improves the economic return of photovoltaic power generation, but also effectively reduces dependence on traditional fossil fuels, reduces carbon emissions, and supports global efforts to combat climate change.

[0004] In addition, accurate identification of photovoltaic potential is also of great significance in urban planning and environmental monitoring. It provides scientific data support for urban decision-makers, enabling cities to make decisions based on actual photovoltaic potential when formulating energy policies and plans, thereby improving urban energy independence and stability. At the same time, the promotion of distributed rooftop photovoltaic systems can alleviate the energy crisis, improve energy security, create new economic opportunities, and promote the development of the green economy.

[0005] However, satellite images usually contain complex background information and noise, making roof detection and segmentation a challenging task. Although traditional image processing and machine learning methods have been applied to roof area detection and segmentation, they still face the problems of insufficient accuracy and poor robustness. The introduction of deep learning technology, especially convolutional neural network (CNN), provides new possibilities for improving the accuracy of roof detection and segmentation, but these methods are often susceptible to noise and background interference. Summary of the invention

[0006] The purpose of the present invention is to provide a method, system, device and storage medium for rooftop distributed photovoltaic identification. By introducing technologies such as pixel feature extraction, cluster analysis, Bayesian classifier, morphological operation optimization and segmentation result fusion, the accuracy and robustness of roof segmentation are improved, and accurate identification of building roofs is achieved.

[0007] To achieve the above object, the present invention is implemented by adopting the following technical solutions.

[0008] In a first aspect, the present invention provides a method for identifying rooftop distributed photovoltaics, comprising:

[0009] Mark the roof positions of the acquired satellite images, and extract pixel features based on the roof position marks;

[0010] The extracted pixel features are clustered and analyzed to obtain the initial pixel classification results;

[0011] Based on the initial pixel classification results, a Bayesian classifier is used to calculate the posterior probability that each pixel belongs to the roof category and obtain a probability map;

[0012] Perform morphological operations including dilation, erosion, opening and closing operations on the probability map to obtain the optimized roof area detection result;

[0013] The optimized roof area detection result is weightedly fused with the initial segmentation result obtained by semantic segmentation to obtain the final roof segmentation result.

[0014] Furthermore, the roof position is marked using an image annotation tool, and the marking method includes: outlining the boundaries of the roof area by clicking and adjusting the marking points; during the marking process, capturing the true outline of the roof through real-time adjustment and feedback, and reviewing and correcting the marking results to ensure that each roof area is accurately marked.

[0015] Further, the extracting pixel features includes extracting color histogram, texture features and shape information;

[0016] Extracting the color histogram involves extracting the color values ​​of all pixels from the marked area to calculate the color value distribution, as follows:

[0017] (1);

[0018] In the formula, H ( k ) is the value of each pixel k The frequency of occurrence, n k The pixel value in the image is k The number of pixels, N is the total number of pixels;

[0019] The color histogram is in the form of:

[0020] Color Histogram =[[ R 1, R 2,…, R 256 ],[ G 1, G 2,…, G256 ],[ B 1, B 2,…, B 256 ]] (2);

[0021] In the formula, Color Histogram is the vector representation of the color histogram, Color Histogram Divide the image into R , G , B There are three channels, and the color value of each channel is described by a 256-dimensional vector. The elements in each vector are H ( k ) value, indicating the value of each pixel in this channel k Frequency of occurrence; R 1, R 2,…, R 256 ],[ G 1, G 2,…, G 256 ],[ B 1, B 2,…, B 256 ] are three 256-dimensional vectors formed by the color value distribution of the three channels R, G, and B;

[0022] Extracting texture features includes converting color images into grayscale images and using grayscale co-occurrence matrix or local binary pattern method to extract texture features including contrast, correlation, energy and entropy. The formula is as follows:

[0023] (3);

[0024] (4);

[0025] (5);

[0026] (6);

[0027] In the formula, Contrast is the contrast, Correlation is the correlation, Energy It's energy. Entropy is entropy, P ( i , j ) is the gray level i and grayscale j The normalized frequency of the co-occurrence matrix, , The pixel values ​​are in grayscalei and grayscale j The mean of , The pixel values ​​are in grayscale i and grayscale j The standard deviation of

[0028] The texture feature is in the form of:

[0029] Texture Features =[ Contrast , Correlation , Energy , Entropy ] (7);

[0030] In the formula, Texture Features It is a texture feature;

[0031] Extract shape information, including using image processing algorithms to extract the boundaries of the roof position mark area, and calculate shape features including area, perimeter, and shape moment to accurately reflect the geometric features and contours of the roof. The formula is as follows:

[0032] (8);

[0033] (9);

[0034] (10);

[0035] In the formula, Area is the area, Perimeter is the circumference, Centroid is the shape moment, m , n are the indices of the horizontal and vertical coordinates of the pixel, respectively. x m is the horizontal coordinate of the current pixel, x m+1 is the horizontal coordinate of the next pixel, y n is the vertical coordinate of the current pixel, y n+1 is the vertical coordinate of the next pixel;

[0036] The shape information is in the form of:

[0037] Shape Information =[ Area , Perimeter , Centroid ] (11);

[0038] In the formula, Shape Information It is shape information.

[0039] Furthermore, the cluster analysis method includes:

[0040] Taking the extracted pixel features as input data, the optimal K value is found by combining the elbow rule and the silhouette coefficient;

[0041] Among them, the method of finding the optimal K value through the elbow rule includes: by drawing the change curve of the loss function of clustering under different K values, selecting a K value that makes the loss function drop rapidly and tend to be stable as the optimal K value, the formula of the loss function is as follows:

[0042] (12);

[0043] In the formula, SSE is the loss function, C d It is d The sample set of clusters, z is the vector representation of a data point in the dataset, It is d The center point of each cluster;

[0044] The method of finding the optimal K value through the silhouette coefficient includes: calculating the silhouette coefficient for each sample, and the K value with the maximum average silhouette coefficient is regarded as the optimal K value. The formula is as follows:

[0045] (13);

[0046] In the formula, s ( e ) is the silhouette coefficient, a ( e ) is a sample e The average distance to other samples in the same cluster, b ( e ) is a sample e The average distance to the nearest other cluster;

[0047] After the optimal K value is determined by combining the two methods, K cluster centers are initialized and cluster analysis is performed through an iterative optimization process. The specific steps include:

[0048] Assign each pixel to the category of the nearest cluster center, calculate the distance from each pixel to all cluster centers, and select the cluster center corresponding to the minimum distance to complete the pixel assignment;

[0049] Calculate the mean of each cluster and use the mean as the new cluster center to complete the cluster center update;

[0050] The pixel allocation and cluster center update steps are repeated until the cluster center no longer changes or a predetermined number of iterations is reached, and a pixel-level classification result is generated.

[0051] Furthermore, the method of using the Bayesian classifier to calculate the posterior probability that each pixel belongs to the roof category includes:

[0052] Applying the initial pixel classification result to assign each pixel point to a corresponding cluster center;

[0053] Using the extracted pixel features as the input features of the Bayesian classifier, the posterior probability that each pixel assigned to the corresponding cluster center belongs to the roof category is calculated as follows:

[0054] (14);

[0055] In the formula, is the posterior probability that the pixel belongs to the roof category when the pixel features are known. is the conditional probability of a pixel feature given the rooftop class, P (roof) is the prior probability of the roof class, P (Feature) is the marginal probability of the feature, which is normalized to ensure that the sum of the posterior probabilities is 1.

[0056] Furthermore, the morphological operation includes:

[0057] The expansion operation is expressed as follows:

[0058] (15);

[0059] In the formula, A is the original probability map, B is the expansion kernel, ( x , y ) is the pixel position in the image, p , q is the coordinate index in the dilation kernel 𝐵;

[0060] The corrosion operation is expressed as follows:

[0061] (16);

[0062] In the formula, C It is a corrosive core;

[0063] The opening operation includes performing corrosion operation and expansion operation in sequence. The expression is as follows:

[0064] (17);

[0065] In the formula, Opening ( A , B,C ) is an opening operation;

[0066] The closing operation includes performing the dilation operation and the erosion operation in sequence, and the expression is as follows:

[0067] (18);

[0068] In the formula, Closing ( A , B, C ) is a closing operation.

[0069] Furthermore, the method of obtaining the initial segmentation result by semantic segmentation includes using deep learning and convolutional neural network to build an end-to-end semantic segmentation model to identify the roof of the building;

[0070] The optimized roof area detection result is weightedly fused with the initial segmentation result obtained by semantic segmentation, and the formula is as follows:

[0071] (19);

[0072] In the formula, ( x , y ) is the pixel position in the image, R ( x , y ) is the pixel value after fusion, P ( x , y ) is the pixel value in the probability map after morphological operation optimization, S ( x , y ) is the pixel value in the semantic segmentation result, α is a weight parameter used to balance the contributions of the two.

[0073] In a second aspect, the present invention provides a rooftop distributed photovoltaic identification device, comprising:

[0074] The marking and extraction module is configured to mark the roof position of the acquired satellite image and extract pixel features based on the roof position mark;

[0075] A clustering analysis module is configured to perform clustering analysis on the extracted pixel features using a K-means clustering algorithm to obtain an initial pixel classification result;

[0076] A calculation module is configured to calculate the posterior probability of each pixel belonging to the roof category using a Bayesian classifier based on the initial pixel classification result to obtain a probability map;

[0077] A morphological operation module is configured to perform morphological operations including dilation, erosion, opening operation and closing operation on the probability map to obtain an optimized roof area detection result;

[0078] The weighted fusion module is configured to perform weighted fusion on the optimized roof area detection result and the initial segmentation result obtained by semantic segmentation to obtain a final roof segmentation result.

[0079] In a third aspect, the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the steps of the rooftop distributed photovoltaic identification method described in the first aspect are implemented.

[0080] In a fourth aspect, the present invention provides a computer system, comprising:

[0081] Memory, for storing computer programs / instructions;

[0082] A processor is used to execute the computer program / instructions to implement the steps of the rooftop distributed photovoltaic identification method described in the first aspect.

[0083] Compared with the prior art, the present invention has the following beneficial effects:

[0084] (1) In the present invention, firstly, the roof position of the acquired satellite image is marked, and pixel features are extracted based on the roof position mark to fully describe the visual attributes of the roof area, thereby ensuring the comprehensive capture of the roof visual features and enhancing the accuracy of classification and segmentation; secondly, the extracted pixel features are clustered to obtain the initial pixel classification result, and pixels with similar features are clustered together to form preliminary roof and non-roof areas, and the optimal number of clusters is automatically determined, which effectively improves the accuracy and efficiency of detection; then, based on the initial pixel classification result, a Bayesian classifier is used to calculate the posterior probability of each pixel belonging to the roof category to obtain a probability map, taking into account the pixel The local features and the global distribution features of the roof area significantly improve the accuracy and robustness of classification; on this basis, through morphological operations such as expansion, corrosion, opening and closing operations, the detection results are optimized, noise is removed, broken parts are filled, and the roof area is made more continuous and clear, making the segmentation results more accurate; finally, the optimized roof area detection results are weighted fused with the initial segmentation results obtained by semantic segmentation, and the results of the two methods are combined according to the trust of different pixels, so as to generate a more accurate and stable final roof segmentation result. This fusion method effectively combines local and global information and greatly improves the accuracy and robustness of roof segmentation;

[0085] (2) The present invention enhances the accuracy of classification and segmentation by introducing multiple feature extraction, fully utilizes the rich feature information of satellite images by combining cluster analysis and Bayesian classifier, and enhances the ability to handle noise and image defects through morphological operations. It combines the semantic segmentation model of deep learning and utilizes its powerful feature extraction and classification capabilities to improve the overall performance, overcome the limitations of traditional methods, and can efficiently process large-scale satellite image data. It is suitable for large-scale roof detection tasks at the city level, and provides more reliable basic data support for applications such as urban planning and geographic information systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0086] Figure 1 Schematic diagram of the process of the rooftop distributed photovoltaic identification method in an embodiment of the present invention;

[0087] Figure 2 Schematic diagram of a color histogram extracted in an embodiment of the present invention;

[0088] Figure 3 Schematic diagram of clustering results based on color histogram and texture features in an embodiment of the present invention. DETAILED DESCRIPTION

[0089] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations on the technical solution of the present invention. The embodiments of the present invention and the technical features in the embodiments may be combined with each other unless there is a conflict.

[0090] The term "and / or" is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " generally indicates that the associated objects are in an "or" relationship.

[0091] Example 1

[0092] like Figure 1 As shown, this embodiment introduces a method for identifying rooftop distributed photovoltaics, and the steps are as follows:

[0093] Step S1: Use an image annotation tool to mark the roof position of the acquired satellite image, and extract pixel features based on the roof position mark.

[0094] Step S1.1, roof position marking, including: accurately outlining the boundaries of the roof area by clicking and adjusting the marking points; during the marking process, ensuring the accuracy and consistency of the marking position through real-time adjustment and feedback to capture the true outline of the roof, and reviewing and correcting the marking results to ensure that each roof area is accurately marked.

[0095] Step S1.2, extracting pixel features, including: extracting color histogram, texture features and shape information.

[0096] (1) Color histogram: A statistical information chart that can quickly describe the overall pixel value distribution of an image and reflects the true distribution characteristics of the roof color.

[0097] Extracting the color histogram involves extracting the color values ​​of all pixels from the marked area to calculate the color value distribution, which is performed in the RGB color space to reflect the true distribution characteristics of the roof color. The formula is as follows:

[0098] (1);

[0099] In the formula, H ( k ) is the value of each pixel k The frequency of occurrence, n k The pixel value in the image is k The number of pixels, N is the total number of pixels;

[0100] The color histogram is in the form of:

[0101] Color Histogram =[[ R 1, R 2,…, R 256 ],[ G 1, G 2,…, G 256 ],[ B 1, B 2,…, B 256 ]] (2);

[0102] In the formula, Color Histogram is the vector representation of the color histogram, Color Histogram Divide the image into R , G , B There are three channels, and the color value of each channel is described by a 256-dimensional vector. The elements in each vector are H ( k ) value, indicating the value of each pixel in this channelk Frequency of occurrence; R 1, R 2,…, R 256 ],[ G 1, G 2,…, G 256 ],[ B 1, B 2,…, B 256 ] are three 256-dimensional vectors formed by the color value distribution of the three channels R, G, and B.

[0103] like Figure 2 As shown in the figure, the color histogram of the actual image is displayed. The horizontal axis represents the color value (dimensionless), ranging from 0 to 255. The larger the value, the darker the color. The vertical axis represents the frequency, that is, the number of times each color value appears. Figure 2 It shows the pixel distribution of each intensity value of different color channels (such as red, green, and blue) in the image. By analyzing the color histogram, different areas in the image can be effectively identified, such as roofs, vegetation, or shadows.

[0104] (2) Texture features are global features that reflect the visual characteristics of homogeneous phenomena in an image and reflect the slowly changing or periodically changing surface structure and arrangement properties of an object. Image texture is represented by the grayscale distribution of pixels and their surrounding spatial neighborhoods, i.e., local texture information. In addition, the repetitiveness of local texture information to varying degrees is global texture information.

[0105] Extracting texture features includes converting color images into grayscale images, using gray-level co-occurrence matrix (GLCM) or local binary pattern (LBP) method to extract texture features including contrast, correlation, energy and entropy to describe the subtle structure and pattern of the roof surface. The formula is as follows:

[0106] (3);

[0107] (4);

[0108] (5);

[0109] (6);

[0110] In the formula, Contrast is the contrast, Correlation is the correlation, Energy It's energy. Entropy is entropy, P ( i ,j ) is the gray level i and grayscale j The normalized frequency of the co-occurrence matrix, , The pixel values ​​are in grayscale i and grayscale j The mean of , The pixel value is the gray level i and grayscale j The standard deviation of

[0111] The texture feature is in the form of:

[0112] Texture Features =[ Contrast , Correlation , Energy , Entropy ] (7);

[0113] In the formula, Texture Features It is a texture feature.

[0114] (3) Shape information, including shape features such as area, perimeter, shape moment, bounding box and convex hull.

[0115] Extract shape information, including using image processing algorithms to extract the boundaries of the roof position mark area, and calculate shape features including area, perimeter, shape moment, bounding box and convex hull to accurately reflect the geometric features and contours of the roof. The formula is as follows:

[0116] (8);

[0117] (9);

[0118] (10);

[0119] In the formula, Area is the area, Perimeter is the circumference, Centroid is the shape moment, m , n are the indices of the horizontal and vertical coordinates of the pixel, respectively. x m is the horizontal coordinate of the current pixel, x m+1 is the horizontal coordinate of the next pixel, y n is the vertical coordinate of the current pixel, y n+1 is the vertical coordinate of the next pixel;

[0120] The shape information is in the form of:

[0121] Shape Information =[ Area , Perimeter , Centroid ] (11);

[0122] In the formula, Shape Information It is shape information.

[0123] Finally, the feature vectors of each pixel are combined into a feature high-dimensional vector, which serves as the input data for subsequent clustering analysis and classification. Through the extraction of these detailed features, this method can more comprehensively and accurately describe the roof area in satellite images, providing a solid foundation for subsequent processing steps.

[0124] Step S2.1, using the extracted color histogram, texture features and shape information as input data, find the optimal K value by combining the Elbow Method and the Silhouette Coefficient.

[0125] (1) The method of finding the optimal K value by the elbow rule includes: by plotting the change curve of the clustering loss function (such as square error) under different K values, selecting a K value that makes the loss function decrease rapidly and tend to be stable as the optimal K value. The formula of the loss function is as follows:

[0126] (12);

[0127] In the formula, SSE is the loss function, C d It is d The sample set of clusters, z is the vector representation of a data point in the dataset, It is d The center point of each cluster;

[0128] (2) The method of finding the optimal K value through the silhouette coefficient includes: calculating the silhouette coefficient for each sample, and the K value with the maximum average silhouette coefficient is regarded as the optimal K value. The formula is as follows:

[0129] (13);

[0130] In the formula, s ( e ) is the silhouette coefficient, a ( e ) is a sample e The average distance to other samples in the same cluster, b ( e ) is a sample eThe average distance to the nearest other cluster.

[0131] Step S2.2: After selecting the optimal K value by combining the two methods, initialize K cluster centers and perform cluster analysis through an iterative optimization process. The specific steps are as follows:

[0132] Step S2.2.1, pixel assignment: assign each pixel point to the category to which the nearest cluster center belongs, calculate the distance from each pixel to all cluster centers, and select the cluster center corresponding to the minimum distance.

[0133] Step S2.2.2, cluster center update: calculate the mean of each cluster and use the mean as the new cluster center.

[0134] Step S2.2.3, repeated iterations: Repeat the above pixel allocation and cluster center update steps until the cluster center no longer changes or reaches a predetermined number of iterations.

[0135] Ultimately, cluster analysis will generate a pixel-level classification result. Each pixel is assigned to a category represented by a cluster center, which reflects different types of roofs and background areas in satellite images. The results of cluster analysis include the classification label of each pixel and the corresponding cluster center information. These preliminary classification results provide basic data and feature descriptions for subsequent roof detection and segmentation. Through these detailed steps, the K-means clustering method can be effectively used to classify pixels in satellite images, thereby achieving preliminary classification and segmentation of roof areas.

[0136] like Figure 3 The figure shows the result of clustering pixels based on color histogram and texture features. The horizontal axis represents color features (dimensionless) and the vertical axis represents texture features (dimensionless). By combining color features and texture features, the pixels in the image are divided into several categories, each of which represents a different object or area, such as roof, ground or shadow. The clustering results mark these areas with different colors, which helps to accurately identify and distinguish different types of roof areas.

[0137] Step S3: Based on the initial pixel classification result, a Bayesian classifier is used to calculate the posterior probability that each pixel belongs to the roof category to obtain a probability map.

[0138] Among them, the method of using the Bayesian classifier to calculate the posterior probability of each pixel belonging to the roof category includes:

[0139] Applying the initial pixel classification result to assign each pixel point to a corresponding cluster center;

[0140] Using the extracted color histogram, texture features, and shape information as input features of the Bayesian classifier, the posterior probability that each pixel assigned to the corresponding cluster center belongs to the roof category is calculated as follows:

[0141] (14);

[0142] In the formula, is the posterior probability that the pixel belongs to the roof category when the pixel features are known. is the conditional probability of a pixel feature given the roof category, i.e., the probability of having that feature when the pixel belongs to the roof category, P (Roof) is the prior probability of the roof category, that is, the probability that a pixel belongs to the roof before the feature is observed, P (Feature) is the marginal probability of the feature, which is normalized to ensure that the sum of the posterior probabilities is 1.

[0143] The specific steps are as follows:

[0144] Step S3.1, calculate conditional probability: for each feature (color histogram, texture feature, shape information), calculate its conditional probability when the "roof" category is known.

[0145] Step S3.2, Prior Probability: Determine Prior Probability P (Roof), determined based on the ratio of “roof” to “non-roof” in the training data.

[0146] Step S3.3, marginal probability: calculate the marginal probability of the feature P (feature), estimated by the feature distribution over all categories.

[0147] Step S3.4, infer pixel category probability: The Bayesian classifier infers the posterior probability of each pixel belonging to the "roof" category through the prior probability and the conditional probability of the feature. Set "roof" and "non-roof" as two categories, and use the features extracted by cluster analysis to describe the spatial and visual attributes of the pixel.

[0148] Step S3.5, threshold decision: In order to finally determine whether each pixel is classified as "roof", we need to set an appropriate threshold. If the posterior probability is greater than the set threshold, the pixel will be classified as "roof"; otherwise, it will be classified as "non-roof". This process determines the optimal threshold through experiments and verification data.

[0149] Through these steps, the Bayesian classifier converts the feature information of each pixel into a posterior probability, thereby achieving accurate roof detection. This process not only takes into account the conditional probability and prior probability of the feature, but also utilizes the preliminary classification results provided by cluster analysis, which greatly improves the accuracy and reliability of roof detection.

[0150] Step S4: performing morphological operations including dilation, erosion, opening and closing operations on the probability map to obtain an optimized roof area detection result.

[0151] Step S4.1, dilation operation, is applied to the probability map, the purpose of which is to expand the pixels of the roof area. By adding the surrounding area of ​​each pixel to its neighboring pixels, the dilation operation helps fill in the small holes or breaks that may exist, making the roof area more continuous and complete. The expression of the dilation operation is as follows:

[0152] (15);

[0153] In the formula, A is the original probability map, B is the expansion kernel, ( x , y ) is the pixel position in the image, p、q is the coordinate index in the dilation kernel 𝐵.

[0154] Step S4.2, erosion operation, is used to reduce the pixels of the roof area in the probability map. This operation helps to remove unnecessary small connected parts, so that the boundary of the roof area is clearer and more precise. The expression of the erosion operation is as follows:

[0155] (16);

[0156] In the formula, C It is a corrosion core. p、q is the coordinate index in the dilation kernel 𝐵.

[0157] Step S4.3, opening operation, including performing erosion operation and dilation operation in sequence. Opening operation is often used to eliminate small objects or holes in the image while keeping the overall shape and structure of large objects unchanged. In roof detection, opening operation helps to smooth the boundaries of the roof area and eliminate possible noise points. The expression of opening operation is as follows:

[0158] (17);

[0159] In the formula, Opening ( A , B , C ) is the opening operation.

[0160] Step S4.4, closing operation, which is opposite to opening operation, includes performing dilation operation and erosion operation in sequence. Closing operation is used to fill small holes inside objects and smooth their boundaries while keeping the shape and structure of large objects unchanged. In roof detection, closing operation helps to connect parts that may be disconnected in the roof area, so that the detection results are more complete and accurate. The expression of closing operation is as follows:

[0161] (18);

[0162] In the formula, Closing ( A , B , C ) is a closing operation.

[0163] Through these morphological operations, the roof probability map can be effectively adjusted and optimized to improve the detection accuracy of the roof area. These operations can not only handle the noise and discontinuity in the probability map, but also improve the quality of the roof detection results. Dilation and erosion operations can fill small holes and remove unnecessary details to make the boundaries clearer. Opening and closing operations can smooth boundaries, eliminate noise, and fill in broken parts to ensure the continuity and integrity of the detection results. In this way, we finally get more accurate and reliable roof detection results.

[0164] Step S5: weighted fusion of the optimized roof area detection result and the initial segmentation result obtained by semantic segmentation to obtain the final roof segmentation result. This step aims to comprehensively utilize the local fine information after morphological operation and the overall characteristics of the semantic segmentation model, thereby improving the accuracy and stability of roof segmentation.

[0165] The present invention obtains the roof segmentation result through semantic segmentation. The semantic segmentation method of the image uses deep learning and convolutional neural network to build an end-to-end semantic segmentation model to identify the roof of the building. The image mask is obtained through semantic segmentation, marking the semantic segmentation model's judgment on whether each pixel in the image is a roof.

[0166] In the process of weighted fusion, the optimization result after morphological operation is combined with the semantic segmentation result. Weighted fusion fuses the results obtained by the two methods according to the confidence of different pixels. The formula is as follows:

[0167] (19);

[0168] In the formula, ( x , y ) is the pixel position in the image, R ( x , y ) is the pixel value after fusion, P (x , y ) is the pixel value in the probability map after morphological operation optimization, S ( x , y ) is the pixel value in the semantic segmentation result, α is a weight parameter used to balance the contributions of the two.

[0169] By comprehensively utilizing the local optimization information of morphological operations and the global features of semantic segmentation models, a more accurate and stable final roof segmentation result is generated. Morphological operations can process local details and noise, while semantic segmentation models can capture overall semantic information. The combination of the two can make up for each other's shortcomings and improve the overall performance and effect of roof segmentation. Therefore, the fusion of segmentation results is one of the key steps in the roof detection process, which can significantly improve the accuracy and robustness of roof detection.

[0170] Example 2

[0171] Based on the same inventive concept as Example 1, this example introduces a rooftop distributed photovoltaic identification device, including:

[0172] The marking and extraction module is configured to mark the roof position of the acquired satellite image and extract pixel features based on the roof position mark;

[0173] A clustering analysis module is configured to perform clustering analysis on the extracted pixel features using a K-means clustering algorithm to obtain an initial pixel classification result;

[0174] A calculation module is configured to calculate the posterior probability of each pixel belonging to the roof category using a Bayesian classifier based on the initial pixel classification result to obtain a probability map;

[0175] A morphological operation module is configured to perform morphological operations including dilation, erosion, opening operation and closing operation on the probability map to obtain an optimized roof area detection result;

[0176] The weighted fusion module is configured to perform weighted fusion on the optimized roof area detection result and the initial segmentation result obtained by semantic segmentation to obtain a final roof segmentation result.

[0177] The specific functional implementation of each of the above modules can be found in the relevant contents of the method in Example 1 and will not be elaborated here.

[0178] Example 3

[0179] This embodiment introduces a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the rooftop distributed photovoltaic identification method described in Embodiment 1 are implemented.

[0180] Example 4

[0181] This embodiment introduces a computer system, including:

[0182] Memory, for storing computer programs / instructions;

[0183] A processor is used to execute the computer program / instructions to implement the steps of the rooftop distributed photovoltaic identification method described in Example 1.

[0184] In summary, the present invention firstly marks the roof position of the acquired satellite image and extracts pixel features based on the roof position mark to comprehensively describe the visual attributes of the roof area, thereby ensuring the comprehensive capture of the visual features of the roof and enhancing the accuracy of classification and segmentation; secondly, the initial pixel classification result is obtained by clustering the extracted pixel features using the K-means clustering algorithm, and pixels with similar features are clustered together to form preliminary roof and non-roof areas, and the optimal number of clusters is automatically determined, which effectively improves the accuracy and efficiency of detection; then, based on the initial pixel classification result, a Bayesian classifier is used to calculate the posterior probability that each pixel belongs to the roof category to obtain a probability map, The local characteristics of pixels and the global distribution characteristics of the roof area are taken into account, which significantly improves the accuracy and robustness of classification; on this basis, through morphological operations such as dilation, erosion, opening and closing operations, the detection results are optimized, noise is removed, broken parts are filled, and the roof area is made more continuous and clear, making the segmentation results more accurate; finally, the optimized roof area detection results are weightedly fused with the initial segmentation results obtained by semantic segmentation, and the results of the two methods are combined according to the trust of different pixels to generate a more accurate and stable final roof segmentation result. This fusion method effectively combines local and global information and greatly improves the accuracy and robustness of roof segmentation. The present invention enhances the accuracy of classification and segmentation by introducing multiple feature extraction, fully utilizes the rich feature information of satellite images by combining cluster analysis and Bayesian classifier, enhances the processing ability of noise and image defects by morphological operations, and combines the semantic segmentation model of deep learning with its powerful feature extraction and classification capabilities to improve the overall performance, overcome the limitations of traditional methods, and can efficiently process large-scale satellite image data. It is suitable for large-scale roof detection tasks at the city level, and provides more reliable basic data support for applications such as urban planning and geographic information systems.

[0185] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0186] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0187] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0189] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.

Claims

1. A method for identifying rooftop distributed photovoltaics, characterized in that: include: Mark the roof positions of the acquired satellite images, and extract pixel features based on the roof position marks; Perform cluster analysis on the extracted pixel features to obtain the initial pixel classification results; Based on the initial pixel classification results, a Bayesian classifier is used to calculate the posterior probability that each pixel belongs to the roof category and obtain a probability map; Perform morphological operations including dilation, erosion, opening and closing operations on the probability map to obtain the optimized roof area detection result; The optimized roof area detection result is weightedly fused with the initial segmentation result obtained through semantic segmentation to obtain the final roof segmentation result; The cluster analysis method comprises: Taking the extracted pixel features as input data, the optimal K value is found by combining the elbow rule and the silhouette coefficient; Among them, the method of finding the optimal K value through the elbow rule includes: by drawing the change curve of the loss function of clustering under different K values, selecting a K value that makes the loss function drop rapidly and tend to be stable as the optimal K value. The formula of the loss function is as follows: (12); In the formula, SSE is the loss function, C d It is d The sample set of clusters, z is the vector representation of a data point in the dataset, It is d The center point of each cluster; The method of finding the optimal K value through the silhouette coefficient includes: calculating the silhouette coefficient for each sample, and the K value with the maximum average silhouette coefficient is regarded as the optimal K value. The formula is as follows: (13); In the formula, s ( e ) is the silhouette coefficient, a ( e ) is a sample e The average distance to other samples in the same cluster, b ( e ) is a sample e The average distance to the nearest other cluster; After the optimal K value is determined by combining the two methods, K cluster centers are initialized and cluster analysis is performed through an iterative optimization process. The specific steps include: Assign each pixel to the category of the nearest cluster center, calculate the distance from each pixel to all cluster centers, and select the cluster center corresponding to the minimum distance to complete the pixel assignment; Calculate the mean of each cluster and use the mean as the new cluster center to complete the cluster center update; Repeating the pixel allocation and cluster center update steps until the cluster center no longer changes or a predetermined number of iterations is reached, and generating a pixel-level classification result; The method for obtaining an initial segmentation result through semantic segmentation includes using deep learning and convolutional neural network to build an end-to-end semantic segmentation model to identify the roof of the building; The optimized roof area detection result is weightedly fused with the initial segmentation result obtained by semantic segmentation, and the formula is as follows: (19); In the formula, ( x , y ) is the pixel position in the image, R ( x , y ) is the pixel value after fusion, P ( x , y ) is the pixel value in the probability map after morphological operation optimization, S ( x , y ) is the pixel value in the semantic segmentation result, α is a weight parameter used to balance the contributions of the two.

2. The method for identifying rooftop distributed photovoltaics according to claim 1, characterized in that: The roof position is marked using an image annotation tool, and the marking method includes: outlining the boundaries of the roof area by clicking and adjusting the marking points; during the marking process, capturing the true outline of the roof through real-time adjustment and feedback, and reviewing and correcting the marking results to ensure that each roof area is accurately marked.

3. The method for identifying rooftop distributed photovoltaics according to claim 1, characterized in that: The extracting pixel features includes extracting color histogram, texture features and shape information; Extracting the color histogram involves extracting the color values ​​of all pixels from the marked area to calculate the color value distribution, as follows: (1); In the formula, H ( k ) is the value of each pixel k The frequency of occurrence, n k The pixel value in the image is k The number of pixels, N is the total number of pixels; The color histogram is in the form of: Color Histogram =[[ R 1, R 2,…, R 256 ],[ G 1, G 2,…, G 256 ],[ B 1, B 2,…, B 256 ]] (2); In the formula, Color Histogram is the vector representation of the color histogram, Color Histogram Divide the image into R , G , B There are three channels, and the color value of each channel is described by a 256-dimensional vector. The elements in each vector are H ( k ) value, indicating the value of each pixel in this channel k Frequency of occurrence; [ R 1, R 2,…, R 256 ]、[ G 1, G 2,…, G 256 ]、[ B 1, B 2,…, B 256 ] are three 256-dimensional vectors formed by the color value distribution of the three channels R, G, and B; Extracting texture features involves converting color images into grayscale images and using grayscale co-occurrence matrix or local binary pattern method to extract texture features including contrast, correlation, energy and entropy. The formula is as follows: (3); (4); (5); (6); In the formula, Contrast is the contrast, Correlation is the correlation, Energy It's energy. Entropy is entropy, P ( i , j ) is the gray level i and grayscale j The normalized frequency of the co-occurrence matrix, , The pixel values ​​are in grayscale i and grayscale j The mean of , The pixel values ​​are in grayscale i and grayscale j The standard deviation of The texture feature is in the form of: Texture Features =[ Contrast , Correlation , Energy , Entropy ] (7); In the formula, Texture Features It is a texture feature; Extract shape information, including using image processing algorithms to extract the boundaries of the roof position mark area, and calculate shape features including area, perimeter, and shape moment to accurately reflect the geometric features and contours of the roof. The formula is as follows: (8); (9); (10); In the formula, Area is the area, Perimeter is the circumference, Centroid is the shape moment, m , n are the indices of the horizontal and vertical coordinates of the pixel, respectively. x m is the horizontal coordinate of the current pixel, x m+1 is the horizontal coordinate of the next pixel, y n is the vertical coordinate of the current pixel, y n+1 is the vertical coordinate of the next pixel; The shape information is in the form of: Shape Information =[ Area , Perimeter , Centroid ] (11); In the formula, Shape Information It is shape information.

4. The method for identifying rooftop distributed photovoltaics according to claim 1, characterized in that: The method of using a Bayesian classifier to calculate the posterior probability of each pixel belonging to the roof category includes: Applying the initial pixel classification result to assign each pixel point to a corresponding cluster center; Using the extracted pixel features as the input features of the Bayesian classifier, the posterior probability that each pixel assigned to the corresponding cluster center belongs to the roof category is calculated as follows: (14); In the formula, is the posterior probability that the pixel belongs to the roof category when the pixel features are known. is the conditional probability of a pixel feature given the rooftop class, P (roof) is the prior probability of the roof class, P (Feature) is the marginal probability of the feature, which is normalized to ensure that the sum of the posterior probabilities is 1.

5. The method for identifying rooftop distributed photovoltaics according to claim 1, characterized in that: The morphological operations include: The expansion operation is expressed as follows: (15); In the formula, A is the original probability map, B is the expansion kernel, ( x , y ) is the pixel position in the image, p , q is the coordinate index in the dilation kernel 𝐵; The corrosion operation is expressed as follows: (16); In the formula, C It is a corrosive core; The opening operation includes performing corrosion operation and expansion operation in sequence. The expression is as follows: (17); In the formula, Opening ( A , B,C ) is an opening operation; The closing operation includes performing the dilation operation and the erosion operation in sequence, and the expression is as follows: (18); In the formula, Closing ( A , B, C ) is a closing operation.

6. A rooftop distributed photovoltaic identification device, characterized in that: Used to implement the rooftop distributed photovoltaic identification method described in any one of claims 1 to 5, the device comprises: The marking and extraction module is configured to mark the roof position of the acquired satellite image and extract pixel features based on the roof position mark; A clustering analysis module is configured to perform clustering analysis on the extracted pixel features using a K-means clustering algorithm to obtain an initial pixel classification result; A calculation module is configured to calculate the posterior probability of each pixel belonging to the roof category using a Bayesian classifier based on the initial pixel classification result to obtain a probability map; A morphological operation module is configured to perform morphological operations including dilation, erosion, opening operation and closing operation on the probability map to obtain an optimized roof area detection result; The weighted fusion module is configured to perform weighted fusion on the optimized roof area detection result and the initial segmentation result obtained by semantic segmentation to obtain a final roof segmentation result.

7. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the steps of the rooftop distributed photovoltaic identification method described in any one of claims 1 to 5 are implemented.

8. A computer system, characterized in that: include: Memory, for storing computer programs / instructions; A processor, configured to execute the computer program / instructions to implement the steps of the rooftop distributed photovoltaic identification method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Bayesian probability and neural network-based image segmentation method

    CN106846321A

  • Image intelligent signal detection and identification method based on texture features

    CN116933153A

  • Building roof identification method and device based on multi-source heterogeneous deep network fusion

    CN117253149A