Cloud cover density calculation method combining image features and superpixel partition merging

By combining the method of combining image features and superpixel partitioning, the problem that deep learning-based image semantic segmentation is not applicable in cloud density calculation, and high-precision cloud density calculation is realized, suitable for resource-constrained scenarios, and has good robustness.

CN119992147AActive Publication Date: 2025-05-13ANHUI UNIV

Patent Information

Application Number
CN202510105046.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-13
Estimated Expiration
2045-01-23

Smart Images

  • Figure CN119992147A_ABST
    Figure CN119992147A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of computer vision, and particularly relates to a cloud cover density calculation method combining image features and superpixel partition merging and a corresponding device thereof. The method comprises the following steps: 1, preprocessing an original image P0 containing the sky and the cloud layer to obtain a gray level image H1, an HSV image P1, a Lab image P2, a color enhancement image E1 and a gray level enhancement image E2 which correspond to different color spaces; 2, P0 is divided into a plurality of superpixel areas, and background elimination is carried out by combining characteristic information of H1, P1, P2, E1 and E2; gradually combining the superpixel regions belonging to the cloud layer or the sky; and 3, extracting values of an S channel and a Lab color space three channel of the superpixel region, generating a four-dimensional feature vector, and inputting the four-dimensional feature vector into a K-means algorithm for clustering. And 4, calculating the cloud cover density according to the clustering result of the K-means algorithm. The problem that the sky and cloud layer image segmentation task is difficult to process by the existing traditional image segmentation technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer vision, and specifically relates to a cloud density calculation method combining image features with superpixel partitioning, and a corresponding device. Background Art

[0002] Cloud density refers to the number or mass of clouds per unit volume, and is usually used to describe the density of clouds in the atmosphere. Cloud density can be measured and estimated in a variety of ways. Among them, ground observation stations may take images, identify the sky and clouds in the images, and then calculate the corresponding cloud density. Image-based cloud density estimation is usually completed by computers. When computers process image-based cloud density calculation tasks, they first need to identify the areas of sky and clouds contained in the image, which requires the computer to have the ability to perform semantic segmentation on the image.

[0003] Semantic segmentation is a basic task in the field of computer vision, and its goal is to assign each pixel in an image to a specific semantic category. Semantic segmentation technology has wide application value in fields such as autonomous driving, medical image analysis, remote sensing image processing, and video surveillance. Traditional semantic segmentation methods are usually based on image processing and machine learning techniques. These methods mainly rely on manually designed features and rules or models for segmentation. Common traditional methods include threshold-based segmentation, region growing, edge detection, graph optimization, and clustering analysis. Although traditional methods have solved the problem of semantic segmentation to a certain extent, there are still many shortcomings in complex scenes. For example, these methods are sensitive to noise, illumination changes, and target morphology changes, and are difficult to adapt to the diverse needs of different images. In addition, due to the limited feature expression ability of traditional methods, it is difficult to capture high-level semantic information in the image, resulting in poor results when processing images with complex structures. To solve the above problems, deep learning methods have been widely used in the field of semantic segmentation. However, for scenes with insufficient data or applications with limited computing resources, deep learning usually cannot achieve good performance.

[0004] Considering that deep learning-based image semantic segmentation methods have high requirements for the sample size used for training, traditional segmentation methods still have important practical value. Therefore, how to improve traditional methods so that they can effectively meet the semantic segmentation needs of complex scenes with a small number of image samples has become a direction worthy of further research. Summary of the invention

[0005] In order to solve the problem that the image semantic segmentation method based on deep learning is not suitable for scenes with limited sample numbers such as cloud density calculation, and the segmentation accuracy of traditional segmentation methods in such scenes is insufficient; the present invention provides a cloud density calculation method combining image features with superpixel partitioning;

[0006] The technical solution provided by the present invention is:

[0007] A cloud density calculation method combining image features and superpixel partitioning is used to analyze and calculate the cloud density of clouds contained in the sky in an image. The cloud density calculation method includes the following process:

[0008] Get the original RGB image P0, convert it to HSV, GRAY and Lab color space respectively, and get the corresponding HSV image P1, grayscale image H1 and Lab image P2. Perform histogram equalization on the S channel of P1 and take the logarithm of the V channel to get the color enhanced image E1. Extract the texture features in H1 to get the texture feature map F1, and perform morphological operations on F1 to get the contour mask Mask1. Identify the high-light area in P1 and reduce the intensity of the V channel of the pixels in the corresponding area; then superimpose Mask1 and convert it to a grayscale image to get the grayscale enhanced image E2.

