Image white balance adjusting method and device and electronic equipment

By calculating the color mean and deviation ratio values of the image channel, and updating the image pixel value in combination with the gain value and constraint ratio values, the problem of inaccurate image color correction in the traditional white balance method is solved, and the image color balance and natural correction are achieved.

CN120302170APending Publication Date: 2025-07-11WONDERSHARE TECH (HUNAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510380216.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

Traditional white balance adjustment methods are difficult to accurately correct image color, resulting in deviations from the real color of the object.

Method used

By calculating the color mean and deviation ratio values of each channel of the image, calculating the gain value, and updating the image pixel value in combination with the constraint ratio values to achieve accurate white balance correction.

Benefits of technology

Improve the authenticity and visual expressiveness of image colors to ensure that the corrected image colors are natural and there is no over-correction or insufficient correction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120302170A_ABST
    Figure CN120302170A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image white balance adjustment method. The image white balance adjustment method comprises the following steps of calculating a deviation value and a deviation proportion value of a pixel mean value of each channel of a three-channel image relative to the pixel mean value of the three channels; calculating a gain value of the three-channel image according to the deviation value and the deviation proportion value; and updating the initial pixel values of the three channels of the image according to the gain values. According to the image white balance adjustment method provided by the embodiment of the invention, the color mean value of each channel of the image is calculated, and the image pixels are updated according to the mean value deviation and proportion, so that image white balance correction is accurately carried out. The embodiment of the invention further provides an image white balance adjusting device and electronic equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology. Specifically, the embodiments of the present application relate to an image white balance adjustment method, device, and electronic device. Background Art

[0002] White balance is a key concept in color science and photography technology, aiming to restore the true color of an object in an image. In color science, white refers to a light state where the proportions of blue, green, and red light are the same and the brightness is moderate. However, due to the change in the color temperature of the light source and the deviation of the color channel gain of the camera, the color of the image often deviates from the true color of the object. Color temperature is an important parameter for describing the color of a light source, measured in Kelvin. The higher the color temperature, the bluer the light color; the lower the color temperature, the redder the light color. White balance processing corrects the white part in the image to remove the influence of the external light source color temperature, so that the image shows the true color of the object.

[0003] Then, traditional white balance adjustment methods often rely on experience or simple color transformations and are difficult to accurately correct the color of an image. Summary of the Invention

[0004] In view of the problems existing in the above-mentioned prior art, the embodiments of the present application provide an image white balance adjustment method, device, and electronic device. By calculating the color mean values of each channel of the image and updating the image pixels according to the mean deviation and ratio, accurate image white balance correction can be achieved.

[0005] In a first aspect, the embodiments of the present application provide an image white balance adjustment method, including the following steps:

[0006] Calculating the deviation value and deviation ratio value of the pixel mean value of each channel of the three-channel image relative to the pixel mean values of the three channels;

[0007] Calculating the gain value of the three-channel image according to the deviation value and the deviation ratio value; and

[0008] Updating the initial pixel values of the three channels of the image according to the gain value.

[0009] Further, after calculating the gain value of the three-channel image according to the deviation value and the deviation ratio value, the method further includes:

[0010] Obtaining a constraint ratio value that is inversely proportional to the initial pixel values of the three channels of the image; and

[0011] Updating the initial pixel values of the three channels of the image according to the gain value and the constraint ratio value.

[0012] Further, the constraint ratio value is between 0 and 1.

[0013] Further, before calculating the deviation value and deviation ratio value of the pixel mean of each channel of the three-channel image with respect to the pixel mean of the three channels, it includes:

[0014] Obtain the average pixel value of each channel of the image;

[0015] According to the average pixel value of each channel of the image, calculate the average pixel value of the three channels of the image.

[0016] Further, before obtaining the average pixel value of each channel of the image, it further includes:

[0017] Convert the image into a three-channel image.

[0018] Further, when the number of images is multiple, after calculating the gain value of the three-channel image according to the deviation value and the deviation ratio value, it further includes:

[0019] Calculate the average gain value of the multiple images; and

[0020] According to the average gain value, update the initial pixel values of the three channels of the multiple images.

[0021] Further, calculating the average gain value of the multiple images includes:

[0022] Calculate the gain value of each image; and

[0023] According to the gain value of each image, perform an arithmetic mean calculation to obtain the average gain value of the multiple images.

[0024] In a second aspect, an image white balance adjustment device provided by an embodiment of the present application includes:

[0025] A deviation value calculation module, configured to calculate the deviation value and deviation ratio value of the pixel mean of each channel of the three-channel image with respect to the pixel mean of the three channels;

[0026] A gain value calculation module, configured to calculate the gain value of the three-channel image according to the deviation value and the deviation ratio value; and

[0027] A pixel update module, configured to update the initial pixel values of the three channels of the image according to the gain value.

[0028] In a third aspect, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. The processor is configured to implement the image white balance adjustment method according to the first aspect described above when executing the program.

[0029] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program is used to implement the image white balance adjustment method according to the first aspect described above.

[0030] The embodiments of the present application bring the following beneficial effects:

[0031] In the image white balance adjustment method provided by the embodiments of the present application, first, the deviation value and its ratio of the pixel mean of each channel of the three-channel image (red, green, blue) to the overall pixel mean are calculated to quantify the difference between each channel and the overall color balance. Then, using the obtained deviation value and ratio, the gain value of each channel is further calculated. The gain value is used as an adjustment parameter to correct the color deviation and achieve color balance. Finally, according to the calculated gain value, the initial pixel values of the three channels of the image are updated to complete color correction. The image white balance adjustment method of the embodiments of the present application effectively realizes the balance and correction of image colors by accurately calculating and updating the pixel values of the image channels, not only improving the authenticity of image colors but also enhancing the visual expressiveness of the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on the structures shown in these drawings.

[0033] Figure 1 It is a schematic flowchart of the image white balance adjustment method provided by the embodiments of the present application;

[0034] Figure 2 It is a block diagram of the structure of the image white balance adjustment device provided by the embodiments of the present application;

[0035] Figure 3 It is a schematic diagram of the structure of the electronic device provided by the embodiments of the present application.

[0036] The realization, functional features, and advantages of the purpose of the present application will be further described in conjunction with the embodiments with reference to the drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0037] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present application.

