CN115840761A - Satellite image pixel value modification method, system, equipment and medium - Google Patents
Satellite image pixel value modification method, system, equipment and medium Download PDFInfo
- Publication number
- CN115840761A CN115840761A CN202310182265.7A CN202310182265A CN115840761A CN 115840761 A CN115840761 A CN 115840761A CN 202310182265 A CN202310182265 A CN 202310182265A CN 115840761 A CN115840761 A CN 115840761A
- Authority
- CN
- China
- Prior art keywords
- satellite image
- image data
- grid
- pixel
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Image Processing (AREA)
Abstract
The invention discloses a method, a system, equipment and a medium for modifying a pixel value of a satellite image, which relate to the field of geographic information, and the method comprises the following steps: generating an absolute reference path of each wave band according to the format and the type of the target satellite image data; generating mask parameters according to the space constraint conditions; generating a database query statement according to the attribute constraint condition; according to the mask parameters and the database query statements, performing condition testing on each wave band of the target satellite image data respectively to obtain binary grids corresponding to each wave band, and further determining a sparse grid for representing target pixels to be modified; generating a raster object according to the absolute reference path; and modifying the corresponding pixel values in the grid object by taking the sparse grid as a spatial position index to obtain modified satellite image data. The method can quickly and accurately find out and modify the pixels needing to be processed in the satellite image data, improve the data processing efficiency and reduce the time consumption of data processing.
Description
Technical Field
The invention relates to the field of geographic information, in particular to a method, a system, equipment and a medium for modifying a pixel value of a satellite image.
Background
In the field of geographic information, grid data is used to record certain physicochemical information, such as spectral information, temperature information, etc., of a certain region in the real world. Satellite imagery is the most common raster data. In general, due to the large spatial extent of such data recording, the volume of raster data is also increasing in the context of increasing data resolution. In the fine-grained processing of such raster data pixel values, only a very small fraction (on the order of about a hundred thousand or even less) of the hundreds of millions of pixels typically need to be processed. How to quickly and accurately find out the pixels needing to be processed and modify the pixels has application value. In the current solution, one type of sacrifice efficiency means traversing all pixels and judging whether processing is needed one by one; the other type utilizes the principle of 'image element aggregation' to reduce the resolution of the grid and retain specific values, and gradually reduces the area to be processed in the process. The method cannot effectively adapt to the raster data under the spatial constraint and cannot cope with the complex attribute constraint condition of the pixel value.
Disclosure of Invention
The invention aims to provide a method, a system, equipment and a medium for modifying a pixel value of a satellite image, so as to quickly and accurately find out and modify pixels needing to be processed in satellite image data, improve the data processing efficiency and reduce the time consumption of data processing.
In order to achieve the purpose, the invention provides the following scheme:
a method for modifying a pixel value of a satellite image comprises the following steps:
acquiring the format and the type of target satellite image data; the types include: single band images and multi-band images;
generating an absolute reference path of each wave band of the target satellite image data according to the format and the type;
determining a space constraint condition, and generating a mask parameter corresponding to the target satellite image data according to the space constraint condition;
determining attribute constraint conditions, and generating database query statements corresponding to each wave band of the target satellite image data according to the attribute constraint conditions;
performing condition testing on each wave band of the target satellite image data respectively according to the mask parameters and the database query statements to obtain binary grids corresponding to each wave band of the target satellite image data;
determining a sparse grid according to the binary grid; the sparse grid is used for representing target pixels in the target satellite image data; the target pixel is a pixel in the target satellite image data, the spatial position of which meets the spatial constraint condition, and the pixel value of each wave band of which meets the attribute constraint condition;
generating a raster object corresponding to each wave band of the target satellite image data according to the absolute reference path;
and modifying the pixel values corresponding to the grid objects by taking the sparse grid as a spatial position index to obtain modified satellite image data.
Optionally, the performing condition test on each band of the target satellite image data according to the mask parameter and the database query statement to obtain a binary grid corresponding to each band of the target satellite image data specifically includes:
determining an interested region in the target satellite image data according to the mask parameter;
in the region of interest, performing condition testing on pixel values of all pixels of each wave band of the target satellite image data according to the database query statement;
and setting the value of the grid unit corresponding to the pixel which does not pass the condition test as a first set value and the value of the grid unit corresponding to the pixel which passes the condition test as a second set value for any wave band of the target satellite image data, and determining the array formed by all the grid units as the binary grid.
Optionally, determining a sparse grid according to the binary grid specifically includes:
when the target satellite image data is a single-band image:
setting the grid unit with the median value of the binary grid as a first set value as a null value to obtain a sparse grid;
when the target satellite image data is a multiband image:
performing logical operation on the binary grids corresponding to each wave band of the target satellite image data to obtain the binary grids after operation;
and setting the grid unit with the median value of the computed binary grid as a first set value as a null value to obtain the sparse grid.
Optionally, modifying a pixel value corresponding to the grid object by using the sparse grid as a spatial position index to obtain modified satellite image data, specifically including:
adopting a pixel iterator, taking the sparse grid as a spatial position index, and accessing corresponding pixels in the grid object one by one according to the ascending sequence of row and column numbers; the corresponding pixel is the pixel with the same row number and column number as the sparse grid in the grid object;
and modifying the pixel value of the corresponding pixel in the raster object according to a set processing formula to obtain modified satellite image data.
Optionally, the setting processing formula specifically includes:
when the pixel value of the corresponding pixel in the grid object is 0, adding 1 to the pixel value;
and when the pixel value of the corresponding pixel in the grid object is 255, subtracting 1 from the pixel value.
Optionally, the first set value is 0, the second set value is 1, and the logical operation is a logical and operation.
Optionally, the first set value is 1, the second set value is 0, and the logical operation is a logical or operation.
A satellite image pixel value modification system comprises:
the data acquisition module is used for acquiring the format and the type of the target satellite image data; the types include: single band images and multi-band images;
a path generation module, configured to generate an absolute reference path of each band of the target satellite image data according to the format and the type;
the space constraint module is used for determining a space constraint condition and generating a mask parameter corresponding to the target satellite image data according to the space constraint condition;
the attribute constraint module is used for determining attribute constraint conditions and generating database query statements corresponding to each wave band of the target satellite image data according to the attribute constraint conditions;
the condition testing module is used for respectively carrying out condition testing on each wave band of the target satellite image data according to the mask parameters and the database query statements to obtain binary grids corresponding to each wave band of the target satellite image data;
a sparse grid determining module for determining a sparse grid from the binary grid; the sparse grid is used for representing target pixels in the target satellite image data; the target pixel is a pixel in the target satellite image data, the spatial position of which meets the spatial constraint condition, and the pixel value of each wave band of which meets the attribute constraint condition;
the raster object determining module is used for generating raster objects corresponding to all wave bands of the target satellite image data according to the absolute reference path;
and the pixel value modification module is used for modifying the corresponding pixel value in the grid object by taking the sparse grid as a spatial position index to obtain modified satellite image data.
An electronic device comprising a memory for storing a computer program and a processor for executing the computer program to cause the electronic device to perform the method as described above.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the above-mentioned method.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
according to the satellite image pixel value modification method, the mask parameters are generated according to the space constraint conditions, the database query statements are generated according to the attribute constraint conditions, the sparse grid is determined by utilizing the mask parameters and the database query statements to represent the target pixels in the target satellite image data, the pixels which meet the space constraint conditions and the attribute constraint conditions in the target satellite image data can be screened out, the sparse grid is used as the space position index, the pixel values of the corresponding positions in the target satellite image data are accessed and modified, the data processing efficiency can be improved, and the processing time consumption is greatly reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flow chart of a method for modifying pixel values of satellite images according to the present invention;
FIG. 2 is a schematic diagram of the logic and operation implemented by the map algebra function according to the present invention;
FIG. 3 is a schematic diagram of satellite image data satisfying spatial constraints according to the present invention;
fig. 4 is a block diagram of a satellite image pixel value modification system according to the present invention.
Description of the symbols:
the system comprises a data acquisition module-1, a path generation module-2, a space constraint module-3, an attribute constraint module-4, a condition test module-5, a sparse grid determination module-6, a grid object determination module-7 and a pixel value modification module-8.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention aims to provide a method, a system, equipment and a medium for modifying a pixel value of a satellite image, so as to quickly and accurately find out and modify pixels needing to be processed in satellite image data, improve the data processing efficiency and reduce the time consumption of data processing.
Specifically, the method converts an image into a raster object by using a map algebra function in an ArcGIS platform, sets independent pixel value screening conditions with controllable logical relation for a single or multiple wave bands, limits a spatial processing range of data by using mask parameters, finishes pixel screening operation by using a raster function, and modifies pixel values meeting the screening conditions in raster data to be processed (namely target satellite image data) one by using a pixel iterator according to a preset pixel value processing formula to obtain the processed raster data (namely the modified satellite image data).
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
As shown in fig. 1, the present invention provides a method for modifying a pixel value of a satellite image, comprising:
step S1: acquiring the format and the type of target satellite image data; the types include: single band images and multi-band images.
Specifically, common file formats of the satellite image data include a GeoTiff format, an ERDAS image format, an eri Grid format, and the like. Wherein, the file extension name corresponding to the GeoTiff format is Tif; the file extension corresponding to the ERDAS IMAGINE format is img; the Esri Grid format has no extension.
Satellite image data can be divided into a single-waveband image and a multi-waveband image according to the number of wavebands, the single-waveband image is generally described by a black-white gray scale image, the multi-waveband image is generally described by a color image of an RGB (red, green and blue) synthesized pixel value, namely the data of the three wavebands are loaded through three channels of red, green and blue respectively, so that the data are rendered.
Step S2: and generating an absolute reference path of each wave band of the target satellite image data according to the format and the type.
Specifically, according to the format and type of the satellite image data, a corresponding absolute reference path of the satellite image data or each band data below the satellite image data in a computer storage medium is generated.
For a single-band image, the absolute reference path is the absolute storage path of a file with an extension, such as "C: \ single-band image.
For a multiband image, for absolute reference paths of different bands, expansion needs to be performed after the absolute storage path of a file of the multiband image, and different file formats have differences, such as a common GeoTiff format, a "Band _ N" should be added, where N represents a serial number of a Band, for example, "C: \ multiband image.
And step S3: and determining a space constraint condition, and generating a mask parameter corresponding to the target satellite image data according to the space constraint condition.
And step S4: and determining an attribute constraint condition, and generating a database query statement corresponding to each wave band of the target satellite image data according to the attribute constraint condition.
Specifically, the attribute constraint conditions of the user on the pixel values are converted into database query statements.
The pixels, also known as pixels or pels, are the smallest units that make up the digitized image. The satellite image data can be regarded as a data array of m rows × n columns and m × n pixels in total, for a single-waveband image, each pixel can store one value, namely a pixel value, and for a multiband image, each pixel correspondingly stores the same number of values as the waveband number.
The attribute constraint of the pixel VALUE is proposed according to the actual requirement of the user, for example, the requirement of the user is "the pixel VALUE of the image should avoid an extreme VALUE", in the specific implementation, the attribute constraint condition that the pixel VALUE is 0 OR 255 (taking an image with 8 bits as an example) "should be set, and the conversion into the query statement is" VALUE = 0 OR VALUE = 255".
The attribute constraint condition means that a user hopes to screen out part of pixels meeting the constraint condition from all pixels of the target satellite image by taking the value range of the pixel value as constraint, and participates in subsequent processing. Such as: setting a constraint condition that the pixel VALUE is less than 10 OR more than 245 ' aiming at the single-waveband image, and converting the constraint condition into a database query statement ' VALUE < 10 OR VALUE > 245 '; setting a constraint condition that the wave band one-pixel VALUE is 0 AND the wave band two-pixel VALUE is 255 OR the wave band three-pixel VALUE is more than 5 AND less than 10 for the multiband image, AND converting the image into a database query statement of (VALUE = 0) AND (VALUE = 255) OR (VALUE > 5 AND VALUE < 10) ".
Step S5: and respectively performing condition testing on each wave band of the target satellite image data according to the mask parameters and the database query statements to obtain binary grids corresponding to each wave band of the target satellite image data.
As a specific implementation manner, step S5 specifically includes:
step S51: and determining an interested area in the target satellite image data according to the mask parameters.
Step S52: and in the region of interest, performing condition test on pixel values of all pixels of each wave band of the target satellite image data according to the database query statement.
Step S53: and setting the value of the grid unit corresponding to the pixel which does not pass the condition test as a first set value and the value of the grid unit corresponding to the pixel which passes the condition test as a second set value for any wave band of the target satellite image data, and determining the array formed by all the grid units as the binary grid. That is, the grid cell is an element in the binary grid, and the value of the grid cell is determined according to the result of conditional testing of the pixels of the same row and column number. Specifically, the first set value is 0 or 1, and the second set value is 1 or 0.
As a specific implementation manner, based on the database query statement constructed in step S4, a "condition test" tool in the ArcGIS space analysis toolkit is used for each band in the single-band satellite image itself or in the multi-band satellite image. The SQL query parameters required in the tool come from step S4.
For multi-band satellite imagery, each band must use a "condition test" tool independently, such as the example in step S4, for the first band, when the condition test tool is used, the query parameter is "VALUE = 0", AND for the third band, "VALUE > 5 AND VALUE < 10".
In addition, since the region of interest is usually an irregular polygon, and the image data is a standard rectangle, the data processing range needs to be controlled by using a spatial constraint, and therefore, another important parameter "mask" needs to be set for the tool at the same time, i.e. the spatial constraint. The term "mask" refers to a region of interest that should be indicated using a graphic of a planar element, i.e., a mask, when processing image data, where the region of interest relates only to a local spatial range of the data. The result of the tool execution is a binary grid having the same number of rows and columns as the input image.
As a specific implementation, in step S5, for a pixel value passing the test, the value of the grid cell in the binary grid is 1, and otherwise, the value is 0.
Step S6: determining a sparse grid according to the binary grid; the sparse grid is used for representing target pixels in the target satellite image data; the target pixel is a pixel in the target satellite image data, the spatial position of which meets the spatial constraint condition, and the pixel value of each band of which meets the attribute constraint condition.
As a specific implementation, step S6 specifically includes:
when the target satellite image data is a single-band image: and setting the grid unit with the median value of the binary grid as a first set value as a null value to obtain the sparse grid.
When the target satellite image data is a multiband image: performing logical operation on the binary grids corresponding to each wave band of the target satellite image data to obtain the binary grids after operation; and setting the grid unit with the median value of the computed binary grid as a first set value as a null value to obtain the sparse grid.
In this embodiment, the target pixel is a pixel in the target satellite image data, which has the same row number as the sparse grid.
Further, the first set value is 0, the second set value is 1, and the logical operation is a logical and operation; or, the first set value is 1, the second set value is 0, and the logical operation is a logical or operation.
As a specific embodiment, for the single-band satellite image, the sparse grid can be determined directly by using the execution result of step S5. For the multiband satellite images, a map algebra function is used to perform logic operation on the execution result of the step S5 of each band, so that logic constraint of different band constraint conditions is realized. The map algebra is an algebra language for grid data under the ArcGIS platform, and can be used for implementing logic operation among a plurality of grid data, and fig. 2 shows a logic and operation result implemented by using a "map algebra" function.
Further, the "set to null function (SetNull)" in the ArcGIS spatial analysis is used for the above execution result, and the pixel having the pixel value of 0 is set to "null", that is, an invalid pixel. In general, the proportion of pixels satisfying both the attribute constraint and the spatial constraint to the total number of pixels is very low, so the execution result of this step will generate a "sparse grid" data containing only few effective pixels. As shown in fig. 2, after the post-operation binary grid on the right side of the equal sign, after the SetNull function is used, positions where all pixel values are 0 are marked as invalid pixels, that is, null pixels, at this time, in the whole m × n pixel array, only a very few sporadically distributed valid pixels, that is, target pixels, exist, and this grid data is called sparse grid data.
Step S7: and generating a raster object corresponding to each wave band of the target satellite image data according to the absolute reference path.
As a specific embodiment, based on the absolute reference path in step S2, a raster object of the satellite image data as a whole or a sub-raster object corresponding to each band below the raster object is created.
In the ArcGIS platform, a "Raster object" is a special state of Raster data, and is characterized in that in order to improve the access efficiency of data, a copy of key information of the Raster data stored in a disk is placed in a memory and is realized through a program code Raster (path) supported by the platform, wherein the path is an absolute reference path of the Raster data, for a single-band image, the reference path corresponds to the entire image, and for a multi-band image, each band corresponds to one path. Theoretically, a multiband image can also create a raster object directly for the entire image, but it is substantially equivalent to the raster object created for the first band.
Step S8: and modifying the corresponding pixel values in the grid object by taking the sparse grid as a spatial position index to obtain modified satellite image data.
As a specific implementation manner, step S8 specifically includes:
step S81: and adopting a pixel iterator, taking the sparse grid as a spatial position index, and accessing corresponding pixels in the grid object one by one according to the ascending sequence of the row number and the column number. The corresponding pixels are pixels in the grid object with the same row-column number as the sparse grid.
Step S82: and modifying the pixel value of the corresponding pixel in the raster object according to a set processing formula to obtain modified satellite image data.
Preferably, the setting processing formula specifically includes: when the pixel value of the corresponding pixel in the grid object is 0, adding 1 to the pixel value; and when the pixel value of the corresponding pixel in the grid object is 255, subtracting 1 from the pixel value.
It should be noted that, after finding the pixel to be modified by using the attribute constraint condition and the spatial constraint condition, the user adopts which processing equation to modify the original pixel value, which is open, depending on the intention of the user, for example, if the user does not want to make an extreme value appear in the data, the pixel value 255 may be subtracted by 1, the pixel value 0 may be added by 1, or even the odd pixel value may be added by 1, the even pixel value may be subtracted by 1, etc. for other unknown purposes.
In this embodiment, the sparse grid generated in step S6 is used as a spatial position index, a pixel iterator is applied, and the pixel value at the corresponding position of the grid object generated in step S7 is modified according to a processing formula specified by a user, so as to achieve a processing effect.
The pixel iterator can access pixels at any appointed index in the appointed raster data, and under the default condition, the pixel iterator accesses the pixels one by one according to the ascending sequence of the row number and the column number, and the sparse raster generated in the step S6 is used as an index, so that the iteration process is limited in the effective pixels of the sparse raster. On the other hand, while accessing the pixel, modifying the pixel value of the corresponding position in the input satellite image according to the processing formula of the pixel value specified by the user, and storing the processing result when the iteration is finished, thereby realizing the processing effect. The processing formula refers to a modification manner of the original pixel value, for example, the original pixel value is P, and the user can specify that the processed pixel value is modified to P-1 or P × 2.
The satellite image pixel value modification method provided by the invention can be applied to various different actual scenes, such as: (1) the pixel values to be modified have some specific meaning and need to be avoided. As shown in fig. 3, the black part is a non-interest area, and the pixel value is characterized in that the three bands are all 0, and at this time, it is usually required that pixels with three bands all 0 cannot appear inside the interest area (i.e. the area satisfying the spatial constraint condition, i.e. other areas except the black part) in the picture, because the meaning of the pixels is confused with the peripheral black color indicating the non-interest area; (2) certain specific colors are replaced. This application is similar to color replacement in PS, but since the satellite images have coordinate information, the spatial extent set by the "mask" parameter is difficult to convert to an accurate selection area in PS, on the other hand the satellite image data volume is usually large, and if it is desired to edit in PS, it requires severe computer hardware requirements.
The method provided by the invention is further described in detail below by taking the correction of the pixel extremum of any band in the satellite image as an example.
The satellite image is an image with high-precision geographical coordinate information, which is used for carrying various sensors by using a satellite to obtain data which comprehensively, truly and objectively reflects earth surface characteristics. In recent years, the generalized satellite images also include images acquired by low-altitude aerial photography (such as unmanned aerial vehicle aerial photography). In the process from the shooting of the image to the formation of the final finished product, in order to achieve a better visual effect, the image needs to be subjected to integral processing such as color mixing and color homogenizing, and extreme values of part of pixels are inevitably caused in the process. Extreme values (an extreme value here means that a pixel value is equal to an upper limit or a lower limit of a value range thereof, such as a 0 value or a 255 value in an 8-bit image) are generally not allowed to appear in a final product, so that a requirement for correcting the extreme values is generated.
Assuming that the format of a satellite image file covering a panorama of a certain county area is TIF, the file storage path is as follows: and C, a test image TIF comprises three 8-bit wave bands of RGB, and the process of correcting the extreme value by applying the method provided by the invention comprises the following steps:
(1) generating absolute reference paths for three bands:
c, TIF \ Band _1;
c, a \\ test image, TIF \ Band _2;
c, TIF \ Band _3.
(2) The attribute constraint conditions for screening the extreme values are as follows:
(VALUE = 0 OR VALUE = 255) OR (VALUE = 0 OR VALUE = 255) OR (VALUE = 0 OR VALUE = 255)。
(3) using a condition testing tool for the three wave bands respectively, wherein query parameters are all VALUE = 0 OR VALUE = 255, and the county-area range space vector data of the county is required to be used as mask parameters each time.
(4) And executing results on the condition testing tools of the three wave bands by using a map algebra function. Assuming that the execution result of the i-band is Ri, the map algebraic execution parameter is R1 OR R2 OR R3, and a binary grid is obtained.
(5) The binary grid is subjected to a "set to null function", and a sparse grid index _ Raster is generated.
(6) And converting the satellite image to be processed into a Raster object Raster _ obj.
(7) And (4) aiming at the grid object and the sparse grid in the step (6), executing a pixel iterator, namely a RasterCellItera ({ 'rasters': raster _ obj, index _ Raster ], 'skipNoData': index _ Raster ] }), judging whether the pixel value of the pixel which is accessed by iteration is 0 or 255, if the pixel value is 0, then +1 is carried out on the basis of the original value, and if the pixel value is 255, then-1 is carried out on the basis of the original value.
Example two
In order to implement the method corresponding to the above embodiment to achieve the corresponding functions and technical effects, the following provides a system for modifying pixel values of satellite images, as shown in fig. 4, including:
the data acquisition module 1 is used for acquiring the format and the type of target satellite image data; the types include: single band images and multi-band images.
And the path generation module 2 is configured to generate an absolute reference path of each band of the target satellite image data according to the format and the type.
And the space constraint module 3 is used for determining a space constraint condition and generating a mask parameter corresponding to the target satellite image data according to the space constraint condition.
And the attribute constraint module 4 is used for determining an attribute constraint condition and generating a database query statement corresponding to each wave band of the target satellite image data according to the attribute constraint condition.
And the condition testing module 5 is configured to perform condition testing on each band of the target satellite image data according to the mask parameter and the database query statement, so as to obtain a binary grid corresponding to each band of the target satellite image data.
A sparse grid determining module 6, configured to determine a sparse grid according to the binary grid; the sparse grid is used for representing target pixels in the target satellite image data; the target pixel is a pixel in the target satellite image data, the spatial position of which meets the spatial constraint condition, and the pixel value of each band of which meets the attribute constraint condition.
And the raster object determining module 7 is configured to generate a raster object corresponding to each band of the target satellite image data according to the absolute reference path.
And the pixel value modification module 8 is used for modifying the corresponding pixel value in the grid object by taking the sparse grid as a spatial position index to obtain modified satellite image data.
EXAMPLE III
The embodiment of the present invention further provides an electronic device, which includes a memory and a processor, where the memory is used to store a computer program, and the processor is used to run the computer program, so that the electronic device executes the method in the first embodiment. The electronic device may be a server.
In addition, the present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program realizes the method in the first embodiment when being executed by a processor.
Compared with the prior art, the invention has the following advantages:
the method has the advantages that: the independent setting of the multiband pixel value screening conditions and the logic operation of each band screening condition are realized. Specifically, a condition test tool is applied to each wave band of the multi-wave band raster data, so that the pixel value of each wave band is screened, and on the basis of the result, the condition test results of different wave bands are subjected to logic operation by means of a map algebra function.
The advantages are two: and the grid data processing under the spatial constraint is realized. This advantage results from the setting of the mask region parameters in step S3. From the view of data structure, the raster data is a regular rectangular state with m rows × n columns, but when the raster data is used to express a certain numerical value of a specific real area in the real world, the effective range of the raster data is usually an irregular polygon, and when the raster data is processed, the effective range of the raster data is processed in a targeted manner, so that not only the data processing efficiency can be improved, but also a more accurate processing result can be provided. The mask area parameter can be composed of any polygon, and the grid function of the parameter is set, and the application effect only acts in the mask range.
The advantages are three: higher processing efficiency is achieved. For the fine processing of raster data pixel values, the processing efficiency often suffers from the following two points: firstly, each pixel needs to be visited one by one and whether the pixel meets the processing requirement is judged, and the proportion of the number of pixels which need to be processed actually to the total number of the pixels is extremely low, so that the time for searching the target pixel is high; secondly, the raster data processing process needs to read the raster data to be processed and the process data completely or partially for many times, the time consumption is proportional to the raster data capacity, and the total duration of the whole processing process is higher. In the invention, the sparse grid generated in the step S6 has the same data structure as the grid to be processed, but only comprises the pixels at the same positions according with the attribute constraint conditions, and the sparse grid is used as an index in the step S8, the pixels at the corresponding positions of the grid to be processed are accessed and modified, so that the processing time consumption can be greatly reduced, and the problem of difficulty is solved; on the other hand, the map algebra function and the intermediate data format of the raster object adopted in step S6 utilize the computer memory to the maximum extent, instead of using the hard disk as the storage medium of the intermediate data (when the memory capacity cannot meet the processing requirement, the hard disk is used for storage), which reduces the time consumed by reading and writing the process data, and directly modifies the pixels to be processed in the raster to be processed in step S8, thereby saving the time for reading and writing the pixels which do not need to be processed.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the foregoing, the description is not to be taken in a limiting sense.
Claims (10)
1. A method for modifying pixel values of satellite images is characterized by comprising the following steps:
acquiring the format and the type of target satellite image data; the types include: single band images and multi-band images;
generating an absolute reference path of each wave band of the target satellite image data according to the format and the type;
determining a space constraint condition, and generating a mask parameter corresponding to the target satellite image data according to the space constraint condition;
determining attribute constraint conditions, and generating database query statements corresponding to each wave band of the target satellite image data according to the attribute constraint conditions;
performing condition testing on each wave band of the target satellite image data respectively according to the mask parameters and the database query statements to obtain binary grids corresponding to each wave band of the target satellite image data;
determining a sparse grid according to the binary grid; the sparse grid is used for representing target pixels in the target satellite image data; the target pixel is a pixel in the target satellite image data, the spatial position of which meets the spatial constraint condition, and the pixel value of each wave band of which meets the attribute constraint condition;
generating a raster object corresponding to each wave band of the target satellite image data according to the absolute reference path;
and modifying the corresponding pixel values in the grid object by taking the sparse grid as a spatial position index to obtain modified satellite image data.
2. The method for modifying a pixel value of a satellite image according to claim 1, wherein the method for performing condition testing on each band of the target satellite image data according to the mask parameter and the query statement of the database to obtain a binary grid corresponding to each band of the target satellite image data specifically comprises:
determining an interested region in the target satellite image data according to the mask parameter;
in the interested region, performing condition test on pixel values of all pixels of each wave band of the target satellite image data according to the database query statement;
and setting the value of the grid unit corresponding to the pixel which does not pass the condition test as a first set value and the value of the grid unit corresponding to the pixel which passes the condition test as a second set value for any wave band of the target satellite image data, and determining the array formed by all the grid units as the binary grid.
3. The method for modifying pixel values of satellite images according to claim 2, wherein determining a sparse grid according to the binary grid specifically comprises:
when the target satellite image data is a single-band image:
setting the grid unit with the median value of the binary grid as a first set value as a null value to obtain a sparse grid;
when the target satellite image data is a multiband image:
performing logical operation on the binary grids corresponding to each wave band of the target satellite image data to obtain the binary grids after operation;
and setting the grid unit with the median value of the computed binary grid as a first set value as a null value to obtain the sparse grid.
4. The method for modifying the pixel value of the satellite image according to claim 1, wherein the modifying the pixel value corresponding to the grid object by using the sparse grid as the spatial position index to obtain the modified satellite image data specifically comprises:
adopting a pixel iterator, taking the sparse grid as a spatial position index, and accessing corresponding pixels in the grid object one by one according to the ascending sequence of row and column numbers; the corresponding pixels are pixels with the same row-column number as the sparse grid in the grid object;
and modifying the pixel value of the corresponding pixel in the raster object according to a set processing formula to obtain modified satellite image data.
5. The method for modifying a pixel value of a satellite image according to claim 4, wherein the setting of the processing equation specifically comprises:
when the pixel value of the corresponding pixel in the grid object is 0, adding 1 to the pixel value;
and when the pixel value of the corresponding pixel in the grid object is 255, subtracting 1 from the pixel value.
6. The method for modifying a pixel value of a satellite image according to claim 3, wherein the first setting value is 0, the second setting value is 1, and the logical operation is a logical AND operation.
7. The method for modifying a pixel value of a satellite image according to claim 3, wherein the first setting value is 1, the second setting value is 0, and the logical operation is a logical OR operation.
8. A system for modifying a pixel value of a satellite image, comprising:
the data acquisition module is used for acquiring the format and the type of the target satellite image data; the types include: single band images and multi-band images;
a path generation module, configured to generate an absolute reference path of each band of the target satellite image data according to the format and the type;
the space constraint module is used for determining a space constraint condition and generating a mask parameter corresponding to the target satellite image data according to the space constraint condition;
the attribute constraint module is used for determining attribute constraint conditions and generating database query statements corresponding to each wave band of the target satellite image data according to the attribute constraint conditions;
the condition testing module is used for respectively carrying out condition testing on each wave band of the target satellite image data according to the mask parameters and the database query statements to obtain binary grids corresponding to each wave band of the target satellite image data;
a sparse grid determining module for determining a sparse grid from the binary grid; the sparse grid is used for representing target pixels in the target satellite image data; the target pixel is a pixel in the target satellite image data, the spatial position of which meets the spatial constraint condition, and the pixel value of each wave band of which meets the attribute constraint condition;
the raster object determining module is used for generating raster objects corresponding to all wave bands of the target satellite image data according to the absolute reference path;
and the pixel value modification module is used for modifying the corresponding pixel value in the grid object by taking the sparse grid as a spatial position index to obtain modified satellite image data.
9. An electronic device, comprising a memory for storing a computer program and a processor for executing the computer program to cause the electronic device to perform the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310182265.7A CN115840761B (en) | 2023-03-01 | 2023-03-01 | Satellite image pixel value modification method, system, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310182265.7A CN115840761B (en) | 2023-03-01 | 2023-03-01 | Satellite image pixel value modification method, system, equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115840761A true CN115840761A (en) | 2023-03-24 |
CN115840761B CN115840761B (en) | 2023-04-14 |
Family
ID=85580226
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310182265.7A Active CN115840761B (en) | 2023-03-01 | 2023-03-01 | Satellite image pixel value modification method, system, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115840761B (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2003065310A1 (en) * | 2002-02-01 | 2003-08-07 | Canon Kabushiki Kaisha | Efficient display update from changing object graphics |
CN102033898A (en) * | 2010-09-27 | 2011-04-27 | 华东师范大学 | Extraction method for local cloud cover information metadata of moderate resolution imaging spectral image |
CN104899282A (en) * | 2015-06-02 | 2015-09-09 | 北京博阳世通信息技术有限公司 | Processing method and search method for multiple-source and multi-temporal satellite image tile data |
CN112015929A (en) * | 2019-05-30 | 2020-12-01 | 阿里巴巴集团控股有限公司 | Raster data access method and device, electronic equipment and computer storage medium |
CN113327042A (en) * | 2021-06-07 | 2021-08-31 | 中国矿业大学 | Rapid division method for restoration requirements of regional ecological system |
US20210342585A1 (en) * | 2020-05-01 | 2021-11-04 | Caci, Inc. - Federal | Systems and methods for extracting and vectorizing features of satellite imagery |
CN113610940A (en) * | 2021-08-10 | 2021-11-05 | 江苏天汇空间信息研究院有限公司 | Ocean vector file and image channel threshold based coastal area color homogenizing method |
CN113837892A (en) * | 2021-08-25 | 2021-12-24 | 湖北省水利水电规划勘测设计院 | Slope farmland dividing method based on 3S technology |
CN114003755A (en) * | 2021-10-25 | 2022-02-01 | 中国自然资源航空物探遥感中心 | Multi-source satellite scene-separating image data organization storage and retrieval method, system and equipment |
CN114170524A (en) * | 2021-10-28 | 2022-03-11 | 华东师范大学 | Single-day tidal flat digital terrain construction method based on high-time-space satellite data fusion |
CN115223062A (en) * | 2022-06-30 | 2022-10-21 | 桂林理工大学 | UAV data-based method for correcting forest stand accumulation amount time difference of eucalyptus artificial forest region |
-
2023
- 2023-03-01 CN CN202310182265.7A patent/CN115840761B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2003065310A1 (en) * | 2002-02-01 | 2003-08-07 | Canon Kabushiki Kaisha | Efficient display update from changing object graphics |
CN102033898A (en) * | 2010-09-27 | 2011-04-27 | 华东师范大学 | Extraction method for local cloud cover information metadata of moderate resolution imaging spectral image |
CN104899282A (en) * | 2015-06-02 | 2015-09-09 | 北京博阳世通信息技术有限公司 | Processing method and search method for multiple-source and multi-temporal satellite image tile data |
CN112015929A (en) * | 2019-05-30 | 2020-12-01 | 阿里巴巴集团控股有限公司 | Raster data access method and device, electronic equipment and computer storage medium |
US20210342585A1 (en) * | 2020-05-01 | 2021-11-04 | Caci, Inc. - Federal | Systems and methods for extracting and vectorizing features of satellite imagery |
CN113327042A (en) * | 2021-06-07 | 2021-08-31 | 中国矿业大学 | Rapid division method for restoration requirements of regional ecological system |
CN113610940A (en) * | 2021-08-10 | 2021-11-05 | 江苏天汇空间信息研究院有限公司 | Ocean vector file and image channel threshold based coastal area color homogenizing method |
CN113837892A (en) * | 2021-08-25 | 2021-12-24 | 湖北省水利水电规划勘测设计院 | Slope farmland dividing method based on 3S technology |
CN114003755A (en) * | 2021-10-25 | 2022-02-01 | 中国自然资源航空物探遥感中心 | Multi-source satellite scene-separating image data organization storage and retrieval method, system and equipment |
CN114170524A (en) * | 2021-10-28 | 2022-03-11 | 华东师范大学 | Single-day tidal flat digital terrain construction method based on high-time-space satellite data fusion |
CN115223062A (en) * | 2022-06-30 | 2022-10-21 | 桂林理工大学 | UAV data-based method for correcting forest stand accumulation amount time difference of eucalyptus artificial forest region |
Non-Patent Citations (3)
Title |
---|
SHAILENDRA MATHUR等: "VC-3 Codec Updates for Handling Better, Faster, and More Pixels" * |
胡伟等: "基于AutoCAD的地籍数据面拓扑检查算法研究与实现" * |
马鹏刚等: "基于Webgis的栅格数据编辑方法探讨" * |
Also Published As
Publication number | Publication date |
---|---|
CN115840761B (en) | 2023-04-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10311098B2 (en) | System and method for storing points of polygons related to an image | |
Song et al. | Spatiotemporal satellite image fusion through one-pair image learning | |
US8879865B2 (en) | Panchromatic sharpening method of spectral image based on fusion of overall structural information and spatial detail information | |
US9697583B2 (en) | Image processing apparatus, image processing method, and computer-readable recording medium | |
US8712147B2 (en) | Fractal method for detecting and filling data gaps within LiDAR data | |
CN114020756B (en) | Remote sensing image real-time map service publishing method and device | |
CN109829074B (en) | Target area orthophoto image searching method, storage medium and electronic device | |
CN108090872B (en) | Single-frame multispectral image super-resolution reconstruction method and system based on gradient extraction | |
CN110246129B (en) | Image detection method, device, computer readable storage medium and computer equipment | |
Markham et al. | A review of methods for scaling remotely sensed data for spatial pattern analysis | |
CN115565045A (en) | Hyperspectral and multispectral image fusion method based on multi-scale space-spectral transformation | |
US11373018B2 (en) | Method of displaying model and designing pattern, and storage medium | |
CN117409330B (en) | Aquatic vegetation identification method, aquatic vegetation identification device, computer equipment and storage medium | |
CN104732491B (en) | A kind of single frames Remote Sensing Image Super Resolution processing method of edge prior guiding | |
CN115840761B (en) | Satellite image pixel value modification method, system, equipment and medium | |
CN116758206A (en) | Vector data fusion rendering method and device, computer equipment and storage medium | |
JP6945772B1 (en) | Learning device, object detection device and learning method | |
Mishra et al. | Single-Frame Super-Resolution of Real-World Spaceborne Hyperspectral Data | |
CN114463764A (en) | Table line detection method and device, computer equipment and storage medium | |
CN111986283B (en) | Remote sensing image rapid re-projection method based on lookup table | |
CN116977154B (en) | Visible light image and infrared image fusion storage method, device, equipment and medium | |
DE102013112627A1 (en) | An image processing method and apparatus for improving image quality using various coefficients according to areas | |
CN117671036B (en) | Correction parameter calibration method, device, computer equipment and storage medium | |
CN112927149B (en) | Method and device for enhancing spatial resolution of hyperspectral image and electronic equipment | |
CN113837258B (en) | Hyperspectral image classification method and system based on local correlation entropy matrix |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |