Color temperature determination method and device, electronic equipment and storage medium

By using the compensation matrix to perform compensation conversion on the RGB of the target image, the problem of low accuracy in image color temperature determination is solved, and higher accuracy and consistency in color temperature determination are achieved.

CN120050537APending Publication Date: 2025-05-27GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510147001.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In the prior art, the actual color temperature determination accuracy of the image is low, especially in automatic white balance algorithms.

Method used

The target color temperature of the image in the target chromaticity system is determined by obtaining the RGB of the target block in the target image and performing compensation conversion using the compensation matrix obtained by shooting under a standard light source based on the test card.

Benefits of technology

The accuracy of the actual color temperature of the image is improved, and the color uneven difference is compensated through the compensation matrix to ensure the accuracy and consistency of color temperature determination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050537A_ABST
    Figure CN120050537A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a color temperature determination method and device, electronic equipment and a storage medium. Relates to the technical field of images. The method is applied to electronic equipment, and comprises the steps of obtaining a target image, compensating RGB of a target block according to red, green and blue RGB of the target block in the target image and each compensation matrix, converting the RGB into a target chromaticity system, and determining a target color temperature of the target image in the target chromaticity system. Wherein each compensation matrix is obtained by carrying out human eye calibration on an image shot by the test card under each standard color temperature of the standard light source, and the target block is a block in each block divided by the target image, and the RGB of the target block and the RGB of the test card are in a preset range; the target chromaticity system is a CIE UV chromaticity system or a CIE LUV chromaticity system. According to the scheme, the non-uniform color difference is compensated by using the compensation matrix, and the accuracy of the determined actual color temperature of the image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of image technology, and in particular, to a method, device, electronic device, and storage medium for determining color temperature. Background Art

[0002] With the development of science and technology, various electronic devices have emerged in people's daily lives. People can use electronic devices to take pictures and display the captured images.

[0003] Among them, for the acquired images, if an electronic device can timely and accurately determine the color temperature of the image, it is of great significance for the final effect of subsequent display of the image. At present, the more common method for determining color temperature is based on the Auto White Balance (AWB) algorithm, which has the problem of low accuracy in determining the actual color temperature of the image. Summary of the Invention

[0004] In order to solve the problems of related technologies and improve the accuracy of determining the current actual color temperature of an image, embodiments of the present application provide a method, device, electronic device, and storage medium for determining color temperature. The technical solutions are as follows:

[0005] On the one hand, embodiments of the present application provide a method for determining color temperature, which is applied to an electronic device. The method includes:

[0006] Obtain a target image;

[0007] According to the Red-Green-Blue (RGB) values of the target block in the target image and each compensation matrix, compensate the RGB of the target block and convert it to the target colorimetric system to determine the target color temperature of the target image in the target colorimetric system;

[0008] Wherein, each compensation matrix is obtained by human eye calibration of the images captured from a test card under various standard color temperatures of a standard light source, and the target block is the block in each block divided from the target image whose RGB values are within a preset range of the RGB values of the test card; the target colorimetric system is the International Commission on Illumination (CIE) UV colorimetric system or the CIE LUV colorimetric system.

[0009] On the other hand, embodiments of the present application provide a device for determining color temperature, which is applied to an electronic device. The device includes:

[0010] A first acquisition module, configured to obtain a target image;

[0011] A first determination module, configured to compensate the RGB of the target block according to the red, green, and blue (RGB) of the target block in the target image and each compensation matrix, and convert it to a target color temperature system, and determine the target color temperature of the target image in the target color temperature system.

[0012] Wherein, each of the compensation matrices is obtained by performing human eye calibration on images captured of a test card under each standard color temperature of a standard light source, and the target block is a block in each block divided from the target image whose RGB is within a preset range of the RGB of the test card; the target color temperature system is the International Commission on Illumination (CIE) UV color temperature system or the CIE LUV color temperature system.

[0013] On the other hand, the present application provides an electronic device, which includes a processor and a memory. The memory stores a computer program that can run on the processor, and when the processor executes the computer program, it implements the color temperature determination method as described in the above aspect.

[0014] On the other hand, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the color temperature determination method as described in the above aspect.

[0015] On the other hand, the embodiments of the present application provide a computer program product, and when the computer program product runs on a computer, it causes the computer to execute to implement the color temperature determination method as described in the above aspect.

[0016] On the other hand, the embodiments of the present application provide an application publishing platform, which is used to publish a computer program product. Wherein, when the computer program product runs on a computer, it causes the computer to execute to implement the color temperature determination method as described in the above aspect.

[0017] The beneficial effects brought by the technical solutions provided by the embodiments of the present application at least include:

[0018] After the electronic device obtains the target image, it can compensate the RGB of the target block according to the RGB of the target block in the target image and each compensation matrix, and convert it to the target chromaticity system to determine the target color temperature of the target image in the target chromaticity system. Among them, each compensation matrix is obtained by human eye calibration of the images taken of the test card under each standard color temperature of the standard light source. The target block is the block in each block divided by the target image whose RGB is within the preset range of the test card; the target chromaticity system is the International Commission on Illumination (CIE) UV chromaticity system or the CIE LUV chromaticity system. In this application, the compensation matrices can be obtained in advance by human eye calibration of the images taken of the test card under each standard color temperature. When determining the color temperature, each compensation matrix is used to compensate the RGB of the target block and convert it to the target chromaticity system to determine the target color temperature of the target image in the target chromaticity system. In the whole process, the RGB of the target block is compensated by the compensation matrix and converted to the target chromaticity system, without the need to calculate in the Rpg, Bpg coordinate system. The colors in the target chromaticity system are more uniform, and the compensation matrix is also used to compensate the non-uniform color differences, thereby improving the accuracy of the actual color temperature of the determined image. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0020] Figure 1 It is a schematic structural diagram of an example of an electronic device provided by an exemplary embodiment of the present application;

[0021] Figure 2 It is a statistical schematic diagram of a statistical landing point distribution involved in an exemplary embodiment of the present application;

[0022] Figure 3 It is a flowchart of a method for determining color temperature provided by an exemplary embodiment of the present application;

[0023] Figure 4 It is a schematic diagram of a calibration process for obtaining each compensation matrix involved in an exemplary embodiment of the present application;

[0024] Figure 5 It is a flowchart of a method for determining color temperature provided by an exemplary embodiment of the present application;

[0025] Figure 6 It is a schematic diagram of the structure of a target image involved in an exemplary embodiment of the present application;

[0026] Figure 7 The flowchart of another method for determining color temperature provided by an exemplary embodiment of the present application;

[0027] Figure 8 The flowchart of yet another method for determining color temperature provided by an exemplary embodiment of the present application;

[0028] Figure 9 The schematic diagram of the process for evaluating the color temperature of an image in the UV coordinate system in a mobile phone involved in an exemplary embodiment of the present application;

[0029] Figure 10 The structural block diagram of the color temperature determination device provided by an exemplary embodiment of the present application;

[0030] Figure 11 The structural schematic diagram of another example of the color temperature determination device provided by an embodiment of the present application. Detailed implementation manners

[0031] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all the implementation manners consistent with the present application. On the contrary, they are merely examples of the devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0032] As used herein, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0033] It should be noted that the terms "first", "second", and "third" involved in the embodiments of the present application are used to distinguish similar or different objects, and do not represent a specific order for the objects. It can be understood that "first", "second", and "third" can be interchanged in a specific order or sequence when allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0034] The solution provided by the present application can be used in the real scenario where people use an electronic device with an image sensor to capture an image and determine the current color temperature of the image in daily life. For the convenience of understanding, some terms and application scenarios involved in the embodiments of the present application are briefly introduced below.

[0035] Standard light source: It refers to an artificial light source that simulates various ambient light conditions, enabling a production factory or laboratory to obtain a lighting effect that is basically consistent with the light source in these specific environments even off-site. Standard light sources are usually installed in a standard light source box and are mainly used to detect color deviations of items. For example, several common international standard light sources established by the CIE as photometric benchmarks include: simulating blue sky daylight - D65 light source (color temperature: 6500K), simulating average northern sunlight - D75 light source (color temperature: 7500K), simulating sunlight - D50 light source (color temperature: 5000K), simulating European store lighting - TL84 light source (color temperature: 4000K), and so on.

[0036] CCT: correlated color temperature. For a light source on the blackbody locus, the temperature of the incandescent blackbody with the same chromaticity coordinates as it is taken as the color temperature. For a light source outside the blackbody locus, a perpendicular line is drawn from its chromaticity coordinates to the blackbody locus, and the color temperature of the incandescent blackbody corresponding to the intersection point of the perpendicular line and the blackbody locus is taken as the correlated color temperature.

[0037] Duv: delta uv, chromaticity coordinate difference. On the CIE1976UCS chromaticity diagram, it is the distance between the chromaticity coordinates of the light source and the blackbody locus.

[0038] Please refer to Figure 1 , which shows a schematic structural diagram of an example of an electronic device provided by an exemplary embodiment of the present application. As Figure 1 shown, the electronic device includes components such as a processor 110, a memory 120, a transceiver 130, a display unit 140, a sensor 150, and a battery module 160.

[0039] The processor 110 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 120, and by calling data stored in the memory 120, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 110 may include one or more processing units; optionally, the processor 110 may integrate an application processor, which mainly processes operating systems, user interfaces, and application programs. Of course, other processors may also be included, which will not be listed one by one here.

[0040] The memory 120 can be used to store software programs and modules. The processor 110 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 120. The memory 120 may mainly include a program storage area and a data storage area. Among them, the program storage area can store the operating device, application programs required for at least one function (such as the sound playback function, the image playback function, etc.); the data storage area can store the data created according to the use of the electronic device (such as audio data, phone book, etc.). In addition, the memory 120 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.

[0041] The transceiver 130 can provide wireless communication solutions applied to the electronic device, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. The transceiver 130 can be one or more devices integrating at least one communication processing module. For example, integrating the antenna with the baseband processor as the transceiver 130, or integrating the antenna and the modem processor as the transceiver 130, etc., which is not limited herein. Optionally, the electronic device can establish a wireless communication connection with the base station in the above Figure 1 through its own transceiver 130.

[0042] The display unit 140 can be used to display the information input by the user or the information provided to the user and various menus of the electronic device. The display unit 140 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc., which is not limited herein.

[0043] The electronic device may further include at least one sensor 150, such as a gyroscope sensor, a motion sensor, an image sensor, and other sensors. The motion sensor may include an acceleration sensor for detecting the magnitude of acceleration in each direction. When stationary, it can detect the magnitude and direction of gravity and can be used in applications for identifying the posture of the electronic device, such as horizontal and vertical screen switching, related games, magnetometer posture calibration, etc.; the image sensor can be used in modules such as the camera and webcam of the electronic device to collect information about the external scene through the image sensor; as for other sensors such as a pressure gauge, a barometer, a hygrometer, a thermometer, and an infrared sensor that the electronic device may also be configured with, they will not be elaborated here.

[0044] The electronic device further includes a battery module 160 for supplying power to each component. Optionally, the battery module 160 may be logically connected to the processor 110 through a power management device, so as to implement functions such as management of charging, discharging, and power consumption management through the power management device.

[0045] Although not shown, the electronic device may further include a camera. Optionally, the position of the camera on the electronic device may be front-facing or rear-facing, and the embodiments of the present application do not limit this.

[0046] It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0047] Among them, in the above-mentioned electronic device with a camera (i.e., an image sensor), after the electronic device takes an image, the main work done by the AWB algorithm in the image signal processor (ISP) of the camera is to restore the original Raw image captured by the image sensor into a picture with a correct white balance.

[0048] Under normal circumstances, the ISP generally performs statistics according to the granularity of pixels (pixel). For example, the 3A statistical data of the pixel granularity is downsampled and divided into multiple blocks for statistics. The traditional AWB algorithm will capture the gray block data in the image and calculate the landing point distributions of Rpg and Bpg in all blocks, and then compare them with the landing points of the gray area Rpg (the ratio of the red channel to the green channel in the pixel) and Bpg (the ratio of the blue channel to the green channel in the pixel) calibrated in advance under each standard color temperature, and count which color temperature calibration landing point the landing point calculated in real time mainly concentrates around, and apply a certain weight or interpolation operation, and finally obtain the most likely color temperature, which is considered to be the color temperature of the current actual environment.

[0049] Please refer to Figure 2 , which shows a statistical schematic diagram of the statistical distribution of the landing points involved in an exemplary embodiment of the present application. As Figure 2 shown, it includes the landing points of the standard color temperatures corresponding to each standard light source. CWF represents the simulated American store lighting (color temperature: 4100K), and A represents an incandescent spiral tungsten filament lamp with a color temperature of 2856K. Of course, in addition to Figure 2 the various standard light sources shown in are exemplary, and there will be more standard light sources in actual applications. If the landing points calculated in real time by statistics for a certain image are mainly concentrated around the D50 landing point in Figure 2 , then D50 can be considered as the color temperature of the actual environment of the current image.

[0050] Since the Rpg, Bpg coordinate system can be equivalent to the CIE xy coordinate system (note: the latter is a mathematical transformation of the former to eliminate the negative values in the rgb tristimulus value curve), and the CIE xy coordinate system is visually non-uniform. That is, in the related art, in the process of the AWB algorithm, calculations and evaluations are usually performed in the Rpg, Bpg coordinate system. First, the Rpg, Bpg landing point coordinates of the gray blocks under each standard color temperature range of the standard light source are calibrated, and then it is statistically determined which standard color temperature the several in the image are near the landing point corresponding to, and the color temperature of the image is evaluated by interpolation. Due to the influence of the non-uniform color in the Rpg, Bpg coordinate system adopted, the color temperature result calculated by interpolation in this space cannot reflect the deviation amount of the actual color temperature. Therefore, the color temperature result obtained after interpolation in the above manner is often inaccurate, that is, the color temperature obtained after traditional AWB performs white balance still has the problem of inaccuracy.

[0051] To solve the above problems existing in the related art, an embodiment of the present application provides a color temperature determination method, which can perform human eye calibration on the images collected of the test card under each standard color temperature of the standard light source in advance to obtain a compensation matrix, and compensate and convert the RGB of the target block to the target chromaticity system through the compensation matrix, so as to achieve the effect of compensating for the difference in visual perception non-uniformity and improve the accuracy of the determined actual color temperature of the image.

[0052] Please refer to Figure 3 , which shows a flowchart of a color temperature determination method provided by an exemplary embodiment of the present application. This color temperature determination method can be applied to an electronic device. As Figure 3 shown, this color temperature determination method may include the following steps:

[0053] Step 301, obtain a target image.

[0054] Optionally, in this solution, the electronic device may be a terminal device with an image sensor. For example, the electronic device may be, but is not limited to, a wearable device (such as a bracelet, a smart watch, smart glasses, etc.), a mobile phone, a tablet computer, a laptop computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a desktop computer, a laptop computer, etc.

[0055] Optionally, the target image may be any image captured by the electronic device through its own image sensor, or any image received by the electronic device and sent by other devices.

[0056] Step 302: According to the red, green, and blue (RGB) values of the target block in the target image and each compensation matrix, compensate the RGB of the target block and convert it to the target colorimetric system to determine the target color temperature of the target image in the target colorimetric system.

[0057] Among them, each compensation matrix is obtained by human eye calibration of the images captured of the test card under each standard color temperature of the standard light source. The target block is the block in each divided area of the target image whose RGB values are within a preset range of those of the test card; the target colorimetric system is the International Commission on Illumination (CIE) UV colorimetric system or the CIE LUV colorimetric system.

[0058] That is, each compensation matrix is set in the electronic device by developers after pre-shooting the test card under each standard color temperature of the standard light source and performing human eye calibration, so that the electronic device can use it when it needs to determine the color temperature of an image. In this solution, after the electronic device obtains the target image, it can compensate the RGB of the target block according to the RGB values of the target block in the target image and each compensation matrix, and convert the compensated target block to the target colorimetric system, and further determine the target color temperature of the target image in this target colorimetric system. The target color temperature is the color temperature of the actual environment estimated for the target image in this solution.

[0059] For example, taking M1 as one of the compensation matrices in each compensation matrix, the electronic device can perform a multiplication operation on the RGB of the target block in the target image with this M1 to obtain the RGB of the compensated target block, and convert it to the CIE UV chromaticity system. According to the coordinate values of the RGB obtained after compensation in the target chromaticity system, the target color temperature of the target image in this chromaticity system is determined. It should be noted that in this solution, the CIE UV chromaticity system refers to the color space calculated under the CIE UV coordinate system, and the CIE LUV chromaticity system refers to the color space calculated under the CIE LUV coordinate system. For the convenience of description, the CIE UV chromaticity system is equivalent to the CIE UV coordinate system, and the CIE LUV chromaticity system is equivalent to the CIE LUV coordinate system.

[0060] Optionally, after the electronic device obtains the target image, it samples and divides the target image to obtain multiple blocks. For example, it can be sampled and divided according to the 3A statistical data of the pixel granularity, so as to obtain multiple blocks. The target block can be a block among the blocks divided from the target image whose RGB is within a preset range from the RGB of the test card.

[0061] For example, the test card is a gray card, and the RGB of the gray card is (r_gray, g_gray, b_gray). Finding the target block from the divided blocks can be as follows: calculate the average of the RGB of each pixel point in each block to obtain the RGB of each block. If the absolute value of the difference between the RGB of a certain block and the RGB of the gray card is less than the preset value, it means that it is a block whose RGB is within the preset range from the RGB of the test card, then this block is the target block. Among them, the preset value can be set in advance by the developer. Of course, in addition to the gray card, if other color test cards are used, the same method can also be used to determine the target block, which will not be elaborated here.

[0062] In summary, after the electronic device obtains the target image, it can compensate the RGB of the target block according to the red, green, and blue (RGB) of the target block in the target image and each compensation matrix, and convert it to the target color temperature system to determine the target color temperature of the target image in the target color temperature system. Among them, each compensation matrix is obtained by human eye calibration of the images taken of the test card under each standard color temperature of the standard light source. The target block is the block in each block divided by the target image whose RGB is within the preset range of the RGB of the test card; the target color temperature system is the International Commission on Illumination (CIE) UV color temperature system or the CIE LUV color temperature system. In this application, the images taken of the test card under each standard color temperature can be pre-calibrated by human eyes to obtain each compensation matrix. When determining the color temperature, each compensation matrix is used to compensate the RGB of the target block and convert it to the target color temperature system to determine the target color temperature of the target image in the target color temperature system. In the whole process, the RGB of the target block is compensated by the compensation matrix and converted to the target color temperature system, without the need to calculate in the Rpg, Bpg coordinate system. The colors in the target color temperature system are more uniform, and the compensation matrix is also used to compensate the differences in non-uniform colors, thereby improving the accuracy of the actual color temperature of the determined image.

