A method for automatically segmenting a color block of a multi-source spliced image

By employing steps such as HSV component image processing and Otsu's method for segmentation, the problem of color block differences in multi-source stitched images was solved, achieving basic segmentation for color consistency processing.

CN115511898BActive Publication Date: 2026-01-13CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211173673.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-26
Publication Date
2026-01-13
Estimated Expiration
2042-09-26

AI Technical Summary

Technical Problem

Existing methods for homogenizing and coloring remote sensing images are ineffective in handling large-area color patch differences, leading to color inconsistencies in multi-source mosaic images.

Method used

By employing HSV component image processing, combined with steps such as single-threshold Otsu's method segmentation, small connected component removal, color block segmentation, mean distribution map reassignment, and filling, automatic color block segmentation of multi-source stitched images is achieved.

Benefits of technology

Effective segmentation of color blocks in multi-source stitched images ensures color consistency and lays the foundation for subsequent processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115511898B_ABST
    Figure CN115511898B_ABST
Patent Text Reader

Abstract

The application relates to a kind of automatic color block segmentation methods of supporting multi-source splicing image, steps are as follows: extracting the H, S, V three-component diagram of multi-source splicing image;Three component diagrams are respectively segmented by single threshold Otsu method;And the small connected region is removed to Otsu method result;To the removal result, the first color block segmentation result is determined by using closed operation, contour fitting, mask method;Mean distribution diagram is generated to color block segmentation result;And the pixel of the region to be studied in mean distribution diagram is revalued by using Otsu method;Fill the small area of abnormal region in revalued result, obtain the image after filling;Whether the image after filling is single color block, if yes, end, otherwise, further judge by using vertex number, mean difference, until it is single color block;The application uses image segmentation, image morphological processing and other methods to segment color block, and lays a foundation for the next multi-source splicing image color consistency processing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image segmentation, and in particular to a color block automatic segmentation method supporting multi-source spliced images. BACKGROUND

[0002] When acquiring satellite images, due to the influence of external environment such as atmosphere and light, different degrees of color difference will appear in the images. Therefore, it is necessary to eliminate the color difference between the spliced images and maintain the overall color consistency of the images. The existing remote sensing image light and color uniformization method cannot well solve the problem of large-area color block difference images. When processing the global image, it is difficult to achieve good results for the areas with large color difference. SUMMARY

[0003] Therefore, in view of the poor processing of local color difference areas by the existing method, the present application provides a color block automatic segmentation method supporting multi-source spliced images, which specifically includes the following steps:

[0004] S1: Obtain the HSV three-component images of the multi-source spliced image src, denoted as the to-be-processed images srcH, srcS and srcV respectively;

[0005] S2: Perform single-threshold Otsu method segmentation on the to-be-processed images srcH, srcS and srcV to obtain the segmentation results OTSUH, OTSUS and OSTUV;

[0006] S3: Remove small connected regions from the segmentation results OTSUH, OTSUS and OSTUV respectively to obtain the removal results fH, fS and fV; wherein the small connected region refers to a connected region with an area less than a preset area threshold s;

[0007] S4: Perform color block segmentation operation on the removal results fH, fS and fV respectively to obtain the first color block segmentation result;

[0008] S5: Generate a mean value distribution map of the first color block segmentation result;

[0009] S6: Process the mean value distribution map using a single-threshold Otsu algorithm to obtain a revalued mean value distribution map;

[0010] S7: Fill in the small-area abnormal regions in the revalued mean value distribution map to obtain a filled image;

[0011] S8: Determine whether the filled image is all background regions, if yes, go to step S10; otherwise, count the number of vertices of the largest connected region in the filled image and go to step S9;

[0012] S9: judging whether the vertex number is greater than a preset vertex number threshold value, if yes, entering step S10; otherwise, calculating the mean difference of all pixels in the connected region with value 0 in the filled image, if the mean difference is greater than a preset mean difference threshold value, returning to step S1, otherwise, entering step S10;

[0013] S10: taking the filled image as the final color block segmentation result.

[0014] The application provides the beneficial effects that it can be used for segmenting each color block in the multi-source spliced image, and lays a foundation for color consistency processing of the multi-source spliced image. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 is a method flowchart of the application;

[0016] Figure 2 is a multi-source spliced image and its HSV component;

[0017] Figure 3 is an OTSU method result image of the HSV component;

[0018] Figure 4 is a small connected region removal result schematic diagram of the OTSU method result of the HSV component;

