A method and system for automatically generating building facade texture

By combining the deep learning network and the Pix2PixHD network, the problem of facade distortion and poor texture quality in 3D building models captured by drones is solved, and the automatic extraction of window masks and generation of real building facade textures are realized, ensuring It shows the true layout and size of objects on the facade, improving the neatness and authenticity of the three-dimensional model.

CN114117614BActive Publication Date: 2024-08-23WUHAN DASHI SMART TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111459597.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-01
Publication Date
2024-08-23
Estimated Expiration
2041-12-01

AI Technical Summary

Technical Problem

In the existing technology, three-dimensional building models generated using multi-view images taken by drones are prone to problems such as facade distortion and poor texture quality. In particular, it is difficult to keep the location, size and layout information of windows realistic, resulting in three-dimensional models. Does not meet actual scene requirements.

Method used

Using a combination of deep learning network and Pix2PixHD network, by acquiring and preprocessing building facade data, extracting window masks and performing regular processing to ensure the true layout and size information of windows, a building facade that conforms to the actual model is generated. Texture images and map them into 3D models.

Benefits of technology

It realizes the automatic extraction of window masks on building facades, saves manual time, maintains the real position and layout of windows, and generates facade images that meet the size and requirements of the actual model, improving the authenticity and neatness of the three-dimensional model. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114117614B
    Figure CN114117614B
Patent Text Reader

Abstract

The present invention relates to the field of computer vision technology, and in particular to a method and system for automatically generating building facade textures. The present invention uses a deep learning network capable of object recognition to extract windows, and uses a Pix2PixHD network to synthesize building facade textures for synthesizing new building facade wall textures. Finally, according to the obtained window information and its real layout structure, the window is pasted on the synthesized building facade texture image. The present invention uses image generation and window extraction methods to generate real building facade textures, and according to the mask file of the extracted windows, the real layout information and actual size of the windows are maintained, saving the time of manually obtaining the window position and size. The generated building facade maintains the real position and structural layout of the windows on the original facade, ensuring the authenticity of the layout of objects on the facade, and generating a building facade image that is more in line with the size of the facade in the actual model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, to computer vision image generation, three-dimensional city modeling, and digital twin technology, and in particular to a method and system for automatically generating building facade textures based on multi-view image modeling data. Background Art

[0002] The analysis and 3D modeling of real urban scenes are basic problems in computer vision and computer graphics. With the widespread use of 3D urban building models in housing surveys, stereo measurements, and urban planning, the construction of 3D models of buildings has also received great attention. Due to its advantages such as low modeling cost, rich model texture details, short modeling time, and high speed, oblique photography modeling has now developed into a mainstream method for large-scale reconstruction.

[0003] At present, most oblique photography modeling uses the Multi-view Stereo (MVS) method. Its workflow has the following three steps: first, for the aerial images obtained by drones, use the structure from motion (SFM) to obtain the camera parameters and the sparse three-dimensional information of the scene, then use the MVS method for dense matching to obtain a dense three-dimensional point cloud model, and finally use the point cloud through Poisson surface reconstruction and texture mapping to obtain the three-dimensional model of the building. However, there are also some problems with the existing process. For example, distortion occurs when the model is reconstructed; in addition, the texture may also be distorted due to operations such as stretching, cropping, and transformation when mapping, so the texture does not fit well after mapping, giving people a distorted feeling. In addition, when the building is collected by drone images, the number of images collected is insufficient or the building is blocked by vegetation, resulting in distortion and holes in the facade of the obtained three-dimensional building model. Therefore, it is necessary to replace the texture of the building facade.

[0004] For the three-dimensional building models generated by photogrammetry or computer vision methods using multi-view images taken by drones, some facades are distorted and the texture quality is poor. This is especially true for the image texture generation problem. At present, GAN networks are commonly used for image texture synthesis. The building facade image contains not only wall textures, but also objects such as windows. If the windows on the building facade are also imaged, the position, size and layout information of the actual windows on the building facade will be destroyed, which does not meet the requirements of three-dimensional buildings to express real scenes. Summary of the invention

[0005] In order to solve the problem that some building facades in urban three-dimensional modeling are easily distorted and have poor texture quality, which makes it difficult to meet the requirements of three-dimensional building expression of real scenes, the purpose of the embodiments of the present invention is to provide a method and system for automatically generating building facade textures, focusing on the problem of automatic replacement of building facade textures, by replacing distorted and empty building facades, the purpose of completing the building facade is achieved. The buildings after facade replacement can make the buildings in the three-dimensional model look more regular and unified, and the model as a whole looks neater.

[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0007] In a first aspect, in an embodiment provided by the present invention, a method for automatically generating building facade texture is provided, comprising the following steps:

[0008] Obtain the original building facade dataset, and preprocess it to obtain training samples for building facade window extraction;

[0009] Constructing a deep learning network for building facade image recognition, training the deep learning network according to the training samples, and obtaining a building facade window recognition model based on the deep learning network;