[0063] Next, taking the example that the developer takes pictures of the test card in advance and performs human eye calibration to obtain each compensation matrix, the process of obtaining each compensation matrix will be introduced below. Please refer to Figure 4 , which shows a schematic diagram of a calibration process for obtaining each compensation matrix according to an exemplary embodiment of the present application. This method can be applied to an electronic device, such as Figure 4 shown, and the calibration process may include the following steps:

[0064] Step 401, take pictures of the test card under each standard color temperature of the standard light source, and obtain the RGB of each captured sample image.

[0065] Optionally, the developer controls the standard light source to switch to different standard color temperatures in different gears, and uses the image sensor (which can also be called a camera) of the electronic device to take pictures of the test card, so as to obtain the sample images under each standard color temperature collected by the image sensor, and obtain the RGB of each sample image.

[0066] For example, taking the test card as a gray card, irradiate the gray card with a standard light source under a standard color temperature 1, and use an image sensor to capture the gray card, then a sample image under the standard color temperature 1 is obtained. By analogy, shoot at the standard color temperatures of each gear in turn to obtain each sample image under each standard two-color temperature. For each obtained sample image, use the average value of the RGB of each pixel point of the sample image as the RGB of the sample image. For example, in the environment of a laboratory light box, under standard light sources with common different color temperatures, use the camera of an electronic device to capture a gray card (i.e., a gray card), such as a D65 light source (color temperature about 6500K).

[0067] Step 402: According to the RGB of each captured sample image and the standard RGB under each standard color temperature, calculate the compensation matrix corresponding to each standard color temperature. The standard RGB is the RGB obtained by the human eye observing the test card under each standard color temperature.

[0068] Among them, since the light source used above is a standard light source with a known standard color temperature, and the human eye is a standard observer defined by the CIE, the RGB obtained by the human eye here is known. And the image sensor of the electronic device, like the human eye, is a kind of observer. Because their spectral responses to the same light collection are different, the RGB values obtained by the image sensor and the human eye here are different. The difference between the two is the spectral response difference of different observers. In this solution, the compensation matrix is calculated to reflect the spectral response difference between the image sensor and the human eye.

[0069] Optionally, the standard RGB obtained by the human eye observing the test card under each standard color temperature is known. For example, developers pre-set the theoretical value or empirical value of the RGB of the human eye observing the test card as the standard RGB in the electronic device, so that the electronic device can calculate the compensation matrix corresponding to each standard color temperature according to the RGB of each captured sample image and the standard RGB under each standard color temperature.

[0070] Optionally, taking the test card as a gray card, under the standard color temperature 1, the empirical value of the RGB of the human eye observing the gray card is (R 人 , G 人 , B 人 ). Developers set this empirical value as the standard RGB of the human eye observing the gray card. After capturing the gray card under the standard color temperature 1 through the image sensor of the electronic device, the RGB of the obtained sample image is (R 样 , G 样 , B 样 ). The electronic device can calculate the compensation matrix M1 corresponding to the standard color temperature 1 according to the following formula:

[0071] (R 人, G 人 , B 人 ) = M1 * (R 样 , G 样 , B 样 );

[0072] Through the above formula, for each standard color temperature, the standard RGB values of the gray card observed by the human eye, combined with the respective sample images obtained after the image sensor of the electronic device captures the gray card at each standard color temperature, the compensation matrix corresponding to each standard color temperature is calculated according to the same calculation method as above. Taking the standard color temperatures as C1 to Cn as an example, the corresponding compensation matrices calculated can be M1 to Mn.

[0073] It should be noted that through the process of the above formula (R 人 , G 人 , B 人 ) = M1 * (R 样 , G 样 , B 样 ), it is equivalent to aligning the spectral response of the image sensor to the spectral response of the human eye. This process is not to make the spectral response curves coincide, but to align in terms of chromaticity values. At this time, the respective compensation matrices M obtained represent the response differences between the image sensor of the electronic device and the human eye at each standard color temperature.

[0074] Step 403, for the compensation matrix corresponding to each standard color temperature, calculate the RGB values of the respective compensated sample images according to the RGB values of the sample images and the compensation matrix of the same standard color temperature.

[0075] Optionally, since the above compensation matrices are obtained by converting based on the theoretical values or empirical values of RGB, after compensating the RGB values of the sample images with the respective compensation matrices and converting them to the target chromaticity system, the resulting color temperature may still be different from the standard color temperature due to reasons such as system errors. Therefore, in order to improve the accuracy of the converted color temperature, this solution can compensate the RGB values of the respective sample images based on the compensation matrix corresponding to each standard color temperature obtained above, and recalculate the RGB values of the respective compensated sample images.

[0076] For example, when the electronic device calculates the RGB values of the respective compensated sample images according to the RGB values of the sample images and the compensation matrix of the same standard color temperature, it can be as follows: Taking the standard color temperatures as C1 to Cn as an example, the compensation matrix obtained based on C1 is M1, the sample image collected under C1 is sample image one, and the RGB values of sample image one are (R 样1 , G 样1 , B 样1) In this step, the RGB of the first sample image is compensated as follows, that is, M1*(R 样1 , G 样1 , B 样1 ) is used to obtain the RGB of the compensated first sample image. Optionally, for other standard color temperatures, in the same way, for each compensation matrix corresponding to each standard color temperature, and for each sample image, the RGB of each compensated sample image is calculated, which will not be elaborated here.

[0077] Step 404: Convert the RGB of each compensated sample image to the target chromaticity system, and calculate the compensated color temperature corresponding to the RGB of each compensated sample image in the target chromaticity system according to the coordinate values of the RGB of each compensated sample image in the target chromaticity system and the preset trajectory curve.

[0078] Optionally, taking the target chromaticity system as the CIE UV chromaticity system as an example, after obtaining the RGB of each compensated sample image above, the RGB of each compensated sample image can be first subjected to a mathematical transformation to be converted to the CIE xy coordinate system, and then based on the CIE xy coordinate system, it is converted to the CIE UV coordinate system. In the CIE UV coordinate system, combined with the preset trajectory curve, the compensated color temperature corresponding to the RGB of each compensated sample image in the CIE UV chromaticity system is calculated.

[0079] Optionally, the preset trajectory curve can be the blackbody trajectory curve in the target chromaticity system. Taking the compensation matrix calculated based on C1 as M1, the sample image collected under C1 as the first sample image, and the RGB of the first sample image as (R 样1 , G 样1 , B 样1 ) as an example, for the RGB of any compensated sample image converted to the target chromaticity system, the electronic device can calculate the RGB of each compensated sample image: (R 补偿 , G 补偿 , B 补偿 ) = M1*(R 样1 , G 样1 , B 样1 ). Through mathematical transformation, first transform to the CIE xy coordinate system, and then transform to the CIE UV coordinate system. In the CIE UV coordinate system, combined with the blackbody trajectory curve, the uv value corresponding to (R 补偿 , G 补偿 , B 补偿 ) is obtained, and then the corresponding compensated color temperature (i.e., CCT) and duv value are obtained.

[0080] It should be noted that, in addition to the blackbody trajectory curve, the above preset trajectory curve can also be a daylight trajectory curve. For example, for each standard color temperature above 4000K, the preset trajectory curve selected here can be a daylight trajectory curve, so that the obtained CCT and duv values are more accurate.

[0081] Step 405: According to the differences between the compensated color temperatures corresponding to the RGB of each compensated sample image in the target color system and each standard color temperature, update each compensation matrix until the differences between the compensated color temperatures corresponding to the RGB of each compensated sample image in the target color system and each standard color temperature are within a third preset range.

[0082] Optionally, through the above recalculation, the compensated color temperatures corresponding to the RGB of each compensated sample image in the target color system are obtained, and then the electronic device updates the compensation matrix based on the difference between the compensated color temperature and the standard color temperature, so that the differences between the compensated color temperatures corresponding to the RGB of each compensated sample image in the target color system and each standard color temperature are within a third preset range. Among them, the third preset range can be set by the developer in advance.

[0083] For example, if the compensation matrix calculated based on C1 is M1, the sample image collected under C1 is sample image one, and the RGB of sample image one is (R 样1 , G 样1 , B 样1 ), the compensated color temperature obtained through the above calculation is CCT1. The electronic device can obtain the difference between CCT1 and C1. If there is a large deviation between the two (that is, the difference is greater than the third preset range), then the compensation matrix M1 needs to be fine-tuned again, and the above logic for calculating the compensated color temperature is executed again until, in this step, it is detected that the difference between the compensated color temperature and C1 is within the third preset range, and the finally adjusted compensation matrix is used as the compensation matrix corresponding to C1. For each standard color temperature, the above process is executed for the sample images collected under that standard color temperature until all the compensation matrices are updated.

