White balance adjustment method and device and storage medium
By segmenting the image with saturation and brightness information, and using tone information to mark the mixed color temperature area, a more accurate white balance processing is achieved, and the image color casting problem in the mixed color temperature scene in the prior art is solved, and the image quality is improved.
Patent Information
- Application Number
- CN202411185690.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-24
AI Technical Summary
The existing white balance method has local or global color cast problems when dealing with mixed color temperature scenes, especially when there are large differences in mixed color temperatures, which makes it difficult to accurately identify and process, resulting in a decline in image quality.
By performing saturation information segmentation processing on the image to be identified, the target area is obtained, and adaptive segmentation is performed based on the brightness information of the target area to obtain the target sub-region, the color temperature mark is used to mark the color temperature area, and the mixed color temperature area segmentation standard is determined. This allows image white balance processing.
It improves the accuracy and effect of image white balance processing, reduces color casting, and optimizes image quality, especially in scenarios where mixed color temperatures vary greatly.
Smart Images

Figure CN119182892A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a white balance adjustment method, device and storage medium. Background Art
[0002] Different light sources have different spectral components and distributions, which result in different color temperatures. Affected by different light sources, white objects will appear blue at high color temperatures and red at low color temperatures. Therefore, images are often processed for white balance to obtain images with accurate colors.
[0003] However, when there are multiple light sources in the image, that is, when there is a mixed color temperature, the current white balance method is not perfect enough to identify and process the mixed color temperature scene; when performing white balance processing, it may cause local or global color cast problems in the image; especially when the mixed color temperature difference is large, the color cast is more serious.
[0004] There is an urgent need for more effective white balance adjustment methods to improve image quality. Summary of the invention
[0005] The present application at least provides a white balance adjustment method, apparatus, device and computer-readable storage medium.
[0006] In a first aspect, the present application provides a white balance adjustment method, comprising: performing image segmentation processing on the image to be identified according to the acquired saturation information of the image to be identified, so as to obtain a target area in the image to be identified; performing adaptive segmentation processing on the target area according to the brightness information of the target area in the image to be identified, so as to obtain a target sub-area; marking each target sub-area with a color temperature according to the hue information of the target sub-area, so as to obtain a mixed color temperature area segmentation standard; and performing image white balance processing based on the mixed color temperature area segmentation standard.
[0007] In one embodiment, the target sub-region includes a first target sub-region and a second target sub-region, and the step of marking each target sub-region with a color temperature according to the hue information of the target sub-region to obtain a mixed color temperature region segmentation standard includes: calculating the hue difference between the first target sub-region and the second target sub-region based on the hue mean of the first target sub-region and the hue mean of the second target sub-region; if the hue difference between the first target sub-region and the second target sub-region is greater than a preset hue difference threshold, marking the first target sub-region and the second target sub-region respectively to obtain the mixed color temperature region segmentation standard.
[0008] In one embodiment, the step of calculating the hue difference between the first target sub-region and the second target sub-region based on the hue mean of the first target sub-region and the hue mean of the second target sub-region includes: if the area of the first target sub-region and the area of the second target sub-region are both greater than a preset target sub-region area threshold, and the area difference between the first target sub-region and the second target sub-region is less than a preset area difference threshold, determining a first hue mean of the first target sub-region based on the hue value of each pixel in the first target sub-region, and determining a second hue mean of the second target sub-region based on the hue value of each pixel in the second target sub-region; and performing a difference calculation on the first hue mean and the second hue mean to obtain the hue difference between the first target sub-region and the second target sub-region.
[0009] In one embodiment, the step of performing image segmentation processing on the image to be identified based on the acquired saturation information of the image to be identified to obtain the target area in the image to be identified includes: based on the saturation information of the image to be identified, selecting candidate areas with a saturation less than a preset saturation threshold in the image to be identified; eliminating areas in the candidate areas whose areas are less than a preset candidate area threshold to obtain the remaining areas; if the area of the remaining areas is greater than the preset remaining area threshold, determining the remaining areas as the target areas.
[0010] In one embodiment, before the step of performing image segmentation processing on the image to be identified according to the acquired saturation information of the image to be identified to obtain the target area in the image to be identified, the method further includes: performing color cast verification on the acquired image to be verified to obtain a color cast verification result of the image to be verified; if the color cast verification result indicates that the image to be verified has color cast, stopping subsequent processing of the image to be verified; if the color cast verification result indicates that the image to be verified has no color cast, using the image to be verified as the image to be identified.
[0011] In one embodiment, the image to be verified is subjected to white balance processing. After the step of performing color cast verification on the acquired image to be verified and obtaining a color cast verification result of the image to be verified, the method further includes: each time a color cast verification result for characterizing that the image to be verified is free of color cast, a preset number of non-color cast times is accumulated and calculated until a color cast verification result for characterizing that the image to be verified is free of color cast is obtained, and then the accumulation calculation of the number of non-color cast times is suspended; the processing frequency of the white balance processing is adjusted based on the number of non-color cast times, and the number of non-color cast times and the processing frequency are negatively correlated; if the adjusted processing frequency is lower than a preset frequency threshold, the number of non-color cast times is reduced.
[0012] In one embodiment, the step of performing color cast verification on the acquired image to be verified and obtaining the color cast verification result of the image to be verified includes: obtaining the saturation mean and / or hue standard deviation of the image to be verified; if the saturation mean is greater than the right boundary of a preset saturation interval, and / or the hue standard deviation is less than the left boundary of a preset hue standard deviation interval, then a color cast verification result for characterizing that the image to be verified is color cast is obtained; if the saturation mean is less than the left boundary of the saturation interval, and / or the hue standard deviation is greater than the right boundary of the hue standard deviation interval, then a color cast verification result for characterizing that the image to be verified is not color cast is obtained.
[0013] In one embodiment, the step of performing color cast verification on the acquired image to be verified and obtaining the color cast verification result of the image to be verified includes: obtaining the saturation mean and / or hue standard deviation of the image to be verified; if the saturation mean is within the saturation range, and / or the hue standard deviation is within the hue standard deviation range, then comparing the image to be verified with a preset template image to obtain the color difference value between the image to be verified and the template image; if the color difference value is greater than a preset color difference threshold, then obtaining a color cast verification result for characterizing that the image to be verified has color cast; if the color difference value is less than or equal to the color difference threshold, then obtaining a color cast verification result for characterizing that the image to be verified has no color cast.
[0014] The second aspect of the present application provides a white balance adjustment device, including: a first segmentation module, used to perform image segmentation processing on the image to be identified according to the acquired saturation information of the image to be identified, so as to obtain a target area in the image to be identified; a second segmentation module, used to perform adaptive segmentation processing on the target area in the image to be identified according to the brightness information of the target area, so as to obtain a target sub-area; a marking module, used to mark the color temperature of each target sub-area according to the hue information of the target sub-area, so as to obtain a mixed color temperature area segmentation standard; a white balance processing module, used to perform image white balance processing based on the mixed color temperature area segmentation standard.
[0015] A third aspect of the present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned white balance adjustment method.
[0016] A fourth aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, which implement the above-mentioned white balance adjustment method when the program instructions are executed by a processor.
[0017] The above scheme, by utilizing the color attributes of the image, obtains the target area in the image to be identified according to the saturation information of the image to be identified, obtains the target sub-area in the target area according to the brightness information of the target area, and marks the color temperature of each target sub-area according to the hue information of the target sub-area, thereby determining the mixed color temperature area in the image to be identified and obtaining the mixed color temperature area segmentation standard; performing image white balance processing by using the mixed color temperature area segmentation standard can more accurately judge the mixed color temperature area during the image white balance process, thereby improving the white balance processing effect and optimizing the image quality.
[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0020] Figure 1 is a flowchart of an exemplary embodiment of a white balance adjustment method of the present application;
[0021] Figure 2 It is a simplified schematic diagram of the mixed color temperature area segmentation standard in this application;
[0022] Figure 3 is a schematic diagram of the relationship between an exemplary white balance processing frequency and the number of un-color cast times in the white balance adjustment method of the present application;
[0023] Figure 4 is a schematic diagram of an exemplary template image in the white balance adjustment method of the present application;
[0024] Figure 5 It is a schematic diagram of the overall process of the white balance adjustment method of the present application;
[0025] Figure 6 is a block diagram of a white balance adjustment device shown in an exemplary embodiment of the present application;
[0026] Figure 7 It is a structural schematic diagram of an embodiment of the electronic device of the present application;
[0027] Figure 8 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0028] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0029] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0030] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.
[0031] For ease of understanding, the white balance in the field of image processing technology of the present application is now exemplarily explained. White balance is an important concept in photography and videography. Its main function is to adjust the color so that electronic devices such as digital cameras or displays can accurately restore white objects to white when shooting or displaying under different light sources. There will be many light sources in real scenes. White objects will be blue under high color temperature light sources and red under low color temperature light sources. The human eye will automatically adjust its own photosensitivity according to the changes in ambient light, that is, color adaptation, so that white objects still look white. However, electronic devices such as digital cameras need to use white balance algorithms to achieve this automatic correction process of the human eye. The purpose of white balance is that no matter how the ambient light changes, electronic devices with image processing functions can accurately restore white objects to white. At present, the effect of white balance is usually achieved by adjusting the red and blue gains corresponding to the red and blue channels, so that the photos look closer to the visual habits of the human eye.
[0032] Although there are currently a variety of white balance algorithms, the recognition and processing of mixed color temperature scenes is still imperfect; when there are multiple light sources in the image, that is, mixed color temperatures, there will still be color cast problems when using existing white balance algorithms for correction; when the mixed color temperature difference is large, the color cast problem will be more serious.
[0033] See also Figure 1 , Figure 1 : is a flowchart of an exemplary embodiment of the white balance adjustment method of the present application. Specifically, it may include the following steps:
[0034] Step S110 , performing image segmentation processing on the image to be identified according to the acquired saturation information of the image to be identified, to obtain a target area in the image to be identified.
[0035] The image to be identified refers to the image to be identified with mixed color temperature. By identifying the mixed color temperature area in the image and then adjusting the white balance, the white balance processing process can be made more accurate and effective, and will not cause color cast in other normal areas during the white balance processing process.
[0036] For example, the image to be identified may be an image in HSV format, where HSV is a color model, hue (H), saturation (S) and value (V), which is equivalent to hue (H), saturation (S) and brightness (V).
[0037] The step of performing image segmentation processing on the image to be identified according to the acquired saturation information of the image to be identified may be that when the image to be identified in the HSV space is acquired, the mixed color temperature correction flag ct_flag is initialized to 0; then the image to be identified is segmented on the saturation channel S based on the saturation information of the image to be identified, and the gray block area whose saturation is less than the saturation threshold S_thresh in the image to be identified is obtained, and the gray block area is used as the target area. The gray block area refers to the area corresponding to gray or white in the real world, rather than the area of other colors (such as red, green, etc.), and the purpose of white balance is to accurately restore such areas to gray and / or white.
[0038] Optionally, the gray block area can be further screened to remove some areas with smaller areas, for example, the area of the gray block area is removed from the gray block area that is smaller than the preset candidate area threshold N_area, and the remaining gray block area is obtained. Since the gray block area of small area has little effect on the overall picture, in order to improve the operation efficiency of the overall solution, the processing of the gray block area of small area can be ignored, and the interference of the small area in the white balance processing process can be reduced to a certain extent. Then determine whether the area s_gray of the remaining gray block area is greater than the preset remaining area threshold S_gray; if greater than, the remaining gray block area can be used as the target area for subsequent judgment; if less than or equal to S_gray, the mixed color temperature area judgment is terminated. Among them, the remaining gray block area may be continuous or discontinuous. If the remaining gray block area is continuous, the area of the remaining gray block area can be compared with the remaining area threshold; if the remaining gray block area is not continuous (for example, there are multiple remaining gray block areas in a certain image), the sum of the areas of each remaining gray block area can be calculated, and then the sum of their areas is compared with the remaining area threshold.
[0039] It should also be noted that before eliminating the areas in the gray block area whose area is smaller than the area threshold of the candidate area, the gray block area can also be closed, and then the areas in the gray block area after the closed operation are eliminated whose area is smaller than the area threshold N area of the candidate area. Closing operation is a basic operation in mathematical morphology, which is defined as a process of dilation followed by erosion. Specifically, the closing operation uses the same structural element to perform a dilation operation on the image first, and then an erosion operation. The closing operation can effectively remove small holes and noise in the image, while maintaining large objects and edge information in the image, and smoothing its boundaries without significantly changing the area and shape of the object.
[0040] Step S120 , performing adaptive segmentation processing on the target area according to the brightness information of the target area in the image to be identified, to obtain target sub-areas.
[0041] Combined with the above steps, the description is given. Similarly, in the process of adaptively segmenting the target area according to the brightness information of the target area in the image to be identified, the target area is adaptively thresholded in the brightness channel V based on the brightness information of the target area to obtain the target sub-area. Among them, the adaptive threshold segmentation can refer to the existing segmentation algorithm for calculation. The existing image segmentation methods mainly include threshold segmentation, region-based segmentation, segmentation using morphological watershed, and cluster segmentation and deep learning segmentation. Among them, the threshold segmentation method is intuitive, simple to implement and fast in calculation. The threshold can be divided into: basic global threshold, optimal global threshold using Otsu method, global threshold improved by image smoothing, global threshold improved by edge, multi-threshold, variable threshold, multivariate threshold, etc., which will not be described here. Optionally, the adaptive threshold segmentation is a variable threshold segmentation, which is based on the brightness distribution of different areas of the image, local characteristics and other image information, and calculates the mean, median, Gaussian weighted average, etc. of a neighborhood in the image to determine its threshold. It is a kind of local threshold segmentation. It should be noted that if you pursue the regional segmentation effect or need to divide the image into multiple regions (there are many mixed color temperature light sources in the scene and the color temperature difference is large), you can combine the image features such as image hue, brightness, edge, texture, etc., and use region-based segmentation, morphological watershed segmentation, clustering segmentation, and deep learning segmentation to segment each light source, so that each color temperature region can be segmented more accurately. For the sake of convenience, the following mainly takes two target sub-regions S1_region and S2_region as examples for explanation.
[0042] Step S130 , marking the color temperature of each target sub-region according to the hue information of the target sub-region, and obtaining a mixed color temperature region segmentation standard.
[0043] In combination with the above steps, after obtaining the target sub-regions S1_region and S2_region, the hue information of the target sub-region S1_region and the hue information of the target sub-region S2_region can be obtained respectively in the hue channel H; if the hue information of the two target sub-regions differs too much, it means that there is an obvious color temperature difference between the two sub-regions, that is, it is considered that there is a mixed color temperature region, and the mixed color temperature correction flag ct_flag can be set to 1 to indicate that a mixed color temperature region is currently detected in the image to be identified.
[0044] Therefore, the two target sub-regions are respectively marked with color temperature, so that the image area ranges corresponding to the two target sub-regions in the image to be identified can be distinguished through different color temperature marks, and a mixed color temperature area segmentation standard is obtained.
[0045] For example, reference may be made to Figure 2 As shown, Figure 2 It is a simplified schematic diagram of the mixed color temperature region segmentation standard in the present application, wherein the step of color temperature marking the two target sub-regions may be: obtaining the original image in RGB format corresponding to the image to be identified, and correspondingly marking the color temperature in the original image based on the two target sub-regions in the image to be identified, obtaining the gray block area 1 and gray block area 2 in the original image, and the non-gray block area 0, thereby forming a mixed color temperature region segmentation information table ct_mat (i.e., the mixed color temperature region segmentation standard), wherein ct_mat may be represented in matrix form. Thus, the mixed color temperature region in the RGB original image may be determined by ct_mat.
[0046] Through the above steps, mixed color temperature judgment is performed in the white balance process, and the image features of the three channels of the HSV space and the information such as the brightness difference of the mixed color temperature scene are fully utilized, so that the judgment of the mixed color temperature scene is more accurate, and also more efficient and convenient.
[0047] Step S140: performing image white balance processing based on the mixed color temperature region segmentation standard.
[0048] Combined with the above steps, the above steps are described as follows. After obtaining the mixed color temperature area segmentation standard ct_mat, the size of ct_mat and the size of the raw format image captured by the image acquisition device (image sensor) can be adjusted to be the same; then the mixed color temperature area in the raw data is determined according to ct_mat, and the mixed color temperature area in the raw data is subjected to regional white balance processing. The white balance processing methods for different areas can be the same or different, which is not limited here. Among them, raw data usually refers to the unprocessed image data format, which retains all the original information at the time of image acquisition. In image processing, raw data is the original data after the image sensor (such as CMOS or CCD, etc.) converts the captured light source signal into a digital signal, which contains physical information such as illumination and color of the current image acquisition scene.
[0049] The obtained raw data of the image to be processed is divided into regions according to the mixed color temperature regions marked in the ct mat to obtain the region to be processed in the image to be processed; and white balance processing is performed on the region to be processed.
[0050] It can be seen that the present application utilizes the color attributes of the image to obtain the target area in the image to be identified according to the saturation information of the image to be identified, obtains the target sub-area in the target area according to the brightness information of the target area, and marks the color temperature of each target sub-area according to the hue information of the target sub-area, thereby determining the mixed color temperature area in the image to be identified and obtaining the mixed color temperature area segmentation standard; performing image white balance processing by using the mixed color temperature area segmentation standard can more accurately perform white balance correction in different regions during the image white balance process, thereby improving the white balance processing effect, making the color correction of the mixed color temperature area more accurate, and optimizing the image quality.
[0051] Based on the above embodiment, the embodiment of the present application describes the steps of marking the color temperature of each target sub-region according to the hue information of the target sub-region to obtain the mixed color temperature region segmentation standard. The target sub-region includes a first target sub-region and a second target sub-region. Specifically, the method of this embodiment includes the following steps:
[0052] The hue difference between the first target sub-region and the second target sub-region is calculated based on the hue mean of the first target sub-region and the hue mean of the second target sub-region; if the hue difference between the first target sub-region and the second target sub-region is greater than a preset hue difference threshold, the first target sub-region and the second target sub-region are marked respectively to obtain a mixed color temperature region segmentation standard.
[0053] Exemplarily, the first target sub-region and the second target sub-region are used as examples for explanation. In the hue channel H, the hue mean s1_h_mean of the first target sub-region and the hue mean s2_h_mean of the second target sub-region are respectively counted; the difference calculation is performed based on s1_h_mean and s2_h_mean to obtain the hue difference diff_h_mean between the hue means of the two sub-regions. If the hue difference diff_h_mean is greater than the preset hue difference threshold Diff_h_mean, it indicates that the hue difference between the first target sub-region and the second target sub-region is too large, so the first target sub-region and the second target sub-region in the image to be identified are determined to be mixed color temperature regions, that is, regions that require white balance partition adjustment, and the mixed color temperature correction flag ct_flag is set to 1. If the hue difference diff_h_mean is less than or equal to the hue difference threshold Diff_h_mean, it indicates that the hue difference between the first target sub-region and the second target sub-region is not large, there may be no mixed color temperature region or there is no obvious mixed color temperature region, and the mixed color temperature recognition judgment of the image to be identified can be terminated.
[0054] Furthermore, in the process of subsequent white balance processing, if the recognition of the image to be recognized does not find a mixed color temperature area that requires white balance adjustment, the white balance parameters before the recognition can continue to be used to perform white balance processing on the newly acquired image; if the recognition of the image to be recognized finds a mixed color temperature area that requires white balance adjustment, and the mixed color temperature area segmentation standard ct_mat is obtained, the ct_mat can be used to perform white balance processing on the newly acquired image.
[0055] Based on the above embodiment, the embodiment of the present application describes the steps of calculating the hue difference between the first target sub-region and the second target sub-region based on the hue mean of the first target sub-region and the hue mean of the second target sub-region. Specifically, the method of this embodiment includes the following steps:
[0056] If the area of the first target sub-region and the area of the second target sub-region are both greater than a preset target sub-region area threshold, and the area difference between the first target sub-region and the second target sub-region is less than the preset area difference threshold, a first hue mean of the first target sub-region is determined based on the hue value of each pixel in the first target sub-region, and a second hue mean of the second target sub-region is determined based on the hue value of each pixel in the second target sub-region; the difference between the first hue mean and the second hue mean is calculated to obtain the hue difference between the first target sub-region and the second target sub-region.
[0057] In combination with the above-mentioned embodiment, after obtaining the first target sub-area and the second target sub-area, it is necessary to determine whether the first target sub-area and the second target sub-area meet the preset judgment criteria, and then determine whether it is necessary to perform mixed color temperature area judgment on the first target sub-area and the second target sub-area.
[0058] Specifically, the area s1 of the first target sub-region and the area s2 of the second target sub-region are obtained respectively; it is determined whether the areas s1 and s2 of the two sub-regions are both greater than a preset target sub-region area threshold S_part, and whether the area difference between s1 and s2 is less than the area difference threshold (for example, it can be calculated by whether |s1–s2| / min(s1, s2) is less than a preset S_ratio); if the above two judgment conditions are met at the same time, it is characterized that the areas occupied by the first target sub-region and the second target sub-region in the image are obvious, and the areas of the first target sub-region and the second target sub-region are similar in size, and the mixed color temperature phenomenon is obvious, and the mixed color temperature area judgment can be further performed; if the above two judgment conditions are not met at the same time, it is characterized that the areas occupied by the first target sub-region and the second target sub-region in the image are not obvious enough, and / or the areas of the first target sub-region and the second target sub-region are quite different in size, then the first target sub-region and the second target sub-region are not easy to form an obvious mixed color temperature area, and therefore the mixed color temperature area judgment of the first target sub-region and the second target sub-region can be terminated, thereby improving the processing efficiency of the entire processing process. Optionally, if it is necessary to improve the determination accuracy of the mixed color temperature area, the above determination process of the target sub-area may be omitted, and the hue difference analysis may be directly performed on each obtained target sub-area.
[0059] Further, if the first target sub-region and the second target sub-region simultaneously meet the above two judgment conditions, the hue difference analysis is performed on the first target sub-region and the second target sub-region. The first hue mean s1_h_mean of the first target sub-region is determined by performing mean calculation based on the hue values of each pixel in the first target sub-region, and the second hue mean s2_h_mean of the second target sub-region is determined by performing mean calculation based on the hue values of each pixel in the second target sub-region; the hue difference between the first target sub-region and the second target sub-region is calculated based on s1_h_mean and s2_h_mean to obtain diff_h_mean; if diff_h_mean is greater than the preset hue difference threshold Diff_h_mean, it indicates that the hue difference between the first target sub-region and the second target sub-region is too large, so the first target sub-region and the second target sub-region in the image to be identified are determined to be mixed color temperature regions, that is, regions that need white balance adjustment, and the mixed color temperature correction flag ct_flag is set to 1. If the hue difference diff_h_mean is less than or equal to the hue difference threshold Diff_h_mean, it indicates that the hue difference between the first target sub-region and the second target sub-region is not large, there may be no mixed color temperature region or no obvious mixed color temperature region, then the mixed color temperature recognition judgment of the image to be recognized can be terminated.
[0060] On the basis of the above embodiments, the embodiment of the present application describes the steps of performing image segmentation processing on the image to be identified according to the acquired saturation information of the image to be identified to obtain the target area in the image to be identified. Specifically, the method of this embodiment includes the following steps:
[0061] Based on the saturation information of the image to be identified, candidate areas whose saturation is less than a preset saturation threshold are selected in the image to be identified; areas in the candidate areas whose areas are less than a preset candidate area threshold are eliminated to obtain the remaining areas; if the area of the remaining areas is greater than the preset remaining area threshold, the remaining areas are determined as the target areas.
[0062] In combination with the above-mentioned embodiments, the process of image segmentation based on the saturation information of the image to be identified in the present application can be: threshold segmentation is performed on the image to be identified on the saturation channel S, and candidate gray block areas (candidate areas) with a saturation less than a saturation threshold S_thresh in the image to be identified are retained; then areas with an area less than a threshold N_area in the candidate gray block areas are eliminated to obtain remaining gray block areas (remaining areas); the area s_gray of the remaining gray block areas is calculated, and if the area s_gray of the remaining gray block areas is greater than a preset remaining area threshold S_gray, the remaining gray block areas are used as the target areas, and the target areas are continued to be segmented based on brightness; if the area s_gray of the remaining gray block areas is less than or equal to S_gray, the analysis of the remaining gray block areas is terminated, and it can be determined that there is no obvious mixed color temperature area in the image to be identified.
[0063] In addition, before performing the region elimination process, the candidate regions may be firstly subjected to a closing operation process, and then the regions whose areas are smaller than a preset candidate region area threshold value in the candidate regions subjected to the closing operation process are eliminated to obtain the remaining regions.
[0064] On the basis of the above embodiments, the embodiment of the present application describes the steps before performing image segmentation processing on the image to be identified based on the acquired saturation information of the image to be identified to obtain the target area in the image to be identified. Specifically, the method of this embodiment includes the following steps:
[0065] Perform color cast verification on the acquired image to be verified to obtain a color cast verification result of the image to be verified; if the color cast verification result indicates that the image to be verified has color cast, stop performing subsequent processing on the image to be verified; if the color cast verification result indicates that the image to be verified has no color cast, use the image to be verified as an image to be identified.
[0066] In conjunction with the above-mentioned embodiment, before the mixed color temperature area recognition judgment is performed on the image to be recognized, a color cast verification judgment may also be performed, that is, the image to be recognized is subjected to color cast verification judgment.
[0067] Specifically, the acquired image to be verified is subjected to color cast verification to obtain a color cast verification result of the image to be verified. If the color cast verification result indicates that the image to be verified is color cast, it will affect the subsequent mixed color temperature area recognition and judgment, so the subsequent processing of the image to be verified is stopped (the mixed color temperature area judgment is stopped), which is equivalent to skipping the processing of the image to be verified. Further, the next frame of the image to be verified that is determined to be color cast can be directly obtained for white balance processing, and then the image after white balance processing is judged to be color cast, until an image without color cast is obtained and used as the image to be identified, and then the subsequent mixed color temperature area recognition and judgment is performed; if the color cast verification result indicates that the image to be verified is not color cast, the image to be verified can be used as the image to be identified to enter the mixed color temperature area recognition and judgment process. Among them, if the number of times the image is white-balanced is greater than the preset white-balance number threshold and the image is still determined to be color cast, the white balance processing can be paused or stopped, and an error message is generated and output to the corresponding electronic device (such as an image acquisition device or other intelligent electronic device, etc.). Optionally, if the subsequent color cast verification result indicates that the image to be verified still has color cast, the subsequent operation on the image to be verified may be directly terminated to determine whether the next frame of image data of the image to be verified has color cast.
[0068] Based on the above embodiment, the embodiment of the present application describes the steps after color cast verification is performed on the acquired image to be verified and the color cast verification result of the image to be verified is obtained. The image to be verified is an image after white balance processing. Specifically, the method of this embodiment includes the following steps:
[0069] Every time a color cast verification result for characterizing that the image to be verified is not color casted is obtained, the preset number of non-color cast times is accumulated and calculated, until a color cast verification result for characterizing the color cast of the image to be verified is obtained, then the accumulation calculation of the number of non-color cast times is suspended; the processing frequency of the white balance processing is adjusted based on the number of non-color cast times, and the number of non-color cast times and the processing frequency are negatively correlated; if the adjusted processing frequency is lower than the preset frequency threshold, the number of non-color cast times is reduced.
[0070] Combined with the above example, in the common image acquisition process, when the image sensor or image acquisition device outputs the image data in RGB format, it is usually processed by white balance. Therefore, the image to be verified can be an RGB image after white balance processing. The color cast of the image to be verified can be analyzed to obtain the processing effect of the white balance processing. If a color cast verification result is obtained each time to characterize the image to be verified without color cast, the preset number of non-color cast times cnt is accumulated (cnt++), and the color accuracy of the collected image can be characterized by the number of non-color cast times, until a color cast verification result is obtained to characterize the color cast of the image to be verified, and the number of non-color cast is set to 0. Among them, each image to be verified in "each color cast verification result is obtained to characterize the image to be verified without color cast" is a different image to be verified.
[0071] It is understandable that in a common white balance processing process, an image sensor or an image acquisition device usually performs a white balance processing once for each frame of image data acquired, that is, the frequency of white balance processing can be set to 1 time / frame by default, or other frequencies are not limited here. However, it can be seen from the above description that the more times of non-color cast are counted, the higher the reliability and stability of the image with accurate color is. Therefore, in the present application, the frequency of white balance processing can be adjusted by counting the number of non-color cast, so that the white balance processing process is more reasonable and effective.
[0072] For example, reference may be made to Figure 3 , Figure 3 1 is a schematic diagram of an exemplary relationship between the white balance processing frequency and the number of uncolored images in the white balance adjustment method of the present application. Among them, the number of uncolored images cnt and the processing frequency awb_f are negatively correlated, that is, the higher the number of uncolored images, the lower the white balance processing frequency can be adjusted accordingly, thereby reducing the image processing time and improving the image generation efficiency. In addition, there is a preset frequency threshold awb_F_MIN and the uncolored image number threshold N corresponding to each other in the relationship diagram, which is used to limit the processing frequency from being unlimitedly lowered as the number of uncolored images cnt increases.
[0073] Specifically, it is determined whether the current number of uncolor cast times cnt is greater than the uncolor cast times threshold N; if not, the white balance frequency can be lowered according to the current number of uncolor cast times and the subsequent steps are continued; if greater, it is further determined whether the current white balance processing frequency awb_f is less than the frequency threshold awb_F_MIN; if awb_f<awb_F_MIN, the current cnt is reduced, for example, cnt=cnt / 2, and then the white balance frequency is adjusted according to the current number of uncolor cast times and the subsequent steps are continued; if awb_f≥awb_F_MIN, the white balance frequency can be further lowered and the subsequent steps are continued until awb_f<awb_F_MIN or a color cast image is obtained.
[0074] On the basis of the above embodiments, the embodiment of the present application will illustrate the steps of performing color cast verification on the acquired image to be verified and obtaining the color cast verification result of the image to be verified. Specifically, the method of this embodiment includes the following steps:
[0075] Obtain the saturation mean and / or hue standard deviation of the image to be verified; if the saturation mean is greater than the right boundary of a preset saturation interval, and / or the hue standard deviation is less than the left boundary of a preset hue standard deviation interval, a color cast verification result is obtained to characterize that the image to be verified has a color cast; if the saturation mean is less than the left boundary of the saturation interval, and / or the hue standard deviation is greater than the right boundary of the hue standard deviation interval, a color cast verification result is obtained to characterize that the image to be verified has no color cast.
[0076] In conjunction with the foregoing embodiments, in the process of color cast verification of the avatar to be verified, the presence of color cast can be determined by comparing the saturation and / or hue standard deviation. Specifically, the RGB image can be cloned and then reduced by n times to obtain a scaled image, and then the scaled image can be converted to the HSV space. It should be noted that the RGB image and HSV image used in the image color cast verification process can be shared with the mixed color temperature area recognition and judgment process described in the foregoing embodiments, that is, the image to be verified and the image to be identified can correspond to the same image, and the image to be identified can be the above-mentioned scaled image based on the HSV space. In the saturation channel S, the saturation mean s_img of the image to be verified is calculated based on the saturation of each pixel in the image to be verified; and / or in the hue channel H, the hue standard deviation h_img of the image to be verified is calculated based on the hue value of each pixel in the image to be verified. The saturation mean s_img is compared with the preset saturation interval [S_img_min, S_img_max], and / or the hue standard deviation h_img is compared with the preset hue standard deviation interval [H_img_min, H_img_max]. If the saturation mean is greater than the saturation interval (i.e., s_img is greater than S_img_max), and / or the hue standard deviation is less than the hue standard deviation interval (i.e., h_img is less than H_img_min), a color cast verification result for characterizing the color cast of the image to be verified is obtained. If the saturation mean is less than the saturation interval (i.e., s_img is less than S_img_min), and / or the hue standard deviation is greater than the hue standard deviation interval (i.e., h_img is greater than H_img_max), a color cast verification result for characterizing that the image to be verified is not color cast is obtained. According to the above method, the process of global color cast judgment on the image to be judged is realized.
[0077] On the basis of the above embodiments, the embodiment of the present application will illustrate the steps of performing color cast verification on the acquired image to be verified and obtaining the color cast verification result of the image to be verified. Specifically, the method of this embodiment includes the following steps:
[0078] Obtain the saturation mean and / or hue standard deviation of the image to be verified; if the saturation mean is within the saturation range, and / or the hue standard deviation is within the hue standard deviation range, compare the image to be verified with a preset template image to obtain a color difference value between the image to be verified and the template image; if the color difference value is greater than a preset color difference threshold, obtain a color cast verification result for characterizing that the image to be verified has a color cast; if the color difference value is less than or equal to the color difference threshold, obtain a color cast verification result for characterizing that the image to be verified has no color cast.
[0079] In conjunction with the above-mentioned embodiment, if the saturation mean s_img of the image to be verified is within the saturation interval [S_img_min, S_img_max], and / or the hue standard deviation h_img of the image to be verified is within the hue standard deviation interval [H_img_min, H_img_max], then a preset template image and the image to be verified can be obtained for comparison processing. Among them, the template image can be pre-stored in the color cast database for judging the color cast of the image. The template image is a picture of an object taken by an image acquisition device under normal lighting conditions (that is, the template image refers to a standard color image without color cast), which can be compressed and stored in the image acquisition device (such as a camera system), and each template image needs to record the corresponding color information and other image data. Optionally, the selection rule for the template image can also be based on static objects that often appear in actual use scenarios, because static objects usually have stable and obvious features; for example, traffic signs that often appear in traffic scenes, select images of several signs with obvious features as template images of the color cast database, for example Figure 4 , Figure 4 This is a schematic diagram of an exemplary template image in the white balance adjustment method of the present application, wherein each template image has its corresponding color information, which will not be described in detail here.
[0080] Further, the image to be verified is compared with the template image in the color cast database. The specific comparison method may include but is not limited to image matching methods such as template matching and shape matching; if the comparison is successful, the color difference judgment is performed. If the comparison fails, it is considered that the image to be verified is color cast and the color cast flag is set to 1. Specifically, if the comparison is successful, the color difference judgment is performed based on the mutually matching areas in the image to be verified and the template image. The method of color difference judgment can still refer to the judgment method of the hue difference value described in the aforementioned embodiment, which will not be repeated here, and the color difference diff_color between the image to be verified and one or more template images is obtained. If the color difference diff_color is greater than the preset color difference threshold DIFF_color, it means that there is an obvious color difference between the image to be verified and the template image, that is, the image to be verified is a color cast image, so the color cast flag is set to 1, and the number of times of non-color cast is set to 0. If the color difference diff_color is less than or equal to the color difference threshold DIFF_color, it means that there is no obvious color difference between the image to be verified and the template image, that is, the image to be verified is a non-color cast image, so the color cast flag remains at 0, and the number of times of non-color cast is +1. Therefore, according to the above method, the process of performing local color cast judgment on the image to be identified by using the template image can be realized.
[0081] It should be noted that if a color-cast image to be verified is obtained, the subsequent mixed color temperature area judgment processing of the image to be verified can be stopped, and the next frame of the image to be verified can be directly obtained for white balance processing, and the image after white balance processing can be subjected to color cast judgment; if a non-color-cast image to be verified is obtained, the image can be used as the image to be identified for mixed color temperature area identification and judgment.
[0082] It should also be noted that in other implementation scenarios, the above-mentioned global color cast judgment method and local color cast judgment method may exist at the same time or any one of them may exist. That is, a rough global color cast judgment may be performed only by setting a saturation threshold, a hue standard deviation threshold, etc., or a precise local color cast judgment may be performed only by comparing the image to be verified with the template image, or a global color cast judgment may be performed first and then a local color cast judgment may be performed based on the above-mentioned embodiment, thereby improving the accuracy of the color cast judgment, which is not limited here.
[0083] On the basis of the above embodiments, this embodiment also exemplarily provides a white balance method, and the specific steps may at least include: acquiring raw image data acquired by an image sensor or an image acquisition device; performing white balance correction processing on the raw data, wherein the white balance algorithm may include but is not limited to a gray world algorithm, a perfect reflection algorithm, a white balance algorithm that is a combination of the two algorithms, or other commonly used white balance algorithms, which are not limited here.
[0084] Furthermore, the step of "performing white balance correction processing on raw data" may also at least include: first determine whether the color cast flag is 0 (0 indicates no color cast, 1 indicates color cast, the color cast flag awb_flag can be initialized to 1 when the camera is started, and can be obtained later through the subsequent color cast judgment process). If there is color cast, perform global white balance correction on the raw data, and restore the current white balance processing frequency awb_f to the preset default frequency awb_F, and set the statistical value cnt of the number of times there is no color cast to 0; then perform color cast judgment on the corrected raw data again. If there is no color cast, determine whether the mixed color temperature correction flag ct_flag is 0 (0 indicates that there is no mixed color temperature area, 1 indicates that there is a mixed color temperature area, the mixed color temperature correction flag ct_flag can be initialized to 0 when the camera is started; it can be obtained later through the mixed color temperature recognition and judgment process). If there is a mixed color temperature area, the raw data is divided into regions based on the mixed color temperature area segmentation standard ct_mat; then according to the different regional segmentation information of ct_mat, the gray block white balance correction gains rgain and bgain of the raw data are calculated for each region to obtain an image with white balance correction for each region. Figure 2To illustrate, the gray block areas with different color temperatures numbered 1 and 2 are calculated for white balance correction gain based on the pixel information in their respective gray block areas, and rgain1 and bgain1 and rgain2 and bgain2 are obtained respectively; and the non-gray block area numbered 0 can be white balanced by using the average of the white balance correction gains rgain and bgain of the mixed color temperature areas 1 and 2, that is, rgain0 = (rgain1 + rgain2) / 2, bgain0 = (bgain1 + bgain2) / 2, and cnt++ is executed after the white balance is completed. In this way, white balance processing is implemented for images with mixed color temperature areas. If there is no mixed color temperature area, global white balance correction is performed on the raw data, and cnt++ is executed.
[0085] On the basis of the above embodiments, in order to facilitate the overall understanding of the technical solution of the present application, this embodiment provides an overall implementation method to summarize the steps provided in the above embodiments. Specifically, the technical solution of the present application at least includes a method for white balancing an image, a method for judging color cast of an image, and a method for identifying and judging mixed color temperature areas of an image. Figure 5 As shown, Figure 5 It is a schematic diagram of the overall process of the white balance adjustment method of the present application. During the implementation process, the white balance processing method can be encapsulated in the white balance correction module, the color cast judgment method can be encapsulated in the image color cast feedback module, and the mixed color temperature area identification and judgment method can be encapsulated in the mixed color temperature judgment feedback module.
[0086] Exemplarily, in the specific implementation process of the overall method of the present application, the white balance correction module is used to adjust the white balance of the acquired raw data; the image color cast feedback module is used to verify the color cast of the adjusted raw data (equivalent to the RGB data output by the image acquisition device, which is converted into the HSV space), and the color cast verification result is fed back to the system of the image acquisition device (such as the camera system) to update its color cast flag; the mixed color temperature judgment feedback module is used to identify and judge the mixed color temperature of the unbiased image, and if there is a mixed color temperature, ct_mat is constructed and converted into a size matching the raw data and then fed back to the white balance correction module, so that the white balance correction module can perform white balance processing on the new image according to the latest ct_mat when continuing to acquire a new image, thereby avoiding the problem of image color cast for a long time.
[0087] It should be further explained that the execution subject of the white balance adjustment method may be a white balance adjustment device, for example, the white balance adjustment method may be executed by a terminal device or a server or other processing device, wherein the terminal device may be a user equipment (UE), a computer, a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the white balance adjustment method may be implemented by a processor calling a computer-readable instruction stored in a memory.
[0088] Figure 6 FIG. 1 is a block diagram of a white balance adjustment device shown in an exemplary embodiment of the present application. Figure 6 As shown, the exemplary white balance adjustment device 600 includes: a first segmentation module 610, a second segmentation module 620, a marking module 630 and a white balance processing module 640. Specifically:
[0089] The first segmentation module 610 is used to perform image segmentation processing on the image to be identified according to the acquired saturation information of the image to be identified, so as to obtain a target area in the image to be identified.
[0090] The second segmentation module 620 is used to perform adaptive segmentation processing on the target area according to the brightness information of the target area in the image to be identified, so as to obtain target sub-areas.
[0091] The marking module 630 is used to mark the color temperature of each target sub-region according to the hue information of the target sub-region to obtain a mixed color temperature region segmentation standard.
[0092] The white balance processing module 640 is used to perform image white balance processing based on the mixed color temperature area segmentation standard.
[0093] In this exemplary white balance adjustment device, by utilizing the color attributes of the image, the target area in the image to be identified is obtained according to the saturation information of the image to be identified, the target sub-area in the target area is obtained according to the brightness information of the target area, and the color temperature of each target sub-area is marked according to the hue information of the target sub-area, thereby determining the mixed color temperature area in the image to be identified and obtaining the mixed color temperature area segmentation standard; performing image white balance processing by using the mixed color temperature area segmentation standard can more accurately judge the mixed color temperature area during the image white balance process, thereby improving the white balance processing effect and optimizing the image quality.
[0094] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0095] The functions of each module can be found in the embodiment of the white balance adjustment method, which will not be described in detail here.
[0096] See also Figure 7 , Figure 7 7 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 700 includes a memory 701 and a processor 702, and the processor 702 is used to execute the program instructions stored in the memory 701 to implement the steps in any of the above white balance adjustment method embodiments. In a specific implementation scenario, the electronic device 700 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 700 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0097] Specifically, the processor 702 is used to control itself and the memory 701 to implement the steps in any of the above-mentioned white balance adjustment method embodiments. The processor 702 can also be called a CPU (Central Processing Unit). The processor 702 may be an integrated circuit chip with signal processing capabilities. The processor 702 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 702 can be implemented by an integrated circuit chip.
[0098] In this exemplary electronic device, by utilizing the color attributes of the image, the target area in the image to be identified is obtained according to the saturation information of the image to be identified, the target sub-area in the target area is obtained according to the brightness information of the target area, and the color temperature of each target sub-area is marked according to the hue information of the target sub-area, thereby determining the mixed color temperature area in the image to be identified and obtaining the mixed color temperature area segmentation standard; image white balance processing is performed by using the mixed color temperature area segmentation standard, so that the mixed color temperature area can be judged more accurately during the image white balance process, thereby improving the white balance processing effect and optimizing the image quality.
[0099] See also Figure 8 , Figure 8 The computer-readable storage medium 810 stores program instructions 811 that can be executed by a processor, and the program instructions 811 are used to implement the steps in any of the above-mentioned white balance adjustment method embodiments.
[0100] In this exemplary storage medium, by running program instructions in the storage medium and utilizing the color attributes of the image, a target area in the image to be identified is obtained according to the saturation information of the image to be identified, a target sub-area in the target area is obtained according to the brightness information of the target area, and the color temperature of each target sub-area is marked according to the hue information of the target sub-area, thereby determining the mixed color temperature area in the image to be identified and obtaining the mixed color temperature area segmentation standard; performing image white balance processing by using the mixed color temperature area segmentation standard can more accurately judge the mixed color temperature area during the image white balance process, thereby improving the white balance processing effect and optimizing the image quality.
[0101] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0102] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0103] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0104] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
Claims
1. A white balance adjustment method, characterized in that: The method comprises: Performing image segmentation processing on the image to be identified according to the acquired saturation information of the image to be identified, so as to obtain a target area in the image to be identified; According to the brightness information of the target area in the image to be identified, the target area is adaptively segmented to obtain a target sub-area; Marking each target sub-region with a color temperature according to the hue information of the target sub-region to obtain a mixed color temperature region segmentation standard; Image white balance processing is performed based on the mixed color temperature area segmentation standard.
2. The method according to claim 1, characterized in that The target sub-region includes a first target sub-region and a second target sub-region, and the step of marking each target sub-region with a color temperature according to the hue information of the target sub-region to obtain a mixed color temperature region segmentation standard includes: Calculating a hue difference between the first target sub-region and the second target sub-region based on a hue mean value of the first target sub-region and a hue mean value of the second target sub-region; If the hue difference between the first target sub-region and the second target sub-region is greater than a preset hue difference threshold, the first target sub-region and the second target sub-region are marked respectively to obtain the mixed color temperature region segmentation standard.
3. The method according to claim 2, characterized in that The step of calculating the hue difference between the first target sub-region and the second target sub-region based on the hue mean value of the first target sub-region and the hue mean value of the second target sub-region comprises: If the area of the first target sub-region and the area of the second target sub-region are both greater than a preset target sub-region area threshold, and the area difference between the first target sub-region and the second target sub-region is less than a preset area difference threshold, determining a first hue mean of the first target sub-region based on the hue value of each pixel in the first target sub-region, and determining a second hue mean of the second target sub-region based on the hue value of each pixel in the second target sub-region; A difference calculation is performed on the first hue mean value and the second hue mean value to obtain a hue difference between the first target sub-region and the second target sub-region.
4. The method according to claim 1, characterized in that: The step of performing image segmentation processing on the image to be identified according to the acquired saturation information of the image to be identified to obtain the target area in the image to be identified includes: Based on the saturation information of the image to be identified, selecting a candidate region whose saturation is less than a preset saturation threshold in the image to be identified; Eliminate the areas in the candidate regions whose areas are smaller than a preset candidate region area threshold to obtain the remaining areas; If the area of the remaining region is greater than a preset remaining area threshold, the remaining region is determined as the target region.
5. The method according to claim 1, characterized in that Before the step of performing image segmentation processing on the image to be identified according to the acquired saturation information of the image to be identified to obtain the target area in the image to be identified, the method further includes: Performing color cast verification on the acquired image to be verified to obtain a color cast verification result of the image to be verified; If the color cast verification result indicates that the image to be verified has color cast, then stopping subsequent processing of the image to be verified; If the color cast verification result indicates that the image to be verified has no color cast, the image to be verified is used as the image to be identified.
6. The method according to claim 5, characterized in that The image to be verified is subjected to white balance processing. After the step of performing color cast verification on the acquired image to be verified to obtain a color cast verification result of the image to be verified, the method further includes: Each time a color cast verification result for indicating that the image to be verified is not color casted is obtained, the preset number of times of no color cast is accumulated and calculated, until a color cast verification result for indicating that the image to be verified is color casted is obtained, then the accumulation and calculation of the number of times of no color cast is suspended; adjusting the processing frequency of the white balance processing based on the number of uncolored-out times, wherein the number of uncolored-out times and the processing frequency are negatively correlated; If the adjusted processing frequency is lower than a preset frequency threshold, the number of times of no color cast is reduced.
7. The method according to claim 5, characterized in that The step of performing color cast verification on the acquired image to be verified to obtain a color cast verification result of the image to be verified includes: Obtaining a saturation mean value and / or a hue standard deviation of the image to be verified; If the saturation mean is greater than the right boundary of the preset saturation interval, and / or the hue standard deviation is less than the left boundary of the preset hue standard deviation interval, a color cast verification result for characterizing the color cast of the image to be verified is obtained; If the saturation mean is smaller than the left boundary of the saturation interval, and / or the hue standard deviation is larger than the right boundary of the hue standard deviation interval, a color cast verification result is obtained for indicating that the image to be verified is not color cast.
8. The method according to claim 5, characterized in that The step of performing color cast verification on the acquired image to be verified to obtain a color cast verification result of the image to be verified includes: Obtaining a saturation mean value and / or a hue standard deviation of the image to be verified; If the saturation mean is within the saturation range, and / or the hue standard deviation is within the hue standard deviation range, the image to be verified is compared with a preset template image to obtain a color difference value between the image to be verified and the template image; If the color difference value is greater than a preset color difference threshold, a color cast verification result for characterizing the color cast of the image to be verified is obtained; If the color difference value is less than or equal to the color difference threshold, a color cast verification result is obtained, which is used to indicate that the image to be verified is not color cast.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