[0010] Get the original building facade wall dataset;

[0011] Inputting the original building facade wall dataset into the Pix2PixHD network for parameter fine-tuning and model training to obtain a building facade wall texture image synthesis model based on the Pix2PixHD network;

[0012] Acquire the facade image of the building to be tested, input the building facade window recognition model and the building facade wall texture image synthesis model respectively, and obtain the position information and mask file of the building facade window and the synthesized building facade wall texture image;

[0013] The window mask file is regularized and completed, and the windows are fitted onto the synthesized building facade wall texture image according to the actual layout and size information of the windows in the mask file. The synthesized building facade texture image is mapped to the three-dimensional model of the building through texture mapping.

[0014] In some embodiments provided by the present invention, a method for preprocessing to obtain training samples extracted from building facade windows includes:

[0015] Get the original building facade dataset;

[0016] Annotating and saving window features in the original building facade dataset;

[0017] The saved data is processed with data enhancement to obtain training samples extracted from building facade windows.

[0018] In some embodiments provided by the present invention, the enhancement processing is to perform data enhancement on the annotated and saved original building facade data by using a method of random 90° multiple rotation, horizontal flipping and scaling transformation.

[0019] In some embodiments provided by the present invention, the method for generating a window attached to a synthesized building facade wall texture image includes:

[0020] The acquired facade image of the building to be tested;

[0021] Detecting and locating the windows of the building facade image to be tested by using a building facade window recognition model to obtain a binary file of the building facade windows;

[0022] Perform mask regularization on the acquired window binary file, and use the regularized window mask file;

[0023] Windows of appropriate size and style are obtained from the window database according to the window mask file.

[0024] In some embodiments provided by the present invention, before obtaining the original building facade wall dataset, it also includes: using a generative adversarial network (GAN) to receive a randomly input noise image, generating and outputting a building facade picture, labeled as a real wall texture image, scaling the image pair for data enhancement, and obtaining the original building facade wall dataset.

[0025] In some embodiments provided by the present invention, the generative adversarial network uses the data distribution created by the generative network to fit the real data distribution, uses the discriminative network to input the building facade image, calculates the probability that the input building facade image is a generated or real image, and predicts true or false results.

[0026] In some embodiments provided by the present invention, the deep learning network used for window position and window segmentation in the building facade window recognition model is a Mask-Rcnn network, the Mask-Rcnn network performs window position and window segmentation, the backbone feature extraction network and feature pyramid network of the Mask-Rcnn network perform convolution feature extraction on the input building facade image to fuse the underlying information, the region proposal network generates a proposal window, and the feature windows of each level are fused and pooled to generate a feature map of a fixed size, and the feature map of the fixed size is classified, bounding box regression and window Mask prediction are performed.

[0027] In some embodiments provided by the present invention, the Pix2PixHD network includes a generative network and a discriminative network that compete with each other in GAN network training, and the generative network and the discriminative network jointly learn their respective optimal transition states to achieve Nash distribution; wherein the generative network is used to generate data distribution of the target domain according to input data, and maximize the probability of recognition error of the discriminative network; the discriminative network is used to maximize the discriminative loss, so as to correctly judge the results of the generative network and accurately identify the images generated by the generative network and the label images of the target domain.

[0028] In some embodiments provided by the present invention, the generation network in the Pix2PixHD network includes a global generation network and a local enhancement network; the method for the generation network to improve the resolution of the generated image is:

[0029] The local enhancement network extracts local shallow features of the input image, and downsamples the input image by a factor of 2, and the downsampling result is input into the global generation network;

[0030] The global generation network obtains global features of the image;

[0031] The local features of the local enhancement network and the global features of the global generation network are added pixel by pixel and input into the local enhancement network.

[0032] In some embodiments provided by the present invention, the discriminant network in the Pix2PixHD network is a multi-scale discriminant network, and the multi-scale discriminant network is used for discriminant components of different image scales to form a discriminant network, and the image synthesized by the generation network and the label image are downsampled with different sampling coefficients, and the downsampled label images and synthesized images are given to different discriminant components respectively.

[0033] In the second aspect, in another embodiment provided by the present invention, a system for automatically generating building facade textures is provided, wherein the system for automatically generating building facade textures adopts the aforementioned method for automatically generating building facade textures to paste the extracted windows onto a synthesized building facade texture image; the system for automatically generating building facade textures includes a deep learning network training module, a Pix2PixHD network training module, and a texture image mapping module.

[0034] A deep learning network training module is used to train the deep learning network by extracting training samples from building facade windows, thereby obtaining a building facade window recognition model based on the deep learning network;

[0035] A Pix2PixHD network training module is used to fine-tune the parameters and train the model of the Pix2PixHD network using the original building facade wall dataset to obtain a building facade wall texture image synthesis model based on the Pix2PixHD network; and

