Method, device, electronic device and storage medium for repairing tree obstruction on building roof

By combining the tree occlusion decomposition model and the diffusion model, the occlusion noise is gradually removed and the original image of the roof is restored. This solves the problem of inaccurate roof extraction caused by tree occlusion in remote sensing images and achieves efficient and accurate roof restoration.

CN119941549BActive Publication Date: 2025-10-03BEIJING UNIV OF CIVIL ENG & ARCHITECTURE +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411790649.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-10-03
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

When existing technologies use remote sensing images to extract building information, tree occlusion leads to inaccurate roof shape extraction, making it difficult to accurately determine the occlusion location and perform targeted repairs, and the cost of acquiring multi-source data is high.

Method used

The tree occlusion decomposition model is adopted to gradually predict the occlusion position and roof prediction image, and the diffusion model is used to gradually remove noise and restore the original image information of the roof. Combined with conditional diffusion restoration and fusion restoration technology, accurate roof restoration is achieved.

Benefits of technology

It improves the accuracy of tree-blocking repair on building roofs, reduces manual quality inspection work, and lowers the cost of multi-source data acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119941549B_ABST
    Figure CN119941549B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, electronic device, and storage medium for restoring tree occlusions on building roofs. The method comprises: obtaining a tree occlusion image and a Gaussian pure noise image of the building roof to be restored; repeatedly performing the following steps until a preset step length is reached: predicting an occlusion position image and a roof prediction image of the tree occlusion image at the current time step based on a tree occlusion decomposition model; determining a restoration change constraint from the current time step to the next time step based on the occlusion position image, the roof prediction image, and the tree occlusion image to be restored; performing conditional control denoising on the Gaussian pure noise image based on the restoration change constraint to obtain a conditional diffusion restoration image; and performing fusion restoration on the conditional diffusion restoration image based on a tree occlusion fusion restoration sampler to obtain a tree occlusion image at the next time step; and finally obtaining a complete building roof image at the last time step as the tree occlusion image. The present invention can improve the accuracy of building roof extraction in tree-occluded environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, electronic device and storage medium for repairing tree occlusion on a building roof. Background Art

[0002] As a key symbol of social development, buildings are closely intertwined with human life. With the rapid development of remote sensing Earth observation technology, large-scale, high-resolution remote sensing imagery provides accurate and reliable data for applications such as building change monitoring, urban planning and construction, and disaster emergency assessment. Currently, large-scale building information extraction using remote sensing imagery remains challenging due to issues such as incorrect and missed detection of buildings obscured by trees.

[0003] This method focuses on tree occlusion, a common yet rarely studied problem. Trees obstructing rooftops obstruct the inherent extension of building boundaries. These trees and their shadows alter the spectrum of rooftop pixels, posing a significant challenge to accurately delineating buildings. Current research focuses on optimizing deep network architectures to improve rooftop extraction accuracy under tree occlusion, rather than prioritizing restoration. Image segmentation models predict rooftops at the spatial pixel level, making it difficult to address the inaccurate rooftop morphology extraction caused by tree occlusion. In practical engineering applications, obtaining CityGML Level 0 (LOD0) data that meets GIS quality standards still requires extensive manual visual interpretation and subsequent quality control. Some studies have leveraged multi-source data to address the limitations of a single optical data source. For example, additional radar point clouds that penetrate the canopy can be used to extract missing rooftop information. However, acquiring large-scale, spatially aligned multi-source data is prohibitively expensive. Graph neural networks improve boundary reasoning under occlusion by assessing the number and spatial relationships of rooftop corners, enabling direct generation of vector representations. However, when the roof occludes a large area, the existing edge or corner information is incomplete, and the resulting vector contour boundary is not very usable. The above methods all start from the information of the visible part of the roof, and have limited ability to infer the information of the occluded part of the roof.

[0004] Generative models have been widely used in image restoration. For example, generative adversarial networks optimize the adversarial loss between the generator and the discriminator to ensure that the generated image is as close to the real image as possible. MAE uses the encoder to obtain visible image features and the decoder to inpaint occluded areas. Therefore, when faced with large areas of tree occlusion, it is possible to first inpaint the rooftop area obscured by trees before performing extraction.

[0005] However, there are two key issues that are difficult to resolve when repairing tree shading on rooftops:

[0006] 1. How to determine the locations of trees in an image that interfere with rooftop extraction? The core of this problem is that not all trees in an image need to be identified as obstructing. How can we determine the locations of tree obstructions and perform targeted repairs based on the degree of obstruction?

[0007] 2. How to use information from the visible area of ​​a building's roof to inpaint the occluded portion? The core of this problem lies in whether the model can understand the pixel distribution of a complete building roof. The roof is inpainted by leveraging the image's inherent characteristics and its spatial layout within the background. Summary of the Invention

[0008] The present invention provides a method, device, electronic device and storage medium for repairing tree occlusion on building roofs, which are used to solve the problem of inaccurate building roof information extracted by current deep learning methods in the case of tree occlusion in high spatial resolution remote sensing images.

[0009] The present invention provides a method for repairing tree obstruction on a building roof, comprising:

[0010] Obtaining a tree-occluded image and a Gaussian pure noise image of the roof of the building to be repaired, wherein the tree-occluded image at the first time step is the tree-occluded image of the roof of the building to be repaired;

[0011] Repeat the following steps until a preset step length is reached: based on the tree occlusion decomposition model, predict the occlusion position image of the tree occlusion image at the current time step and the roof prediction image of the tree occlusion image at the current time step; based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step, and the tree occlusion image of the roof of the building to be repaired, determine the tree occlusion repair change constraint from the current time step to the next time step; based on the repair change constraint, conditionally control denoising is performed on the Gaussian pure noise image to obtain the conditional diffusion repair image of the current time step, and based on the tree occlusion fusion repair sampler, the conditional diffusion repair image is fused and repaired to obtain the tree occlusion image of the next time step;

