Wide remote sensing image segmentation and sample automatic generation method based on map matching and forward and reverse projection

By improving the RPC model and GPU parallel computing framework, the problems of radiometric distortion, geometric distortion and low computational efficiency in remote sensing data processing are solved, and high-precision, efficient automatic sample generation and improved computing speed are achieved.

CN122089797APending Publication Date: 2026-05-26XIDIAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIDIAN UNIV
Filing Date
2026-03-04
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing remote sensing data processing technologies suffer from problems such as radiometric distortion, geometric distortion, low computational efficiency, and high sample construction costs in wide-format high-resolution image processing, making it difficult to meet the needs of modern artificial intelligence interpretation.

Method used

An improved RPC model combined with OSM map prior information is used to achieve pixel-level precise alignment between raster imagery and vector map. High-quality ternary semantic masks are automatically generated through forward and reverse geographic projection technology, and a GPU parallel computing framework is introduced to optimize computational efficiency.

Benefits of technology

It achieves pixel-level spatial consistency and efficient computation, generates high-precision ground truth samples, improves processing speed and computing resource utilization, and reduces manual annotation costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122089797A_ABST
    Figure CN122089797A_ABST
Patent Text Reader

Abstract

The invention discloses a map matching and forward and reverse projection wide remote sensing image segmentation and sample automatic generation method. The method comprises the following steps: step 1, taking an original image, metadata and coastline vector data as an input triple; data cleaning and normalization are carried out through an image preprocessing module; entering a geometric correction and registration module to generate a corrected image with an Alpha channel; 2, performing spatial indexing and matching on the coastline vector data and the corrected image; using a mask generation algorithm to automatically align and rasterize the vector data, and constructing a final true value mask of pixel-level alignment; 3, initializing a reverse mapping grid through a coordinate transformation processing module; calculating a nonlinear mapping relation from geographic coordinates to original sensor pixel coordinates by using a coordinate inverse transformation calculation module; and through resampling processing, accurately backfilling the semantic tag to an original image space, and outputting a final inverse transformation mask. According to the invention, high precision is ensured, and meanwhile, the order of magnitude of processing speed is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of spatiotemporal registration technology for multi-source heterogeneous data, specifically relating to a method for wide-span remote sensing image segmentation and automatic sample generation based on map matching and forward and reverse projection. Background Technology

[0002] With the continuous evolution of spaceborne sensor technology, Earth observation data exhibits significant characteristics such as wide swath width, high spatiotemporal resolution, and multi-source heterogeneity, marking the full entry of the geospatial information processing field into the era of big data. Precise geo-positioning and semantic segmentation of remote sensing imagery are crucial links connecting raw observation data with high-level geographic intelligence. Especially in complex application scenarios such as ocean monitoring, port facility inspection, and coastal zone management, constructing accurate mapping models from georeferenced raw raster imagery to standard map coordinate systems, and simultaneously achieving high-precision extraction of ground features, are prerequisites for realizing multi-domain situational awareness and intelligent interpretation across land and sea.

[0003] However, existing remote sensing data processing and interpretation technologies face significant technical bottlenecks in three dimensions—physical imaging mechanisms, sample construction paradigms, and computational architecture performance—when dealing with wide-swath, high-resolution imagery. These limitations make it difficult to meet the stringent requirements of modern AI interpretation for radiometric fidelity, automated sample construction, and real-time processing. First, regarding geometric registration and radiometric quality preservation, traditional standard operating procedures generally employ an image-to-map orthorectification strategy. This strategy forces resampling and geometric correction of the original oblique observation image to adapt it to the map projection grid. However, the resampling process based on interpolation algorithms (such as bilinear interpolation and cubic convolution) inevitably alters the pixel array structure of the original image at the signal processing level, leading to smoothing of high-frequency texture information and blurring of edge gradients (pixel aliasing and blur). For deep convolutional neural networks, which are highly sensitive to texture features, the radiometric distortion and spectral aliasing introduced by this preprocessing significantly weaken the robustness of feature extraction. Furthermore, registration methods that rely solely on the general rational polynomial coefficient (RPC) model without prior geographic information constraints are prone to nonlinear geometric distortions at wide-field imaging edges, making it difficult to achieve pixel-level alignment between raster images and vector maps.

[0004] Secondly, in terms of deep learning sample construction, existing technologies are constrained by the scarcity of high-quality labeled data and the high cost of manual annotation. Although crowdsourced geographic data (such as OpenStreetMap, OSM) contains rich vector prior information, the significant spatiotemporal reference differences and projection differences between the original imagery and the vector map often lead to severe misalignment when directly superimposed. This geometric mismatch makes generating training samples directly from vector maps subject to huge noise interference, resulting in current mainstream methods still heavily relying on manual annotation. This labor-intensive approach is not only inefficient but also struggles to meet the rapid update demands of massive amounts of remote sensing data, severely restricting the generalization and iterative updates of large-scale deep learning models in the field of remote sensing.

[0005] Finally, regarding computational efficiency and system architecture, traditional remote sensing processing software often employs a tile-based, disk I / O-intensive processing architecture when dealing with large-format remote sensing images in the gigabyte range. When complex geometric transformations and backprojection calculations are involved, frequent disk read / write operations and memory-to-GPU data transfers become significant bottlenecks to system performance. This prevents high-performance parallel computing units (such as GPUs) from achieving saturated data throughput, leaving them in a prolonged waiting state and hindering the achievement of millisecond-level real-time response and high-throughput processing for complex interpretation tasks.

[0006] In summary, existing technologies lack a systematic solution that can simultaneously preserve original radiation characteristics, accurately register multi-source heterogeneous data, automatically generate samples, and perform efficient full-memory computing. Summary of the Invention

[0007] To overcome the shortcomings of existing technologies, this invention aims to provide a method for wide-span remote sensing image segmentation and automatic sample generation through map matching and forward / backward projection. This invention utilizes an improved RPC model combined with OSM map prior information to achieve pixel-level precise alignment between raster images and vector maps, effectively eliminating nonlinear geometric distortion and ensuring spatial consistency for subsequent tasks. Simultaneously, through forward / backward geographic projection technology, this invention can automatically generate high-quality ternary semantic masks from aligned vector data, achieving zero-cost construction of large-scale, high-precision ground truth samples. Furthermore, by introducing a reconstructed GPU parallel computing framework to replace traditional CPU serial processing, this invention solves the efficiency bottleneck of wide-span image processing, achieving an order-of-magnitude increase in processing speed while maintaining high accuracy.

[0008] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for wide-span remote sensing image segmentation and automatic sample generation based on map matching and forward / backward projection includes the following steps: Step 1. Multi-source data fusion and positive geocorrection stage: The original wide-span remote sensing image (.tiff), metadata (.rpb / .xml), and coastline vector data (.shp) are used as input triplets. First, the original wide-span remote sensing image is cleaned and normalized by the image preprocessing module, and the metadata is processed and parsed by the RPC model. Then, it enters the geometric correction and registration module, which uses the RPC model to project the original image onto the WGS84 geographic coordinate system to generate a corrected image with an alpha channel (corrected_*.tiff). Step 2. Truth mask generation stage based on vector superposition: Within the geospatial space, the coastline overlay analysis module spatially indexes and matches the coastline vector data with the corrected image; then, using a mask generation algorithm, the vector data is automatically aligned and rasterized to construct a pixel-level aligned final ground truth mask (mask_*.tiff). Step 3. Reverse sensor spatial reprojection and sample fitting stage: Read the final ground truth mask and the original image and metadata, and initialize the inverse mapping mesh through the coordinate transformation processing module; Next, the inverse coordinate transformation calculation module is used to solve the nonlinear mapping relationship from geographic coordinates to the original sensor pixel coordinates; Finally, after resampling, the semantic labels are accurately backfilled into the original image space, and the final inverse transform mask (inverse_*.tiff) is output.