[0019] Figure 5 is a first color block segmentation result image;

[0020] Figure 6 is a mean distribution image;

[0021] Figure 7 is a revalued mean distribution image;

[0022] Figure 8 is a filled result schematic diagram;

[0023] Figure 9 is a color block segmentation result schematic diagram. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical scheme and advantages of the application more clear, the embodiments of the application will be further described below with reference to the drawings.

[0025] Please refer to Figure 1 , Figure 1 is a method flowchart of the application;

[0026] The application provides a color block automatic segmentation method supporting multi-source spliced images, which specifically comprises the following steps:

[0027] S1: Firstly, extract the three components of HSV of the multi-source spliced image src, and mark them as the to-be-processed images srcH, srcS and srcV respectively; please refer to Figure 2 , Figure 2 are the multi-source spliced image and the HSV components thereof; wherein Figure 2 a is the multi-source spliced image src, and b, c and d are the three components H, S and V extracted respectively;

[0028] S2: Perform single-threshold Otsu segmentation on the to-be-processed images srcH, srcS and srcV respectively, and mark the Otsu results as OTSUH, OTSUS and OTSUV respectively;

[0029] Please refer to Figure 3 , Figure 3 are the Otsu results of the HSV components; below Figure 3 , a, b and c are the Otsu results of the three components H, S and V respectively;

[0030] S3: Perform small connected region removal on the three Otsu results respectively, and mark the results as fH, fS and fV respectively; please refer to Figure 4 , Figure 4 is a small connected region removal result diagram of the Otsu results of the three HSV components; below Figure 4 , a, b and c are the small connected region removal results fH, fS and fV respectively;

[0031] S4: Perform segmented color block operation on the three results obtained in step 3 respectively, and take fH as an example to perform the following processing:

[0032] (1) Firstly, perform image closing operation on fH with a size of p, and the region with a median value of 255 in the closing operation result image is the foreground region, and the region with a value of 0 is the background region.

[0033] It should be noted that the image closing operation refers to the operation of dilation first and then erosion. First, call the dilate function in the OpenCV library to perform dilation operation on fH with a size of p, and then call the erode function to perform erosion operation on the dilation result with a size of p;

[0034] (2) Perform contour fitting on the foreground region in the closing operation result image to obtain an approximate polygon region, and create a binary image Mask1 with the same size as fH, and the initial value of the pixels of the binary image Mask1 is all 0. In Mask1, assign the pixel values of the approximate polygon region to 255, and the values of the remaining regions remain unchanged.

[0035] It should be noted that the approxPolyDP function in the OpenCV library is called to fit the contour of the foreground region in the closed operation result image to obtain an approximate polygon region, and a binary image Mask1 with the same size as fH is created, and the initial value of the pixels of binary image Mask1 is all 0.

[0036] (3) A binary image Mask2 is created which is exactly the same as Mask1, and the foreground region and the background region in the binary image Mask2 are inverted, that is, the original foreground region is assigned a value of 0, and the original background region is assigned a value of 255.

[0037] (4) The binary images Mask1 and Mask2 are respectively used as masks for the multi-color block image src, and the two mask results are denoted as srcH1 p and srcH2 p . The average value of the H component pixels in the foreground region of the mask result srcH1 p is calculated and denoted as meanH1 p , the average value of the H component pixels in the foreground region of the mask result srcH2 p is denoted as meanH2 p , and the difference between the two average values is denoted as meanH p .

[0038] (5) The size of the multi-source splicing image src is different, and a fixed closed operation size p cannot be set. In order to determine the size of the closed operation size p, the value of p is taken as 10, 20, 30, …, M in turn, and the value of M is taken as 100 by default. Each p value can obtain a set of mask results and the corresponding average difference value, and the maximum average difference value is denoted as DH. The mask result corresponding to DH is the optimal result of color block segmentation using the H component srcH, which is denoted as the segmentation result srcH1 and srcH2.

[0039] According to the above operation method for fH, fS and fV are processed, and two sets of segmentation results are obtained, which are denoted as srcS1, srcS2, srcV1 and srcV2. The two maximum average difference values are denoted as DS and DV. The maximum average difference value is compared with DH, DS and DV, and the segmentation result corresponding to the maximum average difference value is denoted as the first color block segmentation result srcD1 and srcD2. Please refer to Figure 5 , Figure 5 which is the first color block segmentation result image. Figure 5 a represents srcD1, Figure 5 b represents srcD2.

