Method for determining color correction matrix and electronic equipment
By determining the target reference light source type and its color correction matrix according to the spectral power distribution of the target light source, the problem of poor color correction under low-color rendering narrowband light sources in the prior art is solved, and high quality under various lighting conditions is achieved Color expression and color accuracy.
Patent Information
- Application Number
- CN202411048406.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-12
AI Technical Summary
The existing color correction matrix is not adaptable to narrowband light sources with low color rendering, making it difficult to effectively adjust the image color, resulting in color overflow and loss of image content.
By determining the type of target reference light source adjacent to the color of the target light source according to the spectral power distribution of the target light source, obtaining its color correction matrix, and computing the color correction matrix of the target light source based on these reference matrices to reflect the overall color characteristics of the light source, ensuring that Provides consistent and high-quality color performance under various lighting conditions.
The adaptability of the color correction matrix under low color rendering narrowband light sources is improved, the deviation in the color correction process is reduced, the color reproduction performance under specific light sources is improved, and the color accuracy requirements of scenes such as bars and stages are met.
Smart Images

Figure CN118945490A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology, and specifically relates to a method for determining a color correction matrix and an electronic device. Background Art
[0002] With the popularity of smart terminals such as mobile phones and the iteration of photography algorithms, photography is used in more and more scenes, and color correction under different types of light sources has become particularly important. The existing color correction matrix (CCM) is usually designed for conventional scenes illuminated by broadband light sources with high color rendering, but it has poor adaptability in scenes such as bars and stages illuminated by narrow-band light sources with low color rendering, which easily causes color overflow. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a method for determining a color correction matrix and an electronic device, which can at least solve the problem that the existing color correction matrix has poor adaptability under a narrow-band light source with low color rendering and is difficult to effectively adjust the image color.
[0004] In a first aspect, an embodiment of the present application provides a method for determining a color correction matrix, comprising: determining at least one target reference light source type that is adjacent to the color of the target light source based on the spectral power distribution of the target light source, each of the target reference light source types including at least one target reference light source that is closest to the target light source; determining a reference color correction matrix for the target light source type based on a color correction matrix of at least one target reference light source corresponding to each of the target reference light source types; and determining a target color correction matrix corresponding to the target light source based on the reference color correction matrix of each of the target reference light source types.
[0005] In a second aspect, an embodiment of the present application provides a device for determining a color correction matrix, comprising: a light source type determination module, used to determine a target reference light source type that is adjacent to the color of the target light source based on the spectral power distribution of the target light source, each of the target reference light source types including at least one target reference light source that is closest to the target light source; a first matrix determination module, used to determine a reference color correction matrix for the target light source type based on a color correction matrix of at least one target reference light source corresponding to each of the target reference light source types; and a second matrix determination module, used to determine a target color correction matrix corresponding to the target light source based on the reference color correction matrix of each of the target reference light source types.
[0006] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0007] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0008] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0009] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0010] In an embodiment of the present application, at least one target reference light source type adjacent to the target light source color is determined according to the spectral power distribution of the target light source, and each target reference light source type includes at least one target reference light source closest to the target light source; a reference color correction matrix of the target light source type is determined according to the color correction matrix of at least one target reference light source corresponding to each target reference light source type; and a target color correction matrix corresponding to the target light source is determined based on the reference color correction matrix of each target reference light source type. In this way, by determining the reference color correction matrix of the target light source type according to the color correction matrix of at least one target reference light source corresponding to each target reference light source type, it can be ensured that the reference color correction matrix can reflect the overall color characteristics of the target light source type, and then, based on the reference color correction matrix of each target reference light source type, the target color correction matrix corresponding to the target light source is determined, which can ensure that the target color correction matrix can provide consistent and high-quality color performance under various lighting conditions, improve the color reproduction performance under specific light sources, and then meet the color accuracy requirements in specific application scenarios such as bars and stages. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 It is a flow chart of a method for determining a color correction matrix provided in an embodiment of the present application;
[0012] Figure 2 is a flow chart of a method for determining the type of a target reference light source provided in an embodiment of the present application;
[0013] Figure 3is a flow chart of a method for determining a reference color correction matrix provided in an embodiment of the present application;
[0014] Figure 4 is another flow chart of a method for determining a color correction matrix provided in an embodiment of the present application;
[0015] Figure 5 is a schematic diagram of the structure of a device for determining a color correction matrix provided in an embodiment of the present application;
[0016] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0017] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0019] The terms "first", "second", etc. in the specification of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0020] The following describes in detail the method for determining the color correction matrix provided in the embodiment of the present application through specific embodiments and application scenarios in conjunction with the accompanying drawings.
[0021] In order to facilitate understanding of the embodiments of the present application, the relevant terms are explained as follows:
[0022] SPD: spectral power distribution, spectral power distribution of light source.
[0023] CCT: correlated color temperature. For a light source on the blackbody locus, the temperature corresponding to the luminous blackbody with the same chromaticity coordinates is taken as the color temperature. For a light source outside the blackbody locus, a perpendicular line is drawn through its chromaticity coordinates to the blackbody locus, and the color temperature of the luminous blackbody corresponding to the intersection of the perpendicular line and the blackbody locus is taken as the correlated color temperature.
[0024] Duv: delta uv, color coordinate difference, the distance between the chromaticity coordinates of the light source and the blackbody locus on the CIE1976UCS chromaticity diagram.
[0025] CC: color correction, color correction, by multiplying the image to be processed with a 3×3 matrix to eliminate the influence of light source color on non-neutral colors.
[0026] CCM: color correction matrix. When CC is a linear operation, its calculation method is: first calibrate the corresponding CCM under some common light sources, and then interpolate according to CCT to obtain the CCM corresponding to the target light source.
[0027] sUCS: simple Uniform Color Space, a uniform color space proposed in 2024.
[0028] TM-30-20: The light source color quality evaluation system proposed by the Illuminating Engineering Society of North America is based on the color difference between the target light source and the reference light source on 99 samples. It calculates the color fidelity index, color gamut area index, relative change degree of hue and chroma, etc. to evaluate the color rendering of the light source.
[0029] Color correction matrices are usually used to correct color deviations that may be introduced by image acquisition devices (such as cameras, mobile phone cameras, etc.) to ensure that the final displayed or analyzed image has accurate color representation. Existing CCMs are usually designed for conventional scenes illuminated by high color rendering broadband light sources, and have at least the following problems in scenes illuminated by low color rendering light sources:
[0030] (1) Most of the light sources used for calibration are located near the blackbody locus and are common broadband light sources such as sunlight and tungsten lamps. However, scenes with low color rendering light sources such as bars and stages may be illuminated by narrowband LEDs, fluorescent lamps and other light sources, whose spectrum and color characteristics are quite different from those used for calibration.
[0031] (2) CCM calculation is usually based on CCT linear interpolation. However, the light sources in scenes such as bars and stages often have extremely high or low color temperatures, and CCT is nonlinearly distributed in the chromaticity diagram (in the CIE1976UCS diagram, the chromaticity points with equal CCT intervals on the blackbody trajectory are unevenly distributed, sparse in low color temperature areas and dense in high color temperature areas). This interpolation method further aggravates the CCM calculation error of such light sources.
[0032] Since the traditional CCM algorithm is not suitable for scenes illuminated by low color rendering light sources, it often produces a large number of color overflow (less than 0 or greater than 1 after normalization) pixels during color correction. The conventional image signal processor (ISP) will truncate the color overflow part, resulting in loss of image content and reduced layering.
[0033] An embodiment of the present application provides a method for determining a color correction matrix. The method determines a reference color correction matrix of a target light source type based on a color correction matrix of at least one target reference light source corresponding to each target reference light source type, thereby ensuring that the reference color correction matrix can reflect the overall color characteristics of the target light source type. Further, based on the reference color correction matrix of each target reference light source type, a target color correction matrix corresponding to the target light source is determined, thereby ensuring that the target color correction matrix can provide consistent and high-quality color performance under various lighting conditions, reducing deviations in the color correction process, thereby improving the problem that the existing color correction matrix has poor adaptability under narrow-band light sources with low color rendering and is difficult to effectively adjust image colors.
[0034] See also Figure 1 , Figure 1 1 is a flow chart of a method for determining a color correction matrix provided in an embodiment of the present application. As shown in the figure, the method 100 includes:
[0035] S101: Determine at least one target reference light source type that is adjacent to the target light source in color according to the spectral power distribution of the target light source, wherein each of the target reference light source types includes at least one target reference light source that is closest to the target light source.
[0036] Among them, spectral power distribution is used to characterize the radiation intensity of the target light source at different wavelengths.
[0037] In specific implementation, the spectral power distribution (SPD) of the target light source can be measured by a spectral radiometer such as CL500. t , according to the measured spectral power distribution SPD t, determine at least one target reference light source type that is adjacent to the target light source color. For example, the similarity of spectral power distribution can be used to determine at least one target reference light source that is adjacent to the target light source color. The at least one target reference light source type is determined based on the at least one target reference light source. The spectral power distribution SPD of the target light source can also be used to determine the type of the at least one target reference light source. t The target light source is analyzed to obtain the light source spectrum characteristics of the target light source, including chromaticity coordinates, correlated color temperature, color characteristics, etc., and at least one target reference light source type that is adjacent to the target light source color is predicted based on the light source spectrum characteristics of the target light source.
[0038] In one possible implementation, Figure 2 As shown, in the above S101, determining at least one target reference light source type that is adjacent to the target light source in color according to the spectral power distribution of the target light source includes:
[0039] Step 1011: Based on the spectral power distribution of the target light source, determine the color difference component between the target light source and the reference illuminant; Step 1012: According to the color difference component, determine the probability value that the target light source belongs to a preset reference light source type; Step 1013: Determine the reference light source type whose probability value is greater than a preset probability threshold as the target reference light source type whose color is adjacent to the target light source.
[0040] In the embodiment of the present application, the color difference between the target light source and the reference illuminant in a specific scene can be determined based on the spectral power distribution of the target light source, and then the color difference component between the target light source and the reference illuminant is obtained, wherein the color difference component includes a color difference brightness component, a color difference chromaticity component, and a color difference hue component; according to the color difference component, the probability value of the target light source belonging to a preset reference light source type is determined, wherein the preset reference light source types include four types of light sources: daylight, tungsten filament lamp, fluorescent lamp, and light emitting diode (LED), and the probability of the target light source belonging to the preset reference light source type is divided into r D 、r H 、r F 、r L . The probability value r x ,(x∈{D,H,F,L}) is greater than the preset probability threshold T r The reference light source type is determined to be a target reference light source type that is close to the target light source color.
[0041] In a possible implementation, in step 1011, determining the color difference component between the target light source and the reference illuminant based on the spectral power distribution of the target light source includes:
[0042] In a uniform color space, the color difference brightness component, the color difference chroma component and the color difference hue component of the color sample under the reference illuminant and the target light source are obtained; and the color difference component between the target light source and the reference illuminant is determined according to the color difference brightness component, the color difference chroma component and the color difference hue component.
[0043] In the embodiment of the present application, in the uniform color space sUCS, for the 99 color samples used by TM-30-20, the color difference lightness component ΔL, the color difference chroma component ΔC, and the color difference hue component ΔH between the target light source and the reference illuminant are determined. The color difference component between the target light source and the reference illuminant is determined based on the color difference lightness component ΔL, the color difference chroma component ΔC, and the color difference hue component ΔH, wherein the color difference component may be one or more of the color difference lightness component ΔL, the color difference chroma component ΔC, and the color difference hue component ΔH, or may be a result obtained by weighted operation of the color difference lightness component ΔL, the color difference chroma component ΔC, and the color difference hue component ΔH, which is not specifically limited here.
[0044] In a possible implementation, in step 1012, determining the probability value of the target light source belonging to a preset reference light source type according to the color difference component includes:
[0045] The color difference component is input into a pre-trained target classification model, and the probability value of the target light source belonging to a preset reference light source type is determined by the target classification model.
[0046] In the embodiment of the present application, the probability value of the target light source belonging to the preset reference light source type can be determined by a pre-trained target classification model. For example, by inputting the color difference components ΔL, ΔC, and ΔH into the pre-trained target classification model, the probability values r of the target light source belonging to the four types of light sources: daylight, tungsten lamp, fluorescent lamp, and LED are obtained. D 、r H 、r F 、r L .
[0047] Among them, the training methods of the target classification model include:
[0048] A plurality of reference light sources are selected at set intervals from within the color parameter range corresponding to the preset reference light source type; the reference illuminant is selected according to a reference illuminant selection rule; the color difference brightness component, color difference chroma component and color difference hue component between the plurality of reference light sources and the reference illuminant are obtained in a uniform color space to construct a training sample set; the machine learning model is trained using the training sample set, and the trained machine learning model is determined as the target classification model.
[0049] In the embodiment of the present application, for four types of light sources, namely, daylight, tungsten lamp, fluorescent lamp and LED, the color parameter ranges are as shown in Table 1:
[0050] Table 1 Reference light source selection method
[0051] Light source type CCT Range Duv Range sunlight 4500K~7000K -0.01~0.01 Tungsten lamp 2000K~3500K -0.005~0.005 Fluorescent lamp 2500K~4500K -0.015~0.015 led 1500K~10000K -0.2~0.2
[0052] Can be set A plurality of reference light sources are selected at equal intervals within the range of the color parameters (CCT and Duv) in Table 1, with an interval of 1 / 500 and an interval of 0.005 for Duv.
[0053] For each reference light source, its spectral power distribution SPD is measured by a spectral radiometer CL500 or other equipment, and the corresponding reference illuminant is selected according to the reference illuminant selection rule (for example, the method in the color rendering index TM-30-20). In the uniform color space sUCS, for the 99 color samples used in TM-30-20, the color difference lightness component ΔL, the color difference chroma component ΔC, and the color difference hue component ΔH between multiple reference light sources and the reference illuminant are determined to construct a training sample set. The constructed training sample set is used to train a preset machine learning model (for example, a softmax regression model) to obtain a target classification model.
[0054] S102: Determine a reference color correction matrix of the target light source type according to the color correction matrix of at least one target reference light source corresponding to each target reference light source type.
[0055] In a specific implementation, at least one target reference light source corresponding to a target reference light source type may be obtained, and a reference color correction matrix of the target light source type may be determined based on a color correction matrix of the at least one target reference light source. In this way, it may be ensured that the reference color correction matrix can reflect the overall color characteristics of the target light source type.
[0056] In one possible implementation, Figure 3 As shown, in the above S102, determining the reference color correction matrix of the target light source type according to the color correction matrix of at least one target reference light source corresponding to each target reference light source type includes:
[0057] Step 1021: Obtain at least one target reference light source corresponding to each of the target reference light source types; Step 1022: Obtain a color correction matrix corresponding to each of the target reference light sources; Step 1023: Perform bilinear interpolation based on the color correction matrix of the target reference light source to obtain a reference color correction matrix of the target light source type.
[0058] In the present application embodiment, for r x>T r , obtaining at least one target reference light source corresponding to each target reference light source type, wherein at least one target reference light source is adjacent to the target light source, and obtaining a color correction matrix CCM corresponding to each target reference light source r , using bilinear interpolation, calculate the reference color correction matrix CCM corresponding to the target light source type tx ,(x∈{D,H,F,L}).
[0059] In a possible implementation, in step 1022, obtaining a color correction matrix corresponding to each of the target reference light sources includes:
[0060] Acquire an initial color correction matrix of the at least one target reference light source; acquire a captured image of a standard color card under the target reference light source; determine a loss function according to a color response value of the standard color card in the captured image and a color standard value of the standard color card; and adjust the initial color correction matrix based on the loss function to obtain a color correction matrix of the at least one target reference light source.
[0061] In the embodiment of the present application, for each target reference light source, an initial color correction matrix CCM of the target reference light source can be obtained, an image of a standard color card (classic color card) under the target reference light source is captured by a camera device, and color response values of 24 color blocks in the classic color card are extracted. According to the color response values and the color standard values of the classic color card, the CIEDE2000 color difference is determined, and the CIEDE2000 color difference is used as a loss function to fit the CCM to obtain the color correction matrix CCM of the target reference light source. r .
[0062] In a possible implementation, in step 1021, obtaining at least one target reference light source corresponding to each target reference light source type includes:
[0063] According to the spectral power distribution of the target light source, at least one color parameter of the target light source is determined; according to the at least one color parameter of the target light source, a target reference light source whose color is adjacent to the target light source is obtained from a plurality of reference light sources corresponding to each type of the target reference light source.
[0064] In the embodiment of the present application, the spectral power distribution SPD of the target light source can be tAn analysis is performed to determine at least one color parameter of the target light source (for example, chromaticity coordinates, correlated color temperature, etc.), and based on the at least one color parameter, a number of target reference light sources whose colors are close to the target light source are selected from a plurality of reference light sources corresponding to each type of target reference light source. In this way, by quantifying and describing the color characteristics of the target light source through at least one color parameter, a target reference light source that better matches the target light source can be selected.
[0065] Among them, the color parameters include microconductivity and color coordinate difference Duv t The above-mentioned step of determining at least one color parameter of the target light source according to the spectral power distribution of the target light source comprises:
[0066] The spectral power distribution of the target light source is reconstructed using an ambient light sensor; the light source chromaticity coordinates corresponding to the spectral power distribution in the chromaticity diagram are determined; and the microconductance and color coordinate difference of the target light source are determined based on the light source chromaticity coordinates and the blackbody locus in the chromaticity diagram.
[0067] In the embodiment of the present application, an ambient light sensor (including a spectral sensor, a photoelectric sensor, a photodiode, etc.) can be used to reconstruct the spectral power distribution SPD of the target light source. t Taking the ambient light sensor of a mobile phone as an example, it has 8 to 10 channels, each of which measures the light intensity within a specific wavelength range. In order to obtain a spectrum (for example, the wavelength is evenly distributed in the visible light band, from 380 to 700nm, with an interval of 10nm, which can be regarded as a 33-dimensional high-dimensional data), spectral reconstruction is required to map the data of these limited channels to a higher-dimensional space, that is, 33-dimensional spectral data.
[0068] Spectral Power Distribution SPD t Integrate with the CIE1931 standard observer spectrum tristimulus value curve to determine the chromaticity coordinates (such as XYZ coordinates) of the target light source, and convert the chromaticity coordinates into the light source chromaticity coordinates (x, y) in the CIE1976UCS chromaticity diagram. On the CIE1976UCS chromaticity diagram, the black body locus represents the chromaticity coordinates of an ideal black body radiation source with different color temperatures. By comparing the light source chromaticity coordinates of the target light source with the point on the closest black body locus, the microconductivity can be inferred. Color coordinate difference Duv t It is the distance between the chromaticity coordinates of the target light source and the point on the closest blackbody locus.
[0069] The above-mentioned step of obtaining, according to at least one color parameter of the target light source, a target reference light source having a color adjacent to the target light source among the multiple reference light sources corresponding to each type of the target reference light source, includes:
[0070] Determine the distance between the target light source and the multiple reference light sources based on at least one color parameter of the target light source and calibration parameters of the multiple reference light sources corresponding to the at least one color parameter; and acquire a target reference light source whose color is adjacent to the target light source based on the distance between the target light source and the multiple reference light sources.
[0071] In the embodiment of the present application, at least one color parameter ( Duv t ) and a calibration parameter corresponding to at least one color parameter of a reference light source ( Duv), determine the distance d between the target light source and the reference light source. The specific formula is as follows:
[0072]
[0073] Among them, c1 and c2 are constants and can be set manually according to actual needs, for example, c1=500, c2=200.
[0074] Furthermore, according to the distance d between the target light source and the reference light source, a target reference light source whose color is close to the target light source among the pre-calibrated reference light sources is determined. For example, a reference light source whose distance is less than a preset distance threshold is selected as the target reference light source.
[0075] In a possible implementation, the step of acquiring a target reference light source having a color close to the target light source according to the distance between the target light source and the plurality of reference light sources includes:
[0076] According to the distance between the target light source and the multiple reference light sources, a candidate reference light source among the multiple reference light sources is determined; and according to the calibration parameters of the candidate reference light sources and the predetermined deviation range corresponding to each color parameter of the target light source, a target reference light source whose color is adjacent to the target light source is obtained from the candidate reference light sources.
[0077] In the embodiment of the present application, the pre-calibrated reference light sources can be sorted according to the distance d between the target light source and the reference light source, and 1 to 4 reference light sources closest to the target light source can be selected. Duv t When all are within the corresponding predetermined deviation range, the target light source has 4 nearest target reference light sources. Duv t When they are respectively outside the corresponding predetermined deviation range, the number of the nearest target reference light sources decreases.
[0078] S103: Determine a target color correction matrix corresponding to the target light source based on the reference color correction matrix of each target reference light source type.
[0079] In a specific implementation, a target color correction matrix corresponding to the target light source is determined based on a reference color correction matrix for each target reference light source type. This ensures that the target color correction matrix can provide consistent and high-quality color performance under various lighting conditions, thereby improving color reproduction performance under a specific light source.
[0080] In a possible implementation, in S103, determining a target color correction matrix corresponding to the target light source based on the reference color correction matrix of each type of the target reference light source includes:
[0081] Obtain a probability value that the target light source belongs to each of the target reference light source types; determine an interpolation ratio for each of the target reference light source types based on the probability value corresponding to each of the target reference light source types; and obtain a target color correction matrix corresponding to the target light source based on the interpolation ratio for each of the target reference light source types and the reference color correction matrix.
[0082] In an exemplary embodiment, the interpolation ratio corresponding to each light source type may be determined according to the following formula:
[0083]
[0084] Among them, r xi is the interpolation ratio corresponding to the i-th light source, r xi is the probability value that the target light source belongs to the i-th type of light source x, x∈{D,H,F,L}, T r is the preset threshold. In specific applications, r can be calculated x >T r The interpolation ratio corresponding to the light source type is x ≤T r The interpolation ratio of the light source type can be set to 0.
[0085] Then, the reference color correction matrix of each target reference light source type is adjusted by the following formula to obtain the target color correction matrix of the target light source:
[0086]
[0087] Among them, CCM t is the target color correction matrix, CCM tx is the reference color correction matrix.
[0088] In an exemplary embodiment, if Figure 4 As shown, the above method for determining the color correction matrix can be divided into a preparation process and a calculation process, and the preparation process includes:
[0089] Step 411: For four types of light sources, namely, daylight, tungsten lamp, fluorescent lamp and LED, reference light sources are selected at equal intervals;
[0090] Step 412: training a softmax regression model (i.e., the above-mentioned machine learning model) to output the probability that the target light source belongs to each type of light source;
[0091] Step 413: For each reference light source, calibrate the CCM using a standard color chart.
[0092] The calculation process includes:
[0093] Step 421: The ambient light sensor reconstructs the SPD of the target light source t ;
[0094] Step 422: ΔL, ΔC and ΔH of 99 samples in TM-30-20;
[0095] Step 423: input ΔL, ΔC and ΔH into the trained softmax regression model (i.e., the target classification model mentioned above), and output the probability that the target light source belongs to each type of light source;
[0096] Step 424: determining at least one color parameter of the target light source according to the spectral power distribution of the target light source;
[0097] Step 425: According to the probability that the target light source belongs to each type of light source and at least one color parameter, the calibrated CCM is screened and interpolated to obtain the target color correction matrix CCM of the target light source. t .
[0098] The method for determining a color correction matrix provided in the embodiment of the present application can be executed by a device for determining a color correction matrix. In the embodiment of the present application, the device for determining a color correction matrix performing the method for determining a color correction matrix is taken as an example to illustrate the device for determining a color correction matrix provided in the embodiment of the present application.
[0099] Figure 5 is a structural diagram of a device for determining a color correction matrix provided in an embodiment of the present application. As shown in the figure, the device 500 for determining a color correction matrix includes:
[0100] A light source type determination module 510 is used to determine a target reference light source type that is adjacent to the target light source in color according to the spectral power distribution of the target light source, each of the target reference light source types including at least one target reference light source that is closest to the target light source;
[0101] A first matrix determination module 520, configured to determine a reference color correction matrix of the target light source type according to a color correction matrix of at least one target reference light source corresponding to each target reference light source type;
[0102] The second matrix determination module 530 is configured to determine a target color correction matrix corresponding to the target light source based on the reference color correction matrix of each type of the target reference light source.
[0103] In a possible implementation, the light source type determination module 510 includes:
[0104] a color difference component determination unit, configured to determine a color difference component between the target light source and a reference illuminant based on a spectral power distribution of the target light source;
[0105] A probability value determination unit, used to determine a probability value that the target light source belongs to a preset reference light source type according to the color difference component;
[0106] The light source type determination unit is used to determine the reference light source type whose probability value is greater than a preset probability threshold as a target reference light source type that is adjacent to the target light source color.
[0107] In a possible implementation manner, the color difference component determining unit, when used to determine the color difference component between the target light source and the reference illuminant based on the spectral power distribution of the target light source, is specifically used to:
[0108] In a uniform color space, obtaining a color difference brightness component, a color difference chroma component, and a color difference hue component of the color sample under the reference illuminant and the target light source;
[0109] The color difference component between the target light source and the reference illuminant is determined according to the color difference brightness component, the color difference chroma component and the color difference hue component.
[0110] In a possible implementation manner, the probability value determination unit, when used to determine the probability value that the target light source belongs to a preset reference light source type according to the color difference component, is specifically used to:
[0111] The color difference component is input into a pre-trained target classification model, and the probability value of the target light source belonging to a preset reference light source type is determined by the target classification model.
[0112] In a possible implementation, the first matrix determination module 520 includes:
[0113] A reference light source acquisition unit, configured to acquire at least one target reference light source corresponding to each target reference light source type;
[0114] A correction matrix acquisition unit, used to acquire a color correction matrix corresponding to each of the target reference light sources;
[0115] A bilinear interpolation unit is used to perform bilinear interpolation based on the color correction matrix of the target reference light source to obtain a reference color correction matrix of the target light source type.
[0116] In a possible implementation, the correction matrix acquisition unit, when used to acquire the color correction matrix corresponding to each of the target reference light sources, is specifically used to:
[0117] Acquire an initial color correction matrix of the at least one target reference light source;
[0118] Acquire a photographic image of a standard color card under the target reference light source;
[0119] Determining a loss function according to a color response value of a standard color card in the captured image and a color standard value of the standard color card;
[0120] The initial color correction matrix is adjusted based on the loss function to obtain a color correction matrix for the at least one target reference light source.
[0121] In a possible implementation manner, the reference light source acquisition unit, when used to acquire at least one target reference light source corresponding to each target reference light source type, is specifically configured to:
[0122] Determining at least one color parameter of the target light source according to the spectral power distribution of the target light source;
[0123] According to at least one color parameter of the target light source, a target reference light source having a color adjacent to the target light source is obtained from the plurality of reference light sources corresponding to each type of the target reference light source.
[0124] In a possible implementation, the color parameter includes a microconductance and a color coordinate difference; and the reference light source acquisition unit, when used to determine at least one color parameter of the target light source according to the spectral power distribution of the target light source, is specifically used to:
[0125] reconstructing the spectral power distribution of the target light source using an ambient light sensor;
[0126] Determine the light source chromaticity coordinates corresponding to the spectral power distribution in the chromaticity diagram;
[0127] The microconductance and color coordinate difference of the target light source are determined according to the light source chromaticity coordinates and the black body locus in the chromaticity diagram.
[0128] In a possible implementation manner, the reference light source acquisition unit, when used to acquire, according to at least one color parameter of the target light source, a target reference light source having a color adjacent to the target light source among the multiple reference light sources corresponding to each target reference light source type, is specifically used to:
[0129] determining a distance between the target light source and the plurality of reference light sources according to at least one color parameter of the target light source and calibration parameters of the plurality of reference light sources corresponding to the at least one color parameter;
[0130] A target reference light source having a color close to that of the target light source is acquired according to the distance between the target light source and the plurality of reference light sources.
[0131] In a possible implementation, the second matrix determination module 530 includes:
[0132] A probability value acquisition unit, used to acquire a probability value that the target light source belongs to each of the target reference light source categories;
[0133] an interpolation ratio determination unit, configured to determine an interpolation ratio of each of the target reference light source types according to a probability value corresponding to each of the target reference light source types;
[0134] The correction matrix acquisition unit is used to obtain a target color correction matrix corresponding to the target light source based on the interpolation ratio of each type of the target reference light source and the reference color correction matrix.
[0135] The embodiment of the present application provides a device for determining a color correction matrix, including a light source type determination module, a first matrix determination module, and a second matrix determination module; the light source type determination module determines the target reference light source type that is adjacent to the target light source color according to the spectral power distribution of the target light source, and each target reference light source type includes at least one target reference light source that is closest to the target light source; the first matrix determination module determines the reference color correction matrix of the target light source type according to the color correction matrix of at least one target reference light source corresponding to each target reference light source type; the second matrix determination module is used to determine the target color correction matrix corresponding to the target light source based on the reference color correction matrix of each target reference light source type. In this way, it can be ensured that the target color correction matrix can provide consistent and high-quality color performance under various lighting conditions, improve the color reproduction performance under specific light sources, and thus meet the requirements for color accuracy in specific application scenarios such as bars and stages.
[0136] Alternatively, if Figure 6As shown, an embodiment of the present application also provides an electronic device 600, including a processor 601 and a memory 602, and the memory 602 stores a program or instruction that can be executed on the processor 601. When the program or instruction is executed by the processor 601, the various steps of the power supply voltage control method embodiment of the above-mentioned RF power amplifier are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0137] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0138] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0139] The electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.
[0140] Those skilled in the art will appreciate that the electronic device 700 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 710 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0141] The processor 710 is used to determine at least one target reference light source type that is adjacent to the target light source in color according to the spectral power distribution of the target light source, and each of the target reference light source types includes at least one target reference light source that is closest to the target light source;
[0142] Determining a reference color correction matrix of the target light source type according to a color correction matrix of at least one target reference light source corresponding to each target reference light source type;
[0143] Based on the reference color correction matrix of each target reference light source type, a target color correction matrix corresponding to the target light source is determined.
[0144] In an embodiment of the present application, a reference color correction matrix for a target light source type is determined based on a color correction matrix of at least one target reference light source corresponding to each target reference light source type, thereby ensuring that the reference color correction matrix can reflect the overall color characteristics of the target light source type. Furthermore, based on the reference color correction matrix for each target reference light source type, a target color correction matrix corresponding to the target light source is determined, thereby ensuring that the target color correction matrix can provide consistent and high-quality color performance under various lighting conditions, thereby improving the color reproduction performance under a specific light source, and thereby meeting the requirements for color accuracy in specific application scenarios such as bars and stages.
[0145] In some embodiments, the processor 710, when used to determine at least one target reference light source type that is adjacent to the target light source in color according to the spectral power distribution of the target light source, is specifically used to:
[0146] Determining a color difference component between the target light source and a reference illuminant based on the spectral power distribution of the target light source;
[0147] Determining, according to the color difference component, a probability value that the target light source belongs to a preset reference light source type;
[0148] The reference light source type whose probability value is greater than a preset probability threshold is determined as a target reference light source type that is adjacent to the target light source color.
[0149] In some embodiments, the processor 710, when used to determine the color difference component between the target light source and the reference illuminant based on the spectral power distribution of the target light source, is specifically used to:
[0150] In a uniform color space, obtaining a color difference brightness component, a color difference chroma component, and a color difference hue component of the color sample under the reference illuminant and the target light source;
[0151] The color difference component between the target light source and the reference illuminant is determined according to the color difference brightness component, the color difference chroma component and the color difference hue component.
[0152] In some embodiments, the processor 710, when used to determine the probability value that the target light source belongs to a preset reference light source type according to the color difference component, is specifically used to:
[0153] The color difference component is input into a pre-trained target classification model, and the probability value of the target light source belonging to a preset reference light source type is determined by the target classification model.
[0154] In some embodiments, the processor 710, when used to determine the reference color correction matrix of the target light source type according to the color correction matrix of at least one target reference light source corresponding to each target reference light source type, is specifically used to:
[0155] Acquire at least one target reference light source corresponding to each target reference light source type;
[0156] Obtaining a color correction matrix corresponding to each of the target reference light sources;
[0157] Bilinear interpolation is performed based on the color correction matrix of the target reference light source to obtain a reference color correction matrix of the target light source type.
[0158] In some embodiments, the processor 710, when used to obtain the color correction matrix corresponding to each of the target reference light sources, is specifically used to:
[0159] Acquire an initial color correction matrix of the at least one target reference light source;
[0160] Acquire a photographic image of a standard color card under the target reference light source;
[0161] Determining a loss function according to a color response value of a standard color card in the captured image and a color standard value of the standard color card;
[0162] The initial color correction matrix is adjusted based on the loss function to obtain a color correction matrix for the at least one target reference light source.
[0163] In some embodiments, the processor 710, when used to obtain at least one target reference light source corresponding to each target reference light source type, is specifically used to:
[0164] Determining at least one color parameter of the target light source according to the spectral power distribution of the target light source;
[0165] According to at least one color parameter of the target light source, a target reference light source having a color adjacent to the target light source is obtained from the plurality of reference light sources corresponding to each type of the target reference light source.
[0166] In some embodiments, the color parameter includes microconductance and color coordinate difference; the processor 710, when used to determine at least one color parameter of the target light source according to the spectral power distribution of the target light source, is specifically used to:
[0167] reconstructing the spectral power distribution of the target light source using an ambient light sensor;
[0168] Determine the light source chromaticity coordinates corresponding to the spectral power distribution in the chromaticity diagram;
[0169] The microconductance and color coordinate difference of the target light source are determined according to the light source chromaticity coordinates and the black body locus in the chromaticity diagram.
[0170] In some embodiments, the processor 710, when used to obtain, according to at least one color parameter of the target light source, a target reference light source having a color adjacent to the target light source among the multiple reference light sources corresponding to each type of the target reference light source, is specifically used to:
[0171] determining a distance between the target light source and the plurality of reference light sources according to at least one color parameter of the target light source and calibration parameters of the plurality of reference light sources corresponding to the at least one color parameter;
[0172] A target reference light source having a color close to that of the target light source is acquired according to the distance between the target light source and the plurality of reference light sources.
[0173] In some embodiments, the processor 710, when used to determine the target color correction matrix corresponding to the target light source based on the reference color correction matrix of each type of the target reference light source, is specifically used to:
[0174] Obtaining a probability value that the target light source belongs to each of the target reference light source categories;
[0175] Determining an interpolation ratio of each target reference light source type according to a probability value corresponding to each target reference light source type;
[0176] Based on the interpolation ratio of each of the target reference light source types and the reference color correction matrix, a target color correction matrix corresponding to the target light source is obtained.
[0177] The electronic device 700 provided in the embodiment of the present application can also implement the various processes of the above-mentioned color correction matrix determination method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0178] It should be understood that in the embodiment of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 707 includes a touch panel 7071 and at least one of other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts: a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0179] The memory 709 can be used to store software programs and various data. The memory 709 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 709 may include a volatile memory or a non-volatile memory, or the memory 709 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 709 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0180] The processor 710 may include one or more processing units; optionally, the processor 710 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 710.
[0181] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned color correction matrix determination method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0182] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0183] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned color correction matrix determination method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0184] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0185] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned color correction matrix determination method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0186] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0187] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0188] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for determining a color correction matrix, characterized in that: include: Determine at least one target reference light source type that is adjacent to the target light source in color according to the spectral power distribution of the target light source, each of the target reference light source types including at least one target reference light source that is closest to the target light source; Determining a reference color correction matrix of the target light source type according to a color correction matrix of at least one target reference light source corresponding to each target reference light source type; Based on the reference color correction matrix of each target reference light source type, a target color correction matrix corresponding to the target light source is determined.
2. The method according to claim 1, characterized in that The step of determining at least one target reference light source type having a color adjacent to the target light source according to the spectral power distribution of the target light source comprises: Determining a color difference component between the target light source and a reference illuminant based on the spectral power distribution of the target light source; Determining, according to the color difference component, a probability value that the target light source belongs to a preset reference light source type; The reference light source type whose probability value is greater than a preset probability threshold is determined as a target reference light source type that is adjacent to the target light source color.
3. The method according to claim 2, characterized in that The step of determining the color difference component between the target light source and a reference illuminant based on the spectral power distribution of the target light source comprises: In a uniform color space, obtaining a color difference brightness component, a color difference chroma component, and a color difference hue component of the color sample under the reference illuminant and the target light source; The color difference component between the target light source and the reference illuminant is determined according to the color difference brightness component, the color difference chroma component and the color difference hue component.
4. The method according to claim 2, characterized in that: The determining, according to the color difference component, a probability value that the target light source belongs to a preset reference light source type includes: The color difference component is input into a pre-trained target classification model, and the probability value of the target light source belonging to a preset reference light source type is determined by the target classification model.
5. The method according to claim 1, characterized in that The step of determining the reference color correction matrix of the target light source type according to the color correction matrix of at least one target reference light source corresponding to each target reference light source type comprises: Acquire at least one target reference light source corresponding to each target reference light source type; Obtaining a color correction matrix corresponding to each of the target reference light sources; Bilinear interpolation is performed based on the color correction matrix of the target reference light source to obtain a reference color correction matrix of the target light source type.
6. The method according to claim 5, characterized in that The obtaining of the color correction matrix corresponding to each of the target reference light sources includes: Acquire an initial color correction matrix of the at least one target reference light source; Acquire a photographic image of a standard color card under the target reference light source; Determining a loss function according to a color response value of a standard color card in the captured image and a color standard value of the standard color card; The initial color correction matrix is adjusted based on the loss function to obtain a color correction matrix for the at least one target reference light source.
7. The method according to claim 5, characterized in that The acquiring at least one target reference light source corresponding to each target reference light source type includes: Determining at least one color parameter of the target light source according to the spectral power distribution of the target light source; According to at least one color parameter of the target light source, a target reference light source having a color adjacent to the target light source is obtained from the plurality of reference light sources corresponding to each type of the target reference light source.
8. The method according to claim 7, characterized in that The color parameters include microconductance and color coordinate difference; the step of determining at least one color parameter of the target light source according to the spectral power distribution of the target light source includes: reconstructing the spectral power distribution of the target light source using an ambient light sensor; Determine the light source chromaticity coordinates corresponding to the spectral power distribution in the chromaticity diagram; The microconductance and color coordinate difference of the target light source are determined according to the light source chromaticity coordinates and the black body locus in the chromaticity diagram.
9. The method according to claim 7, characterized in that: The step of acquiring, according to at least one color parameter of the target light source, a target reference light source having a color adjacent to the target light source among a plurality of reference light sources corresponding to each type of the target reference light source, comprises: determining a distance between the target light source and the plurality of reference light sources according to at least one color parameter of the target light source and calibration parameters of the plurality of reference light sources corresponding to the at least one color parameter; A target reference light source having a color close to that of the target light source is acquired according to the distance between the target light source and the plurality of reference light sources.
10. The method according to claim 1, characterized in that The step of determining a target color correction matrix corresponding to the target light source based on the reference color correction matrix of each type of the target reference light source includes: Obtaining a probability value that the target light source belongs to each of the target reference light source categories; Determining an interpolation ratio of each target reference light source type according to a probability value corresponding to each target reference light source type; Based on the interpolation ratio of each of the target reference light source types and the reference color correction matrix, a target color correction matrix corresponding to the target light source is obtained.
11. A device for determining a color correction matrix, characterized in that: include: A light source type determination module, configured to determine a target reference light source type that is adjacent to the target light source in color according to the spectral power distribution of the target light source, wherein each of the target reference light source types includes at least one target reference light source that is closest to the target light source; A first matrix determination module, configured to determine a reference color correction matrix of the target light source type according to a color correction matrix of at least one target reference light source corresponding to each target reference light source type; The second matrix determination module is used to determine a target color correction matrix corresponding to the target light source based on the reference color correction matrix of each type of the target reference light source.
12. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 11 are implemented.
Citation Information
Cited By
Image color calibration method and device, electronic equipment and storage medium
CN121505053A