[0009] Perform SLIC superpixel segmentation on P0, and then combine H1 to identify the background of the segmented superpixel area. Then convert the spatial distribution of the superpixel area after excluding the background into an adjacency graph, and combine F1, E1, and E2 on the adjacency graph to merge regions based on texture difference, color difference, and grayscale difference. Then, combine the features of the cloud edge to merge the unclear superpixel areas at the edge. Finally, merge the isolated areas at the edge and inside the cloud.

[0010] According to P1 and P2, the values ​​of the S channel and the three channels of the Lab color space corresponding to each superpixel area after multiple rounds of merging are extracted, and the corresponding four-dimensional feature vector is generated. Each four-dimensional feature vector is input into the K-means algorithm for clustering, and the cloud mask Mask0 is extracted from the clustering result. The area ratio of the cloud area in Mask0 to the total area of ​​the cloud and sky is calculated, which is the cloud density.

[0011] As a further improvement of the present invention, the morphological operation for generating the contour mask Mask1 includes erosion and dilation.

[0012] As a further improvement of the present invention, a method for identifying a high brightness area in P1 and reducing the intensity of the V channel of pixels in the corresponding area is:

[0013] First, extract the V channel value of each pixel in P1, identify the pixel area with a V value higher than the preset brightness threshold v0 as the high light area, and generate a binary mask to represent the high light area. Then, Gaussian filter the binary mask to smooth the mask edge. Finally, normalize the binary mask and multiply it by a suitable value, subtract the binary mask from the original V channel value, and make the final V channel value between 0-255.

[0014] As a further improvement of the present invention, a method for background recognition of the segmented super-pixel region in combination with the grayscale image H1 is as follows:

[0015] The grayscale of each pixel in each superpixel area is obtained, and the grayscale mean of the superpixel area is calculated. If the grayscale mean of any superpixel area is less than 100, it is identified as the background area, otherwise it is the target area.

[0016] As a further improvement of the present invention, a method for merging the segmented superpixel regions based on texture differences in combination with F1 includes:

[0017] (1) Establish an adjacency graph by taking each superpixel region identified as the target region as a node and the adjacent relationship between each node as an edge.

[0018] (2) Based on F1, the Euclidean distance between the mean values ​​of the texture features between the two superpixel regions corresponding to each edge is calculated to obtain the texture difference SF between the two, and it is set as the edge weight.

[0019] (3) A texture difference threshold sf0 is preset, and the superpixel regions corresponding to the two nodes whose edge weights in the adjacency graph are lower than sf0 are merged.

[0020] As a further improvement of the present invention, a method for merging the segmented superpixel regions based on color difference in combination with E1 includes:

[0021] (1) Obtain an adjacency graph after merging based on texture differences.

[0022] (2) According to E1, the Euclidean distance between the color feature means of the superpixel regions corresponding to the two nodes of each edge is calculated to obtain the color difference SC between the two and set it as the edge weight.

[0023] (3) A color difference threshold sc0 is preset, and the superpixel regions corresponding to the two nodes whose edge weights in the adjacency graph are lower than sc0 are merged.

[0024] As a further improvement of the present invention, a method for merging the segmented superpixel regions based on grayscale differences in combination with E2 includes:

[0025] (1) Obtain the adjacency graph after merging based on color difference.

[0026] (2) According to E2, the grayscale mean difference DG between the superpixel regions corresponding to the two nodes of each edge is calculated and set as the edge weight.

[0027] (3) A grayscale difference threshold dg0 is preset, and the superpixel regions corresponding to the two nodes whose edge weights in the adjacency graph are lower than dg0 are merged.

[0028] As a further improvement of the present invention, the method for extracting the features of the cloud edge and merging the unclear superpixel areas in the edge is:

[0029] (1) Obtain the adjacency graph after merging based on grayscale differences.

[0030] (2) Obtain the area of ​​the superpixel region corresponding to each node in the adjacency graph, and filter out nodes whose areas are smaller than a preset threshold.

[0031] (3) Calculate the texture difference SC between the filtered node and its neighbor nodes, and set it as the edge weight between the two.

[0032] (4) The two superpixel regions corresponding to the node screened out in the adjacency graph and the node with the largest edge weight among its neighboring nodes are merged.