[0084] Through the process shown above Figure 4 , the acquisition of each compensation matrix is completed. The developer sets the finally determined each compensation matrix in the electronic device for subsequent use when determining the color temperature.

[0085] Please refer to Figure 5 , which shows a flowchart of a color temperature determination method provided by an exemplary embodiment of the present application. This color temperature determination method can be applied to an electronic device. As Figure 5 shown, this color temperature determination method may include the following steps:

[0086] Step 501, obtain a target image.

[0087] Optionally, in this step, the manner of obtaining the target image may be similar to that in step 301 above, and will not be elaborated here.

[0088] Step 502, sequentially select a compensation matrix from each of the compensation matrices, compensate the RGB of the target block according to the selected compensation matrix, and convert the obtained RGB after compensation to the target chromaticity system.

[0089] In this embodiment, the electronic device may sequentially select a compensation matrix from each of the determined compensation matrices, and compensate the RGB of the target block according to the selected compensation matrix. For example, for the above n compensation matrices (taking M1 to Mn as an example), the electronic device may first select any one of M1 to Mn, and compensate the RGB of the target block in the currently obtained target image, obtain the RGB after compensation, and convert it to the target chromaticity system. Among them, the process of converting to the target chromaticity system may refer to the process of first converting to the CIE xy coordinate system and then converting to the UV coordinate system in the above process of obtaining the compensation matrix, and will not be elaborated here.

[0090] Taking the RGB of the target block in the currently obtained target image as (R 1 , G 1 , B 1 ), if the selected compensation matrix in this step is M1, use M1*(R 1 , G 1 , B 1 ) to obtain the RGB of the target block after being compensated by this compensation matrix, and convert it to the target chromaticity system.

[0091] In a possible implementation manner, the number of target blocks in the obtained target image is at least 2. The electronic device may also obtain the average value of the RGB according to the RGB of each target block, and use the average value of the RGB as the RGB of the target block in the target image; or, obtain the respective weights of each target block, and calculate the RGB of the target block in the target image according to the respective weights and the respective RGB of each target block.

[0092] That is, for each target block, the electronic device may calculate the average value of the RGB of each target block as the RGB of the overall target block in the target image. Or, the electronic device may also obtain the respective weights of each target block, multiply the respective RGB of each target block by its respective weight and sum them, and use the summation result as the RGB of the overall target block in the target image. For example, please refer to Figure 6 , which shows a schematic structural diagram of a target image involved in an exemplary embodiment of the present application. As Figure 6As shown, it includes the target image 600, target block one 601, target block two 602, and target block three 603. The electronic device can calculate the RGB average value of each pixel point in target block one 601 as the RGB of target block one 601, calculate the RGB average value of each pixel point in target block two 602 as the RGB of target block two 602, calculate the RGB average value of each pixel point in target block three 603 as the RGB of target block three 603, and average the RGB values of target block one 601, target block two 602, and target block three 603 respectively, so as to obtain the RGB of the overall target block of the target image.

[0093] Or, for the target image shown above Figure 6 The electronic device obtains the weight Q1 of target block one 601 in the target image, obtains the weight Q2 of target block two 602 in the target image, and obtains the weight Q3 of target block three 603 in the target image. Taking the RGB of target block one 601 as (R 目标块一 , G 目标块一 , B 目标块一 ), the RGB of target block two 602 as (R 目标块二 , G 目标块二 , B 目标块二 ), and the RGB of target block three 603 as (R 目标块三 , G 目标块三 , B 目标块三 ) as an example, the electronic device can multiply the RGB of each target block by its respective weight and sum them to calculate the RGB of the overall target block of the target image. In Figure 6 , according to Q1*(R 目标块一 , G 目标块一 , B 目标块一 ) + Q2*(R 目标块二 , G 目标块二 , B 目标块二 ) + Q3*(R 目标块三 , G 目标块三 , B 目标块三 ), the calculated result is used as the RGB of the overall target block of the target image.

[0094] Optionally, the weights of each target block can be obtained based on the ratio between the number of pixel points included in each target block and the total number of pixel points of the target image, or alternatively, they can also be obtained according to the ratio between the area occupied by each target block and the total area of the target image. This solution does not limit the method of obtaining the weight occupied by the target block in the target image.

[0095] Step 503: Calculate the first estimated color temperature of the target block according to the coordinate value of the RGB obtained after compensation in the target color system and the preset trajectory curve.

[0096] Optionally, after converting the compensated RGB to the target colorimetric system as described above, the first estimated color temperature of the target block can be calculated in combination with a preset trajectory curve. The preset trajectory curve can be the blackbody trajectory curve or the daylight trajectory curve used in the process of obtaining each compensation matrix above.

[0097] Taking M1*(R 1 , G 1 , B 1 ) to represent the RGB of the target block in the target image after being compensated by the selected compensation matrix M1, and then performing calculations in combination with the blackbody trajectory curve in the target colorimetric system, the CCT value of the target block compensated by M1 can be obtained. The CCT value of the target block calculated here is the first estimated color temperature of the target block.

[0098] Step 504: Determine the target color temperature of the target image according to the difference between the first estimated color temperature and the first standard color temperature. The first standard color temperature is the standard color temperature corresponding to the currently selected compensation matrix.

[0099] Optionally, the way for the electronic device to determine the target color temperature of the target image according to the difference between the first estimated color temperature and the first standard color temperature can be as follows: The electronic device detects the magnitude relationship between the difference between the first estimated color temperature and the first standard color temperature and a first preset range. If the difference between the first estimated color temperature and the first standard color temperature is not within the first preset range, select the next compensation matrix in the preset order and compensate the RGB of the target block until all compensation matrices are traversed. If the difference between the first estimated color temperature and the first standard color temperature is within the first preset range, use the first estimated color temperature as the target color temperature of the target image. The first preset range can also be set in advance by the developer.

[0100] That is to say, for the first estimated color temperature calculated by compensating according to a compensation matrix, the electronic device first determines whether the currently calculated first estimated color temperature can be used as the color temperature of the target image based on the difference between the first preset color temperature and the first standard color temperature. If the difference between the first preset color temperature and the first standard color temperature is within the first preset range, use the first estimated color temperature as the target color temperature of the target image. If the difference between the first preset color temperature and the first standard color temperature is not within the first preset range, re-execute the above step 502 to select the next compensation matrix for compensation until all compensation matrices are traversed.

[0101] Taking the standard color temperature corresponding to M1 above as D65 and the first preset range as -100K to 100K as an example, after calculating through steps 502 to 504, the first estimated color temperature obtained is CCT 预估一 , and the electronic device detects CCT 预估一The difference between the CCT and D65 (i.e., the difference between the two), if it is between -100K and 100K, the obtained CCT is considered 预估一 to be able to represent the color temperature of the target image, and this CCT 预估一 is used as the target color temperature of the target image. If the CCT 预估一 is not between -100K and 100K from D65, then step 502 can be returned, select M2 to perform the same steps, and so on until all compensation matrices corresponding to the standard color temperature levels are traversed.

[0102] Optionally, before determining the target color temperature of the target image in the target chromaticity system, the electronic device can also calculate chromaticity parameters according to the compensated RGB, the first standard color, and the color difference formula. The chromaticity parameters include one or more of color difference, hue difference, and hue angle. The first standard color is the color of the standard light source at the first standard color temperature, and the first standard color temperature is the standard color temperature corresponding to the currently selected compensation matrix. If the chromaticity parameter is less than the preset parameter threshold, the target color temperature of the target image in the target chromaticity system is determined. Among them, the preset parameter threshold can also be set in the electronic device by the developer in advance.

[0103] For example, in the above process of calculating the target color temperature, after converting the compensated RGB to the target chromaticity system through step 502, the gap between the compensated RGB and the first standard color can be calculated according to the CIE color difference formula, that is, the chromaticity parameter, including parameters such as color difference, hue difference, and hue angle. And the calculated chromaticity parameter is detected. If the chromaticity parameter is less than the preset parameter threshold, the subsequent steps of determining the target color temperature of the target image in the target chromaticity system are executed.

[0104] That is to say, before calculating the first estimated color temperature of the target block, the gap between the color corresponding to the currently compensated RGB and the first standard color can be calculated in the target chromaticity system according to the color difference formula. If the gap between the two is greater than the preset parameter threshold, it means that the accuracy of the evaluated color temperature is relatively low at this time. If the gap between the two is less than the preset parameter threshold, it means that the accuracy of the evaluated color temperature is relatively high at this time. In the case of a relatively high accuracy in this solution, the process of determining the target color temperature of the target image is executed. Optionally, if the gap between the two is greater than the preset parameter threshold, the action of reselecting the next compensation matrix can be performed in advance in step 502, and the color difference parameter here is recalculated until all compensation matrices are traversed.

[0105] Optionally, when the number of target blocks in the above target image is at least 2, the process of the electronic device compensating the RGB of the target blocks according to the RGB of the target blocks in the target image and each compensation matrix and converting them to the target colorimetric system, and determining the target color temperature of the target image in the target colorimetric system can also be as follows: According to the RGB of each target block in the target image and each compensation matrix, compensate the RGB of each target block and convert them to the target colorimetric system, and determine the color temperature of each target block in the target colorimetric system; According to the color temperature of each target block in the target colorimetric system, calculate the target color temperature of the target image.

