A color adaptation driving white balance correction method and device suitable for a single light source, an electronic device, and a storage medium
By converting the image to the LMS frustum response space and calculating the gain coefficient, and taking into account the ambient light factor, the problem of inconsistency between the white balance algorithm and human eye perception in the existing technology is solved, and a more accurate color correction effect is achieved.
Patent Information
- Application Number
- CN202211321445.0
- 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-17
- Estimated Expiration
- 2042-10-26
AI Technical Summary
Existing camera white balance algorithms cannot accurately simulate the color adaptation phenomenon of the human eye when dealing with changes in light source, resulting in color reproduction results that are inconsistent with human eye perception, and they fail to fully consider the influence of factors such as the color, brightness, and size of the light source on the degree of adaptation.
The image is converted to the LMS frustum response space by using the characteristic matrix and frustum response transformation matrix of the image acquisition device. When calculating the gain coefficient, the influence factor of the ambient light source and the environmental factor are taken into account. White balance correction is performed using the gain coefficient and the LMS frustum response of the image.
It improves the accuracy of image white balance correction, making the corrected image more consistent with human visual perception, reducing color deviation, and is suitable for a variety of imaging devices.
Smart Images

Figure CN115908161B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of camera white balance correction, in particular to a color adaptation driven white balance correction method and device, electronic equipment and storage medium. BACKGROUND
[0002] The adjustment function of the human visual system can partially offset the influence of light source color on object color appearance, keeping the relative stability of object color appearance under different light sources, which is called color adaptation phenomenon. In order to restore the color appearance perception of the human eye as much as possible, the white balance module in the signal processing flow (ISP) of the color digital camera undertakes the function of color adaptation adjustment, and corrects the colors of the original image according to the chrominance, brightness and other information of the actual light environment, and its flow is as shown in Figure 1
[0003] The white balance correction algorithm of the camera includes two modules: light source estimation and color adaptation adjustment. The light source estimation module estimates the light source color and light environment brightness in the current environment based on the image color information, and then the color adaptation adjustment module adjusts the response value of each pixel point in the image according to the estimated actual light source color. The commonly used light source estimation algorithm includes gray world method, maximum scaling method, gamut mapping method, neural network method, color correlation method and rule fuzzy method, and the color adaptation adjustment algorithm used is based on the assumption of Walker and Chris, the gain coefficient of each channel is obtained by calculating the ratio of the color of the actual light source and the reference light source in the red (R), green (G) and blue (B) channels, and the coefficient is used to make independent linear adjustment on the three channel response values of the original image, so that the image taken in the actual scene is matched with the image under the reference light source after white balance correction.
[0004] One of the key technologies of the camera white balance correction algorithm is to develop a color adaptation adjustment algorithm consistent with the human visual system. However, the color adaptation adjustment algorithm commonly used in the industry has a series of problems: (1) the color adaptation phenomenon is caused by the spectral sensitivity of cone cells changing with the light environment, but the image linear transformation in the white balance algorithm is not carried out in the LMS space used to describe the response of cone cells, but in the device-related RGB space or R / G, B / G space, and the mismatch of color space will cause the color restoration result to deviate from the human eye perception; (2) for any illumination light source and adaptation background, the existing white balance algorithm assumes that the human eye has reached a fully adapted state and takes the reference light source as the correction target, ignoring the possible incomplete adaptation of the visual system, and not considering the influence of light source color, brightness, size and other factors on the adaptation degree, resulting in deviation between the image after white balance correction and the human visual system. SUMMARY
[0005] The embodiment of the present application provides a color adaptation driving white balance correction method, device, electronic equipment and storage medium suitable for a single light source, and the accuracy of image white balance correction is improved.
[0006] In the first aspect, an embodiment of the present application provides a color adaptation driving white balance correction method suitable for a single light source, comprising:
[0007] The chrominance values of the photographed image and the ambient light source are respectively converted into image LMS cone response and ambient light source LMS cone response values by using the characterization matrix and the cone response conversion matrix of the image acquisition device;
[0008] The gain coefficient of each cone channel is calculated based on the ambient light source LMS cone response value and the reference light source LMS cone response value;
[0009] The corresponding color of the photographed image under the reference light source is calculated by using the gain coefficient and the image LMS cone response;
[0010] The corresponding color is converted by using the inverse matrix of the characterization matrix and the cone response conversion matrix, so that the white balance correction of the photographed image is realized.
[0011] Optionally, the specific process of calculating the gain coefficient of each cone channel based on the ambient light source LMS cone response value and the reference light source LMS cone response value comprises:
[0012] The influence factor of the ambient light source is calculated based on the ambient light source LMS cone response value;
[0013] The product of the influence factor and the peripheral environment factor is taken as the adaptation degree of the ambient light source color;
[0014] The gain coefficient of each cone channel is calculated based on the adaptation degree of the ambient light source color, the ambient light source LMS cone response value and the reference light source LMS cone response value.
[0015] Optionally, the ambient light source factor comprises a chrominance factor, a size factor and a brightness factor; and the adaptation degree of the ambient light source color is the product of the chrominance factor, the size factor, the brightness factor and the peripheral environment factor, the peripheral environment factor is positively correlated with the brightness of the peripheral environment, and the value range is [0.8, 1].
[0016] Optionally, the gain coefficient is calculated by using the following formula:
[0017]
[0018] Wherein, D represents the adaptation degree of the ambient light source color, which is the product of the chrominance factor, the size factor, the brightness factor and the peripheral environment factor, [L ref Mref S ref ] is the LMS cone response value of the reference light source, [L w M w S w ] is the LMS cone response value of the ambient light source.
[0019] Optionally, the peripheral environment factor is positively correlated with the brightness of the peripheral environment, and the value range is [0.8, 1].
[0020] Optionally, the reference light source is an equal-energy white light source, and the three stimulus values of the reference light source are scaled to make the brightness of the reference light source the same as the brightness of the ambient light source, to obtain the three stimulus values [X ref Y ref Z ref ] of the reference light source, which are converted into the LMS cone response values [L w M w S w ] by using a cone response conversion matrix.
[0021] Optionally, the specific process of calculating the corresponding color of the photographed image under the reference light source is as follows:
[0022]
[0023] wherein, is the corresponding color of the pixel point with coordinates (i, j) in the photographed image under the reference light source, is the LMS cone response value of the pixel point with coordinates (i, j) in the photographed image.
[0024] Optionally, the corresponding color is converted into: -1 and the inverse matrix of the cone response conversion matrix
[0025]
[0026] wherein, is the camera response value of the corresponding color of the pixel point with coordinates (i, j) in the photographed image under the reference light source.
[0027] Optionally, the cone response conversion matrix is an HPE matrix, a CAT02 matrix, a CAT16 matrix, a Sharp matrix, a BFD matrix or a CIE 2006 LMS conversion matrix.
[0028] In a second aspect, an embodiment of the present application provides a color adaptation driven white balance correction device suitable for a single light source, which comprises:
[0029] a data processing module, a gain coefficient module and a color adaptation adjustment module.
[0030] The data processing module converts the chrominance value of the photographed image and the chrominance value of the ambient light source into image LMS cone response and ambient light source LMS cone response value respectively by using the characterization matrix and the cone response conversion matrix of the image acquisition device.
[0031] The gain coefficient module calculates the gain coefficient of each cone channel based on the ambient light source LMS cone response value and the reference light source LMS cone response value.
[0032] The chrominance adaptive adjustment module calculates the corresponding color of the photographed image under the reference light source by using the gain coefficient and the image LMS cone response, and converts the corresponding color by using the inverse matrix of the characterization matrix and the cone response conversion matrix, so as to realize the white balance correction of the photographed image.
[0033] 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 the steps of any of the above methods when executing the computer program.
[0034] 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 the steps of any of the above methods.
[0035] Advantages
[0036] First, the embodiment of the present application converts the photographed image into the LMS space for correction by using the characterization matrix and the cone response conversion matrix of the image acquisition device, and calculates the gain coefficient by using the cone response of the ambient light source and the reference light source in the LMS space, so that the white balance correction process is performed in the LMS space of the cone cell response. Compared with the prior art which is performed in the device-related RGB space or R / G, B / G space, the 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.
[0037] Second, when calculating the gain coefficient, the embodiment of the present application does not simply take the reference light source as the correction target, but fully considers the influence factor of the ambient source and the environmental factor, and takes the product as the adaptive degree of the ambient light color, so that the image after white balance correction can reach the state of fully adapting to the human eye.
[0038] Third, the embodiment of the present application fully considers the influence of the light source color, brightness, size and other factors on the adaptive degree, and calculates the gain coefficient by using the product of the light source color, brightness, size and environmental factor, so that the deviation between the image after white balance correction and the human eye vision can be avoided.
[0039] Fourthly, the present application can be applied to different imaging electronic devices, and has good application prospects. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.
[0041] Figure 1 The flow chart of the linear correction method for the color of the original image in the color adaptation adjustment of the white balance module in the signal processing flow of the existing color digital camera.
[0042] Figure 2 The flow chart of the method of the present application.
[0043] Figure 3 The flow chart of the specific characteristic of the method of the present application.
[0044] Figure 4 The corresponding relationship between the light source color factor in the color adaptation degree (D) formula and the u', v' color coordinates in the CIE 1976u'v' uniform color space in the embodiments of the present application.
[0045] Figure 5 The relationship between the light source field of view size factor and the light environment field of view angle in the color adaptation degree (D) formula under different values of the parameter a in the embodiments of the present application.
[0046] Figure 6 The relationship between the light source brightness factor and the light environment brightness in the color adaptation degree (D) formula under different values of the parameter b in the embodiments of the present application. DETAILED DESCRIPTION
[0047] The 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 the features in the embodiments can be combined with each other without conflict; and all other embodiments obtained by those skilled in the art on the basis of the embodiments in the present disclosure without creative labor are within the scope of protection of the present disclosure.
[0049] It is important to note that the various aspects described throughout this disclosure can be implemented in any of numerous ways, as the described aspects specify a preferred embodiment for purposes of this document. Other aspects can be practiced without several of the specific details (e.g., not every implementation according to the disclosure includes all of the described features) since learning can be practiced in many ways. Furthermore, this document describes several examples of how the described
[0050] The design idea of the present application is: (1) converting the captured image into the LMS space for processing, which is closer to the change of human cone cell spectral sensitivity with light environment; (2) introducing a new variable-adaptation degree D into the calculation of the gain coefficient, which is used to quantify the influence of light environment color, brightness, size and other parameters on the adaptation degree, forming an accurate, comprehensive and widely applicable adaptation degree evaluation model, combined with the camera color characteristic model and light source estimation algorithm; based on the above two design ideas, the color camera white balance correction conforming to the real perception of the human eye is realized.
[0051] The embodiment of the present application 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 A color adaptation driven white balance correction method suitable for single light source, the specific process is: using the characteristic matrix of the image acquisition device and the cone response transformation matrix, the chrominance value of the captured image and the chrominance value of the environment light source are converted into image LMS cone response and environment light source LMS cone response value respectively; based on the environment light source LMS cone response value and the reference light source LMS cone response value, the gain coefficient of each cone channel is calculated; using the gain coefficient and the image LMS cone response, the corresponding color of the captured image under the reference light source (i.e. image LMS cone response) is calculated; using the inverse matrix of the characteristic matrix and the cone response transformation matrix, the corresponding color is converted to realize the white balance correction of the captured image.
[0053] The embodiment utilizes a characteristic matrix of an image acquisition device and a cone response transformation matrix to convert a captured image into an LMS space for correction, and utilizes the LMS space cone response of an ambient light source and a reference light source to calculate a gain coefficient, so that the white balance correction process is performed in the LMS space of the cone cell response. Compared with the prior art which is performed in a device-dependent RGB space or R / G, B / G space, the embodiment can more accurately solve the problem caused by the change of the cone cell spectral sensitivity with the light environment, so as to ensure that the color correction result is consistent with the perception of the human eye.
[0054] Optionally in combination with the above embodiment, the specific process of calculating the gain coefficient of each cone channel based on the LMS cone response value of the ambient light source and the LMS cone response value of the reference light source is as follows:
[0055] Based on the LMS cone response value of the ambient light source, an influence factor of the ambient light source is calculated; the product of the influence factor and a peripheral environment factor is taken as the adaptation degree of the ambient light source color; and based on the adaptation degree of the ambient light source color, the LMS cone response value of the ambient light source and the LMS cone response value of the reference light source, the gain coefficient of each cone channel is calculated.
[0056] In the embodiment, when calculating the gain coefficient, the reference light source is not simply taken as a correction target, but the influence factor of the ambient source and the environment factor are fully considered, and the product thereof is taken as the adaptation degree of the ambient light source color, so that the image after white balance correction in the embodiment can reach a state fully adapted to the human eye.
[0057] Optionally in combination with the above embodiment, the ambient light source factor includes a chromaticity factor, a size factor and a brightness factor; and the adaptation degree of the ambient light source color is the product of the chromaticity factor, the size factor, the brightness factor and the peripheral environment factor.
[0058] The embodiment fully considers the influence of the color, brightness and size of the light source on the adaptation degree, and utilizes the product of the color, brightness, size of the light source and the environment factor to calculate the gain coefficient, so that deviation between the image after white balance correction and the human eye vision can be avoided.
[0059] Optionally in combination with the above embodiment, the gain coefficient is calculated by using the following formula:
[0060]
[0061] Wherein, D represents the adaptation degree of the ambient light source color, which is the product of the chromaticity factor, the size factor, the brightness factor and the peripheral environment factor, [L ref M ref S ref ] is the LMS cone response value of the reference light source, [L w M wS w ] is the LMS cone response value of the ambient light source LMS.
[0062] Optionally in combination with the above embodiment, the peripheral environment factor is positively correlated with the brightness of the peripheral environment, and the value range is [0.8, 1].
[0063] In this embodiment, the influence of the brightness of the peripheral environment on the image is considered, and the greater the brightness, the greater the influence. Therefore, the peripheral environment factor is set to be positively correlated with the brightness of the peripheral environment, for example, 1.0, 0.9 and 0.8 can be taken for bright, dim and dark peripheral environments respectively.
[0064] Optionally in combination with the above embodiment, the reference light source is an equal-energy white light source, and the tristimulus values of the reference light source are obtained by scaling the tristimulus values of the reference light source, so that the brightness of the reference light source is the same as the brightness of the ambient light source, that is, [X ref Y ref Z ref ]. The LMS cone response value [L w M w S w ] is converted by using the cone response conversion matrix.
[0065] Optionally in combination with the above embodiment, the specific process of calculating the corresponding color of the photographed image under the reference light source is as follows:
[0066]
[0067] wherein, is the corresponding color of the pixel point with coordinates (i, j) in the photographed image under the reference light source, is the LMS cone response value of the pixel point with coordinates (i, j) in the photographed image.
[0068] The corresponding color is converted by using the inverse matrix A -1 of the characteristic matrix and the inverse matrix of the cone response conversion matrix.
[0069]
[0070] wherein, is the camera response value of the corresponding color of the pixel point with coordinates (i, j) in the image under the reference light source.
[0071] Example:
[0072] In this embodiment, the image acquisition device is a digital camera, and the image collected by the digital camera is subjected to white balance correction.
[0073] (1) The characteristic matrix A of the camera is obtained by using the simulated D65 light source.
[0074] For example,Figure 3 The specific process of this step is as follows:
[0075] 101. For a simulated D65 light source with spectral power distribution P(λ), use the CIE color matching functions to calculate the XYZ colorimetric values of the i-th patch of the standard color chart under this light source:
[0076]
[0077] where R i (λ) is the spectral reflectance of the i-th patch of the standard color chart. There are N patches in the standard color chart, and the combination of the N patches results in an N x 3 XYZ tristimulus value matrix X, each row of which corresponds to a patch in the color chart. The color matching functions used can be selected from the CIE 1931 2°, CIE 1964 10°, CIE 2006 2°, and CIE 2006 10° standard observer color matching functions according to the size of the object in the actual scene.
[0078] 102. Use the digital camera to be calibrated to obtain the RGB response values of each patch in the standard color chart under the D65 light source, where the response value of the i-th patch is denoted as R i G i B i . The N patches in the standard color chart result in an N x 3 RGB camera response value matrix V0, each row of which corresponds to a patch in the color chart.
[0079] 103. Extend the camera response value matrix to N x 11, denoted as V, where the i-th row corresponds to:
[0080]
[0081] 104. Calculate the camera characterization matrix:
[0082] A = (V T V) -1 V T X
[0083] where the superscript T represents the transpose matrix and the superscript -1 represents the inverse matrix.
[0084] (2) Based on the camera characterization matrix A obtained in step (1), convert the camera response value in RAW format of the photographed image to the tristimulus value in the (X F,10 Y F,10 Z F,10 ) color space Based on the camera characterization matrix A obtained in step (1), convert the colorimetric value of the light source in the environment to the tristimulus value in the (X F,10 YF,10 Z F,10 ) three stimulus values [L w M w S w ] on color space;
[0085] The conversion of camera response values, for example, is performed using the following formula:
[0086]
[0087] wherein, is the chrominance value of the pixel with coordinates (i,j) in the captured image; is the camera response value (i.e. the RGB value of the image) of the pixel with coordinates (i,j) in the captured image.
[0088] The chrominance values X w ,Y w ,Z w of the light sources in the actual environment can be calculated using a similar method, which is not further described herein.
[0089] (3) Obtain the chrominance of the reference light source, i.e. the chrominance three stimulus values [X ref Y ref Z ref ]
[0090] The specific process of this step is as follows: taking an equal-energy white light source as the reference light source, and scaling its three stimulus values so that its brightness is the same as that of the light source in the environment, and the chrominance three stimulus values of the reference light source are X ref ,Y ref ,Z ref , and satisfy X ref =Y ref =Z ref =Y w
[0091] (4) Convert the XYZ three stimulus values of the reference light source, the ambient light source and each pixel in the image to the LMS space using a cone response transformation matrix:
[0092]
[0093] wherein, M xyz2lms is a selected cone response transformation matrix, and the selectable transformation matrices include HPE matrix, CAT02 matrix, CAT16 matrix, Sharp matrix, BFD matrix, CIE 2006 LMS conversion matrix, etc.
[0094] (5) Based on the [L ref M ref S ref ] of the reference light source and the [Lw M w S w ], the gain coefficient of each view frustum channel is calculated:
[0095]
[0096] wherein D represents the degree of adaptation to the color of the ambient light source, ranging from 0 (no adaptation) to 1 (full adaptation), and is obtained by multiplying three factors: the color factor (f color ), the size factor (f fov ), and the brightness factor (f La ), whose calculation formula is shown as follows:
[0097] D = F · f color (r w ,b w ) · f fov (fov) · f La (Y w )
[0098]
[0099] wherein F is the ambient factor, taking 1.0, 0.9, and 0.8 for bright, dim, and dark ambient environments, respectively; r w ,b w are the colorimetric values X w ,Y w ,Z w on the logarithm-compressed MacLeod Boynton color space; fov refers to the field of view of the adapted light environment; μ1, μ2, σ1, σ2, ρ, a, and b are undetermined constants, which can be calibrated according to actual conditions.
[0100] In this step, the modeling of the colorimetric factor uses a two-dimensional Gaussian distribution model on the logarithm-compressed MacLeod Boynton space, and the modeling of the size factor and the brightness factor uses an exponential decay model. The undetermined constants in the color adaptation degree formula may change with the change of the adapted environment, such as the environmental complexity, the display medium, and the observation mode, and their specific values can be obtained by optimizing the experimental results. The present application has important significance for improving the processing effect of the white balance correction algorithm of a color digital camera.
[0101] Figure 4 For the present application, the corresponding relationship between the light source color factor in the color adaptation degree (D) formula and the u', v' color coordinates in the CIE 1976 u'v' uniform color space is shown in the schematic diagram. Figure 5For the embodiment of the present application, the relationship between the light source field of view size factor and the light environment field of view angle in the color adaptation degree (D) formula under different values of parameter a is shown in the following figure. Figure 6 For the embodiment of the present application, the relationship between the light source brightness factor and the light environment brightness in the color adaptation degree (D) formula under different values of parameter b is shown in the following figure.
[0102] (6) The corresponding color of the photographed picture under the reference light source is calculated by using the gain coefficient calculated in step (5):
[0103]
[0104] wherein, is the cone cell response value of the pixel point with coordinates (i, j) in the picture under the corresponding color of the reference light source.
[0105] (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 camera used by using the inverse matrix of the cone response transformation matrix and the camera characteristic matrix:
[0106]
[0107] wherein, is the camera response value of the pixel point with coordinates (i, j) in the picture under the corresponding color of the reference light source, and the color camera white balance correction more in line with the real feeling of the human eye is completed.
[0108] Based on the same inventive concept as the color adaptation driven white balance correction method for the single light source environment described above, the embodiment of the present application also provides a color adaptation driven white balance correction device suitable for a single light source, which comprises a data processing module, a gain coefficient module and a color adaptation adjustment module.
[0109] The data processing module converts the chrominance value of the photographed image and the chrominance value of the environment light source into the image LMS cone response and the environment light source LMS cone response value, respectively, by using the characteristic matrix of the image acquisition device and the cone response transformation matrix.
[0110] The gain coefficient module calculates the gain coefficient of each cone channel based on the environment light source LMS cone response value and the reference light source LMS cone response value.
[0111] The chroma adaptation adjustment module calculates the corresponding color of the photographed image under the reference light source by using the gain coefficient and the image LMS cone response, and converts the corresponding color by using the inverse matrix of the characteristic matrix and the cone response transformation matrix, so as to realize the white balance correction of the photographed image.
[0112] The device for correcting white balance of color adaptation driving suitable for a single light source and the method for correcting white balance of color adaptation driving suitable for a single light source provided by the embodiments of the present application adopt the same inventive concept, can achieve the same beneficial effects, and will not be described here again.
[0113] Based on the same inventive concept as the method for correcting white balance of color adaptation driving for a single light source, the embodiments of the present application further provide an electronic device, which can be a mobile phone, a digital camera, a tablet computer, etc. The electronic device includes a memory and a processor.
[0114] 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, a discrete gate or transistor logic device, a discrete hardware component, and 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 method disclosed in combination with the embodiments of the present application can be directly embodied as execution completed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0115] 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 storage, magnetic disk, optical disk, etc. The memory can be 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 any other device capable of realizing a storage function, used for storing program instructions and / or data.
[0116] 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.
[0117] Alternatively, the above-mentioned 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 number of instructions to make an electronic device execute all or part of the methods described in the embodiments of the present application.
[0118] 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 color adaptation driven white balance correction method suitable for a single light source, characterized in that, The method comprises the following steps: The chrominance values of the captured image and the ambient light source are respectively converted into image LMS cone response and ambient light source LMS cone response values by using the characterization matrix and the cone response conversion matrix of the image acquisition device; Gain coefficients of each cone channel are calculated based on the ambient light source LMS cone response values and the reference light source LMS cone response values; The corresponding colors of the captured image under the reference light source are calculated by using the gain coefficients and the image LMS cone response; The white balance correction of the captured image is realized by converting the corresponding colors by using the inverse matrix of the characterization matrix and the cone response conversion matrix; The specific process of calculating the gain coefficients of each cone channel based on the ambient light source LMS cone response values and the reference light source LMS cone response values comprises: An influence factor of the ambient light source is calculated based on the ambient light source LMS cone response values; The product of the influence factor and the peripheral environment factor is taken as the adaptation degree of the ambient light source color; The gain coefficients of each cone channel are calculated based on the adaptation degree of the ambient light source color, the ambient light source LMS cone response values and the reference light source LMS cone response values; The ambient light source factor comprises a chrominance factor, a size factor and a brightness factor; and the adaptation degree of the ambient light source color is the product of the chrominance factor, the size factor, the brightness factor and the peripheral environment factor.
2. The method of claim 1, wherein the color adaptation driving white balance correction method is applied to a single light source. The gain coefficients are calculated by using the following formula: where D represents the degree of adaptation to the color of the ambient light source, and is the product of a chromaticity factor, a size factor, a luminance factor, and a peripheral environment factor, [L ref M ref S ref ] is the LMS cone response value of the reference light source, and [L w M w S w ] is the LMS cone response value of the ambient light source.
3. The method of claim 1, wherein the color adaptation driving white balance correction method is applied to a single light source. The reference light source is an equal-energy white light source, and the tristimulus values of the reference light source are obtained by scaling the tristimulus values of the reference light source so that the brightness of the reference light source is the same as the brightness of the ambient light source, that is, [X ref Y ref Z ref ], and the tristimulus values are converted into LMS cone response values [L w M w S w ] by using a cone response conversion matrix.
4. The method for color adaptation driving white balance correction suitable for a single light source according to claim 1 or 2, wherein, The specific process of calculating the corresponding colors of the captured image under the reference light source comprises: wherein, is the corresponding color of the pixel at coordinates (i, j) in the captured image under the reference light source, is the LMS cone response value of the pixel at coordinates (i, j) in the captured image.
5. The method of claim 1, wherein the color adaptation driving white balance correction method is applied to a single light source. said utilizing the inverse matrix A of the characterization matrix -1 and the inverse matrix of the cone response transform matrix converts the corresponding color to: wherein, R(i, j) is the camera response value of the pixel at coordinates (i, j) in the picture for the color corresponding to the reference light source.
6. A color adaptation driven white balance correction device suitable for a single light source for implementing the steps of the method according to any one of claims 1 to 5, characterized in that, It comprises: a data processing module, a gain coefficient module and a color adaptation adjustment module; The data processing module converts the chrominance values of the captured image and the ambient light source into image LMS cone response and ambient light source LMS cone response values respectively by using the characterization matrix and the cone response conversion matrix of the image acquisition device; The gain coefficient module calculates the gain coefficients of each cone channel based on the ambient light source LMS cone response values and the reference light source LMS cone response values; The color adaptation adjustment module calculates the corresponding colors of the captured image under the reference light source by using the gain coefficients and the image LMS cone response, and realizes the white balance correction of the captured image by converting the corresponding colors by using the inverse matrix of the characterization matrix and the cone response conversion matrix.
7. An electronic device, comprising: The computer program instructions are executed by the processor to realize the steps of the method according to 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 according to any one of claims 1 to 5.
Citation Information
Patent Citations
Color digital camera white balance correction method based on color adaptation model
CN107197225A
KR20210093658A