[0033] As a further improvement of the present invention, the method for merging the isolated areas at the edge and inside of the cloud layer is as follows:

[0034] Get the adjacency graph after the small area is merged in the previous step, and filter out the edge nodes that contain only one neighbor node.

[0035] It is determined whether each group of edge nodes and their neighbor nodes meets the following conditions: the average value of the texture feature value of the edge nodes is less than a preset texture threshold f0 and the area of ​​the neighbor nodes is less than a preset area threshold s0.

[0036] If yes, the edge node and its neighbor nodes are merged into superpixel regions.

[0037] The present invention also includes a cloud density calculation device that combines image features with superpixel partitions, which includes a memory, a processor, and a computer program stored in the memory and running in the processor. When the processor executes the computer program, the cloud density method that combines image features with superpixel partitions as described above is implemented, thereby analyzing and calculating the cloud density of the cloud layer contained in the sky in the input RGB image.

[0038] The technical solution provided by the present invention has the following beneficial effects:

[0039] The solution provided by the present invention creatively combines superpixel segmentation with hierarchical merging of adjacency graph structure when solving the image semantic segmentation task in cloud density calculation, breaking the limitations of traditional pixel-level segmentation methods. The image is divided into uniform small areas by the SLIC superpixel algorithm, which reduces the impact of image noise on the segmentation results in traditional methods and improves segmentation accuracy. The spatial relationship between pixels is introduced by establishing an adjacency graph. The accuracy of segmentation is enhanced and the computational efficiency is improved by gradually merging the multiple feature similarities between graph nodes.

[0040] Compared with deep learning methods, the present invention does not require large-scale annotated data sets and computationally intensive model training, can significantly reduce the consumption of computing resources, and is suitable for real-time processing and resource-constrained application scenarios. At the same time, the solution provided by the present invention has high robustness in dealing with common image problems such as noise and illumination changes, and can specifically process the high-light areas of the image and superimpose the enhanced image contours on the original image, which can adapt to various image quality and background conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a schematic diagram of the cloud density calculation method that combines image features with superpixel partitioning provided in Example 1 of the present invention.

[0042] Figure 2 It is the original image to be segmented in the verification experiment.

[0043] Figure 3 To verify the experimental Figure 2 Generated texture feature map.

[0044] Figure 4 To verify the experimental Figure 2 The resulting contour mask.

[0045] Figure 5 To verify the experimental Figure 2 The resulting color-enhanced image.

[0046] Figure 6 To verify the experimental Figure 2 The generated grayscale enhanced image.

[0047] Figure 7 To verify the experiment Figure 2 The preliminary segmentation result of the superpixel area.

[0048] Figure 8 The spatial distribution of superpixel regions after identifying and separating the background.

[0049] Fig. 9 It is the merging result of super-pixel regions based on texture features.

[0050] Fig.10 It is the merging result of super-pixel regions based on color features.

[0051] Fig.11 It is the merging result of the identified superpixel regions with high and similar grayscale values.

[0052] Fig.12 It is the merged result of the identified superpixel regions with low and similar grayscale values.

[0053] Fig.13 Spatial distribution of superpixel regions after local merging of superpixel regions belonging to the edge of the cloud.

[0054] Fig.14 Spatial distribution of superpixel regions after local merging of isolated regions contained in clouds and sky.

[0055] Fig.15 This is the final clustering result diagram of the K-Means algorithm. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0057] Example 1

[0058] This embodiment provides a cloud density calculation method that combines image features with superpixel partitioning, which is used to analyze and calculate the cloud density of clouds contained in the sky in an image. Figure 1 As shown, the cloud density calculation method provided in this embodiment includes the following process:

[0059] Step 1: Preprocess the original image P0 containing the sky and clouds to obtain the grayscale image H1, HSV image P1, Lab image P2, color enhanced image E1 and grayscale enhanced image E2 corresponding to different color spaces; the process includes:

[0060] 1.1. Obtain the original RGB image P0, and convert it to HSV, GRAY and Lab color spaces respectively to obtain the corresponding HSV image P1, grayscale image H1 and Lab image P2. The solution of this embodiment is applicable to RGB images of any size.

[0061] 1.2. Perform histogram equalization on the S channel of P1 and take the logarithm of the V channel to obtain the color enhanced image E1.