[0036] The texture image mapping module is used to input the building facade window recognition model and the building facade wall texture image synthesis model into the building facade image to be tested, obtain the building facade window position information and mask file and the synthesized building facade wall texture image, perform regularization processing on the window mask file and complete the undetected windows, and according to the real layout and size information of the windows in the mask file, fit the windows on the synthesized building facade wall texture image, and map the synthesized building facade texture image to the three-dimensional model of the building through texture mapping.

[0037] The technical solution provided by the present invention has the following beneficial effects:

[0038] The method and system for automatically generating building facade textures of the present invention use image generation and window extraction methods to generate real building facade textures, and maintain the real layout information and actual size of the windows according to the mask file of the extracted windows. Specifically, a deep learning network capable of object recognition is used to extract windows, and a Pix2PixHD network is used to synthesize new building facade wall textures. Finally, the windows are attached to the synthesized building facade texture image according to the obtained window information and its real layout structure.

[0039] The advantages of the present invention are as follows:

[0040] 1. The method and system for automatically generating building facade textures provided by the present invention can automatically extract window masks on the building facade, saving the time of manually obtaining the window position and size.

[0041] 2. The method and system for automatically generating building facade textures provided by the present invention can generate a building facade that maintains the actual position and structural layout of the windows on the original facade, thereby ensuring the authenticity of the layout of objects on the facade.

[0042] 3. The method and system for automatically generating building facade textures provided by the present invention can generate building facade images that conform to the size of the facades in the actual model, and can generate larger images according to the size requirements of the facades in the actual model.

[0043] These and other aspects of the present invention will be more clearly understood in the following description of the embodiments. It should be understood that the above general description and the following detailed description are only exemplary and explanatory and cannot limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the following briefly introduces the drawings required for use in the exemplary embodiments or related technical descriptions. The drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention. In the drawings:

[0045] Figure 1 A flowchart of a method for automatically generating building facade textures provided by an embodiment of the present invention.

[0046] Figure 2 A flowchart of window generation in a method for automatically generating building facade textures provided by an embodiment of the present invention.

[0047] Figure 3 A flowchart of automatic generation of building facade texture in a method for automatic generation of building facade texture provided by an embodiment of the present invention.

[0048] Figure 4 A network structure diagram of a Mask-Rcnn network in a method for automatically generating building facade textures provided in an embodiment of the present invention.

[0049] Figure 5 A schematic diagram of a window mask file extracted in a method for automatically generating building facade textures provided in an embodiment of the present invention.

[0050] Figure 6 A network structure diagram of a GAN network structure in a method for automatically generating building facade textures provided in an embodiment of the present invention.

[0051] Figure 7 A schematic diagram of a Pix2PixHD generation network in a method for automatically generating building facade textures provided in an embodiment of the present invention.

[0052] Figure 8 A schematic diagram of Pix2PixHD discriminant network loss calculation in a method for automatically generating building facade textures provided in an embodiment of the present invention.

[0053] Fig. 9 A system block diagram of a system for automatically generating building facade textures provided by an embodiment of the present invention.

[0054] Fig.10 A schematic diagram of a building facade image input when applying a method for automatically generating building facade texture provided by an embodiment of the present invention.

[0055] Fig.11A schematic diagram of a regularized window mask file when applying a method for automatically generating building facade textures provided by an embodiment of the present invention.

[0056] Fig.12 A method for automatically generating building facade texture provided by an embodiment of the present invention generates a schematic diagram of a building facade result when applied. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0058] In some of the processes described in the specification and claims of the present invention and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0059] The following will be combined with the drawings in the exemplary embodiments of the present invention to clearly and completely describe the technical solutions in the exemplary embodiments of the present invention. Obviously, the exemplary embodiments described are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0060] Currently, GAN networks are commonly used for image texture synthesis. The facade image of a building contains not only wall textures, but also objects such as windows. If images of windows on the facade of a building are also generated, the position, size and layout information of the actual windows on the facade of the building will be destroyed, which does not meet the requirements of three-dimensional buildings to express real scenes.

[0061] To solve the above problems, an embodiment of the present invention provides a method and system for automatically generating building facade texture replacement based on multi-view image modeling data, which uses image generation and window extraction methods to generate real building facade textures, and maintains the real layout information and actual size of the windows based on the mask files of the extracted windows.

[0062] The technical solution of the present invention is further described below with reference to the accompanying drawings and through specific implementation methods.

[0063] See also Figure 1 As shown, Figure 1 A flowchart of a method for automatically generating building facade textures provided by the present invention. An embodiment of the present invention provides a method for automatically generating building facade textures, comprising the following steps:

[0064] S1: Obtain the original building facade dataset and preprocess it to obtain training samples for building facade window extraction.

[0065] In this embodiment, when preparing training samples for extracting building facade windows, a method for preprocessing to obtain training samples for extracting building facade windows includes:

[0066] Get the original building facade dataset;

[0067] Annotating and saving window features in the original building facade dataset;