[0012] The tree occlusion image at the last time step is used as the final restored complete building roof image.

[0013] According to the method for repairing tree occlusion on a building roof provided by the present invention, the tree occlusion decomposition model includes an encoder, a position decoder, and a pixel decoder. The method, based on the tree occlusion decomposition model, predicts an occlusion position image of a tree occlusion image at a current time step and a predicted roof image of the tree occlusion image at a current time step, including:

[0014] Extracting intermediate transition features of the tree occlusion image at the current time step based on the encoder;

[0015] Predicting an occlusion position image of the tree occlusion image at the current time step based on the position decoder and the intermediate transition features;

[0016] Based on the pixel decoder and the intermediate transition features, a roof prediction image of the tree occlusion image at the current time step is predicted.

[0017] According to the building roof tree occlusion restoration method provided by the present invention, the occlusion position image of the tree occlusion image at the current time step is predicted based on the position decoder and the intermediate transition feature, including:

[0018] Calculating an attention score of the intermediate transition feature based on the position decoder;

[0019] Multi-head self-attention calculation is performed on the intermediate transition features whose attention scores are greater than or equal to the preset threshold, and convolution calculation is performed on the intermediate transition features whose attention scores are less than the preset threshold. The calculation results are fused to obtain the occlusion position image of the tree occlusion image at the current time step.

[0020] According to the method for repairing tree occlusion on a building roof provided by the present invention, the method of predicting a roof prediction image of the tree occlusion image at the current time step based on the pixel decoder and the intermediate transition feature includes:

[0021] Based on the pixel decoder, performing partial random masking on the intermediate transition features to obtain masked features and unmasked features;

[0022] A convolution calculation is performed on the masked features, a multi-head self-attention calculation is performed on the unmasked features, and the calculation results are fused to obtain a roof prediction image of the tree-occluded image at the current time step.

[0023] According to the building roof tree occlusion repair method provided by the present invention, the loss function of the tree occlusion decomposition model is determined based on the positioning loss function, the prediction loss function and the repair loss function;

[0024] The positioning loss function is determined based on the occlusion position image of the tree occlusion image at the current time step and the sample true occlusion position image, the prediction loss function is determined based on the roof prediction image of the tree occlusion image at the current time step and the sample building roof image, and the restoration loss function is determined based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step and the sample building roof image.

[0025] According to the method for repairing tree occlusion on a building roof provided by the present invention, determining a tree occlusion repair change constraint from the current time step to the next time step based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step, and the tree occlusion image of the building roof to be repaired, includes:

[0026] Determine a predicted image of the building roof at the occlusion position based on the occlusion position image of the tree occlusion image at the current time step and the predicted image of the roof of the tree occlusion image at the current time step;

[0027] Determine an occlusion image of the building roof at the occlusion position based on the occlusion position image of the tree occlusion image at the current time step and the tree occlusion image of the building roof to be restored;

[0028] Based on the difference between the predicted image of the building roof at the occlusion position and the occlusion image of the building roof, a tree occlusion restoration change constraint from the current time step to the next time step is determined.

[0029] According to the tree occlusion restoration method for a building roof provided by the present invention, the conditional diffusion restoration image of the current time step is obtained based on the restoration change constraint, and the conditional diffusion restoration image is fused and restored based on a tree occlusion fusion restoration sampler to obtain a tree occlusion image of the next time step, including:

[0030] Based on the restoration change constraint, a conditional diffusion restoration image of the area occluded by trees at the current time step is obtained by a reverse sampling method of conditional control denoising;

[0031] The diffusion image of the area not blocked by trees at the current time step is obtained by forward diffusion;

[0032] Based on the tree occlusion fusion restoration sampler, the conditional diffusion restoration image and the diffusion image are combined and then fused and restored to obtain the tree occlusion image at the next time step.

[0033] The present invention also provides a tree-blocking repair device for a building roof, comprising:

[0034] An image acquisition unit is used to acquire a tree-blocked image of the roof of the building to be repaired, wherein the tree-blocked image at the first time step is the tree-blocked image of the roof of the building to be repaired;

[0035] An iterative denoising unit is configured to repeatedly execute the following steps until a preset step length is reached: based on a tree occlusion decomposition model, predict an occlusion position image of the tree occlusion image at the current time step and a roof prediction image of the tree occlusion image at the current time step; based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step, and the tree occlusion image of the roof of the building to be repaired, determine a tree occlusion repair change constraint from the current time step to the next time step; based on the repair change constraint, conditionally control denoising is performed on the Gaussian pure noise image to obtain a conditional diffusion repair image at the current time step, and based on a tree occlusion fusion repair sampler, the conditional diffusion repair image is fused and repaired to obtain a tree occlusion image at the next time step;

[0036] The image determination unit is used to use the tree occlusion image at the last time step as the final restored complete building roof image.

[0037] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, any of the above-described methods for repairing tree shading on a building roof is implemented.

[0038] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for repairing tree shading on a building roof as described above is implemented.

[0039] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-mentioned methods for repairing tree shading on a building roof.

[0040] The proposed method, device, electronic device, and storage medium for restoring tree-occluded rooftops treat the tree-occluded image of the roof to be restored as a random noise pattern, gradually removing the noise pixels that cause the roof occlusion and restoring the original roof image information. A tree occlusion decomposition model is used to learn the characteristic distribution and variation patterns of pixels at the occluded locations during noise removal. After obtaining the target image result for the restored rooftop, the final contour result is extracted, improving the accuracy of tree-occluded roof restoration. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 This is one of the flow charts of the method for repairing tree shading on a building roof provided by the present invention.

[0043] Figure 2 This is the second flow chart of the method for repairing tree obstruction on a building roof provided by the present invention.

[0044] Figure 3 Schematic diagram of a building roof example dataset provided by the present invention.

[0045] Figure 4 Schematic diagram of a rooftop tree occlusion simulation sequence data set provided by the present invention.

[0046] Figure 5 This is one of the structural diagrams of the tree occlusion decomposition model provided by the present invention.

