Multi-light-source-oriented image white balance correction method, device, equipment and storage medium
By calculating the influence weight and adaptability of light sources on images under multi-light source environments, and performing white balance correction as an equivalent light source, the problem of color reproduction deviating from human visual perception under multi-light source environments is solved, and the consistency between image correction and human visual perception is achieved.
Patent Information
- Application Number
- CN202211321442.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-06-30
- Filing Date
- 2022-10-26
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-10-26
AI Technical Summary
Existing white balance algorithms are mainly designed for single-light source environments and cannot effectively handle the influence of the spatial distribution of light source color and brightness distribution on the adaptation state in multi-light source environments, resulting in color reproduction results that deviate from human visual perception.
By calculating the influence weight of ambient light sources at different locations on each pixel position of the image, and based on the equivalent multiple light sources of the cone cell response value as an equivalent light source, the gain coefficient is calculated for image white balance correction. The degree of adaptation of factors such as light source color, brightness and size is considered, and chromaticity conversion is performed using the camera characteristic matrix and the cone response transformation matrix.
It achieves consistency between image white balance correction results and human visual perception in multi-light source environments, avoids color deviation, and is applicable to a variety of imaging electronic devices.
Smart Images

Figure CN115988335B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of camera white balance correction technology, specifically to an image white balance correction method, apparatus, device, and storage medium for multi-light source images. Background Technology
[0002] The human visual system possesses the ability to adapt to color, adjusting the sensitivity curve of cone cells according to the color and brightness of the light environment to maintain the relative stability of object color under different light sources. In the signal processing flow of a digital camera, the white balance module serves as the color adaptation reference light source, adjusting the target light source to ensure that the white balance-corrected image matches the human eye's visual perception of the real scene. The camera's white balance correction algorithm includes light source estimation and color adaptation adjustment: based on image color information, the light source estimation module predicts the color and brightness of the light source in the adaptive environment; based on the predicted light source information, the color adaptation adjustment module calculates the gain coefficient for each channel and uses this coefficient to independently and linearly adjust the three-channel response values of the original image.
[0003] Unlike an ideal single-light source environment, a real adaptive environment may contain multiple different light sources. However, current white balance algorithms are mainly designed for single-light source adaptive environments. For complex adaptive fields with multiple light sources, the color adaptation adjustment method in white balance algorithms faces a series of problems and challenges: (1) The influence of the spatial distribution of light source color on the adaptation state is unknown. Under the theoretical framework of the Worcester color adaptation transformation, the test light source used to calculate the gain coefficient is the estimated ambient light source. However, for multi-light source environments, current white balance algorithms do not consider the mutual influence between different light sources, so the calculation method for the test light source is still unknown; (2) Existing white balance algorithms assume that the human eye has reached a state of complete adaptation and do not consider the influence of factors such as the color spatial distribution, brightness spatial distribution, and adaptation field size of multi-light source environments on the degree of adaptation, resulting in color reproduction results deviating from human eye perception. Summary of the Invention
[0004] In view of this, embodiments of this application provide an image white balance correction method, apparatus, device, and storage medium for multi-light source environments, which can be applied to multi-light source environments.
[0005] In a first aspect, one embodiment of this application provides an image white balance correction method for multiple light sources, the specific steps of which include:
[0006] Calculate the influence weight of ambient light sources at different locations on the position of each pixel in the captured image. Based on the influence weight and the cone cell response values of multiple light sources, calculate the equivalent light source cone cell response value equivalent to the multiple light sources.
[0007] calculating an influence factor of the equivalent light source on each pixel position of the image, and calculating an adaptation degree of the equivalent light source based on the influence factor;
[0008] calculating a gain coefficient of each cone channel based on the adaptation degree, the cone response value of the equivalent light source and the reference light source;
[0009] calculating a corresponding color of the captured image under the reference light source by using the gain coefficient, converting the corresponding color into an RGB output of the corrected image, and realizing the white balance correction of the captured image.
[0010] Optionally, an influence weight of different position light sources on each pixel position of the captured image is set based on an actual distance corresponding to adjacent pixels of the image, a horizontal direction Gaussian distribution function and a vertical direction Gaussian distribution function.
[0011] Optionally, for a certain pixel (i, j) in the captured image, the influence weight is set as w s (m, n, i, j):
[0012]
[0013] wherein d0 is an actual distance corresponding to adjacent pixels of the image; σ and k are to-be-determined constants of a horizontal direction Gaussian distribution curve and a vertical direction Gaussian distribution curve respectively, (m, n) is a spatial coordinate of the light source, M and N represent pixel numbers of the image in horizontal and vertical directions respectively, 0≤i≤M, 0≤j≤N;
[0014] obtaining the cone response value of the multi-light source based on a characteristic matrix of the image acquisition device and a cone response transformation matrix calculating the equivalent light source cone response value of the pixel (i, j) based on the influence weight and the cone response value of the multi-light source is:
[0015]
[0016] Optionally, the calculation of the influence factor of the equivalent light source on each pixel position of the image and the calculation of the adaptation degree of the equivalent light source based on the influence factor are as follows:
[0017] calculating a chroma factor and a brightness factor of the equivalent light source on each pixel of the image, calculating a scale factor of the equivalent light source, and taking a product of the chroma factor, the brightness factor and the scale factor as the adaptation degree of the equivalent light source.
[0018] Optionally, the calculation of the gain coefficient of each cone channel based on the adaptation degree, the cone response value of the equivalent light source and the reference light source is as follows:
[0019]
[0020] wherein, is the cone response value of the reference light source, is the cone response value of the equivalent light source, and D(i,j) is the adaptation degree of the equivalent light source.
[0021] Optionally, the corresponding color of the photographed image under the reference light source is calculated by using the gain coefficient as follows:
[0022] Based on the characterization matrix of the image acquisition device and the cone response transformation matrix, the cone response value of the photographed image is obtained, the gain coefficient is multiplied by the cone response value of the photographed image, and the corresponding color of the photographed image under the reference light source is calculated.
[0023]
[0024] wherein, is the cone response value of the corresponding color of the pixel point with coordinates (i,j) in the photographed image under the reference light source, is the cone response value of the pixel point with coordinates (i,j) in the photographed image;
[0025] The RGB of the corresponding color of the photographed image is converted into the RGB of the corrected image as follows:
[0026] The cone response value of the corresponding color of the photographed image under the reference light source is converted back to the RGB space of the camera by using the inverse matrix of the cone response transformation and the inverse matrix of the camera characterization as follows:
[0027]
[0028] wherein, A -1 is the inverse matrix of the camera characterization, is the inverse matrix of the cone response transformation.
[0029] Optionally, the reference light source is an equal-energy white light source, the three stimulus values of which are scaled so that the brightness thereof is the same as that of the equivalent light source at the corresponding position, the three stimulus values of the reference light source are obtained, and the cone response value thereof is converted by using the cone response transformation matrix.
[0030] In a second aspect, an embodiment of the present application provides an image white balance correction device for multiple light sources, which comprises an equivalent light source module, an adaptation degree module, a gain coefficient module, and a correction module.
[0031] The equivalent light source module is configured to calculate the influence weight of different position environment light sources on each pixel position in the photographed image, and calculate the equivalent light source cone response value equivalent to the multiple light sources based on the influence weight and the cone response value of the multiple light sources.
[0032] an adaptation degree module, configured to calculate an influence factor of the equivalent light source on each pixel position on the image, and calculate an adaptation degree of the equivalent light source based on the influence factor;
[0033] a gain coefficient module, configured to calculate a gain coefficient of each cone channel based on the adaptation degree, the cone cell response value of the equivalent light source and the reference light source;
[0034] a correction module, configured to calculate corresponding colors of the captured image under the reference light source by using the gain coefficient, and realize white balance correction of the captured image.
[0035] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements steps of any of the above methods when executing the computer program.
[0036] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores computer program instructions, and the computer program instructions are executed by a processor to implement steps of any of the above methods.
[0037] Advantages
[0038] Firstly, the embodiment of the present application sets an influence weight of each pixel in the captured image corresponding to the multiple light sources based on position information of the multiple light sources, and equivalently converts the multiple light sources into one equivalent light source by using the influence weight, so that the method can be applied to a case where the environment has multiple light sources.
[0039] Secondly, the embodiment of the present application simulates the influence weight of the light source at different positions on the equivalent light source by using a two-dimensional space Gaussian distribution function based on a research result that the color adaptation state is mainly affected by the central field of view, so that the method is consistent with human visual perception.
[0040] Thirdly, the embodiment of the present application fully considers the influence of factors such as color, brightness and size of the light source on the adaptation degree, and calculates the gain coefficient by using the product of the color, brightness and size of the light source and the environmental factor, so that the deviation between the image after white balance correction and human visual perception can be avoided.
[0041] Fourthly, the present application can be applied to different imaging electronic devices, and has good application prospect. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0043] Figure 1 is a flowchart of the method of the present application.
[0044] Figure 2 is a flowchart of the method of the present application.
[0045] Figure 3 is a flowchart of the method of the present application.
[0046] Figure 4 is a flowchart of the method of the present application. DETAILED DESCRIPTION
[0047] Embodiments of the present application will be described in detail below with reference to the drawings.
[0048] It should be noted that the following embodiments and features of the embodiments can be combined with each other without conflict, and all other embodiments obtained by those skilled in the art based on the embodiments of the present disclosure without creative labor shall fall within the scope of the present disclosure.
[0049] It should be noted that the various aspects of the embodiments described below are within the scope of the appended claims. It should be apparent that the aspects described herein can be embodied in a wide variety of forms and that any specific structure and / or function described herein is merely illustrative. Based on the disclosure provided, one skilled in the art should appreciate that an aspect described herein can be implemented, independently of any other aspect and that two or more aspects can be combined in any way. For example, an apparatus can be implemented or a method can be practiced using any number of the aspects set forth herein. In addition, such an apparatus can be implemented or such a method can be practiced using other structure and / or functionality in addition to or other than one or more of the aspects set forth herein.
[0050] The design idea of the present application is: (1) for the shooting environment with multiple light sources, the influence weight of the light source position is set, the multiple light sources at different positions are equivalent to an equivalent light source, and the white balance correction is performed based on the related information of the equivalent light source, so that the method can be applied to the shooting environment with multiple light sources; (2) the shooting image is converted into the LMS space for processing, and the processing process is closer to the change process of the spectral sensitivity of the human eye cone cell in different light environments; (3) a new variable-adaptability D is introduced in the calculation of the gain coefficient, which is used to quantify the influence of light environment color, brightness, size and other parameters on the adaptability, and forms an accurate, comprehensive and widely applicable adaptability evaluation model, and combines the camera color characteristic model and the light source estimation algorithm; based on the above three design ideas, the white balance correction of the shooting image in the multi-light source environment is realized, and the color camera white balance correction conforms to the real perception of the human eye.
[0051] The present application embodiment does not consider the light source estimation problem, and assumes that the light source color in the actual shooting scene has been calculated by the existing light source estimation module.
[0052] As shown in Figure 1 An embodiment of the present application is a white balance correction method for a multi-light source environment, and the specific process is:
[0053] The influence weight of the light source at different positions on each pixel position in the shooting image is set, the equivalent light source cone cell response value equivalent to the multiple light sources is calculated based on the influence weight and the cone cell response value of the multiple light sources, the influence factor of the equivalent light source on each pixel position in the image is calculated, the adaptability of the equivalent light source is calculated based on the influence factor, the gain coefficient of each cone channel is calculated based on the adaptability, the cone cell response value of the equivalent light source and the reference light source, and the corresponding color of the shooting image under the reference light source (i.e. image LMS cone response) is calculated by using the gain coefficient, the corresponding color is converted into the RGB output of the corrected image, and the white balance correction of the shooting image is realized.
[0054] The present embodiment sets the influence weight of the light source at different positions on each pixel in the shooting image based on the position information of the multiple light sources, and equivalent light source is used to equivalent the multiple light sources, so as to ensure that the method can be applied to the case that the environment has multiple light sources.
[0055] In combination with the above embodiment, the influence weight of the light source at different positions on each pixel position in the shooting image is set based on the actual distance corresponding to the adjacent pixels of the image, the horizontal and vertical direction Gaussian distribution functions.
[0056] The present application is based on the research result that the color adaptation state is mainly affected by the central visual field, a two-dimensional space Gaussian distribution function is used to simulate the influence weight of different position light source on the equivalent light source, so as to ensure that the method is consistent with the human eye visual perception.
[0057] According to the optional embodiment, the influence weight is set as w s (m,n,i,j):
[0058]
[0059] Wherein, d0 is the actual distance corresponding to the adjacent pixel points of the image; sigma and k are the to-be-determined constants of the Gaussian distribution curve in the horizontal and vertical directions respectively, (m,n) is the spatial coordinates of the light source, M and N represent the number of pixels in the horizontal and vertical directions of the image respectively, 0≤i≤M, 0≤j≤N;
[0060] Based on the characteristic matrix and the cone response transformation matrix of the image acquisition device, the multi-light source cone cell response value is obtained Based on the influence weight and the multi-light source cone cell response value, the equivalent light source cone cell response value of the pixel (i,j) is calculated is:
[0061]
[0062] According to the optional embodiment, the influence factor of the equivalent light source on each pixel position on the image is calculated, and the adaptation degree of the equivalent light source is calculated based on the influence factor:
[0063] The chroma factor and the brightness factor of the equivalent light source on each pixel point on the image are calculated, the scale factor of the equivalent light source is calculated, and the product of the chroma factor, the brightness factor and the scale factor is taken as the adaptation degree of the equivalent light source.
[0064] The present embodiment fully considers the influence of light source color, brightness, size and other factors on the adaptation degree, uses the product of light source color, brightness, size and environmental factors to calculate the gain coefficient, which can avoid the deviation between the image after white balance correction and the human eye vision, and forms an accurate, comprehensive and suitable color adaptation adjustment method for various multi-light source environments, and realizes the white balance correction of the color camera consistent with the real perception of the human eye.
[0065] According to the optional embodiment, based on the adaptation degree, the cone cell response value of the equivalent light source and the reference light source, the gain coefficient of each cone channel is calculated as:
[0066]
[0067] Wherein, a cone cell response value of the reference light source, a cone cell response value of the equivalent light source, and D(i,j) is an adaptation degree of the equivalent light source.
[0068] In combination with the above-mentioned embodiments, the corresponding color of the photographed image under the reference light source is calculated by using the gain coefficient:
[0069] Based on the characterization matrix of the image acquisition device and the cone response transformation matrix, the cone cell response value of the photographed image is obtained, the gain coefficient is multiplied by the cone cell response value of the photographed image, and the corresponding color of the photographed image under the reference light source is calculated.
[0070]
[0071] wherein, is a cone cell response value of a pixel point with coordinates (i,j) in the photographed image corresponding to the color under the reference light source, is a cone cell response value of a pixel point with coordinates (i,j) in the photographed image,
[0072] The corresponding color is converted into the RGB of the corrected image as follows:
[0073] The cone cell response value of the corresponding color of the image under the reference light source is reconverted into the RGB space of the camera by using the inverse matrix of the cone response transformation and the inverse matrix of the camera characterization:
[0074]
[0075] wherein, A -1 is the inverse matrix of the camera characterization, is the inverse matrix of the cone response transformation.
[0076] In this embodiment, the cone cell response value of each light source under a multi-light source environment is obtained in advance by using the characterization matrix of the image acquisition device and the cone response transformation matrix, and the cone cell response value of an equivalent light source equivalent to the multi-light source is obtained in combination with the influence weight, so as to ensure that the obtained cone cell response value of the equivalent light source can accurately represent the characteristics of the multi-light source in the environment. In this embodiment, the photographed image is converted into the LMS space for correction by using the characterization matrix of the image acquisition device and the cone response transformation matrix, and compared with the prior art which is based on the device-related RGB space or R / G, B / G space. This embodiment can more accurately solve the problem that the cone cell spectral sensitivity changes with the light environment, so as to ensure that the color correction result is consistent with the perception of the human eye.
[0077] Optionally, in conjunction with the above embodiments, the reference light source is an equal-energy white light source. By scaling its tristimulus values to make its brightness the same as that of the equivalent light source at the corresponding position, the tristimulus values of the reference light source are obtained, and then converted into cone cell response values using a cone response transformation matrix.
[0078] Example:
[0079] In this embodiment, the image acquisition device is a digital camera, and white balance correction is performed on the images acquired by the digital camera.
[0080] (1) Using a simulated D65 light source, obtain the characteristic matrix A of the camera;
[0081] like Figure 2 As shown, the specific process of this step is as follows:
[0082] 101. For a simulated D65 light source with spectral power distribution P(λ), using the color matching function... Calculate the chromaticity value XYZ of the i-th color patch on the standard color chart under this light source:
[0083]
[0084] Among them, R i (λ) is the spectral reflectance of the i-th color patch on the standard color chart. The standard color chart contains N color patches, which are combined to form an N×3 XYZ tristimulus matrix X, with each row corresponding to one color patch on the chart. The color matching function used can be selected from the CIE 1931 2°, CIE 1964 10°, CIE 2006 2°, and CIE 2006 10° standard observer color matching functions based on the size of the objects in the actual scene.
[0085] 102. Use the digital camera to be calibrated to acquire the RGB response values of each color patch in the standard color chart under a D65 light source, where the response value of the i-th color patch is denoted as R. i G i B i The combination of N color patches in the standard color chart yields an N×3 RGB camera response value matrix V0, with each row corresponding to one color patch in the color chart.
[0086] 103. Expand the camera response matrix to N×11, denoted as V, where s≥3, representing the number of polynomial terms selected. When s=11, the i-th row corresponds to:
[0087]
[0088] 104. Calculate the camera's characteristic matrix:
[0089] A = (VT V) -1 V T X
[0090] wherein the upper index T represents the transpose matrix, and the upper index -1 represents the inverse matrix.
[0091] (2) Obtain the cone cell response values of the multiple ambient light sources and the cone cell response values of the photographed image based on the characterization matrix of the camera and the cone response conversion matrix; the specific process of this step is as follows:
[0092] Based on the characterization matrix of the camera, convert the light source chrominance value in the actual environment and the camera response value of the photographed image to the XYZ color space:
[0093] [X I ,Y I ,Z I ]=V I ·A
[0094] wherein V I is the camera response value of the photographed image (i.e. the pixel value of the image), X I ,Y I ,Z I is the chrominance value of the photographed image obtained after the characterization conversion (i.e. the tristimulus value).
[0095] The light source chrominance value in the actual environment can be converted in the above manner to obtain the tristimulus value The light source chrominance value in this step can be obtained by using the prior art, which will not be described further herein.
[0096] Based on the cone response conversion matrix, convert the XYZ tristimulus value of the ambient light source spatial distribution and the photographed image to the LMS space to obtain the cone cell response values of the multiple ambient light sources and the cone cell response values of the photographed image:
[0097]
[0098] wherein M xyz2lms is the selected cone response conversion matrix, and the conversion matrix that can be selected includes the HPE matrix, the CAT02 matrix, the CAT16 matrix, the Sharp matrix, the BFD matrix, the CIE 2006 LMS conversion matrix, etc.
[0099] (3) Based on the design idea of equivalent the multiple ambient light sources to one equivalent light source, use the set light source position weight and the cone cell response values of the multiple ambient light sources to calculate the cone cell response values of the equivalent light source, and convert the values to the XYZ color space; the specific process is as follows:
[0100]
[0101] wherein M, N represent the number of pixels in horizontal and vertical directions of the image respectively, 0≤i≤M, 0≤j≤N; is the equivalent light source cone cell response value corresponding to the image pixel point with spatial coordinates (i, j); w s (m, n, i, j) is the influence weight of the ambient light source with spatial coordinates (m, n) on the adaptation state of the image pixel point with spatial coordinates (i, j); d0 is the actual distance corresponding to adjacent image pixel points; σ and k are the to-be-determined constants of the Gaussian distribution curves in horizontal and vertical directions respectively, and the specific values of the to-be-determined constants in the binary Gaussian distribution can be obtained by optimizing the experimental results and can change with the change of the adaptation environment and the observation mode. The corresponding relationship between the position weight in the equivalent light source calculation formula and the distance between the light source and the relative stimulating object in the horizontal / vertical direction under different values of the parameter σ is shown in FIG. 1; and the corresponding relationship between the light source position weight of the photographed picture and the two-dimensional pixel coordinates with the pixel point located at (1000, 1000) as the reference object is shown in FIG. 2. Figure 3 Figure 4
[0102] convert the equivalent light source cone cell response value to the XYZ colorimetric space
[0103]
[0104] (4) Obtain the colorimetric tristimulus value of the reference light source, and convert the value to the LMS space to obtain the cone cell response value of the reference light source; the specific process of this step is as follows:
[0105] Scale the tristimulus value of the equal-energy white serving as the reference light source, so that the brightness is the same as that of the equivalent light source at the corresponding (i, j) position, and the colorimetric tristimulus value of the reference light source is and satisfies
[0106] Next, the colorimetric tristimulus value of the reference light source is converted to the LMS space:
[0107]
[0108] (5) Based on the cone cell response value of the equivalent light source and the cone cell response value of the reference light source, calculate the gain coefficient of each visual cone channel; the specific process of this step is as follows:
[0109] Firstly, based on the three-stimulus values on XYZ color space corresponding to the equivalent light source, the color factor and the brightness factor of the image pixel point with spatial coordinates (i, j) are calculated; the scale factor is calculated by obtaining the field of view angle of the adaptive light environment of the equivalent light source, and the color factor (f color ), the scale factor (f fov ), the brightness factor (f La ) are multiplied to obtain the adaptive degree D(i, j) of the human eye to the equivalent light source:
[0110]
[0111] Wherein, fov refers to the field of view angle of the adaptive light environment. The change range of D(i, j) is from 0 (no adaptation) to 1 (complete adaptation)
[0112] The gain coefficient of each cone channel:
[0113]
[0114] Wherein, is the cone cell response value of the reference light source, is the cone cell response value of the equivalent light source.
[0115] (6) The corresponding color of the picture under the reference light source is calculated by using the gain coefficient calculated in step (5):
[0116]
[0117] Wherein, is the cone cell response value of the pixel point with coordinates (i, j) in the picture under the reference light source.
[0118] (7) The cone cell response value of the corresponding color of the picture under the reference light source is converted to the RGB space of the used camera by the inverse matrix of the cone response transformation and the inverse matrix of the camera characteristics:
[0119]
[0120] Wherein, is the camera response value of the pixel point with coordinates (i, j) in the picture under the reference light source, which completes the multi-light source color camera white balance correction considering the color space distribution of the light source and more in line with the human eye perception.
[0121] In this embodiment, the binary Gaussian distribution is used to calculate the influence weight of light sources at different positions on the adaptation state, the three-stimulus values of the equivalent light source are calculated through the weighted integral of the spatial distribution of the light source, and the adaptation degree of the human eye vision system to the equivalent light source is calculated in combination with the brightness of the equivalent light source and the size of the adaptation field. The embodiment innovatively proposes the concept of equivalent light source, solves the problem of color adaptation adjustment in a multi-light source environment, and has important significance for improving the processing effect of the white balance algorithm and expanding the application range thereof.
[0122] Based on the same inventive concept as the above white balance correction method for a multi-light source environment, the embodiment of the present application also provides a white balance correction device for a multi-light source environment, which comprises an equivalent light source module, an adaptation degree module, a gain coefficient module and a correction module.
[0123] The equivalent light source module is used to calculate the influence weight of the environmental light source at different positions on each pixel position in the captured image, and based on the influence weight and the cone cell response value of the multi-light source, the equivalent light source cone cell response value equivalent to the multi-light source is calculated.
[0124] The adaptation degree module is used to calculate the influence factor of the equivalent light source on each pixel position on the image, and based on the influence factor, the adaptation degree of the equivalent light source is calculated.
[0125] The gain coefficient module is used to calculate the gain coefficient of each cone channel based on the adaptation degree, the cone cell response value of the equivalent light source and the reference light source.
[0126] The correction module calculates the corresponding color of the captured image under the reference light source by using the gain coefficient, and realizes the white balance correction of the captured image.
[0127] The white balance correction device for a multi-light source environment according to the embodiment of the present application adopts the same inventive concept as the above white balance correction method for a multi-light source environment, and can achieve the same beneficial effects, which will not be described here.
[0128] Based on the same inventive concept as the above white balance correction method for a multi-light source environment, the embodiment of the present application also provides an electronic device, which can be a mobile phone, a digital camera, a tablet computer and the like. The electronic device comprises a memory and a processor.
[0129] The processor can be a general purpose processor, such as a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.
[0130] The memory is a non-volatile computer readable storage medium, which can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory can include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card type memory, random access memory (RAM), static random access memory (SRAM), programmable read only memory (PROM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. The memory is any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited to this. The memory in the embodiments of the present application can also be a circuit or other any device capable of realizing the storage function, used to store program instructions and / or data.
[0131] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware, and the foregoing program can be stored in a computer readable storage medium, and the program executes the steps of the above-mentioned method embodiments when executed; the computer storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to: mobile storage devices, random access memory (RAM), magnetic memories (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical memories (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor memories (such as ROMs, EPROMs, EEPROMs, non-volatile memories (NAND FLASH), solid state disks (SSD), etc.), and various media that can store program codes.
[0132] Alternatively, the integrated units of the present application can be stored in a computer readable storage medium if they are realized in the form of software function modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products, and the computer software products are stored in a storage medium, including a plurality of instructions for causing an electronic device to execute all or part of the methods described in the embodiments of the present application.
[0133] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A multi-light source oriented image white balance correction method, characterized by, The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: wherein is the cone cell response value for the reference light source, is the cone cell response value for the equivalent light source, and D(i,j) is the degree of adaptation of the equivalent light source.
2. The multi-light source oriented image white balance correction method according to claim 1, wherein, The specific steps include:
3. The multi-light source oriented image white balance correction method according to claim 2, wherein, For a certain pixel (i,j) in the captured image, the influence weight is set as w s (m,n,i,j): The specific steps include: Based on the characteristic matrix of the image acquisition device and the cone response transformation matrix, a multi-light source cone cell response value is obtained The equivalent light source cone cell response value of the pixel (i, j) is calculated based on the influence weight and the multi-light source cone cell response value is:
4. The multi-light source oriented image white balance correction method according to claim 1, wherein, The specific steps include: The specific steps include: wherein, is the cone cell response value of the pixel at coordinates (i, j) in the captured image to the corresponding color under the reference light source, is the cone cell response value of the pixel at coordinates (i, j) in the captured image. The specific steps include: The specific steps include: where A -1 is the camera characterization inverse matrix, is the cone response transform inverse matrix.
5. The multi-light source oriented image white balance correction method according to claim 1 or 2, characterized in that, The specific steps include:
6. A multi-light-source oriented image white balance correction apparatus, characterized by comprising: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps include: The specific steps The adaptation degree module is configured to calculate an influence factor of the equivalent light source on each pixel position on the image, and calculate the adaptation degree of the equivalent light source based on the influence factor. Specifically, the adaptation degree of the equivalent light source is calculated by calculating a chromaticity factor and a brightness factor of the equivalent light source on each pixel point on the image, and calculating a scale factor of the equivalent light source, and taking the product of the chromaticity factor, the brightness factor and the scale factor as the adaptation degree of the equivalent light source. The gain coefficient module is configured to calculate a gain coefficient of each cone channel based on the adaptation degree, the cone cell response value of the equivalent light source and the reference light source. Specifically, the gain coefficient of each cone channel is calculated by: wherein α, β and γ respectively correspond to the gain coefficients of L, M and S cone channels, and (i, j) represents a certain pixel in the captured image. Cone cell response value for the reference light source; Cone cell response value for the equivalent light source, D(i,j) is the adaptation level of the equivalent light source; The correction module is configured to calculate the corresponding color of the captured image under the reference light source by using the gain coefficient, so as to realize the white balance correction of the captured image.
7. An electronic device, comprising: The computer program instructions are executed by the processor to realize the steps of the method in any one of claims 1 to 5.
8. A computer-readable storage medium having stored thereon computer program instructions, wherein, The computer program instructions are executed by the processor to realize the steps of the method in any one of claims 1 to 5.
Citation Information
Patent Citations
Image white balance processing method and device, electronic equipment and storage medium
CN112866667A
Image Processing Device, Image Processing Program, and Image Processing Method
US20090010535A1