[0106] For example, in addition to calculating the RGB of the target block representing the whole target image for each target block in advance as described above, the color temperature of each target block in the target colorimetric system can also be calculated for each target block according to the process of step 502 to step 504 above. Finally, according to the color temperature of each target block in the target colorimetric system, the target color temperature of the target image is calculated. For instance, in the above Figure 6 example, for each of the three target blocks according to the process of step 502 to step 504, the obtained color temperatures of the three target blocks are color temperature one, color temperature two, and color temperature three respectively. The electronic device can calculate the average value of color temperature one, color temperature two, and color temperature three, and use this average value as the target color temperature of the final target image.

[0107] In addition, the CIE UC coordinate system adopted in this solution can refer to the CIE1960 UCS diagram (UV chromaticity diagram). Moreover, in order to consider the influence of lightness on color, this solution can also perform the above calculations in the CIE LUV colorimetric system to further improve the accuracy of color temperature determination.

[0108] In summary, after the electronic device obtains the target image, it can compensate the RGB of the target block according to the red, green, and blue (RGB) of the target block in the target image and each compensation matrix, and convert it to the target colorimetric system to determine the target color temperature of the target image in the target colorimetric system. Among them, each compensation matrix is obtained by human eye calibration of the images taken of the test card under each standard color temperature of the standard light source. The target block is the block in each block divided from the target image whose RGB is within a preset range of the RGB of the test card; the target colorimetric system is the International Commission on Illumination (CIE) UV colorimetric system or the CIE LUV colorimetric system. In this application, the images taken of the test card under each standard color temperature can be pre-calibrated by human eyes to obtain each compensation matrix. When determining the color temperature, each compensation matrix is used to compensate the RGB of the target block and convert it to the target colorimetric system to determine the target color temperature of the target image in the target colorimetric system. In the whole process, the RGB of the target block is compensated by the compensation matrix and converted to the target colorimetric system, without the need to calculate in the Rpg, Bpg coordinate systems. The colors in the target colorimetric system are more uniform, and the compensation matrix is also used to compensate for the non-uniform color differences, thereby improving the accuracy of the actual color temperature of the determined image.

[0109] In addition, in this solution, by superimposing the calculation of relevant colorimetric parameters, when the colorimetric parameters are less than the preset parameter threshold, the process of determining the target color temperature of the target image in the target colorimetric system is executed, making the calculated color temperature more accurate.

[0110] In a possible implementation manner, this solution can further consider the deviation of duv, and jointly determine the final target color temperature of the target image in combination with the deviation of duv and the above-mentioned calculated estimated color temperature and the standard color temperature, improving the accuracy of color temperature determination. Please refer to Figure 7 , which shows a flowchart of another color temperature determination method provided by an exemplary embodiment of this application. This color temperature determination method can be applied to an electronic device. As Figure 7 shown, this color temperature determination method may include the following steps:

[0111] Step 701, obtain a target image.

[0112] Optionally, in this step, the manner of obtaining the target image may be similar to that in step 301 above, and will not be elaborated here.

[0113] Step 702, sequentially select a compensation matrix from each compensation matrix, compensate the RGB of the target block according to the selected compensation matrix, and convert the compensated RGB to the target colorimetric system.

[0114] Step 703: Calculate the first estimated color temperature of the target block according to the coordinate values of the compensated RGB in the target colorimetric system and the preset trajectory curve.

[0115] Optionally, the implementation manners of steps 702 to 703 may refer to the content of the above steps 502 to 503, which will not be elaborated here.

[0116] Step 704: Calculate the estimated color deviation value of the target block according to the coordinate values of the compensated RGB in the target colorimetric system and the preset trajectory curve.

[0117] In this solution, after the RGB obtained by the above compensation matrix compensation is converted to the target colorimetric system, during the process of calculating the first estimated color temperature of the target block in combination with the preset trajectory curve, the corresponding duv value will also be obtained. This duv value is the estimated color difference deviation calculated here. That is, the estimated color difference deviation is obtained together during the process of calculating the first estimated color temperature in combination with the preset trajectory curve.

[0118] Still using M1*(R 1 , G 1 , B 1 ) to represent the RGB of the target block in the target image after being compensated by the selected compensation matrix M1, and then performing calculations in combination with the blackbody trajectory curve in the target colorimetric system, the CCT value and duv value of the target block compensated by M1 can be obtained. This CCT value is the first estimated color temperature, and this duv value is the estimated color deviation value.

[0119] Step 705: Determine the target color temperature of the target image according to the difference between the first estimated color temperature and the first standard color temperature, and the difference between the estimated color deviation value and the first color deviation value. The first color deviation value is the color deviation value corresponding to the currently selected compensation matrix.

[0120] Optionally, in this embodiment, since in addition to the calculated CCT, the calculated duv value is also included, during the detection process of this step, in addition to detecting the difference between the first estimated color temperature and the first standard color temperature, the detection of the difference between the estimated color deviation value and the first color deviation value is also combined. If the difference between the first estimated color temperature and the first standard color temperature is within the first preset range, and the difference between the estimated color deviation value and the first color deviation value is within the second preset range, the first estimated color temperature is used as the target color temperature of the target image; otherwise, the next compensation matrix is selected in the preset order and the RGB of the target block is compensated until all compensation matrices are traversed. The second preset range can also be set by the developer in advance.

[0121] For the first estimated color temperature and the estimated color deviation value compensated and calculated according to a compensation matrix, the electronic device first determines whether the currently calculated first estimated color temperature can be used as the color temperature of the target image based on the difference between the first preset color temperature and the first standard color temperature, and the difference between the estimated color deviation value and the first color deviation value. If the difference between the first preset color temperature and the first standard color temperature is within the first preset range, and the difference between the estimated color deviation value and the first color deviation value is within the second preset range, the first estimated color temperature is used as the target color temperature of the target image. If the difference between the first preset color temperature and the first standard color temperature is not within the first preset range, or the difference between the estimated color deviation value and the first color deviation value is not within the second preset range, then the above step 502 is re-executed, and the next compensation matrix is selected for compensation until all compensation matrices are traversed.

[0122] Taking the standard color temperature corresponding to M1 above as D65, the first preset range as -100K to 100K, and the second preset range as -0.02 to 0.02 as an example, through the calculation of steps 502 to 504, the first estimated color temperature obtained is CCT 预估一 , and the estimated color deviation value is duv 预估一 . The electronic device detects the difference between CCT 预估一 and D65 (i.e., the difference between the two), and the degree to which duv 预估一 deviates from the preset trajectory curve. If the difference between CCT 预估一 and D65 is between -100K and 100K, and the degree to which duv 预估一 deviates from the preset trajectory curve is between -0.02 and 0.02, it is considered that the obtained CCT 预估一 can represent the color temperature of the target image, and this CCT 预估一 can be used as the target color temperature of the target image. If the difference between CCT 预估一 and D65 is not between -100K and 100K, or the degree to which duv 预估一 deviates from the preset trajectory curve is not between -0.02 and 0.02, then step 502 can be returned, and M2 can be selected to execute the same steps, and so on until all compensation matrices corresponding to all standard color temperature ranges are traversed. That is, the first color deviation value is the duv value corresponding to the preset trajectory curve.

[0123] In summary, in the present application, compensation matrices are obtained by calibrating the human eye for the images captured by the test card in various standard color temperatures in advance. When determining the color temperature, the RGB values of the target block are compensated using the respective compensation matrices and converted to the target colorimetric system, and the target color temperature of the target image in the target colorimetric system is determined. Throughout the process, the RGB values of the target block are compensated using the compensation matrices and converted to the target colorimetric system, without the need to calculate in the Rpg and Bpg coordinate systems. The colors in the target colorimetric system are more uniform, and the compensation matrices are also used to compensate for the differences in non-uniform colors, thereby improving the accuracy of the actual color temperature of the determined image.

[0124] In addition, in the target colorimetric system, the difference in the value of duv is also combined to further improve the accuracy of the calculated target color temperature.

[0125] In a possible implementation manner, the electronic device may also first compensate the RGB values of the target block based on the respective compensation matrices. During the final determination of the target color temperature of the target image, an estimated color temperature can be selected from the respective estimated color temperatures as the target color temperature of the target image based on the difference between each estimated color temperature and each standard color temperature.

[0126] Please refer to Figure 8 , which shows a flowchart of another method for determining color temperature provided by an exemplary embodiment of the present application. This method for determining color temperature can be applied to an electronic device. As Figure 8 shown, this method for determining color temperature may include the following steps:

[0127] Step 801, obtain a target image.

[0128] Step 802, respectively compensate the RGB values of the target block according to each compensation matrix, and convert the compensated RGB values to the target colorimetric system.

[0129] Step 803, calculate the respective estimated color temperatures of the target block according to the coordinate values of the compensated RGB in the target colorimetric system and a preset trajectory curve.

[0130] Optionally, the method for calculating the estimated color temperature of the target block in steps 801 to 803 may refer to the content of steps 502 to 503 above, which will not be elaborated here.

[0131] Step 804, select an estimated color temperature from the respective estimated color temperatures as the target color temperature of the target image based on the difference between each estimated color temperature and each standard color temperature.