[0068] The saved data is processed with data enhancement to obtain training samples extracted from building facade windows.

[0069] The enhancement processing is to perform data enhancement on the annotated and saved original building facade data by using a method of random 90° multiple rotation, horizontal flipping and scaling transformation.

[0070] It should be noted that when extracting training samples, first, prepare the building facade dataset, that is, the original building facade dataset, use annotation software to manually annotate the windows, and save the annotation results in Json format. The data is enhanced by random 90° rotation, horizontal flipping and scaling transformation to enhance the network's segmentation and recognition results and the generalization performance of the model.

[0071] S2: Construct a deep learning network for building facade image recognition, train the deep learning network according to the training samples, and obtain a building facade window recognition model based on the deep learning network.

[0072] It should be noted that this embodiment uses the window training data set to fine-tune the parameters and train the model of the deep learning network, tests the trained model, and extracts the location information and mask files of the building facade windows.

[0073] S3: Get the original building facade wall dataset.

[0074] In this embodiment, the input is a noise image, and the label is a real wall texture image. The image pair is scaled and transformed for data enhancement.

[0075] S4: Obtain the facade image of the building to be tested, input the building facade window recognition model and the building facade wall texture image synthesis model respectively, and obtain the location information of the building facade windows and the mask file and the synthesized building facade wall texture image.

[0076] In this embodiment, the Pix2PixHD network is fine-tuned in parameters and trained in a model. After the model is trained, it is tested to obtain a synthesized building facade wall texture image.

[0077] S5: Obtain the facade image of the building to be tested, input the building facade window recognition model and the building facade wall texture image synthesis model respectively, and obtain the location information of the building facade windows and the mask file and the synthesized building facade wall texture image.

[0078] S6: Regularize and complete the window mask file, and according to the actual layout and size information of the windows in the mask file, fit the windows onto the synthesized building facade wall texture image, and map the synthesized building facade texture image into the three-dimensional model of the building through texture mapping.

[0079] The completion operation is to complete the windows that have not been detected.

[0080] By adopting the above-mentioned method for automatically generating building facade textures, the embodiment of the present invention can automatically extract window masks on the building facade, saving the time of manually obtaining the window position and size; the generated building facade maintains the actual position and structural layout of the windows on the original facade, ensuring the authenticity of the object layout on the facade; and can generate a building facade image that conforms to the size of the facade in the actual model, and can generate a larger image according to the size requirements of the facade in the actual model.

[0081] In another embodiment provided by the present invention, a method for automatically generating building facade texture is provided, the method also comprising: using a Mask-RCNN network capable of object recognition to extract windows, synthesizing a new building facade wall texture, using a Pix2PixHD network to synthesize the building facade texture, and finally pasting the window on the synthesized building facade texture image based on the obtained window information and its actual layout structure.

[0082] In this embodiment, see Figure 2 As shown, the window, i.e. the window attached to the synthesized building facade wall texture image, is generated by a method comprising:

[0083] S11, obtaining the facade image of the building to be tested;

[0084] S12, using a building facade window recognition model to detect and locate the windows of the building facade image to be tested, and obtaining a binary file of the building facade windows;

[0085] S13, performing mask regularization on the acquired window binary file, and using the regularized window mask file;

[0086] S14. Obtain a window of suitable size and style from a window database according to the window mask file.

[0087] In this embodiment, the Mask-RCNN network is used as a deep learning network for window position and window segmentation in the building facade window recognition model. The Mask-RCNN network performs window position and window segmentation, and the backbone feature extraction network and feature pyramid network of the Mask-RCNN network perform convolution feature extraction on the input building facade image to fuse the underlying information, generate a suggestion window by the region proposal network, and perform fusion pooling on the feature windows of each level to generate a fixed-size feature map, and perform classification, border regression and window mask prediction on the fixed-size feature map.

[0088] In this embodiment, see Figure 3 As shown in the figure, the workflow for automatic generation of building facade textures is as follows:

[0089] First, the model is adjusted and trained according to the prepared building facade texture dataset, and then the trained model is used to generate a building facade of appropriate size. Next, Mask-Rcnn is used to detect and locate the windows of the original building facade, obtain the binary file of the building facade windows, and mask regularize the obtained window binary file. Using the regularized window mask file, select windows of appropriate size and style from the prepared window database, paste them on the generated building facade, obtain the building facade with a real window layout, and finally map the obtained building facade texture image to the 3D building model.

[0090] In the embodiment of the present invention, the network structure of the Mask-Rcnn network is shown in Figure 4As shown, the present invention uses a Mask-Rcnn network to perform window position and window segmentation. The structure of the Mask-Rcnn network is: using a backbone feature extraction network and a feature pyramid network (FPN) to perform convolutional feature extraction on the input building facade image, and fuse the underlying information, generate a proposal window by a region proposal network (RPN), and perform fusion pooling on the feature windows of each level to generate a fixed-size feature map, and perform classification, border regression and window Mask prediction on the fixed-size feature map.