[0040] According to the following steps S5-S9, it is judged whether srcD1 and srcD2 are single color blocks. When srcD1 or srcD2 is not a single color block, color block segmentation operation needs to be continued.

[0041] S5: generate mean distribution map for the result of the first color block segmentation srcD1 and srcD2 respectively, take srcD1 as an example for illustration:

[0042] (1) First extract the HSV three-component map of srcD1, denoted as srcD1H, srcD1S and srcD1V.

[0043] (2) For srcD1H, block it according to the size of 50 pixels x 50 pixels, and if the size of the image block is less than 50 pixels x 50 pixels, it does not participate in the operation of generating the mean distribution map.

[0044] If the image block is all foreground region, calculate the mean value of the foreground region, and assign the mean value to each pixel in the image block; if the image block is all background region, directly assign each pixel in the image block to 255;

[0045] If the image block has background region, and the number of foreground region pixels is greater than one fourth of the total number of pixels in the image block, calculate the mean value M of the foreground region pixels in the image block, and assign the foreground region of each pixel in the image block to M, and the background region pixel value to 255; otherwise, directly assign each pixel in the image block to 255;

[0046] After the above operation, the mean distribution map of srcD1H is generated and denoted as MH. The region with value not equal to 255 in MH is called the region to be studied.

[0047] Statistical mean data of all image blocks in the region to be studied in MH, and the mean data is denoted as set MH{mh1, mh2...mh m}, where m is the number of image blocks in the region to be studied, mh1, mh2...mh m is the mean data of each image block in the region to be studied. Calculate the coefficient of variation (i.e. standard deviation / mean) corresponding to the set MH, denoted as CVH.

[0048] (3) According to the above (2), the same processing is performed on srcD1S and srcD1V, and the obtained mean distribution maps are denoted as MS and MV respectively, and the corresponding coefficients of variation are denoted as CVS and CVV. The larger the coefficient of variation, the greater the degree of change of the mean data in the mean distribution map, which is more likely to be multiple color blocks. Therefore, select the maximum value among CVH, CVS and CVV, for example, when CVH is the maximum, its corresponding mean distribution map is MH, that is, select MH as the mean distribution map of srcD1, denoted as M1;

[0049] The same operation is performed on srcD2 to obtain the mean distribution map M2. Please refer to Figure 6 , Figure 6 is the mean distribution map;Figure 6 a is the mean distribution plot M1. Figure 6 b is the mean distribution plot M2;

[0050] S6: Reassign values ​​to the pixels in the regions to be studied in the mean distribution maps M1 and M2. The reassignment method is explained using M1 as an example:

[0051] The mean data of all image patches in the region to be studied in M1 are denoted as set M1{m11, m12...m1}. q}, where q is the number of all image patches in the region to be studied, m11, m12...m1 q This represents the mean data of each image patch in the region under study. Using Otsu's method, a segmentation threshold is obtained for the mean data in set M1. Regions in the region under study with pixel values ​​greater than the segmentation threshold are assigned a value of 150, while regions with pixel values ​​less than the segmentation threshold are assigned a value of 0. The resulting value is denoted as the reassigned mean distribution map ReM1.

[0052] The same method is used to process the mean distribution plot M2, and the resulting plot is denoted as the reassigned mean distribution plot ReM2. Please refer to [reference needed]. Figure 7 , Figure 7 This is a distribution chart of the reassigned value mean; Figure 7 'a' represents the distribution of the reassigned mean (ReM1); Figure 7 b represents the ReM2 plot of the reassigned mean distribution;

[0053] S7: If there are connected regions with a small area of ​​150 in the regions to be studied in ReM1 and ReM2, these connected regions need to be filled with background regions.

[0054] Taking ReM1 as an example, the following filling process is performed: The area of ​​all connected regions in the region to be studied in ReM1 is calculated, and the area data of the connected regions is denoted as the set Area{area1, area2, ..., area... n}, where n is the number of connected components in the region to be studied, area1, area2, ..., area n Let be the area of ​​each connected region. Using Otsu's method, the segmentation threshold of the area data in the set Area is obtained. Connected regions with an area smaller than the segmentation threshold are filled as background regions. The result after filling is denoted as the mean distribution corrected image FM1 (the filled image).

[0055] If the entire area to be studied in FM1 is a background area, then srcD1 can be directly identified as a monochrome block and proceed to step 10; otherwise, proceed to step 8.