[0009] The image preprocessing module in step 1 specifically includes: Before starting the processing flow, the system first executes a data scanning program; for each wide-span remote sensing image to be processed, the system automatically retrieves and locks the three core files that constitute the processing unit according to the file naming rules, and performs strict I / O verification. Input definition: Image entity file Typically, .tiff files for L1 / L2 level products store the raw digital quantization (DN) values ​​acquired by the sensor, and RPC parameter files. It is a .rpb or .txt text file containing all the geometric parameters needed to establish the spatial mapping between the sensor plane and ground features; auxiliary metadata file. Typically an .xml file, it records the image's width, height, geographical bounding box, and sensor type; Execute logical verification function Only when all three are present and the file header is complete will the valid path indexes of the three files be passed to the next level of the parsing module; otherwise, an exception handling mechanism will be triggered to skip the data group.

[0010] The RPC model performs automated semantic parsing of RPC parameters: The input valid path index is used to convert unstructured text into a numerical matrix through a semantic parsing algorithm based on regular expressions; a parsing mapping from text to the parameter domain is then constructed. Extract the key-value scalar items and bracketed list items from the RPB file into a numerical vector and reorganize them into a matrix form. For any scalar parameter row k=v, the formula is defined as follows: in This means taking the string on the right side of the equals sign. For floating-point decimation and numeration operators; for coefficient list items, such as The formula is defined as follows: The final set of scalars obtained from the analysis With four sets of coefficient vectors: The RPC parameters are concatenated into a unified numerical parameter matrix representation, as follows: This enables the transformation from semi-structured text to a numerical parameter representation that can directly participate in subsequent matrix operations; The system traverses the text stream, extracting two types of core geometric parameters: normalized scalar parameters and polynomial coefficient vectors. Finally, the extracted discrete values ​​are reassembled into a dictionary-structured numerical set. It distinguishes between general parameter fields and core coefficient sequences, thus completing the transformation from textual semantics to numerical semantics.

[0011] The coordinate normalization specifically refers to: Based on the set of values In the preprocessing stage, the coordinate normalization model is clearly defined; Set the ground geographic coordinates as ,in Longitude Latitude The elevation is given by the original image pixel coordinates. ,in For line numbers, For column number; system call The parameters in the table are defined by the following normalized mapping relationship: in , , This represents the geographic coordinate offset, specifically the latitude, longitude, and altitude coordinates of the geometric center point of the image coverage area. , , This represents the geographic coordinate scaling factor, indicating the half-span of the image coverage area in both latitude, longitude, and elevation directions. , Indicates the image coordinate offset. , Indicates the image coordinate scaling factor; Using the memory driver of the GDAL library, a virtual memory image object is created in RAM, and the SetMetadata interface is called to encapsulate and inject the RPC parameter model into the RPC attribute field of the object.

[0012] The specific operation of the geometric correction and registration module is as follows: The pre-processed virtual memory image object, which has been injected with RPC metadata, is used to map the original image from the sensor coordinate system with geometric distortion to the standard WGS84 geographic coordinate system using a rational polynomial imaging model and a high-performance resampling algorithm.

[0013] The specific implementation process includes the following three core sub-steps: Step (1): Before performing pixel migration, establish a strict mathematical correspondence between the output image (geographic grid) and the input image (original image); the input image comes from the input original remote sensing image (.tiff, sensor pixel coordinate domain) and is combined with the RPC parameters provided by its supporting metadata (.rpb / .xml); the geographic grid of the output image is constructed in the WGS84 geographic coordinate system with the corrected image (corrected_*.tiff) obtained by RPC forward geographic correction as a reference, based on its coverage, spatial resolution and affine geographic transformation parameters.

[0014] First, the target output coordinate system is defined as WGS84 (EPSG:4326); the system divides the image into a uniform latitude and longitude grid based on the geographic bounding box of the image. For any point in the target grid (including elevation) (Can be provided by DEM or set as average elevation), directly use normalized geographic coordinates. Substitute the coefficients of the cubic polynomial from the parsed RPB file to calculate its dimensionless projected coordinates in the normalized image space. : in , , This represents the normalized longitude, latitude, and elevation calculated using formulas during the preprocessing stage. , Let represent the cubic polynomial functions in the numerator and denominator of the line direction, respectively. , Let represent the cubic polynomial functions of the numerator and denominator for the column direction (Sample), respectively. , This represents the calculated normalized row and column numbers, with values ​​ranging from 1 to 2. , which represents the relative positional proportion of a pixel within an image; The system performs the inverse operation of the image-side normalization formula defined in the preprocessing stage to obtain the real pixel index that can be used for resampling. Using parameters such as LINE_SCALE / OFF stored in the memory object, the coordinates are mapped back to the sensor pixel coordinate system. The calculation formula is as follows: in , This represents the true floating-point row and column numbers in the solved original image, which will be used as input coordinates for subsequent resampling. , This represents the row direction scaling and translation parameters extracted and stored during the preprocessing stage, corresponding to... The lineScale and lineOffset values ​​in the code. Step (2): After obtaining the mapping relationship, the system calls the geometric transformation engine (corresponding to the gdal.Warp operator) to perform pixel value filling; The grayscale value is calculated using bilinear interpolation resampling; the formula is as follows: in This indicates the corrected output image in geographic coordinates. Pixel value at that location, This represents the pixel value at a specified integer row and column position in the original image. , This means rounding the floating-point coordinates calculated in step (1) to the nearest integer reference pixel at the top left corner of the target point. Represents floating-point coordinates The distance weighting coefficient calculated from the fractional part satisfies ; Step (3): Generate the Alpha channel and output normalization, then generate the corrected image. Simultaneously, force synchronous output of an 8-bit alpha mask channel. Its assignment logic is defined as follows: in, This represents the transparency mask value at the corresponding position in the output image. A value of 255 indicates that the pixel is valid data (completely opaque), while a value of 0 indicates that the pixel is invalid background fill (completely transparent). Based on this, the final generated image file corrected_*.tiff is standardized and packaged using tile-based storage, LZW lossless compression, and BigTIFF format. This ensures data integrity while maximizing the optimization of large data reading performance and storage space usage in subsequent stages.

[0015] The specific steps of the coastline overlay analysis in step 2 are as follows: Step (1): First, perform vector lightweight preprocessing based on image spatial range; The process is as follows: The system analyzes the geographic transformation parameters of the corrected image and calculates its geometric bounding box in the geographic coordinate system. Based on this, the OGR geometry engine is driven to construct a spatial filter, accurately extracting vector features that intersect with the bounding box, thereby eliminating redundant data outside the current field of view at the source. Furthermore, for the selected local coastline features, the system dynamically calculates a simplification tolerance based on the image's baseline resolution. The Douglas-Peucker algorithm is used to perform topology downsampling on the vector nodes.

[0016] Step (2): A virtual raster environment with the same size and projection as the corrected image is constructed in computer memory (RAM) and a fast conversion is performed to achieve precise spatial pixel-level alignment between heterogeneous vector data and raster image; the system first uses the GDAL memory driver to instantiate a single-band virtual dataset. Its width, height, and geographic coordinate projection information are strictly inherited from the corrected image generated in the previous steps. This establishes a unified spatial benchmark. Based on this, the algorithm performs feature burning operations, directly mapping the topologically simplified vector features from step (1) to the virtual grid, and setting the coastline feature value as... This generates a temporary Boolean matrix of coastlines. Its numerical distribution logic is defined as follows: .