[0091] It should be noted that in this embodiment, the windows of the acquired building facade dataset are manually annotated using annotation software, and data enhancement is performed using random 90° rotation, horizontal flipping and scaling transformation methods, and then model training is performed. The window mask results extracted in the model testing phase are shown in Figure 2. Figure 5 As shown, Figure 5 Schematic diagram of the extracted window mask file.

[0092] In one embodiment provided by the present invention, the Pix2PixHD network includes a generative network and a discriminative network that compete with each other in GAN network training, and the generative network and the discriminative network jointly learn their respective optimal transition states to achieve Nash distribution; wherein the generative network is used to generate data distribution of the target domain according to input data, and maximize the probability of recognition error of the discriminative network; the discriminative network is used to maximize the discriminative loss, so as to correctly judge the results of the generative network and accurately identify the images generated by the generative network and the label images of the target domain.

[0093] In this embodiment, the generation network in the Pix2PixHD network includes a global generation network and a local enhancement network; the method for the generation network to improve the resolution of the generated image is:

[0094] The local enhancement network extracts local shallow features of the input image, and downsamples the input image by a factor of 2, and the downsampling result is input into the global generation network;

[0095] The global generation network obtains global features of the image;

[0096] The local features of the local enhancement network and the global features of the global generation network are added pixel by pixel and input into the local enhancement network.

[0097] The discriminant network in the Pix2PixHD network is a multi-scale discriminant network. The multi-scale discriminant network is used for discriminant components of different image scales to form a discriminant network. The images synthesized by the generation network and the label images are downsampled with different sampling coefficients respectively. The downsampled label images and synthesized images are given to different discriminant components respectively.

[0098] In this embodiment, see Figure 7 and Figure 8 As shown in the figure, the generator network in the Pix2PixHD network is marked as G and the discriminator network is marked as D. Therefore, G represents the generator network and D represents the discriminator network. The function of the generator network is to generate the data distribution of the target domain based on the input data, that is, to maximize the probability of the discriminator network's recognition error, so that the discriminator network mistakenly believes that the image is a real sample image rather than a generated fake image; the goal of the discriminator network is to maximize the discriminant loss, so as to correctly judge the results of the generator network and accurately identify the images generated by the generator network and the label images of the target domain. The generator network and the discriminator network compete with each other in the GAN network training, and finally the two jointly learn their respective optimal transition states to achieve the Nash distribution.

[0099] In order to improve the resolution of the generated image, Pix2PixHD designed a coarse-to-fine generation network, which includes two sub-networks such as Figure 7 As shown. G1 is the global generation network, G2 is the local enhancement network. The input image first passes through the G2 network to obtain local shallow features, and then the input image is downsampled by 2 times. The downsampling result is input into the G1 network. The G1 network is a complete encoding and decoding network structure that can obtain the global features of the image. Finally, the local features of the G2 network and the global features of the G1 network are added pixel by pixel (Element-wise Add) and input into the G2 network. The G2 network doubles the resolution of the image generated by the G1 network. As for the discriminant network, in order to better produce high-resolution images, Pix2PixHD uses a multi-scale discriminant network, such as Figure 8 As shown in the figure. Three discriminant components with the same network structure but acting on different image scales are used to form a discriminant network. The images synthesized by the generation network and the label images are downsampled with sampling coefficients of 1, 2, and 4 respectively. In this way, the downsampled label images and synthesized images are given to the three discriminant components respectively. The discriminant network corresponding to the image with the smallest resolution will have a larger receptive field and a stronger global sense of image generation. The discriminant network corresponding to the image with the largest resolution will capture richer details.

[0100] In another embodiment provided by the present invention, before obtaining the original building facade wall dataset, it also includes: using a generative adversarial network (GAN) to receive a randomly input noise image, generating and outputting a building facade picture, labeled as a real wall texture image, scaling the image pair for data enhancement, and obtaining the original building facade wall dataset.

[0101] Among them, the generative adversarial network uses the data distribution created by the generative network to fit the real data distribution, uses the discriminative network to input the building facade picture, calculates the probability that the input building facade picture is a generated or real picture, and predicts true or false results.

[0102] In this embodiment, the game process of the Generative adversarial network (GAN) uses the data distribution created by the Generator Network (G) to fit the real data distribution. That is, it is a network that generates building facade images, receives a random noise, generates building facade images and outputs them. The role of the Discriminator Network (D) is to use a building facade image as input, and the discriminator can calculate the probability that the image is a generated or real image. The two update the network in reverse according to the returned results, compete with each other, and finally reach the Nash mean through dynamic changes. The GAN network structure is as follows: Figure 6 shown.

[0103] In this embodiment, based on the superior performance of GAN, the model is gradually applied to various directions in the field of image processing, including image conversion, image restoration, style transfer, image generation, etc. Building facade generation belongs to the use of GAN network to generate pictures. Since the building facade size in the actual model is large, this patent uses Mask-Rcnn network for window position and window segmentation, and Pix2PixHD network framework for high-definition building facade texture generation.