[0047] Figure 6 This is the second structural diagram of the tree occlusion decomposition model provided by the present invention.

[0048] Figure 7 This is the third flow chart of the method for repairing tree shading on a building roof provided by the present invention.

[0049] Figure 8 It is a structural schematic diagram of the tree-blocking repair device for a building roof provided by the present invention.

[0050] Figure 9 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0051] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. 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 shall fall within the scope of protection of the present invention.

[0052] In recent years, diffusion models have been widely used in natural and remote sensing imagery. Tree occlusion in remote sensing images can be considered a form of occlusion noise, present as patches above rooftops. Based on a denoising approach, this method gradually predicts tree-occluded patches and the corresponding true rooftops below them, using these as conditions for the backward denoising process to guide the restoration of complete building rooftops. This paper proposes a method for performing targeted restoration of rooftops after obtaining candidate frames or preliminary extraction results for tree-occluded roofs. After obtaining the target image result of the restored rooftop, the final contour result is extracted.

[0053] Figure 1 This is one of the flow charts of the method for repairing tree shading on a building roof provided by the present invention, such as Figure 1 As shown, the method includes:

[0054] Step 110 , obtaining a tree-blocked image and a Gaussian pure noise image of the roof of the building to be repaired, wherein the tree-blocked image at the first time step is the tree-blocked image of the roof of the building to be repaired.

[0055] Specifically, the tree-occluded image of a building roof to be restored contains tree occlusion noise. The restoration process removes this noise and restores the original image information. Tree occlusion noise refers to the phenomenon in remote sensing images where the roof's outline is obscured by trees, resulting in changes in the roof's geometric and spectral characteristics.

[0056] Step 120, repeatedly perform the following steps until a preset step length is reached: based on the tree occlusion decomposition model, predict the occlusion position image of the tree occlusion image at the current time step and the roof prediction image of the tree occlusion image at the current time step; based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step, and the tree occlusion image of the roof of the building to be repaired, determine the tree occlusion repair change constraint from the current time step to the next time step; based on the repair change constraint, conditionally control denoising is performed on the Gaussian pure noise image to obtain the conditional diffusion repair image of the current time step, and based on the tree occlusion fusion repair sampler, the conditional diffusion repair image is fused and repaired to obtain the tree occlusion image of the next time step.

[0057] Step 130 , using the tree-occluded image at the last time step as the final restored complete building roof image;

[0058] Specifically, the embodiment of the present invention uses a T-step decomposition process based on the diffusion denoising concept to gradually remove tree occlusion noise from a tree occlusion image of a building roof to be restored until a restored roof image is obtained. Figure 2 This is the second flow chart of the method for repairing tree obstruction on the roof of a building provided by the present invention, such as Figure 2 As shown, for any time t, three modules are mainly processed:

[0059] (1) Tree occlusion decomposition model: For the input image, the tree occlusion decomposition model is first used to obtain the current prediction of the occlusion position, that is, the occlusion position image of the tree occlusion image at the current time step is predicted, and the prediction of the original image, that is, the roof prediction image of the tree occlusion image at the current time step is predicted.

[0060] (2) Tree occlusion repair change constraints: After obtaining the occlusion position image of the tree occlusion image at the current time step and the roof prediction image of the tree occlusion image at the current time step, the tree occlusion repair change constraints from the current time step to the next time step can be determined based on the occlusion position image, the roof prediction image, and the tree occlusion image of the roof of the building to be repaired.

[0061] (3) Tree Occlusion Fusion Inpainting Sampler: Based on the inpainting change constraint, the generation direction of the occluded area is controlled to correspond to the distribution pattern of the visible area, thereby performing conditional control denoising on the Gaussian pure noise image and obtaining the conditional diffusion inpainting image of the current time step. On this basis, based on the tree occlusion fusion inpainting sampler, the conditional diffusion inpainting image is fused and inpainted to obtain the denoising result of the current time step, that is, the tree occlusion image of the next time step.

[0062] Before executing step 120, a denoising diffusion model may be used to pre-train the complete building roof instance dataset, with the goal of understanding the pixel distribution pattern of the building roof in the non-occluded case, including the geometric shape, spectral color, and texture style of each building roof instance.

[0063] The data sets of this embodiment include the building roof instance data set BUCEA4.0 and the roof tree occlusion simulation sequence data set. Figure 3 This is a schematic diagram of the building roof example dataset provided by this invention. BUCEA 4.0 defines the standard for complete building roof restoration, which is key to restoration feasibility. A diffusion model is pre-trained on this dataset to enable it to generate complete building roofs.

[0064] The forward diffusion process is defined as follows: From the uniformly distributed building roof instance data Randomly sample a rooftop image sample ,right Add T times of Gaussian noise randomly sampled from a standard normal distribution Get the diffusion image At the same time, Input into the neural network of the diffusion model to learn the noise information added at each step, fitting When T is large enough, the final noise image Will obey the standard normal distribution. According to the properties of the Markov chain, the forward noise enhancement process can be obtained as formula (1):

[0065]

[0066] in is the diffusion process image, is Gaussian noise, coefficient The value range is (0, 1) and satisfies formula (2):

[0067]

[0068] Then we have the following conditional probability distribution formula (3):

[0069]

[0070] in Known under conditions The conditional probability of . By recursion, we can directly get Calculated Formula (4):

[0071]

[0072] Depend on The obtained conditional probability distribution becomes formula (5):

[0073]

[0074] in Known under conditions The conditional probability of . Backward denoising is to gradually remove noise from a pure noise image to generate an image The process is as follows: First, a noise image is randomly sampled from the standard normal distribution. ,Will Adding noise to the input deep neural network to get predictions , remove the noise to get the denoised image in the first step , repeat the above steps T times to get the final generated image According to the posterior probability distribution, we can get formula (6):

[0075]

[0076] in Indicates that in the known under conditions The posterior probability of . represents the parameters of the neural network, is the mean, is the variance.