[0017] The specific steps of the mask generation algorithm are as follows: The temporary coastline Boolean matrix is ​​logically evaluated against the Alpha validity channel generated during the geometric correction stage to generate the final truth mask that conforms to the WGS84 coordinate system. The algorithm employs a strategy combining validity constraints and priority cropping to eliminate false coastline noise (i.e., vector lines located in the black background area) caused by geometric correction edge filling. First, it reads the alpha channel of the corrected image to construct an effective data mask. Furthermore, the final ternary mask is synthesized according to the hierarchical logic of background (0) < effective region (1) < coastline (255). The model is defined as follows: The final generated matrix is ​​encoded as mask_*.tiff.

[0018] The specific implementation process of step 3 includes three modules: coordinate transformation processing module, inverse coordinate transformation calculation module, and resampling and post-processing module. Coordinate transformation processing module: A push model strategy based on sparse matrices is designed. First, the ground truth mask mask_*.tiff (WGS84 coordinate system) generated in the first stage and the metadata of the original image are read. The system then identifies the valid regions in the mask with non-zero pixel values ​​(i.e., the valid background and coastline), extracts their geographic coordinates, and constructs a sparse point set. The definition of this set is: in, The latitude and longitude coordinates corresponding to the effective pixels. This represents the mask matrix with standard geographic coordinates generated in the first stage; Inverse coordinate transformation calculation module: for sets For each geographic coordinate point, the algorithm calls the RPC parameters resolved in the preprocessing stage to perform projection calculations; here, this is defined as a discrete projection operator. : in, This represents the calculated floating-point row and column coordinates of the i-th feature point in the original sensor image space. This is a discrete projection operator constructed based on a rational polynomial coefficient model; the input vector is... Represents the normalized longitude, latitude, and elevation parameters; the polynomial terms in the formula , and , The cubic polynomial functions for the numerators and denominators, corresponding to the row (Line) and column (Sample) directions respectively, are used to solve nonlinear geometric distortions; while , and , These represent the scaling factors (corresponding to LINE_SCALE and SAMP_SCALE in the RPC parameters) and translation offsets (corresponding to LINE_OFF and SAMP_OFF) of the original image in the row and column directions, respectively, which are used to finally restore the normalized result calculated by the polynomial to the real pixel coordinates.

[0019] The resampling and post-processing module is responsible for discretizing the floating-point sensor coordinates obtained by parallel computing on the GPU and reconstructing them into a two-dimensional raster image. In practice, the system initializes a memory array with the same size as the original image. A strictly uniform zero-value matrix is ​​mapped directly using GPU vectorization operations, scattering discrete feature points to fill the new matrix. The mapping logic is defined as follows: in, This represents the reconstructed original sensor space mask matrix; Represents the floating-point coordinates calculated by the inverse transformation. The integer row and column indices obtained after rounding; Then, the target semantic label value (e.g., 255) is assigned to the pixel location. The system introduces the OpenCV image processing engine to perform morphological closing operations, repairing pixel gaps or isolated noise points in the initially generated raster image. The operational model is as follows: in, I represents the final continuous mask image output after morphological restoration; I represents the initial mask image generated after discretization mapping; B represents the structuring element used for morphological scanning. and These represent morphological expansion and erosion operations, respectively. Finally, the processed matrix is ​​packaged into an inverse_*.tiff file, stored using LZW lossless compression and BigTIFF format, ensuring that the output is geometrically perfectly aligned with the original L1 / L2 level image, and can be directly used as the pixel-level ground truth for training deep learning models.

[0020] The beneficial effects of this invention are: 1. This invention introduces open-source vector data as geographic prior knowledge, uses RPC model for forward geographic correction to project images onto the WGS84 coordinate system, and completes vector overlay matching and rasterization to generate pixel-level ground truth masks in geographic space. Furthermore, semantic labels are accurately backfilled into the original image space through reverse sensor spatial reprojection and resampling, replacing the complex manual pixel-by-pixel drawing and realizing the low-cost automated construction of large-scale, standardized pixel-level ground truth samples. 2. This invention adopts a closed-loop strategy of forward acquisition of semantics and reverse adaptation of images. The semantic labels are accurately backfilled into the original sensor space through coordinate inverse transformation. While achieving strict geometric registration, the radiometric brightness and texture details of the original image are fully preserved, avoiding feature aliasing and information loss caused by traditional geometric resampling. 3. This invention designs a sparse push model for the sparse characteristics of masks, which performs projection calculations only on valid feature points, significantly reducing the computational complexity from the whole image level to the feature point level, effectively avoiding the waste of computing power in invalid background areas and greatly improving the utilization rate of computing resources; 4. This invention constructs a processing architecture that combines full-memory computing flow with GPU heterogeneous parallel acceleration. By utilizing CUDA kernel functions and adaptive memory partitioning technology, it breaks through the I / O bottleneck and serial computing limitations of wide-format image processing, and achieves millisecond-level real-time response for complex geometric transformation tasks. 5. This invention introduces an Alpha channel validity constraint and a morphological closing operation repair mechanism to effectively eliminate boundary noise and fill the topological gaps generated by inverse projection, ensuring the accuracy and spatial continuity of the generated ground truth samples on the geometric boundaries, which is significantly better than the coarse labels generated by traditional methods. Attached Figure Description

[0021] Figure 1 This is a flowchart of the overall algorithm for wide-span remote sensing image region segmentation and automatic sample generation based on map matching.

[0022] Figure 2 It is a heterogeneous parallel acceleration computing module based on GPU CUDA architecture. Detailed Implementation

[0023] The present invention will now be described in further detail with reference to the accompanying drawings.

[0024] This invention proposes an algorithm for wide-span remote sensing image region segmentation and automatic sample generation based on map matching and forward and reverse geographic projection. For example... Figure 1As shown, the overall algorithm architecture constructs a strict closed-loop data processing chain of forward geospatial mapping and reverse original sensor spatial reprojection, aiming to solve the problems of difficult registration of multi-source heterogeneous data (raster imagery and vector map), high cost of manual annotation, and low computational efficiency. This architecture is driven by the underlying high-performance GPUCUDA heterogeneous parallel computing module and logically divided into the following three core processing stages: Step 1. Image preprocessing and geometric correction and registration stage: This stage takes the original image (.tiff), metadata (.rpb / .xml), and coastline vector data (.shp) as input triplets. First, the image preprocessing module cleans and normalizes the data. Then, the core geometric correction and registration module uses an RPC model to project the original image onto the WGS84 geographic coordinate system, generating a corrected image (corrected_*.tiff) with an alpha channel. This alpha channel precisely marks the effective imaging area, providing spatial constraints for subsequent processing. Step 2. Truth mask generation stage based on vector superposition: Within the geographic space, the high-precision vector map data and the corrected raster image are spatially indexed and matched using the coastline overlay analysis module. Then, the vector data is automatically aligned and rasterized using a mask generation algorithm to construct a pixel-level aligned final ground truth mask (mask_*.tiff). This mask is located in the WGS84 coordinate system and contains precise semantic category labels (such as ocean, land, coastline). Step 3. Reverse sensor spatial reprojection and sample fitting stage: In order to utilize the radiometric features of the original image with zero loss, this stage implements a reverse adaptation strategy; the system reads the final ground truth mask and the original image metadata, and initializes the reverse mapping mesh through the coordinate transformation processing module; Next, the inverse coordinate transformation calculation module (based on an improved iterative approximation algorithm) is used to solve the nonlinear mapping relationship from geographic coordinates to the original sensor pixel coordinates; Finally, after resampling, the semantic labels are accurately backfilled into the original image space, and the final inverse transform mask (inverse_*.tiff) is output. This result achieves strict geometric registration between the semantic labels and the original distorted image in the sensor space, and can be directly used as a high-quality training sample for deep learning.