[0038] In the description and claims of the present application and the above-mentioned accompanying drawings, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, unless otherwise stated, the meaning of "a plurality" is two or more. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific circumstances.

[0039] Refer to Figure 1 , Figure 1 is a flowchart framework of the image white balance adjustment method according to the embodiments of the present application. As Figure 1 shown, the image white balance adjustment method in the embodiments of the present application includes the following steps:

[0040] S101: Calculate the deviation value and deviation ratio value of the pixel mean of each channel of the three-channel image relative to the pixel mean of the three channels;

[0041] S102: Calculate the gain value of the three-channel image according to the deviation value and the deviation ratio value; and

[0042] S103: Update the initial pixel values of the three channels of the image according to the gain value.

[0043] In the image white balance adjustment method provided in the embodiments of the present application, first, calculate the deviation value and its ratio of the pixel mean of each channel of the three-channel image (red, green, blue) to the overall pixel mean, so as to quantify the difference between each channel and the overall color balance. Then, use the obtained deviation value and ratio to further calculate the gain value of each channel. The gain value is used as an adjustment parameter to correct the color deviation and achieve color balance. Finally, update the initial pixel values of the three channels of the image according to the calculated gain value to complete color correction.

[0044] To sum up, the image white balance adjustment method in the embodiments of the present application effectively realizes the balance and correction of image colors by accurately calculating and updating the pixel values of the image channels, not only improving the authenticity of image colors, but also enhancing the visual expressiveness of the image.

[0045] Further, in some embodiments of the present application, after calculating the gain value of the three-channel image according to the deviation value and the deviation ratio value, the following steps are further included:

[0046] Obtain a constraint ratio value that is inversely proportional to the initial pixel values of the three channels of the image; and

[0047] Update the initial pixel values of the three channels of the image according to the gain value and the constraint ratio value.

[0048] Specifically, after calculating the gain value of the three-channel image according to the deviation value and the deviation ratio value, the image white balance adjustment method of the embodiments of the present application further adds the following steps to further optimize the image color correction process: First, obtain a constraint ratio value that is inversely proportional to the initial pixel values of the three channels of the image to introduce an adjustment factor related to the pixel value size, so as to ensure that when adjusting the gain value, the change of the pixel value can be kept within a reasonable range and avoid overcorrection or undercorrection. Then, update the initial pixel values of the three channels of the image according to the calculated gain value and the obtained constraint ratio value. Therefore, the image white balance adjustment method of the embodiments of the present application combines the gain value and the constraint ratio value to achieve precise correction of the image color. By comprehensively considering the gain value and the constraint ratio value, it can be ensured that the color of the corrected image is both real and natural, while avoiding excessive change of the pixel value. The image white balance adjustment method of the embodiments of the present application adds the acquisition and application of the constraint ratio value on the original basis, further optimizes the image color correction process, and improves the accuracy and effect of the correction.