[0077] In the original diffusion model, the variance is fixed and the neural network only calculates the mean. Make predictions. Based on the noise prediction results We can get formula (7):

[0078]

[0079] The mean In a given Under the condition of only and current t Image of the diffusion process of the step , neural network parameters , and the predicted results related.

[0080] Based on the mathematical process of equations (1)-(7), a complete building roof instance dataset is trained using self-supervised learning to obtain a pre-trained building roof diffusion model for subsequent restoration work. During the training process, the diffusion model learns to restore the original image from different noise levels, understands the global structure and detailed features of the image, and gradually understands the shape, texture, and boundary information of the complete roof. Through the self-supervised mechanism, the model can extract features from the data itself without relying on explicit manual annotation. The pre-trained diffusion model can use the features learned from the complete building roof atlas sample library to generate realistic building roof images from pure noise images.

[0081] For the simulated rooftop tree occlusion sequence dataset, considering that in remote sensing imagery, it is often difficult to determine the true boundary outline and pixel information between the building roof and the background below the tree occlusion from a single data source, resulting in a lack of labeled data corresponding to the occluded images and the real images for training. Compared to shadows, clouds, and fog, tree occlusion is a common feature type in high-resolution remote sensing imagery. Its pixels are concentrated and continuously distributed, forming a distinct tree occlusion pattern.

[0082] Figure 4 is a schematic diagram of a rooftop tree occlusion simulation sequence data set provided by the present invention, such as Figure 4 As shown in the figure, an image of a building rooftop obscured by trees (occluded image) X can be regarded as a spatiotemporal random combination of a complete building rooftop image B (clean image) and a tree image O. The location of tree occlusion is controlled by multiplying a randomly generated binary map P (position image, where background is 0 and tree is 1) of the occluded patch with the tree image O. At the same time, since there is an edge transition zone composed of mixed pixels at the edge of the tree, in order to make the simulated data closer to the actual environment, a Gaussian smoothing operation is performed on the edge of the occluded patch in P within a random width of 1-3 pixels. Therefore, the occluded image X can be expressed as follows (8):

[0083]

[0084] For deep learning models, the true image B is usually predicted directly from the occluded image X. Based on the analysis of shadow occlusion composition and inspired by the diffusion model, and in order to make the model's learning task fit the process of repairing tree occlusion, this simulation method decomposes formula (8) and defines it as the forward occlusion process of tree occlusion noise. The specific description is as follows:

[0085] Gradually add tree occlusion patch noise to the real image B, and gradually remove building roofs and background pixels. The simulation process is specified as Step 1, define a random noise list As shown in formula (9):

[0086]

[0087] Among them, the list elements The value is between 0 and 1, and the sum of all elements is 1. The default value is 5. At step i, the occlusion position is proportional to Add a random tree occlusion image O to the image and remove the corresponding position of the real image B. Therefore, for any real image B, we can get formula (10):

[0088]

[0089] Formula (11) defines the tree occlusion noise added at each step :

[0090]

[0091] Formula (12) defines the real image removed :

[0092]

[0093] List The elements in are not completely random, but gradually increase according to the step size. Similar to the diffusion model, the trees added at the beginning have less occlusion, and the more trees added later, the more occlusion. At the beginning, you can see the outline of the building roof below through the tree canopy, and the outline of the building roof becomes more blurred until it is completely blocked by the tree canopy. The sum of the sequence elements is always 1, ensuring that the final Output of step , still satisfies formula (8).

[0094] In some embodiments, based on the tree occlusion decomposition model, an occlusion position image of the tree occlusion image at the current time step and a predicted roof image of the tree occlusion image at the current time step are predicted, that is, step 120 specifically includes:

[0095] Step 121, extracting intermediate transition features of the tree occlusion image at the current time step based on the encoder;

[0096] Step 122 , predicting an occlusion position image of the tree occlusion image at the current time step based on the position decoder and the intermediate transition features;

[0097] Step 123 : Based on the pixel decoder and the intermediate transition features, a roof prediction image of the tree occlusion image at the current time step is predicted.

[0098] Specifically, Figure 5 This is one of the structural diagrams of the tree occlusion decomposition model provided by the present invention. The tree occlusion decomposition model includes an encoder, a position decoder and a pixel decoder. Figure 6 This is the second structural diagram of the tree occlusion decomposition model provided by the present invention, such as Figure 5 and Figure 6 As shown in the figure, the tree occlusion decomposition model is based on the network structure of the original diffusion model, which is constructed as a U-shaped structure with a single encoder and a dual decoder (position decoder\pixel decoder). Its purpose is to simulate the sequence data of roof occlusion corresponding to any time i. After obtaining the image features through the four-layer encoder block, the tree occlusion position at the current moment i is predicted from the two decoders after the middle block intermediate transition layer. and original pixels The decoder block has one more block per layer than the encoder block, which is used to receive the feature information of the short connection.

[0099] Encoder Block, Decoder-P Block and Decoder-B Block such as Figure 6 As shown in (a). Their previous structures are the same, but the difference lies in the optimization of the attention structure for the different tasks of the encoder and decoder. The current time step i is temporally embedded and superimposed with the input after group normalization, Swish activation function, and Conv3×3 convolution. After group normalization, Swish activation function, Conv3×3 convolution, and Dropout, it is residually connected with the original input after Conv1×1. The Middle Block is composed of two Encoder Blocks connected together to transfer information between the encoder and decoder. For the Encoder Block part, the most primitive self-attention is used to obtain the most complete overall image features.

[0100] It should be noted that step 122 and step 123 may be executed simultaneously or sequentially, and the execution order of the two is not limited.

[0101] Based on the pixel decoder and intermediate transition features, the roof prediction image of the tree occlusion image at the current time step is predicted, specifically including:

[0102] Step 123-1: Based on the pixel decoder, perform partial random masking on the intermediate transition features to obtain masked features and unmasked features;