[0132] In this embodiment, it is equivalent that the electronic device first compensates the RGB of the target block with each compensation matrix respectively, and executes the process of calculating the corresponding estimated color temperature. Finally, from the differences between the respective estimated color temperatures and the respective standard color temperatures, an estimated color temperature is selected from the respective estimated color temperatures as the target color temperature of the target image. The difference from the steps shown above Figure 5 and Figure 7 is that, Figure 5 and Figure 7 calculate the corresponding estimated color temperature using one compensation matrix at a time, while in this embodiment, each compensation matrix is used to calculate the respective estimated color temperatures, and one of the respective estimated color temperatures is selected as the target color temperature of the target image.

[0133] Optionally, the manner in which the electronic device selects an estimated color temperature from the respective estimated color temperatures as the target color temperature of the target image according to the differences between the respective estimated color temperatures and the respective standard color temperatures can be as follows: If the difference between the second estimated color temperature and the second standard color temperature is within the first preset range, the second estimated color temperature is used as the target color temperature of the target image; if the difference between the second estimated color temperature and the second standard color temperature is not within the first preset range, another estimated color temperature is selected as the new second estimated color temperature until all the estimated color temperatures are traversed; wherein, the second estimated color temperature is the estimated color temperature calculated based on the coordinate values of the RGB after compensation by the first compensation matrix in the target colorimetric system and the preset trajectory curve, the first compensation matrix is any one of the compensation matrices, and the second standard color temperature is the standard color temperature corresponding to the first compensation matrix.

[0134] That is, the difference between each estimated color temperature and the second standard color temperature is detected. For the second estimated color temperature and the second standard color temperature that are within the first preset range, the second estimated color temperature is used as the target color temperature of the target image. For example, taking the above standard color temperatures C1 to Cn, the compensation matrices corresponding to the respective standard color temperatures are M1 to Mn, and the first preset range is -100K to 100K as an example, after calculation, the respective estimated color temperatures obtained by compensating the target block with each compensation matrix are CCT 预估1 to CCT 预估n . The electronic device can detect the difference between CCT 预估1 and C1. If the difference between CCT 预估n and Cn is not within -100K to 100K, then detect the difference between CCT 预估2 and C2... If the previous differences have not been within -100K to 100K, finally detect the difference between CCT 预估n and Cn. During this process, if the difference between CCT 预估x and Cx is within -100K to 100K, then it is considered that the obtained CCT 预估xcan represent the color temperature of the target image, and use this CCT 预估x as the target color temperature of the target image. x is any integer from 1 to n.

[0135] In a possible implementation manner, the way for the electronic device to select a predicted color temperature from each predicted color temperature as the target color temperature of the target image according to the difference between each predicted color temperature and each standard color temperature can also be as follows: obtain the minimum value of the difference between each predicted color temperature and the color temperature of the standard light source corresponding to each compensation matrix; determine the predicted color temperature corresponding to the minimum value as the target color temperature of the target image. That is, by calculating the difference between the predicted color temperature obtained above and the color temperature of each standard light source, and then screening out the minimum value among them, and determining the predicted color temperature corresponding to the minimum value as the target color temperature of the target image.

[0136] Taking the above standard color temperatures C1 to Cn, the compensation matrices corresponding to each standard color temperature are M1 to Mn, and the first preset range is -100K to 100K as an example, after calculation, the predicted color temperatures after compensating the target block by each compensation matrix are CCT 预估1 to CCT 预估n . The electronic device can calculate the difference between CCT 预估1 and C1, the difference between CCT 预估2 and C2... the difference between CCT 预估n and Cn, and select the predicted color temperature corresponding to the minimum value among them as the target color temperature of the target image. For example, if the difference between CCT 预估2 and C2 is the smallest in this process, it is considered that the obtained CCT 预估2 can represent the color temperature of the target image, and use this CCT 预估2 as the target color temperature of the target image.

[0137] It should be noted that the content of further improving the accuracy of determining the target color temperature by combining the duv value and the color difference parameter and other methods mentioned in the above embodiments can also be combined in this embodiment, which will not be elaborated here. That is, the content provided in the above embodiments can be combined with each other.

[0138] In summary, in the present application, compensation matrices are obtained by calibrating the images taken of the test card in advance at various standard color temperatures with the human eye. When determining the color temperature, the RGB values of the target block are compensated using the respective compensation matrices and converted to the target chromaticity system, and the target color temperature of the target image in the target chromaticity system is determined. Throughout the process, the RGB values of the target block are compensated using the compensation matrix and converted to the target chromaticity system, without the need to calculate in the Rpg and Bpg coordinate systems. The colors in the target chromaticity system are more uniform, and the compensation matrix is also used to compensate for the non-uniform color differences, thereby improving the accuracy of the actual color temperature of the determined image.

[0139] Taking the target chromaticity system as the CIE UV chromaticity system and the electronic device as a mobile phone with a camera function as an example, the camera is equivalent to the above-mentioned image sensor. Please refer to Figure 9 , which shows a schematic flowchart of evaluating the color temperature of an image in the UV coordinate system in a mobile phone according to an exemplary embodiment of the present application. As Figure 9 shown, the process of color temperature evaluation includes the following steps:

[0140] Step 901, use the camera to take a picture of the experimental gray card.

[0141] Step 902, perform human eye calibration.

[0142] Step 903, convert to the CIE xy coordinate system.

[0143] Step 904, convert to the CIE UV coordinate system.

[0144] Step 905, calculate cct and duv.

[0145] Step 906, output the compensation matrix M.

[0146] Among them, steps 901 to 906 are equivalent to the process of obtaining the respective compensation matrices shown above. The calculated cct can be used to fine-tune the compensation matrix above, so that the difference between the compensated color temperature corresponding to the compensated RGB in the target chromaticity system and the standard color temperature is within the third preset range. Figure 4 Step 907, use the camera to take the target image.

[0147] Step 908, obtain the RGB values of the gray block in the target image.

[0148] Step 909, traverse the color temperature levels and select the compensation matrix M corresponding to each color temperature level.

[0149] Step 910, obtain the compensated RGB.

[0150] Step 910, obtain the compensated RGB.

[0151] Step 911: Convert to the CIE xy coordinate system.

[0152] Step 912: Convert to the CIE UV coordinate system.

[0153] Step 913: Calculate the CCT and duv.

[0154] Here are the estimated color temperatures calculated after applying the actual application compensation matrix and the corresponding duv values.

[0155] Step 914: Detect through the first preset range and the second preset range.

[0156] Optionally, the detection through the first preset range and the second preset range can refer to the descriptions in the above embodiments and will not be elaborated here.

[0157] Step 915: If satisfied, use the currently calculated CCT as the color temperature of the target image.

[0158] If satisfied, that is, the difference between the calculated CCT and the color temperature of the currently selected compensation matrix is within the first preset range, and the duv and the first color deviation value are within the second preset range.

[0159] If not satisfied, it means that the difference between the calculated CCT and the color temperature of the currently selected compensation matrix is not within the first preset range, or the duv and the first color deviation value are not within the second preset range. In this case, you can return to Step 909, change to the next color temperature range for calculation until the traversal ends.

[0160] In summary, in this application, by pre - calibrating the human eye for the images obtained by photographing the test card at each standard color temperature to obtain each compensation matrix, when determining the color temperature, use each compensation matrix to compensate the RGB of the target block and convert it to the target chromaticity system to determine the target color temperature of the target image in the target chromaticity system. The entire process compensates the RGB of the target block using the compensation matrix and converts it to the target chromaticity system, without the need to calculate in the Rpg, Bpg coordinate systems. The colors in the target chromaticity system are more uniform, and the compensation matrix is also used to compensate for the non - uniform color differences, thereby improving the accuracy of the actual color temperature of the determined image.

[0161] The following is the device embodiment of the present application, which can be used to execute the method embodiment of the present application. For the details not disclosed in the device embodiment of the present application, please refer to the method embodiment of the present application.

[0162] Please refer to Figure 10, which shows a structural block diagram of a color temperature determination device provided by an exemplary embodiment of the present application. The color temperature determination device 1000 can be used in an electronic device to perform all or part of the steps executed by the electronic device in the methods provided by the above various illustrated embodiments. The color temperature determination device 1000 includes:

[0163] A first acquisition module 1001, configured to acquire a target image;

[0164] A first determination module 1002, configured to compensate the RGB of the target block according to the red, green, and blue RGB of the target block in the target image and each compensation matrix, and convert it to the target colorimetric system, and determine the target color temperature of the target image in the target colorimetric system;

[0165] Wherein, each of the compensation matrices is obtained by human eye calibration of an image obtained by photographing a test card under each standard color temperature of a standard light source, and the target block is a block in each block divided from the target image whose RGB is within a preset range of the RGB of the test card; the target colorimetric system is the International Commission on Illumination CIE UV colorimetric system or the CIE LUV colorimetric system.