[0049] Further, in some embodiments of the present application, the constraint ratio value is between 0 and 1. By introducing a constraint ratio value between 0 and 1, the image white balance adjustment method of the embodiments of the present application can more finely control the color correction process, improve the accuracy and effect of the correction, and at the same time maintain the natural and realistic sense of the image.

[0050] Further, in some embodiments of the present application, before calculating the deviation value and the deviation ratio value of the pixel mean value of each channel of the three-channel image relative to the pixel mean value of the three channels, the following steps are included:

[0051] Obtain the average pixel value of each channel of the image;

[0052] Calculate the average pixel value of the three channels of the image according to the average pixel value of each channel of the image.

[0053] Specifically, before calculating the deviation value and deviation ratio value of the pixel mean of each channel of the three-channel image with respect to the pixel mean of the three channels, first, obtain the average pixel value of each channel of the image. This step is the basis for subsequent calculations. It involves averaging the pixel values of each color channel (red, green, blue) to obtain an average value representing the overall brightness of the channel.

[0054] Next, based on the average pixel value of each channel of the image, further calculate the average pixel value of the three channels of the image. This step is to summarize or average the average pixel values of the three color channels to obtain an average value representing the overall brightness of the entire image. This overall average value will be used as a reference benchmark for subsequent calculations of the deviation value and deviation ratio value.

[0055] After completing the above steps, it is possible to enter the stage of calculating the deviation value and deviation ratio value mentioned before. By comparing the difference between the average pixel value of each channel and the overall average pixel value, the degree of color deviation of each channel can be quantified, thereby providing a basis for subsequent calculation of the gain value and color correction.

[0056] In summary, before formally performing color correction, the image white balance adjustment method of the embodiment of the present application needs to first obtain the average pixel value of each channel of the image and calculate the average pixel value of the three channels to ensure the accuracy and effectiveness of subsequent steps.

[0057] Furthermore, in some embodiments of the present application, before obtaining the average pixel value of each channel of the image, it further includes:

[0058] Convert the image into a three-channel image.

[0059] That is, it is necessary to decompose the original image (which may be in RGB, CMYK or other color space formats) into three independent color channel images: the red channel, the green channel, and the blue channel. This is the basis for subsequent color analysis and correction. Because only by decomposing the image into separate color channels can the pixel values of each channel be analyzed and processed independently. For example, if the current input original image is a 4-channel image, namely BGRA, where the A channel is the transparent channel of the image, then in subsequent processing, it is necessary to first separate the A channel and convert the BGRA four-channel image into a BGR three-channel image.

[0060] After completing this step, it is possible to enter the stage of obtaining the average pixel value of each channel. By averaging the pixel values of each color channel, an average value representing the overall brightness of the channel can be obtained, and this average value will be used for subsequent color deviation analysis and gain value calculation.

[0061] Before the color correction process officially starts, the image white balance adjustment method provided by the embodiments of the present application needs to first convert the image into a three-channel image and obtain the average pixel value of each channel to ensure the accuracy and effectiveness of subsequent steps.

[0062] Further, in some embodiments of the present application, when the number of the images is multiple, after calculating the gain value of the three-channel image according to the deviation value and the deviation ratio value, the method further includes:

[0063] Calculating the average gain value of the multiple images; and

[0064] Updating the initial pixel values of the three channels of the multiple images according to the average gain value.

[0065] When the image to be processed is generated from a video, at this time, the number of images is multiple. First, it is necessary to calculate the average gain value of the multiple images, that is, to summarize the gain values calculated for each image and find their average value. By calculating the average gain value, a gain parameter representing the overall color correction requirements of the multiple images can be obtained, and this parameter will be used for subsequent unified color correction of the multiple images. Then, according to the calculated average gain value, the initial pixel values of the three channels of the multiple images are updated. That is, the average gain value is applied to each color channel of each image to achieve color correction of the multiple images. By uniformly using the average gain value for correction, the color consistency between multiple images can be ensured, and obvious color differences between images can be avoided.

[0066] Further, in some embodiments of the present application, the calculating the average gain value of the multiple images includes:

[0067] Calculating the gain value of each image; and

[0068] Performing arithmetic mean calculation according to the gain value of each image to obtain the average gain value of the multiple images.

[0069] Specifically, first, for each image, the gain value is independently calculated according to the deviation value and the deviation ratio value calculated in the previous steps to ensure that each image obtains a personalized gain value according to its own color deviation situation.