[0025] Example: The prerequisite for implementing this invention is the construction of a standardized data input stream and a high-precision geographic prior library. At the input data level, this system receives three types of core files as the starting point for processing: first, L1-level wide-swath remote sensing image data with original geometric distortion (usually in .tiff format), which preserves the original radiance values ​​of the sensor; second, rational polynomial coefficient files (.rpb) describing the satellite imaging geometric model, which provide initial mapping parameters from pixel space to geographic space; and third, metadata files (.xml) recording sensor attitude, imaging time, and band information, used to assist in subsequent parameter calculations. At the geographic reference level, this invention introduces OpenStreetMap (OSM) as the core offline geographic information database. As a global crowdsourced geographic information system, OSM provides highly up-to-date coastline and land polygon vector data, providing an absolute spatial reference for map matching and ground truth generation in the algorithm.

[0026] Based on the aforementioned data, the specific implementation process of this algorithm will strictly follow the temporal logic of forward geographic correction—semantic sample generation—back projection adaptation.

[0027] In turn Figure 1 The specific execution steps, key algorithm principles, and related mathematical models within the three core processing modules shown are analyzed in depth.

[0028] Step 1: Forward geocorrection: like Figure 1 As shown in the flowchart on the left, the core task of this stage is to establish a mapping bridge from the raw sensor space to the standard geographic space. The algorithm takes the raw image (.tiff), metadata (.rpb / .xml), and coastline vector data (.shp) as input triplets, and through the processing of the following core modules, outputs an accurate ternary ground truth mask in the WGS84 coordinate system.

[0029] 1.1 Image Preprocessing The geometric correction and registration module does not rely on proprietary format interfaces of specific vendors. Instead, it is designed with a universal automated parsing process to convert unstructured raw satellite observation data into structured mathematical model parameters that can be directly calculated by computers.

[0030] Step (1): Construction and integrity verification of multi-source data triples: Before starting the processing flow, the system first executes a data scanning program; for each wide-span remote sensing image to be processed, the system automatically retrieves and locks the three core files that constitute the processing unit according to the file naming rules, and performs strict I / O verification.

[0031] Input definition: Image entity file Typically, .tiff files for L1 / L2 level products store the raw digital quantization (DN) values ​​acquired by the sensor, at which point the image pixel grid is still in the distorted sensor space; RPC parameter files... Typically a .rpb or .txt text file, it contains all the geometric parameters needed to establish a spatial mapping between the sensor plane and ground features; auxiliary metadata files. Typically an .xml file, it records the image's width, height, geographical bounding box, and sensor type.

[0032] Execute logical verification function Only when all three are present and the file header is complete will the valid path indexes of the three files be passed to the next level of the parsing module; otherwise, an exception handling mechanism will be triggered to skip the data group, ensuring the robustness of the batch processing flow.

[0033] Step (2): Automated semantic parsing of RPC parameters: The valid file index passed in step (1) is used as input. Since RPB files are usually stored in semi-structured key-value pair text format (e.g., lineOffset = 1234.5), the computer cannot directly use it for subsequent matrix operations. This step converts the unstructured text into a numerical matrix by designing a semantic parsing algorithm based on regular expressions. This step constructs a parsing mapping from text to parameter domain. Extract the key-value scalar items and bracketed list items from the RPB file into a numerical vector and reorganize them into a matrix form. For any scalar parameter row k=v, the formula is defined as follows: in This means taking the string on the right side of the equals sign. For floating-point decimation and numeration operators. For coefficient list items, such as... The formula is defined as follows: The final set of scalars obtained from the analysis With four sets of coefficient vectors: The RPC parameters are concatenated into a unified numerical parameter matrix representation, as follows: This enables the transformation from semi-structured text to a numerical parameter representation that can directly participate in subsequent matrix operations.

[0034] The system traverses the text stream, extracting two types of core geometric parameters: first, normalized scalar parameters: a total of 10, including the offset and scaling factor for longitude, latitude, elevation, row number, and column number; second, a polynomial coefficient vector: a total of 80, including the numerator and denominator polynomial coefficients for both row and column directions, with 20 coefficients in each group. Finally, the extracted discrete values ​​are reorganized into a dictionary structure. Distinguish between general parameter fields (such as ERR_BIAS) and core coefficient sequences to complete the transformation from textual semantics to numerical semantics. The numerical values ​​in this set are the direct source of coefficients for defining the coordinate normalization mathematical model in step (3).

[0035] Step (3): Coordinate normalization Based on the set of numerical values ​​obtained in step (2) This step explicitly defines the coordinate normalization model during the preprocessing stage. This is to avoid numerical overflow and ill-conditioned matrix problems in subsequent high-order polynomial calculations, and to establish a numerical mapping rule between sensor space and geographic space in advance.

[0036] Normalized mathematical definition: Let the ground geographic coordinates be... ,in Longitude Latitude The elevation is given by the original image pixel coordinates. ,in For line numbers, For column number. System call. The parameters in the table are defined by the following normalized mapping relationship: in , , This represents the geographic coordinate offset, specifically the latitude, longitude, and altitude coordinates of the geometric center point of the image coverage area. , , This represents the geographic coordinate scaling factor, indicating the half-span of the image coverage area in both latitude, longitude, and elevation directions. , This represents the image coordinate offset, typically corresponding to the row and column number of the image's center pixel. , This represents the image coordinate scaling factor, which typically corresponds to half the width and height of the image.

[0037] Step (4): GDAL metadata injection and virtual geometry engine construction As the endpoint of the preprocessing stage and the interface to the next stage, this step performs parameter binding operations. The system uses the memory driver of the GDAL library to create a virtual memory image object in RAM and calls the SetMetadata interface to encapsulate and inject the RPC parameter model generated in steps (2) and (3) into the RPC attribute field of the object.

[0038] The second-stage geometric correction and registration module will directly receive the data object. Its internal gdal.Warp operator will automatically read the metadata injected in this step, and can directly perform projection transformation calculations without reading the disk file again, thus achieving a seamless and efficient connection between the two stages.

[0039] 1.2 Geometric Correction and Registration This step is the core of the forward geomapping process. The algorithm takes the virtual memory image object, pre-processed in the previous stage and infused with RPC metadata, and uses a rational multinomial imaging model and a high-performance resampling algorithm to map the original image from the geometrically distorted sensor coordinate system to the standard WGS84 geographic coordinate system. This process not only eliminates nonlinear distortions caused by terrain undulations and sensor attitude but also precisely defines the validity boundaries of the data through a synchronously generated alpha channel.

[0040] The specific implementation process includes the following three core sub-steps: Step (1): Construct the mathematical mapping model for orthorectification. Before performing pixel migration, a rigorous mathematical correspondence must be established between the output image (geographic grid) and the input image (raw image). The input image comes from the original remote sensing image (.tiff, sensor pixel coordinate domain), combined with the RPC parameters provided in its accompanying metadata (.rpb / .xml). The geographic grid of the output image is constructed in the WGS84 geographic coordinate system, using the corrected image (corrected_*.tiff) obtained through RPC forward geocorrection as a reference, based on its coverage, spatial resolution, and affine geotransformation parameters. Although the RPC coefficients are defined as the forward projection from ground points to image points, a reverse calculation mechanism is used in the actual calculation of orthorectification.

