CN110139088B - Color temperature compensation method, electronic device, and computer-readable storage medium - Google Patents

Color temperature compensation method, electronic device, and computer-readable storage medium Download PDF

Info

Publication number
CN110139088B
CN110139088B CN201910451847.4A CN201910451847A CN110139088B CN 110139088 B CN110139088 B CN 110139088B CN 201910451847 A CN201910451847 A CN 201910451847A CN 110139088 B CN110139088 B CN 110139088B
Authority
CN
China
Prior art keywords
color temperature
screen
value
ambient light
photodiode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910451847.4A
Other languages
Chinese (zh)
Other versions
CN110139088A (en
Inventor
贾玉虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910451847.4A priority Critical patent/CN110139088B/en
Publication of CN110139088A publication Critical patent/CN110139088A/en
Application granted granted Critical
Publication of CN110139088B publication Critical patent/CN110139088B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control

Abstract

The application is applicable to the technical field of electronics, and provides a color temperature compensation method, electronic equipment and a computer-readable storage medium. According to the embodiment of the application, the color temperature sensor is arranged in the electronic equipment comprising the screen and the camera, the RGB value of the color temperature sensor, the RGB value of the screen and the brightness level of the screen are obtained, the relevant color temperature value of the ambient light is determined according to the RGB value of the color temperature sensor, the RGB value of the screen and the brightness level of the screen, then the color temperature value of the camera is compensated according to the relevant color temperature value of the ambient light, the deviation between the color temperature value of the camera and the relevant color temperature value of the ambient light is smaller than the preset color temperature threshold value, the camera can keep color balance, and the shooting effect of the electronic equipment is effectively improved.

Description

Color temperature compensation method, electronic device, and computer-readable storage medium
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a color temperature compensation method, an electronic device, and a computer-readable storage medium.
Background
With the continuous development of electronic technology, electronic devices with display and camera functions, such as smart phones, tablet computers, notebook computers and the like, are in the endlessly, and great convenience is brought to daily production and life of people. When the electronic equipment is used for shooting, ambient light can cause certain influence on the shooting effect of the electronic equipment, and the conditions of color cast, over-saturation or insufficient saturation occur.
Disclosure of Invention
In view of the above, embodiments of the present disclosure provide a color temperature compensation method, an electronic device, and a computer-readable storage medium to solve the problem of color shift, over saturation, or insufficient saturation caused by the shooting effect of ambient light on the electronic device.
A first aspect of an embodiment of the present application provides a color temperature compensation method, which is applied to an electronic device, where the electronic device includes a color temperature sensor, a screen, and a camera, and the color temperature compensation method includes:
acquiring RGB values of the color temperature sensor;
acquiring the RGB value of the screen and the brightness level of the screen;
determining a correlated color temperature value of ambient light according to the RGB value of the color temperature sensor, the RGB value of the screen and the brightness level of the screen;
and compensating the color temperature value of the camera according to the correlated color temperature value of the ambient light, so that the deviation between the color temperature value of the camera and the correlated color temperature value of the ambient light is smaller than a preset color temperature threshold value.
A second aspect of the embodiments of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and further includes a color temperature sensor, a screen, and a camera electrically connected to the processor, where the processor implements the steps of the color temperature compensation method when executing the computer program.
A third aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program, which when executed by a processor, implements the steps of the color temperature compensation method described above.
According to the embodiment of the application, the color temperature sensor is arranged in the electronic equipment comprising the screen and the camera, the RGB value of the color temperature sensor, the RGB value of the screen and the brightness level of the screen are obtained, the relevant color temperature value of the ambient light is determined according to the RGB value of the color temperature sensor, the RGB value of the screen and the brightness level of the screen, then the color temperature value of the camera is compensated according to the relevant color temperature value of the ambient light, the deviation between the color temperature value of the camera and the relevant color temperature value of the ambient light is smaller than the preset color temperature threshold value, the camera can keep color balance, and the shooting effect of the electronic equipment is effectively improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a color temperature compensation method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a color temperature compensation method according to a second embodiment of the present application;
FIG. 3 is a diagram illustrating a relationship curve between brightness and interference value of a screen according to a second embodiment of the present application;
FIG. 4 is a schematic diagram of gamma2.2 relationship curve of color depth and interference value of the screen provided in the second embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to a third embodiment of the present application;
fig. 6 is a schematic structural diagram of another electronic device provided in the third embodiment of the present application;
fig. 7 is a schematic structural diagram of a light sensor according to a third embodiment of the present application;
fig. 8 is a schematic structural diagram of another optical line sensor provided in the third embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "comprises" and "comprising," and any variations thereof, in the description and claims of this application and the drawings described above, are intended to cover non-exclusive inclusions. For example, a process, method, or system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. Furthermore, the terms "first," "second," and "third," etc. are used to distinguish between different objects and are not used to describe a particular order.
Example one
The embodiment provides a color temperature compensation method which is applied to electronic equipment, wherein the electronic equipment comprises a color temperature sensor, a screen and a camera.
In application, the electronic device may be a smart phone, a tablet computer, a notebook computer, a personal digital assistant, a self-service camera, a digital camera, etc. with display and camera functions. The color temperature compensation method may particularly be performed by a processor of the electronic device.
As shown in fig. 1, the color temperature compensation method provided by the present embodiment includes:
and S101, acquiring RGB values of the color temperature sensor.
In application, the color temperature sensor is arranged on the front surface of the electronic equipment, namely, the color temperature sensor and the screen of the electronic equipment are arranged on the same surface; when the screen of the electronic device is an OLED (Organic Light-Emitting display) screen, the color temperature sensor may be disposed below the screen, and particularly may be disposed below foam under the screen of the OLED screen, and a through hole is disposed in a foam area between the color temperature sensor and the OLED screen, so that there is no shielding between the OLED screen and the color temperature sensor, and ambient Light may penetrate through the OLED screen and enter the color temperature sensor through the through hole.
In application, RGB values refer to an R component, a G component, and a B component corresponding to three primary colors of R (Red ) G (Green, Green) B (Blue).
And S102, acquiring the RGB value of the screen and the brightness level of the screen.
In application, the RGB values of the screen and the luminance levels of the screen refer to the RGB values and the luminance levels of a picture displayed by the screen, and the RGB values and the luminance levels of the screen may be acquired by digital RGB data and driving currents for driving the picture displayed by the screen. When the screen is black, the RGB value and the brightness level of the screen are both 0.
Step S103, determining a relevant color temperature value of ambient light according to the RGB value of the color temperature sensor, the RGB value of the screen and the brightness level of the screen.
In application, the RGB values of the color temperature sensor are not only affected by ambient light, but also affected by light emitted when the screen displays a picture, so that the calculated correlated color temperature value of the ambient light is not accurate directly according to the color temperature calculation formula and the RGB values of the color temperature sensor, and the problem of interference of the light emitted when the screen displays the picture on the RGB values of the color temperature sensor needs to be solved. Therefore, when determining the color temperature value of the ambient light, the RGB values of the color temperature sensor, the RGB values of the screen, and the brightness level of the screen need to be taken into consideration at the same time to improve the accuracy of the calculated color temperature value of the ambient light, thereby improving the accuracy of compensating the color temperature value of the camera.
And S104, compensating the color temperature value of the camera according to the relevant color temperature value of the ambient light, so that the deviation between the color temperature value of the camera and the relevant color temperature value of the ambient light is smaller than a preset color temperature threshold value.
In application, the preset color temperature threshold may be set according to actual needs, as long as the color temperature value of the camera after color temperature value supplementation approaches to the relevant color temperature value of the ambient light, and the color tone of the image shot by the camera is the same as the color tone of the ambient light, that is, the color tone of the image shot by the camera and the color tone of the ambient light are both cool tones or warm tones.
In one embodiment, the preset color temperature threshold is 0.
According to the embodiment, the color temperature sensor is arranged in the electronic equipment comprising the screen and the camera, the RGB value of the color temperature sensor, the RGB value of the screen and the brightness level of the screen are obtained, the correlated color temperature value of the ambient light is determined according to the RGB value of the color temperature sensor, the RGB value of the screen and the brightness level of the screen, and then the color temperature value of the camera is compensated according to the correlated color temperature value of the ambient light, so that the deviation between the color temperature value of the camera and the correlated color temperature value of the ambient light is smaller than the preset color temperature threshold value, the camera can keep color balance, and the shooting effect of the electronic equipment is effectively improved.
Example two
As shown in fig. 2, in the present embodiment, the step S103 in the first embodiment includes:
step S201, determining an interference value of the screen to the RGB value of the color temperature sensor according to the RGB value of the screen, the brightness level of the screen and a preset interference value calculation formula.
In application, an interference value calculation formula of interference generated by the screen on the RGB values of the color temperature sensor can be obtained in advance according to different RGB values and brightness levels when the screen displays different pictures, and stored as a preset interference value calculation formula. The interference generated by the screens of different electronic devices to the RGB values of the color temperature sensors thereof is different, and therefore, an interference value calculation formula for the interference generated by the screen of each electronic device to the RGB values of the color temperature sensors thereof should be separately determined before compensating for the color temperature values of the camera of each electronic device.
In one embodiment, step S201 is preceded by:
acquiring at least n groups of different RGB values of the screen and at least n brightness levels of the screen; wherein the RGB values of each group of the screen correspond to a brightness level of the screen;
performing nth polynomial fitting calculation on at least n groups of different RGB values of the screen, at least n brightness levels of the screen and a preset reference brightness level according to an nth polynomial fitting algorithm to obtain a preset interference value calculation formula; wherein n is not less than 1 and n is an integer.
In application, the value of n can be set according to actual needs, and the larger the value of n is, the more the number of terms of the preset interference value calculation formula is, and the more accurate the RGB value of the ambient light obtained through calculation is. For example, when n is 3, a 3 rd order polynomial fitting calculation may be performed on 3 sets of RGB values when the screen displays different pictures, corresponding 3 luminance levels, and a preset reference luminance level according to a 3 rd order polynomial fitting algorithm to obtain a preset interference value calculation formula. The preset reference brightness can be set according to actual needs, the preset reference brightness can be set to be different in size according to different-degree polynomial fitting algorithms, and a corresponding preset reference brightness can also be set for each brightness level.
In one embodiment, the RGB values include an R component, a G component, and a B component corresponding to RGB three primary colors, and the interference values include an R component interference value, a G component interference value, and a B component interference value;
the expression of the preset interference value calculation formula is as follows:
Figure GDA0002742325830000061
wherein Δ R represents an R component interference value, Δ G represents a G component interference value, Δ B represents a B component interference value, a0, a1, a2, … and an are constants, B0, B1, B2, … and bn are constants, c0, c1, c2, … and cn are constants, R represents an R component of the screen, G represents a G component of the screen, B represents a B component of the screen, level represents a brightness level of the screen, level _ ref represents a preset reference brightness level, n ≧ 1 and n is an integer.
In application, the constants a0, a1, a2, …, an, b0, b1, b2, … and bn, and c0, c1, c2, … and cn are obtained by performing nth-order polynomial fitting calculation on at least n groups of different RGB values of the screen, at least n brightness levels of the screen and a preset reference brightness level according to an nth-order polynomial fitting algorithm;
when n is 1, the expression of the preset interference value calculation formula is as follows:
Figure GDA0002742325830000062
when n is 2, the expression of the preset interference value calculation formula is as follows:
Figure GDA0002742325830000063
when n is 3, the expression of the preset interference value calculation formula is as follows:
Figure GDA0002742325830000071
when n is 4, the expression of the preset interference value calculation formula is as follows:
Figure GDA0002742325830000072
by analogy, it can be seen that the magnitude of n is in direct proportion to the number of terms of the preset interference value calculation formula.
In one embodiment, the n-3.
As shown in fig. 3, an exemplary graph showing the relationship between the brightness of the screen and the interference value is shown.
As shown in fig. 4, an exemplary gamma2.2 relationship curve showing the color depth of the screen and the interference value is shown.
Step S202, determining the RGB value of the ambient light according to the RGB value of the color temperature sensor and the interference value.
In application, after the interference value of the screen to the RGB value of the color temperature sensor is determined, the RGB value of the ambient light can be determined according to the difference between the RGB value of the color temperature sensor and the interference value.
In one embodiment, the calculation formula of step S202 is as follows:
Figure GDA0002742325830000073
wherein R represents an R component of the ambient light, G represents a G component of the ambient light, B represents a B component of the ambient light, R1 represents an R component of the color temperature sensor, G1 represents a G component of the color temperature sensor, and B1 represents a B component of the color temperature sensor.
And S203, determining the color temperature value of the ambient light according to the RGB value and the color temperature calculation formula of the ambient light.
In application, the RGB value of the ambient light is calculated through a color temperature calculation formula, and the color temperature value of the ambient light after the interference of a picture displayed on a screen is eliminated can be obtained.
In one embodiment, step S203 comprises:
determining the tristimulus value of the ambient light according to the RGB value of the ambient light;
determining the color coordinate of the ambient light according to the tristimulus values of the ambient light;
and determining the color temperature value of the ambient light according to the color coordinate and color temperature calculation formula of the ambient light.
In application, the RGB values of the ambient light may be converted into tristimulus values according to a CIE spectrum tristimulus value calculation formula based on the CIE (Commission Internationale de L' Eclairage) 1931 standard, and then the color coordinates are calculated.
In one embodiment, the calculation formula for determining the tristimulus value of the ambient light according to the RGB values of the ambient light is as follows:
Figure GDA0002742325830000081
wherein X, Y, Z represents the tristimulus value of the ambient light, R represents the R component of the ambient light, G represents the G component of the ambient light, and B represents the B component of the ambient light.
In one embodiment, the calculation formula for determining the color coordinates of the ambient light according to the tristimulus values of the ambient light is as follows:
Figure GDA0002742325830000082
wherein x, y, z represent the color coordinates of the ambient light.
In one embodiment, the calculation formula for determining the color temperature value of the ambient light according to the color coordinate and the color temperature calculation formula of the ambient light is as follows:
T=(x-0.3320)/(0.1858-y);
wherein T represents the color temperature value of the ambient light.
And step S204, determining the relevant color temperature value of the ambient light according to the color temperature value of the ambient light.
In application, the Temperature of the Color of light radiated by a black body (e.g., platinum) at a certain Temperature that coincides with the Color of ambient light is expressed as the Color Temperature of ambient light, i.e., Correlated Color Temperature (CCT).
In one embodiment, the calculation formula for determining the color temperature value of the ambient light according to the color temperature value of the ambient light is as follows:
CCT=437×T3+3601×T2+6831×T+5517;
wherein CCT represents a correlated color temperature value of the ambient light.
In the embodiment, the interference value of the screen to the RGB value of the color temperature sensor is determined by a calculation formula according to the RGB value of the screen, the brightness level of the screen and a preset interference value; determining the RGB value of the ambient light according to the RGB value and the interference value of the color temperature sensor; determining the color temperature value of the ambient light according to the RGB value and the color temperature calculation formula of the ambient light; according to the color temperature value of the ambient light, the related color temperature value of the ambient light is determined, and the interference of the screen light to the color temperature sensor can be eliminated, so that the accurate related color temperature value of the ambient light is obtained.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
EXAMPLE III
As shown in fig. 5, the present embodiment provides an electronic device 100, which includes a memory 10, a processor 20, and a computer program 11 stored in the memory 10 and executable on the processor 20, and further includes a color temperature sensor 30, a screen 40, and a camera 50 electrically connected to the processor 20, wherein the processor 20 implements the steps of the color temperature compensation method in the first embodiment or the second embodiment when executing the computer program 11.
In application, the electronic device may be a smart phone, a tablet computer, a notebook computer, a personal digital assistant, a self-service camera, a digital camera, etc. with display and camera functions. The electronic devices may include, but are not limited to, a memory, a processor, a color temperature sensor, a screen, and a camera. Those skilled in the art will appreciate that fig. 5 is merely an example of the electronic device 100 and does not constitute a limitation of the electronic device 100 and may include more or fewer components than shown, or combine certain components, or different components, e.g., the electronic device may also include input-output devices, network access devices, buses, etc.
In an application, the storage may be an internal storage unit of the electronic device, such as a hard disk or a memory of the electronic device. The memory may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the electronic device. Further, the memory may also include both internal storage units and external storage devices of the electronic device. The memory is used for storing computer programs and other programs and data required by the electronic device. The memory may also be used to temporarily store data that has been output or is to be output.
In an application, the computer program may be divided into one or more modules/units, which are stored in the memory and executed by the processor to implement the color temperature compensation method. One or more modules/units may be a series of computer program instruction segments capable of performing certain functions, which are used to describe the execution of a computer program in an electronic device. For example, the computer program may be divided into a first acquisition module, a second acquisition module, a determination module, and a compensation module, and each module has the following specific functions:
the first acquisition module is used for acquiring the RGB value of the color temperature sensor;
the second acquisition module is used for acquiring the RGB value of the screen and the brightness level of the screen;
the determining module is used for determining the relevant color temperature value of the ambient light according to the RGB value of the color temperature sensor, the RGB value of the screen and the brightness level of the screen;
and the compensation module is used for compensating the color temperature value of the camera according to the relevant color temperature value of the ambient light, so that the deviation between the color temperature value of the camera and the relevant color temperature value of the ambient light is smaller than a preset color temperature threshold value.
In one embodiment, the computer program may be further divided into a third obtaining module and a calculating module, and the specific functions of the modules are as follows:
the third acquisition module is used for acquiring at least n groups of different RGB values of the screen and at least n brightness levels of the screen; wherein the RGB values of each group of the screen correspond to a brightness level of the screen;
the calculation module is used for performing nth polynomial fitting calculation on at least n groups of different RGB values of the screen, at least n brightness levels of the screen and a preset reference brightness level according to an nth polynomial fitting algorithm to obtain a preset interference value calculation formula; wherein n is not less than 1 and n is an integer.
In one embodiment, the computer program may be further divided into a first determining unit, a second determining unit, a third determining unit and a fourth determining unit, and the specific functions of each unit are as follows:
the first determining unit is used for determining the interference value of the screen on the RGB value of the color temperature sensor according to the RGB value of the screen, the brightness level of the screen and a preset interference value calculation formula;
the second determining unit is used for determining the RGB value of the ambient light according to the RGB value of the color temperature sensor and the interference value;
the third determining unit is used for determining the color temperature value of the ambient light according to the RGB value and the color temperature calculation formula of the ambient light;
and the fourth determining unit is used for determining the related color temperature value of the ambient light according to the color temperature value of the ambient light.
In Application, the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In application, the screen may be set as a Liquid Crystal Display screen based on an LCD (Liquid Crystal Display) technology, an organic electroluminescent Display screen based on an OLED technology, a Quantum Dot Light Emitting diode Display screen based on a QLED (Quantum Dot Light Emitting diode) technology, a curved Display screen, or the like according to actual needs.
In one embodiment, the screen is an OLED screen, and the color temperature sensor is disposed below the OLED screen;
ambient light is incident to the color temperature sensor through the OLED screen.
In application, the color temperature sensor is arranged on the front surface of the electronic equipment, namely, the color temperature sensor and the screen of the electronic equipment are arranged on the same surface; when the screen of the electronic device is an OLED (Organic Light-Emitting display) screen, the color temperature sensor may be disposed below the screen, and particularly may be disposed below foam under the screen of the OLED screen, and a through hole is disposed in a foam area between the color temperature sensor and the OLED screen, so that there is no shielding between the OLED screen and the color temperature sensor, and ambient Light may penetrate through the OLED screen and enter the color temperature sensor through the through hole.
As shown in fig. 6, when the screen 40 is exemplarily shown to be an OLED screen, the electronic device 100 further includes a foam 60 under the screen, and a through hole 61 is opened in a foam region between the color temperature sensor 30 and the screen 40.
As shown in fig. 7 or fig. 8, in an embodiment, the color temperature sensor 30 is a light sensor of the electronic device 100, that is, the color temperature sensor and the light sensor of the electronic device 100 are shared, and the light sensor is used as a color temperature sensor without additionally providing a color temperature sensor, and the light sensor has functions of light sensing and color temperature sensing. By using the light sensor as the color temperature sensor, the cost and the space of the electronic equipment can be effectively saved, and the electronic equipment can be lighter and thinner.
As shown in fig. 7, the light sensor 30 includes a first analog-to-digital converter 31, a second analog-to-digital converter 32, a third analog-to-digital converter 33, a fourth analog-to-digital converter 34, an infrared channel photodiode D1, and an R channel photodiode D2, a G channel photodiode D3, and a B channel photodiode D4 corresponding to three primary colors of RGB;
the first analog-to-digital converter 31 is electrically connected with the infrared channel photodiode D1 and the processor 20;
the second analog-to-digital converter 32 is electrically connected to the R-channel photodiode D2 and the processor 20;
the third analog-to-digital converter 33 is electrically connected with the G-channel photodiode D3 and the processor 20;
the fourth analog-to-digital converter 34 is electrically connected to the B-channel photodiode D4 and the processor 20.
In application, the first to fourth analog-to-digital converters can select analog-to-digital converters with appropriate sampling precision according to actual needs, the infrared channel photodiodes, the R channel photodiodes, the G channel photodiodes D3 and the B channel photodiodes can select photodiodes with corresponding light filtering functions according to actual needs, the number of each photodiode can be more than one, and all the photodiodes can be regularly arranged in an array form. The photodiode with the light filtering function can be obtained by arranging the corresponding type of optical filter or plating the film with the corresponding optical filtering function on the light incidence surface of the common photodiode. For example, an infrared light filter, a red light filter, a green light filter, and a blue light filter are respectively coated on the light incident surface of the infrared channel photodiode, the R channel photodiode, the G channel photodiode D3, and the B channel photodiode, it should be understood that the infrared light filter refers to a filter that can transmit infrared light and filter other light, the red light filter refers to a filter that can transmit red light and filter other light, the green light filter refers to a filter that can transmit green light and filter other light, and the blue light filter refers to a filter that can transmit blue light and filter other light.
As shown in fig. 8, the light sensor 30 includes a first analog-to-digital converter 31, a second analog-to-digital converter 32, a third analog-to-digital converter 33, an infrared channel photodiode D1, a switch 35, a first photodiode D2, a second photodiode D3, and a third photodiode D4;
the second analog-to-digital converter 32 is electrically connected to the second photodiode D3 and the processor 20;
the third analog-to-digital converter 33 is electrically connected with the third photodiode D4 and the processor 20;
the switch 35 is electrically connected to the processor 20, the first analog-to-digital converter 31, the infrared channel photodiode D1 and the first photodiode D2, and the first analog-to-digital converter 31 is further electrically connected to the processor 20;
the processor 20 is configured to control the switch 35 to switch on the electrical connection between the first analog-to-digital converter 31 and the first photodiode D2 when receiving the color temperature compensation instruction;
the first photodiode D2, the second photodiode D3, and the third photodiode D4 are different from each other and are each one of an R-channel photodiode, a G-channel photodiode, and a B-channel photodiode corresponding to three primary colors of RGB.
In application, the switch can be configured as an analog switch chip or circuit according to actual needs, for example, a single-pole double-throw analog switch or a transistor (e.g., a triode or a field effect transistor).
The diverter switch 35 is illustratively shown in fig. 8 as a single pole double throw analog switch.
In application, the color temperature compensation instruction can be automatically sent to the change-over switch by the processor when the camera starts the photographing function, and can also be sent to the change-over switch by the processor when a user triggers the color temperature compensation function of the electronic equipment in any feasible man-machine interaction mode after the camera starts the photographing function.
As shown in fig. 7 and 8, the light sensor 30 further includes an interface circuit 36, where the interface circuit 36 is electrically connected between the processor 20 and the first analog-to-digital converter 31, the second analog-to-digital converter 32, and the third analog-to-digital converter 33 to provide corresponding interfaces for communication between the processor 20 and the first analog-to-digital converter 31, the second analog-to-digital converter 32, and the third analog-to-digital converter 33. The interface circuitry may provide, for example, an I2C interface, a terminal interface, a digital data input/output interface, and the like.
As shown in fig. 7 and 8, the light sensor 30 is exemplarily shown to include a power supply pin VCC, a ground pin GND, a data pin SDA, a clock pin SCL, an interrupt pin INT, an address pin ADDR, and a TEST pin TEST.
The embodiment determines the correlated color temperature value of the ambient light by acquiring the RGB value of the color temperature sensor, the RGB value of the screen and the brightness level of the screen according to the RGB value of the color temperature sensor, the RGB value of the screen and the brightness level of the screen, and then compensates the color temperature value of the camera according to the correlated color temperature value of the ambient light, so that the deviation between the color temperature value of the camera and the correlated color temperature value of the ambient light is smaller than a preset color temperature threshold value, the camera can keep color balance, and the shooting effect is effectively improved.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A color temperature compensation method is applied to an electronic device, the electronic device comprises a color temperature sensor, a screen and a camera, and the color temperature compensation method comprises the following steps:
acquiring RGB values of the color temperature sensor;
acquiring the RGB value of the screen and the brightness level of the screen;
determining a correlated color temperature value of ambient light according to the RGB value of the color temperature sensor, the RGB value of the screen and the brightness level of the screen;
and compensating the color temperature value of the camera according to the correlated color temperature value of the ambient light, so that the deviation between the color temperature value of the camera and the correlated color temperature value of the ambient light is smaller than a preset color temperature threshold value.
2. The color temperature compensation method of claim 1, wherein determining the correlated color temperature value of the ambient light according to the RGB values of the color temperature sensor, the RGB values of the screen, and the brightness level of the screen comprises:
determining an interference value of the screen to the RGB value of the color temperature sensor according to the RGB value of the screen, the brightness level of the screen and a preset interference value calculation formula;
determining the RGB value of the ambient light according to the RGB value of the color temperature sensor and the interference value;
determining the color temperature value of the ambient light according to the RGB value and the color temperature calculation formula of the ambient light;
and determining the relevant color temperature value of the ambient light according to the color temperature value of the ambient light.
3. The color temperature compensation method of claim 2, wherein before determining the correlated color temperature value of the ambient light according to the RGB values of the color temperature sensor, the RGB values of the screen, and the brightness level of the screen, comprises:
acquiring at least n groups of different RGB values of the screen and at least n brightness levels of the screen; wherein the RGB values of each group of the screen correspond to a brightness level of the screen;
performing nth polynomial fitting calculation on at least n groups of different RGB values of the screen, at least n brightness levels of the screen and a preset reference brightness level according to an nth polynomial fitting algorithm to obtain a preset interference value calculation formula; wherein n is not less than 1 and n is an integer.
4. The color temperature compensation method of claim 2 or 3, wherein the RGB values include R, G, and B components corresponding to RGB three primary colors, and the interference values include R, G, and B component interference values;
the expression of the preset interference value calculation formula is as follows:
Figure FDA0002756273550000021
wherein Δ R represents an R component interference value, Δ G represents a G component interference value, Δ B represents a B component interference value, a0, a1, a2, … and an are constants, B0, B1, B2, … and bn are constants, c0, c1, c2, … and cn are constants, R represents an R component of the screen, G represents a G component of the screen, B represents a B component of the screen, level represents a brightness level of the screen, level _ ref represents a preset reference brightness level, n ≧ 1 and n is an integer.
5. The color temperature compensation method of claim 4, wherein the calculation formula for determining the RGB values of the ambient light according to the RGB values of the color temperature sensor and the interference values is as follows:
Figure FDA0002756273550000022
wherein R represents an R component of the ambient light, G represents a G component of the ambient light, B represents a B component of the ambient light, R1 represents an R component of the color temperature sensor, G1 represents a G component of the color temperature sensor, and B1 represents a B component of the color temperature sensor.
6. The color temperature compensation method of claim 4, wherein n is 3;
the expression of the preset interference value calculation formula is as follows:
Figure FDA0002756273550000023
7. an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized by further comprising a color temperature sensor, a screen and a camera electrically connected to the processor, respectively, the processor implementing the steps of the color temperature compensation method according to any one of claims 1 to 6 when executing the computer program.
8. The electronic device of claim 7, wherein the screen is an OLED screen, the color temperature sensor being disposed below the OLED screen;
ambient light is incident to the color temperature sensor through the OLED screen.
9. The electronic device of claim 7 or 8, wherein the color temperature sensor is a light sensor of the electronic device;
the light sensor comprises a first analog-to-digital converter, a second analog-to-digital converter, a third analog-to-digital converter, a fourth analog-to-digital converter, an infrared channel photodiode, and an R channel photodiode, a G channel photodiode and a B channel photodiode which correspond to RGB three primary colors;
the first analog-to-digital converter is electrically connected with the infrared channel photodiode and the processor;
the second analog-to-digital converter is electrically connected with the R-channel photodiode and the processor;
the third analog-to-digital converter is electrically connected with the G-channel photodiode and the processor;
the fourth analog-to-digital converter is electrically connected with the B-channel photodiode and the processor;
or the light sensor comprises a first analog-to-digital converter, a second analog-to-digital converter, a third analog-to-digital converter, an infrared channel photodiode, a selector switch, a first photodiode, a second photodiode and a third photodiode;
the second analog-to-digital converter is electrically connected with the second photodiode and the processor;
the third analog-to-digital converter is electrically connected with the third photodiode and the processor;
the change-over switch is electrically connected with the processor, the first analog-to-digital converter, the infrared channel photodiode and the first photodiode, and the first analog-to-digital converter is also electrically connected with the processor;
the processor is used for controlling the selector switch to switch on the electric connection between the first analog-to-digital converter and the first photodiode when receiving a color temperature compensation instruction;
the first photodiode, the second photodiode and the third photodiode are different from each other and are respectively one of an R-channel photodiode, a G-channel photodiode and a B-channel photodiode corresponding to RGB (red, green and blue) three primary colors.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the color temperature compensation method according to any one of claims 1 to 6.
CN201910451847.4A 2019-05-28 2019-05-28 Color temperature compensation method, electronic device, and computer-readable storage medium Active CN110139088B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910451847.4A CN110139088B (en) 2019-05-28 2019-05-28 Color temperature compensation method, electronic device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910451847.4A CN110139088B (en) 2019-05-28 2019-05-28 Color temperature compensation method, electronic device, and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN110139088A CN110139088A (en) 2019-08-16
CN110139088B true CN110139088B (en) 2021-03-02

Family

ID=67582318

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910451847.4A Active CN110139088B (en) 2019-05-28 2019-05-28 Color temperature compensation method, electronic device, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN110139088B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110730262A (en) * 2019-10-30 2020-01-24 北京字节跳动网络技术有限公司 Environment brightness value detection method and device and electronic equipment
CN111918047A (en) * 2020-07-27 2020-11-10 Oppo广东移动通信有限公司 Photographing control method and device, storage medium and electronic equipment
CN111964778A (en) * 2020-08-21 2020-11-20 深圳市汇顶科技股份有限公司 Under-screen environment optical sensor and terminal equipment
CN112082644A (en) * 2020-09-14 2020-12-15 深圳市汇顶科技股份有限公司 Under-screen environment optical sensor and terminal equipment
CN112735352A (en) * 2020-12-31 2021-04-30 Oppo广东移动通信有限公司 Color temperature self-adaptive adjusting method, device, equipment and medium for display equipment
CN113194303B (en) * 2021-06-29 2023-05-23 深圳小米通讯技术有限公司 Image white balance method, device, electronic equipment and computer readable storage medium
CN114205569B (en) * 2021-12-10 2023-07-07 峰米(北京)科技有限公司 Color temperature compensation method and device for projection equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103338383A (en) * 2013-06-25 2013-10-02 深圳市中兴移动通信有限公司 White balance calibrating method and device
TW201432646A (en) * 2013-02-08 2014-08-16 Hung-Ta Liu Display apparatus and method of adjusting color temperature thereof
CN105208364A (en) * 2014-06-27 2015-12-30 联想(北京)有限公司 Image white balance control method, device and electronic apparatus
CN105208360A (en) * 2015-09-23 2015-12-30 青岛海信移动通信技术股份有限公司 Image preview method and device of intelligent terminal and terminal
CN106097953A (en) * 2016-06-29 2016-11-09 广东欧珀移动通信有限公司 Control method and control device
CN107221305A (en) * 2017-06-19 2017-09-29 广东欧珀移动通信有限公司 Color temperature adjusting method, device and its equipment based on screen intensity

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201432646A (en) * 2013-02-08 2014-08-16 Hung-Ta Liu Display apparatus and method of adjusting color temperature thereof
CN103338383A (en) * 2013-06-25 2013-10-02 深圳市中兴移动通信有限公司 White balance calibrating method and device
CN105208364A (en) * 2014-06-27 2015-12-30 联想(北京)有限公司 Image white balance control method, device and electronic apparatus
CN105208360A (en) * 2015-09-23 2015-12-30 青岛海信移动通信技术股份有限公司 Image preview method and device of intelligent terminal and terminal
CN106097953A (en) * 2016-06-29 2016-11-09 广东欧珀移动通信有限公司 Control method and control device
CN107221305A (en) * 2017-06-19 2017-09-29 广东欧珀移动通信有限公司 Color temperature adjusting method, device and its equipment based on screen intensity

Also Published As

Publication number Publication date
CN110139088A (en) 2019-08-16

Similar Documents

Publication Publication Date Title
CN110139088B (en) Color temperature compensation method, electronic device, and computer-readable storage medium
CN108376539B (en) Image color compensation method and device
CN112073703B (en) Method and device for adjusting color correction matrix, terminal equipment and medium
US10497297B2 (en) Electronic device with ambient-adaptive display
CN113077738B (en) Ambient light detection method and device and storage medium
CN103426391B (en) For the method and apparatus of display calibration
CN103765503A (en) Fast calibration of displays using spectral-based colorimetrically calibrated multicolor camera
WO2008153620A1 (en) Color correcting for ambient light
CN111326099A (en) Display correction method, device and system, storage medium and display system
CN211959311U (en) Image scanning device
JP2023538781A (en) White balance correction method, device and electronic equipment
JP2022511143A (en) Ambient light detection method, ambient light detection device, terminal device and storage medium
EP3916714A1 (en) Method and device for calibrating color gamut of display screen, and electronic device
CN112116888A (en) Screen calibration method, calibration device and storage medium
CN112710383A (en) Light sensor calibration method and device and storage medium
CN111083256A (en) Display screen assembly and electronic device
CN111696479B (en) Color gamut adjusting method and device
KR102412278B1 (en) Camera module including filter array of complementary colors and electronic device including the camera module
CN111918047A (en) Photographing control method and device, storage medium and electronic equipment
US7965322B2 (en) Color correction on an image
US11145233B1 (en) Masking for mitigating visual contrast of a camera region of a display
CN114531521B (en) Image processing method, device, storage medium and electronic equipment
CN113870768B (en) Display compensation method and device
CN113473101B (en) Color correction method, device, electronic equipment and storage medium
Lee et al. A camera-based color calibration of tiled display systems under various illumination environments

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant