High remote sensing image data organization and storage method based on classification subgraph
Through the high-remote sensing image data organization and storage method based on classification submap, the problem that the traditional remote sensing image storage model cannot meet the requirements of continuous samples in deep learning is solved, and high-quality and high-number of remote sensing image samples are achieved, and spectral depth super-score learning is supported.
Patent Information
- Application Number
- CN202510007529.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-04-15
AI Technical Summary
Traditional remote sensing image storage models cannot meet the continuous samples required by deep learning in remote sensing research, especially because the cell distribution of hyperspectral remote sensing images is in a discrete state, it is difficult to obtain spatially continuous and similar cell sets.
Using the high-remote sensing image data organization and storage method based on classification submap, a continuous hyperspectral remote sensing image submap is generated through the steps of hyperspectral image splitting and classification, classification submap and background image synthesis, and rolling back of multi-place hyperspectral remote sensing image sets.
It greatly improves the quality and quantity of samples required for spectral depth overscore of remote sensing images, and solves the problem that it is difficult to obtain spatially continuous and similar cell sets of cells in a single hyperspectral remote sensing image.
Smart Images

Figure CN119831842A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the research field of remote sensing image spectral depth super-resolution, and in particular to a high-resolution remote sensing image data organization and storage method based on classified subgraphs. Background Art
[0002] As a kind of high-dimensional geographic information, hyperspectral remote sensing images contain rich geographic spatial and spectral information, characterize the distribution of surface objects, and have extremely important research and application value. With the continuous development of remote sensing technology, this kind of hyperspectral remote sensing image with integrated image and spectrum has been widely used in fine classification, mineral detection, species identification and other fields. However, due to the limitation of the scanning angle of hyperspectral sensors, its image width is small and it is difficult to meet the needs of large-scale remote sensing applications. To this end, domestic and foreign scholars have proposed a multispectral and hyperspectral remote sensing image fusion theory to solve the problem of hyperspectral remote sensing image width. That is, using multispectral remote sensing images and hyperspectral remote sensing image pairs with overlapping areas, a spectral mapping method between images is established, and the spectral information of the original hyperspectral remote sensing image is mapped to the multispectral image to generate a synthetic hyperspectral remote sensing image with large width and high spatial resolution, such as "Wide-width hyperspectral image reconstruction method based on multi / hyperspectral image fusion" (application number 201310256179.2). At the same time, with the continuous development of deep learning technology, it has also achieved good fitting results in the study of remote sensing image spectral super-resolution.
[0003] Most studies on spectral depth super-resolution of remote sensing images require continuous and regular samples, while the spatial distribution of various types of objects in the real world is mostly discrete. Existing remote sensing image storage methods are difficult to effectively solve this problem of continuous and regular samples. For example, the remote sensing image storage methods disclosed in the patents named "A remote sensing data cloud storage method based on image block organization" (application number CN201310457067.3), "A remote sensing data storage method and storage system based on blockchain" (application number CN201910163311.2), and "A multi-dimensional organization method of multi-source remote sensing image data based on cloud storage" (application number CN201910205425.9) are all for the physical cloud storage and exchange of massive remote sensing images, and do not involve the organization and storage of individual remote sensing image pixel structures.
[0004] Since the traditional remote sensing image storage model has discrete objects, it cannot meet the scarcity of continuous samples required by current deep learning in remote sensing research. Therefore, a high-resolution remote sensing image data organization and storage method that can solve this problem is needed. Summary of the invention
[0005] In order to solve the problem that the traditional remote sensing image storage model has discrete objects and cannot meet the scarcity of continuous samples required by current deep learning in remote sensing research, the present invention provides a high-resolution remote sensing image data organization and storage method based on classified subgraphs.
[0006] The specific content of the present invention is as follows: A method for organizing and storing high-resolution remote sensing image data based on classified subgraphs, comprising the following steps: Step (1), hyperspectral image splitting and classification: for the hyperspectral remote sensing image and classification data, traverse the hyperspectral image pixels, obtain the pixel value array of the hyperspectral remote sensing image and classification data, store the hyperspectral image pixels of the same land class in the same memory block according to the corresponding pixel land class code in the classification data, and record the position coordinates of each pixel; Step (2), synthesis of classification sub-images and background images: Based on the hyperspectral image pixels stored in different memory blocks after classification, the maximum square size that can be formed is calculated, and classification sub-images are constructed respectively. At the same time, the redundant land class pixels are merged into the background pixel set, and a rectangular image with the smallest perimeter is constructed. A pixel position and land class space mapping file is generated, and saved as a collection of multiple hyperspectral remote sensing image sub-images; Step (3), rollback of multiple land-type hyperspectral remote sensing image collections: Based on the generated multiple hyperspectral remote sensing image sub-image collections, the hyperspectral remote sensing image sub-images are re-divided into blocks, and the order of reading pixels is calculated according to the pixel positions and the land-type spatial mapping file, and the pixels are read into the memory in the corresponding order, and the original hyperspectral image is restored and output.
[0007] Furthermore, step (1) includes: Step (11), reading the input hyperspectral remote sensing image data and the corresponding classification data in the form of an array, and saving them to the memory; Step (12), traverse the hyperspectral image pixels and create a new file to store the pixels; Step (13) traverses the pixel values of each band of the pixel, saves them in a newly created file, and names the file as the coordinates of the pixel in the original hyperspectral file; at the same time, according to the land class code in the classification data, the pixel file is stored in the corresponding memory block.
[0008] Furthermore, constructing the classification subgraph in step (2) includes: Step (21), reading the memory block storing the pixels, and obtaining the number of pixels of the same land type; Step (22), calculating the number of pixels required for the largest square remote sensing image that can be synthesized and the number of rows and columns of the grid matrix according to the number of pixels obtained; Step (23), creating a new file to store the classification sub-image according to the number of rows and columns of the grid matrix; Step (24), according to the discrete degree of pixel values of the same land type and the number of pixels required in step (22), the pixel with the smaller discrete degree of pixel value is selected; Step (25), traverse the pixel values of each band of the selected pixel, read them into the newly created file in sequence, and save the name of each pixel file as a file of the spatial mapping relationship between the pixel position and the land type.
[0009] Furthermore, the process of selecting pixels in step (24) includes: traversing all pixels of the same object, calculating the average value of the pixels of the object, and comparing individual pixels with the average value, taking pixels with a smaller degree of discreteness than the average value to construct a classification sub-image, and moving the remaining pixels to be merged into the background pixel set.
[0010] Furthermore, the process of constructing the background pixel set in step (2) includes: Step (26), reading the memory block storing the pixels, and obtaining the number of pixels of the same land type; Step (27), calculating the method with the smallest rectangular perimeter among the methods that can synthesize the rectangular remote sensing image according to the number of pixels obtained, and creating a new file to store the background image; Step (28), traverse the pixel values of all pixel bands, read them into the file storing the background image in sequence, and generate a file of the spatial mapping relationship between the pixel position and the land type.
[0011] Furthermore, in step (27), the method for calculating the method of minimizing the perimeter of the rectangle in the method of calculating the pixels that can synthesize the rectangular remote sensing image includes: calculating all factors of the number of pixel images read, and taking a pair of factors with the smallest difference as the length and width of the background image.
[0012] Furthermore, step (3) includes: Step (31), each classification sub-image and background image saves all pixels into the same memory block according to the method of steps (12) and (13), and reads the corresponding pixel position and land class spatial mapping relationship file; Step (32), according to the file of spatial mapping relationship between pixel position and land type, restore the names of all pixel files; Step (33), creating a new file for storing the restored hyperspectral remote sensing image, and reading all pixels into the file in sequence according to the positional relationship contained in their file names.
[0013] Further, step (33) includes: reading all pixels into a list, calculating the sequence number of each pixel vector according to the name of the pixel image, that is, the row and column number of the pixel in the original image, the calculation method is: (total number of columns - 1) × row number + column number, rearranging all the data in the list according to the sequence number, and reading the data in the list into the newly created file in sequence The present invention aims at the pixel requirements of spectral depth super-resolution learning of multispectral and hyperspectral remote sensing images, solves the current problem that it is difficult to obtain a set of spatially continuous and homogeneous pixels in a single hyperspectral remote sensing image, and can greatly improve the quality and quantity of samples required for spectral depth super-resolution of remote sensing images. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The specific implementation of the present invention will be further explained below in conjunction with the accompanying drawings.
[0015] Figure 1 It is a flow chart of the method for organizing and storing high remote sensing image data based on classified subgraphs of the present invention; Figure 2 This is a diagram of the synthesis process of the classification sub-image and the background image of the present invention; Figure 3 A schematic diagram of the process of restoring a hyperspectral image sub-image into a hyperspectral image according to the present invention; Figure 4a This is a pseudo-color composite image of the Idinapine during the splitting, reorganization and rollback process of the Indian Pines dataset in an embodiment of the present invention; Figure 4b It is a classification subgraph in the process of splitting, reorganizing and rolling back the Indian Pines dataset in an embodiment of the present invention; Figure 4c It is a rollback image in the process of splitting, reorganizing and rolling back the Indian Pines dataset in an embodiment of the present invention. DETAILED DESCRIPTION
[0016] Combination Figure 1 The invention provides a method for organizing and storing high-resolution remote sensing image data based on classified subgraphs, including hyperspectral image splitting and classification, classification subgraph and background image synthesis, and multi-region hyperspectral remote sensing image collection rollback. The invention focuses on the sample requirements for deep learning applications on remote sensing images, and provides a new technical route to meet the pixel requirements for deep spectral super-resolution learning of multispectral and hyperspectral remote sensing images, which can greatly improve the sample quality and quantity required for deep spectral super-resolution of remote sensing images.
[0017] This example uses Windows 10 as the operating system environment, PyCharm 2020.1 x64 as the development environment, Python as the development language, and the hyperspectral file is stored as a tif file. The Indian Pines dataset and tif file are used as sample data. The specific solution includes: 1. Hyperspectral Image Segmentation and Classification For hyperspectral remote sensing images and classified data, traverse the hyperspectral image pixels, obtain the pixel value array of the hyperspectral remote sensing image and classified data, store the hyperspectral image pixels of the same land class in the same memory block according to the corresponding pixel land class code in the classified data, and record the position coordinates of each pixel. The specific steps include: Step 11, respectively reading the input hyperspectral remote sensing image data and the corresponding classification data in the form of an array, and saving them to the memory; Step 12, traverse the hyperspectral image pixels and create a new file to store the pixels; Step 13, traverse the pixel values of each band of the pixel, save them in a newly created file, and name the file as the coordinates of the pixel in the original hyperspectral file; at the same time, according to the land class code in the classification data, store the pixel file in the corresponding memory block.
[0018] In this embodiment, a hyperspectral image and a classification data set or a classification image (the IndianPines data set in this example is a .mat file) are input, and the raster data is read by the ReadAsArray method, and converted into an array and saved in memory. At the same time, the two arrays are traversed, and the gdal.GetDriverByName method is used to create a TIF file with the same information as the original hyperspectral image band number, projection, etc., but the number of rows and columns of the raster matrix is 1×1. Using the WriteArray function, the pixel values of each band of the traversed hyperspectral image pixel are read into the TIF file, and the name of the TIF file is named as the coordinate position of the pixel. According to the value of the classification array read to the same position, the assigned TIF file is stored in the corresponding position. After all pixels of the hyperspectral image are traversed, the number of TIF files in each storage file should be the same as the number of pixels of the hyperspectral image. At the same time, if there are land classes that are not related to the research object in the hyperspectral image, the classification results can be divided into two categories: background pixel set and classification sub-pixel set.
[0019] 2. Classification sub-image and background image synthesis Based on the hyperspectral image pixels stored in different memory blocks after classification, the maximum square size that can be formed is calculated, and the classification sub-images are constructed respectively. At the same time, the redundant land class pixels are merged into the background pixel set, and the rectangular image with the smallest perimeter is constructed. The pixel position and land class space mapping file is generated and saved as a collection of multiple hyperspectral remote sensing image sub-images, such as Figure 2 The specific steps include: Step 21: Determination of classified pixels and background pixels The judgment of classified pixels and background pixels refers to judging whether the pixels in the folder are background pixels or classified pixels based on the name of the folder, and synthesizing sub-images in a targeted manner according to different pixel types. The specific steps are as follows: input the directory where each pixel folder is stored, traverse each folder, judge whether the stored content is background pixels or classified pixels based on its name, and perform different sub-image synthesis methods according to the two different pixel types.
[0020] Step 22, calculate the size of the classification sub-graph Calculating the size of the classified sub-image refers to calculating the classified pixels according to their specific number to obtain the size of the synthesized hyperspectral land class sub-image image. The specific steps include: taking the square root of the number of pixel images in the read folder, rounding it down and then squaring it, respectively obtaining the size of the classified sub-image image and the number of images used to synthesize the hyperspectral land class sub-image, and creating a suitable TIF file based on the data.
[0021] Step 23: Selection of optimal classification sub-image element The optimal classification sub-image element selection refers to selecting pixels with small discreteness of pixel values for synthesizing the optimal hyperspectral land class sub-image image. The specific steps include: traversing all pixel images in the folder, calculating the average value of all pixels, and obtaining the average pixel of the land class. Compare each pixel with the average pixel, that is, calculate the spectral angle of the two, and take the pixel with small spectral angle to synthesize the optimal hyperspectral land class sub-image image. At the same time, move the pixels with large discreteness to the background pixel set and merge them into background pixels.
[0022] Step 24: Synthesis of the optimal classification subgraph The synthesis of the optimal classification sub-image refers to synthesizing the selected classification sub-image elements into the optimal hyperspectral land class sub-image image. The specific steps include: traversing the pixel values of each band of the selected pixel, reading them into the newly created file in sequence, and saving the name of each pixel file as a file of the spatial mapping relationship between the pixel position and the land class.
[0023] In this embodiment, the pixels used to synthesize the optimal hyperspectral land class sub-image are read into the list, and the name of the TIF file is saved in the TXT file. The list is traversed, and the gdal.Open method is used to open each pixel image to obtain a GDALDataset object. At the same time, the ReadAsArray method is used to convert the GDALDataset object into an array and store it in the list. The Reshape method is used to convert the three-dimensional array in the list into a two-dimensional array (the number of rows and columns of the raster data is merged, the number of bands is retained, and the number of traversals is reduced), and finally the pixel values are assigned band by band to the newly created TIF file.
[0024] Step 25: Background image synthesis Background image synthesis refers to the process of constructing a remote sensing image with the smallest perimeter when there are ground-type pixel vectors outside the research in the hyperspectral image, including the remaining pixels when the optimal classification sub-image is generated, calculating according to the number of such pixels, creating a new file to store the background image, traversing the pixel values of all pixel bands, and reading them into the file storing the background image in sequence, and generating a file of the relationship between the pixel position and the ground-type space mapping. The specific steps for constructing a remote sensing image with the smallest perimeter are: calculating all factors of the number of pixel images read, and taking a pair of factors with the smallest difference as the length and width of the background image.
[0025] In this embodiment, a new TIF file is created based on the data. All pixels are traversed, and the pixel values of each band of the pixel are read into the newly created TIF file in turn to synthesize the background image (the specific process is similar to step 24). At the same time, the names of all TIF files are saved in the TXT file.
[0026] 3. Rollback of Hyperspectral Remote Sensing Image Collections of Multiple Land Types Based on the generated multiple hyperspectral remote sensing image sub-image sets, the hyperspectral remote sensing image sub-images are re-blocked, and the order of reading pixels is calculated according to the pixel positions and the land type spatial mapping file. The pixels are read into the memory in the corresponding order, and the original hyperspectral image is restored and output, such as Figure 3 The specific steps include: Step 31: Restore the hyperspectral image sub-image Restoring the hyperspectral image sub-image means splitting the synthesized classification sub-image and the background image back into a single pixel image. The specific steps are: read the folder storing the hyperspectral image sub-image, traverse each sub-image and the generated pixel position and land class space mapping file in turn, and restore the sub-image into a single pixel image using the splitting method in the hyperspectral image splitting and classification (the specific process is similar to the splitting method in the hyperspectral image splitting and classification), and restore the file name of each pixel vector according to the mapping file.
[0027] Step 32: Restore the hyperspectral image Restoring a hyperspectral image means re-synthesizing all the split pixels into an image identical to the original hyperspectral remote sensing image. The specific steps include: reading all the pixels into a list, calculating (total number of columns - 1) × row number + column number to get the sequence number of each pixel vector according to the name of the pixel image, that is, the row and column number of the pixel in the original image, and rearranging all the data in the list according to the sequence number. Create a new TIF file identical to the original hyperspectral remote sensing image, and read the data in the list into the new TIF file in sequence (the specific process is the same as step 4 in the synthesis of classification sub-images and background images), thereby restoring the hyperspectral remote sensing image. Close the index sequence container and the data sequence container, and release all other system I / O resources.
[0028] like Figure 4a-4c The figure shows a schematic diagram of splitting, reorganizing and rolling back the Indian Pines data set in this embodiment, where Figure 4b It is a whole picture and contains obvious boundary lines, which are used to clearly compare the differences between the classification sub-pictures. After splitting, the result will consist of 16 classification sub-pictures and a background image, and is not stored in the form of a single picture. Using the method of this application, images of the quality and quantity required to meet the pixel requirements of spectral deep super-resolution learning of multispectral and hyperspectral remote sensing images can be obtained.
[0029] The hyperspectral image splitting, classification sub-image synthesis and image restoration methods provided by the present invention can better meet the needs of deep learning for continuous and regular samples in remote sensing image applications. The method of the present invention is aimed at the pixel requirements of spectral deep super-resolution learning of multi-spectral and hyperspectral remote sensing images, solves the problem that it is difficult to obtain a set of pixels that are spatially continuous and of the same geographical type in a single hyperspectral remote sensing image, and can greatly improve the quality and quantity of samples required for spectral deep super-resolution of remote sensing images.
[0030] Many specific details are described in the above description to facilitate a full understanding of the present invention. However, the above description is only a preferred embodiment of the present invention. The present invention can be implemented in many other ways different from those described herein, so the present invention is not limited to the specific implementation disclosed above. At the same time, any person familiar with the art can make many possible changes and modifications to the technical solution of the present invention using the methods and technical contents disclosed above without departing from the scope of the technical solution of the present invention, or modify it into an equivalent embodiment of equivalent changes. Any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of protection of the technical solution of the present invention.
Claims
1. A method for organizing and storing high-resolution remote sensing image data based on classified subgraphs, characterized in that: The steps include: Step (1), hyperspectral image splitting and classification: for the hyperspectral remote sensing image and classification data, traverse the hyperspectral image pixels, obtain the pixel value array of the hyperspectral remote sensing image and classification data, store the hyperspectral image pixels of the same land class in the same memory block according to the corresponding pixel land class code in the classification data, and record the position coordinates of each pixel; Step (2), synthesis of classification sub-images and background images: Based on the hyperspectral image pixels stored in different memory blocks after classification, the maximum square size that can be formed is calculated, and classification sub-images are constructed respectively. At the same time, the redundant land class pixels are merged into the background pixel set, and a rectangular image with the smallest perimeter is constructed. A pixel position and land class space mapping file is generated, and saved as a collection of multiple hyperspectral remote sensing image sub-images; Step (3), rollback of multiple land-type hyperspectral remote sensing image collections: Based on the generated multiple hyperspectral remote sensing image sub-image collections, the hyperspectral remote sensing image sub-images are re-divided into blocks, and the order of reading pixels is calculated according to the pixel positions and the land-type spatial mapping file, and the pixels are read into the memory in the corresponding order, and the original hyperspectral image is restored and output.
2. The method for organizing and storing high-resolution remote sensing image data based on classified subgraphs according to claim 1, characterized in that: Step (1) includes: Step (11), reading the input hyperspectral remote sensing image data and the corresponding classification data in the form of an array, and saving them to the memory; Step (12), traverse the hyperspectral image pixels and create a new file to store the pixels; Step (13) traverses the pixel values of each band of the pixel, saves them in a newly created file, and names the file as the coordinates of the pixel in the original hyperspectral file; at the same time, according to the land class code in the classification data, the pixel file is stored in the corresponding memory block.
3. The method for organizing and storing high-resolution remote sensing image data based on classified subgraphs according to claim 2 is characterized in that: The construction of the classification subgraph in step (2) includes: Step (21), reading the memory block storing the pixels, and obtaining the number of pixels of the same land type; Step (22), calculating the number of pixels required for the largest square remote sensing image that can be synthesized and the number of rows and columns of the grid matrix according to the number of pixels obtained; Step (23), creating a new file to store the classification sub-image according to the number of rows and columns of the grid matrix; Step (24), according to the discrete degree of pixel values of the same land type and the number of pixels required in step (22), the pixel with the smaller discrete degree of pixel value is selected; Step (25), traverse the pixel values of each band of the selected pixel, read them into the newly created file in sequence, and save the name of each pixel file as a file of the spatial mapping relationship between the pixel position and the land type.
4. The method for organizing and storing high-resolution remote sensing image data based on classified subgraphs according to claim 3 is characterized in that: The process of selecting pixels in step (24) includes: traversing all pixels of the same object, calculating the average value of the pixels of the object, comparing individual pixels with the average value, taking pixels with a smaller degree of discreteness than the average value to construct a classification sub-image, and moving the remaining pixels to be merged into the background pixel set.
5. The method for organizing and storing high-resolution remote sensing image data based on classified subgraphs according to claim 3 is characterized in that: The process of constructing the background pixel set in step (2) includes: Step (26), reading the memory block storing the pixels, and obtaining the number of pixels of the same land type; Step (27), calculating the method with the smallest rectangular perimeter among the methods that can synthesize the rectangular remote sensing image according to the number of pixels obtained, and creating a new file to store the background image; Step (28), traverse the pixel values of all pixel bands, read them into the file storing the background image in sequence, and generate a file of the spatial mapping relationship between the pixel position and the land type.
6. The method for organizing and storing high-resolution remote sensing image data based on classified subgraphs according to claim 5 is characterized in that: The method for calculating the minimum perimeter of the rectangle in the method for calculating the pixel-synthesized rectangular remote sensing image in step (27) includes: calculating all factors of the number of pixel images read, and taking a pair of factors with the smallest difference as the length and width of the background image.
7. The method for organizing and storing high-resolution remote sensing image data based on classified subgraphs according to claim 2 is characterized in that: Step (3) includes: Step (31), each classification sub-image and background image saves all pixels into the same memory block according to the method of steps (12) and (13), and reads the corresponding pixel position and land class spatial mapping relationship file; Step (32), according to the file of spatial mapping relationship between pixel position and land type, restore the names of all pixel files; Step (33), creating a new file for storing the restored hyperspectral remote sensing image, and reading all pixels into the file in sequence according to the positional relationship contained in their file names.
8. The method for organizing and storing high-resolution remote sensing image data based on classified subgraphs according to claim 7 is characterized in that: Step (33) includes: reading all pixels into a list, calculating the sequence number of each pixel vector according to the name of the pixel image, that is, the row and column number of the pixel in the original image, the calculation method is: (total number of columns - 1) × row number + column number, all data in the list are rearranged according to the sequence number, and the data in the list are read into the newly created file in sequence.
Citation Information
Patent Citations
Method for reconstructing wide hyperspectral image based on fusion of multispectral / hyperspectral images
CN103325096A
Remote sensing data cloud storage method based on image block organization
CN103491185A
A blockchain-based remote sensing data storage method and storage system
CN109918378B
Multi-source remote sensing image data multi-dimensional organization method based on cloud storage
CN110110107A