[0041] First, the target output coordinate system is defined as WGS84 (EPSG:4326). The system then divides the imagery into a uniform latitude and longitude grid based on the geographic bounding boxes. For any point in the target grid (including elevation) (The elevation can be provided by the DEM or set as the average elevation), and the normalized geographic coordinates obtained in step (3) of the data preprocessing stage can be used directly. Substituting the coefficients of the 80 cubic polynomials from the parsed RPB file, calculate their dimensionless projected coordinates in the normalized image space. : in , , This represents the normalized longitude, latitude, and elevation calculated by the formula in step (3) of the preprocessing stage. , Let represent the cubic polynomial functions in the numerator and denominator of the line direction, respectively. , Let represent the cubic polynomial functions of the numerator and denominator for the column direction (Sample), respectively. , This represents the calculated normalized row and column numbers, with values ​​ranging from 1 to 2. , which represents the relative position ratio of a pixel within an image.

[0042] To obtain the true pixel index that can be used for resampling, the system performs the inverse operation of the image-side normalization formula defined in step (3) of the preprocessing stage. Using parameters such as LINE_SCALE / OFF stored in the memory object, the coordinates are mapped back to the sensor pixel coordinate system. The calculation formula is as follows: in , This represents the true floating-point row and column numbers in the solved original image, which will be used as input coordinates for subsequent resampling. , This represents the row direction scaling and translation parameters extracted and stored during the preprocessing stage, corresponding to... In lineScale and lineOffset.

[0043] Step (2): Perform high-fidelity resampling and parallel computing After obtaining the mapping relationship, the system calls the geometric transformation engine (corresponding to the gdal.Warp operator) to perform pixel value filling. To balance computational efficiency and radiometric fidelity, this embodiment employs a series of specific optimization parameters.

[0044] Bilinear interpolation resampling is used because the original coordinates are calculated via reverse mapping. Typically, the value is not an integer. This algorithm abandons the simple nearest neighbor method and uses bilinear interpolation to calculate the grayscale value. It utilizes the weighted average of the four neighboring pixels around the target point as the output value, effectively avoiding image jaggedness. in This indicates the corrected output image in geographic coordinates. Pixel value at that location, This represents the pixel value at a specified integer row and column position in the original image. , This means rounding the floating-point coordinates calculated in step (1) to the nearest integer reference pixel at the top left corner of the target point. Represents floating-point coordinates The distance weighting coefficient calculated from the fractional part satisfies .

[0045] To address the issue of high computational demands on wide-format images, this step employs a multi-level acceleration strategy. It utilizes multi-core CPUs to process different image blocks concurrently, and, where hardware support allows, schedules GPUs to participate in intensive floating-point operations.

[0046] Step (3): Generate Alpha channel and output normalization This is the key technical feature that distinguishes this algorithm from traditional geometric correction. For the no-data areas (NoData) generated in the rectangular geographic grid after geometric transformations such as rotation and shearing of the original image, this step generates a corrected image to accurately distinguish between real black features and the filled black background. Simultaneously, force synchronous output of an 8-bit alpha mask channel. Its assignment logic is defined as follows: in, This represents the transparency mask value at the corresponding position in the output image. A value of 255 indicates that the pixel is valid data (completely opaque), while a value of 0 indicates that the pixel is invalid background fill (completely transparent). Based on this, the final generated image file corrected_*.tiff is standardized and packaged using tile-based storage, LZW lossless compression, and BigTIFF format. This ensures data integrity while maximizing the optimization of large data reading performance and storage space usage in subsequent stages.

[0047] Step 2. Truth mask generation stage based on vector superposition: 2.1 Coastline Overlay Analysis This step corresponds to the ground truth mask generation stage based on vector overlay in step 2 of the wide-span remote sensing image region segmentation and automatic sample generation algorithm based on map matching and forward and reverse geographic projection. The aim is to spatially fuse offline high-precision vector coastline data with geometrically corrected remote sensing imagery to automatically generate semantic segmentation labels for deep learning model training. The system uses the alpha channel generated in the previous stage as a hard constraint on the effective data, and through a series of spatial optimization algorithms, accurately maps the vector data onto a raster grid, ultimately outputting a three-value mask file containing background, effective region, and coastline features.

[0048] Step (1): Vector topology preprocessing and spatial index construction To effectively address the computational bottleneck caused by the massive number of vertices in global-scale vector data, the system first performs lightweight vector preprocessing based on the image's spatial extent before performing overlay analysis. This process is as follows: the system analyzes the geographic transformation parameters of the corrected image and calculates its geometric bounding box in the geographic coordinate system. Based on this, the OGR geometry engine is driven to construct a spatial filter, accurately extracting vector features that intersect with the bounding box, thereby eliminating redundant data outside the current field of view at the source. Furthermore, for the selected local coastline features, the system dynamically calculates a simplification tolerance based on the image's baseline resolution. The Douglas-Peucker algorithm is used to perform topology downsampling on the vector nodes.

[0049] The specific implementation logic of this algorithm is defined as follows: Let the set of discrete points to be processed be... First, construct a connection between the first and last endpoints. and For a straight line segment, calculate all intermediate nodes. perpendicular distance to line L And find the maximum distance If the criterion is met. If all intermediate nodes are discarded, only the endpoints approximate the original curve; if Then retain the point with the maximum distance. As key feature points, the origin set is divided into subsets. and Recursive calculations are performed until all sub-segments satisfy the tolerance constraints. Through this mathematical simplification strategy, the system adaptively removes redundant vertices smaller than a single pixel while ensuring that the coastline morphological features are not distorted, significantly reducing the computational complexity and memory overhead of subsequent rasterization operations.

[0050] Step (2): Memory-level vector rasterization To achieve precise pixel-level alignment between heterogeneous vector data and raster imagery in space, the algorithm constructs a virtual raster environment in computer memory (RAM) with the same size and projection as the corrected image and performs rapid conversion. Specifically, the system first instantiates a single-band virtual dataset using the GDAL memory driver. Its width, height, and geographic coordinate projection information are strictly inherited from the corrected image generated in the previous steps. This establishes a unified spatial benchmark. Based on this, the algorithm performs feature burning operations, directly mapping the topologically simplified vector features from step (1) to the virtual grid, and setting the coastline feature value as... This generates a temporary Boolean matrix of coastlines. Its numerical distribution logic is defined as follows: 2.2 Mask Generation Algorithm This step corresponds to step 2 of the vector overlay-based ground truth mask generation stage in the wide-span remote sensing image region segmentation and automatic sample generation algorithm based on map matching and forward and reverse geographic projection. It is the endpoint of the forward processing chain. Its core task is to build a multi-source data fusion engine to logically evaluate the candidate coastline matrix generated in the previous stage and the Alpha validity channel generated in the geometric correction stage, and generate the final ground truth mask that conforms to the WGS84 coordinate system.

[0051] To eliminate false coastline noise (i.e., vector lines located in the black background area) caused by geometric correction edge filling, the algorithm employs a strategy combining validity constraints and priority cropping. First, the alpha channel of the corrected image is read to construct an effective data mask. Furthermore, the final ternary mask is synthesized according to the hierarchical logic of background (0) < effective region (1) < coastline (255). The mathematical model is defined as follows: The final generated matrix is ​​encoded as mask_*.tiff. This file, as a standardized geographic ground truth with standard WGS84 geographic coordinates, has dual technical value: on the one hand, it can directly serve downstream target detection and GIS analysis tasks based on geographic location; on the other hand, and more importantly, it constructs a precise mapping bridge from vector space to raster space, providing a unique spatial reference for subsequent stages to restore the mask back to the original sensor space through inverse coordinate transformation and generate deep learning training samples that are strictly aligned with the pixel coordinates of the original image.

[0052] Step 3: Reverse sensor spatial reprojection and sample fitting stage: This stage corresponds to step 3 of the algorithm for wide-span remote sensing image region segmentation and automatic sample generation based on map matching and forward and reverse geographic projection: the inverse sensor spatial reprojection and sample adaptation stage. The aim is to establish an inverse mapping link from standardized geographic space back to the original sensor space. The core motivation is that although the first stage completed geometric correction and semantic annotation in the WGS84 coordinate system, in order for the deep learning model to directly utilize the undamaged radiometric texture features in the original remote sensing image, the generated semantic mask must be inversely projected back into the pixel coordinate system of the original image to generate training labels that are strictly aligned with the original image.