[0056] Perform the same filling process on ReM2 to obtain the mean distribution corrected map FM2. If the area to be studied in FM2 is entirely background, then srcD2 is directly judged as a monochrome block and proceed to step 10; otherwise, proceed to step 8.

[0057] Please refer to Figure 8 , Figure 8 This is a schematic diagram of the result after filling; Figure 8 a is FM1, Figure 8 b is FM2;

[0058] S8: If the region to be studied in FM1 or FM2 is not entirely background region, further judgment is needed based on the number of vertices in the connected component with the largest area. Taking FM1 as an example, the specific judgment process is as follows:

[0059] Count the area of ​​each connected region in the region under study in FM1, and obtain the number of vertices in the connected region with the largest area, denoted as n1. Let the threshold for the number of vertices be VN, with a default value of 25.

[0060] When n1 is greater than or equal to VN, srcD1 can be directly determined to be a monochrome block, and proceed to step 10; otherwise, proceed to step 9 to continue the judgment.

[0061] The judgment process for FM2 is the same as that for FM1.

[0062] S9: If n1 or n2 is less than VN, FM1 or FM2 needs to continue with the following judgment. Taking FM1 as an example, the specific judgment process is as follows:

[0063] All connected regions with a value of 0 in FM1 are collectively referred to as region A, and all connected regions with a value of 150 are collectively referred to as region B. The pixel mean of region A in the mean distribution map FM1 is calculated and denoted as meanA, the pixel mean of region B in FM1 is denoted as meanB, and the difference between meanA and meanB is denoted as mean difference DM1.

[0064] Let the threshold for the mean difference be DM, with a default value of 18. When the mean difference DM1 is greater than DM, srcD1 is a multi-colored block and needs to be processed in step 1. When DM1 is less than or equal to DM, srcD1 is a single-colored block and proceed to step 10.

[0065] The judgment process for FM2 is the same as that for FM1;

[0066] S10: Obtain the segmented monochrome block result. Please refer to [link / reference]. Figure 9 , Figure 9 This is a schematic diagram of the color block segmentation result.

[0067] In summary, the beneficial effects of this invention are: it can be used to segment individual color blocks in multi-source stitched images, laying the foundation for the next step of color consistency processing of multi-source stitched images.

[0068] 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 within the protection scope of the present invention.

Claims

1. A method for supporting automatic segmentation of tiles of a multi-source stitched image, characterized in that: The method comprises the following steps: S1: obtaining three HSV component images of a multi-source spliced image src, denoted as to-be-processed images srcH, srcS and srcV respectively; S2: performing single-threshold Otsu method segmentation on the to-be-processed images srcH, srcS and srcV to obtain segmentation results OTSUSH, OTSUS and OTSUV; S3: performing small connected region removal on the segmentation results OTSUSH, OTSUS and OTSUV respectively to obtain removal results fH, fS and fV; wherein the small connected region refers to a connected region with an area less than a preset area threshold s; S4: performing segmented color block operation on the removal results fH, fS and fV respectively to obtain a first segmented color block result; S5: generating a mean value distribution map of the first segmented color block result; S6: processing the mean value distribution map by using a single-threshold Otsu algorithm to obtain a revalued mean value distribution map; S7: filling small-area abnormal regions in the revalued mean value distribution map to obtain a filled image; S8: judging whether the filled image is all background regions, if yes, proceeding to step S10; otherwise, counting the number of vertexes of the largest connected region in the filled image, and proceeding to step S9; S9: judging whether the number of vertexes is greater than a preset vertex number threshold, if yes, proceeding to step S10; otherwise, calculating the pixel mean value difference of all connected regions with all values of 0 in the filled image, if the mean value difference is greater than a preset mean value difference threshold, returning to step S1, otherwise, proceeding to step S10; S10: taking the filled image as a final segmented color block result.

