A method for extracting photovoltaic developable roofs based on high-resolution images
By combining multiple digital image processing technologies and utilizing high-resolution images, the problem of low accuracy in extracting photovoltaic developable roofs from remote sensing images was solved, and high-precision roof area calculation was achieved.
Patent Information
- Application Number
- CN202210805671.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-08
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-07-08
AI Technical Summary
In existing technologies, the identification and extraction of photovoltaic developable roofs in remote sensing images has the problem of low accuracy, especially in urban areas, where it is difficult to efficiently distinguish and extract building roof information.
The principal component analysis algorithm, Otsu threshold segmentation, decision tree classification, supervised classification, Canny operator edge detection and mathematical morphology algorithm are used, combined with high-resolution images, to remove interference factors and extract photovoltaic developable roofs.
The extraction accuracy of photovoltaic developable roofs has been improved, and the roof area can be accurately calculated, providing technical support for photovoltaic power generation.
Smart Images

Figure CN115471738B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote sensing data processing, and in particular to a method for extracting photovoltaic developable roofs based on high-resolution images. Background Art
[0002] With the rapid development of remote sensing technology, high-resolution remote sensing images have gained widespread use in various fields due to their rich information content, ease of acquisition, real-time performance, and high accuracy. Photovoltaic (PV) technology is one of the most effective ways to utilize solar energy and is currently one of the fastest-growing high-tech industries. Distributed PV systems are primarily installed on building roofs and directly connected to the low-voltage distribution network, improving land resource utilization.
[0003] The development of distributed photovoltaic rooftops is currently far slower than expected and faces numerous challenges, particularly a lack of methods and technologies for assessing urban rooftop resources. Currently, methods for large-scale rooftop data collection are limited, primarily relying on land use data and periodic manual inspections of monitored areas. While manual field inspections offer high accuracy in obtaining rooftop information, this method is labor-intensive, time-consuming, and inefficient, making it unsuitable for the current development needs of the photovoltaic industry. With the rapid advancement of remote sensing technology, remote sensing data capture boasts wide coverage, short acquisition times, and very high resolution, providing a rich and reliable data source for building identification. However, remote sensing object extraction also presents numerous uncertainties, such as the fact that spectra of objects can vary from one object to another, or from different objects to the same spectra, making it difficult to distinguish objects or resulting in low extraction accuracy. Numerous researchers, both domestically and internationally, have conducted research on building identification and photovoltaic array extraction from remote sensing imagery. However, achieving high-precision and efficient automatic rooftop identification and extraction remains a significant challenge, and further exploration is needed for practical application. Summary of the Invention
[0004] In response to the problems in the existing technology that objects are difficult to distinguish and the extraction accuracy is low, the present invention provides a method for extracting photovoltaic developable roofs based on high-resolution images. Through principal component analysis algorithm, Otsu threshold segmentation, decision tree classification, supervised classification, Canny operator edge detection, mathematical morphology algorithm and other steps, the photovoltaic developable roofs in high-resolution images are extracted, which can remove most interference factors and has high accuracy.
[0005] The following are the technical solutions of the present invention.
[0006] A method for extracting photovoltaic developable roofs based on high-resolution images includes the following steps:
[0007] S1: Preprocess the high-resolution image and crop the area with dense buildings;
[0008] S2: Use the principal component analysis algorithm to reduce the dimension of the building-dense area and obtain several principal component data;
[0009] S3: Perform Otsu threshold segmentation on the principal component data to generate a binary image result map;
[0010] S4: Use decision tree classification and supervised classification to classify the image binarization result map to obtain the suspected roof class;
[0011] S5: Mask the threshold segmentation result according to the suspected roof class, and the mask result is a discrete object of the roof;
[0012] S6: Perform Canny operator edge detection on the mask result to extract the building outline;
[0013] S7: Edit and repair irregular line segments and small closed loops of building outlines;
[0014] S8: Use mathematical morphology algorithm to optimize the processing results, obtain the final extraction results, and calculate the photovoltaic developable roof area.
[0015] The present invention can effectively combine the characteristic information of targets in high-resolution optical images with a variety of new digital image processing technology methods to remove interference information and improve the accuracy of roof extraction; it uses the roof extraction results and the resolution of the image to calculate the photovoltaic developable roof area, providing technical support for accurately obtaining photovoltaic developable roof information.
[0016] Preferably, the process of S1 includes: selecting a portion of the high-resolution image where the density of rectangles is greater than a preset value, and cropping the portion to obtain a densely populated building area. Since most roofs are rectangular, a high density of rectangles indicates a high probability of being a densely populated building area.
[0017] Preferably, the process of S2 includes:
[0018] Calculate the covariance matrix of densely built areas;
[0019] Find the eigenvalue λ of the covariance matrix i and its corresponding orthogonalized unit eigenvector a i ;
[0020] The first m largest eigenvalues of the covariance matrix are the variances corresponding to the first m principal components; the i-th principal component F i for:
[0021] F i =ai X;
[0022] Where X is the original image of the building-dense area, X = X i , i = 1, 2,…, k, k is the number of bands.
[0023] Preferably, the process of S4 includes:
[0024] Select regions of interest, namely bare soil, vegetation, roads, roofs, and shadows. Use the statistical data of each region of interest to set judgment conditions for each node in the decision tree. After obtaining the final results, use the confusion matrix to analyze the results.
[0025] Then, using the region of interest, the maximum likelihood classification method in supervised classification is used for classification. The maximum likelihood classification method assumes that the characteristics of each category obey the normal distribution and constructs a probability distribution function. Based on the probability distribution function, the probability of each pixel belonging to different categories is calculated, and the multiple probability results obtained are compared. The category with the largest probability is the classification result of the pixel. Let the conditional probability of pixel x in category k be P(x|k), and the conditional probability of pixel x in category i be P(x|i), then the belonging probability L k It is expressed as a discriminant function of the following form:
[0026] L k =P(k|x)=P(k)×P(x|k) / ∑P(i)×P(x|i);
[0027] P(k) is the prior probability of category k, and P(i) is the prior probability of category i, determined by the training area;
[0028] The ROI in the above steps is used for preliminary maximum likelihood classification, and the confusion matrix is used for result analysis. For areas with misclassification or mixed classification, the ROI is adjusted and reclassified to improve the classification results and obtain the suspected roof class.
[0029] Preferably, the process of S7 includes:
[0030] Convert the building outline obtained by Canny operator edge detection into line features;
[0031] Process irregular line segments and small closed loops, delete the small closed loops, compare with the original image, adjust the position of irregular line segments in the building outline, and connect the broken line segments.
[0032] The substantial effects of the present invention include: being able to roughly segment the roof area from the background area; performing principal component analysis, decision tree classification, and supervised classification, and comparing the accuracy of the decision tree classification with the supervised classification to obtain suspected roof classes; then using the classified suspected roof classes to mask the Otsu threshold segmentation results, and performing Canny operator edge detection on the masked results to obtain the roof outline; editing interference factors in the outline results; and finally, processing the roof outline results using mathematical morphology methods to obtain the final photovoltaic developable roof extraction results, and calculating their area using resolution. Principal component analysis removes some interference information, highlighting the roof information, which can be applied to subsequent decision tree classification; combining the classification algorithm with threshold segmentation effectively removes most interference information to obtain the roof object; performing Canny operator edge detection on the image after removing the interference target, which can quickly extract the building outline; and calculating the area of the photovoltaic developable roof using the number of pixels and resolution in the extraction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a flow chart of an embodiment of the present invention;
[0034] Figure 2 This is a diagram showing the principal component analysis results of an embodiment of the present invention;
[0035] Figure 3 This is the Otsu threshold segmentation result of an embodiment of the present invention;
[0036] Figure 4 This is the threshold segmentation mask result of the suspected roof class in an embodiment of the present invention;
[0037] Figure 5 The edge detection and ArcGIS editing processing results of the embodiment of the present invention;
[0038] Figure 6 is the mathematical morphology processing result of the embodiment of the present invention;
[0039] Figure 7 This is a comparison chart between the extraction results of an embodiment of the present invention and the actual situation. DETAILED DESCRIPTION
[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions will be clearly and completely described below in conjunction with the embodiments. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0041] It should be understood that in various embodiments of the present invention, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0042] It should be understood that in the present invention, "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus that includes 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 these processes, methods, products or apparatuses.
[0043] It should be understood that in the present invention, "multiple" refers to two or more. "And / or" is only a description of the association relationship of associated objects, indicating that three relationships can exist. For example, and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "Contains A, B and C", "Contains A, B, C" means that A, B, and C are all included, "Contains A, B or C" means that one of A, B, and C is included, and "Contains A, B and / or C" means that any one, any two, or any three of A, B, and C are included.
[0044] The technical solution of the present invention is described in detail below with reference to specific embodiments. The embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0045] Example:
[0046] A method for extracting photovoltaic developable roofs based on high-resolution images, such as Figure 1 As shown, the following steps are included:
[0047] S1: Preprocess the high-resolution image and crop the area with dense buildings.
[0048] The specific process involves selecting areas in the high-resolution image where the density of rectangles exceeds a preset value and cropping them to identify densely populated building areas. Since most rooftops are rectangular, a high density of rectangles indicates a high probability of densely populated building areas.
[0049] In reality, building roofs come in many different types. Some roofs differ significantly from other features in the image, while others are similar in color to other features, making them difficult to distinguish. First, we crop the image and identify areas with a high density of buildings in the remote sensing image as experimental areas for roof extraction. Areas with high building density are typically urban areas. In high-resolution remote sensing images, the majority of features in these areas are neatly arranged buildings, with the remainder consisting of green spaces, roads, and other features. Therefore, we selected buildings from two regions of the image: Region A, where the buildings stand out from the background and are easier to segment; Region B, where the buildings are similar to the background and more difficult to segment.
[0050] S2: Use the principal component analysis algorithm to reduce the dimension of the building-dense area and obtain several principal component data.
[0051] High-resolution images contain a large amount of information and a lot of interference, which may affect classification results and the extraction of building roof information. In remote sensing image classification, using the principal component analysis algorithm to reduce the image dimension can maximize the retention of original image information, remove excess noise, and achieve information enhancement. The principal component analysis algorithm uses the orthogonal rotation method to transform multiple indicators of information in the original image into new comprehensive indicators, namely principal components. The specific process includes:
[0052] Calculate the covariance matrix of densely built areas;
[0053] Find the eigenvalue λ of the covariance matrix i and its corresponding orthogonalized unit eigenvector a i ;
[0054] The first m largest eigenvalues of the covariance matrix are the variances corresponding to the first m principal components; the i-th principal component F i for:
[0055] F i =a i X;
[0056] Where X is the original image of the building-dense area, X = X i , i = 1, 2,…, k, k is the number of bands.
[0057] like Figure 2As shown in the figure, (a) is the first principal component, (b) is the second principal component, and (c) is the third principal component. It can be seen that the brightness of each object varies across the different principal components. Therefore, the pixel values of the three principal component images can be used as one of the criteria for distinguishing different objects. The vegetation area is highlighted in the first principal component image, while the roof area is less bright. The second principal component image highlights a portion of the roof area. The third principal component contains less information, with only a portion of the roof area highlighted. In the image, buildings and other background information are somewhat distinguishable. First, the pixel value statistics of different objects in each principal component image are examined to obtain the maximum and minimum values for each category. If the minimum pixel value of the roof is greater than the maximum pixel value of the other objects, or the maximum pixel value of the roof is less than the minimum pixel value of the other objects, the roof area can be completely distinguished. However, in most cases, the pixel value span of the roof area is large, making it impossible to distinguish directly. Next, the above-mentioned judgment method is used to determine whether there are other objects that can be directly distinguished from the other objects. After distinguishing some interfering objects, the frequency distribution histogram information of different objects in the principal component images is used to distinguish the majority of pixels in the roof category from the background objects.
[0058] S3: Perform Otsu threshold segmentation on the principal component data to generate an image binarization result map.
[0059] The results are as follows Figure 3 As shown in the figure, compared with the original image, the roof area in region a is more different from the background, and the segmentation effect is better; the roof area in region b is less different from the background, so the segmentation effect is poor.
[0060] S4: Use decision tree classification and supervised classification to classify the image binarization result map to obtain the suspected roof class.
[0061] The specific process includes:
[0062] Select regions of interest, namely bare soil, vegetation, roads, roofs, and shadows. Use the statistical data of each region of interest to set judgment conditions for each node in the decision tree. After obtaining the final results, use the confusion matrix to analyze the results.
[0063] Then, using the region of interest, the maximum likelihood classification method in supervised classification is used for classification. The maximum likelihood classification method assumes that the characteristics of each category obey the normal distribution and constructs a probability distribution function. Based on the probability distribution function, the probability of each pixel belonging to different categories is calculated, and the multiple probability results obtained are compared. The category with the largest probability is the classification result of the pixel. Let the conditional probability of pixel x in category k be P(x|k), and the conditional probability of pixel x in category i be P(x|i), then the belonging probability L k It is expressed as a discriminant function of the following form:
[0064] Lk =P(k|x)=P(k)×P(x|k) / ∑P(i)×P(x|i);
[0065] P(k) is the prior probability of category k, and P(i) is the prior probability of category i, determined by the training area;
[0066] The ROI in the above steps is used for preliminary maximum likelihood classification, and the confusion matrix is used for result analysis. For areas with misclassification or mixed classification, the ROI is adjusted and reclassified to improve the classification results and obtain the suspected roof class.
[0067] In the table below, production accuracy = number of correct classifications / total number of a certain category.
[0068] Experimental Area Production accuracy (Percent) a 99.76 b 86.35
[0069] Experimental Area Production accuracy (Percent) a 98.68 b 97.12
[0070] As shown in Tables 1 and 2, the rooftops in region a differ significantly from the background, resulting in high classification accuracy and excellent roof extraction. The decision tree classification accuracy reached 99.76%. In region b, the rooftops differ less from the background, resulting in lower classification accuracy. The supervised classification results are much more accurate than the decision tree classification results. In practical applications, the smaller difference between the rooftops and the background in region b must be taken into account. The results indicate that the classification in region b is less accurate, with many omissions and misclassifications, requiring further improvement.
[0071] S5: Mask the threshold segmentation result according to the suspected roof class, and the mask result is a discrete object of the roof.
[0072] The suspected roof class obtained after classification of region b masks the threshold segmentation result, and the mask result is a discrete object of the roof. Figure 4 The mask result removes a lot of interference information in the Otsu threshold segmentation result.
[0073] S6: Perform Canny operator edge detection on the mask result to extract the building outline.
[0074] Using the Canny operator to detect edges in images after removing the interference targets can quickly extract the outline of the building.
[0075] S7: Edit and repair irregular line segments and small closed loops of the building's outline.
[0076] The specific process includes:
[0077] Convert the building outline obtained by Canny operator edge detection into line features;
[0078] Process irregular line segments and small closed loops, delete the small closed loops, compare with the original image, adjust the position of irregular line segments in the building outline, and connect the broken line segments. Figure 5 shown.
[0079] S8: Use mathematical morphology algorithm to optimize the processing results, obtain the final extraction results, and calculate the photovoltaic developable roof area.
[0080] Most of the roof area has been extracted and most of the small holes have been processed, but there are still some curved edges and remaining holes. The roof outline is processed by mathematical morphology using a closing operation to fill the small holes inside the roof and smooth the edges. First, set the structure element for the closing operation. Since most roofs are rectangular areas in the image, the noise inside the roof extraction image is small, so the structure element is set to a regular square element of 1×1. The result is as follows Figure 6 The roof outline obtained by manual extraction is compared with the final roof extraction result, as shown in Figure 7 As shown in the figure, (a) is the manually extracted roof outline, and (b) is the final extraction result. The real roof area has 58017 pixels, and the extracted roof outline area has 52924 pixels. The final accuracy is calculated to be 91.22%, which is higher than the roof extraction accuracy of decision tree classification and reduces a lot of fragmented areas compared to the supervised classification results. The resolution of its unit pixel is 1m, that is, the area of a single pixel is 1 2 =1m 2 Based on this, we can get the area of the building roof in the study area to be 52924m 2 Although some roofs are still not extracted and have curved edges, the roof extraction effect is greatly improved compared to the results after Otsu threshold segmentation and remote sensing image classification. In other words, the proposed method for extracting photovoltaic developable roofs based on high-resolution imagery is effective.
[0081] The present invention can effectively combine the characteristic information of targets in high-resolution optical images with a variety of new digital image processing technology methods to remove interference information and improve the accuracy of roof extraction; it uses the roof extraction results and the resolution of the image to calculate the photovoltaic developable roof area, providing technical support for accurately obtaining photovoltaic developable roof information.
[0082] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed to different functional modules as needed, that is, the internal structure of the specific device can be divided into different functional modules to complete all or part of the functions described above.
[0083] In the embodiments provided herein, it should be understood that the disclosed structures and methods can be implemented in other ways. For example, the structural embodiments described above are merely illustrative. For example, the division of modules or units is merely a logical functional division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another structure, or some features can be ignored or not implemented. In addition, the coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of structures or units, and can be electrical, mechanical, or other forms.
[0084] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0085] In addition, the functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or software functional units.
[0086] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially 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, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0087] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for extracting photovoltaic developable roofs based on high-resolution images, characterized in that: The following steps are involved: S1: Preprocess the high-resolution image and crop the area with dense buildings; S2: Use the principal component analysis algorithm to reduce the dimension of the building-dense area and obtain several principal component data; S3: Perform Otsu threshold segmentation on the principal component data to generate a binary image result map; S4: Use decision tree classification and supervised classification to classify the image binarization result map to obtain the suspected roof class; S5: Mask the threshold segmentation result according to the suspected roof class, and the mask result is a discrete object of the roof; S6: Perform Canny operator edge detection on the mask result to extract the building outline; S7: Edit and repair irregular line segments and small closed loops of building outlines; S8: Use mathematical morphology algorithm to optimize the processing results to obtain the final extraction results, and calculate the photovoltaic developable roof area; The process of S1 includes: selecting a portion of the high-resolution image where the density of rectangles is greater than a preset value, and cropping the portion to obtain a densely populated building area; The S2 process includes: Calculate the covariance matrix of densely built areas; Find the eigenvalues of the covariance matrix and its corresponding orthogonalized unit eigenvector ; The first m largest eigenvalues of the covariance matrix are the variances corresponding to the first m principal components; the i-th principal component for: ; in is the original image of the building-dense area, , is the number of bands; The S4 process includes: Select regions of interest, namely bare soil, vegetation, roads, roofs, and shadows. Use the statistical data of each region of interest to set judgment conditions for each node in the decision tree. After obtaining the final results, use the confusion matrix to analyze the results. Then, using the region of interest, the maximum likelihood classification method in supervised classification is used for classification. The maximum likelihood classification method assumes that the characteristics of each category obey the normal distribution and constructs a probability distribution function. Based on the probability distribution function, the probability of each pixel belonging to different categories is calculated, and the multiple probability results obtained are compared. The category with the largest probability is the classification result of the pixel. Let the conditional probability of pixel x in category k be P(x|k), and the conditional probability of pixel x in category i be P(x|i), then the belonging probability L k It is expressed as a discriminant function of the following form: ; P(k) is the prior probability of category k, and P(i) is the prior probability of category i, determined by the training area; The ROI in the above steps is used for preliminary maximum likelihood classification, and the confusion matrix is used for result analysis. For areas with misclassification or mixed classification, the ROI is adjusted and reclassified to improve the classification results and obtain the suspected roof class.
2. The method for extracting photovoltaic developable roofs based on high-resolution images according to claim 1, characterized in that: The S7 process includes: Convert the building outline obtained by Canny operator edge detection into line features; Process irregular line segments and small closed loops, delete the small closed loops, compare with the original image, adjust the position of irregular line segments in the building outline, and connect the broken line segments.
Citation Information
Patent Citations
Road extraction method using multi-temporal SAR images and optical auxiliary information
CN111144246A