[0053] The specific implementation process includes three core modules: coordinate transformation processing module, inverse coordinate transformation calculation module, and resampling and post-processing module. Coordinate transformation processing module: As the initialization step for inverse projection, the main task of this module is to build an efficient data indexing mechanism to extract effective feature points to be transformed from massive geospatial data. To address the computational redundancy problem caused by traditional pixel-by-pixel scanning, this algorithm designs a push model strategy based on sparse matrices. Instead of blindly traversing the entire image, the algorithm first reads the ground truth mask mask_*.tiff (WGS84 coordinate system) generated in the first stage and the metadata of the original image. The system identifies the effective regions with non-zero pixel values ​​in the mask (i.e., the effective background and coastline) and extracts their geographic coordinates to construct a sparse point set. The mathematical definition of this set is: in, The latitude and longitude coordinates corresponding to the effective pixels. This represents the mask matrix with standard geographic coordinates generated in the first stage. By indexing and extracting only the region of interest (ROI), this strategy avoids redundant calculations of large areas of invalid background (NoData), significantly reducing the computational load of subsequent geometric solutions.

[0054] Inverse coordinate transformation calculation module: For sets For each geographic coordinate point, the algorithm calls the RPC parameters parsed in the preprocessing stage to perform projection calculations. Although the purpose here is to reverse back to the sensor space, mathematically it reuses the forward projection formula of RPC. That is, it utilizes the latitude and longitude to pixel mapping capability inherently defined by the RPC model to accurately push geographic points back to the original image space.

[0055] To avoid confusion with the preceding steps, it is defined here as the discrete projection operator. : in, This represents the calculated floating-point row and column coordinates of the i-th feature point in the original sensor image space. This is a discrete projection operator constructed based on a rational polynomial coefficient model; the input vector is... Represents the normalized longitude, latitude, and elevation parameters; the polynomial terms in the formula , and , The cubic polynomial functions for the numerators and denominators, corresponding to the row (Line) and column (Sample) directions respectively, are used to solve nonlinear geometric distortions; while , and , These represent the scaling factors (corresponding to LINE_SCALE and SAMP_SCALE in the RPC parameters) and translation offsets (corresponding to LINE_OFF and SAMP_OFF) of the original image in the row and column directions, respectively, which are used to finally restore the normalized result calculated by the polynomial to the real pixel coordinates.

[0056] Resampling and post-processing module: This module is first responsible for discretizing the floating-point sensor coordinates obtained by GPU parallel computing in the previous stage and reconstructing them into a two-dimensional raster image. Specifically, the system initializes a raster image in memory with the same dimensions as the original image. A strictly uniform zero-value matrix is ​​mapped directly using GPU vectorization operations, scattering discrete feature points to fill the new matrix. The mapping logic is defined as follows: in, This represents the reconstructed original sensor space mask matrix; Represents the floating-point coordinates calculated by the inverse transformation. The integer row and column indices obtained after rounding; This assigns the target semantic label value (e.g., 255) to the pixel location. Through this parallelized write operation, the system quickly completes the spatial reconstruction from a sparse discrete point set to a continuous raster image.

[0057] However, given the inherent nonlinear stretching characteristics of the RPC inverse transform and the discrete displacement mechanism of the push model, the initially generated raster image is prone to pixel gaps or isolated noise points in local areas. To correct these geometric and topological defects, the system introduces the OpenCV image processing engine to perform morphological closing operations, the operational model of which is as follows: in, I represents the final continuous mask image output after morphological restoration; I represents the initial mask image generated after discretization mapping; B represents the structuring element used for morphological scanning, which is specifically selected in this embodiment. The elliptical core is designed to precisely fit the natural curvature of the coastline; and These represent morphological dilation and erosion operations, respectively. They are used in cascade to effectively connect broken pixels and remove edge burrs.

[0058] Finally, the processed matrix is ​​packaged into an inverse_*.tiff file, stored using LZW lossless compression and BigTIFF format, ensuring that the output is geometrically perfectly aligned with the original L1 / L2 level image, and can be directly used as the pixel-level ground truth for training deep learning models.

[0059] like Figure 2 As shown, the heterogeneous parallel accelerated computing module based on the GPU CUDA architecture serves as the unified execution base for the aforementioned map matching—forward geographic projection—vector overlay rasterization—backward reprojection backfill closed-loop algorithm link, carrying and implementing all the core calculations of steps 1 to 3 of the overall algorithm framework.

[0060] To address the I / O bottleneck caused by massive data throughput in wide-span remote sensing image processing and the computational redundancy resulting from full-image traversal in traditional algorithms, this algorithm proposes a highly efficient architecture based on full-memory computation flow. This architecture pioneers a Push Model sparse computation strategy, extracting coordinates and performing inverse projection only for effective feature points in the mask, completely eliminating the computational waste of invalid background pixels and reducing computational complexity from the total image pixel level to the effective point level. Simultaneously, in the CPU processing stage, the system abandons inefficient interpreter computation, introducing a C++-based gdaltransform engine combined with ProcessPoolExecutor multi-process tile parallelism technology to achieve independent task partitioning and efficient aggregation, significantly overcoming the performance bottlenecks of traditional methods.

[0061] To achieve ultimate computational speed, this algorithm further constructs a heterogeneous parallel acceleration engine. Utilizing Numba JIT technology, it reconstructs complex RPC polynomial solutions into customized CUDA kernel functions, fully unleashing the single-instruction multiple-data (SIMD) computational potential of the thousands of stream processors on the GPU. This design transforms the originally time-consuming serial mathematical operations into large-scale parallel tasks, compressing computation time from minutes to milliseconds, achieving an order-of-magnitude performance leap. Coupled with intelligent hardware detection and automatic rollback mechanisms, the system can seamlessly switch computation backends according to the operating environment, ensuring optimal efficiency in solving the geometric transformation challenges of large-scale remote sensing images under different hardware configurations.

[0062] This invention solves the problem of spatiotemporal registration of multi-source heterogeneous data. By utilizing the RPC model combined with OSM prior geographic information, pixel-level precise alignment between raster imagery and vector maps is achieved. This invention addresses the problem of complex and costly manual annotation of deep learning samples for wide-span remote sensing images. By automatically generating ternary semantic masks through OSM vector data rasterization, it replaces manual annotation and achieves automated construction of large-scale, high-quality ground truth samples.

[0063] This invention solves the pixel aliasing and feature blurring problems caused by forced image resampling when mapping geographic information to images using traditional methods. It employs a strategy of forward semantic acquisition and reverse image adaptation, achieving strict geometric registration between semantic labels and the original image within the sensor space. This invention solves the problems of I / O bottlenecks and low computational efficiency in wide-span remote sensing image processing. It employs a full-memory computational flow combined with GPU CUDA core parallel acceleration technology to achieve millisecond-level high-efficiency processing of complex geometric transformation tasks.

[0064] Next, we will use an example to simulate the above algorithm process.

[0065] The input processing unit in this embodiment is a triple (original image .tiff, RPC / metadata .rpb / .xml, coastline vector .shp), and uses WGS84 (EPSG:4326) as the unified geographic reference coordinate system. The example naming here is only for process illustration; in actual engineering, it can be automatically generated and managed by batch processing tasks.

[0066] Step 1: Image preprocessing and geometric correction and registration stage, outputting corrected image corrected_*.tiff and Alpha channel. 1) I / O verification and RPC parsing: The system locks F_img, F_rpb, and F_xml according to the naming rules and completes the integrity verification; then it performs semantic parsing on the semi-structured RPB text, extracts 10 Offset / Scale scalars and 80 polynomial coefficients and reassembles them into an RPC numerical parameter matrix.

[0067] 2) Establish the output geographic grid: Using WGS84 (EPSG:4326) as the target coordinate system, determine the output grid range based on the image bounding box, and determine the output width and height in combination with the target resolution (which can be inherited or explicitly set).

[0068] 3) Perform orthorectification using reverse mapping: For any geographic point (λ, φ, h) on the output geographic grid, use RPC forward projection to obtain the floating-point pixel coordinates (r, c) in the original image, and use bilinear interpolation to sample from raw_001.tiff to generate the corrected image I_geo.

[0069] 4) Synchronously generate Alpha channel: For each output pixel, if its back projection point (r, c) falls within the effective field of view of the original image, the Alpha is set to 255, otherwise it is set to 0; thus, corrected_001.tiff (containing Alpha channel) is obtained, which is used for the validity hard constraint in the subsequent vector superposition stage.

[0070] Step 2: Generate a ground truth mask based on vector overlay, and output a geospatial mask mask_*.tiff. 1) Coastline overlay analysis (spatial indexing and lightweighting): Parse the geographic transformation parameters of corrected_001.tiff and solve its geographic bounding box [x_min, y_min, x_max, y_max]; use the OGR spatial filter to extract the local coastline feature set intersecting with the bounding box, and dynamically set the simplification tolerance ε according to the output image resolution. Use the Douglas-Peucker algorithm to perform topological simplification on local features to reduce rasterization calculation and memory overhead.

[0071] 2) Memory-level vector rasterization: Create a single-band virtual raster R_mem in RAM with the same size and projection as corrected_001.tiff; burn the simplified coastline features into R_mem, set the coastline cell value V_coast=255, and obtain the temporary coastline matrix M_coast.

[0072] 3) Mask synthesis (Alpha hard constraint): Read the Alpha channel to construct the validity matrix M_valid; execute the logical decision according to the priority background (0) < valid area (1) < coastline (255) and output the three-value truth mask mask_001.tiff (WGS84 coordinate system). Its pixel semantic meaning is: 0 represents invalid filling area, 1 represents valid background area, and 255 represents valid coastline.

[0073] Step 3: Reverse sensor spatial reprojection and sample adaptation, outputting the original spatial mask inverse_*.tiff 1) Sparse projection model: The system does not scan the entire image pixel by pixel in mask_001.tiff, but only extracts its non-zero pixels (with values ​​of 1 or 255) to form the valid point set S_valid, thereby reducing the projection calculation from the full image level to the valid point level.

[0074] 2) Reverse adaptation (substantially reusing RPC ground-to-image point capability): For any valid geographic point (λ_i, φ_i, h_i), call the projection operator Ψ_RPC to calculate its floating-point coordinates (r_i, c_i) in the original image; scatter the corresponding semantic values ​​and write them into the sensor space mask Mask_sensor of the same size as raw_001.tiff to form the initial inverse_raw_001.tiff.

[0075] 3) Post-processing repair: For local cracks and isolated noise introduced by backscattering, morphological closing operations (5×5 elliptical structuring elements) are used to connect the fractures and suppress glitch, resulting in the final inverse_001.tiff file. This file is strictly aligned with raw_001.tiff in the sensor pixel coordinate system and can be directly used as a deep learning training label.

Claims

1. A method for wide-span remote sensing image segmentation and automatic sample generation based on map matching and forward / backward projection, characterized in that, Includes the following steps: Step 1. Using the original wide-span remote sensing image (.tiff), metadata (.rpb / .xml), and coastline vector data (.shp) as input triplets, the original wide-span remote sensing image is first cleaned and normalized by the image preprocessing module, and the metadata is processed and parsed using the RPC model. Then, it enters the geometric correction and registration module, which uses the RPC model to project the original image onto the WGS84 geographic coordinate system, generating a corrected image with an alpha channel (corrected_*.tiff). Step 2. Within the geospatial space, the coastline vector data is spatially indexed and matched with the corrected image using the coastline overlay analysis module; then, the vector data is automatically aligned and rasterized using a mask generation algorithm to construct a pixel-level aligned final ground truth mask (mask_*.tiff). Step 3. Read the final ground truth mask, original image, and metadata, and initialize the inverse mapping mesh through the coordinate transformation processing module; Next, the inverse coordinate transformation calculation module is used to solve the nonlinear mapping relationship from geographic coordinates to the original sensor pixel coordinates; Finally, after resampling, the semantic labels are accurately backfilled into the original image space, and the final inverse transform mask (inverse_*.tiff) is output.

2. The method for wide-span remote sensing image segmentation and automatic sample generation based on map matching and forward / backward projection according to claim 1, characterized in that, The image preprocessing module in step 1 specifically includes: Before initiating the processing flow, the system first executes a data scanning procedure; for each wide-span remote sensing image to be processed, the system performs strict I / O checks according to the file naming rules; Input definition: The image entity file of the original image. For L1 / L2 level products, the .tiff file stores the raw digital quantization (DN) values ​​acquired by the sensor, and the RPC parameter file containing metadata. It is a .rpb or .txt text file containing all the geometric parameters needed to establish the spatial mapping between the sensor plane and ground features; auxiliary metadata file. It is an .xml file that records the width, height, geographic bounding box, and sensor type of the image; Execute logical verification function Only when all three are present and the file header is complete will the valid path indexes of the three files be passed to the next level of the parsing module; otherwise, an exception handling mechanism will be triggered to skip the data group.

3. The method for wide-span remote sensing image segmentation and automatic sample generation based on map matching and forward / backward projection according to claim 2, characterized in that, In step 1, the RPC model performs automated semantic parsing of RPC parameters: The input valid path index is used to convert unstructured text into a numerical matrix through a semantic parsing algorithm based on regular expressions; a parsing mapping from text to the parameter domain is then constructed. Extract the key-value scalar items and bracketed list items from the RPB file into a numerical vector and reorganize them into a matrix form. For any scalar parameter row k=v, the formula is defined as follows: in This means taking the string on the right side of the equals sign. For floating-point number extraction and quantization operators; For coefficient list items, such as The formula is defined as follows: The final set of scalars obtained from the analysis With four sets of coefficient vectors: The RPC parameters are concatenated into a unified numerical parameter matrix representation, as follows: To achieve the conversion from semi-structured text to a numerical parameter representation that can directly participate in subsequent matrix operations; The system traverses the text stream and extracts two types of core geometric parameters: normalized scalar parameters and polynomial coefficient vectors. Finally, the extracted discrete values ​​are reassembled into a dictionary-structured set of values. It distinguishes between general parameter fields and core coefficient sequences, thus completing the transformation from textual semantics to numerical semantics.

4. The method for wide-span remote sensing image segmentation and automatic sample generation based on map matching and forward / backward projection according to claim 3, characterized in that, In step 1, based on the set of values Set the ground geographic coordinates as ,in Longitude Latitude The elevation is given by the original image coordinates. ,in For line numbers, For column number; system call The parameters in the table are defined by the following normalized mapping relationship: in , , This represents the geographic coordinate offset, specifically the latitude, longitude, and altitude coordinates of the geometric center point of the image coverage area. , , This represents the geographic coordinate scaling factor, indicating the half-span of the image coverage area in both latitude, longitude, and elevation directions. , Indicates the image coordinate offset. , Indicates the image coordinate scaling factor; Using the memory driver of the GDAL library, a virtual memory image object is created in RAM, and the SetMetadata interface is called to encapsulate and inject the RPC parameter model into the RPC property field of the object.

