Remote sensing image cloud detection method and system based on quick view
By preprocessing and thresholding the quick views of remote sensing images to generate optimal cloud mask images, the problem of low efficiency of traditional cloud detection is solved, fast and accurate cloud detection and geographical coordinate calibration are achieved, and the quality of remote sensing image data is improved. processing efficiency.
Patent Information
- Application Number
- CN202410459830.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-17
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-04-17
AI Technical Summary
Traditional cloud detection methods have low processing efficiency for high-resolution remote sensing images, especially when screening a large number of images. The quick view lacks specific cloud coverage and geographical coordinate data, making it impossible to directly determine the cloud coverage in irregular areas.
By obtaining a quick view of the remote sensing image for preprocessing, the target cloud coverage is extracted, a preset threshold is used to generate a cloud mask image, and the threshold is dynamically adjusted based on the error until the actual coverage of the cloud mask image is the smallest and the target coverage is generated. The optimal cloud mask image is then calibrated with geographical coordinates to obtain cloud detection results.
It achieves fast and automated cloud detection, reduces the complexity of cloud detection, improves efficiency, ensures the accuracy and availability of cloud coverage, and significantly improves the processing efficiency of remote sensing image data.
Smart Images

Figure CN118379624B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of remote sensing data processing and geographic information system GIS (Geographic Information System), and in particular relates to a remote sensing image cloud layer detection method and system based on quick view. Background Art
[0002] In the field of remote sensing, the presence of clouds often affects the quality of image data. Traditional cloud detection methods usually rely on manual analysis or the use of complex software processes to process raw high-resolution remote sensing images. The large amount of raw image data leads to long download and processing times. At the same time, the high resolution of raw remote sensing images increases the complexity of analysis and requires more computing resources. These factors together make it time-consuming and inefficient to process. This method is particularly cumbersome when screening a large number of remote sensing images to determine their suitability.
[0003] Quick views are simplified representations of remote sensing images. They are small, easy to load, and publicly accessible. They are usually used to preview data and conduct preliminary analysis of remote sensing image quality. Although quick views can provide information about cloud coverage, they usually lack specific range and geographic coordinate data and cannot be directly used to determine cloud coverage in irregular areas.
[0004] Therefore, a fast and automated cloud detection and processing technology for remote sensing images is needed to enable researchers and application users to quickly and accurately evaluate the usability of remote sensing image data. Summary of the invention
[0005] In view of this, the present invention proposes a remote sensing image cloud detection method and system based on quick view, which are used to solve the problem that the cloud coverage of remote sensing images cannot be quickly extracted.
[0006] In a first aspect, the present invention discloses a remote sensing image cloud detection method based on a quick view, the method comprising:
[0007] Get a quick view of the remote sensing image and pre-process it to extract the target cloud coverage;
[0008] The preprocessed quick view is subjected to feature extraction through a preset threshold to generate a cloud mask image;
[0009] Calculate the error between the actual cloud coverage of the cloud mask image and the target cloud coverage;
[0010] The preset threshold is dynamically adjusted according to the error, and the cloud mask image is regenerated according to the dynamically adjusted threshold until the error between the actual cloud coverage rate of the cloud mask image and the target cloud coverage rate is minimized, thereby generating an optimal cloud mask image;
[0011] The geographic coordinates are calibrated according to the optimal cloud mask image to obtain the cloud detection results of the remote sensing image.
[0012] On the basis of the above technical solution, preferably, the step of obtaining a quick view of the remote sensing image and performing preprocessing specifically includes:
[0013] Obtain remote sensing images uploaded by users through Web applications and parse metadata files of remote sensing images;
[0014] Download the quick view through the URL provided in the metadata file of the remote sensing image;
[0015] Name the quick view according to the combination of image ID and target cloud coverage;
[0016] Convert the quick view to HSV color space and grayscale it.
[0017] On the basis of the above technical solution, preferably, the step of extracting features from the preprocessed quick view by using a preset threshold to generate a cloud mask image specifically includes:
[0018] Extracting a first feature region whose brightness is greater than a preset brightness threshold from the preprocessed quick view;
[0019] Extracting a second feature region whose saturation is less than a preset saturation threshold from the preprocessed quick view;
[0020] The Sobel operator is used to perform edge detection on the processed quick image, and a third feature area whose gray value is greater than a preset edge threshold is extracted;
[0021] A bitwise AND operation is performed on the first feature region, the second feature region, and the third feature region to generate a cloud mask image.
[0022] On the basis of the above technical solution, preferably, dynamically adjusting the preset threshold according to the error, regenerating the cloud mask image according to the dynamically adjusted threshold, until the error between the actual cloud coverage of the cloud mask image and the target cloud coverage is minimized, generating the optimal cloud mask image specifically includes:
[0023] If the error E between the actual cloud coverage of the current cloud mask image and the target cloud coverage is current >0, then reduce the preset brightness threshold and increase the preset saturation threshold and the preset edge threshold;
[0024] If the error E between the actual cloud coverage of the current cloud mask image and the target cloud coverage is current ≤0, then increase the preset brightness threshold and decrease the preset saturation threshold and the preset edge threshold;
[0025] Feature extraction is performed on the preprocessed quick view image again according to the dynamically adjusted threshold to generate a cloud mask image;
[0026] Recalculate the error between the actual cloud coverage rate and the target cloud coverage rate of the cloud mask image, and repeat the above process of dynamically adjusting the preset threshold and generating the cloud mask image until the error is less than the preset error threshold or the preset number of iterations is reached, and output the optimal brightness threshold, saturation threshold, and edge threshold;
[0027] Generate an optimal cloud mask image according to the optimal brightness threshold, saturation threshold, and edge threshold.
[0028] On the basis of the above technical solution, preferably, the dynamically adjusting the preset threshold according to the error further includes:
[0029] Use a sliding window to track the error of continuous n iterations, and calculate the average change rate of the error within the sliding window
[0030]
[0031] where E i and E i+1 represent the errors after the i-th and (i + 1)-th iterations respectively, i = 1, 2,..., n - 1, 1 < n ≤ T, and T is the maximum number of iterations;
[0032] According to the average change rate of the error Calculate the step size of threshold adjustment in each iteration process.
[0033] On the basis of the above technical solution, preferably, calculating the step size of threshold adjustment in each iteration process according to the average change rate of the error specifically includes:
[0034] If the average change rate of the error then the step size of threshold adjustment is:
[0035]
[0036] where new_step is the new step size of threshold adjustment, last_step is the step size of threshold adjustment in the previous iteration, k is the adjustment coefficient, and k > 0;
[0037] If the average change rate of the error then the step size of threshold adjustment is:
[0038]
[0039] E prev is the error between the actual cloud coverage rate and the target cloud coverage rate of the cloud mask image in the previous iteration.
[0040] On the basis of the above technical solution, preferably, the geographic coordinate calibration specifically includes:
[0041] Based on the optimal cloud mask image, a new cloud mask file is created using the geospatial data conversion library;
[0042] Set the geographic transformation parameters and spatial reference system for the new cloud mask file to complete the geographic coordinate calibration of the cloud coverage range of the remote sensing image.
[0043] In a second aspect, the present invention discloses a remote sensing image cloud detection system based on a quick view, the system comprising:
[0044] Preprocessing module: used to obtain a quick view of the remote sensing image, perform preprocessing, and extract the target cloud coverage;
[0045] Cloud mask image generation module: used to extract features from the preprocessed quick view through a preset threshold to generate a cloud mask image;
[0046] Error calculation module: used to calculate the error between the actual cloud coverage of the cloud mask image and the target cloud coverage;
[0047] Cloud mask image optimization module: used to dynamically adjust the preset threshold according to the error, and regenerate the cloud mask image according to the dynamically adjusted threshold until the error between the actual cloud coverage of the cloud mask image and the target cloud coverage is minimized, thereby generating the optimal cloud mask image;
[0048] Coordinate calibration module: used to perform geographic coordinate calibration based on the optimal cloud mask image to obtain cloud detection results of remote sensing images.
[0049] In a third aspect of the present invention, an electronic device is disclosed, comprising: at least one processor, at least one memory, a communication interface and a bus;
[0050] Wherein, the processor, memory, and communication interface communicate with each other via the bus;
[0051] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to implement the method according to the first aspect of the present invention.
[0052] According to a fourth aspect of the present invention, a computer-readable storage medium is disclosed, wherein the computer-readable storage medium stores computer instructions, and the computer instructions enable a computer to implement the method described in the first aspect of the present invention.
[0053] Compared with the prior art, the present invention has the following beneficial effects:
[0054] 1) The present invention generates a cloud mask image by performing feature extraction based on the quick view of the remote sensing image, and dynamically adjusts the threshold of feature extraction according to the error between the cloud coverage of the cloud mask image and the known target cloud coverage, thereby generating an accurate cloud mask image, thereby accurately extracting the cloud coverage range, and realizing cloud detection based on the quick view. Compared with the traditional cloud detection method based on the original image, the complexity of cloud detection is reduced and the efficiency of cloud detection is improved.
[0055] 2) The present invention combines the online cloud detection service built with geographic information services. Users can upload remote sensing images through Web applications. The online cloud detection service automatically parses the metadata files of the remote sensing images, downloads the quick view through the URL provided in the metadata file, and performs cloud layer detection based on the quick view, thereby realizing fast and efficient online cloud layer detection and significantly improving the efficiency of processing remote sensing image data.
[0056] 3) The present invention presets a brightness threshold, a saturation threshold and an edge threshold according to the characteristics of clouds in remote sensing images, extracts highlight areas and low saturation areas from the preprocessed quick view, generates a cloud mask image in combination with the edge detection result, and performs adaptive threshold adjustment according to the error between the actual cloud coverage and the target cloud coverage, iteratively generates the optimal brightness threshold, saturation threshold and edge threshold, thereby completing the optimization of the cloud mask image, making the actual cloud coverage close to the target cloud coverage, improving the accuracy of remote sensing image cloud mask image generation, and ensuring that the final generated cloud mask image reaches the best in terms of accuracy and availability.
[0057] 4) In the cloud detection algorithm of the present invention, a feedback mechanism based on the error change trend is adopted, that is, the step size of the threshold adjustment in each iteration process is dynamically calculated according to the size of the average change rate of the error; if the error trend increases, it indicates that the recent adjustment has failed to improve the performance. The problem may be that the adjustment step size is too large or the direction is wrong. At this time, adjustment is performed through a step size adjustment scheme based on a logarithmic function. The logarithmic function can provide a nonlinear method, which can provide a larger adjustment when the error changes greatly and a subtle adjustment when the error changes less, so as to avoid over-adjustment and more closely approach the optimal solution; if the current error trend decreases, indicating that the recent adjustment is effective, the current step size can be maintained or the step size can be appropriately fine-tuned according to the situation, thereby realizing a simple and effective feedback mechanism, which can adjust the cloud detection strategy in real time and adaptively, and improve the accuracy of cloud detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0059] Figure 1 The flowchart of the remote sensing image cloud detection method based on quick view of the present invention;
[0060] Figure 2 The cloud layer detection service call flow chart of the present invention;
[0061] Figure 3 This is a flow chart of the remote sensing image cloud detection method based on cloud detection service of the present invention. DETAILED DESCRIPTION
[0062] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] See also Figure 1 The present invention proposes a remote sensing image cloud detection method based on quick view, the method comprising:
[0064] S1. Obtain a quick view of the remote sensing image, perform preprocessing, and extract the target cloud coverage.
[0065] S11. Provide cloud layer detection service through web application.
[0066] The present invention uses the Flask framework to build a Web application to provide cloud layer detection services based on quick views, such as Figure 2 As shown in the figure, it is a flowchart of calling the cloud layer detection service based on the quick view of the present invention, which mainly includes the control center, WPS, middleware, CloudDetection component and geographic coordinate assignment component. Through the interface of the Web application, users can effectively interact with the cloud layer detection service. The key lies in the implementation of the CloudDetection class, which inherits from the Process class of PyWPS and is specially designed to obtain and parse the metadata of the relevant remote sensing images uploaded by users. The CloudDetection class includes the adaptive threshold algorithm combined with metadata to realize the cloud range extraction function.
[0067] A network interface is specially set in the service configuration to allow users to conveniently upload metadata files containing key information, such as URLs of remote sensing image quick views, spatial range data, and cloud coverage information. In addition, in order to ensure the efficiency of cloud layer detection services and the accuracy of data, the present invention also defines Web routing and corresponding processing functions, which are responsible for effectively receiving and processing the data information in the above metadata files.
[0068] S12. Acquire the remote sensing image uploaded by the user and parse the metadata file of the remote sensing image.
[0069] Parse the remote sensing image metadata file, extract key information such as image quick view URL, image ID and cloud coverage, and use the known cloud coverage as the target cloud coverage for subsequent cloud coverage range extraction.
[0070] Figure 3 This is a flow chart of the remote sensing image cloud detection method based on cloud detection service of the present invention. Through the Web application, metadata analysis service, cloud range extraction service based on quick view and geographic coordinate calibration service can be provided to users.
[0071] S13. Download the quick view through the URL provided in the metadata file of the remote sensing image.
[0072] Download the remote sensing image snapshot from the URL provided in the metadata file of the remote sensing image, and name the snapshot according to the combination of the image ID and the target cloud coverage. This naming strategy facilitates the extraction of cloud coverage information corresponding to the remote sensing image, and also manages the image snapshot file. The extracted target cloud coverage information will serve as the initial reference point for the subsequent cloud detection algorithm, which is crucial for accurately identifying clouds and calculating cloud coverage.
[0073] S14, converting the quick view into the HSV color space and performing grayscale processing.
[0074] The downloaded remote sensing image snapshots need to be further processed, mainly including image format conversion and color space adjustment. The snapshots are converted from their original format to the HSV color space and grayscaled to obtain grayscale images to enhance the distinction between clouds and other surface features.
[0075] S2. Extract features from the preprocessed quick view using a preset threshold to generate a cloud mask image.
[0076] Generally speaking, clouds in remote sensing images have the characteristics of high brightness, low saturation and obvious edges. Therefore, the present invention sets initial brightness threshold, saturation threshold and edge threshold respectively, and extracts cloud features through these preset thresholds to generate a cloud mask image.
[0077] Specifically, a first feature region having a brightness greater than a preset brightness threshold is extracted from the preprocessed quick view using the V channel of the HSV color space;
[0078] Extracting a second feature area whose saturation is less than a preset saturation threshold from the preprocessed quick view using the S channel of the HSV color space;
[0079] The Sobel operator is used to perform edge detection on the processed quick image, and a third feature area whose gray value is greater than a preset edge threshold is extracted;
[0080] An initial cloud mask image is generated by performing a bit-by-bit AND operation on the first feature region, the second feature region, and the third feature region.
[0081] After the cloud mask image is generated, morphological operations and connected region analysis and alignment are applied for optimization. This ensures that the final cloud mask image is optimal in terms of accuracy and usability. Among them, morphological operations (such as closing operations) are used to improve the visual representation of the cloud layer, making it more continuous and consistent. Connected region analysis can remove small area noise points in the image and retain larger cloud areas, further improving the accuracy of the cloud mask.
[0082] S3. Calculate the error between the actual cloud coverage of the cloud mask image and the target cloud coverage, dynamically adjust the preset threshold according to the error, and regenerate the cloud mask image according to the dynamically adjusted threshold until the error is minimized, thereby generating an optimal cloud mask image.
[0083] Based on the error between the actual cloud coverage and the target cloud coverage, the present invention iteratively adjusts the thresholds of brightness, saturation and edge detection to extract cloud features, so that the actual cloud coverage is close to the target cloud coverage, thereby generating an accurate cloud mask image.
[0084] S31. Set the maximum number of iterations T and the error threshold.
[0085] S32. Calculate the error between the actual cloud coverage of the cloud mask image and the target cloud coverage.
[0086] Considering that the black edges around the remote sensing image quick view may affect the calculation result of the actual cloud coverage, the present invention identifies the non-completely black pixel area in the image as the valid area according to the quick view to calculate the actual cloud coverage, thereby avoiding this problem.
[0087] Assume that the actual cloud coverage is C actual , the target cloud coverage is C target , then the error E current for:
[0088] Ecurrent = C actual - C target
[0089] According to the comparison between the actual coverage rate and the target coverage rate of the current cloud mask, the present invention calculates the error between the two, which facilitates subsequent dynamic adjustment of the brightness threshold, saturation threshold, and edge threshold according to the error, enabling the cloud detection algorithm to adapt to different cloud coverage situations and improving the accuracy of cloud detection.
[0090] S33. Dynamically adjust the preset threshold by using a feedback mechanism based on error iteration.
[0091] In order to improve the efficiency and accuracy of threshold adjustment, the present invention introduces a feedback mechanism based on error iteration in the process of dynamically adjusting the preset threshold. The way for the present invention to dynamically adjust the preset threshold is as follows: if the error between the actual cloud coverage rate and the target cloud coverage rate of the current cloud mask image is greater than 0, calculate the step size of threshold adjustment according to the error change trend of continuous n iterations, and on the basis of the preset threshold in step S2, reduce the preset brightness threshold and increase the preset saturation threshold and increase the preset edge threshold; otherwise, recalculate the step size of threshold adjustment according to the error change trend of continuous n iterations, and increase the preset brightness threshold and reduce the preset saturation threshold and reduce the preset edge threshold according to the step size. That is, during each error iteration, the step size is feedback-adjusted according to the change trend of the average value of the errors of continuous n iterations, so that the step sizes for reducing or increasing the threshold are different, in order to adaptively adjust the cloud detection strategy.
[0092] Step S33 specifically includes the following sub-steps:
[0093] S331. If the error E between the actual cloud coverage rate and the target cloud coverage rate of the current cloud mask image current > 0, then reduce the preset brightness threshold and increase the preset saturation threshold and increase the preset edge threshold.
[0094] Use a sliding window to track the errors [E1, E2,..., E n of continuous n iterations, and calculate the average change rate of the errors within the sliding window
[0095]
[0096] where E i , E i+1 represent the errors after the i-th and (i + 1)-th iterations respectively, i = 1, 2,..., n - 1, 1 < n ≤ T, and T is the maximum number of iterations;
[0097] Calculate the step size of threshold adjustment during each iteration according to the average change rate of the errors :
[0098] (1) If the average rate of change of error That is, the error trend increases, indicating that the recent adjustments have failed to improve performance. The problem may be that the adjustment step size is too large or the direction is wrong. At this time, the step size adjustment scheme based on the logarithmic function is used for adjustment. This nonlinear method can provide larger adjustments when the error changes greatly, and provide subtle adjustments when the error changes are small, so as to avoid over-adjustment and more closely approach the optimal solution. At this time, the step size of the threshold adjustment is:
[0099]
[0100] Among them, new_step is the new threshold adjustment step size, last_step is the threshold adjustment step size in the last iteration process, k is the adjustment coefficient, and k>0.
[0101] (2) If the average rate of change of error That is, the error trend decreases, indicating that the recent adjustment is effective. At this time, the current step size should be maintained or adjusted appropriately according to the situation. At this time, the step size of the threshold adjustment is:
[0102]
[0103] Among them, new_step is the new threshold adjustment step size, last_step is the threshold adjustment step size in the last iteration, and E prev is the error between the actual cloud coverage of the cloud mask image and the target cloud coverage in the previous iteration.
[0104] S332, if the error E between the actual cloud coverage of the current cloud mask image and the target cloud coverage current ≤0, increase the preset brightness threshold and decrease the preset saturation threshold and the preset edge threshold.
[0105] The threshold adjustment strategy of step S332 is the same as that of step S331, using a sliding window to track the errors [E1, E2, ..., E n ], calculate the average rate of change of the error within the sliding window According to the average rate of change of error The step length of the threshold adjustment in each iteration process is calculated. The specific calculation method of the step length of the threshold adjustment is the same as that of step S331.
[0106] S34, re-extracting features from the pre-processed quick view according to the dynamically adjusted threshold value to generate a cloud mask image.
[0107] According to the threshold adjustment result of step S33, feature extraction is performed again on the preprocessed quick view in the same manner as step S2 to generate a cloud mask image.
[0108] S45. Return to step S32 to recalculate the error between the actual cloud coverage of the cloud mask image and the target cloud coverage, and repeat the above process of dynamically adjusting the preset threshold and generating the cloud mask image until the error is less than the preset error threshold or reaches the preset number of iterations, terminate the iteration, and output the optimal brightness threshold, saturation threshold, and edge threshold.
[0109] S46 , generating an optimal cloud mask image according to the optimal brightness threshold, saturation threshold, and edge threshold.
[0110] In the cloud detection algorithm of the present invention, adaptive threshold adjustment is performed according to the error between the actual cloud coverage and the target cloud coverage, and the optimal brightness threshold, saturation threshold and edge threshold are iteratively generated, thereby completing the optimization of the cloud mask image and making the actual cloud coverage close to the target cloud coverage. A feedback mechanism based on the error change trend is adopted to calculate the step size of the threshold adjustment, that is, the step size of the threshold adjustment in each iteration process is dynamically calculated according to the size of the average change rate of the error, realizing a simple and effective feedback mechanism, which can adjust the cloud detection strategy in real time and adaptively to optimize the cloud representation.
[0111] S5. Perform geographic coordinate calibration based on the optimal cloud mask image to obtain cloud detection results of the remote sensing image.
[0112] The present invention performs geographic coordinate calibration operation of the quick view cloud mask through a geospatial data conversion library. The geospatial data conversion library is an open source raster spatial data conversion library that complies with the X / MIT license agreement. The data conversion library processes supported data formats based on its abstract data model, including coordinate systems, affine geographic coordinate conversions, and geodetic control points, and has powerful geographic data processing capabilities. The library can calculate geographic transformation parameters using known control points, starting from parsing metadata, establishing control points through the geographic coordinates of the four corners of the image in the metadata and the coordinates of the quick view image, calculating affine transformation parameters, and creating a coordinate positioning file, thereby realizing the conversion of the binary cloud mask image of the quick view into a file containing geographic coordinate information.
[0113] The present invention is based on the optimal cloud mask image, uses the geospatial data conversion library to create a new cloud mask file, sets the geographic transformation parameters and spatial reference system for the new cloud mask file, and completes the geographic coordinate calibration of the cloud coverage range of the remote sensing image based on the projection information of the spatial reference system. Specifically, the geographic coordinate calibration includes the following process:
[0114] Metadata processing and geographic information extraction: extract necessary geographic coordinate information from the metadata of the remote sensing image according to the metadata file parsing in step S1 to ensure the accuracy of subsequent steps and the integrity of the data;
[0115] Accurate calculation of resolution and geographic coordinates: Based on the size of the remote sensing image and its position in geographic space, the precise resolution of each pixel on the actual ground is calculated;
[0116] Create a cloud mask file containing geographic coordinates: Apply the extracted geographic coordinate information and the calculated pixel resolution, and use the geospatial data conversion library to create a cloud mask file containing geographic coordinates to ensure the geographic accuracy of the file;
[0117] Set up geo-transformation and projection information: Convert the processed cloud mask into a geo-referenced file, embed the geographic information obtained from the metadata, calculate the spatial resolution, and create a file with appropriate geo-transformation parameters and projection information to ensure compatibility with GIS software.
[0118] The present invention generates a cloud mask image by performing feature extraction based on the quick view of the remote sensing image, and dynamically adjusts the threshold of feature extraction according to the error between the cloud coverage of the cloud mask image and the known target cloud coverage, so as to generate an accurate cloud mask image, thereby accurately extracting the cloud coverage range, and realizing cloud detection based on the quick view. Compared with the traditional cloud detection method based on the original image, the complexity of cloud detection is reduced and the efficiency of cloud detection is improved.
[0119] On the basis of the above method embodiments, the present invention further proposes a remote sensing image cloud detection system based on a quick view, the system comprising:
[0120] Preprocessing module: used to obtain a quick view of the remote sensing image, perform preprocessing, and extract the target cloud coverage;
[0121] Cloud mask image generation module: used to extract features from the preprocessed quick view through a preset threshold to generate a cloud mask image;
[0122] Error calculation module: used to calculate the error between the actual cloud coverage of the cloud mask image and the target cloud coverage;
[0123] Cloud mask image optimization module: used to dynamically adjust the preset threshold according to the error, and regenerate the cloud mask image according to the dynamically adjusted threshold until the error between the actual cloud coverage of the cloud mask image and the target cloud coverage is minimized, thereby generating the optimal cloud mask image;
[0124] Coordinate calibration module: used to perform geographic coordinate calibration based on the optimal cloud mask image to obtain cloud detection results of remote sensing images.
[0125] The above system embodiments and method embodiments correspond one to one, and for a brief description of the system embodiments, please refer to the method embodiments.
[0126] The present invention also discloses an electronic device, comprising: at least one processor, at least one memory, a communication interface and a bus; wherein the processor, memory, and communication interface communicate with each other through the bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to implement the aforementioned method of the present invention.
[0127] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, wherein the computer instructions enable the computer to implement all or part of the steps of the method described in the embodiment of the present invention. The storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk, and other media that can store program codes.
[0128] The system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be distributed to multiple network units. A person skilled in the art may select some or all of the modules according to actual needs to achieve the purpose of the solution of this embodiment without creative effort.
[0129] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A remote sensing image cloud detection method based on quick view, characterized in that: The method comprises: Get a quick view of the remote sensing image and pre-process it to extract the target cloud coverage; The preprocessed quick view is subjected to feature extraction through a preset threshold to generate a cloud mask image; Calculate the error between the actual cloud coverage of the cloud mask image and the target cloud coverage; The preset threshold is dynamically adjusted according to the error, and the cloud mask image is regenerated according to the dynamically adjusted threshold until the error between the actual cloud coverage rate of the cloud mask image and the target cloud coverage rate is minimized, thereby generating an optimal cloud mask image; The geographical coordinates are calibrated according to the optimal cloud mask image to obtain the cloud detection results of the remote sensing image; The method of dynamically adjusting the preset threshold according to the error, regenerating the cloud mask image according to the dynamically adjusted threshold until the error between the actual cloud coverage of the cloud mask image and the target cloud coverage is minimized, and generating the optimal cloud mask image specifically includes: If the error E between the actual cloud coverage of the current cloud mask image and the target cloud coverage is current >0, then reduce the preset brightness threshold and increase the preset saturation threshold and the preset edge threshold; If the error E between the actual cloud coverage of the current cloud mask image and the target cloud coverage is current ≤0, then increase the preset brightness threshold and decrease the preset saturation threshold and the preset edge threshold; Re-extract features from the pre-processed quick view according to the dynamically adjusted threshold value to generate a cloud mask image; Recalculate the error between the actual cloud coverage of the cloud mask image and the target cloud coverage, and repeat the above process of dynamically adjusting the preset threshold and generating the cloud mask image until the error is less than the preset error threshold or the preset number of iterations is reached, and output the optimal brightness threshold, saturation threshold and edge threshold; Generate an optimal cloud mask image according to the optimal brightness threshold, saturation threshold and edge threshold; The dynamically adjusting the preset threshold according to the error also includes: Use a sliding window to track the error of n consecutive iterations and calculate the average rate of change of the error within the sliding window ΔE: Among them, E i and E i+1 represent the errors after the i-th and (i + 1)-th iterations respectively, where i = 1, 2, …, n - 1, 1 < n ≤ T, and T is the maximum number of iterations; According to the average rate of change of error Calculate the step size of threshold adjustment during each iteration; According to the average rate of change of error The calculation of the step size of the threshold adjustment during each iteration specifically includes: If the average rate of change of error Then the step size of threshold adjustment is: Among them, new_step is the new threshold adjustment step size, last_step is the threshold adjustment step size in the last iteration process, k is the adjustment coefficient, and k>0; If the average rate of change of error Then the step size of threshold adjustment is: E prev is the error between the actual cloud coverage of the cloud mask image and the target cloud coverage in the previous iteration.
2. The method for detecting cloud layer from remote sensing images based on quick view according to claim 1, characterized in that: The step of obtaining a quick view of the remote sensing image and performing preprocessing specifically includes: Obtain remote sensing images uploaded by users through Web applications and parse metadata files of remote sensing images; Download the quick view through the URL provided in the metadata file of the remote sensing image; Convert the quick view to HSV color space and grayscale it.
3. The method for detecting cloud layer from remote sensing images based on quick view according to claim 2, characterized in that: The step of extracting features from the preprocessed quick view by using a preset threshold to generate a cloud mask image specifically includes: Extracting a first feature region whose brightness is greater than a preset brightness threshold from the preprocessed quick view; Extracting a second feature region whose saturation is less than a preset saturation threshold from the preprocessed quick view; The Sobel operator is used to perform edge detection on the processed quick image, and a third feature area whose gray value is greater than a preset edge threshold is extracted; A bitwise AND operation is performed on the first feature region, the second feature region, and the third feature region to generate a cloud mask image.
4. The method for detecting cloud layer from remote sensing images based on quick view according to claim 1, characterized in that: The geographic coordinate calibration specifically includes: Based on the optimal cloud mask image, a new cloud mask file is created using the geospatial data conversion library; Set the geographic transformation parameters and spatial reference system for the new cloud mask file to complete the geographic coordinate calibration of the cloud coverage range of the remote sensing image.
5. A remote sensing image cloud detection system based on quick view using the method described in any one of claims 1 to 4, characterized in that: The system comprises: Preprocessing module: used to obtain a quick view of the remote sensing image, perform preprocessing, and extract the target cloud coverage; Cloud mask image generation module: used to extract features from the preprocessed quick view through a preset threshold to generate a cloud mask image; Error calculation module: used to calculate the error between the actual cloud coverage of the cloud mask image and the target cloud coverage; Cloud mask image optimization module: used to dynamically adjust the preset threshold according to the error, and regenerate the cloud mask image according to the dynamically adjusted threshold until the error between the actual cloud coverage of the cloud mask image and the target cloud coverage is minimized, thereby generating the optimal cloud mask image; Coordinate calibration module: used to perform geographic coordinate calibration based on the optimal cloud mask image to obtain cloud detection results of remote sensing images.
6. An electronic device, characterized in that: include: at least one processor, at least one memory, a communication interface, and a bus; Wherein, the processor, memory, and communication interface communicate with each other via the bus; The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to implement the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions enable a computer to implement the method according to any one of claims 1 to 4.