[0070] Then, according to the gain values calculated for each image, arithmetic mean calculation is performed to obtain the average gain value of the multiple images. Arithmetic mean calculation is to add up the gain values of all images and then divide by the total number of images, and the result obtained is the average gain value. This average gain value represents the common requirements of all images in terms of color correction and is the basis for subsequent unified color correction of the multiple images.

[0071] Through this process, the image white balance adjustment method according to the embodiments of the present application can ensure that when processing multiple images, both the color deviation of each image is considered and the color consistency correction between multiple images is achieved.

[0072] For example, in an embodiment of the present application, the image white balance adjustment method provided by the present application includes the following steps:

[0073] 1. Input an image as the original image, denoted as src.

[0074] 2. If the current image is in a format other than the BGR three-channel image, such as the BGRA four-channel image, perform image format conversion to convert the image into a BGR three-channel image.

[0075] 3. Calculate the color mean of each channel in the current BGR three-channel image, denoted as bMean, gMean, and rMean respectively.

[0076] 4. Calculate the average value of the three channels, denoted as kMean = (bMean + gMean + rMean) / 3.

[0077] 5. Calculate the deviation of the average value of each channel compared to kMean, denoted as: offset_b = kMean - bMean, offset_g = kMean - gMean, offset_r = kMean - rMean.

[0078] 6. Calculate the deviation ratio value of the average value of each channel compared to kMean, denoted as: kb = bMean / kMean, kg = gMean / kMean, kr = rMean / kMean.

[0079] 7. Calculate the gain value that the final pixel needs to be updated through the above deviation values and deviation ratio values: gain_b = offset_b * kb, gain_g = offset_g * kg, gain_r = offset_r * kr.

[0080] Perform an update operation on each pixel value of the original input image: Obtain the BGR color values of each pixel value, denoted as b, g, and r respectively; Calculate the BGR color values of the updated pixel value, denoted as b_new, g_new, and r_new respectively; Calculate the constraint ratio values according to the BGR three-channel values of each pixel: ratio_b = 1.0 - b / 255.0, ratio_g = 1.0 - g / 255.0, ratio_r = 1.0 - r / 255.0; Update the pixel value according to the gain value and the constraint ratio value: b_new = gain_b * ratio_b + b, g_new = gain_g * ratio_g + g, r_new = gain_r * ratio_r + r.

[0081] If processing a video, calculate the corresponding parameters according to the above steps in the first frame and apply them to each subsequent frame, or calculate the average of the gain values for all video image frames and apply it to the entire video.

[0082] Figure 2 It is a structural block diagram of the image white balance adjustment device 200 provided by an embodiment of the present application. As Figure 2 shown, the image white balance adjustment device 200 of the embodiment of the present application includes: a deviation value calculation module 210, a gain value calculation module 220, and a pixel update module 230, where:

[0083] The deviation value calculation module 210 is used to calculate the deviation value and the deviation ratio value of the pixel mean value of each channel of the three-channel image relative to the pixel mean value of the three channels;

[0084] The gain value calculation module 220 is used to calculate the gain value of the three-channel image according to the deviation value and the deviation ratio value; and

[0085] The pixel update module 230 is used to update the initial pixel values of the three channels of the image according to the gain value.

[0086] In the image white balance adjustment device provided by the embodiment of the present application, first calculate the deviation value and its ratio of the pixel mean value of each channel of the three-channel image (red, green, blue) to the overall pixel mean value, so as to quantify the difference between each channel and the overall color balance. Then, use the obtained deviation value and ratio to further calculate the gain value of each channel. The gain value is used as an adjustment parameter to correct the color deviation and achieve color balance. Finally, update the initial pixel values of the three channels of the image according to the calculated gain value to complete color correction. The image white balance adjustment device of the embodiment of the present application effectively realizes the balance and correction of the image color by accurately calculating and updating the pixel values of the image channels, not only improving the authenticity of the image color, but also enhancing the visual expressiveness of the image.

[0087] It should be noted that the specific implementation of the image white balance adjustment device in the embodiments of the present application is similar to that of the image white balance adjustment method in the embodiments of the present application. For specific details, please refer to the description in the method section, and will not be elaborated here.

[0088] Figure 3 It is a schematic structural diagram of an electronic device 300 according to an embodiment of the present application.

[0089] As Figure 3 shown, the electronic device 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage section 302 into the random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The CPU 301, ROM 302, and RAM 303 are connected to each other via a bus 304. The input / output (I / O) interface 305 is also connected to the bus 304.

[0090] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as required. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as required, so that a computer program read from it can be installed into the storage section 308 as required.