[0166] In summary, after the electronic device acquires the target image, it can compensate the RGB of the target block according to the red, green, and blue RGB of the target block in the target image and each compensation matrix, and convert it to the target colorimetric system, and determine the target color temperature of the target image in the target colorimetric system. Wherein, each of the compensation matrices is obtained by human eye calibration of an image obtained by photographing a test card under each standard color temperature of a standard light source, and the target block is a block in each block divided from the target image whose RGB is within a preset range of the RGB of the test card; the target colorimetric system is the International Commission on Illumination CIE UV colorimetric system or the CIE LUV colorimetric system. In the present application, the compensation matrices can be obtained in advance by human eye calibration of images obtained by photographing a test card under each standard color temperature. When determining the color temperature, the compensation matrices are used to compensate the RGB of the target block and convert it to the target colorimetric system, and the target color temperature of the target image in the target colorimetric system is determined. The RGB of the target block is compensated by the compensation matrix and converted to the target colorimetric system throughout the process, without the need to calculate in the Rpg, Bpg coordinate systems. The colors in the target colorimetric system are more uniform, and the uneven color differences are also compensated by the compensation matrix, thereby improving the accuracy of the determined actual color temperature of the image.

[0167] Optionally, the first determination module 1002 is further configured to,

[0168] Select a compensation matrix from each of the compensation matrices in turn, compensate the RGB of the target block according to the selected compensation matrix, and convert the compensated RGB to the target colorimetric system;

[0169] Calculate the first estimated color temperature of the target block according to the coordinate values of the compensated RGB in the target colorimetric system and the preset trajectory curve;

[0170] Determine the target color temperature of the target image according to the difference between the first estimated color temperature and the first standard color temperature, where the first standard color temperature is the standard color temperature corresponding to the currently selected compensation matrix.

[0171] Optionally, the first determination module 1002 is further configured to,

[0172] If the difference between the first estimated color temperature and the first standard color temperature is not within the first preset range, select the next compensation matrix in the preset order and compensate the RGB of the target block until all compensation matrices are traversed;

[0173] If the difference between the first estimated color temperature and the first standard color temperature is within the first preset range, use the first estimated color temperature as the target color temperature of the target image.

[0174] Optionally, the device further includes:

[0175] A first calculation module, configured to calculate the estimated color deviation value of the target block according to the coordinate values of the compensated RGB in the target colorimetric system and the preset trajectory curve;

[0176] Optionally, the first determination module 1002 is further configured to,

[0177] Determine the target color temperature of the target image according to the difference between the first estimated color temperature and the first standard color temperature and the difference between the estimated color deviation value and the first color deviation value, where the first color deviation value is the color deviation value corresponding to the currently selected compensation matrix.

[0178] Optionally, the first determination module 1002 is further configured to,

[0179] If the difference between the first estimated color temperature and the first standard color temperature is within the first preset range and the difference between the estimated color deviation value and the first color deviation value is within the second preset range, use the first estimated color temperature as the target color temperature of the target image;

[0180] Otherwise, select the next compensation matrix in the preset order and compensate the RGB of the target block until all compensation matrices are traversed.

[0181] Optionally, the first determination module 1002 is further configured to

[0182] According to each compensation matrix, compensate the RGB of the target block respectively, and convert the compensated RGBs to the target colorimetric system;

[0183] According to the coordinate values of the RGBs obtained after each compensation in the target colorimetric system and the preset trajectory curve, calculate the respective estimated color temperatures of the target block;

[0184] According to the differences between the respective estimated color temperatures and the respective standard color temperatures, select an estimated color temperature from the respective estimated color temperatures as the target color temperature of the target image.

[0185] Optionally, the first determination module 1002 is further configured to

[0186] If the difference between the second estimated color temperature and the second standard color temperature is within the first preset range, use the second estimated color temperature as the target color temperature of the target image;

[0187] If the difference between the second estimated color temperature and the second standard color temperature is not within the first preset range, select another estimated color temperature as the new second estimated color temperature until all the estimated color temperatures are traversed;

[0188] Wherein, the second estimated color temperature is the estimated color temperature calculated according to the coordinate values of the RGB obtained after compensation based on the first compensation matrix in the target colorimetric system and the preset trajectory curve, the first compensation matrix is any one of the compensation matrices, and the second standard color temperature is the standard color temperature corresponding to the first compensation matrix.

[0189] Optionally, the device further includes:

[0190] A second acquisition module, configured to photograph a test card under each standard color temperature of a standard light source, and acquire the RGBs of the captured sample images;

[0191] A second calculation module, configured to calculate the respective compensation matrices corresponding to each standard color temperature according to the RGBs of the captured sample images and the standard RGBs under each standard color temperature, where the standard RGBs are the RGBs observed by the human eye for the test card under each standard color temperature.

[0192] Optionally, the device further includes:

[0193] A third calculation module, configured to, after calculating a compensation matrix corresponding to each standard color temperature according to the RGB of each captured sample image and the standard RGB under each standard color temperature, calculate the RGB of each compensated sample image respectively according to the RGB of the sample images of the same standard color temperature and the compensation matrix;

[0194] A fourth calculation module, configured to convert the RGB of each compensated sample image to the target colorimetric system, and calculate a compensated color temperature corresponding to each compensated sample image in the target colorimetric system according to the coordinate values of the RGB of each compensated sample image in the target colorimetric system and a preset trajectory curve;

[0195] A first update module, configured to update each compensation matrix according to the difference between the compensated color temperature corresponding to the RGB of each compensated sample image in the target colorimetric system and each standard color temperature, until the difference between the compensated color temperature corresponding to the RGB of each compensated sample image in the target colorimetric system and each standard color temperature is within a third preset range.

[0196] Optionally, the apparatus further includes:

[0197] A fifth calculation module, configured to calculate a colorimetric parameter before determining the target color temperature of the target image in the target colorimetric system, according to the compensated RGB, a first standard color, and a color difference formula, where the colorimetric parameter includes one or more of color difference, hue difference, and hue angle, and the first standard color is the color of the standard light source under the first standard color temperature;

[0198] A second determination module, configured to determine the target color temperature of the target image in the target colorimetric system if the colorimetric parameter is less than a preset parameter threshold.

[0199] Optionally, the number of target blocks in the target image is at least 2, and the apparatus further includes:

[0200] A third acquisition module, configured to obtain an average value of the RGB according to the RGB of each target block, and use the average value of the RGB as the RGB of the target blocks in the target image; or

[0201] A fourth acquisition module, configured to obtain the weight of each target block, and calculate the RGB of the target blocks in the target image according to the weight of each target block and its RGB.

[0202] Optionally, the number of target blocks in the target image is at least 2, and the first determination module 1002 is further configured to

[0203] According to the red, green, and blue (RGB) values of each target block in the target image and each compensation matrix, compensate the RGB of each target block and convert it to the target colorimetric system, and determine the color temperature of each target block in the target colorimetric system.

[0204] According to the color temperature of each target block in the target colorimetric system, calculate the target color temperature of the target image.

[0205] Please refer to Figure 11 , which is a schematic structural diagram of another example of the color temperature determination device provided in the embodiments of the present application. Among them, the color temperature determination device 1100 may be an electronic device and can implement the functions in the method provided in the embodiments of the present application. Among them, the color temperature determination device 1100 may be a chip system. In the embodiments of the present application, the chip system may be composed of chips or may include chips and other discrete devices.

[0206] In terms of hardware implementation, the above communication module may be a transceiver, and the transceiver is integrated in the color temperature determination device 1100 to form a communication interface 1103.

[0207] The color temperature determination device 1100 includes at least one processor 1101, which is used to implement or support the color temperature determination device 1100 to implement the functions of the electronic device in the method provided in the embodiments of the present application. Exemplarily, the processor 1101 may acquire a target image; according to the red, green, and blue (RGB) values of the target block in the target image and each compensation matrix, compensate the RGB of the target block and convert it to the target colorimetric system, and determine the target color temperature of the target image in the target colorimetric system, etc. For specific details, please refer to the detailed description in the method example and will not be elaborated here.

[0208] The color temperature determination device 1100 may further include at least one memory 1102, which is used to store program instructions and / or data. The memory 1102 is coupled to the processor 1101. The coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units, or modules, which may be electrical, mechanical, or other forms, and is used for information interaction between devices, units, or modules. The processor 1101 may cooperate with the memory 1102. The processor 1101 may execute the program instructions stored in the memory 1102. At least one of the at least one memories may be included in the processor.

[0209] The color temperature determination device 1100 may further include a communication interface 1103, which is used to communicate with other devices through a transmission medium, so that the devices in the color temperature determination device 1100 can communicate with other devices. Exemplarily, the other device may be a network-side device. The processor 1101 may use the communication interface 1103 to send and receive data. The communication interface 1103 may specifically be a transceiver.

[0210] In the embodiments of the present application, the specific connection medium between the communication interface 1103, the processor 1101, and the memory 1102 is not limited. In the embodiments of the present application, Figure 11 it is shown that the memory 1102, the processor 1101, and the communication interface 1103 are connected through a bus 1104. The bus is represented by a thick line in Figure 11 which. The connection manners between other components are only for illustrative purposes and are not limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 11 it is only represented by a thick line in which, but it does not mean that there is only one bus or one type of bus.

[0211] In the embodiments of the present application, the processor 1101 can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various 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, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.

[0212] In the embodiments of the present application, the memory 1102 can be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or can also be a volatile memory, such as a random-access memory (RAM). The memory is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiments of the present application can also be a circuit or any other device capable of implementing a storage function, for storing program instructions and / or data.

[0213] Optionally, the embodiments of the present application further provide an electronic device. The electronic device includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the computer program, all or part of the steps performed by the electronic device in the color temperature determination methods in the above various embodiments are implemented.