[0062] In the process of generating the color enhanced image, this embodiment first separates the information of the three channels of hue H, saturation S and brightness V of the image P1 in the HSV color space, and then uses histogram equalization on the S channel to enhance the contrast. Finally, the V channel is logarithmically mapped to the range of 0-255 to balance the overall brightness of the image.

[0063] 1.3. Extract the texture features in H1 to obtain the texture feature map F1, and perform morphological operations on F1 to obtain the contour mask Mask1.

[0064] Specifically, for the grayscale image H1, this embodiment uses a rotation-invariant local binary pattern (LBP-ROR) to extract texture features, uses a median filter to binarize the obtained texture feature map to retain the edge contour; finally, the obtained edge contour is enhanced by morphological operations such as corrosion and expansion, and finally a corresponding binary mask Mask1 is obtained.

[0065] 1.4. Identify the high-brightness area in P1 and reduce the intensity of the V channel of the pixels in the corresponding area; then superimpose Mask1 and convert it into a grayscale image to obtain a grayscale enhanced image E2. Specifically, the method of identifying the high-brightness area in P1 and reducing the intensity of the V channel of the pixels in the corresponding area in this embodiment is:

[0066] First, extract the V channel value of each pixel in P1, identify the pixel area with a V value higher than the preset brightness threshold v0 as the high light area, and generate a binary mask to represent the high light area. Then, Gaussian filter the binary mask to smooth the mask edge. Finally, normalize the binary mask and multiply it by a suitable value, subtract the binary mask from the original V channel value, and make the final V channel value between 0-255.

[0067] Step 2: Use the superpixel segmentation method to divide the original image P0 into multiple superpixel regions, and then combine the characteristic information contained in the pre-processed grayscale image H1, HSV image P1, Lab image P2, and color enhanced image E1 and grayscale enhanced image E2 to exclude non-detection targets belonging to the background in P0; and gradually merge the superpixel regions belonging to the clouds or sky; the process includes:

[0068] 2.1. Perform SLIC superpixel segmentation on P0.

[0069] In this embodiment, the SLIC superpixel algorithm is used to divide the original image into N=400 superpixel regions to enhance local consistency.

[0070] 2.2. Combine H1 to perform background recognition on the segmented superpixel area.

[0071] Considering that the grayscale values ​​of the sky and clouds are usually high in grayscale images, this embodiment sets the labels corresponding to the superpixel regions with grayscale values ​​less than 100 to 0, that is, sets them as background regions and does not participate in subsequent processing. The rest are used as target regions and participate in the subsequent merging of the sky and cloud regions.

[0072] 2.3. The spatial distribution of the superpixel area after excluding the background is converted into an adjacency graph, and F1, E1, and E2 are combined on the adjacency graph to merge regions based on texture difference, color difference, and grayscale difference; so as to achieve a preliminary merger of regions belonging to the sky or clouds.

[0073] Specifically, in the process of merging superpixel regions, the present embodiment first constructs a pixel graph structure based on the superpixel region. In the construction of the graph structure, the present embodiment regards each superpixel as a node, and adjacent superpixel regions are connected by edges in the graph structure. The weights of each edge in the graph structure need to be set separately in combination with the features between different superpixel regions, so as to combine different feature information to perform targeted merging of each superpixel region.

[0074] In this embodiment, the merging process is mainly implemented by relying on the texture difference, color difference and grayscale difference between the superpixel areas of adjacent nodes in the graph structure. Generally speaking, areas with small texture differences and color differences should usually belong to the same cloud layer or sky. For the sky or cloud layer, the color, texture and grayscale of the different areas contained therein should be relatively close. The subsequent three rounds of merging in this embodiment are mainly based on this principle. The three-round merging process includes: (1) combining F1 to perform regional merging based on texture difference on the segmented superpixel areas; (2) combining E1 to perform regional merging based on color difference on the segmented superpixel areas. (3) combining E2 to perform regional merging based on grayscale difference on the segmented superpixel areas.

[0075] It should be noted that: in actual application, the order of merging the above three rounds of superpixel regions can be adjusted arbitrarily. In this embodiment, the step-by-step implementation is based on texture difference, color difference and grayscale difference, which is only one implementation method of the present invention. In other embodiments, technicians can adjust it as needed.

[0076] Specifically, the method for merging the segmented superpixel regions based on texture differences in combination with F1 includes the following steps:

[0077] S1: Establish an adjacency graph with each superpixel region identified as the target region as a node and the adjacent relationship between each node as an edge.