[0103] In step 123-2, convolution calculation is performed on the masked features, multi-head self-attention calculation is performed on the unmasked features, and the calculation results are fused to obtain the roof prediction image of the tree-occluded image at the current time step.

[0104] Specifically, if Figure 6 As shown in (b), since the pixel decoder performs raw pixel prediction, most pixels not affected by tree occlusion do not need to be changed. Therefore, a random masking approach is used to reduce computational complexity. First, the input is split along the spatial dimension, then randomly masked by 50%. Only the unmasked 50% undergoes multi-head self-attention, while the masked 50% passes through only the Conv3×3 convolution.

[0105] Based on the position decoder and intermediate transition features, the occlusion position image of the tree occlusion image at the current time step is predicted, specifically including:

[0106] Step 122-1, calculating the attention score of the intermediate transition feature based on the position decoder;

[0107] In step 122-2, the intermediate transition features with attention scores greater than or equal to the preset threshold are subjected to multi-head self-attention calculation, and the intermediate transition features with attention scores less than the preset threshold are subjected to convolution calculation, and the calculation results are fused to obtain the occlusion position image of the tree occlusion image at the current time step.

[0108] Specifically, if Figure 6 As shown in (c), the position decoder actually performs a binary classification task, classifying trees that obstruct the roof as 1 and background as 0. Self-attention is performed only on those parts with high eigenvalues. First, the image is segmented along the spatial dimension and the attention score is calculated for each part. After sorting, the top 50% of the scores are selected for the multi-head self-attention module. The results are then concatenated with the bottom 50% after the 3×3 ConvNet and output.

[0109] Through the above-mentioned attention method, the attention to image features of the corresponding task can be improved and the computational complexity can be reduced to a certain extent.

[0110] The decomposition process of the tree occlusion decomposition model can redefine a random denoising list , satisfying the following formula (13):

[0111]

[0112] Among them, the list elements The value is between 0 and 1, and the sum of all elements is 1. The reason why it does not need to be completely consistent is that the model focuses on the trend of change from occlusion to unocclusion. The change of does not affect this trend, but only controls the change in the pixel value at the location where the tree occlusion occurs in each time step. By gradually removing the tree occlusion noise, the real image B can be restored to Formula (14) and Formula (15):

[0113]

[0114]

[0115] in, and For the simulated image sequence Any The tree occlusion decomposition model consists of a shared image encoder and two feature decoders Decoder-P and Decoder-B, which respectively decode the occlusion position and original pixels Make predictions and get Then, the tree occlusion noise is obtained directly according to the occlusion image to be repaired. The prediction formula (16):

[0116]

[0117] A random time step in the tree occlusion image sequence and the corresponding occlusion image , as input, enters the encoder to obtain the intermediate transition features . Then They will enter the position decoder Decoder-P for feature decoding to predict the occlusion position , that is, get the occlusion position image of the tree occlusion image at the current time step; enter the pixel decoder Decoder-B, the purpose is to decode and generate the real image , get pixel prediction , that is, the roof prediction image of the tree occlusion image at the current time step is obtained. The following formula (17) is shown:

[0118]

[0119] in, Represents the above occlusion decomposition model. In the backward reasoning stage, for a real building roof image X that is blocked by trees, it is equivalent to the last element in the simulated data sequence , that is, the tree occlusion is completely added, then after You will get , as shown in formula (18):

[0120]

[0121] And so on, after step length The image restoration result formula given by the decomposition model can be obtained (19):

[0122]

[0123] Based on the above embodiment, the loss function of the tree occlusion decomposition model is determined based on the positioning loss function, the prediction loss function and the restoration loss function;

[0124] The positioning loss function is determined based on the occlusion position image of the tree occlusion image at the current time step and the sample true occlusion position image. The prediction loss function is determined based on the roof prediction image of the tree occlusion image at the current time step and the sample building roof image. The restoration loss function is determined based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step and the sample building roof image.

[0125] Specifically, the loss function of the tree occlusion decomposition model constructed in the embodiment of the present invention mainly includes the following three parts:

[0126] Trees are widely distributed in remote sensing images, so it is crucial to determine the specific location information of the trees that cause occlusion. Position decoder Decoder-P can predict the positioning information by decoding the input image features. , you can calculate the prediction The L1 norm between the true value P and the positioning loss is calculated as shown in formula (20):

[0127]

[0128] In addition, the pixel decoder Decoder-B attempts to repair the roof of the building under the location and obtains the predicted building image result , you can calculate the prediction The restoration loss is calculated by the root mean square error between the true value B and the true value B, as shown in formula (21):

[0129]

[0130] Although the position decoder Decoder-P and the pixel decoder Decoder-B both obtain image feature information from the same encoder, they are still independent of each other during the decoding process. Therefore, the final output prediction result lacks the relationship between the occlusion position information and the corresponding tree information, building roof information, and background information. and , the predicted repair result is as follows formula (22):

[0131]

[0132] In order to evaluate the consistency between the restoration result and the real situation, the generated restoration image is made visually closer to the real image. The following formula (23) is shown:

[0133]

[0134] In summary, the overall loss function of the occlusion decomposition model is as follows (24):

[0135]

[0136] in , is the weight coefficient used to balance the impact of various losses. , The weights of are set to 1, 2, and 1 respectively. represents the positioning loss function, represents the prediction loss function, represents the repair loss function.

[0137] Based on any of the above embodiments, Figure 7 This is the third flow chart of the method for repairing tree obstruction on the roof of a building provided by the present invention, as shown in FIG. Figure 7 As shown, the present invention is based on the T-step decomposition process of the diffusion denoising idea, starting from an image of the roof of a building to be repaired Gradually remove the occlusion noise until the roof restoration image is obtained . For any time t:

[0138] The unobstructed area does not need to be processed, and its process image can be directly obtained using the forward diffusion noise enhancement method; while the obstructed area starts from the randomly sampled Gaussian noise, and the diffusion conditions provided by the tree occlusion decomposition model are used to control the generation direction to make it correspond to the distribution pattern of the visible area; finally, the two parts are fused and sampled to complete the denoising result of the current step. .