2. The method of claim 1, wherein: The color block segmentation operation in step S4 is specifically as follows: S41: performing image closing operation on fH with a size of p, the region with a value of 255 in the closing operation result image is a foreground region, and the region with a value of 0 is a background region; S42: performing contour fitting on the foreground region in the closing operation result image to obtain an approximate polygon region, and creating a binary image Mask1 with the same size as fH, in the binary image Mask1, the pixel value of the approximate polygon region is assigned as 255, and the pixel value of other regions is assigned as 0; S43: creating a binary image Mask2 which is completely the same as Mask1, and inverting the foreground region and the background region in the binary image Mask2; S44, the binary graph Mask1 and Mask2 are respectively used to mask the multi-source splicing image src, and the two mask results are recorded as srcH1 p and srcH2 p ; the H component pixel mean value of the foreground area in the mask result srcH1 p is calculated, recorded as meanH1 p , the H component pixel mean value of the foreground area in the mask result srcH2 p is recorded as meanH2 p , and the mean value difference is recorded as meanH p ; S45: increasing the size of the image closing operation size p by a step Δp, and repeating steps S41-S44 until the image closing operation size reaches M, wherein each value of p obtains a group of mask results and corresponding mean value difference values, the maximum mean value difference value is recorded as DH, and the mask result corresponding to DH is the optimal result of color block segmentation by using the H component srcH, and is recorded as segmented results srcH1 and srcH2; S46: using the method of steps S41-S45 to process fS and fV in the same way to obtain segmented results srcS1, srcS2, srcV1 and srcV2, and the corresponding two maximum mean value difference values are recorded as DS and DV; S47: comparing the mean value difference values DH, DS and DV, and recording the segmented result corresponding to the maximum mean value difference as the first color block segmentation result srcD1 and srcD2.

3. The method of claim 2, wherein: Step S5 is specifically as follows: S51: extract the HSV three-component diagram of srcD1, denoted as srcD1H, srcD1S and srcD1V; S52: block them according to the size of a pixel x a pixel, and the image block size less than a pixel x a pixel does not participate in the operation of generating the mean distribution diagram; wherein a is a preset value; S53: if the image block is all foreground area, calculate the mean value of the foreground area, and assign the mean value to each pixel in the image block; if the image block is all background area, directly assign each pixel in the image block to 255; S54: if the image block has background area and the number of foreground area pixels is greater than one fourth of the total number of pixels in the image block, calculate the pixel mean value M of the foreground area in the image block, and assign the foreground area of each pixel value in the image block to M, and the background area pixel value to 255; otherwise, directly assign each pixel in the image block to 255; S55: after step S53~S54, generate the mean distribution diagram of srcD1H and denote it as MH, and the region with value not equal to 255 in MH is called the region to be studied; S56: statistics the mean data of all image blocks in the region to be studied in MH, and record the mean data as a set MH{mh1, mh2...mh m}, where m is the number of image blocks in the region to be studied, and mh1, mh2...mh m are the mean data of each image block in the region to be studied; S57: calculate the standard deviation / mean value corresponding to the set MH, denoted as CVH; S58: according to steps S52~S57, the same processing is carried out on srcD1S and srcD1V, and the mean distribution diagrams are obtained, denoted as MS and MV, and the corresponding standard deviation / mean value is denoted as CVS and CVV; S59: select the maximum value in CVH, CVS and CVV, and the corresponding mean distribution diagram is the final first color block segmentation result srcD1 mean distribution diagram M1; S60: according to the method of steps S51~S59, the same processing is carried out on the first color block segmentation result srcD2, and the mean distribution diagram M2 of the first color block segmentation result srcD2 is obtained.

4. The method of claim 3, wherein: The specific process of step S6 is: S61: the mean data of all image blocks in the region to be studied in M1 is recorded as set M1{m11, m12...m1 q q, where q is the number of all image blocks in the region to be studied, m11, m12...m1 q is the mean data of each image block in the region to be studied; S62: the threshold value of the mean data in set M1 is obtained by using Otsu method, the region with pixel value greater than the threshold value in the region to be studied is assigned to b, and the region with pixel value less than the threshold value is assigned to 0, and the generated result is denoted as the revalued mean distribution diagram ReM1; wherein b is a preset value; S63: the same method is used to process the mean distribution diagram M2, and the result is denoted as the revalued mean distribution diagram ReM2.

5. The method of claim 4, wherein: Step S7 is specifically: S71: Statistics of the area of all connected regions in the area to be studied in ReM1, and the connected region area data is recorded as a set Area{area1, area2....area n}, where n is the number of connected regions in the area to be studied, area1, area2....area n is the area of each connected region; S72: the threshold value of the area data in set Area is obtained by using Otsu method, and the connected region with area less than the threshold value is filled as background area, and the filled result is denoted as the filled image FM1; S73: ReM2 is processed in the same way as steps S71~S72, and the filled image FM2 is obtained.

Citation Information

Patent Citations

  • Self-adaptive image segmentation method based on Otsu method and K-means method

    CN111340815A

  • Image splicing method, device and system and storage medium

    CN113935900A