[0078] S2: Obtain the texture features of each pixel included in the texture feature map F1, and calculate the mean of the texture features of all pixels included in each superpixel region. Then calculate the Euclidean distance between the texture feature means of the two superpixel regions corresponding to each edge, and use it as the texture difference SF between the two, and then set it as the edge weight of each edge contained in the graph structure at this stage.

[0079] S3: Preset a texture difference threshold sf0 and merge the superpixel regions corresponding to two nodes whose edge weights in the adjacency graph are lower than sf0.

[0080] Specifically, the method for merging the segmented superpixel regions based on color difference in combination with E1 includes the following steps:

[0081] S4: Obtain an adjacency graph after merging based on texture differences.

[0082] S5: Obtain the color feature of each pixel included in the color enhancement graph E1, and calculate the color feature mean of all pixels included in each superpixel region. Then calculate the Euclidean distance between the color feature means of the superpixel regions corresponding to the two nodes connected by each edge, and use it as the color difference SC between the two, and then set it as the edge weight of each edge contained in the graph structure of this stage.

[0083] S6: Preset a color difference threshold sc0, and merge the superpixel regions corresponding to two nodes whose edge weights in the adjacency graph are lower than sc0.

[0084] Specifically, the method for merging the segmented superpixel regions based on grayscale differences in combination with E2 includes the following steps:

[0085] S7: Obtain an adjacency graph after merging based on color difference.

[0086] S8: Obtain the grayscale features of all pixels contained in the grayscale enhancement graph E2, and calculate the grayscale feature mean of all pixels contained in each superpixel region. Then calculate the grayscale mean difference DG between the superpixel regions corresponding to the two nodes connected by each edge, and then set it as the edge weight of each edge contained in the graph structure of this stage.

[0087] S9: Preset a grayscale difference threshold dg0 and merge the superpixel regions corresponding to the two nodes whose edge weights in the adjacency graph are lower than dg0.

[0088] In the process of merging superpixel regions based on grayscale differences, not only superpixel regions with larger adjacent grayscale intensities can be merged, but also superpixel regions with smaller adjacent grayscale intensities can be merged.

[0089] 2.4. Combine the features of the cloud edge and merge the unclear superpixel areas in the edge.

[0090] The processing of this step is mainly used to find the regions with small area, simple texture and adjacent to multiple regions with complex texture, and merge them into one region. Then, the unclear parts in the edge of the cloud layer and the clear edge of the cloud layer are merged.

[0091] Specifically, in order to achieve the above purpose, the method provided in this embodiment for extracting features of cloud edges and merging unclear superpixel areas in the edges is as follows:

[0092] S10: Obtain an adjacency graph after merging based on grayscale differences.

[0093] S11: Obtain the area of ​​the superpixel region corresponding to each node in the adjacency graph, and filter out nodes whose areas are smaller than a preset threshold.

[0094] S12: Calculate the texture difference SC between the filtered node and its neighboring nodes, and set it as the edge weight between the two.

[0095] S13: Merge the two superpixel regions corresponding to the node selected from the adjacency graph and the node with the largest edge weight among its neighboring nodes.

[0096] 2.5. Merge the isolated areas at the edge and inside of the cloud.

[0097] The processing of this step is mainly based on the consideration that after the above merging, the cloud layer is divided into the edge outline and the inside of the cloud layer, and the inside of the cloud layer and the sky part are similar. In order to distinguish the two, here we use the characteristics of the cloud layer. The inside of the cloud layer is an isolated node, which is only adjacent to the entire area belonging to the edge of the cloud layer. In addition, the texture inside the cloud layer is simple, and the area of ​​the adjacent edge area is small. Therefore, based on this feature, the two can be merged.

[0098] In the actual processing process, in order to achieve this effect, an isolated area with only one adjacent node should be found to determine whether its texture is simple and whether the adjacent area is small. If so, they are merged into one area. Specifically, the method for merging the isolated areas at the edge and inside of the cloud layer in this embodiment is:

[0099] S14: Obtain the adjacency graph after the small area regions are merged in the previous step, and filter out the edge nodes that contain only one neighbor node.

[0100] S15: Determine whether each group of edge nodes and their neighbor nodes meet the following conditions: the average value of the texture feature value of the edge node is less than a preset texture threshold f0 and the area of ​​the neighbor node is less than a preset area threshold s0. If yes, merge the superpixel region of the edge node and its neighbor nodes.