[0139] In some embodiments, determining the tree occlusion restoration change constraints from the current time step to the next time step based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step, and the tree occlusion image of the roof of the building to be restored in step 120 includes:

[0140] Step 124, determining a predicted image of the building roof at the occlusion position based on the occlusion position image of the tree occlusion image at the current time step and the predicted image of the roof of the tree occlusion image at the current time step;

[0141] Step 125 , determining an occlusion image of the building roof at the occlusion position based on the occlusion position image of the tree occlusion image at the current time step and the tree occlusion image of the building roof to be restored;

[0142] Step 126 : Determine the tree occlusion restoration change constraint from the current time step to the next time step based on the difference between the predicted image of the building roof at the occlusion position and the occlusion image of the building roof.

[0143] Specifically, in the sampling process of the diffusion model, since reverse denoising starts from a pure noise image, the step size T is usually very large, the generation process is slow and difficult to control, and it is impossible to accurately repair the occluded roof area. In view of this, the embodiment of the present invention is based on the conditional diffusion model, using the spatial and spectral domain distribution gradient of the pixels at the occluded position as a condition to control the generation process of the diffusion model. According to the gradient variation of the pixels in the occluded area and the characteristics of the roof in the unoccluded area, the occluded roof portion is gradually repaired during the "denoising" process.

[0144] In order to synchronize the decomposition process of the tree occlusion model with the reverse sampling process of the diffusion model, the time steps of the two need to be unified. The subsequent reverse sampling of the diffusion model in this embodiment uses the DDIM method, and the default denoising step size is 20.

[0145] For the task of repairing tree occlusion on building roof, it is simply a process of restoring the tree pixels at the occlusion position to the building roof pixels. Through the tree occlusion decomposition model, we can The prediction of the occluded position is obtained from And the prediction of the real image , which is multiplied with the original image to obtain the prediction of the tree image at the occluded position , that is, multiply the occlusion position image of the tree occlusion image at the current time step by the roof prediction image of the tree occlusion image at the current time step to obtain the building roof prediction image at the occlusion position .Depend on arrive The transformation process is the task process of occlusion repair. According to the principle of the conditional diffusion model, the embodiment of the present invention will and The gradient of the difference between is used as a conditional classifier to control the generation process of the diffusion model and guide the model to transform the pixel style of the repaired area. Therefore, the control condition can be obtained from formula (25): :

[0146]

[0147] in Represents the gradient of the occluded position compared to the entire image. is provided by the tree occlusion decomposition model, and its step size The default value is 5, which means that the inference process of the tree occlusion decomposition model is performed every 4 steps during the inpainting process of T=20 with reverse sampling, passing the control conditions of the inpainting.

[0148] Based on any of the above embodiments, in step 120, a conditional diffusion inpainted image of the current time step is obtained based on the inpainting change constraint, and the conditional diffusion inpainted image is fused and inpainted based on the tree occlusion fusion inpainting sampler to obtain a tree occlusion image of the next time step, including:

[0149] Step 127 , based on the restoration change constraint, obtain a conditional diffusion restoration image of the area occluded by trees at the current time step through a reverse sampling method of conditional control denoising;

[0150] Step 128, obtaining a diffusion image of the area not blocked by trees at the current time step by forward diffusion;

[0151] Step 129 : Based on the tree occlusion fusion restoration sampler, the conditional diffusion restoration image and the diffusion image are combined and then restored by fusion to obtain a tree occlusion image at the next time step.

[0152] Specifically, for any tree-occluded image of a building roof to be restored, the parts outside the occluded position do not need to be processed and should be retained. The intermediate sampled image at any time step t, that is, the diffuse image of the area not blocked by trees at the current time step Formula (26) can be obtained using the following forward diffusion method:

[0153]

[0154] in, Represents the tree occlusion image of the building roof to be repaired, coefficient The value range is (0, 1). The area that needs to be repaired is unknown, so it is necessary to obtain the intermediate image through reverse sampling. , that is, the conditional diffusion repair image of the area blocked by trees at the current time step, according to the repair change constraint Then we can get formula (27):

[0155]

[0156] in, represents the diffusion image at any time t, Represents the control condition, i.e., the repair change constraint. Based on the tree occlusion decomposition model, and The combination gives the conditional repair process image , as shown in formula (28):

[0157]

[0158] in, Represents the prediction of the occlusion position at any time i. It not only contains the visible position information of the roof, but also adds change constraints to the predicted occlusion area to control the generation of the image. As shown in Equation (29), the restoration result of the current time step is obtained through fusion sampling. .

[0159]

[0160] in, Indicates known Down, The posterior probability of , that is, the prediction of the repaired image at the next moment, that is, the tree occlusion image at the next time step.

[0161] The building roof obstruction repair device provided by the present invention is described below. The building roof obstruction repair device described below and the building roof tree obstruction repair method described above can be referenced to each other.

[0162] Figure 8 This is a schematic diagram of the structure of the tree-blocking repair device for a building roof provided by the present invention. Figure 8 As shown, the device includes:

[0163] An image acquisition unit 810 is configured to acquire a tree-occluded image and a Gaussian pure noise image of the roof of the building to be repaired, wherein the tree-occluded image at the first time step is the tree-occluded image of the roof of the building to be repaired;

[0164] The iterative denoising unit 820 is configured to repeatedly perform the following steps until a preset step length is reached: based on a tree occlusion decomposition model, predict an occlusion position image of the tree occlusion image at the current time step and a predicted roof image of the tree occlusion image at the current time step; based on the occlusion position image of the tree occlusion image at the current time step, the predicted roof image of the tree occlusion image at the current time step, and the tree occlusion image of the roof of the building to be repaired, determine a tree occlusion repair change constraint from the current time step to the next time step; based on the repair change constraint, perform conditional control denoising on the Gaussian pure noise image to obtain a conditional diffusion repair image at the current time step, and based on a tree occlusion fusion repair sampler, perform fusion repair on the conditional diffusion repair image to obtain a tree occlusion image at the next time step;