[0104] In summary, the present invention provides a method for automatically generating building facade textures, and the implementation process includes the preparation of building facade texture datasets, model parameter fine-tuning and training, and model testing. The specific implementation process is:

[0105] (1) Create a building facade texture dataset for model training. Since building facade images are relatively large, they cannot be directly input into the network for model training. In addition, if the training dataset is too large, it will consume video memory during training, resulting in slower model training. Therefore, the training data needs to be cropped to an appropriate size. Finally, data enhancement is used to increase the diversity of the dataset, mainly for horizontal rotation and scaling transformation.

[0106] (2) Model parameter fine-tuning and training. Fine-tune the hyperparameters in the model, such as learning rate, number of iterations, batch size, etc., and observe the changes in the training loss and validation loss curves during training. When the training loss curve no longer decreases or the validation set accuracy no longer increases, the model training can be stopped in advance.

[0107] (3) Model testing: The trained model is called for testing, and a noise image is input to obtain a building facade texture image generated by the model.

[0108] (4) Use the Mask-Rcnn network to segment and extract the windows on the original building facade image and obtain their location information, and regularize the window mask file. Then use the regularized window mask file to retrieve the appropriate window from the pre-prepared material library and paste it to the appropriate position of the generated building facade. The generated facade texture result can be fitted to the 3D model through texture mapping.

[0109] The automatic generation method of building facade texture of the present invention adopts image generation and window extraction methods to generate real building facade texture, and maintains the real layout information and actual size of the windows according to the mask file of the extracted windows, thus saving the time of manually obtaining the position and size of the windows. The generated building facade maintains the real position and structural layout of the windows on the original facade, ensures the authenticity of the layout of objects on the facade, and generates a building facade image that is more in line with the facade size in the actual model.

[0110] It should be understood that, although described in a certain order, these steps are not necessarily performed in sequence in the above order. Unless there is clear explanation in this article, the execution of these steps does not have strict order restriction, and these steps can be performed in other orders. Moreover, a part of the steps of the present embodiment may include a plurality of steps or a plurality of stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a part of the steps or stages in other steps or other steps.

[0111] In one embodiment provided by the present invention, Fig. 9 FIG. 2 shows a structural block diagram of a building facade texture automatic generation system provided by an embodiment of the present invention. Fig. 9 As shown, in a preferred embodiment of the present invention, a building facade texture automatic generation system includes a deep learning network training module 100, a Pix2PixHD network training module 200 and a texture image mapping module 300. Wherein:

[0112] The deep learning network training module 100 is used to train the deep learning network by producing building facade window extraction training samples, so as to obtain a building facade window recognition model based on the deep learning network.

[0113] In this embodiment, when preparing training samples for extracting building facade windows, an original building facade data set is obtained, and preprocessing is performed to obtain training samples for extracting building facade windows. During preprocessing, the original building facade data set is obtained; window features in the original building facade data set are marked and saved; and data enhancement processing is performed on the saved data to obtain training samples for extracting building facade windows.

[0114] The enhancement processing is to perform data enhancement on the annotated and saved original building facade data by using a method of random 90° multiple rotation, horizontal flipping and scaling transformation.

[0115] It should be noted that when extracting training samples, first, prepare the building facade dataset, that is, the original building facade dataset, use annotation software to manually annotate the windows, and save the annotation results in Json format. The data is enhanced by random 90° rotation, horizontal flipping and scaling transformation to enhance the network's segmentation and recognition results and the generalization performance of the model.

[0116] When training the deep learning network, the window training data set is used to fine-tune the parameters and train the model of the deep learning network, the trained model is tested, and the location information and mask file of the building facade windows are extracted. In this embodiment, the deep learning network for object recognition can be a Mask-RCNN network.

[0117] In this embodiment, the Mask-RCNN network is used as a deep learning network for window position and window segmentation in the building facade window recognition model. The Mask-RCNN network performs window position and window segmentation, and the backbone feature extraction network and feature pyramid network of the Mask-RCNN network perform convolution feature extraction on the input building facade image to fuse the underlying information, generate a suggestion window by the region proposal network, and perform fusion pooling on the feature windows of each level to generate a fixed-size feature map, and perform classification, border regression and window mask prediction on the fixed-size feature map.

[0118] The Pix2PixHD network training module 200 is used to perform parameter fine-tuning and model training on the Pix2PixHD network using the original building facade wall dataset, so as to obtain a building facade wall texture image synthesis model based on the Pix2PixHD network.

[0119] In this embodiment, when the original building facade wall dataset is obtained, the input is a noise image and the label is a real wall texture image. The image pair is scaled for data enhancement. Then the Pix2PixHD network is fine-tuned and the model is trained. After the model is trained, it is tested to obtain a synthesized building facade wall texture image.