[0101] Step 3: Extract the values ​​of the S channel and the three channels of the Lab color space of the superpixel area after the above multiple rounds of merging, generate a four-dimensional feature vector, and use the feature vector in the K-means algorithm to cluster each superpixel area.

[0102] In this embodiment, P1 contains the values ​​of the H, S, and V channels corresponding to each pixel in the original image, and P2 contains the values ​​of the L, a, and b channels corresponding to each pixel in the original image. Therefore, combined with each superpixel region after multiple rounds of merging in step 2; the values ​​of the S channel and the three channels of the Lab color space corresponding to each superpixel region can be obtained. The feature information of the above four channels corresponding to each superpixel region is merged to generate a four-dimensional feature vector corresponding to each superpixel region. Finally, each four-dimensional feature vector is input into the K-means algorithm for clustering, and the cloud mask Mask0 is extracted from the clustering result.

[0103] Step 4: Calculate the area ratio of the cloud area in Mask0 to the total area of ​​the clouds and sky, which is the cloud density.

[0104] In this embodiment, Mask0 is a mask used to classify clouds and sky (excluding the background area, which has been excluded in the previous process). CF The calculation formula is:

[0105]

[0106] In the above formula, S1 represents the pixel area of ​​the cluster corresponding to the cloud layer in the clustering result in the original image; S2 represents the pixel area of ​​the cluster corresponding to the sky in the original image.

[0107] Example 2

[0108] Based on the scheme of embodiment 1, this embodiment provides a cloud density calculation device that combines image features with superpixel partitions, which includes a memory, a processor, and a computer program stored in the memory and running in the processor. When the processor executes the computer program, the cloud density method that combines image features with superpixel partitions as described above is implemented, thereby analyzing and calculating the cloud density of the cloud layer contained in the sky in the input RGB image.

[0109] The cloud density calculation device combining image features and superpixel partitions provided in this embodiment is essentially a computer device for implementing the solution in Embodiment 1. In actual application, the computer device can be an intelligent terminal capable of executing a program, a tablet computer, a laptop computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including an independent server or a server cluster composed of multiple servers), etc.

[0110] The computer device indicated in this embodiment includes at least but is not limited to: a memory and a processor that can be connected to each other through a system bus. Among them, the memory (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory can be an internal storage unit of a computer device, such as a hard disk or a memory of the computer device. In other embodiments, the memory can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. Of course, the memory can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the memory is generally used to store an operating system and various application software installed on the computer device. In addition, the memory can also be used to temporarily store various types of data that have been output or are to be output.

[0111] The processor may be a central processing unit (CPU), a graphics processing unit (GPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor is generally used to control the overall operation of a computer device. In this embodiment, the processor is used to run program codes stored in a memory or process data.

[0112] Performance Verification

[0113] In order to verify the effectiveness of the cloud density calculation method combining image features with superpixel partitioning provided by the present invention, technicians conducted Figure 2 The image shown is semantically segmented to test whether the method can effectively segment the clouds with complex textures contained in the sky.

[0114] Among them, this experiment obtained Figure 2 The texture feature map is as follows Figure 3 As shown in the figure, the texture feature map is subjected to morphological operations such as corrosion and expansion to obtain a rough contour mask as shown in the figure. Figure 4 As shown. The color enhanced image obtained by processing the HSV channel image of the original image is as follows Figure 5 The grayscale enhanced image obtained by preprocessing the original image is shown in Figure 6 The original image is segmented into superpixels, and the 400 original superpixel regions are as follows: Figure 7 After identifying and separating the background, the remaining superpixel area is shown in Figure 8 As shown. The superpixel area after merging based on the difference of texture features is shown as Fig. 9 As shown. The superpixel area after merging based on the color feature difference is shown in Fig.10 As shown in Figure 2. The superpixel regions with high grayscale intensity are merged, and the result is as follows: Fig.11 As shown in Figure 2. The superpixel regions with lower grayscale intensity are merged, and the result is as follows: Fig.12 As shown in Figure 2, the superpixel regions belonging to the edge of the cloud are locally merged, and the results are as follows: Fig.13 The isolated areas contained in the clouds and sky are merged, and the result is as follows Fig.14 shown.

[0115] Finally, according to the four-dimensional feature vector of the merged superpixel area, after processing by the K-Means algorithm, the obtained mask Mask0 is as follows: Fig.15 As shown. Fig.15 In the figure, the black part is the pre-identified background area, the purple part is the cloud area clustered by the K-Means algorithm, and the yellow part is the cloudless sky area clustered by the K-Means algorithm.

[0116] Combined with the results of the above verification experiments, it can be found that the method of the present invention can achieve accurate semantic segmentation of the background, clouds and sky contained in natural images through traditional methods without relying on a large number of sample images and deep learning-based network models. The performance is very outstanding and the practicability is strong.

[0117] Further analysis of the technical solution provided by the present invention shows that: traditional semantic segmentation methods often rely only on pixel-level color or texture features, which are easily affected by image noise, illumination changes and complex backgrounds, resulting in low segmentation accuracy, especially at the edges and detail areas of the image. This method effectively enhances the spatial consistency of the segmented area, significantly improves the accuracy of boundary processing, and avoids excessive segmentation and noise at the pixel level by introducing superpixel segmentation and graph structure optimization technology.

[0118] The advantages of the present invention specifically include:

[0119] 1. Higher segmentation accuracy

[0120] The present invention divides the image into relatively uniform small areas through superpixel segmentation, making the segmentation result more stable and in line with human visual habits. In terms of the performance of edge and detail areas, especially when processing complex scenes, higher accuracy is shown.

[0121] 2. Higher computing efficiency

[0122] Compared with complex deep learning methods based on global pixels, the superpixel and clustering methods used in the present invention effectively reduce the amount of calculation. By first performing superpixel segmentation on the image, the number of pixels involved in the calculation is reduced, and the consumption of memory and computing resources is reduced.

[0123] 3. Simple and easy to implement

[0124] Compared with deep learning methods, the present invention does not rely on large-scale annotated data sets or complex neural network models, the implementation process is relatively simple, and the algorithm can be quickly implemented in a conventional computer environment. It can be implemented through open image processing libraries (such as OpenCV, scikit-image), and has high operability.

[0125] 4. Strong targeting

[0126] The present invention mainly focuses on the calculation of cloud density in an image and specifically deals with this problem. Of course, based on the same technical concept, the solution can also be quickly deployed and applied to various other types of image segmentation tasks by adjusting parameters.

[0127] 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 and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A cloud density calculation method combining image features and superpixel partitioning, characterized in that: It includes: Get the original RGB image P0, convert it to HSV, GRAY and Lab color space respectively, and get the corresponding HSV image P1, grayscale image H1 and Lab image P2; perform histogram equalization on the S channel of P1 and take the logarithm of the V channel to get the color enhanced image E1; extract the texture features in H1 to get the texture feature map F1, perform morphological operations on F1 to get the contour mask Mask1; identify the high light area in P1 and reduce the intensity of the V channel of the pixels in the corresponding area; then superimpose Mask1 and convert it to a grayscale image to get the grayscale enhanced image E2; Perform SLIC superpixel segmentation on P0, and then combine H1 to identify the background of the segmented superpixel area; then convert the spatial distribution of the superpixel area after excluding the background into an adjacency graph, and combine F1, E1, and E2 on the adjacency graph to merge regions based on texture difference, color difference, and grayscale difference; then extract the features of the cloud edge, merge the unclear superpixel areas at the edge; and merge the isolated areas at the edge and inside the cloud; The values ​​of the S channel and the three channels of the Lab color space corresponding to each superpixel area after multiple rounds of merging are extracted from P1 and P2, and the corresponding four-dimensional feature vector is generated and input into the K-means algorithm for clustering; the cloud mask Mask0 is extracted from the clustering result; the area ratio of the cloud area in Mask0 to the total area of ​​the cloud layer and the sky is calculated, which is the cloud density.

2. The cloud density calculation method combining image features and superpixel partitioning as claimed in claim 1, characterized in that: The morphological operations for generating the contour mask Mask1 include erosion and dilation.

3. The cloud density calculation method combining image features and superpixel partitioning as claimed in claim 2, characterized in that: The method of identifying the high brightness area in P1 and reducing the intensity of the V channel of the pixels in the corresponding area is: First, extract the value of the V channel of each pixel in P1, identify the pixel area with a V value higher than the preset brightness threshold v0 as the high-light area, and generate a binary mask representing the high-light area; then, perform Gaussian filtering on the binary mask to smooth the mask edge; finally, normalize the binary mask and multiply it by a suitable value, subtract the binary mask from the original V channel value, and make the final V channel value between 0 and 255.

4. The cloud density calculation method combining image features and superpixel partitioning as claimed in claim 1, characterized in that: The method for background recognition of the segmented superpixel area combined with the grayscale image H1 is: The grayscale of each pixel in each superpixel area is obtained, and the grayscale mean of the superpixel area is calculated. If the grayscale mean of any superpixel area is less than 100, it is identified as the background area, otherwise it is the target area.

5. The cloud density calculation method combining image features and superpixel partitioning as claimed in claim 4, characterized in that: The method of combining F1 with the segmented superpixel regions to merge regions based on texture differences includes: (1) Establish an adjacency graph with each superpixel region identified as the target region as a node and the adjacent relationship between nodes as an edge; (2) Calculate the Euclidean distance between the mean values ​​of the texture features between the two superpixel regions corresponding to each edge based on F1, obtain the texture difference SF between the two, and set it as the edge weight; (3) A texture difference threshold sf0 is preset, and the superpixel regions corresponding to the two nodes whose edge weights in the adjacency graph are lower than sf0 are merged.

6. The cloud density calculation method combining image features and superpixel partitioning as claimed in claim 5, characterized in that: The method of combining E1 with the segmented superpixel regions to merge regions based on color differences includes: (1) Obtaining an adjacency graph after merging based on texture difference; (2) Calculate the Euclidean distance between the color feature means of the superpixel regions corresponding to the two nodes on each edge according to E1, obtain the color difference SC between the two, and set it as the edge weight; (3) A color difference threshold sc0 is preset, and the superpixel regions corresponding to the two nodes whose edge weights in the adjacency graph are lower than sc0 are merged.

7. The cloud density calculation method combining image features and superpixel partitioning as claimed in claim 6, characterized in that: The method of combining E2 with the segmented superpixel regions to merge the regions based on grayscale differences includes: (1) Obtaining an adjacency graph after merging based on color difference; (2) According to E2, the grayscale mean difference DG between the superpixel regions corresponding to the two nodes of each edge is calculated and set as the edge weight; (3) A grayscale difference threshold dg0 is preset, and the superpixel regions corresponding to the two nodes whose edge weights in the adjacency graph are lower than dg0 are merged.

8. The cloud density calculation method combining image features and superpixel partitioning as claimed in claim 7, characterized in that: The method to extract the features of the cloud edge and merge the unclear superpixel areas at the edge is: (1) Obtaining an adjacency graph after merging based on grayscale differences; (2) Obtain the area of ​​the superpixel region corresponding to each node in the adjacency graph, and filter out nodes whose area is smaller than a preset threshold; (3) Calculate the texture difference SC between the selected node and its neighbor nodes, and set it as the edge weight between the two; (4) The two superpixel regions corresponding to the node screened out in the adjacency graph and the node with the largest edge weight among its neighboring nodes are merged.

9. The cloud density calculation method combining image features and superpixel partitioning as claimed in claim 8, characterized in that: The method to merge the isolated areas at the edge and inside of the cloud is: Get the adjacency graph after the small area is merged in the previous step, and filter out the edge nodes that contain only one neighbor node; Determine whether each group of edge nodes and their neighbor nodes meet the following conditions: the mean value of the texture feature value of the edge node is less than a preset texture threshold f0 and the area of ​​the neighbor node is less than a preset area threshold s0; If yes, the edge node and its neighbor nodes are merged into superpixel regions.

10. A cloud density calculation device combining image features and superpixel partitioning, comprising a memory, a processor, and a computer program stored in the memory and executed in the processor, characterized in that: When the processor executes the computer program, it implements the cloud density method combining image features and superpixel partitioning as described in any one of claims 1 to 9, thereby analyzing and calculating the cloud density of the cloud layer contained in the sky in the input RGB image.

Citation Information

Patent Citations

  • Plant leaf identification method based on improved dung beetle optimization algorithm and integrated learning model

    CN118840663A

  • LiDAR point cloud reflection intensity complementation method and system

    US11099275B1

  • Methods and systems for assessing cell morphology

    WO2017106359A1

Cited By

  • Cloud removal restoration method based on generative model and synthetic aperture radar image

    CN120563370A

  • Unmanned aerial vehicle power distribution network equipment identification method based on mutual neighbor density peak clustering

    CN121010786A