[0165] The image determination unit 830 is configured to use the tree-occluded image at the last time step as the final restored complete building roof image.

[0166] The device provided by the present invention treats the occluded image of a building roof to be restored as a random noise image, gradually removing the noise pixels that occlude the roof, and restoring the original roof image information. Using an occlusion decomposition model, the device learns the characteristic distribution and variation patterns of pixels at the occluded locations during noise removal. After obtaining the target image result for the roof restoration, the device then extracts the final contour.

[0167] Based on any of the above embodiments, the iterative denoising unit is specifically configured to:

[0168] Based on the pixel decoder, performing partial random masking on the intermediate transition features to obtain masked features and unmasked features;

[0169] A convolution calculation is performed on the masked features, a multi-head self-attention calculation is performed on the unmasked features, and the calculation results are fused to obtain a roof prediction image of the tree-occluded image at the current time step.

[0170] Based on any of the above embodiments, the loss function of the tree occlusion decomposition model is determined based on the positioning loss function, the prediction loss function and the restoration loss function;

[0171] The positioning loss function is determined based on the occlusion position image of the tree occlusion image at the current time step and the sample true occlusion position image, the prediction loss function is determined based on the roof prediction image of the tree occlusion image at the current time step and the sample building roof image, and the restoration loss function is determined based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step and the sample building roof image.

[0172] Based on any of the above embodiments, the iterative denoising unit is specifically configured to:

[0173] Determine a predicted image of the building roof at the occlusion position based on the occlusion position image of the tree occlusion image at the current time step and the predicted image of the roof of the tree occlusion image at the current time step;

[0174] Determine an occlusion image of the building roof at the occlusion position based on the occlusion position image of the tree occlusion image at the current time step and the tree occlusion image of the building roof to be restored;

[0175] Based on the difference between the predicted image of the building roof at the occlusion position and the occlusion image of the building roof, a tree occlusion restoration change constraint from the current time step to the next time step is determined.

[0176] Based on any of the above embodiments, the iterative denoising unit is specifically configured to:

[0177] Based on the restoration change constraint, a conditional diffusion restoration image of the area occluded by trees at the current time step is obtained by a reverse sampling method of conditional control denoising;

[0178] The diffusion image of the area not blocked by trees at the current time step is obtained by forward diffusion;

[0179] Based on the tree occlusion fusion restoration sampler, the conditional diffusion restoration image and the diffusion image are combined and then fused and restored to obtain the tree occlusion image of the next time step.

[0180] Figure 9 An example of a physical structure diagram of an electronic device is shown below. Figure 9As shown, the electronic device may include: a processor 910 , a communication interface 920 , a memory 930 and a communication bus 940 , wherein the processor 910 , the communication interface 920 and the memory 930 communicate with each other via the communication bus 940 . The processor 910 can call the logic instructions in the memory 930 to execute a tree occlusion repair method for a building roof, which includes: obtaining a tree occlusion image and a Gaussian pure noise image of the building roof to be repaired, where the tree occlusion image of the first time step is the tree occlusion image of the building roof to be repaired; repeatedly performing the following steps until a preset step length is reached: based on a tree occlusion decomposition model, predicting an occlusion position image of the tree occlusion image at the current time step and a roof prediction image of the tree occlusion image at the current time step; based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step, and the tree occlusion image of the building roof to be repaired, determining a tree occlusion repair change constraint from the current time step to the next time step; based on the repair change constraint, conditionally controlling denoising the Gaussian pure noise image to obtain a conditional diffusion repair image of the current time step, and based on a tree occlusion fusion repair sampler, fusing and repairing the conditional diffusion repair image to obtain a tree occlusion image of the next time step; and using the tree occlusion image of the last time step as the final repaired complete building roof image.

[0181] Furthermore, the logic instructions in the aforementioned memory 930 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0182] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the building roof tree occlusion repair method provided by the above methods, the method comprising: obtaining a tree occlusion image and a Gaussian pure noise image of the building roof to be repaired, the tree occlusion image of the first time step is the tree occlusion image of the building roof to be repaired; repeating the following steps until a preset step length is reached: based on a tree occlusion decomposition model, predicting the occlusion position image of the tree occlusion image at the current time step, the current time step A roof prediction image of the inter-step tree occlusion image; based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step, and the tree occlusion image of the roof of the building to be repaired, the tree occlusion repair change constraint from the current time step to the next time step is determined; based on the repair change constraint, the Gaussian pure noise image is conditionally controlled denoising to obtain the conditional diffusion repair image of the current time step, and based on the tree occlusion fusion repair sampler, the conditional diffusion repair image is fused and repaired to obtain the tree occlusion image of the next time step; the tree occlusion image of the last time step is used as the final repaired complete building roof image.

[0183] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented by a processor to execute the tree occlusion repair method for a building roof provided by the above-mentioned methods, the method comprising: obtaining a tree occlusion image and a Gaussian pure noise image of the building roof to be repaired, wherein the tree occlusion image at the first time step is the tree occlusion image of the building roof to be repaired; repeatedly performing the following steps until a preset step length is reached: based on a tree occlusion decomposition model, predicting an occlusion position image of the tree occlusion image at the current time step, and a roof prediction image of the tree occlusion image at the current time step. ; Based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step, and the tree occlusion image of the roof of the building to be repaired, determine the tree occlusion repair change constraints from the current time step to the next time step; based on the repair change constraints, conditionally control denoising is performed on the Gaussian pure noise image to obtain the conditional diffusion repair image of the current time step, and based on the tree occlusion fusion repair sampler, the conditional diffusion repair image is fused and repaired to obtain the tree occlusion image of the next time step; the tree occlusion image of the last time step is used as the final repaired complete building roof image.

[0184] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0185] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0186] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for repairing tree-blocked rooftops of buildings, characterized in that: include: Obtaining a tree-occluded image and a Gaussian pure noise image of the roof of the building to be repaired, wherein the tree-occluded image at the first time step is the tree-occluded image of the roof of the building to be repaired; Repeat the following steps until a preset step length is reached: based on the tree occlusion decomposition model, predict the occlusion position image of the tree occlusion image at the current time step and the roof prediction image of the tree occlusion image at the current time step; based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step, and the tree occlusion image of the roof of the building to be repaired, determine the tree occlusion repair change constraint from the current time step to the next time step; based on the repair change constraint, conditionally control denoising is performed on the Gaussian pure noise image to obtain the conditional diffusion repair image of the current time step, and based on the tree occlusion fusion repair sampler, the conditional diffusion repair image is fused and repaired to obtain the tree occlusion image of the next time step; The tree occlusion image at the last time step is used as the final restored complete building roof image.

2. The method for repairing tree-blocked rooftops of buildings according to claim 1, characterized in that: The tree occlusion decomposition model includes an encoder, a position decoder, and a pixel decoder. The tree occlusion decomposition model is used to predict an occlusion position image of a tree occlusion image at a current time step and a roof prediction image of the tree occlusion image at a current time step, including: Extracting intermediate transition features of the tree occlusion image at the current time step based on the encoder; Predicting an occlusion position image of the tree occlusion image at the current time step based on the position decoder and the intermediate transition features; Based on the pixel decoder and the intermediate transition features, a roof prediction image of the tree occlusion image at the current time step is predicted.

3. The method for repairing tree obstruction on a building roof according to claim 2, characterized in that: The step of predicting an occlusion position image of the tree occlusion image at the current time step based on the position decoder and the intermediate transition feature includes: Calculating an attention score of the intermediate transition feature based on the position decoder; Multi-head self-attention calculation is performed on the intermediate transition features whose attention scores are greater than or equal to the preset threshold, and convolution calculation is performed on the intermediate transition features whose attention scores are less than the preset threshold. The calculation results are fused to obtain the occlusion position image of the tree occlusion image at the current time step.

4. The method for repairing tree-blocked rooftops of buildings according to claim 2, characterized in that: The step of predicting a roof prediction image of the tree occlusion image at the current time step based on the pixel decoder and the intermediate transition feature includes: Based on the pixel decoder, performing partial random masking on the intermediate transition features to obtain masked features and unmasked features; A convolution calculation is performed on the masked features, a multi-head self-attention calculation is performed on the unmasked features, and the calculation results are fused to obtain a roof prediction image of the tree-occluded image at the current time step.

5. The method for repairing tree-shaded roofs of buildings according to any one of claims 1 to 4, characterized in that: The loss function of the tree occlusion decomposition model is determined based on the positioning loss function, the prediction loss function and the restoration loss function; The positioning loss function is determined based on the occlusion position image of the tree occlusion image at the current time step and the sample true occlusion position image, the prediction loss function is determined based on the roof prediction image of the tree occlusion image at the current time step and the sample building roof image, and the restoration loss function is determined based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step and the sample building roof image.

6. The method for repairing tree-shaded roofs of buildings according to any one of claims 1 to 4, characterized in that: The determining of the tree occlusion restoration change constraint from the current time step to the next time step based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step, and the tree occlusion image of the roof of the building to be restored includes: Determine a predicted image of the building roof at the occlusion position based on the occlusion position image of the tree occlusion image at the current time step and the predicted image of the roof of the tree occlusion image at the current time step; Determine an occlusion image of the building roof at the occlusion position based on the occlusion position image of the tree occlusion image at the current time step and the tree occlusion image of the building roof to be restored; Based on the difference between the predicted image of the building roof at the occlusion position and the occlusion image of the building roof, a tree occlusion restoration change constraint from the current time step to the next time step is determined.

7. The method for repairing tree-shaded roofs of buildings according to any one of claims 1 to 4, characterized in that: The method of obtaining a conditional diffusion restoration image of the current time step based on the restoration change constraint, and performing fusion restoration on the conditional diffusion restoration image based on a tree occlusion fusion restoration sampler to obtain a tree occlusion image of the next time step includes: Based on the restoration change constraint, a conditional diffusion restoration image of the area occluded by trees at the current time step is obtained by a reverse sampling method of conditional control denoising; The diffusion image of the area not blocked by trees at the current time step is obtained by forward diffusion; Based on the tree occlusion fusion restoration sampler, the conditional diffusion restoration image and the diffusion image are combined and then fused and restored to obtain the tree occlusion image at the next time step.

8. A tree-blocking repair device for a building roof, characterized in that: include: An image acquisition unit is used to acquire a tree-blocked image and a Gaussian pure noise image of the roof of the building to be repaired, wherein the tree-blocked image at the first time step is the tree-blocked image of the roof of the building to be repaired; An iterative denoising unit is configured to repeatedly execute the following steps until a preset step length is reached: based on a tree occlusion decomposition model, predict an occlusion position image of the tree occlusion image at the current time step and a roof prediction image of the tree occlusion image at the current time step; based on the occlusion position image of the tree occlusion image at the current time step, the roof prediction image of the tree occlusion image at the current time step, and the tree occlusion image of the roof of the building to be repaired, determine a tree occlusion repair change constraint from the current time step to the next time step; based on the repair change constraint, conditionally control denoising is performed on the Gaussian pure noise image to obtain a conditional diffusion repair image at the current time step, and based on a tree occlusion fusion repair sampler, the conditional diffusion repair image is fused and repaired to obtain a tree occlusion image at the next time step; The image determination unit is used to use the tree occlusion image at the last time step as the final restored complete building roof image.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for repairing tree occlusion on a building roof as described in any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for repairing tree shading on a building roof as claimed in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Remote sensing image building roof contour identification method, device, equipment and medium

    CN116645595A

  • Building model mapping shielding restoration system and method

    CN118229584A