5. The method for wide-span remote sensing image segmentation and automatic sample generation based on map matching and forward / backward projection according to claim 4, characterized in that, The geometric correction and registration module uses a rational polynomial imaging model and a high-performance resampling algorithm to map the pre-processed virtual memory image object, which has been injected with RPC metadata, from the sensor coordinate system with geometric distortion to the standard WGS84 geographic coordinate system. The specific implementation process includes the following three core sub-steps: Step (1): Before performing pixel migration, establish the correspondence between the output image and the input image; the input image comes from the original remote sensing image and is combined with the RPC parameters provided by its supporting metadata; the geographic grid of the output image is constructed in the WGS84 geographic coordinate system with the corrected image obtained by RPC forward geographic correction as a reference, based on its coverage, spatial resolution and affine geographic transformation parameters. Step (2): After obtaining the mapping relationship, the system calls the geometric transformation engine to fill the pixel values; The grayscale value is calculated using bilinear interpolation resampling; the formula is as follows: in This indicates the corrected output image in geographic coordinates. Pixel value at that location, This represents the pixel value at a specified integer row and column position in the original image. , This means rounding the floating-point coordinates calculated in step (1) to the nearest integer reference pixel at the top left corner of the target point. Represents floating-point coordinates The distance weighting coefficient calculated from the fractional part satisfies ; Step (3): Generate the Alpha channel and output normalization, then generate the corrected image. Simultaneously, force synchronous output of an 8-bit alpha mask channel. Its assignment logic is defined as follows: in, This represents the transparency mask value at the corresponding position in the output image. A value of 255 indicates that the pixel is valid data, and a value of 0 indicates that the pixel is invalid background filling. Based on this, the final generated image file corrected_*.tiff is standardized and packaged using tile-based storage, LZW lossless compression, and BigTIFF format.

6. The method for wide-span remote sensing image segmentation and automatic sample generation based on map matching and forward / backward projection according to claim 5, characterized in that, The specific steps (1) are as follows: First, the target output coordinate system is defined as WGS84; the system divides the image into a uniform latitude and longitude grid based on the geographic bounding box of the image. For any point in the target grid Directly use normalized geographic coordinates Substitute the coefficients of the cubic polynomial from the parsed RPB file to calculate its dimensionless projected coordinates in the normalized image space. : in , , This represents the normalized longitude, latitude, and elevation calculated using formulas during the preprocessing stage. , Let represent the cubic polynomial functions in the numerator and denominator of the line direction, respectively. , Let represent the cubic polynomial functions of the numerator and denominator for the column direction (Sample), respectively. , This represents the calculated normalized row and column numbers, with values ​​ranging from 1 to 2. , which represents the relative positional proportion of a pixel within an image; The system performs the inverse operation of the image-side normalization formula defined in the preprocessing stage to obtain the real pixel index that can be used for resampling, and uses the parameters such as LINE_SCALE / OFF stored in the memory object to map the coordinates back to the sensor pixel coordinate system; The calculation formula is as follows: in , This represents the true floating-point row and column numbers in the solved original image, which will be used as input coordinates for subsequent resampling. , This represents the row direction scaling and translation parameters extracted and stored during the preprocessing stage, corresponding to... In lineScale and lineOffset.

7. The method for wide-span remote sensing image segmentation and automatic sample generation based on map matching and forward / backward projection according to claim 5, characterized in that, Step 2, the coastline overlay analysis, includes the following steps: Step (1): The system analyzes the geographic transformation parameters of the corrected image and calculates its geometric bounding box in the geographic coordinate system. Based on this, the OGR geometry engine is driven to construct a spatial filter to extract vector features intersecting the bounding box. For the selected local coastline features, the system further dynamically calculates a simplification tolerance based on the image's baseline resolution. And the Douglas-Peucker algorithm is used to perform topology downsampling on the vector nodes; Step (2): A virtual raster environment with the same size and projection as the corrected image is constructed in the computer memory and a fast conversion is performed to achieve pixel-level alignment between heterogeneous vector data and raster image in space; First, a single-band virtual dataset is instantiated using the GDAL memory driver. Its width, height, and geographic coordinate projection information are strictly inherited from the corrected image generated in the previous steps. This establishes a unified spatial benchmark. Based on this, the algorithm performs feature burning operations, directly mapping the topologically simplified vector features from step (1) to the virtual grid, and setting the coastline feature value as... Generate a temporary Boolean matrix of coastlines. Its numerical distribution logic is defined as follows: 。 8. The method for wide-span remote sensing image segmentation and automatic sample generation based on map matching and forward / backward projection according to claim 7, characterized in that, The specific steps of the mask generation algorithm are as follows: The temporary coastline Boolean matrix is ​​logically evaluated against the Alpha validity channel generated during the geometric correction stage to generate the final truth mask that conforms to the WGS84 coordinate system. First, the alpha channel of the corrected image is read to construct an effective data mask. Furthermore, the final ternary mask is synthesized according to the hierarchical logic of background (0) < effective region (1) < coastline (255). The model is defined as follows: The final generated matrix is ​​encoded as mask_*.tiff.

9. The method for wide-span remote sensing image segmentation and automatic sample generation based on map matching and forward / backward projection according to claim 8, characterized in that, The specific implementation process of step 3 includes three modules: coordinate transformation processing module, inverse coordinate transformation calculation module, and resampling and post-processing module. Coordinate transformation processing module: A sparse matrix-based inference model strategy is designed. First, the system reads the ground truth mask (mask_*.tiff) generated in the first stage and the metadata of the original image. Then, the system identifies the valid regions in the mask where pixel values ​​are non-zero, extracts their geographic coordinates, and constructs a sparse point set. The definition of this set is: in, The latitude and longitude coordinates corresponding to the effective pixels. This represents the mask matrix with standard geographic coordinates generated in the first stage; Inverse coordinate transformation calculation module: for sets For each geographic coordinate point, the algorithm calls the RPC parameters resolved in the preprocessing stage to perform projection calculations; here, this is defined as a discrete projection operator. : in, This represents the calculated floating-point row and column coordinates of the i-th feature point in the original sensor image space. This is a discrete projection operator constructed based on a rational polynomial coefficient model; the input vector is... Represents the normalized longitude, latitude, and elevation parameters; the polynomial terms in the formula , and , The cubic polynomial functions for the numerators and denominators, corresponding to the row and column directions respectively, are used to solve nonlinear geometric distortions; and , and , These represent the scaling factor and translation offset of the original image in the row and column directions, respectively, which are used to finally restore the normalized result calculated by the polynomial to the real pixel coordinates; Resampling and post-processing module: responsible for discretizing the floating-point sensor coordinates obtained by GPU parallel computing and reconstructing them into a two-dimensional raster image; In practice, the system initializes a memory array with the same size as the original image. A strictly uniform zero-value matrix is ​​mapped directly using GPU vectorization operations, scattering discrete feature points to fill the new matrix. The mapping logic is defined as follows: in, This represents the reconstructed original sensor space mask matrix; Represents the floating-point coordinates calculated by the inverse transformation. The integer row and column indices obtained after rounding; This is the target semantic label value assigned to that pixel location; The system introduces the OpenCV image processing engine to perform morphological closing operations, repairing pixel gaps or isolated noise points in the initially generated raster image. The operational model is as follows: in, I represents the final continuous mask image output after morphological restoration; I represents the initial mask image generated after discretization mapping; B represents the structuring element used for morphological scanning. and These represent morphological expansion and erosion operations, respectively. Finally, the processed matrix is ​​packaged into an inverse_*.tiff file, stored using LZW lossless compression and BigTIFF format, ensuring that the output is geometrically perfectly aligned with the original L1 / L2 level image, and directly used as the pixel-level ground truth for training the deep learning model.