[0120] The Pix2PixHD network includes a generative network and a discriminative network that compete with each other in GAN network training. The generative network and the discriminative network jointly learn their respective optimal transition states to achieve Nash distribution; wherein the generative network is used to generate data distribution of the target domain according to input data, and maximize the probability of recognition errors of the discriminative network; the discriminative network is used to maximize the discriminative loss, so as to correctly judge the results of the generative network and accurately identify the images generated by the generative network and the label images of the target domain.

[0121] In this embodiment, see Figure 7 and Figure 8 As shown in the structure diagram of the Pix2PixHD network, G represents the generator network and D represents the discriminant network. The function of the generator network is to generate the data distribution of the target domain based on the input data, that is, to maximize the probability of the discriminant network's recognition error, so that the discriminant network mistakenly believes that the image is a real sample image rather than a generated fake image; the goal of the discriminant network is to maximize the discriminant loss, so as to correctly judge the results of the generator network and accurately identify the images generated by the generator network and the label images of the target domain. The generator network and the discriminant network compete with each other in the GAN network training, and finally the two jointly learn their respective optimal transition states to achieve the Nash distribution.

[0122] In order to improve the resolution of the generated image, Pix2PixHD designed a coarse-to-fine generation network, which includes two sub-networks such as Figure 7 As shown. G1 is the global generation network, G2 is the local enhancement network. The input image first passes through the G2 network to obtain local shallow features, and then the input image is downsampled by 2 times. The downsampling result is input into the G1 network. The G1 network is a complete encoding and decoding network structure that can obtain the global features of the image. Finally, the local features of the G2 network and the global features of the G1 network are added pixel by pixel (Element-wise Add) and input into the G2 network. The G2 network doubles the resolution of the image generated by the G1 network. As for the discriminant network, in order to better produce high-resolution images, Pix2PixHD uses a multi-scale discriminant network, such as Figure 8As shown in the figure. Three discriminant components with the same network structure but acting on different image scales are used to form a discriminant network. The images synthesized by the generation network and the label images are downsampled with sampling coefficients of 1, 2, and 4 respectively. In this way, the downsampled label images and synthesized images are given to the three discriminant components respectively. The discriminant network corresponding to the image with the smallest resolution will have a larger receptive field and a stronger global sense of image generation. The discriminant network corresponding to the image with the largest resolution will capture richer details.

[0123] The texture image mapping module 300 is used to input the building facade window recognition model and the building facade wall texture image synthesis model into the building facade image to be tested, obtain the building facade window position information and mask file and the synthesized building facade wall texture image, perform regularization processing on the window mask file and complete the undetected windows, and according to the real layout and size information of the windows in the mask file, fit the windows on the synthesized building facade wall texture image, and map the synthesized building facade texture image to the three-dimensional model of the building through texture mapping.

[0124] In this embodiment, the window mask file is regularized and the undetected windows are completed, and the windows are attached to the synthesized building facade wall texture image according to the real layout and size information of the windows in the mask file. Finally, the synthesized building facade texture image is mapped to the three-dimensional model through texture mapping.

[0125] In this embodiment, the automatic building facade texture generation system adopts the steps of the aforementioned automatic building facade texture generation method during execution. Therefore, the operation process of the automatic building facade texture generation system in this embodiment will not be described in detail.

[0126] In summary, the technical solution provided by the present invention has the following advantages:

[0127] 1. The method and system for automatically generating building facade textures provided by the present invention can automatically extract window masks on the building facade, saving the time of manually obtaining the window position and size.

[0128] 2. The method and system for automatically generating building facade textures provided by the present invention can generate a building facade that maintains the actual position and structural layout of the windows on the original facade, thereby ensuring the authenticity of the layout of objects on the facade.

[0129] 3. The method and system for automatically generating building facade textures provided by the present invention can generate building facade images that conform to the size of the facades in the actual model, and can generate larger images according to the size requirements of the facades in the actual model.

