Remote sensing image defogging processing method and device based on distributed computing
By using a distributed computing environment to perform block processing and dehazing on remote sensing images, the problem of low efficiency in remote sensing image dehazing is solved, achieving efficient and accurate dehazing results and improving the clarity and usability of remote sensing images.
Patent Information
- Application Number
- CN202511460951.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-10-14
AI Technical Summary
Existing remote sensing image dehazing methods are computationally inefficient, time-consuming, and require a large amount of computing resources. Furthermore, the transparency of deep learning models is poor, which fails to meet the needs of modern remote sensing applications.
A distributed computing environment is used to process remote sensing images in blocks. Through block reading, downsampling, mask generation, dark channel calculation and weighted guided filtering, combined with the Dehaze dehazing function, pixel-by-pixel adjustment is performed to achieve dehazing.
It significantly improves the processing efficiency and quality of large-scale remote sensing image data, ensures high definition and accuracy of processed images, and reduces the demand for computing resources.
Smart Images

Figure CN120953134B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of digital image processing and geospatial data analysis, and in particular to a remote sensing image defogging processing method and device based on distributed computing. BACKGROUND
[0002] Remote sensing images have important application value in many fields such as environmental monitoring, agriculture, urban planning, etc. However, in the atmospheric environment, there are often pollutants such as fog, smoke, etc. that affect the quality of remote sensing images, reduce the contrast and color fidelity of remote sensing images. It is necessary to eliminate the influence of these pollutants on the quality of remote sensing images through remote sensing image defogging technology, so as to restore the clarity and original color of remote sensing images.
[0003] The existing defogging method usually processes the whole remote sensing image as a whole, and the data calculation and processing amount is large, which leads to slow processing speed and low efficiency. With the development of remote sensing technology and the continuous increase of data amount, this processing method has been unable to meet the needs of modern remote sensing applications. The traditional defogging method faces double challenges of computing efficiency and processing quality when processing large-scale remote sensing images.
[0004] The prior art discloses a hyperspectral image haze removal method and system, which mainly converts the defogging features into defogging images by convolution processing of long-wave bands in the hyperspectral image, residual calculation of image features, etc. to complete the haze removal of the hyperspectral image. However, the defogging algorithm using convolution network needs a large amount of labeled data for training, and it takes a long time and is expensive to obtain and label these data. Secondly, high computing resources are usually required for deep learning model training and inference. The decision-making process of the deep learning model lacks transparency, and the interpretability of the deep learning model is poor. SUMMARY
[0005] The present application provides a remote sensing image defogging processing method and device based on distributed computing, which solves the problem that the defogging processing of remote sensing images in the prior art is complex and requires a large amount of computing time and computing resources. The remote sensing image defogging method fully utilizes the advantages of distributed computing, significantly improves the processing efficiency of large-scale remote sensing image data, and ensures the high quality and accuracy of the processed images.
[0006] In a first aspect, the embodiments of the present application provide a remote sensing image defogging processing method based on distributed computing, comprising: initializing a distributed computing environment, and reading a remote sensing image based on the distributed computing environment to obtain original tile data; obtaining metadata information of the remote sensing image, reorganizing a layout of the original tile data based on the metadata information to obtain block tile data; determining block metadata information of the block tile data, performing down-sampling processing on the block tile data to obtain down-sampled tile data, and determining a mask thereof; determining a dark channel according to a value of an RGB channel of the block tile data; updating a value of a corresponding position in the dark channel according to a value of the mask, performing an erosion operation on the updated dark channel to obtain eroded block tile data, and determining an atmospheric light value thereof; performing normalization processing on the down-sampled tile data, and determining a ratio of the down-sampled tile data to the atmospheric light value of a corresponding channel, updating a pixel value of the down-sampled tile data based on the ratio to obtain updated block tile data; performing an erosion operation on the updated block tile data to obtain an updated dark channel, and initializing calculation of an atmospheric transmission result according to the updated dark channel; merging each channel of the down-sampled tile data, and converting the same to a gray-scale image to obtain a merged gray-scale image; performing weighted guided filter processing according to the atmospheric transmission result and the merged gray-scale image to obtain a weighted guided filter result; creating an identification mask based on the weighted guided filter result to identify invalid pixels therein, and marking the invalid pixels in the identification mask; performing pixel-by-pixel adjustment on each channel image of the down-sampled tile data through a Dehaze defogging function to perform defogging calculation thereon to obtain an initial defogging image; setting a position corresponding to the invalid pixels in the identification mask in the initial defogging image as an invalid value to obtain a defogging image; and up-sampling the defogging image to an original resolution to obtain the remote sensing image after defogging processing.
[0007] In combination with the first aspect, in a possible implementation manner, the reading of the remote sensing image to obtain the original tile data comprises: setting a maximum tile size, and defining a size of a slice window according to the maximum tile size; and dividing the remote sensing image into the original tile data conforming to the maximum tile size according to the slice window.
[0008] In combination with the first aspect, in a second possible implementation manner, the reorganizing of the layout of the original tile data based on the metadata information to obtain the block tile data comprises: iteratively calculating a geographical boundary of each original tile data based on the metadata information, and merging the geographical boundaries through a reduce function to obtain a merged boundary; determining an overall range of the remote sensing image; setting a spatial limit of the merged boundary according to the overall range to obtain the block tile data.
[0009] In conjunction with the first aspect, in a third possible implementation, determining the atmospheric light value includes: calculating a histogram of the corroded tile data and determining a threshold based on the histogram; and determining the atmospheric light value of the corroded tile data based on the threshold.
[0010] In conjunction with the third possible implementation of the first aspect, in the fourth possible implementation, determining the threshold based on the histogram includes: performing a reverse iteration step on the histogram; the reverse iteration step includes: iterating the histogram in reverse order and accumulating the iteration results to obtain an accumulated value; if the number of valid items in the mask is less than the accumulated value, then the reverse iteration step is performed; otherwise, the reverse iteration step is exited, and the threshold is determined; wherein, the threshold is as follows: Where thres represents the threshold, and i represents the number of iterations in the reverse iteration step.
[0011] In conjunction with the third possible implementation of the first aspect, in the fifth possible implementation, determining the atmospheric light value of the eroded tile data based on the threshold includes: performing a mask determination step, and determining the atmospheric light value based on the dark channel value output in the mask determination step; the mask determination step includes: determining whether the mask value at the corresponding pixel position of the eroded tile data is 1; if the mask value at the corresponding pixel position of the eroded tile data is 1, then determining whether the dark channel value at that pixel position is greater than the threshold; if the dark channel value at that pixel position is greater than the threshold, then outputting the dark channel value at that pixel position; otherwise, performing the mask determination step based on the next eroded tile data, until all eroded tile data has been traversed; if the mask value at the corresponding pixel position of the eroded tile data is not 1, then performing the mask determination step based on the next eroded tile data, until all eroded tile data has been traversed.
[0012] In conjunction with the first aspect, in the sixth possible implementation, before performing the erosion operation on the updated dark channel, the method further includes: determining the boundary expansion range, and expanding the boundary of the downsampled tile data based on the boundary expansion range.
[0013] In a second aspect, the embodiments of the present application provide a remote sensing image defogging processing device based on distributed computing, comprising: a block reading module, configured to perform block reading on a remote sensing image, and reorganize a block reading result based on metadata information of the remote sensing image to obtain block tile data; a pre-defogging processing module, configured to perform downsampling, mask generation, dark channel generation, histogram and atmospheric light value calculation, normalization processing and weighted filter guided processing on the block tile data, and output downsampling data; and a defogging calculation module, configured to perform defogging calculation on the downsampling data output by the pre-defogging processing module, and upsample the downsampling data to an original resolution to obtain the remote sensing image after defogging processing.
[0014] In a third aspect, the embodiments of the present application provide a device for performing the remote sensing image defogging processing method based on distributed computing, comprising: a processor; a memory for storing processor executable instructions; and the processor executes the executable instructions to implement the remote sensing image defogging processing method based on distributed computing as described in the first aspect or any possible implementation manner of the first aspect.
[0015] In a fourth aspect, the embodiments of the present application provide a non-volatile computer readable storage medium, comprising a computer program or instructions for storing, when the computer program or instructions are executed, to enable the remote sensing image defogging processing method based on distributed computing as described in the first aspect or any one of the first aspect to be implemented.
[0016] The one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0017] The embodiments of the present application perform parallel processing on remote sensing images by using a distributed computing environment, then perform block reading processing on the remote sensing images by using spatial analysis and processing techniques, perform downsampling, mask and dark channel determination, erosion operation and weighted guided filtering operation on the block data to generate remote sensing images after defogging processing. The technical problems of low efficiency, long time consumption and low transparency of the traditional remote sensing image defogging processing technology are effectively solved, and the technical effects of quickly processing a large amount of remote sensing image data and effectively removing haze are achieved, thereby improving the clarity and usability of the remote sensing image. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application or the prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0019] Figure 1A flowchart of a remote sensing image defogging processing method based on distributed computing provided for an embodiment of the present application is shown in FIG. 1.
[0020] Figure 2 Another flowchart of a remote sensing image defogging processing method based on distributed computing provided for an embodiment of the present application is shown in FIG. 2.
[0021] Figure 3 A flowchart of histogram calculation threshold provided for an embodiment of the present application is shown in FIG. 3.
[0022] Figure 4 A flowchart of determining the atmospheric light value of eroded block tile data based on threshold provided for an embodiment of the present application is shown in FIG. 4. DETAILED DESCRIPTION
[0023] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0024] Figure 1 A flowchart of a remote sensing image defogging processing method based on distributed computing provided for an embodiment of the present application is shown in FIG. 1. Figure 1 As shown in FIG. 1, the remote sensing image defogging processing method based on distributed computing includes:
[0025] Step 101: Initialize the distributed computing environment, and read the remote sensing image based on its block to obtain the original tile data.
[0026] Exemplarily, the distributed computing environment is initialized through SparkSession, and the remote sensing image is read through the hadoopMultibandGeoTiffRDD block of Geotrellis to divide it into the original tile data that can be processed in parallel.
[0027] SparkSession is the only entry of Spark big data processing engine, which encapsulates the functions of Spark, so that developers can use various functions of Spark through a unified interface. After creating SparkSession, various operations such as loading data and converting data can be performed based on it.
[0028] Geotrellis is a library and framework running on Spark, which provides geospatial analysis tools, so that developers can more easily process and analyze spatial data.
[0029] The hadoopMultibandGeoTiffRDD is a function in the Geotrellis library, which is used to read a GeoTiff file from a Hadoop distributed file system or compatible storage system in a Spark environment and convert it into raw tile data of Spark.
[0030] On the other hand, by combining Geotrellis with Spark, the remote sensing image is read in blocks, and the return value is converted into raw tile data.
[0031] It should be noted that the raw tile data can form an elastic distributed data set RDD [ProjectedExtent, MultibandTile], which contains a series of key-value pairs (Key-Value Pair). In the elastic distributed data set, each key (Key) is a ProjectedExtent object, and each value (Value) is a MultibandTile object. The elastic distributed data set can use the parallel processing capability of Spark to quickly process large-scale geospatial data, and combine the rich geospatial analysis tools provided by GeoTrellis to perform complex geospatial analysis on the data.
[0032] Exemplarily, when the remote sensing image is read in blocks, the maximum tile size also needs to be set, and the size of the slice window for the remote sensing image is defined according to the maximum tile size. According to the size of the slice window, the remote sensing image is cut into raw tile data conforming to the maximum tile size.
[0033] Step 102: Obtain the metadata information of the remote sensing image, reorganize the layout of the raw tile data based on the metadata information, and obtain the block tile data.
[0034] In the embodiment of the present application, the metadata information of the remote sensing image is obtained through the open source GDAL library (English full name: Geospatial Data Abstraction Library).
[0035] GDAL (Geospatial Data Abstraction Library) is an open source raster spatial data conversion library, which is widely used to read, write and process various geospatial data formats.
[0036] The metadata information includes the width, height, pixel value of the remote sensing image, and the four-to-range of the remote sensing image.
[0037] Specifically, the geographical boundary of each original tile data is iteratively calculated based on the metadata information of the remote sensing image, and the iteratively calculated geographical boundaries are merged through a reduce function to obtain a merged boundary.
[0038] The overall range of the remote sensing image is determined through a layout definition function, and the merged boundary is set with a spatial limit according to the overall range to obtain the divided tile data.
[0039] In the divided tile data, the geographical range is the geographical area or spatial range represented by each tile. In the tile map service, the map is divided into a plurality of tiles of fixed size, each tile covers a small part of the earth's surface, and these tiles are organized in a certain hierarchy. The higher the hierarchy, the smaller the geographical range represented by the tile, and the more detailed the tile.
[0040] Step 103: Determine the division metadata information of the divided tile data, perform down-sampling processing on the divided tile data to obtain down-sampled tile data, and determine a mask thereof.
[0041] In the embodiments of the present application, the down-sampling coefficient is set to 4 after multiple debugging, and the division index SpatialKey is constructed according to the four information of the divided tile data.
[0042] It should be noted that after obtaining the down-sampled tile data, an operation of boundary expansion on the down-sampled tile data is further included, specifically:
[0043] The range of boundary expansion is determined, and the down-sampled tile data is expanded based on the boundary expansion range. Exemplarily, the expansion range is 30 pixel values. The purpose of expansion is to reduce the image caused by edge problems for subsequent operations.
[0044] After boundary expansion, the mask is calculated. The calculation logic of the mask is that as long as the pixel value in any channel of the down-sampled tile data is 0, the value at the corresponding position of the mask should also be set to 0, otherwise it is set to 1.
[0045] Specifically, the principle of calculating the mask is that 0 is nodata, which is invalid. In subsequent calculation of the dark channel, the RGB three channels need to have values. Therefore, the corresponding position in the mask should be set to 0, indicating that this position is invalid in subsequent calculation. If the RGB three channels have values, the corresponding position in the mask is set to 1, indicating that this position is valid in subsequent calculation.
[0046] Step 104: Determine the dark channel according to the value of the RGB channel of the divided tile data.
[0047] The dark channel is created according to the minimum value in the RGB channel of the divided tile data.
[0048] Step 105: updating the value of the corresponding position in the dark channel according to the value of the mask, and performing an erosion operation on the updated dark channel to obtain the erosion patch tile data and determine the atmosphere light value thereof.
[0049] The specific operation process of updating the value of the corresponding position in the dark channel according to the value of the mask is as follows:
[0050] Based on the position where the value of the mask is 0, the value of the corresponding position in the dark channel is set to the maximum value 1, otherwise it remains unchanged and is still the minimum value. The purpose is to avoid the subsequent erosion operation being affected by the invalid value at the mask boundary.
[0051] In the embodiment of the present application, the calculation logic of the erosion operation is to create an erosion kernel with a specified size of 41x41, and perform an erosion operation on the dark channel by calling the Imgproc. erode function in the openCV library to strengthen the dark area therein, and set the value of the position in the dark channel corresponding to the mask value of 1 to 0 again to restore the valid area of the mask. The purpose is that the erosion operation may affect the pixel value of the valid area, and through step 105, it can be ensured that only the dark area (the area where the mask value is 1) in the dark channel is retained, and other areas are not affected by the erosion operation.
[0052] Exemplarily, the determination process of the atmosphere light value is as follows:
[0053] The histogram of the erosion patch tile data is calculated, and the calculation function adopts the Imgproc. calcHist function in the openCV library, and the histogram is calculated by passing the dark channel after erosion, the mask, initializing a size of 1001 bins, and a range of pixel values from 0 to 1.001. And according to the histogram, the threshold value is determined, and the atmosphere light value of the erosion patch tile data is determined based on the threshold value.
[0054] On the one hand, the threshold value is determined according to the histogram, as shown in Figure 3 , which includes:
[0055] An inverse iteration step is performed on the histogram to obtain the threshold value thres, and the inverse iteration step includes:
[0056] The histogram is iterated in reverse order, and the iteration result is accumulated to obtain an accumulated value count.
[0057] It is judged whether the number of valid masks num is less than the accumulated value count. If count≥num, that is, the number of valid masks num is less than the accumulated value count, the current iteration is exited, and the threshold value thres is calculated.
[0058] .
[0059] Wherein, thres represents the threshold value, and i represents the iteration number in the reverse iteration step.
[0060] If the effective number num in the mask is not less than (i.e. greater than or equal to) the accumulated value count, the reverse iteration step is continued to be executed in a loop.
[0061] On the other hand, the atmospheric light value of the eroded patch tile data is determined based on the threshold value, as shown in the following formula: Figure 4 As shown in the following formula:
[0062] The mask judgment step is executed, and the atmospheric light value of the eroded patch tile data is determined based on the result (the value of the dark channel) output in the mask judgment step. The mask judgment step includes:
[0063] It is determined whether the value of the mask of the pixel position corresponding to the eroded patch tile data is 1. If yes, it is determined whether the value of the dark channel of the pixel position is greater than the threshold value.
[0064] If the value of the dark channel is greater than the threshold value, the value of the dark channel of the pixel position is output. If the value of the dark channel is not greater than (i.e. less than or equal to) the threshold value, the mask judgment step is executed based on the next eroded patch tile data until the eroded patch tile data is traversed.
[0065] If the value of the mask of the pixel position corresponding to the eroded patch tile data is not 1, the mask judgment step is executed based on the next eroded patch tile data until all the eroded patch tile data is traversed.
[0066] Exemplarily, the calculation of the eroded patch tile data by the threshold value needs to satisfy two conditions first. One is that the mask of the same position must be 1. The other is that the value of the dark channel of the same position must be greater than the threshold value. The eroded patch tile data satisfying only the above conditions is screened, and the global average value is calculated after the screening result is obtained, so as to obtain the atmospheric light value of each channel. In the embodiment of the present application, the two conditions are used as the judgment step to screen the eroded patch tile data correspondingly, so as to obtain the atmospheric light value of each channel.
[0067] Step 106: The down-sampling tile data is normalized, and the ratio of the atmospheric light value of the corresponding channel is determined. The pixel value of the down-sampling tile data is updated based on the ratio, and the updated patch tile data is obtained.
[0068] Specifically, the down-sampling tile data is normalized, the atmospheric light value calculated by step 105 is used to traverse the down-sampling data by using the Core.divide function, the pixel value of the down-sampling data is divided by the atmospheric light value of the corresponding channel, and the obtained result is overlaid on the original pixel value of the down-sampling data, and the pixel value of each channel of the down-sampling data is limited to not more than 1, that is, the pixel value greater than 1 is set to 1, so as to obtain the updated patch tile data.
[0069] Step 107: performing an erosion operation on the updated patch tile data to obtain an updated dark channel, and initializing the calculation of the atmospheric transmission result according to the updated dark channel.
[0070] Again, the erosion operation is performed on the updated patch tile data (i.e., repeating step 105), the dark channel is recalculated, the updated dark channel is obtained, and the initialization calculation of the atmospheric transmission result is performed based on the updated dark channel.
[0071] Step 108: merging the channels of the down-sampling tile data and converting it into a gray scale image to obtain a merged gray scale image.
[0072] The channels of the down-sampling tile data are merged by using the Core.merge function to obtain mat_rgb, and the Imgproc.cvtColor function is used to convert mat_rgb into a gray scale image.
[0073] Step 109: performing a weighted guided filter processing according to the atmospheric transmission result and the merged gray scale image to obtain a weighted guided filter result.
[0074] Specifically, this processing generates an image that is smooth while preserving useful edges by combining local pixel statistics, a guide image, and a specific weight. This method combines local statistics and global guidance to preserve important structural features of the image while smoothing.
[0075] Step 110: creating a recognition mask based on the weighted guided filter result to identify invalid pixels therein, and marking the invalid pixels in the recognition mask.
[0076] Illustratively, the weighted guided filter result is associated with the patch index SpatialKey obtained in step 103, and the Core.compare is used to create a recognition mask.
[0077] Step 111: performing a pixel-by-pixel adjustment on the channel images of the down-sampling tile data by using the Dehaze dehaze function to perform a dehaze calculation to obtain an initial dehaze image.
[0078] The channel images of the down-sampled tile data are adjusted by a Dehaze defogging function, which uses the get and put of the Core function to adjust the initial defogging image pixel by pixel.
[0079] Step 112: Set the positions corresponding to the invalid pixels in the identification mask in the initial defogging image to invalid values to obtain a defogging image.
[0080] Specifically, the images of non-RGB channels are not changed and are directly copied to the output array, and the results at the positions of the identification mask are set to invalid values, thereby obtaining the defogging image.
[0081] Step 113: Up-sample the defogging image to the original resolution to obtain a remote sensing image processed by defogging.
[0082] Exemplarily, the up-sampling coefficient is the same as the down-sampling coefficient in the down-sampling, and both are 4.
[0083] In addition, the remote sensing image processed by defogging obtained after up-sampling is also written to the shared disk file system through the GDAL library.
[0084] Figure 2 Another flowchart of a remote sensing image defogging processing method based on distributed computing provided by the embodiment of the application.
[0085] In the remote sensing image defogging processing method based on distributed computing described in the application, the defogging algorithm principle is as follows:
[0086] 1. Foggy day degradation model, as follows:
[0087] .
[0088] Wherein, I represents the observed foggy day image intensity, J represents the light intensity of the original scene image, A represents the atmospheric light value (Atmospheric Light, also known as atmospheric illumination), and t represents the transmittance (i.e. the part of the optical fiber that transmits through the medium without attenuation to the remote sensing image acquisition device).
[0089] The meaning of the foggy day degradation model formula is that the observed foggy day image intensity I can be obtained by linearly combining the light intensity J of the original scene image and the atmospheric light value A. Wherein, the transmittance t controls the proportion of the original foggy day image intensity I and the atmospheric light value A in the combination.
[0090] When the transmittance t approaches 1, the observed foggy day image I is closer to the original scene image J; when the transmittance t approaches 0, the observed foggy day image intensity I is closer to the atmospheric light value A.
[0091] The haze degradation model is the theoretical basis of the entire defogging algorithm, which facilitates understanding of how the haze existing in the atmosphere affects remote sensing images. This is used to deduce how to restore clear images from hazy images.
[0092] 2. Dark channel prior, as follows:
[0093] .
[0094] where t(x) represents the transmittance of each pixel, i represents the pixel number, x represents the pixel, d represents the boundary, represents the light intensity of the original scene image corresponding to the pixel number i.
[0095] This formula is used to estimate the transmittance t(x) of each pixel, i.e., the visibility of the pixel in the haze-free image. The dark channel prior assumes that in most local blocks of non-sky regions, the intensity of some pixels of at least one color channel is very low, close to 0. Equivalently, the minimum intensity in such local blocks is close to 0. This assumption is a statistical assumption that the minimum value in the dark channel image corresponds to the atmospheric light value in the image, which can be used to estimate the intensity and distribution of the atmospheric light value.
[0096] 3. Atmospheric light value estimation, as follows:
[0097] .
[0098] This formula is used to estimate the atmospheric light value A, which is an important parameter in the defogging process. Valley represents a valley-shaped (concave) optimization function commonly used in the field of machine learning, and H represents the histogram of the dark channel image. In the processing process, the wave trough is found by analyzing the histogram of the dark channel image, thereby estimating the atmospheric light value.
[0099] 4. Defogging formula, as follows:
[0100] .
[0101] This formula is used to calculate and restore the haze-free image I(x) based on the transmittance t(x) of each pixel and the atmospheric light value A obtained from the above formulas This formula is the core of the defogging algorithm, which is directly applied to each pixel to eliminate the effects of haze and restore the original color and details of the image. Where I(x) represents the haze image intensity of each pixel.
[0102] 5. Local contrast enhancement, as follows:
[0103] .
[0104] This formula is used for local contrast enhancement of the image after haze removal to improve the image quality. In the processing, it is realized by bilateral filtering or other filtering techniques, which helps to preserve the details and textures of the image while reducing image noise. Among them, represents the local standard deviation of each pixel, Z represents the window size, represents the pixel after local contrast enhancement, represents the average value of the local contrast, represents the haze image intensity of the pixel after local contrast enhancement.
[0105] In addition, the embodiment of the present application also provides a remote sensing image haze removal processing device based on distributed computing, comprising:
[0106] The block reading module is configured to read the remote sensing image in blocks, and reorganize the layout of the block reading result based on the metadata information of the remote sensing image to obtain block tile data.
[0107] The haze pre-processing module is configured to perform down-sampling, mask generation, dark channel generation, histogram and atmospheric light value calculation, normalization processing and weighted filter guided processing on the block tile data, and output down-sampled data.
[0108] The haze removal calculation module is configured to perform haze removal calculation on the down-sampled data output by the haze pre-processing module, and up-sample the down-sampled data to the original resolution to obtain the remote sensing image after haze removal processing.
[0109] The embodiment of the present application provides a remote sensing image haze removal processing method and device based on distributed computing. By using the powerful distributed computing capability of Spark and the geographic information processing function of Geotrellis, efficient and accurate haze removal of remote sensing image data is realized. The processing efficiency of large-scale remote sensing image data can be significantly improved. Through automatic source data management and image processing process, the quality and accuracy of the processed remote sensing image can be improved, the processing speed can be improved, and the haze removal effect can be improved. It has important significance for improving the quality and application value of remote sensing image data.
[0110] Although the present application provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps can be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one of the many execution orders, and does not represent the only execution order. When the device or client product is executed in practice, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method order shown in the embodiments or the drawings.
[0111] Some of the modules in the apparatus described in the present application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, classes, etc., that perform particular tasks or implement particular abstract data types. The present application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including memory storage devices.
[0112] The apparatus or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above apparatus is described as various modules with functions. In the implementation of the embodiments of the present application, the functions of the modules can be implemented in one or more software and / or hardware. Of course, the modules implementing certain functions can also be implemented by a combination of multiple sub-modules or sub-units.
[0113] The methods, apparatuses or modules described in the present application can be implemented in a computer-readable program code in any appropriate manner, for example, the controller can take the form of, for example, a microprocessor or a processor, and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit; abbreviated as: ASIC), programmable logic controllers and embedded microcontrollers, examples of the controller include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a pure computer-readable program code manner, the same function can also be implemented by logically programming the method steps in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers and embedded microcontrollers. Therefore, such a controller can be considered as a hardware component, and the means included therein for implementing various functions can also be regarded as structures within the hardware component. Alternatively, the means for implementing various functions can also be regarded as both software modules implementing the method and structures within the hardware component.
[0114] The embodiment of the present application further provides a device for executing the remote sensing image defogging processing method based on distributed computing, the device comprising: a processor; a memory for storing processor executable instructions; and the processor executes the executable instructions to implement the remote sensing image defogging processing method based on distributed computing provided by the embodiment of the present application.
[0115] The embodiment of the present application further provides a nonvolatile computer readable storage medium, which stores a computer program or instructions, and when the computer program or instructions are executed, the remote sensing image defogging processing method based on distributed computing provided by the embodiment of the present application is implemented.
[0116] In addition, each functional module in each embodiment of the present application can be integrated in one processing module, or each module can exist independently, or two or more modules can be integrated in one module.
[0117] The storage medium described above includes but is not limited to a random access memory (English: Random Access Memory; abbreviation: RAM), a read-only memory (English: Read-Only Memory; abbreviation: ROM), a cache (English: Cache), a hard disk (English: Hard Disk Drive; abbreviation: HDD) or a memory card (English: Memory Card). The memory can be used to store computer program instructions.
[0118] From the above description of the embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software and necessary hardware. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product or through a data migration implementation process. The computer software product can be stored in a storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions for causing a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the method described in each embodiment or some part of the embodiments of the present application.
[0119] Each embodiment in the specification is described in a progressive manner, and the same or similar parts of each embodiment can be referred to each other, and each embodiment mainly describes the difference from other embodiments. The whole or part of the present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, mobile communication terminals, multi-processor systems, microprocessor-based systems, programmable electronic devices, network PCs, small computers, large computers, distributed computing environments including any of the above systems or devices, etc.
[0120] The above examples are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that the technical solutions recorded in the foregoing examples can still be modified, or some or all of the technical features thereof can be replaced by equivalents; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the present application.
Claims
1. A method for remote sensing image defogging processing based on distributed computing, characterized in that, The method comprises the following steps: initializing a distributed computing environment, and reading remote sensing images based on the distributed computing environment to obtain original tile data; obtaining metadata information of the remote sensing images, reorganizing the layout of the original tile data based on the metadata information to obtain block tile data; determining block metadata information of the block tile data, performing down-sampling processing on the block tile data to obtain down-sampled tile data, and determining an atmospheric light value of the down-sampled tile data; determining a dark channel according to the value of the RGB channel of the block tile data; updating the value of the corresponding position in the dark channel according to the value of the mask, performing an erosion operation on the updated dark channel to obtain eroded block tile data, and determining the atmospheric light value of the eroded block tile data; performing normalization processing on the down-sampled tile data, determining the ratio of the down-sampled tile data to the atmospheric light value of the corresponding channel, updating the pixel value of the down-sampled tile data based on the ratio to obtain updated block tile data; performing an erosion operation on the updated block tile data to obtain the updated dark channel, and initializing the calculation of the atmospheric transmission result according to the updated dark channel; merging each channel of the down-sampled tile data and converting it into a grayscale image to obtain a merged grayscale image; performing weighted guided filter processing on the atmospheric transmission result and the merged grayscale image to obtain a weighted guided filter result; creating a recognition mask based on the weighted guided filter result to recognize invalid pixels therein, and marking the invalid pixels in the recognition mask; performing pixel-by-pixel adjustment on each channel image of the down-sampled tile data through a Dehaze dehazing function to perform dehazing calculation thereon to obtain an initial dehazing image; setting the positions corresponding to the invalid pixels in the recognition mask in the initial dehazing image as invalid values to obtain a dehazing image; up-sampling the dehazing image to the original resolution to obtain the remote sensing image after dehazing processing.
2. The method of claim 1, wherein, The method comprises the following steps: setting a maximum tile size and defining the size of a slice window according to the maximum tile size; dividing the remote sensing images into the original tile data conforming to the maximum tile size according to the slice window.
3. The method of claim 1, wherein, The method comprises the following steps: iteratively calculating the geographical boundary of each original tile data based on the metadata information, and merging the geographical boundaries through a reduce function to obtain a merged boundary; determining the overall range of the remote sensing images; setting the spatial limit of the merged boundary according to the overall range to obtain the block tile data.
4. The method of claim 1, wherein, The method comprises the following steps: calculating the histogram of the eroded block tile data, and determining a threshold value according to the histogram; determining the atmospheric light value of the eroded block tile data based on the threshold value.
5. The method of claim 4, wherein, The method comprises the following steps: performing a reverse iteration step on the histogram; The reverse iteration step comprises the following steps: iterating the histogram in reverse order, and accumulating the iteration result to obtain an accumulated value; if the number of valid pixels in the mask is less than the accumulated value, performing the reverse iteration step. Otherwise, exit the reverse iteration step, and determine the threshold value; Wherein, the threshold value is as follows: ; Wherein, thres represents the threshold value, and i represents the iteration number in the reverse iteration step.
6. The method of claim 4, wherein, The determination of the atmospheric light value of the eroded patch tile data based on the threshold value comprises: Performing a mask judgment step, and determining the atmospheric light value based on the value of the dark channel output in the mask judgment step; The mask judgment step comprises: Judging whether the value of the mask corresponding to the pixel position of the eroded patch tile data is 1; If the value of the mask corresponding to the pixel position of the eroded patch tile data is 1, judging whether the value of the dark channel of the pixel position is greater than the threshold value; If the value of the dark channel of the pixel position is greater than the threshold value, outputting the value of the dark channel of the pixel position; Otherwise, performing the mask judgment step based on the next eroded patch tile data until all the eroded patch tile data are traversed; If the value of the mask corresponding to the pixel position of the eroded patch tile data is not 1, performing the mask judgment step based on the next eroded patch tile data until all the eroded patch tile data are traversed.
7. The method of claim 1, wherein, Before the erosion operation on the updated dark channel, the method further comprises: Determining a boundary expansion range, and performing boundary expansion on the down-sampling tile data based on the boundary expansion range.
8. A distributed computing-based remote sensing image defogging processing device, characterized in that, Comprise: The patch reading module is configured to read the remote sensing image based on the initialized distributed computing environment to obtain original tile data. The patch reading module is configured to obtain metadata information of the remote sensing image, and reorganize the layout of the original tile data based on the metadata information to obtain patch tile data. The haze pre-processing module is configured to determine patch metadata information of the patch tile data, perform down-sampling processing on the patch tile data to obtain down-sampling tile data, and determine a mask and a dark channel of the down-sampling tile data. The value of the corresponding position in the dark channel is updated according to the value of the mask, the erosion operation is performed on the updated dark channel to obtain eroded patch tile data, the atmospheric light value of the eroded patch tile data is determined, the down-sampling tile data is normalized to determine the ratio of the atmospheric light value to the corresponding channel, the pixel value of the down-sampling tile data is updated based on the ratio to obtain updated patch tile data; The updated dark channel is obtained by eroding the updated patch tile data, and the atmospheric transmission result is initialized based on the updated dark channel; Each channel of the down-sampling tile data is merged, and the merged down-sampling tile data is converted into a gray-scale image to obtain a merged gray-scale image; According to the atmospheric transmission result and the merged gray-scale image, a weighted guided filter processing is performed to obtain a weighted guided filter result; Based on the weighted guided filter result, a recognition mask is created, invalid pixels are recognized based on the recognition mask, and the invalid pixels are marked in the recognition mask. a dehaze computing module, configured to perform pixel-by-pixel adjustment on each channel image of the down-sampled tile data by a Dehaze dehaze function to obtain initial dehaze images, and set positions corresponding to the invalid pixels in the identification mask in the initial dehaze images as invalid values to obtain dehaze images; up-sampling the dehaze images to the original resolution to obtain the remote sensing image after dehaze processing.
9. A device for performing the distributed computing based remote sensing image defogging processing method, characterized in that, comprising: a processor; a memory for storing processor-executable instructions; when the processor executes the executable instructions, the distributed computing based remote sensing image dehaze processing method in any one of claims 1-7 is implemented.
10. A non-transitory computer readable storage medium, comprising: comprising a computer program or instructions for storing, when the computer program or instructions are executed, the distributed computing based remote sensing image dehaze processing method in any one of claims 1-7 is implemented.
Citation Information
Patent Citations
Quick image defogging optimization method
CN107424132A
System and method for removing haze from remote sensing images
US20230026811A1