A method for quickly extracting building top elevation based on stereo images
Through image semantic segmentation technology and pyramid network of stereoscopic images, multi-scale features of buildings are extracted, three-dimensional models are constructed and elevation calculations are performed, which solves the problem of difficulty in obtaining detailed features of elevation data on top of buildings in the existing technology, and achieves higher measurement accuracy.
Patent Information
- Application Number
- CN202410253734.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-06
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-03-06
AI Technical Summary
When the existing technology extracts the elevation of the top of a building, it is difficult to accurately obtain the detailed features and boundaries of the building, resulting in low quality elevation data and reliance on other data sources or prior knowledge for assistance and constraints.
Using image semantic segmentation technology based on stereoscopic images, through the pyramid network and Softmax function, the multi-scale feature map of the stereoscopic image is extracted, context coding and adaptive enhancement are performed, a three-dimensional model is constructed, and projection transformation and elevation interpolation calculations are performed to obtain the top of the building. elevation value.
It improves the accuracy of image semantic segmentation, significantly improves the accuracy of elevation measurement on the top of buildings, and can more accurately reflect the detailed features and overall shape of the building.
Smart Images

Figure CN117830646B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of building top elevation extraction, and more specifically, to a method for quickly extracting building top elevation based on stereo images. Background Art
[0002] In the field of urban planning and management, extracting the elevation of building tops is a very important technical link.
[0003] Here, building top elevation refers to the height of the highest point of the building relative to the ground or sea level. There are many uses for extracting building top elevation, such as: evaluating the spatial form and density of the city, as well as the height distribution and changing trend of buildings, analyzing the city's landscape and skyline, and the impact of buildings on visual effects and environmental quality, simulating the city's climate and microclimate, and the impact of buildings on factors such as wind speed, temperature, humidity, and light, or planning urban disaster prevention and emergency response, as well as the resistance and vulnerability of buildings to disasters such as earthquakes, floods, and fires.
[0004] It is a common technical route to quickly extract the elevation of the top of a building based on stereo images. By matching and reconstructing the images, the three-dimensional coordinate information of the top of the building is obtained. However, there are still some technical problems in the specific implementation of this method.
[0005] For example, the top boundary of a building is an important component of building elevation data and an important indicator for evaluating the quality of building elevation data. Since the three-dimensional point cloud data obtained by stereo image reconstruction is usually irregular and sparse, it needs to be smoothed and fitted to extract a clear and accurate top boundary of the building. Secondly, the building top elevation data not only needs to reflect the overall height of the building, but also the detailed features of the building, such as roof shape, slope, skylight, chimney, etc. These detailed features are of great significance for the identification and classification of buildings, and can also enhance the realism and visualization of building elevation data. However, due to the limitations of stereo image resolution, viewing angle, coverage and other factors, it is difficult to directly extract these detailed features from stereo images, and other data sources or prior knowledge are needed for assistance and constraints.
[0006] In other words, we look forward to a more optimized solution for quickly extracting the elevation of building tops based on stereo images. Summary of the invention
[0007] In order to solve the above technical problems, the present invention is proposed.
[0008] According to one aspect of the present invention, a method for quickly extracting the elevation of a building top based on a stereo image is provided, comprising:
[0009] Acquire a stereo image containing a target building;
[0010] Performing image semantic segmentation on the stereo image containing the target building to obtain a segmentation result;
[0011] Constructing a three-dimensional model of the target building according to the segmentation result;
[0012] And performing projection transformation and elevation interpolation calculation on the three-dimensional model of the target building to obtain the elevation value of the top of the target building.
[0013] Compared with the prior art, the present invention provides a method for quickly extracting the top elevation of a building based on a stereo image, which uses image semantic segmentation technology to segment a stereo image containing a target building to construct a three-dimensional model of the target building, and then processes the three-dimensional model through projection transformation and elevation interpolation calculation to obtain the top elevation value of the target building. This can improve the accuracy of image semantic segmentation, make the detailed features of the target building more prominent, and thus improve the accuracy of building top elevation measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The above and other purposes, features and advantages of the present invention will become more apparent by describing the embodiments of the present invention in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments 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 of the present invention. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0015] Figure 1 A flowchart of a method for quickly extracting the elevation of a building top based on a stereo image according to an embodiment of the present invention;
[0016] Figure 2 A system architecture diagram of a method for quickly extracting the elevation of a building top based on a stereo image according to an embodiment of the present invention;
[0017] Figure 3 This is a flowchart of sub-step S2 of a method for quickly extracting the elevation of a building top based on a stereo image according to an embodiment of the present invention;
[0018] Figure 4 This is a flowchart of sub-step S21 of a method for quickly extracting the elevation of a building top based on a stereo image according to an embodiment of the present invention;
[0019] Figure 5 This is a flowchart of sub-step S22 of a method for quickly extracting the elevation of a building top based on a stereo image according to an embodiment of the present invention;
[0020] Figure 6 This is a flowchart of sub-step S221 of a method for quickly extracting the elevation of a building top based on a stereo image according to an embodiment of the present invention;
[0021] Figure 7 This is a flowchart of sub-step S222 of a method for quickly extracting building top elevations based on stereo images according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] Below, the exemplary embodiments of the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described here.
[0023] As shown in the present invention, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular, but also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list, and the method or device may also include other steps or elements.
[0024] Although the present invention has made various references to certain modules in the system according to an embodiment of the present invention, any number of different modules can be used and run on a user terminal and / or server. The modules are only illustrative, and different aspects of the system and method can use different modules.
[0025] The present invention uses a flow chart to illustrate the operations performed by the system according to an embodiment of the present invention. It should be understood that the preceding or following operations are not necessarily performed precisely in order. On the contrary, various steps may be processed in reverse order or simultaneously as required. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.
[0026] After research, it is found that the technical problems in the above background technology can be transformed into the technical problems of how to improve the semantic segmentation accuracy of the target building. Those skilled in the art should know that image semantic segmentation refers to segmenting different entity objects in an image, and if the accuracy of image semantic segmentation can be improved, the detailed features of the target building can be made more prominent, thereby improving the accuracy of the building top elevation measurement.
[0027] Following this technical route and technical concept, the present invention proposes a method for quickly extracting the elevation of the top of a building based on a stereo image, which includes the steps of: first, obtaining a stereo image containing a target building; then, performing image semantic segmentation on the stereo image containing the target building to obtain a segmentation result; then, based on the segmentation result, constructing a three-dimensional model of the target building; finally, performing projection transformation and elevation interpolation calculation on the three-dimensional model of the target building to obtain the elevation value of the top of the target building.
[0028] In the above technical solution, the key lies in improving the accuracy of image semantic segmentation, that is, how to optimize the step of "performing image semantic segmentation on the stereo image containing the target building to obtain a segmentation result".
[0029] In the technical solution of the present invention, a method for quickly extracting the elevation of a building top based on a stereo image is proposed. Figure 1 The present invention is a flowchart of a method for rapidly extracting the elevation of a building top based on a stereo image according to an embodiment of the present invention. Figure 2 This is a system architecture diagram of a method for quickly extracting the elevation of a building top based on a stereo image according to an embodiment of the present invention. Figure 1 and Figure 2 As shown, a method for quickly extracting the elevation of the top of a building based on a stereo image according to an embodiment of the present invention includes the steps of: S1, obtaining a stereo image containing a target building; S2, performing image semantic segmentation on the stereo image containing the target building to obtain a segmentation result; S3, constructing a three-dimensional model of the target building according to the segmentation result; and, S4, performing projection transformation and elevation interpolation calculation on the three-dimensional model of the target building to obtain the elevation value of the top of the target building.
[0030] In particular, the S1, obtains a stereo image containing the target building. It should be understood that obtaining the stereo image containing the target building can improve the accuracy of building top elevation extraction and semantic segmentation. Stereo image refers to image data with depth information obtained by using sensors with multiple perspectives. Compared with traditional single-perspective images, stereo images can provide more geometric and depth information, which helps to accurately extract the shape, elevation and semantic information of the building. In other words, by obtaining a stereo image containing the target building, image data of the building at different perspectives can be obtained, thereby capturing the characteristics of the building more comprehensively. Stereo images can provide three-dimensional geometric information of the building, including details such as the building's height, shape, facade and roof. This information is very important for building top elevation extraction and semantic segmentation, and can help the algorithm to more accurately identify and segment the top area of the building.
[0031] In particular, the step S2 performs image semantic segmentation on the stereo image containing the target building to obtain a segmentation result. In particular, in a specific example of the present invention, Figure 3 As shown, the S2 includes: S21, extracting image semantic features from the stereo image containing the target building; S22, passing the image semantic features through a stereo image semantic segmentor based on a Softmax function to obtain the segmentation result.
[0032] Specifically, the step S21 extracts the image semantic features from the stereo image containing the target building. In particular, in a specific example of the present invention, Figure 4 As shown, the S21 includes: S211, passing the stereoscopic image containing the target building through an image feature extractor based on a pyramid network to obtain a shallow feature map of the stereoscopic image content, a middle feature map of the stereoscopic image content and a deep feature map of the stereoscopic image content; and, S212, using a feature pass-through layer to fuse the shallow feature map of the stereoscopic image content, the middle feature map of the stereoscopic image content and the deep feature map of the stereoscopic image content to obtain a multi-scale feature map of the stereoscopic image content as the image semantic feature.
[0033] More specifically, in S211, the stereo image containing the target building is passed through an image feature extractor based on a pyramid network to obtain a shallow feature map of the stereo image content, a middle feature map of the stereo image content, and a deep feature map of the stereo image content. That is, the stereo image containing the target building is passed through an image feature extractor based on a pyramid network to obtain a shallow feature map of the stereo image content, a middle feature map of the stereo image content, and a deep feature map of the stereo image content. Here, the stereo image containing the target building can be passed through an image feature extractor based on a pyramid network to obtain feature maps of different levels, including shallow, middle, and deep feature maps. This is to capture the feature information of the building from different perspectives and levels, and to improve the accuracy of the elevation extraction and semantic segmentation of the top of the building. It is worth mentioning that feature maps of different levels have different semantic information and receptive field sizes. Shallow feature maps usually have higher resolution and local detail information, which are suitable for capturing subtle features of buildings. The middle feature map has a medium receptive field size and can capture some overall shapes and structural features of the building. The deep feature map has a larger receptive field size and can capture a wider range of contextual information, which is helpful for understanding the overall layout and semantic information of the building. By using the image feature extractor of the pyramid network, these feature maps at different levels can be obtained simultaneously. The purpose of this is to comprehensively utilize the feature information at different levels to improve the accuracy of building top elevation extraction and semantic segmentation. By fusing shallow, medium and deep feature maps, the overall shape and contextual information of the building can be fully considered while retaining the details, providing richer feature representation for subsequent feature processing and segmentation steps.
[0034] Pyramid Network is a deep neural network architecture designed to process multi-scale information and multi-scale features. It introduces multiple parallel branches or sub-networks into the network, each branch focusing on inputs or features of different scales to capture details and semantic information at different levels. The advantage of pyramid network is that it can process multi-scale information, thereby improving the model's perception of objects of different scales. It is widely used in computer vision tasks such as object detection, semantic segmentation, image classification, etc. to improve the performance and robustness of the model.
[0035] More specifically, in S212, the feature direct layer is used to fuse the shallow feature map of the stereoscopic image content, the middle feature map of the stereoscopic image content, and the deep feature map of the stereoscopic image content to obtain a multi-scale feature map of the stereoscopic image content as the image semantic feature. That is, the feature direct layer is used to fuse the shallow feature map of the stereoscopic image content, the middle feature map of the stereoscopic image content, and the deep feature map of the stereoscopic image content to obtain a multi-scale feature map of the stereoscopic image content. The use of the feature direct layer to fuse the shallow feature map, the middle feature map, and the deep feature map of the stereoscopic image content is to obtain a multi-scale feature map of the stereoscopic image content. The purpose of doing so is to make full use of feature information at different levels, thereby improving the accuracy of building top elevation extraction and semantic segmentation. As described above, feature maps at different levels have different receptive field sizes and semantic information. Shallow feature maps usually have higher resolution and detail information, while deep feature maps have larger receptive fields and more abstract semantic information. The middle feature map is between the two, with a medium receptive field size and semantic information. By using a feature pass-through layer, these feature maps at different levels can be fused weighted by position. Weighted fusion allows feature maps at different levels to maintain their respective characteristics after fusion while complementing each other. In this way, a multi-scale feature map can be obtained, which contains rich detail information, overall shape information, and contextual information. In a specific example of the present invention, a feature pass-through layer is used to fuse the shallow feature map of the stereoscopic image content, the middle feature map of the stereoscopic image content, and the deep feature map of the stereoscopic image content using the following formula to obtain the multi-scale feature map of the stereoscopic image content; wherein the formula is: ,in, represents a shallow feature map of the stereoscopic image content, represents a mid-level feature map of the stereoscopic image content, represents the deep feature map of the stereoscopic image content, represents a multi-scale feature map of the stereoscopic image content, , and respectively represent weighting parameters of the shallow feature map of the stereoscopic image content, the middle feature map of the stereoscopic image content, and the deep feature map of the stereoscopic image content, Represents positional addition.
[0036] It is worth mentioning that in other specific examples of the present invention, the image semantic features in the stereo image containing the target building can also be extracted by other means, for example: collecting a stereo image data set containing the target building and preprocessing it; selecting a model architecture suitable for the image semantic feature extraction task, such as a convolutional neural network or a pre-trained convolutional neural network model; inputting the stereo image into the model, and calculating the output of the model through forward propagation. In a convolutional neural network, features are usually extracted on the feature map before the last convolution layer of the model. These feature maps contain the semantic information of the image at different levels of abstraction; to represent the extracted features, you can choose to flatten the feature map into a one-dimensional vector, or reduce the feature map to a fixed-length vector through a pooling operation.
[0037] Specifically, the S22 is to pass the image semantic features through a stereo image semantic segmenter based on a Softmax function to obtain the segmentation result. In particular, in a specific example of the present invention, Figure 5 As shown, the S22 includes: S221, context encoding and adaptively enhancing the stereoscopic image content multi-scale feature map to obtain the adaptively enhanced stereoscopic image content multi-scale feature map; and, S222, passing the adaptively enhanced stereoscopic image content multi-scale feature map through the Softmax function-based stereo image semantic segmentor to obtain the segmentation result.
[0038] More specifically, the S221 performs context encoding and adaptive enhancement on the stereoscopic image content multi-scale feature map to obtain the adaptive enhanced stereoscopic image content multi-scale feature map. In particular, in a specific example of the present invention, Figure 6 As shown, the S221 includes: S2211, passing the multi-scale feature map of the stereoscopic image content through a context encoder based on a pyramid pooling module to obtain a multi-scale feature map of the stereoscopic image content enhanced by semantic association; and, S2212, passing the multi-scale feature map of the stereoscopic image content enhanced by semantic association through a local feature adaptive filter based on an adaptive attention layer to obtain the adaptive enhanced multi-scale feature map of the stereoscopic image content.
[0039] In the S2211, the multi-scale feature map of the stereoscopic image content is passed through a context encoder based on a pyramid pooling module to obtain a multi-scale feature map of the stereoscopic image content with semantic association enhancement. That is, the multi-scale feature map of the stereoscopic image content is passed through a context encoder based on a pyramid pooling module to obtain a multi-scale feature map of the stereoscopic image content with semantic association enhancement. Here, in view of the problem that the network is continuously deepened during the feature extraction process, resulting in a certain deviation in the actual network receptive field, making the network unable to effectively fuse global features and lose feature information, the CSPNet structural idea is introduced into the CSP_PPM pooling network composed of the pyramid pooling module (PPM), and added to the end of the backbone network. The aggregation strategy is adopted to apply the average pooling windows of four different scales of 1×1, 2×2, 3×3, and 6×6 to the incoming high-level semantic information, so as to realize the mapping of rich high-level information to low-level features, and the 4 feature maps after pooling are compressed by 1×1 convolution, and the feature integration and jump connection channels of the 3×3 convolution layer are cascaded and fused with the feature maps that have not been pooled. Finally, the feature map that aggregates the effective contextual information of each area is passed to the bottleneck layer of the backbone network. While the network is deepened, shallow detail information and high-level semantic information are aggregated to enhance the representation ability of weak occluded targets without performance loss. Here, the multi-scale feature map enhanced by semantic association can better capture the semantic information and contextual relationship of the top of the building, which helps to accurately identify and segment the top area of the building. This is very important for the elevation extraction and semantic segmentation tasks of the building, and can improve the accuracy and robustness of the algorithm. In a specific example of the present invention, the S2211 includes: passing the stereoscopic image content multi-scale feature map through the first pooling layer, the second pooling layer, the third pooling layer and the fourth pooling layer of the context encoder based on the pyramid pooling module to obtain a first-scale pooling stereoscopic image content multi-scale feature map, a second-scale pooling stereoscopic image content multi-scale feature map, a third-scale pooling stereoscopic image content multi-scale feature map and a fourth-scale pooling stereoscopic image content multi-scale feature map; fusing the first-scale pooling stereoscopic image content multi-scale feature map, the second-scale pooling stereoscopic image content multi-scale feature map, the third-scale pooling stereoscopic image content multi-scale feature map and the fourth-scale pooling stereoscopic image content multi-scale feature map to obtain a multi-scale pooling stereoscopic image content multi-scale feature map; and, using the residual idea to fuse the stereoscopic image content multi-scale feature map and the multi-scale pooling stereoscopic image content multi-scale feature map to obtain the semantic association enhanced stereoscopic image content multi-scale feature map. It is worth mentioning that the average pooling windows of the first pooling layer, the second pooling layer, the third pooling layer and the fourth pooling layer are 1×1, 2×2, 3×3 and 6×6.
[0040] The S2212 is to pass the semantically associated enhanced stereoscopic image content multi-scale feature map through a local feature adaptive filter based on an adaptive attention layer to obtain the adaptively enhanced stereoscopic image content multi-scale feature map. That is, the semantically associated enhanced stereoscopic image content multi-scale feature map is passed through a local feature adaptive filter based on an adaptive attention layer to obtain an adaptively enhanced stereoscopic image content multi-scale feature map. Passing the multi-scale feature map of the stereoscopic image content with enhanced semantic association through a local feature adaptive filter based on an adaptive attention layer is to further enhance the expressive power of the features, focus attention on the most relevant features, and enhance the performance of building top elevation extraction and semantic segmentation. Specifically, the adaptive attention layer can dynamically adjust the weight distribution of the features according to the content and contextual information of the feature map. It can learn the relationship between the features and adaptively select and enhance the most relevant features according to the task requirements. Through the adaptive attention layer, the most discriminative and important features can be screened out in the multi-scale feature map, thereby improving the accuracy of feature representation and semantic segmentation of the top of the building. In a specific example of the present invention, the S2212 includes: processing the semantically associated enhanced stereoscopic image content multi-scale feature map through the local feature adaptive filter based on the adaptive attention layer with the following adaptive local enhancement formula to obtain the adaptively enhanced stereoscopic image content multi-scale feature map; wherein the adaptive local enhancement formula is:
[0041] ;
[0042] ;
[0043] ;
[0044]
[0045] in, is the multi-scale feature map of the semantically associated enhanced stereoscopic image content, Indicates that global mean pooling is performed on each feature matrix along the channel dimension in the feature map. is the channel feature vector of the multi-scale feature map of the semantic association enhanced stereoscopic image content, and are the weights and biases of the convolutional layer, is an activation function and the activation function can adopt the existing technology, is the convolution feature vector of the channel feature vector, is the eigenvalue of each position in the convolution feature vector, is the weight vector, It is the point multiplication by position. It is the multi-scale feature map of the adaptively enhanced stereoscopic image content.
[0046] It is worth mentioning that in other specific examples of the present invention, the stereoscopic image content multi-scale feature map can also be context encoded and adaptively enhanced in other ways to obtain the adaptively enhanced stereoscopic image content multi-scale feature map, for example: obtaining a content multi-scale feature map of a stereoscopic image; for the feature map of each scale, context encoding is performed to enhance the semantic information of the feature; for the feature map after context encoding, adaptive enhancement is performed to further improve the representation capability of the feature; after context encoding and adaptive enhancement, an adaptively enhanced stereoscopic image content multi-scale feature map is obtained.
[0047] More specifically, in S222, the adaptive enhanced stereoscopic image content multi-scale feature map is passed through the stereoscopic image semantic segmenter based on the Softmax function to obtain the segmentation result. In particular, in a specific example of the present invention, Figure 7 As shown, the S222 includes: S2221, performing overall enhancement of feature distribution on the adaptive enhanced stereoscopic image content multi-scale feature map to obtain an enhanced adaptive enhanced stereoscopic image content multi-scale feature map; and S2222, inputting the enhanced adaptive enhanced stereoscopic image content multi-scale feature map into the Softmax function-based stereoscopic image semantic segmentor to obtain the segmentation result.
[0048] The S2221 is to enhance the overall feature distribution of the adaptive enhanced stereoscopic image content multi-scale feature map to obtain an enhanced adaptive enhanced stereoscopic image content multi-scale feature map. It should be understood that in the above technical solution, the stereoscopic image content multi-scale feature map expresses the shallow, middle and deep three-dimensional image semantic features of the fusion of the stereoscopic image containing the target building. In this way, after the stereoscopic image content multi-scale feature map passes through the context encoder based on the pyramid pooling module and the local feature adaptive filter based on the adaptive attention layer, the spatial distribution of the image semantic features in the feature matrix will be enhanced based on the local spatial distribution context of the pyramid pooling scale, and the local channel distribution of the adaptive attention based on the overall feature distribution of the feature matrix will be enhanced in units of feature matrices, thereby affecting the distribution integrity between the various feature matrices of the adaptive enhanced stereoscopic image content multi-scale feature map. Based on this, each feature matrix in the adaptive enhanced stereoscopic image content multi-scale feature map is first converted into a square matrix through a linear transformation, and then the adaptive enhanced stereoscopic image content multi-scale feature map is optimized by taking the feature matrix as a unit through constraints based on adjacent feature matrices, which is specifically expressed as:
[0049] ;
[0050] in and They are the first and feature matrix, and and They are the feature matrices and The global mean of represents matrix multiplication, It means point multiplication by position. is the first Here, by taking the center of the distribution of the feature matrix of the adaptive enhanced stereoscopic image content multi-scale feature map along the channel as the seed point of the scene transfer in the channel dimension, each eigenvalue of the feature matrix of the adaptive enhanced stereoscopic image content multi-scale feature map is robustly aggregated and sub-sampled by matrix multiplication, so that the distribution bounding box transfer directional constraints of adjacent feature matrices are performed on the basis of the participation of each eigenvalue of the feature matrix of the adaptive enhanced stereoscopic image content multi-scale feature map, so as to improve the integrity of the feature representation of the adaptive enhanced stereoscopic image content multi-scale feature map on the basis of the overall bottom-up contextual association of the adaptive enhanced stereoscopic image content multi-scale feature map along the channel dimension, thereby improving the accuracy of the segmentation result of the adaptive enhanced stereoscopic image content multi-scale feature map obtained by the stereo image semantic segmentor based on the Softmax function.
[0051] The S2222, inputs the enhanced adaptive enhanced stereoscopic image content multi-scale feature map into the stereoscopic image semantic segmenter based on the Softmax function to obtain the segmentation result. That is, in the technical solution of the present invention, the multi-scale feature map of the adaptive enhanced stereoscopic image content can obtain the segmentation result through the stereoscopic image semantic segmenter based on the Softmax function. The purpose of this step is to classify each pixel in the feature map as a building or a non-building, thereby realizing the semantic segmentation of the top of the building. It should be known to those of ordinary skill in the art that the Softmax function is a commonly used classification function, which can map the probability distribution of multiple categories to a probability value between 0 and 1, and ensure that the sum of the probabilities of all categories is 1. In the stereoscopic image semantic segmentation task, the Softmax function can map the feature vector of each pixel to the corresponding category probability distribution. Through the stereoscopic image semantic segmenter based on the Softmax function, each pixel can be classified using the adaptive enhanced multi-scale feature map. The segmenter processes the features of each pixel and maps it to the probability of a building and a non-building through the Softmax function. According to the threshold setting of the probability, the pixel with a probability higher than the threshold can be judged as a building, thereby obtaining the segmentation result of the top of the building.
[0052] It is worth mentioning that in other specific examples of the present invention, the adaptively enhanced stereoscopic image content multi-scale feature map can also be passed through the stereoscopic image semantic segmenter based on the Softmax function to obtain the segmentation result in other ways, for example: prepare a stereoscopic image data set with annotations; select a segmenter model suitable for the stereoscopic image semantic segmentation task; input the adaptively enhanced stereoscopic image content multi-scale feature map into the segmenter model, and calculate the output of the model through forward propagation. In the encoder part, image features are gradually extracted and abstracted to capture semantic information at different levels; in the decoder part of the segmenter model, the features extracted by the encoder are upsampled and fused to restore the resolution and generate the segmentation result; in the last layer of the decoder, the Softmax function is applied; according to the output of the Softmax function, the semantic category with the highest probability is selected as the predicted label for each pixel.
[0053] It is worth mentioning that in other specific examples of the present invention, the image semantic features can also be passed through a stereo image semantic segmenter based on a Softmax function in other ways to obtain the segmentation result, for example: prepare a stereo image dataset with annotations, which contains input images and corresponding pixel-level labels. The label specifies the semantic category to which each pixel in the image belongs; select a segmenter model suitable for the image semantic segmentation task, such as U-Net, DeepLab, MaskR-CNN, etc.; input the input image into the segmenter model, and calculate the output of the model through forward propagation. In the encoder part, image features are gradually extracted and abstracted to capture semantic information at different levels; in the decoder part of the segmenter model, the features extracted by the encoder are upsampled and fused to restore the resolution and generate the segmentation result; in the last layer of the decoder, the Softmax function is applied. The Softmax function converts the feature vector of each pixel into a probability distribution, indicating the probability that the pixel belongs to each semantic category; according to the output of the Softmax function, the semantic category with the highest probability is selected as the predicted label of each pixel to obtain the segmentation result, in which each pixel is assigned to the corresponding semantic category.
[0054] It is worth mentioning that in other specific examples of the present invention, the stereo image containing the target building can also be subjected to image semantic segmentation in other ways to obtain the segmentation result, for example: a stereo image data set containing the target building is collected and preprocessed. Preprocessing includes operations such as image format conversion, size adjustment, data enhancement, etc. to ensure the consistency and availability of the data; select a model architecture suitable for the image semantic segmentation task, such as U-Net, FCN (full convolution network), DeepLab, etc.; divide the prepared data set into a training set and a validation set. The training set is used for model training and parameter optimization, and the validation set is used to evaluate the performance of the model and adjust hyperparameters; the stereo images in the training set are annotated at the pixel level, that is, each pixel is assigned a corresponding category label; and the model is trained using the training set. The stereo image of the training set is input, the output segmentation result is calculated by forward propagation, and then compared with the annotated data, the loss function is calculated, and the parameters of the model are updated by back propagation; the performance of the trained model is evaluated using the validation set. The stereo image of the validation set is input into the model to obtain the segmentation result, which is compared with the annotated data of the validation set, and the evaluation index is calculated to evaluate the performance of the model; the trained model is used to predict the new stereo image.
[0055] In particular, the S3 constructs a three-dimensional model of the target building according to the segmentation result. It should be understood that the three-dimensional model can provide an intuitive visual reference of the building. By observing the model, the shape, structure and details of the building can be more clearly understood, including the roof form, protrusions, depressions and other features of the building. This makes it possible to more accurately determine the location and reference of the measurement point when measuring the elevation of the top of the building.
[0056] In particular, the S4 performs projection transformation and elevation interpolation calculation on the three-dimensional model of the target building to obtain the elevation value of the top of the target building. It is worth mentioning that the elevation value of the top of the target building can be obtained through projection transformation and elevation interpolation calculation. This is very important for elevation measurement and analysis, and can provide accurate elevation information of the top of the building, including the height of the roof, elevation change, etc. Among them, the elevation value of the top of the target building can be obtained by projection transformation and elevation interpolation calculation, and the relevant existing technology can be directly used.
[0057] In summary, the method for quickly extracting the top elevation of a building based on a stereo image according to an embodiment of the present invention is explained, which uses image semantic segmentation technology to segment a stereo image containing a target building to construct a three-dimensional model of the target building, and then processes the three-dimensional model through projection transformation and elevation interpolation calculation to obtain the elevation value of the top of the target building. In this way, the accuracy of image semantic segmentation can be improved, making the detailed features of the target building more prominent, thereby improving the accuracy of the building top elevation measurement.
[0058] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for quickly extracting the elevation of a building top based on a stereo image, characterized in that: include: Acquire a stereo image containing a target building; Performing image semantic segmentation on the stereo image containing the target building to obtain a segmentation result; Constructing a three-dimensional model of the target building according to the segmentation result; as well as Performing projection transformation and elevation interpolation calculation on the three-dimensional model of the target building to obtain the elevation value of the top of the target building; Performing image semantic segmentation on the stereo image containing the target building to obtain a segmentation result, including: Extracting image semantic features from the stereo image containing the target building; Passing the image semantic features through a stereo image semantic segmentor based on a Softmax function to obtain the segmentation result; Extracting image semantic features from the stereo image containing the target building includes: Passing the stereoscopic image containing the target building through an image feature extractor based on a pyramid network to obtain a shallow feature map of the stereoscopic image content, a middle feature map of the stereoscopic image content, and a deep feature map of the stereoscopic image content; and Using a feature pass-through layer to fuse the shallow feature map of the stereoscopic image content, the middle feature map of the stereoscopic image content, and the deep feature map of the stereoscopic image content to obtain a multi-scale feature map of the stereoscopic image content as the image semantic feature; The image semantic features are passed through a stereo image semantic segmenter based on a Softmax function to obtain the segmentation result, including: Performing context encoding and adaptive enhancement on the stereoscopic image content multi-scale feature map to obtain an adaptive enhanced stereoscopic image content multi-scale feature map; and Passing the adaptive enhanced stereoscopic image content multi-scale feature map through a stereoscopic image semantic segmentor based on a Softmax function to obtain the segmentation result; The method of passing the adaptive enhanced stereoscopic image content multi-scale feature map through the stereoscopic image semantic segmentor based on the Softmax function to obtain the segmentation result includes: The feature distribution of the adaptive enhanced stereoscopic image content multi-scale feature map is enhanced as a whole to obtain an enhanced adaptive enhanced stereoscopic image content multi-scale feature map, specifically: each feature matrix in the adaptive enhanced stereoscopic image content multi-scale feature map is converted into a square matrix through a linear transformation, and then the adaptive enhanced stereoscopic image content multi-scale feature map is optimized by taking the feature matrix as a unit through constraints based on adjacent feature matrices, which is specifically expressed as: ; in and They are the first and feature matrix, and and They are the feature matrices and The global mean of represents matrix multiplication, It means point multiplication by position. is the first feature matrix; and inputting the enhanced adaptive enhanced stereoscopic image content multi-scale feature map into a stereoscopic image semantic segmentor based on a Softmax function to obtain the segmentation result; The center of the feature matrix of the adaptive enhanced stereoscopic image content multi-scale feature map along the channel distribution is used as the seed point of the scene transfer in the channel dimension, each eigenvalue of the feature matrix of the adaptive enhanced stereoscopic image content multi-scale feature map is robustly aggregated and sub-sampled by matrix multiplication, and the distribution bounding box transfer directional constraints of adjacent feature matrices are performed on the basis of the participation of each eigenvalue of the feature matrix of the adaptive enhanced stereoscopic image content multi-scale feature map, so as to improve the integrity of the feature representation of the adaptive enhanced stereoscopic image content multi-scale feature map on the basis of the overall bottom-up contextual association of the adaptive enhanced stereoscopic image content multi-scale feature map along the channel dimension, so as to improve the accuracy of the segmentation result obtained by the adaptive enhanced stereoscopic image content multi-scale feature map through the stereo image semantic segmentor based on the Softmax function; Among them, using a feature through layer to fuse the shallow feature map of the stereoscopic image content, the middle feature map of the stereoscopic image content, and the deep feature map of the stereoscopic image content to obtain a multi-scale feature map of the stereoscopic image content as the image semantic feature, including: using a feature through layer to fuse the shallow feature map of the stereoscopic image content, the middle feature map of the stereoscopic image content, and the deep feature map of the stereoscopic image content with the following formula to obtain the multi-scale feature map of the stereoscopic image content; Wherein, the formula is: ; in represents a shallow feature map of the stereoscopic image content, represents a mid-level feature map of the stereoscopic image content, represents a deep feature map of the stereoscopic image content, represents a multi-scale feature map of the stereoscopic image content, and represent weighting parameters of the shallow feature map of the stereoscopic image content, the middle feature map of the stereoscopic image content, and the deep feature map of the stereoscopic image content, respectively, Represents positional addition.
2. The method for rapidly extracting the elevation of a building top based on a stereo image according to claim 1, characterized in that: Context encoding and adaptively enhancing the stereoscopic image content multi-scale feature map to obtain an adaptively enhanced stereoscopic image content multi-scale feature map, including: Passing the stereoscopic image content multi-scale feature map through a context encoder based on a pyramid pooling module to obtain a semantically associated enhanced stereoscopic image content multi-scale feature map; and The semantically associated enhanced stereoscopic image content multi-scale feature map is passed through a local feature adaptive filter based on an adaptive attention layer to obtain the adaptively enhanced stereoscopic image content multi-scale feature map.
3. The method for rapidly extracting the elevation of a building top based on a stereo image according to claim 2, characterized in that: The multi-scale feature map of the stereoscopic image content is passed through a context encoder based on a pyramid pooling module to obtain a multi-scale feature map of the stereoscopic image content with enhanced semantic association, including: Passing the stereoscopic image content multi-scale feature map through the first pooling layer, the second pooling layer, the third pooling layer and the fourth pooling layer of the context encoder based on the pyramid pooling module to obtain a first-scale pooled stereoscopic image content multi-scale feature map, a second-scale pooled stereoscopic image content multi-scale feature map, a third-scale pooled stereoscopic image content multi-scale feature map and a fourth-scale pooled stereoscopic image content multi-scale feature map; The first-scale pooled stereoscopic image content multi-scale feature map, the second-scale pooled stereoscopic image content multi-scale feature map, the third-scale pooled stereoscopic image content multi-scale feature map and the fourth-scale pooled stereoscopic image content multi-scale feature map are fused to obtain a multi-scale pooled stereoscopic image content multi-scale feature map; and the stereoscopic image content multi-scale feature map and the multi-scale pooled stereoscopic image content multi-scale feature map are fused using the residual idea to obtain the semantic association enhanced stereoscopic image content multi-scale feature map.
4. The method for rapidly extracting the elevation of the top of a building based on stereoscopic images according to claim 3 is characterized in that: The average pooling windows of the first pooling layer, the second pooling layer, the third pooling layer and the fourth pooling layer are 1×1, 2×2, 3×3 and 6×6.
5. The method for rapidly extracting the elevation of the top of a building based on stereoscopic images according to claim 4 is characterized in that: The method comprises: processing the semantically associated enhanced stereoscopic image content multi-scale feature map through a local feature adaptive filter based on an adaptive attention layer with the following adaptive local enhancement formula to obtain the adaptively enhanced stereoscopic image content multi-scale feature map; Wherein, the adaptive local enhancement formula is: ; ; ; ; in, is the multi-scale feature map of the semantically associated enhanced stereoscopic image content, Indicates that global mean pooling is performed on each feature matrix along the channel dimension in the feature map. is the channel feature vector of the multi-scale feature map of the semantic association enhanced stereoscopic image content, and are the weights and biases of the convolutional layer, is the activation function, is the convolution feature vector of the channel feature vector, is the eigenvalue of each position in the convolution feature vector, is the weight vector, It is the point multiplication by position. It is the multi-scale feature map of the adaptively enhanced stereoscopic image content.
Citation Information
Patent Citations
Method for automatically extracting height of building based on stereoscopic satellite image
CN106871864A
Intelligent fault diagnosis method based on multi-task feature sharing neural network
CN110361176A
Unmanned rolling machine operation scene sensing system and method based on airborne vision
CN111444891A
Semantic image segmentation method and system based on edge enhancement
CN111462126A
Three-dimensional building fine geometric reconstruction method integrating airborne and vehicle-mounted three-dimensional laser point clouds and streetscape images
CN111815776A
