A spatial filtering method for post-classification processing of remote sensing images that takes into account environmental similarity
By introducing environmental variable feature information into the post-processing of remote sensing image classification, an environment-adaptive spatial filter is constructed, which solves the problems of remote sensing image classification accuracy and detail preservation that have not been addressed in existing technologies, and achieves more efficient image smoothing and accuracy improvement.
Patent Information
- Application Number
- CN202510304133.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-03-14
AI Technical Summary
Existing post-processing methods for remote sensing image classification struggle to balance the preservation of image details and classification accuracy when eliminating the "salt and pepper effect," especially in high-resolution images where edge information is easily lost, and they lack mechanisms to incorporate environmental variables.
By introducing environmental variable feature information, the initial classification results and potential environmental variables are preprocessed, a unique value combination partitioning layer of environmental feature encoding is constructed, an environmental similarity adaptive spatial filter is dynamically constructed, and fine-tuning is performed for each pixel.
It significantly improves the accuracy and quality of remote sensing image classification, effectively eliminates the "salt and pepper effect," and better preserves the details of scattered and linear features, especially improving classification accuracy in complex terrain and variable environments.
Smart Images

Figure CN120219967B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital image processing and remote sensing classification technology, and in particular relates to a spatial filtering method for post-classification processing of remote sensing images that takes into account environmental similarities. Background Technology
[0002] With the development of geospatial information technology, remote sensing imagery has become the most important data source for land use and vegetation cover mapping. However, due to factors such as noise interference, limitations of classification algorithms, and the complexity of the land surface itself, the initial classification products obtained from remote sensing imagery often exhibit severe noise. Although improvements can be made through advancements in remote sensing technology and classification algorithms to eliminate the "salt and pepper effect" in remote sensing classification to some extent, these improvements are often costly. Furthermore, hardware technology advancements have long development cycles, making breakthroughs difficult to achieve in the short term. Therefore, post-classification processing techniques have become the primary means of improving the effectiveness of remote sensing mapping.
[0003] Currently, post-classification processing algorithms are mainly based on the "majority voting" rule, with the classic method being spatial sliding window filtering using the mode as the statistical measure. With the support of spatial convolution operations, this method corrects the classification result of the current pixel based on the majority classification result within a specific local window, centering on the current pixel. In traditional spatial filtering techniques, the size of the convolution kernel determines the final post-classification processing effect. Using a smaller convolution kernel, while preserving more detail, often results in a less smooth image and insufficient elimination of the "salt and pepper effect." Conversely, using a larger convolution kernel, while effectively suppressing the "salt and pepper effect," often leads to lower accuracy and can easily cause the loss of image details such as scattered and linear features. Using a Gaussian kernel function for weight allocation, assigning more weight to pixels near the center and less weight to pixels farther from the center, can achieve a smoother filtering effect while preserving smaller features, but may cause blurring of land cover edges. This is especially problematic in high-resolution images, potentially resulting in the loss of some edge information. In addition, anisotropic filtering can preserve linear features to a certain extent, but this method relies on prior information such as the orientation of linear features, which itself may need to be extracted through remote sensing data analysis, resulting in significant uncertainty.
[0004] In summary, existing spatial filtering methods can eliminate the "salt and pepper effect" to some extent, thus effectively improving image smoothness. However, they cannot well preserve scattered and linear features, and classification accuracy is not guaranteed. This is because these methods do not directly aim to improve classification accuracy; instead, they rely on the preliminary classification results themselves and use majority voting to eliminate the "salt and pepper effect." Furthermore, the lack of a mechanism to incorporate third-party environmental variables limits their ability to apply more information. Therefore, this invention proposes a spatial filtering method for post-classification processing of remote sensing images that takes into account environmental similarity. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention proposes a spatial filtering method for post-processing remote sensing images that takes into account environmental similarities, thereby resolving the issues present in the prior art.
[0006] To achieve the above objectives, the present invention provides a spatial filtering method for post-classification processing of remote sensing images that takes into account environmental similarity, comprising:
[0007] S1. Preprocess the initial classification results and potential environmental variable layers of the remote sensing image to obtain a preprocessed layer set, and construct an output raster data layer based on the preprocessed layer set. The preprocessed layer set includes: the preprocessed initial classification result layer and the preprocessed environmental variable layer.
[0008] S2. Reclassify the preprocessed environmental variable layer and construct a unique value combination partition layer of environmental feature encoding by spatial overlay;
[0009] S3. Based on the preprocessed initial classification result layer and the application requirements of remote sensing image classification, determine the initial spatial filter;
[0010] S4. Based on the initial spatial filter and the unique value combination partitioning layer of the environmental feature encoding, dynamically construct an environmental similarity adaptive spatial filter for the current processed pixel in the preprocessed initial classification result layer;
[0011] S5. The environmental similarity adaptive spatial filter is used to perform low-pass filtering on the current processing pixel to obtain the filtering result, and the filtering result is written into the corresponding position of the output raster data layer to obtain the classification post-processing result of the current processing pixel considering environmental similarity.
[0012] S6. Traverse the other pixels of the preprocessed initial classification result layer and repeat S4-S5 to obtain the complete post-classification image.
[0013] Optionally, preprocessing operations on the initial classification results of remote sensing images and the potential environmental variable layer include: projection coordinate system consistency transformation, spatial resolution normalization, and spatial range registration.
[0014] Optionally, the initial spatial filter employs a mode filtering mechanism.
[0015] Optionally, the process of dynamically constructing an adaptive spatial filter for environmental similarity of the current processing pixel includes:
[0016] The neighborhood window is determined based on the template size of the initial spatial filter, with the currently processed pixel as the center.
[0017] Based on the unique values of the environmental feature encoding, the partition layer extracts all pixels within the neighborhood window to construct a neighborhood environmental feature encoding matrix;
[0018] Each element in the neighborhood environment feature encoding matrix is compared with the environment feature encoding of the current processing pixel to generate the environment similarity discrimination matrix of the current processing pixel;
[0019] The environmental similarity adaptive spatial filter for the current processed pixel is constructed based on the initial spatial filter and the environmental similarity discrimination matrix.
[0020] Optionally, the template matrix calculation expression for the environment similarity adaptive spatial filter of the currently processed pixel is:
[0021] F E =F I ⊙S E
[0022] In the formula, ⊙ is the Hadamard product operator; F I S E and F E These represent the initial spatial filter template matrix, the environment similarity discrimination matrix, and the environment similarity adaptive spatial filter template matrix, respectively.
[0023] Optionally, the process of classifying and processing the current pixels using an environment-similar adaptive spatial filter includes:
[0024] The neighborhood window is determined based on the template size of the initial spatial filter, with the currently processed pixel as the center.
[0025] Based on the preprocessed initial classification result layer, extract all pixels within the neighborhood window to construct the neighborhood initial classification result matrix;
[0026] Based on the environmental similarity adaptive spatial filter, the mode is determined by weighted frequency statistics of each element in the unique value set of the initial neighborhood classification result matrix;
[0027] The mode is written to the corresponding position in the output raster data layer to achieve post-processing of the currently processed pixel, taking into account environmental similarities.
[0028] Optionally, the expression for calculating the frequency of each element in the unique value set of the initial neighborhood classification result matrix based on the environmental similarity adaptive spatial filter is as follows:
[0029]
[0030] In the formula, v∈V represents any value within the unique value set V of the initial classification result matrix of the neighborhood, f(v) is the frequency of v, NW is the neighborhood window, and (i,j)∈NW represents the position index of the element belonging to the neighborhood window. E R represents the template matrix of the environment-similar adaptive spatial filter. I This represents the initial classification result matrix of the neighborhood. This is an indicator function.
[0031] Optionally, the potential environment variable layer includes:
[0032] Topographic factors: such as elevation, slope, and aspect;
[0033] Vegetation characteristics: NDVI, leaf area index;
[0034] Soil parameters: type, moisture content, organic matter content;
[0035] Climate elements: temperature and precipitation.
[0036] Compared with the prior art, the present invention has the following advantages and technical effects:
[0037] This invention proposes a spatial filtering method for post-processing remote sensing image classification that takes into account environmental similarity. By innovatively introducing environmental variable feature information, it significantly improves the accuracy and quality of remote sensing image classification. Traditional spatial filtering methods often struggle to preserve image details while eliminating the "salt and pepper effect," and their classification accuracy is limited. This invention, however, performs consistency processing on the initial classification results and potential environmental variable layers during the preprocessing stage, ensuring data accuracy and matching. By generating a unique combination of environmental feature codes and partitioned layers through reclassification and spatial overlay, it provides an environmental similarity basis for the dynamic construction of filters. Based on this, combined with the initial spatial filter, an adaptive spatial filter for environmental similarity is constructed for each pixel, achieving fine-tuning of post-processing. This technique not only effectively eliminates the "salt and pepper effect" but also significantly improves classification accuracy, especially in complex terrain and variable environmental conditions, better preserving detailed information such as scattered and linear features. Experimental results show that compared with traditional methods, the classification accuracy of this invention is significantly improved, providing an efficient and accurate new method for post-processing of remote sensing image classification, with broad application prospects and significant practical importance. Attached Figure Description
[0038] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0039] Figure 1This is a flowchart of a spatial filtering method for post-processing remote sensing images that takes into account environmental similarities, according to an embodiment of the present invention.
[0040] Figure 2 This is a schematic diagram of actual land use types in Embodiment 1 of the present invention;
[0041] Figure 3 This is a schematic diagram of the reclassification result layer of the potential environmental variable layer and the combination partition layer of the unique values of environmental feature codes in Embodiment 1 of the present invention. In this diagram, (a) shows the reclassification result corresponding to the terrain, (b) shows the reclassification result corresponding to the vegetation, and (c) shows the partition layer of the unique values of environmental feature codes.
[0042] Figure 4 This is a schematic diagram of the initial classification results of remote sensing images in Embodiment 1 of the present invention;
[0043] Figure 5 This is a schematic diagram of the post-processing image for classification according to Embodiment 1 of the present invention, wherein Figure (a) shows 3 × The effect of traditional mode filtering in a 3-window window is shown in Figure (b). × Figure (c) shows the traditional mode filtering effect in a 5-window configuration, while Figure (d) shows the filtering effect of the present invention in a 3×3 window configuration. × 5. Filtering effect of this invention in window 5.
[0044] Figure 6 Figure (a) shows the comparison curves of the second embodiment of the present invention. Figure (b) shows the comparison curves of the overall accuracy under different filtering windows (radii from 1 to 19 pixels) and the comparison curves of the Kappa coefficients. Detailed Implementation
[0045] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0046] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0047] Example 1:
[0048] The purpose of this invention is to provide a spatial filtering method for post-classification processing of remote sensing images that takes into account environmental similarities. This method can significantly improve classification accuracy while eliminating the "salt and pepper effect" in the initial classification of remote sensing images and achieving overall smoothness.
[0049] This invention, based on the traditional mode filtering algorithm based on a spatial sliding window, introduces environmental variables such as topography and vegetation that have an impact on or indicate land use classification. It limits the classification from two dimensions: spatial proximity and similar environmental characteristics, providing a new strategy for adjusting the categories of remote sensing classification. This improves classification accuracy while achieving overall smoothness of the classification results.
[0050] like Figure 1 As shown, this embodiment provides a spatial filtering method for post-classification processing of remote sensing images that takes into account environmental similarity, including the following steps:
[0051] Step 1: Spatial registration preprocessing is performed on the initial classification results and potential environmental variable layers of the remote sensing image to generate a preprocessed layer set with consistent map parameters. Based on the map parameters of the preprocessed layer set, an output raster data layer with initial null values is constructed. The preprocessed layer set includes: the preprocessed initial classification result layer and the preprocessed environmental variable layer.
[0052] The initial classification result of remote sensing images is a raster data layer obtained by manipulating remote sensing image processing software (such as ENVI, ArcGIS, etc.), where each cell represents a specific category, such as river, cultivated land, forest, etc. The initial classification result is the data preparation for post-processing spatial filtering techniques. Simultaneously, to ensure the accuracy of subsequent analysis, consistency checks and corrections need to be performed on the initial classification result and the potential environmental variable layer, including: projection coordinate system consistency transformation, spatial resolution normalization, and spatial extent registration.
[0053] In the initial state, the output raster data layer R o The map parameters are the same as the preprocessed layer set, but the raster values are empty, so the filtering results need to be written to the corresponding location.
[0054] The data construction in this embodiment is based on the following scenario:
[0055] A river flows through a valley formed by two small mountain ranges, creating a small island downstream. Based on this, we can infer the land use and surface topography features of this scenario, such as... Figure 2 and Figure 3 As shown in (a), firstly, the confluence of river channels forms a continuous river surface, constituting the main water feature of the scene; secondly, under the scouring action of the river, gentle slopes and low-lying areas are formed around the river channel, and the banks of the river surface are usually developed into farmland, while small river islands are often used as woodlands due to inconvenient transportation; finally, the hillsides on both sides, due to their relatively steep terrain, are mostly covered with woodlands. Furthermore, in terms of vegetation cover, the vegetation cover of both woodlands and farmland is higher than that of the river surface, forming a specific spatial distribution characteristic, namely, woodlands and farmland > river surface, as shown in (a). Figure 3 As shown in (b).
[0056] In this embodiment, the initial classification results mainly include three types: rivers, cultivated land, and forest land, with pixel values of 1, 2, and 3, respectively. Figure 4 As shown.
[0057] Step 2: Reclassify the preprocessed potential environmental variable layer to generate the corresponding reclassification layer, and construct a unique value combination partition layer for environmental feature encoding by spatial overlay.
[0058] The preprocessed latent environmental variable layer refers to third-party environmental variables, such as topography, vegetation, and soil type, that can influence or indicate the classification results. Incorporating this latent environmental variable layer into the post-classification processing allows for full utilization of environmental feature information, effectively improving classification accuracy.
[0059] The unique value combination partitioning layer of environmental feature coding assigns a unique code to each partition by spatially overlaying the reclassification results of different environmental variables, in order to describe the spatial distribution pattern of environmental variables.
[0060] In this embodiment, topography and vegetation are selected as environmental variables, and the corresponding reclassification results are as follows: Figure 3 (a) and Figure 3 As shown in (b). In the topography layer, pixels with values of 1 and 2 represent different slope levels, with a value of 1 indicating a low and flat slope and a value of 2 indicating a steep slope; in the vegetation layer, pixels with values of 1 and 2 represent areas with no vegetation cover and areas with vegetation cover, respectively. Figure 3 (c) represents the unique combination of environmental feature codes in the partition layer.
[0061] Step 3: Based on the characteristics of the initial classification results after preprocessing and the application scenario requirements of remote sensing image classification, determine the type of initial spatial filter and its template parameters for post-classification processing.
[0062] Mode filtering is a commonly used post-processing technique for classification, suitable for eliminating the "salt and pepper effect" in remote sensing image classification results. In this embodiment, mode filtering is used for post-processing: the template weight matrix adopts an equal-weight mode, and the template size is set to a 3×3 and a 5×5 square, respectively. It should be noted that the template size of the mode filter can be set with reference to the spatial resolution of the image, the size of the minimum recognizable ground feature, and the complexity of the ground feature boundaries, in order to effectively eliminate noise.
[0063] Step 4: For the currently processed pixel in the preprocessed initial classification result layer, dynamically construct an adaptive spatial filter for environment similarity based on the initial spatial filter and the unique value of the environment feature encoding, forming a partition layer. The specific process includes:
[0064] Step 4.1: Centered on the currently processed pixel, apply the initial spatial filter template matrix F I The size determines the neighborhood window NW;
[0065] Step 4.2: Extract all pixels within the neighborhood window NW based on the unique value combination of environmental feature encoding of the partition layer, and construct the neighborhood environmental feature encoding matrix C. E ;
[0066] Step 4.3: Compare the neighborhood environment feature encoding matrix C one by one. E Each element is compared with the environmental feature code c of the currently processed pixel to generate the environmental similarity discrimination matrix S of the currently processed pixel. E Its mathematical expression is as follows:
[0067] S E =[s(i,j)] m×n (1)
[0068] in,
[0069]
[0070] Here, m and n are the initial spatial filter template matrices F, respectively. I The number of rows and columns, (i,j) are the position indices of the matrix elements, i = 0, 1, 2, ..., m-1, j = 0, 1, 2, ..., n-1.
[0071] Step 4.4: Construct an adaptive spatial filter for environment similarity for the current pixel based on the initial spatial filter and the environment similarity discrimination matrix. The expression for calculating the template matrix of the adaptive spatial filter for environment similarity is:
[0072] F E =F I ⊙S E (3)
[0073] In the formula, ⊙ is the Hadamard product operator; F I S E and F E These represent the initial spatial filter template matrix, the environment similarity discrimination matrix, and the environment similarity adaptive spatial filter template matrix, respectively.
[0074] In this embodiment, the row and column coordinates (8, 17) are used as the position of the current processed cell. First, a neighborhood window NW with side lengths of 3 pixels and 5 pixels is determined with the current processed cell as the center. (3,3) and NW (5,5) Secondly, based on the unique values of environmental feature encoding, the partition layers are combined, and the neighborhood window (NW) is extracted respectively. (3,3) and NW (5,5)For all pixels within the coverage area, construct the neighborhood environment feature encoding matrix C for the currently processed pixel. E,(3,3) and C E,(5,5) Next, the neighborhood environmental feature encoding matrix C is compared one by one. E,(3,3) and C E,(5,5) The elements of each pixel and the environmental feature encoding c = "12" of the currently processed pixel are used to generate the environmental similarity discrimination matrix of the currently processed pixel as follows: In this matrix, "0" indicates that the element in the neighborhood environment feature encoding matrix is different from the environment feature encoding of the currently processed pixel, meaning that the corresponding neighborhood pixel and the currently processed pixel do not belong to the same unique value combination partition. "1" indicates that the neighborhood pixel and the currently processed pixel have the same environment feature encoding and belong to the same unique value combination partition. Finally, an adaptive spatial filter for environment similarity of the currently processed pixel is constructed based on the initial spatial filter and the environment similarity discrimination matrix. The adaptive spatial filter matrix F is shown below. E,(3,3) and F E,(5,5) The initial spatial filter template matrix F can be calculated separately. I Similarity discrimination matrix C with environment E,(3,3) and C E,(5,5) The Hadamardi is obtained.
[0075] Step 5: Use an environment similarity adaptive spatial filter to perform low-pass filtering on the current processing cell to obtain the filtering result, and write the filtering result to the corresponding position of the output raster data layer, thereby obtaining the classification post-processing result of the current processing cell that takes into account environment similarity.
[0076] The process of classifying and processing the current pixels using an environment-similar adaptive spatial filter includes:
[0077] Step 5.1: Centered on the currently processed pixel, apply the initial spatial filter template matrix F I The size determines the neighborhood window NW;
[0078] Step 5.2: Extract all pixels within the neighborhood window NW based on the preprocessed initial classification result layer, and construct the neighborhood initial classification result matrix R. I .
[0079] Step 5.3: Adaptive Spatial Filter Template Matrix F Based on Environmental Similarity E The initial classification result matrix R of the neighborhood I We perform weighted frequency counting on each element in the unique value set V to determine the mode, which is the element with the highest weighted frequency in set V. The expression for calculating the weighted frequency is:
[0080]
[0081] Where v∈V is any value in the unique value set V of the initial classification result matrix of the neighborhood, f(v) is the frequency of v, NW is the neighborhood window, and (i,j)∈NW represents the position index of the element belonging to the neighborhood window. As an indicator function, when R I The value is 1 when (i,j)=v is true; otherwise it is 0.
[0082] The mode m can be expressed by the following formula:
[0083]
[0084] Here, arg max represents "the parameter value that makes the function or expression reach its maximum value".
[0085] Step 5.4: Write the obtained mode m into the corresponding position of the output raster data layer to realize the post-processing of the current processed pixel considering the similar environment.
[0086] In this embodiment, the initial neighborhood classification result matrices for the current pixel with row and column coordinates (8, 17) are as follows: The corresponding sets of unique values are: V (3,3) =[1,2,3], V (5,5) =[1,2,3]. Based on the corresponding environment similarity adaptive spatial filter template matrix F E,(3,3) and F E,(5,5) The set V can be calculated. (3,3) and V (5,5) The frequencies of all elements are shown in Tables 1 and 2 below.
[0087] Table 1
[0088]
[0089] Table 2
[0090]
[0091] The element with the highest weighted frequency is used as the filter output, i.e., m. (3,3) =2,m (5,5) =2, respectively write the corresponding output raster data layer row and column coordinates of the (8,17) pixel position as the new category label, realize the classification post-processing of the current processed pixel considering the similar environment.
[0092] Step 6: Traverse the other pixels in the preprocessed initial classification result raster image, repeat the operations of Step 4 and Step 5, and finally obtain the complete post-classification image.
[0093] The complete post-processed image obtained in this embodiment is as follows: Figure 5As shown. Figure 5 The results of similarity environment feature spatial filtering and traditional mode filtering based on 3×3 and 5×5 square local sliding windows are presented in tabular form. Compared with the initial classification accuracy, such as Figure 4 As shown, the initial classification accuracy was 76.25%. Spatial filtering, as a key post-processing technique, effectively eliminated salt-and-pepper noise while improving classification accuracy. Smaller windows can effectively remove local noise but may not smooth classification boundaries in larger areas; larger windows, on the other hand, can better smooth classification results, especially in larger homogeneous regions. Furthermore, similar environment feature spatial filtering has higher classification accuracy than traditional mode filtering, as detailed in Table 3. This indicates that similar environment feature spatial filtering, in the post-processing of remote sensing image classification, can not only effectively eliminate the "salt-and-pepper effect" but also improve classification accuracy while preserving image details. This technique provides an effective tool for post-processing of remote sensing image classification, especially under complex terrain and variable environmental conditions, significantly improving the quality of classification results.
[0094] Table 3
[0095]
[0096] Example 2:
[0097] To further verify the effectiveness and innovation of the spatial filtering method for remote sensing image classification that takes into account environmental similarity proposed in this invention, this embodiment selects remote sensing imagery of a region in Shanxi Province as experimental data. The image spatial resolution is 3 meters, and the size is 227×218 pixels. Based on real surface data, land cover categories are divided into five typical land use types: built-up land, cultivated land, water area, dense forest, and sparse forest. The results of supervised classification using ENVI 5.6 software show that the initial classification imagery has significant salt-and-pepper noise, which seriously affects the reliability and application value of the classification results.
[0098] In this embodiment, Normalized Difference Vegetation Index (NDVI) and land evenness are selected as environmental feature variables and preprocessed through spatial registration to ensure they have the same map parameters as the initial classification image. Then, ArcGIS Pro software is used to reclassify NDVI and land evenness into high and low levels, respectively. NDVI is discretized into high vegetation cover areas and low vegetation cover areas, and land evenness is discretized into high evenness areas and low evenness areas. Finally, spatial overlay analysis is used to generate a unique combination of environmental feature codes for a zoning layer.
[0099] To verify the robustness of the method of the present invention, this embodiment uses a circular filtering window with a radius from 1 to 19. The initial classification results are filtered using both traditional mode filtering and the method of the present invention. At the same time, the actual land surface type is also filtered using the method of the present invention, and this is used as a reference. Figure 6 (a) and Figure 6 (b) visually demonstrates the comparison of overall classification accuracy and Kappa coefficients for the true class, initial classification, traditional method filtering results, and the method of this invention under different filtering windows. Figure 6 As can be seen, the overall accuracy of the true land cover types consistently remains above 0.9, and the Kappa coefficient also remains above 0.85, demonstrating the reliability of the true land cover type labels. Due to the influence of salt-and-pepper noise, the overall accuracy and Kappa coefficient of the supervised classification results are relatively low, at 0.8904 and 0.8231, respectively. With the increase of the filtering window radius, the method of this invention consistently maintains higher classification accuracy and Kappa coefficient than traditional methods, demonstrating its superior noise resistance and detail preservation. In contrast, traditional filtering methods suffer from detail loss due to excessive smoothing, resulting in a continuous downward trend in overall accuracy and Kappa coefficient, while the method of this invention maintains a relatively stable level. When the window radius is 11, the method of this invention achieves the best filtering effect, with its overall accuracy increasing to 0.9108, a 5.2% improvement compared to the 0.8587 of the traditional classification results. In summary, this embodiment fully demonstrates the significant advantages of the method of this invention in terms of noise resistance and detail preservation, while traditional methods struggle to achieve both simultaneously.
[0100] This invention proposes a spatial filtering method for post-classification processing of remote sensing images that takes into account environmental similarity. Based on the traditional sliding window spatial domain mode filtering algorithm, it innovatively introduces environmental variables such as terrain and vegetation that influence or indicate the classification results of remote sensing images. By constructing environmental feature combination partitions, the sample range for post-classification category adjustment is limited to a local set of pixels with consistent environmental feature combinations. This invention improves upon the limitations of existing methods that rely solely on neighborhood structure, effectively preserving details of scattered and linear features while eliminating the "salt and pepper effect," thus improving classification accuracy. It represents a novel spatial domain filtering method.
[0101] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A spatial filtering method for post-processing of remote sensing image classification taking into account environmental similarities, characterized in that, The method comprises the following steps: S1, preprocessing remote sensing image initial classification results and potential environmental variable layers to obtain a set of preprocessed layers, and constructing an output raster data layer based on the set of preprocessed layers, wherein the set of preprocessed layers comprises a preprocessed initial classification result layer and a preprocessed environmental variable layer; S2, reclassifying the preprocessed environmental variable layer and constructing an environmental feature code unique value combination zoning layer through spatial superposition; S3, determining an initial spatial filter based on the preprocessed initial classification result layer and application requirements of remote sensing image classification; S4, dynamically constructing an environmental similar adaptive spatial filter of a current processing pixel in the preprocessed initial classification result layer based on the initial spatial filter and the environmental feature code unique value combination zoning layer; S5, performing low-pass filtering on the current processing pixel by using the environmental similar adaptive spatial filter to obtain a filtering result, and writing the filtering result to a corresponding position of the output raster data layer to obtain an environmental similar classification post-processing result of the current processing pixel; S6, traversing other pixels of the preprocessed initial classification result layer, and repeatedly performing S4-S5 to obtain a complete classification post-processing image.
2. The post-processing spatial filtering method for remote sensing image classification considering environmental similarity according to claim 1, characterized in that, The operation of preprocessing remote sensing image initial classification results and potential environmental variable layers comprises projection coordinate system consistency conversion, spatial resolution normalization, and spatial range registration.
3. The post-processing spatial filtering method for remote sensing image classification considering environmental similarity according to claim 1, characterized in that, The initial spatial filter adopts a mode filter mechanism.
4. The post-processing spatial filtering method for remote sensing image classification considering environmental similarity according to claim 1, characterized in that, The process of dynamically constructing the environmental similar adaptive spatial filter of the current processing pixel comprises: determining a neighborhood window based on a template size of the initial spatial filter with the current processing pixel as the center; extracting all pixels in the neighborhood window based on the environmental feature code unique value combination zoning layer to construct a neighborhood environmental feature code matrix; generating an environmental similarity judgment matrix of the current processing pixel by comparing each element in the neighborhood environmental feature code matrix with the environmental feature code of the current processing pixel; constructing the environmental similar adaptive spatial filter of the current processing pixel based on the initial spatial filter and the environmental similarity judgment matrix.
5. The post-processing spatial filtering method for remote sensing image classification considering environmental similarity according to claim 4, characterized in that, The template matrix calculation expression of the environmental similar adaptive spatial filter of the current processing pixel is: F E = F I O S E In the formula, is Hadamard product operator; F I , S E and F E respectively represent initial spatial filter template matrix, environment similarity discrimination matrix and environment similar adaptive spatial filter template matrix.
6. The post-processing spatial filtering method for remote sensing image classification considering environmental similarity according to claim 1, characterized in that, The process of performing classification post-processing on the current processing pixel by using the environmental similar adaptive spatial filter comprises: determining a neighborhood window based on a template size of the initial spatial filter with the current processing pixel as the center; extracting all pixels in the neighborhood window based on the preprocessed initial classification result layer to construct a neighborhood initial classification result matrix; determining a mode by performing weighted frequency statistics on each element in a unique value set in the neighborhood initial classification result matrix based on the environmental similar adaptive spatial filter; writing the mode to a corresponding position of the output raster data layer to implement environmental similar classification post-processing of the current processing pixel.
7. The post-processing spatial filtering method of remote sensing image classification considering environmental similarity according to claim 6, characterized in that, The calculation expression of performing frequency statistics on each element in the unique value set in the neighborhood initial classification result matrix based on the environmental similar adaptive spatial filter is: where v∈V is an arbitrary value in the unique value set V of the neighborhood initial classification result matrix, f(v) is the frequency of v, NW is the neighborhood window, (i,j)∈NW represents the element position index belonging to the neighborhood window, F E represents the environment similar adaptive spatial filter template matrix, R I represents the neighborhood initial classification result matrix, is an indicator function.
8. The post-processing spatial filtering method for remote sensing image classification considering environmental similarity according to claim 1, characterized in that, The potential environmental variable layer comprises: Terrain factors: elevation, slope, aspect; Vegetation characteristics: NDVI, leaf area index; Soil parameters: type, moisture, organic matter content; Climate factors: air temperature, precipitation.
Citation Information
Patent Citations
Method and system for managing marine environment monitoring data
CN104252665A
Birdsong recognition method and system based on spatial orientation, computer equipment and medium
CN113314127A