[0091] Specifically, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 309, and / or installed from the removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, the above functions defined in the electronic device of the present application are executed.

[0092] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electronic device, apparatus, or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0093] In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction-executing electronic device, apparatus, or device. And in this application, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction-executing electronic device, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0094] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of a processing receiving device, method, and computer program product according to various embodiments of this application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the foregoing module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based electronic device for performing the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0095] The units or modules involved in the embodiments of the present application can be implemented in software or in hardware. The described units or modules can also be provided in a processor, and when the processor executes the program, it implements the method for adjusting the image white balance:

[0096] Calculate the deviation value and the deviation ratio value of the pixel mean of each channel of the three-channel image relative to the pixel mean of the three channels;

[0097] Calculate the gain value of the three-channel image according to the deviation value and the deviation ratio value; and

[0098] Update the initial pixel values of the three channels of the image according to the gain value.

[0099] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist alone without being assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the above-mentioned programs are executed by one or more processors, they implement the method for adjusting the image white balance described in the present application:

[0100] Calculate the deviation value and the deviation ratio value of the pixel mean of each channel of the three-channel image relative to the pixel mean of the three channels;

[0101] Calculate the gain value of the three-channel image according to the deviation value and the deviation ratio value; and

[0102] Update the initial pixel values of the three channels of the image according to the gain value.

[0103] As another aspect, the present application also provides a computer program product, which may be included in the electronic device described in the above embodiments; or may exist alone without being assembled into the electronic device. The above computer program product stores one or more programs, and when the above-mentioned programs are executed by one or more processors, they implement the method for adjusting the image white balance described in the present application:

[0104] Calculate the deviation value and the deviation ratio value of the pixel mean of each channel of the three-channel image relative to the pixel mean of the three channels;

[0105] Calculate the gain value of the three-channel image according to the deviation value and the deviation ratio value; and

[0106] Update the initial pixel values of the three channels of the image according to the gain value.

[0107] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structural transformation made under the application concept of the present application by using the content of the specification and drawings of the present application, or directly / indirectly applied in other related technical fields, is included in the patent protection scope of the present application.

Claims

1. An image white balance adjustment method, characterized in that, Comprising the following steps: Calculating the deviation value and deviation ratio value of the pixel mean of each channel of the three-channel image with respect to the pixel mean of the three channels; Calculating the gain value of the three-channel image according to the deviation value and the deviation ratio value; and Updating the initial pixel values of the three channels of the image according to the gain value.

2. The image white balance adjustment method according to claim 1, wherein After calculating the gain value of the three-channel image according to the deviation value and the deviation ratio value, further comprising: Obtaining a constraint ratio value inversely proportional to the initial pixel values of the three channels of the image; and Updating the initial pixel values of the three channels of the image according to the gain value and the constraint ratio value.

3. The image white balance adjustment method according to claim 2, wherein The constraint ratio value is between 0 and 1.

4. The image white balance adjustment method according to claim 1, characterized in that, Before calculating the deviation value and deviation ratio value of the pixel mean of each channel of the three-channel image with respect to the pixel mean of the three channels, comprising: Obtaining the average pixel value of each channel of the image; Calculating the average pixel value of the three channels of the image according to the average pixel value of each channel of the image.

5. The image white balance adjustment method according to claim 4, wherein, Before obtaining the average pixel value of each channel of the image, further comprising: Converting the image into a three-channel image.

6. The image white balance adjustment method according to claim 1, wherein When the number of images is multiple, after calculating the gain value of the three-channel image according to the deviation value and the deviation ratio value, further comprising: Calculating the average gain value of the multiple images; and Updating the initial pixel values of the three channels of the multiple images according to the average gain value.

7. The image white balance adjustment method according to claim 6, characterized in that The calculating the average gain value of the multiple images comprises: Calculating the gain value of each image; and Performing arithmetic mean calculation according to the gain value of each image to obtain the average gain value of the multiple images.

8. An image white balance adjustment device, characterized in that, Comprising: A deviation value calculation module, configured to calculate the deviation value and deviation ratio value of the pixel mean of each channel of the three-channel image with respect to the pixel mean of the three channels; A gain value calculation module, configured to calculate the gain value of the three-channel image according to the deviation value and the deviation ratio value; and A pixel update module, configured to update the initial pixel values of the three channels of the image according to the gain value.

9. An electronic device, characterized in that, Comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor is used to implement the image white balance adjustment method according to any one of claims 1-7 when executing the program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program is used to implement the image white balance adjustment method according to any one of claims 1-7.