[0130] The method and system for automatically generating building facade textures provided by the present invention are fully verified in the following experiments. Fig.10 The input building facade image is used. Since the size and shape of the windows in the mask file extracted by the Mask-Rcnn network are irregular, the regularization algorithm is used to regularize the sizes of all windows. Fig.11 For the extracted window mask file ( Figure 5 The new mask file is regularized in size. Fig.12 The window file retrieved from the prepared window database is then fitted to the generated surface. Fig.10 It can be found that the layout position of the window remains unchanged. Finally, through the texture mapping method, Fig.12 The result is mapped to the three-dimensional model of the building, and the following can be obtained: Fig.10 The building facade texture with concave and convex structure shown.

[0131] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for automatically generating building facade texture, characterized in that: include: Obtain the original building facade dataset, and preprocess it to obtain training samples for building facade window extraction; Constructing a deep learning network for building facade image recognition, training the deep learning network according to the training samples, and obtaining a building facade window recognition model based on the deep learning network; Obtain the original building facade wall dataset; Inputting the original building facade wall dataset into the Pix2PixHD network for parameter fine-tuning and model training to obtain a building facade wall texture image synthesis model based on the Pix2PixHD network; Acquire the facade image of the building to be tested, input the building facade window recognition model and the building facade wall texture image synthesis model respectively, and obtain the position information and mask file of the building facade window and the synthesized building facade wall texture image; The window mask file is regularized and completed, and the windows are fitted onto the synthesized building facade wall texture image according to the actual layout and size information of the windows in the mask file. The synthesized building facade texture image is mapped to the three-dimensional model of the building through texture mapping.

2. The method for automatically generating building facade texture according to claim 1, characterized in that: The method of preprocessing to obtain training samples for building facade window extraction includes: Get the original building facade dataset; Annotating and saving window features in the original building facade dataset; The saved data is processed with data enhancement to obtain training samples extracted from building facade windows.

3. The method for automatically generating building facade texture according to claim 2, characterized in that: The enhancement processing is to perform data enhancement on the annotated and saved original building facade data by using a method of random 90° multiple rotation, horizontal flipping and scaling transformation.

4. The method for automatically generating building facade texture according to claim 1, characterized in that: The method for generating a window attached to a synthesized building facade wall texture image comprises: The acquired facade image of the building to be tested; Detecting and locating the windows of the building facade image to be tested by using a building facade window recognition model to obtain a binary file of the building facade windows; Perform mask regularization on the acquired window binary file, and use the regularized window mask file; Windows of appropriate size and style are obtained from the window database according to the window mask file.

5. The method for automatically generating building facade texture according to claim 1 or 4, characterized in that: The deep learning network used for window position and window segmentation in the building facade window recognition model is the Mask-Rcnn network. The Mask-Rcnn network performs window position and window segmentation. The backbone feature extraction network and feature pyramid network of the Mask-Rcnn network perform convolution feature extraction on the input building facade image to fuse the underlying information. The region proposal network generates a proposal window, and the feature windows of each level are fused and pooled to generate a feature map of a fixed size. The feature map of the fixed size is classified, the border regression and the window Mask prediction are performed.

6. The method for automatically generating building facade texture according to claim 1, characterized in that: Before obtaining the original building facade wall dataset, the method also includes: using a generative adversarial network to receive a randomly input noise image, generating and outputting a building facade image, labeling it as a real wall texture image, performing scaling changes on the image pairs for data enhancement, and obtaining the original building facade wall dataset.

7. The method for automatically generating building facade texture according to claim 6, characterized in that: The Pix2PixHD network includes a generative network and a discriminative network that compete with each other in generative adversarial network training. The generative network and the discriminative network jointly learn their respective optimal transition states to achieve Nash distribution; the generative network is used to generate data distribution of the target domain according to input data, and maximize the probability of recognition errors of the discriminative network; the discriminative network is used to maximize the discriminative loss, so as to correctly judge the results of the generative network and accurately identify the images generated by the generative network and the label images of the target domain.

8. The method for automatically generating building facade texture according to claim 7, characterized in that: The generation network in the Pix2PixHD network includes a global generation network and a local enhancement network; the method for the generation network to improve the resolution of the generated image is: The local enhancement network extracts local shallow features of the input image, and downsamples the input image by a factor of 2, and the downsampling result is input into the global generation network; The global generation network obtains global features of the image; The local features of the local enhancement network and the global features of the global generation network are added pixel by pixel and input into the local enhancement network.

9. The method for automatically generating building facade texture according to claim 7, characterized in that: The discriminant network in the Pix2PixHD network is a multi-scale discriminant network. The multi-scale discriminant network is used for discriminant components of different image scales to form a discriminant network. The images synthesized by the generation network and the label images are downsampled with different sampling coefficients respectively. The downsampled label images and synthesized images are given to different discriminant components respectively.

10. A building facade texture automatic generation system, characterized in that: The automatic building facade texture generation system uses the automatic building facade texture generation method described in any one of claims 1 to 9 to paste the extracted windows on the synthesized building facade texture image; The building facade texture automatic generation system comprises: A deep learning network training module is used to train the deep learning network by extracting training samples from building facade windows, thereby obtaining a building facade window recognition model based on the deep learning network; A Pix2PixHD network training module is used to fine-tune the parameters and train the model of the Pix2PixHD network using the original building facade wall dataset to obtain a building facade wall texture image synthesis model based on the Pix2PixHD network; and The texture image mapping module is used to input the building facade window recognition model and the building facade wall texture image synthesis model into the building facade image to be tested, obtain the building facade window position information and mask file and the synthesized building facade wall texture image, perform regularization processing on the window mask file and complete the undetected windows, and according to the real layout and size information of the windows in the mask file, fit the windows on the synthesized building facade wall texture image, and map the synthesized building facade texture image to the three-dimensional model of the building through texture mapping.