Cloud area identification and cloud cover calculation method and system based on all-sky imager
By combining the maximum inter-class variance method and brightness threshold with morphological smoothing, the problem of inaccurate cloud area identification by all-sky imagers under strong light conditions is solved, achieving high-precision cloud cover calculation, which is suitable for marine cloud research and severe weather forecasting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
- Filing Date
- 2026-01-05
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies struggle to accurately identify cloud areas in all-sky imager images, especially under strong light conditions, leading to significant errors in cloud cover calculations.
An initial threshold is selected based on the maximum inter-class variance method. Combined with brightness threshold and morphological smoothing, image preprocessing, cloud area recognition, and geometric correction are used to improve the accuracy of cloud area recognition and reduce cloud amount calculation error.
It improves the accuracy of cloud area identification, reduces cloud cover calculation errors, is suitable for marine cloud research, supports accurate forecasting of severe weather such as typhoons and sea fog, and provides a scientific basis for safe navigation and operations at sea.
Smart Images

Figure CN121459187B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of cloud measurement technology, specifically relating to a method and system for cloud area identification and cloud amount calculation based on an all-sky imager. Background Technology
[0002] All-sky imagers are crucial instruments for ground-based cloud observation, capable of continuously acquiring high spatiotemporal resolution images of the entire sky. Accurately identifying cloud regions and calculating cloud cover from these images is of great significance for fields such as weather forecasting, climate research, and solar power generation prediction.
[0003] Extending the methods of observing and studying ground clouds to observing and studying marine clouds is crucial for accurately studying marine cloud cover. This is an important factor in reducing the uncertainty of global climate models and is directly related to the ability to predict air-sea exchange, ocean heat balance, and long-term climate change.
[0004] When retrieving cloud cover from all-sky imager images, the mainstream methods are to use a fixed threshold and an adaptive threshold based on maximum inter-class variance. However, the fixed threshold is difficult to adapt to various complex sky images, and the threshold calculated by the maximum inter-class method is difficult to adapt to sky images with complex backgrounds and uneven illumination.
[0005] Under clear skies and strong sunlight, the area around the sun becomes supersaturated. The spectral characteristics of the red, green, and blue bands in these supersaturated regions are very similar to those of clouds, making them easily identified as clouds during cloud detection. When clouds do not completely block sunlight, this area becomes overexposed, making cloudless blue background areas appear whiter and brighter. Traditional single-threshold methods struggle to accurately detect cloudless atmosphere near the sun, leading to significant errors in cloud cover calculations. Summary of the Invention
[0006] To address the aforementioned problems, this application provides a method and system for cloud area identification and cloud cover calculation based on an all-sky imager, which can improve the accuracy of cloud area identification and reduce cloud cover calculation errors. The technical solution is as follows:
[0007] A method for cloud area identification and cloud cover calculation based on an all-sky imager includes the following steps:
[0008] S1. Real-time acquisition of sky images captured by the all-sky imager;
[0009] S2. Preprocess the acquired sky image to obtain a valid sky image;
[0010] S3. Analyze the RGB characteristics of cloud areas and blue sky in valid sky images;
[0011] S4. Select the initial threshold based on the maximum inter-class variance method. For sky images with an introduced brightness threshold, the brightness threshold is selected using the maximum inter-class variance method.
[0012] S5. Initially identify cloud areas in the entire sky image using an initial threshold, and then adjust the threshold based on image features to achieve cloud area identification;
[0013] S6. Perform morphological smoothing on the sky image after cloud area identification;
[0014] S7. Perform geometric correction on the smoothed image and calculate cloud cover.
[0015] Preferably, step S2 involves preprocessing the acquired sky image to obtain a valid sky image, as follows:
[0016] S201, using a circular mask to define the observation range;
[0017] S202, Remove the obstacle portion to obtain the obstacle mask image;
[0018] S203, superimpose the circular mask image and the obstacle mask image to obtain a fixed mask image, and use the fixed mask image to cover the captured sky image to obtain an effective sky image containing only the sky area.
[0019] Preferably, step S3, analyzing the RGB features of the cloud area and blue sky in the effective sky image, includes:
[0020] S301. Separate the red, green, and blue channels of the effective sky image;
[0021] S302. Extract the red, green, and blue channels respectively, calculate the grayscale value of each pixel in each of the three channels, and form three two-dimensional matrices with matrix elements as follows: , , ; This indicates the red grayscale level of the pixel; This indicates the green grayscale level of the pixel; This indicates the blue grayscale level of the pixel;
[0022] S303. Extract the cloud area and the blue sky area to form a red, green, and blue channel matrix;
[0023] S304. Draw line graphs of pixel count and grayscale value for the three channels of clouds and blue sky, and analyze their distribution patterns;
[0024] S305. Input a valid sky image and extract the entire valid sky image to form a red, green, and blue three-channel matrix.
[0025] Preferably, the initial threshold for each sub-region is calculated based on the maximum inter-class variance method; the initial cloud area is identified using the initial threshold on the sky image after normalized difference processing, and if D≤T, it is judged as a cloud, and if D>T, it is judged as sky.
[0026] Preferably, for sky images with an introduced brightness threshold, the brightness threshold is selected using the maximum inter-class variance method, and the steps are as follows:
[0027] S401. Obtain the numerical matrix from the effective sky image after normalized difference processing, and calculate the initial threshold using the Otsu's inter-class method;
[0028] S402. Calculate a suitable brightness threshold for the sky image that requires a brightness threshold using the maximum inter-class variance method. ;
[0029] S403. To determine how many brightness sub-regions the current image is suitable to be divided into, define the segmentation efficiency gain. Set a complexity threshold ;
[0030] when At this point, the sky brightness structure is determined to be complex, so a dual brightness threshold mode is selected, and two thresholds are output. The sky is divided into three regions;
[0031] when This is a low-brightness area. The time is the medium brightness area. High-brightness area;
[0032] Brightness Intensity ; They are respectively , , Abbreviation;
[0033] when At this time, the sky brightness distribution is relatively simple, so the single brightness threshold mode is selected, and a threshold is output. This divides the sky into two regions;
[0034] when This is a low-brightness area. This is a high-brightness area;
[0035] S404. For each brightness sub-region, perform normalized difference processing on the pixels to form a numerical matrix of the same size as the original valid sky image. Each location... The value is the D value of that pixel;
[0036] ;
[0037] S407. Use the initial threshold to identify cloud areas in the valid sky image to obtain an initial cloud area identification image.
[0038] Preferably, the cloud area identification method in step S5 is as follows:
[0039] S501. Adjust the threshold value before and after the initial cloud area identification of the valid sky image based on the initial threshold;
[0040] S502. An effective sky image with a brightness threshold is introduced. For each brightness sub-region, a different initial threshold T for normalized difference is set within the pixel range. The higher the brightness of the sub-region, the smaller the initial threshold is set.
[0041] Preferably, the effective sky image that is not affected by illumination is binarized to directly obtain a preliminary cloud mask; for the effective sky image affected by illumination, a brightness threshold is introduced, and each brightness sub-region after identification is binarized to generate a binarized cloud mask for each sub-region. The binarized cloud masks of each sub-region are then combined by a logical OR operation to obtain a preliminary cloud mask.
[0042] Preferably, step S6 involves morphological smoothing of the sky image after cloud area identification, as follows:
[0043] S601. Perform morphological closing operations on the preliminary cloud mask, using a radius of r. c The disk-shaped structural element is used for the initial cloud mask M. raw Perform a morphological closing operation to obtain the intermediate mask M. closed ;
[0044] S602. Morphological opening operation, using a radius of r o The disk-shaped structural element is used for the intermediate mask M. closed Perform a morphological opening operation to obtain the intermediate mask M. opened ;
[0045] S603. Remove the small connected area and the intermediate mask M. opened Perform connected component labeling and calculate the pixel area of each connected component; remove all components with an area smaller than a preset threshold A. min The connected regions are used to obtain the intermediate mask M. cleaned ;
[0046] S604. Void filling, for the intermediate mask M cleaned Perform hole-filling operation on the binary image to identify and fill the background area completely surrounded by cloud pixels, resulting in the final smooth cloud mask M. smooth ;
[0047] S605. The smooth cloud mask Msmooth With effective sky area mask M sky Perform a logical AND operation to obtain the final cloud mask M. cloud .
[0048] Preferably, step S7 performs geometric correction on the smoothed image, and the cloud cover calculation includes:
[0049] S701. Using the image center as the zenith, calculate the zenith angle θ corresponding to each valid pixel;
[0050] S702. Divide the effective sky image into N rings, with the zenith angle range of each ring being... For the first Each ring band, its geometric correction coefficient The calculation formula is:
[0051] ;
[0052] in The value is in radians;
[0053] S703. Count the number of cloud pixels within each ring zone. Total effective sky pixels Then the corrected cloud cover The calculation formula is:
[0054] ;
[0055] in Indicates the first The solid angle occupied by each partition cloud, Indicates the first The solid angle occupied by the cloudless blue sky area in each zone, This represents the number of pixels in the cloudless blue sky region of the valid sky.
[0056] A system based on cloud area identification and cloud amount calculation using an all-sky imager includes an image acquisition unit, an image processing unit, and an output unit;
[0057] Image acquisition unit: acquires sky images captured by the all-sky imager in real time;
[0058] Image processing unit: Preprocesses the acquired sky image to obtain a valid sky image; analyzes the RGB features of cloud areas and blue sky in the valid sky image; selects a normalized difference processing method to identify cloud areas; introduces a brightness threshold for sky images affected by illumination but not completely covered by clouds; for sky images unaffected by illumination, selects an initial threshold based on the maximum inter-class variance method; for sky images with introduced brightness thresholds, selects a brightness threshold using the maximum inter-class variance method; performs preliminary cloud area identification on the entire sky image using the initial threshold, and then adjusts the threshold based on image features to achieve cloud area identification; performs morphological smoothing on the sky image after cloud area identification; performs geometric correction on the smoothed image and calculates cloud cover.
[0059] Output unit: Visualizes the results.
[0060] Compared with the prior art, the beneficial effects of this application are as follows:
[0061] This invention employs a normalized difference processing method to identify cloud areas, introducing a brightness threshold for sky images with strong sunlight that are not completely covered by clouds. An initial threshold is selected based on the maximum inter-class variance (MOV) method, and a brightness threshold is then selected for the sky images with the introduced brightness threshold. Initial cloud area identification is performed on the entire sky image using the initial threshold, and the threshold is adjusted based on image features to achieve more accurate cloud area identification. Morphological smoothing is then applied to the sky image after cloud area identification. Finally, geometric correction is performed on the smoothed image to calculate cloud cover. This invention utilizes differentiated processing of sky images, introduces a brightness threshold for cloud areas with strong light interference, combines morphological smoothing to reduce noise impact, effectively improving the accuracy of cloud area identification, and finally uses geometric correction to reduce cloud cover calculation errors. Attached Figure Description
[0062] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0063] Figure 1 A flowchart illustrating a cloud region identification and cloud cover inversion method based on an all-sky imager, provided as an embodiment of the present invention;
[0064] Figure 2 This is a flowchart of brightness partitioning threshold processing for strong light conditions provided in an embodiment of the present invention;
[0065] Figure 3 The following are examples of the recognition results for sky images affected by strong light, provided by embodiments of the present invention: (a) a sky image captured by an all-sky imager, and (b) the recognition results after adding a brightness threshold, provided by embodiments of the present invention.
[0066] Figure 4 This is a schematic diagram of the morphological smoothing process provided in an embodiment of the present invention;
[0067] Figure 5 The flowchart for calculating the initial threshold is shown. Detailed Implementation
[0068] To better understand the purpose, principles, features, and advantages of this invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The examples given are only for explaining the invention and are not intended to limit the scope of the invention.
[0069] Figure 1 A flowchart illustrating a cloud region identification and cloud cover inversion method based on an all-sky imager, as provided in this embodiment of the invention, is shown below. Figure 1 As shown, the method includes;
[0070] Step 1: Acquire sky images captured by the all-sky imager in real time.
[0071] In practice, the position of the all-sky imager is adjusted to minimize the range of obstacles in the captured sky images, and the shooting frequency of the all-sky imager is adjusted, for example, to take one image every 10 minutes.
[0072] Step 2: Preprocess the acquired sky image to obtain a valid sky image.
[0073] In practice, we try our best to ensure that there are no obstacles obstructing the captured sky images. However, under some special detection conditions, such as cloud detection at sea, it is difficult to guarantee that there are no obstacles obstructing the images. In such cases, preprocessing is required to remove obstacles and obtain effective sky images.
[0074] Step 3: Analyze the RGB features of cloud areas and blue sky in the effective sky image.
[0075] Step 4: Select the normalized difference processing method to identify cloud areas, and introduce a brightness threshold for sky images with strong sunlight that are not completely covered by clouds.
[0076] The initial threshold is selected based on the Otsu's method. For sky images with an introduced brightness threshold, the brightness threshold is selected using the Otsu's method.
[0077] In practice, although the value that maximizes the inter-class variance is calculated, this threshold works well for local sky images, but has a large error in recognizing the entire sky image taken by the sky imager. Therefore, this threshold is used as the initial threshold and is used as the basis for adjustment in the later recognition process.
[0078] Step 5: Initially identify cloud areas in the entire sky image using an initial threshold, and then adjust the threshold based on image features to achieve more accurate cloud area identification.
[0079] Step 6: Perform morphological smoothing on the sky image after cloud area identification.
[0080] Step 7: Perform geometric correction on the smoothed image and calculate the cloud cover.
[0081] This invention provides a cloud region identification and cloud cover inversion method based on an all-sky imager, improving the accuracy of cloud region identification and reducing cloud cover calculation errors. Furthermore, the processing method can be extended to marine cloud research, providing a scientific basis for accurate forecasting of severe weather such as typhoons and sea fog, and ensuring the safety of maritime navigation and operations. Example:
[0082] Step 1, real-time acquisition of sky images captured by the all-sky imager includes:
[0083] Step 101: Adjust the position of the all-sky imager to minimize the range of obstacles in the captured sky image;
[0084] In practice, it is best to ensure that the area of obstacles does not exceed 20% of the sky image.
[0085] Step 102: Adjust the shooting frequency of the all-sky imager;
[0086] In practice, the frequency can be adjusted to take one photo every 10 minutes.
[0087] Step 2: Preprocess the acquired sky image to obtain a valid sky image.
[0088] Step 201: Use a circular mask to define the observation range;
[0089] In practice, the sky image captured by the all-sky imager is a circular image, and the exported image data is generally square, that is, there is a black square around the circular image to display the time. The circular sky image is defined by a circular mask.
[0090] Step 202: Manually mark and remove obstacle portions to obtain an obstacle mask image;
[0091] In practice, the all-sky imager system has an automatic obstacle removal function. However, misjudgments often occur during the automatic recognition process, so manual removal is used instead. When the shooting position does not change, the obstacle position remains fixed, so manual removal only needs to be done once. The obstacle mask obtained by manual removal is used in all sky images in post-processing.
[0092] Step 203: Overlay the circular mask image and the obstacle mask image to obtain a fixed mask image. Use the fixed mask image to cover the captured sky image to obtain an effective sky image containing only the sky area. Use the effective sky image for subsequent analysis and processing.
[0093] Step 3: Analyze the RGB features of the valid sky image.
[0094] In one possible embodiment, step 3, analyzing the RGB features of the effective sky image and analyzing the RGB features of the cloud area and blue sky based on the effective sky image, includes:
[0095] Step 301: Separate the red, green, blue, and color channels of the effective sky image;
[0096] Step 302: Extract the red channel, calculate the grayscale value of the red band for each pixel, forming a two-dimensional matrix. Each matrix element... This indicates the red grayscale level of the pixel (0-255).
[0097] Extract the green channel, calculate the grayscale value of the green band for each pixel, forming a two-dimensional matrix, and each matrix element... This indicates the green gray level (0-255) of the pixel.
[0098] Extract the blue channel, calculate the grayscale value of the blue band for each pixel, forming a two-dimensional matrix, and each matrix element... This indicates the blue grayscale level (0-255) of the pixel.
[0099] Step 303: Extract the cloud area and blue sky area using the above extraction method to form a red, green, and blue channel matrix.
[0100] Step 304: Draw line graphs of pixel count and grayscale value for the three channels of clouds and blue sky, and analyze their distribution patterns.
[0101] In practice, cloud images and cloudless blue sky images are cropped from the sky image, and the drawn line graph represents the number of pixels occupied by each gray level in the red, green, and blue channels.
[0102] Step 305: Input a valid sky image and extract the entire valid sky image to form a red, green, and blue three-channel matrix using the extraction method described above.
[0103] Step 4: Select the normalized difference processing method to identify cloud areas, and introduce a brightness threshold for sky images with strong sunlight that are not completely covered by clouds.
[0104] like Figure 2 This is a flowchart of brightness partitioning threshold processing for strong light conditions provided in an embodiment of the present invention, combined with... Figure 2 .
[0105] In one possible embodiment, step 4 includes:
[0106] The initial threshold T for each sub-region is calculated using the Otsu's method. The sky image after normalized difference processing is then used to identify the initial cloud area using the initial threshold. If D≤T, it is identified as a cloud; if D>T, it is identified as sky.
[0107] Step 401: Perform normalized interpolation processing on each pixel, calculated using the following formula: This forms a numerical matrix of the same size as the original valid sky image, with each location... The value is the D value of that pixel;
[0108] For sky images with strong sunlight that are not completely covered by clouds, the brightness intensity is calculated first. The effective sky image is divided into partitions, and the calculation formula is as follows: .
[0109] For each brightness sub-region, normalized interpolation is performed on the pixels to form a numerical matrix of the same size as the original valid sky image. Each location... The value is the D value of that pixel.
[0110] Step 5: Select an initial threshold based on the maximum inter-class variance method. For the sky image with an introduced brightness threshold, the brightness threshold is selected using the maximum inter-class variance method.
[0111] In one possible embodiment, step 5 of the maximum inter-class variance method includes:
[0112] Step 501: Calculate the initial segmentation threshold T using the maximum inter-class method on the numerical matrix obtained from the effective sky image after normalized difference processing.
[0113] Step 502, the effective sky image pixel has a gray level of L and a gray value of The number of pixels is If there are , then the total number of pixels is The probability of each grayscale value appearing is .
[0114] Assume that the image is divided into background using a threshold T. and If there are two types of targets, then the probabilities of each type occurring are as follows:
[0115] ;
[0116] The average gray values of the two classes are as follows:
[0117] ;
[0118] The average gray value of the entire effective sky image can be expressed as:
[0119] .
[0120] Step 503, the inter-class variance of the effective sky image background and target classes is:
[0121] .
[0122] Step 504, when processing using normalized difference, satisfies The threshold T is the initial threshold for segmenting the target and the background.
[0123] Step 505: Calculate a suitable brightness threshold for the sky image where a brightness threshold needs to be introduced using the maximum inter-class variance method. .
[0124] In practice, the optimal luminance threshold is determined by the maximum inter-class variance. The calculation yielded:
[0125] ;
[0126] Where k represents the number of brightness regions after segmentation. and Let represent the pixel probability and average gray value of the i-th region, respectively; This represents the average gray level of the effective sky area.
[0127] Step 506: To determine how many brightness sub-regions the current image is suitable to be divided into, define the segmentation performance gain. In practice, Set an empirical complexity threshold In practical implementation, the complexity threshold Take 0.05.
[0128] Step 507, when At this point, if the sky brightness structure is deemed complex, the system automatically selects the dual brightness threshold mode and outputs two threshold values. , The sky is divided into three regions;
[0129] when This is a low-brightness area. The time is the medium brightness area. High-brightness area;
[0130] when At this time, the sky brightness distribution is relatively simple, and the system automatically selects the single brightness threshold mode and outputs a threshold. This divides the sky into two regions;
[0131] when This is a low-brightness area. This is a high-brightness area.
[0132] Step 508: For each brightness sub-region, perform normalized difference processing on the pixels to form a numerical matrix of the same size as the original valid sky image. Each location... The value is the D value of that pixel.
[0133] In practice, the initial threshold cannot accurately identify cloud areas, so the initial threshold is used as the basis for adjusting the threshold of the effective sky image in the later processing.
[0134] like Figure 3 This is the recognition result of a sky image affected by strong light, provided by an embodiment of the present invention. Figure 3 (a) is a sky image taken by the All-Sky Imager, and (b) is the recognition result after increasing the brightness threshold.
[0135] Initial cloud area identification is performed on the entire sky image using an initial threshold, and then the threshold is adjusted based on image features to achieve more accurate cloud area identification.
[0136] In one possible embodiment, adjusting the threshold in step 5 to achieve more accurate cloud area identification includes:
[0137] Based on the initial threshold, the threshold is adjusted before and after the initial cloud area identification of the valid sky image. When using normalized difference processing, if more cloud areas are identified (a part of the sky is identified as clouds), the threshold is lowered, and if fewer cloud areas are identified (a part of the cloud area is not identified), the threshold is raised.
[0138] For an effective sky image with a brightness threshold, different initial thresholds T for the normalized difference are set for the pixel range corresponding to each brightness sub-region. The higher the brightness of the sub-region, the smaller the initial threshold is set.
[0139] In practice, a complexity threshold is used. To determine how many brightness thresholds to set, if one brightness threshold is sufficient for accurate recognition, then there is no need to use two brightness thresholds.
[0140] Unaffected by illumination: The recognition results of valid sky images without introducing a brightness threshold are binarized to obtain a preliminary cloud mask. .
[0141] Influenced by illumination: Using an effective sky image with a brightness threshold, each identified brightness sub-region is binarized to generate a binarized cloud mask for each sub-region. These binarized cloud masks are then combined using a logical OR operation to obtain a preliminary cloud mask. .
[0142] Step 6: Perform morphological smoothing on the sky image after cloud area identification.
[0143] In one possible embodiment, such as Figure 4 The diagram shown is a schematic of the morphological smoothing process provided in an embodiment of the present invention. Figure 4 Step 7, morphological smoothing, includes:
[0144] Step 601, preliminary cloud masking ( , Perform morphological closing operations using a radius of r. c The disk-shaped structural element makes r c =1 pixel, for the initial cloud mask M raw Perform a morphological closing operation to obtain the intermediate mask M. closed ;
[0145] Step 602, morphological opening operation, using a radius of r o The disk-shaped structural element makes r o =1 pixel, for the intermediate mask M closed Perform a morphological opening operation to obtain the intermediate mask M. opened This operation can remove isolated noise points with an area smaller than the area of the structuring element and smooth the boundaries of cloud regions.
[0146] Step 603, remove the small connected area and apply it to the intermediate mask M. opened Perform connected component labeling and calculate the pixel area of each connected component. Remove all components with an area smaller than a preset threshold A. min A connected region with a value of 50 is obtained to obtain the intermediate mask M. cleaned This step further eliminates small false detection areas that the previous steps failed to remove.
[0147] Step 601, hole filling, for the intermediate mask M cleaned Perform hole-filling operation on the binary image to identify and fill the background area completely surrounded by cloud pixels, resulting in the final smooth cloud mask M. smooth This step can make the interior of the cloud area more continuous, and is especially suitable for large continuous cloud types such as stratiform clouds.
[0148] Step 605, apply the smooth cloud mask M smooth With effective sky area mask M sky Perform a logical AND operation to obtain the final cloud mask M. cloud .
[0149] In practice, the cloud area recognition result after smoothing is the final cloud area recognition result, and the cloud area recognition result image is used for subsequent geometric correction and cloud amount calculation.
[0150] Step 7: Perform geometric correction on the smoothed image and calculate the cloud amount by calculating the percentage of pixels in the cloud-covered area.
[0151] In one possible embodiment, step 8, geometric correction and cloud cover calculation, includes:
[0152] In practice, cloud cover calculation is performed without considering edge compression distortion caused by the fisheye lens of the all-sky imager:
[0153] .
[0154] However, this formula assumes that each pixel corresponds to the same solid angle in the sky, which can lead to errors in cloud cover calculation.
[0155] Step 701: Based on the projection characteristics of the fisheye lens of the all-sky imager, with the image center as the zenith, calculate the zenith angle θ corresponding to each effective pixel.
[0156] Step 702: Divide the effective sky image into N rings, with the zenith angle range of each ring being... For the first Each ring band, its geometric correction coefficient The calculation formula is:
[0157] ;
[0158] in , The value is in radians;
[0159] In practice, the effective sky image is divided into 9 rings.
[0160] Count the number of cloud pixels within each ring. Total effective sky pixels Then the corrected cloud cover The calculation formula is:
[0161] .
[0162] Through the above steps, the present invention can accurately identify cloud areas from sky images captured by an all-sky imager, especially optimizing the identification of areas under strong light. Morphological smoothing is used to smooth the identified sky images, and finally geometric correction is combined to improve the accuracy of cloud cover inversion.
[0163] A system based on cloud area identification and cloud amount calculation using an all-sky imager includes an image acquisition unit, an image processing unit, and an output unit;
[0164] Image acquisition unit: acquires sky images captured by the all-sky imager in real time;
[0165] Image processing unit: Preprocesses the acquired sky image to obtain a valid sky image; analyzes the RGB features of cloud areas and blue sky in the valid sky image; selects a normalized difference processing method to identify cloud areas, and introduces a brightness threshold for sky images with strong sunlight that are not completely covered by clouds; selects an initial threshold based on the maximum inter-class variance method, and selects a brightness threshold for the sky image with the introduced brightness threshold using the maximum inter-class variance method; performs preliminary cloud area identification on the entire sky image using the initial threshold, and then adjusts the threshold according to image features to achieve cloud area identification; performs morphological smoothing on the sky image after cloud area identification; performs geometric correction on the smoothed image, and calculates the cloud cover.
[0166] Output unit: Visualizes the results.
[0167] The foregoing has provided a more detailed description of the objectives, technical solutions, and beneficial effects of this invention. It should be understood that the above descriptions are merely specific embodiments of this invention and are intended only to aid in understanding the method and core ideas of this invention. They are not intended to limit the invention. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for cloud area identification and cloud cover calculation based on an all-sky imager, characterized in that, Includes the following steps: S1. Real-time acquisition of sky images captured by the all-sky imager; S2. Preprocess the acquired sky image to obtain a valid sky image; S3. Analyze the RGB characteristics of cloud areas and blue sky in valid sky images; S4. Select the initial threshold based on the maximum inter-class variance method. For sky images with introduced brightness thresholds, the maximum inter-class variance method is used to select the brightness threshold. The cloud area identification method is as follows: S5. Initially identify cloud areas in the entire sky image using an initial threshold, and then adjust the threshold based on image features to achieve cloud area identification; S501. Adjust the threshold value before and after the initial cloud area identification of the valid sky image based on the initial threshold; S502. An effective sky image with a brightness threshold is introduced. For each brightness sub-region, a different initial threshold T for normalized difference is set within the pixel range. The higher the brightness of the sub-region, the smaller the initial threshold T is set. S6. Perform morphological smoothing on the sky image after cloud area identification; Binarization is performed on valid sky images that are not affected by illumination to directly obtain a preliminary cloud mask; for valid sky images affected by illumination, a brightness threshold is introduced, and each brightness sub-region after identification is binarized to generate a binarized cloud mask for each sub-region. The binarized cloud masks of each sub-region are then combined by a logical OR operation to obtain a preliminary cloud mask. S7. Perform geometric correction on the smoothed image and calculate cloud cover.
2. The method for cloud area identification and cloud cover calculation based on an all-sky imager according to claim 1, characterized in that, Step S2 involves preprocessing the acquired sky image to obtain a valid sky image. The steps are as follows: S201, using a circular mask to define the observation range; S202, Remove the obstacle portion to obtain the obstacle mask image; S203, superimpose the circular mask image and the obstacle mask image to obtain a fixed mask image, and use the fixed mask image to cover the captured sky image to obtain an effective sky image containing only the sky area.
3. The method for cloud area identification and cloud cover calculation based on an all-sky imager according to claim 1, characterized in that, Step S3 involves analyzing the RGB features of the cloud area and blue sky in the valid sky image, including: S301. Separate the red, green, and blue channels of the effective sky image; S302. Extract the red, green, and blue channels respectively, calculate the grayscale value of each pixel in each of the three channels, and form three two-dimensional matrices with matrix elements as follows: , , ; This indicates the red grayscale level of the pixel; This indicates the green grayscale level of the pixel; This indicates the blue grayscale level of the pixel; S303. Extract the cloud area and the blue sky area to form a red, green, and blue channel matrix; S304. Draw line graphs of pixel count and grayscale value for the three channels of clouds and blue sky, and analyze their distribution patterns; S305. Input a valid sky image and extract the entire valid sky image to form a red, green, and blue three-channel matrix.
4. The method for cloud area identification and cloud cover calculation based on an all-sky imager according to claim 1, characterized in that, The initial threshold T for each sub-region is calculated based on the maximum inter-class variance method; the initial cloud region is identified using the initial threshold on the sky image after normalization difference processing, if D≤T is judged as cloud, and D>T is judged as sky; at each location The value is the D value of that pixel.
5. The method for cloud area identification and cloud cover calculation based on an all-sky imager according to claim 3, characterized in that, For sky images with an introduced brightness threshold, the maximum inter-class variance method is used to select the brightness threshold. The steps are as follows: S401. Obtain the numerical matrix from the effective sky image after normalized inter-class processing, and calculate the initial threshold T using the Otsu's method. S402. Calculate the brightness threshold using the maximum inter-class variance for sky images that require a brightness threshold; S403. To determine how many brightness sub-regions the current image is suitable to be divided into, define the segmentation efficiency gain. Set a complexity threshold ; when When selecting the dual brightness threshold mode, two thresholds will be output. The sky is divided into three regions; when This is a low-brightness area. The time is the medium brightness area. High-brightness area; Brightness Intensity ; They are respectively , , Abbreviation; when When selecting the single brightness threshold mode, output a threshold value. This divides the sky into two regions; when This is a low-brightness area. This is a high-brightness area; S404. For each brightness sub-region, perform normalized difference processing on the pixels to form a numerical matrix of the same size as the original valid sky image. Each location... The value is the D value of that pixel; ; S407. Use the initial threshold to identify cloud areas in the valid sky image to obtain an initial cloud area identification image.
6. The method for cloud area identification and cloud cover calculation based on an all-sky imager according to claim 1, characterized in that, Step S6 involves morphological smoothing of the sky image after cloud region identification, as follows: S601. Perform morphological closing operations on the preliminary cloud mask, using a radius of r. c The disk-shaped structural element is used for the preliminary cloud mask M. raw Perform a morphological closing operation to obtain the intermediate mask M. closed ; S602. Morphological opening operation, using a radius of r o The disk-shaped structural element is used for the intermediate mask M. closed Perform a morphological opening operation to obtain the intermediate mask M. opened ; S603. Remove the small connected area and the intermediate mask M. opened Perform connected component labeling and calculate the pixel area of each connected component; Remove all areas smaller than the preset threshold A min The connected regions are used to obtain the intermediate mask M. cleaned ; S604. Void filling, for the intermediate mask M cleaned Perform hole-filling operation on the binary image to identify and fill the background area completely surrounded by cloud pixels, resulting in the final smooth cloud mask M. smooth ; S605. The smooth cloud mask M smooth With effective sky area mask M sky Perform a logical AND operation to obtain the final cloud mask M. cloud .
7. The method for cloud area identification and cloud cover calculation based on an all-sky imager according to claim 1, characterized in that, Step S7 performs geometric correction on the smoothed image, and calculates the cloud cover, including: S701. Using the image center as the zenith, calculate the zenith angle θ corresponding to each valid pixel; S702. Divide the effective sky image into N rings, with the zenith angle range of each ring being... For the first Each ring band, its geometric correction coefficient The calculation formula is: ; in , The value is in radians; S703. Count the number of cloud pixels within each ring zone. Total effective sky pixels Then the corrected cloud cover The calculation formula is: ; in Indicates the first The solid angle occupied by each partition cloud, Indicates the first The solid angle occupied by the cloudless blue sky area in each zone, This represents the number of pixels in the cloudless blue sky region of the valid sky.
8. A system for cloud area identification and cloud cover calculation based on an all-sky imager, employing the method for cloud area identification and cloud cover calculation based on an all-sky imager as described in any one of claims 1-7, characterized in that, It includes an image acquisition unit, an image processing unit, and an output unit; Image acquisition unit: acquires sky images captured by the all-sky imager in real time; Image processing unit: preprocesses the acquired sky image to obtain a valid sky image; analyzes the RGB features of cloud areas and blue sky in the valid sky image; A normalized inter-class differential algorithm is selected to identify cloud areas. For sky images affected by illumination but not completely covered by clouds, a brightness threshold is introduced. For sky images unaffected by illumination, an initial threshold is selected based on the maximum inter-class variance (MOL) method. For sky images with introduced brightness thresholds, the MOL method is used to select a brightness threshold. Initial cloud area identification is performed on the entire sky image using the initial threshold, and then the threshold is adjusted based on image features to achieve cloud area identification. Morphological smoothing is performed on the sky image after cloud area identification. Geometric correction is then performed on the smoothed image, and cloud cover is calculated. Output unit: Visualizes the results.
Citation Information
Patent Citations
Cloud and aerial total cloud amount detection method and system
CN103472501A
Cloud day segmentation method and device, terminal equipment and storage medium
CN116228790A