[0214] Optionally, the embodiments of the present application further provide a computer-readable medium, on which a computer program is stored. When the computer program is executed by the processor, all or part of the steps performed by the electronic device in the color temperature determination methods in the above various embodiments are implemented.

[0215] Optionally, an embodiment of the present application further provides a chip, on which there is a computer program that can run. When the chip executes the computer program, all or part of the steps performed by the electronic device in the color temperature determination method of each of the above embodiments are implemented.

[0216] Optionally, an embodiment of the present application further provides a computer program product. When the computer program product runs on a computer, the computer is enabled to execute all or part of the steps performed by the electronic device in the color temperature determination method of each of the above embodiments.

[0217] Optionally, an embodiment of the present application further provides an application publishing platform, which is used to publish a computer program product. Among them, when the computer program product runs on a computer, the computer is enabled to execute all or part of the steps performed by the electronic device in the color temperature determination method of each of the above embodiments.

[0218] It should be noted that when the device provided in the above embodiment executes the control of the electronic device, only the above-mentioned division of each functional module is used for illustration. In actual application, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device provided in the above embodiment and the method embodiment belong to the same concept, and the specific implementation process can be seen in the method embodiment, which will not be elaborated here.

[0219] The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages and disadvantages of the embodiments.

[0220] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a disk or an optical disc, etc.

[0221] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for determining color temperature, characterized in that: Applied to electronic equipment, the method comprises: Get the target image; According to the red, green, and blue (RGB) of the target block in the target image and each compensation matrix, the RGB of the target block is compensated and converted to a target colorimetric system, and a target color temperature of the target image in the target colorimetric system is determined; Among them, each compensation matrix is ​​obtained by calibrating the human eye based on images taken by the test card under various standard color temperatures of the standard light source, and the target block is a block in each block divided by the target image that is within a preset range of the RGB of the test card; the target colorimetry system is the International Commission on Illumination CIE UV colorimetry system or the CIELUV colorimetry system.

2. The method according to claim 1, characterized in that: The step of compensating the RGB of the target block in the target image and converting the RGB to a target colorimetric system according to the RGB and compensation matrices of the target block in the target image, and determining the target color temperature of the target image in the target colorimetric system includes: Selecting one compensation matrix from each compensation matrix in turn, compensating the RGB of the target block according to the selected compensation matrix, and converting the RGB obtained after compensation into the target chromaticity system; Calculating a first estimated color temperature of the target block according to the coordinate values ​​of RGB in the target colorimetric system obtained after compensation and a preset trajectory curve; A target color temperature of the target image is determined according to a difference between the first estimated color temperature and a first standard color temperature, wherein the first standard color temperature is a standard color temperature corresponding to a currently selected compensation matrix.

3. The method according to claim 2, characterized in that The step of determining the target color temperature of the target image according to the difference between the first estimated color temperature and the first standard color temperature includes: If the difference between the first estimated color temperature and the first standard color temperature is not within a first preset range, selecting a next compensation matrix in a preset order and compensating the RGB of the target block until all compensation matrices are traversed; If the difference between the first estimated color temperature and the first standard color temperature is within the first preset range, the first estimated color temperature is used as the target color temperature of the target image.

4. The method according to claim 2, characterized in that: The method further comprises: Calculate the estimated color deviation value of the target block according to the coordinate values ​​of RGB in the target colorimetric system obtained after compensation and the preset trajectory curve; The step of determining the target color temperature of the target image according to the difference between the first estimated color temperature and the first standard color temperature includes: The target color temperature of the target image is determined according to the difference between the first estimated color temperature and the first standard color temperature and the difference between the estimated color deviation value and the first color deviation value, wherein the first color deviation value is the color deviation value corresponding to the currently selected compensation matrix.

5. The method according to claim 4, characterized in that The determining the target color temperature of the target image according to the difference between the first estimated color temperature and the first standard color temperature and the estimated color deviation value includes: If the difference between the first estimated color temperature and the first standard color temperature is within a first preset range, and the difference between the estimated color deviation value and the first color deviation value is within a second preset range, using the first estimated color temperature as the target color temperature of the target image; Otherwise, the next compensation matrix is ​​selected according to a preset order and the RGB of the target block is compensated until all compensation matrices are traversed.

6. The method according to claim 1, characterized in that The step of compensating the RGB of the target block in the target image and converting the RGB to a target colorimetric system according to the RGB and compensation matrices of the target block in the target image, and determining the target color temperature of the target image in the target colorimetric system includes: According to each compensation matrix, the RGB of the target block is compensated respectively, and each compensated RGB is converted into a target colorimetric system; Calculate each estimated color temperature of the target block according to the coordinate values ​​of RGB in the target colorimetric system obtained after each compensation and a preset trajectory curve; According to the differences between the estimated color temperatures and the standard color temperatures, one estimated color temperature is selected from the estimated color temperatures as the target color temperature of the target image.

7. The method according to claim 6, characterized in that The step of selecting, according to the differences between the respective estimated color temperatures and the respective standard color temperatures, one estimated color temperature from the respective estimated color temperatures as the target color temperature of the target image comprises: If the difference between the second estimated color temperature and the second standard color temperature is within a first preset range, using the second estimated color temperature as the target color temperature of the target image; If the difference between the second estimated color temperature and the second standard color temperature is not within the first preset range, selecting another estimated color temperature as a new second estimated color temperature until all the estimated color temperatures are traversed; Among them, the second estimated color temperature is an estimated color temperature calculated based on the coordinate values ​​of RGB in the target colorimetry system obtained after compensation by the first compensation matrix and a preset trajectory curve, the first compensation matrix is ​​any one of the compensation matrices, and the second standard color temperature is the standard color temperature corresponding to the first compensation matrix.

8. The method according to claim 1, characterized in that: The method further comprises: The test card is photographed at various standard color temperatures of the standard light source to obtain the RGB of each sample image photographed; According to the RGB of each sample image captured and the standard RGB at each standard color temperature, the compensation matrix corresponding to each standard color temperature is calculated. The standard RGB is the RGB obtained by the human eye observing the test card at each standard color temperature.

9. The method according to claim 8, characterized in that After calculating the compensation matrix corresponding to each standard color temperature according to the RGB of each sample image captured and the standard RGB under each standard color temperature, the method further includes: For the compensation matrix corresponding to each standard color temperature, the RGB of each sample image after compensation is calculated according to the RGB of the sample image of the same standard color temperature and the compensation matrix; Convert the RGB of each compensated sample image to the target colorimetric system, and calculate the corresponding compensated color temperature of the RGB of each compensated sample image in the target colorimetric system according to the coordinate value of the RGB of each compensated sample image in the target colorimetric system and the preset trajectory curve; According to the difference between the compensated color temperature corresponding to the RGB of each compensated sample image in the target colorimetry system and each standard color temperature, each compensation matrix is ​​updated until the difference between the compensated color temperature corresponding to the RGB of each compensated sample image in the target colorimetry system and each standard color temperature is within a third preset range.

10. The method according to any one of claims 2 to 9, characterized in that: Before determining the target color temperature of the target image in the target colorimetric system, the method further includes: Calculate chromaticity parameters according to the RGB obtained after compensation, the first standard color, and the color difference formula, wherein the chromaticity parameters include one or more of color difference, hue difference, and hue angle, and the first standard color is the color of the standard light source at the first standard color temperature; If the chromaticity parameter is less than a preset parameter threshold, a target color temperature of the target image in the target chromaticity system is determined.

11. The method according to any one of claims 1 to 9, characterized in that: The number of target blocks in the target image is at least 2, and the method further comprises: According to the RGB of each target block, an average value of RGB is obtained, and the average value of RGB is used as the RGB of the target block in the target image; or, Obtain the weight of each target block, and calculate the RGB of the target block in the target image according to the weight and RGB of each target block.

12. The method according to any one of claims 1 to 9, characterized in that: The number of target blocks in the target image is at least 2, and according to the red, green, blue, RGB of the target block in the target image and each compensation matrix, the RGB of the target block is compensated and converted to a target colorimetric system, and the target color temperature of the target image in the target colorimetric system is determined, including: According to the red, green, blue, RGB of each target block in the target image and each compensation matrix, the RGB of each target block is compensated and converted to a target colorimetric system, and the color temperature of each target block under the target colorimetric system is determined; The target color temperature of the target image is calculated according to the color temperatures of the target blocks under the target colorimetric system.

13. A color temperature determination device, characterized in that: Applied to electronic equipment, the device comprises: A first acquisition module, used for acquiring a target image; A first determination module is used to compensate the RGB of the target block in the target image and convert it to a target colorimetric system according to the red, green, and blue (RGB) of the target block in the target image and each compensation matrix, and determine the target color temperature of the target image in the target colorimetric system; Among them, each compensation matrix is ​​obtained by calibrating the human eye based on images taken by the test card under various standard color temperatures of the standard light source, and the target block is a block in each block divided by the target image that is within a preset range of the RGB of the test card; the target colorimetry system is the International Commission on Illumination CIE UV colorimetry system or the CIELUV colorimetry system.

14. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program that can be run on the processor, and the processor implements the color temperature determination method according to any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the color temperature determination method according to any one of claims 1 to 12 is implemented.