CN113260127B - Color temperature adjusting method, terminal equipment and computer readable storage medium - Google Patents
Color temperature adjusting method, terminal equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN113260127B CN113260127B CN202110484887.6A CN202110484887A CN113260127B CN 113260127 B CN113260127 B CN 113260127B CN 202110484887 A CN202110484887 A CN 202110484887A CN 113260127 B CN113260127 B CN 113260127B
- Authority
- CN
- China
- Prior art keywords
- value
- color temperature
- color
- calculating
- channel value
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H05—ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
- H05B—ELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
- H05B47/00—Circuit arrangements for operating light sources in general, i.e. where the type of light source is not relevant
- H05B47/10—Controlling the light source
- H05B47/165—Controlling the light source following a pre-assigned programmed sequence; Logic control [LC]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02B—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
- Y02B20/00—Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
- Y02B20/40—Control techniques providing energy savings, e.g. smart controller or presence detection
Landscapes
- Circuit Arrangement For Electric Light Sources In General (AREA)
Abstract
The application is applicable to the technical field of illumination and provides a color temperature adjusting method, terminal equipment and a computer readable storage medium. The method comprises the following steps: acquiring a color temperature to be regulated; calculating a target color parameter according to the color temperature to be regulated; and controlling the light source of the lighting equipment according to the target color parameters. In the color temperature adjusting method provided by the application, the target color parameter is calculated according to the color temperature to be adjusted, then, the light source of the lighting equipment is controlled according to the target color parameter, so that the color temperature of the light source is indirectly adjusted in a mode of adjusting the target color parameter, the limitation of the light source on the color temperature is avoided, the technical problems that the range of the color temperature adjusting interval of the light source of the current lighting equipment is small, and a user is difficult to adjust the color temperature outside the color temperature adjusting interval are solved, and the color temperature adjusting method has high practicability and usability.
Description
Technical Field
The application belongs to the field of illumination, and particularly relates to a color temperature adjusting method, terminal equipment and a computer readable storage medium.
Background
Along with the popularization of intelligent house, the illumination parameters such as luminance, colour temperature of the illumination that can adjust the light source according to the instruction of control end at present some intelligent lighting apparatus.
The color temperature is a measurement unit containing color components in light, and is an important parameter in the field of illumination.
The color temperature of current lighting devices is limited by the light source of the lighting device, typically within a small color temperature tuning interval. When a user wishes to adjust the color temperature outside the color temperature adjustment interval, the light source of the lighting device cannot directly adjust the color temperature desired by the user, affecting the use experience of the user.
Disclosure of Invention
The embodiment of the application provides a color temperature adjusting method, terminal equipment and a computer readable storage medium, which can solve the technical problems that the range of a color temperature adjusting interval of a light source of current lighting equipment is small, and a user is difficult to adjust the color temperature outside the color temperature adjusting interval.
In a first aspect, an embodiment of the present application provides a color temperature adjustment method, including:
acquiring a color temperature to be regulated;
calculating a target color parameter according to the color temperature to be regulated;
and controlling the light source of the lighting equipment according to the target color parameters.
In a second aspect, an embodiment of the present application provides a color temperature adjusting device, including:
the color temperature acquisition module is used for acquiring the color temperature to be regulated;
the parameter calculation module is used for calculating a target color parameter according to the color temperature to be regulated;
And the color temperature adjusting module is used for controlling the light source of the lighting equipment according to the target color parameter.
In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method according to the first aspect when the processor executes the computer program.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method according to the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product for causing a terminal device to perform the method of the first aspect described above when the computer program product is run on the terminal device.
Compared with the prior art, the embodiment of the application has the beneficial effects that:
in the color temperature adjusting method provided by the application, the color temperature to be adjusted is obtained; calculating a target color parameter according to the color temperature to be regulated; and controlling the light source of the lighting equipment according to the target color parameters.
The color temperature adjusting device calculates target color parameters according to the color temperature to be adjusted, indirectly adjusts the color temperature of the light source in a mode of adjusting the target color parameters, avoids the limitation of the light source on the color temperature, solves the technical problems that the range of a color temperature adjusting interval of the light source of the current lighting equipment is small, and a user is difficult to adjust the color temperature beyond the color temperature adjusting interval, and has higher practicability and usability.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a color temperature adjusting method according to an embodiment of the present application;
FIG. 2 is a schematic view of a scenario provided in an embodiment of the present application;
FIG. 3 is a schematic view of another scenario provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram of a color temperature adjusting device according to an embodiment of the present application;
Fig. 5 is a schematic structural diagram of a terminal device provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In addition, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The color temperature adjusting method provided by the embodiment of the application can be applied to terminal equipment such as a lighting control box, a mobile phone, a tablet personal computer, vehicle-mounted equipment, augmented reality (augmented reality, AR)/Virtual Reality (VR) equipment, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA) and the like, and the specific type of the terminal equipment is not limited.
In order to illustrate the technical solutions described in the present application, the following description is made by specific examples.
Example 1
Referring to fig. 1, a color temperature adjusting method provided in an embodiment of the present application is described below, where the method includes:
s101, obtaining a color temperature to be regulated;
the color temperature adjusting system may include a lighting device and a control end (may also be referred to as a color temperature adjusting device, and may be a terminal device of the above-mentioned lighting control box, a mobile phone, a tablet computer, or the like).
The lighting device and the control terminal can be integrally arranged, or the lighting device and the control terminal can be separately arranged.
When the lighting device and the control terminal are provided separately, a wired communication connection and/or a wireless communication connection may be provided between the lighting device and the control terminal.
The wired communication connection may include one or more of a Registered Jack 45 (rj 45) communication connection, a controller area network (Controller Area Network, CAN) communication connection, an asynchronous transfer standard interface (RS-232) communication connection, and other wired communication solutions.
The wireless communication connection may include one or more of a solution for wireless communication such as Bluetooth (BT) communication connection, wi-Fi communication connection, near field communication (Near Field Communication, NFC) communication connection, mobile network (mobile network) communication connection, zigBee (ZigBee) communication connection, and the like.
The lighting device and the control terminal can perform data interaction through the wired communication connection and/or the wireless communication connection so as to realize the control of the lighting device by the control terminal.
When the user wishes to adjust the color temperature of the light source of the lighting device, the user can operate the control terminal. For example, the user may operate on an interactive interface at the control end, where the interactive interface may be in the form of a touch screen, a liquid crystal display, keys, a keyboard, a mouse, and the like.
When the control end detects the operation of the user, the control end can obtain the color temperature to be adjusted (i.e., the color temperature which the user wants to adjust) in response to the operation of the user.
S102, calculating a target color parameter according to the color temperature to be regulated;
typically the color temperature of the lighting device is limited by the light source of the lighting device, which defines a small color temperature adjustment interval.
However, in an actual application scenario, there is a possibility that the color temperature adjustment range of the control end is larger than the color temperature adjustment range. Even, there is a possibility that the control end does not limit the color temperature adjustment range.
In these scenes, the color temperature to be adjusted acquired by the control terminal may not be in the above-described color temperature adjustment section.
For example: assuming that the color temperature adjustment interval limited by the light source is [3000K,6000K ], two operation modes are set on the control end.
As shown in fig. 2, when the control terminal is in the basic mode, the color temperature adjustment interval on the control terminal is [3000k,6000k ], which matches the color temperature adjustment interval limited by the light source.
When the user operates in the basic mode, the control end may control the light source according to the obtained color temperature to be adjusted (such as 4700K shown in fig. 2). The light source may adjust a color temperature of the light source to a color temperature to be adjusted in response to an operation of the control terminal.
However, when the control terminal is in the extended mode, the color temperature adjustment interval on the control terminal is [1000K, 70000K ], which is not matched with the color temperature adjustment interval limited by the light source.
As shown in fig. 3, it is assumed that the user operates the color temperature to be adjusted on the control side. The color temperature to be regulated acquired by the control end is 6500K, and the color temperature is within the color temperature regulating range of the control end, but is not in the color temperature regulating interval limited by the light source.
Under the condition that the color temperature to be regulated exceeds the color temperature regulation interval of the light source, if the control end directly controls the light source according to the color temperature to be regulated, the light source is difficult to respond to the instruction of the control end, the color temperature of the light source cannot be regulated to the color temperature to be regulated, and the use experience of a user is affected.
Therefore, in the case that the color temperature to be adjusted exceeds the color temperature adjustment interval of the light source, the control end can adopt the color temperature adjustment method provided by the embodiment of the application to indirectly control the color temperature of the light source in a mode of adjusting the target color parameter without directly controlling the light source according to the color temperature to be adjusted and calculating the target color parameter according to the color temperature to be adjusted.
The target color parameter is a lighting parameter other than a color temperature. The specific type of the target color parameter can be set according to actual requirements. For example, the target color parameters may include one or more of a hue value, saturation, color coordinates, etc., lighting parameters.
In some possible implementations, the target color parameters may include hue values and saturation.
At this time, the control end may select a suitable conversion calculation formula, and directly calculate the hue value and the saturation according to the color temperature to be adjusted.
Alternatively, the control end may calculate the red channel value, the green channel value and the blue channel value in an RGB color mode (RGB color mode) according to the color temperature to be adjusted. Then, the control end calculates the Hue Value and Saturation of the H (Hue) S (Saturation) V (Value) in the color mode according to the red channel Value, the green channel Value and the blue channel Value, and reduces the calculation difficulty of the Hue Value and the Saturation.
Specifically, when the color temperature to be adjusted is less than or equal to the first color temperature value, the control end may set the red channel value to 255.
When the color temperature to be adjusted is greater than the first color temperature value, the control end may calculate the red channel value according to formula (1), formula (2) and formula (3):
T=CCT/100 (1)
R=T-A (2)
R=a1*R b1 (3)
wherein, CCT is the color temperature to be regulated, T is a first intermediate variable, and R is a red channel value.
The first color temperature value can be set according to actual requirements. For example, in some embodiments, the first color temperature value may be set to 6600K; in other embodiments, the first color temperature value may be set to other reasonable values. The specific value of the first color temperature value is not limited in the embodiment of the present application.
A is a red bias value, which can be set according to actual requirements, for example, A can be set to 60, or A can be set to other reasonable parameters.
a1 is a red coefficient, which can be set according to actual requirements, and any precise value can be selected as the red coefficient in the interval of [300, 400] without losing generality. For example, when the precision is a bit, 330 may be selected as the red coefficient; when the precision is two bits after the decimal point, 329.70 can be selected as a red coefficient; when the accuracy requirement is higher, 329.698727446 can be selected as the red color coefficient. It is understood that the above red color coefficient may be obtained by curve fitting continuous color temperature segments. The embodiment of the application does not limit the value range and the precision of the red coefficient.
b1 is a red order, which can be set according to actual requirements, and any precise value can be selected as the red order within the interval of [ -1,0] without losing generality. For example, when the precision is the decimal point latter, 0.1 can be chosen as the red order; when the precision is three bits after the decimal point, the red order can be selected to be minus 0.133; when the accuracy requirement is higher, -0.1332047592 can be chosen as the red order. The embodiment of the application does not limit the value range and the precision of the red order.
In addition, in the RBG color mode, the red channel value has a value of [0, 255], so when the calculated red channel value is smaller than 0, the control end can set the red channel value to 0; when the calculated red channel value is greater than 255, the control end may set the red channel value to 255.
When the color temperature to be adjusted is smaller than or equal to the first color temperature value, the control end can calculate a green channel value according to the formula (1), the formula (4) and the formula (5):
G=T (4)
G=a2*ln(G)-b2 (5)
when the color temperature to be adjusted is greater than the first color temperature value, the control end can calculate a green channel value according to the formula (1), the formula (6) and the formula (7):
G=T-B (6)
G=a3*G b3 (7)
where G is the green channel value.
B is a first green bias value, which can be set according to actual requirements, for example, B can be set to 60, or B can be set to other reasonable parameters.
a2 is a first green coefficient, which can be set according to actual requirements, and any precise value can be selected as the first green coefficient in the interval of [80, 120] without losing generality. For example, when the precision is bit, 99 may be selected as the first green coefficient; when the precision is two bits after the decimal point, 99.47 can be selected as the first green coefficient; when the accuracy requirement is higher, 99.4708025861 can be selected as the first green coefficient. It is understood that the first green coefficient may be obtained by performing curve fitting on continuous color temperature segments. The embodiment of the application does not limit the value range and the precision of the first green coefficient.
b2 is a second green offset value, which may be set according to actual requirements, and a numerical value with arbitrary precision may be selected as the second green offset value within the interval of [100, 200] without losing generality. For example, when the precision is one decimal point after, 161.1 may be selected as the second green bias value; when the precision is three bits after the decimal point, 161.120 can be selected as a second green bias value; when the accuracy requirement is higher, 161.1195681661 can be selected as the second green bias value. The value range and the precision of the second green bias value are not limited in the embodiment of the application.
a3 is a second green coefficient, which can be set according to actual requirements, and a numerical value with arbitrary precision can be selected as the second green coefficient in the interval of [200, 300] without losing generality. For example, 288 may be selected as the second green coefficient when the precision is bit; when the precision is two bits after the decimal point, 288.12 can be selected as the second green coefficient; when the accuracy requirement is higher, 288.1221695283 can be selected as the second green coefficient. It is understood that the second green coefficient may be obtained by curve fitting a continuous color temperature segment. The embodiment of the application does not limit the value range and the precision of the second green coefficient.
b3 is a green order, which can be set according to actual requirements, and any precise value can be selected as the green order in the interval of [ -1,0] without losing generality. For example, when the precision is the decimal point latter, 0.1 can be selected as the green order; when the precision is three bits after the decimal point, the green order can be selected to be-0.076; when the accuracy requirement is higher, -0.0755148492 can be chosen as the green order. The embodiment of the application does not limit the value range and the precision of the green scale.
In addition, in the RBG color mode, the green channel value has a value of [0, 255], so when the calculated green channel value is smaller than 0, the control end can set the green channel value to 0; when the calculated green channel value is greater than 255, the control end may set the green channel value to 255.
When the color temperature to be adjusted is greater than the first color temperature value, the control end may set the blue channel value to 255.
When the color temperature to be adjusted is smaller than or equal to the first color temperature value and larger than the second color temperature value, the control end can calculate the blue channel value according to the formula (1), the formula (8) and the formula (9):
BL=T-C (8)
BL=a4*ln(BL)-b4 (9)
where BL is the blue channel value.
C is a first blue bias value, which can be set according to actual requirements, for example, C can be set to 10, or C can be set to other reasonable parameters.
a4 is a blue coefficient, which can be set according to actual requirements, and any precise value can be selected as the blue coefficient in the interval of [100, 150] without losing generality. For example, 139 may be selected as the blue coefficient when the precision is bit; when the precision is two bits after the decimal point, 138.52 can be selected as a blue color coefficient; when the accuracy requirement is higher, 138.5177312231 can be selected as the blue color coefficient. It will be appreciated that the blue coefficients described above may be curve fitted to successive color temperature segments. The embodiment of the application does not limit the value range and the precision of the blue coefficient.
b4 is a second blue offset value, which may be set according to actual requirements, and any precise value may be selected as the second blue offset value in the interval of [250, 350] without losing generality. For example, when the precision is one decimal point after, 305.0 can be selected as the second blue offset value; when the precision is three bits after the decimal point, 305.045 can be selected as the second blue offset value; when the accuracy requirement is higher, 305.0447927307 can be selected as the second blue offset value. The value range and the precision of the second blue offset value are not limited in the embodiment of the application.
When the color temperature to be adjusted is less than or equal to the second color temperature value, the blue channel value may be set to 0.
The second color temperature value can be set according to actual requirements. For example, in some embodiments, the second color temperature value may be set to 1900K; in other embodiments, the second color temperature value may be set to other reasonable values. The specific values of the second color temperature value are not limited in the embodiments of the present application.
In addition, in the RBG color mode, the blue channel value has a value of [0, 255], so when the calculated blue channel value is smaller than 0, the control end can set the blue channel value to 0; when the calculated blue channel value is greater than 255, the control end may set the blue channel value to 255.
After the red channel value, the green channel value and the blue channel value are obtained by calculation, the control end can divide the red channel value, the green channel value and the blue channel value by 255 to obtain a normalized red channel value, a normalized green channel value and a normalized blue channel value, and in the subsequent calculation step, the control end calculates the normalized red channel value, the green channel value and the blue channel value by normalized values so as to reduce the complexity of calculation.
Alternatively, the control end may directly execute the subsequent calculation step without performing normalization processing on the red channel value, the green channel value, and the blue channel value.
And then, the control end can acquire the maximum value and the minimum value in the red channel value, the green channel value and the blue channel value, and calculate the tone value and the saturation according to the maximum value and the minimum value.
Specifically, the control end may calculate a difference between the maximum value and the minimum value to obtain a target difference.
When the red channel value is the maximum value, the control end can calculate a first difference value between the green channel value and the blue channel value;
then, the control end may divide the first difference by the target difference to obtain a first target value, multiply the first target value by a first preset coefficient, and add a first preset offset value to obtain a tone value.
The above calculation process can be expressed as formula (10):
hue=a5*(G-BL)/Vx+b5 (10)
where hue is the hue value and Vx is the target difference.
a5 is a first preset coefficient, and the first preset coefficient can be set according to actual requirements. For example, in some embodiments, the value of a5 may be set to 60; in other embodiments, the value of a5 may be set to other values.
b5 is a first preset bias value, which can be set according to actual requirements. For example, in some embodiments, the value of b5 may be set to 0; in other embodiments, the value of b5 may be set to other values.
When the green channel value is the maximum value, the control end can calculate a second difference value between the blue channel value and the red channel value;
then, the control end may divide the second difference by the target difference to obtain a second target value, multiply the second target value by a second preset coefficient, and add a second preset offset value to obtain a tone value.
The above calculation process can be expressed as formula (11):
hue=a6*(BL-R)/Vx+b6 (11)
wherein a6 is a second preset coefficient, which can be set according to actual requirements. For example, in some embodiments, the value of a6 may be set to 60; in other embodiments, the value of a6 may be set to other values.
b6 is a second preset bias value, which can be set according to actual requirements. For example, in some embodiments, the value of b6 may be set to 120; in other embodiments, the value of b6 may be set to other values.
When the blue channel value is the maximum value, the control end can calculate a third difference value between the red channel value and the green channel value;
then, the control end can divide the third difference value by the target difference value to obtain a third target value, multiply the third target value by a third preset coefficient, and add a third preset offset value to obtain a tone value;
The above calculation process can be expressed as formula (12):
hue=a7*(R-G)/Vx+b7 (12)
wherein a7 is a third preset coefficient, which can be set according to actual requirements. For example, in some embodiments, the value of a7 may be set to 60; in other embodiments, the value of a7 may be set to other values.
b7 is a third preset bias value, which can be set according to actual requirements. For example, in some embodiments, the value of b7 may be set to 240; in other embodiments, the value of b7 may be set to other values.
In addition, when the calculated tone value is smaller than 0, the control end may add the fourth preset offset value to the tone value to obtain an updated tone value.
The fourth preset bias value can be set according to actual requirements. For example, in some embodiments, the fourth preset bias value may be set to 360; in other embodiments, the fourth preset bias value may be set to other values.
In calculating the saturation, the control end may divide the target difference by the maximum value and multiply by the saturation coefficient to obtain the saturation, i.e. formula (13):
sat=Vx/V max (13)
where sat is saturation and Vmax is the maximum value described above.
In other possible implementations, the target color parameter may include color coordinates. The color coordinates may be coordinates of a color space such as International Commission on illumination (CIE) 1931 and CIE 1964.
At this time, the control end may calculate the abscissa x and the ordinate y of the color coordinates according to the color temperature to be adjusted and a preset coordinate conversion formula.
The coordinate conversion formula can be selected according to actual requirements. For example, in some embodiments, the above-described coordinate conversion formula may be expressed in the following manner.
When the color temperature to be adjusted is greater than or equal to the third color temperature value, the control end may calculate x according to formula (14):
x=a8*(10 9 /CCT 3 )+a9*(10 6 /CCT 2 )+a10*(10 3 /CCT)+a11 (14)
wherein a8 is a first abscissa parameter, and the value of a8 can be set according to actual requirements. For example, in some embodiments, a8 may be set to-2; in other embodiments, a8 may be set to-2.00; in other embodiments, a8 may be set to-2.0064. The embodiment of the application does not limit the value range and the precision of the a 8.
a9 is a second abscissa parameter, and the value of a9 can be set according to actual requirements. For example, in some embodiments, a9 may be set to 2; in other embodiments, a9 may be set to 1.90; in other embodiments, a9 may be set to 1.9018. The embodiment of the application does not limit the value range and the precision of the a 9.
a10 is a third abscissa parameter, and the value of a10 can be set according to actual requirements. For example, in some embodiments, a10 may be set to 0.2; in other embodiments, a10 may be set to 0.247; in other embodiments, a10 may be set to 0.24748. The embodiment of the application does not limit the value range and the precision of the a 10.
a11 is a fourth abscissa parameter, and the value of a11 can be set according to actual requirements. For example, in some embodiments, a11 may be set to 0.2; in other embodiments, a11 may be set to 0.237; in other embodiments, a11 may be set to 0.23704. The embodiment of the application does not limit the value range and the precision of the a 11.
When the color temperature to be adjusted is smaller than the third color temperature value and larger than or equal to the fourth color temperature value, the control end may calculate x according to formula (15):
x=a12*(10 9 /CCT 3 )+a13*(10 6 /CCT 2 )+a14*(10 3 /CCT)+a15 (15)
wherein a12 is a fifth abscissa parameter, and the value of a12 can be set according to actual requirements. For example, in some embodiments, a12 may be set to-4; in other embodiments, a12 may be set to-4.60; in other embodiments, a12 may be set to-4.607. The embodiment of the application does not limit the value range and the precision of the a 12.
a13 is a sixth abscissa parameter, and the value of a13 can be set according to actual requirements. For example, in some embodiments, a13 may be set to 3; in other embodiments, a13 may be set to 2.97; in other embodiments, a13 may be set to 2.9678. The embodiment of the application does not limit the value range and the precision of the a 13.
a14 is a seventh abscissa parameter, and the value of a14 can be set according to actual requirements. For example, in some embodiments, a14 may be set to 0.10; in other embodiments, a14 may be set to 0.099; in other embodiments, a14 may be set to 0.09911. The embodiment of the application does not limit the value range and the precision of the a 14.
a15 is an eighth abscissa parameter, and the value of a15 can be set according to actual requirements. For example, in some embodiments, a15 may be set to 0.2; in other embodiments, a15 may be set to 0.244; in other embodiments, a15 may be set to 0.244063. The embodiment of the application does not limit the value range and the precision of the a 15.
When the color temperature to be adjusted is smaller than the fourth color temperature value, the control end may calculate x according to formula (16):
x=a16*(10 9 /CCT 3 )+a17*(10 6 /CCT 2 )+a18*(10 3 /CCT)+a19 (16)
wherein a16 is a ninth abscissa parameter, and the value of a16 can be set according to actual requirements. For example, in some embodiments, a16 may be set to-0.02; in other embodiments, a16 may be set to-0.0216; in other embodiments, a16 may be set to-0.02160054029773841. The embodiment of the application does not limit the value range and the precision of the a 16.
a17 is a tenth abscissa parameter, and the value of a17 can be set according to actual requirements. For example, in some embodiments, a17 may be set to 0.54; in other embodiments, a17 may be set to 0.5422; in other embodiments, a17 may be set to 0.5421573525410042. The embodiment of the application does not limit the value range and the precision of the a 17.
a18 is an eleventh abscissa parameter, and the value of a18 can be set according to actual requirements. For example, in some embodiments, a18 may be set to 1; in other embodiments, a18 may be set to 0.99; in other embodiments, a18 may be set to 0.9931179468684928. The embodiment of the application does not limit the value range and the precision of the a 18.
a19 is a twelfth abscissa parameter, and the value of a19 can be set according to actual requirements. For example, in some embodiments, a19 may be set to 0.17; in other embodiments, a19 may be set to 0.17168; in other embodiments, a19 may be set to 0.17168043223821955. The embodiment of the application does not limit the value range and the precision of the a 19.
After x is calculated, the control end may calculate y according to equation (17):
y=b8*x 2 +b9*x+b10 (17)
Wherein b8 is a first ordinate parameter, and the value of b8 can be set according to actual requirements. For example, in some embodiments, b8 may be set to-3; in other embodiments, b8 may be set to-3.0; in other embodiments, b8 may be set to-3.00. The embodiment of the application does not limit the value range and the precision of b 8.
b9 is a second ordinate parameter, and the value of b9 can be set according to actual requirements. For example, in some embodiments, b9 may be set to 3; in other embodiments, b9 may be set to 2.9; in other embodiments, b9 may be set to 2.87. The embodiment of the application does not limit the value range and the precision of b 9.
b10 is a third ordinate parameter, and the value of b10 can be set according to actual requirements. For example, in some embodiments, b10 may be set to-0.3; in other embodiments, b10 may be set to-0.28; in other embodiments, b10 may be set to-0.275. The embodiment of the application does not limit the value range and the precision of b 10.
The third color temperature value and the fourth color temperature value can be set according to actual requirements. For example, in some embodiments, the third color temperature value may be set to 7000K and the fourth color temperature value may be set to 4000K; in other embodiments, the third color temperature value and the fourth color temperature value may be set to other reasonable values. Specific numerical values of the third color temperature value and the fourth color temperature value are not limited in the embodiment of the present application.
S103, controlling the light source of the lighting equipment according to the target color parameters.
After the target color parameter is calculated, the control end can control the light source of the lighting device according to the target color parameter.
For example, when the target color parameter is hue value and saturation, the control end controls the light source according to the calculated hue value and saturation. The light source responds to the instruction of the control end, the hue value of the light source is adjusted to be the calculated hue value, the saturation of the light source is adjusted to be the calculated saturation, and the color temperature of the light source is indirectly adjusted in a mode of adjusting the hue value and the saturation, so that the color temperature of the light source is adjusted to be the color temperature to be adjusted.
When the target color parameter is the color coordinate, the control end controls the light source according to the calculated color coordinate. The light source responds to the instruction of the control end, the abscissa of the color coordinate system of the light source is adjusted to be the calculated abscissa, the ordinate of the color coordinate system of the light source is adjusted to be the calculated ordinate, and the color temperature of the light source is indirectly adjusted in a mode of adjusting the color coordinate of the color coordinate system, so that the color temperature of the light source is adjusted to be the color temperature to be adjusted.
In addition, before obtaining the color temperature to be adjusted, the control end can set a plurality of color temperature adjusting modes and set color temperature adjusting intervals corresponding to the color temperature adjusting modes.
Specifically, as shown in fig. 2 and 3, the control terminal may set a base mode and an extension mode. Wherein the color temperature adjustment interval of the basic mode is consistent with the color temperature adjustment interval of the light source of the lighting device, and the color temperature adjustment interval of the extended mode is larger than the color temperature adjustment interval of the light source of the lighting device.
After the lighting device and the control terminal are powered on and the communication connection is established between the lighting device and the control terminal, the control terminal can acquire a color temperature adjustment interval of the light source of the lighting device.
Then, the control end can acquire the current color temperature adjusting mode of the device.
If the current color temperature adjusting mode of the control end is the basic mode, the control end can set the color temperature adjusting interval of the color temperature to be adjusted as the color temperature adjusting interval of the light source.
For example, assuming that the color temperature adjustment interval of the light source is [3000k,6000k ], if the current color temperature adjustment mode of the control side is the base mode, the control side may set the color temperature adjustment interval of the base mode to [3000k,6000k ]. At this time, the user can operate the control terminal to select a color temperature to be adjusted in the range of [3000k,6000k ].
If the current color temperature adjusting mode of the control end is the expansion mode, the control end can set the color temperature adjusting interval of the color temperature to be adjusted as the expansion adjusting interval. The extended adjustment interval is larger than the color temperature adjustment interval of the light source, that is, the extended adjustment interval includes the color temperature adjustment interval of the light source.
For example, assuming that the color temperature adjustment interval of the light source is [3000k,6000k ], if the current color temperature adjustment mode of the control terminal is the extended mode, the control terminal may set the color temperature adjustment interval of the extended mode to the extended adjustment interval [1000k,20000k ], the extended adjustment interval [1000k,20000k ] being larger than the color temperature adjustment interval of the light source [3000k,6000k ]. At this time, the user may operate the control terminal to select a color temperature to be adjusted within a range of [1000k,20000k ].
The expansion adjustment interval can be set according to actual requirements.
In some embodiments, the extension adjustment interval may be preset. For example, assuming that a candidate adjustment interval [1000k,20000k ] is set in advance and is larger than the color temperature adjustment interval of the light source, the candidate adjustment interval may be determined as an extended adjustment interval.
In other embodiments, the control end may extend the fixed value to two sides on the basis of the color temperature adjustment interval of the light source, to obtain the extended adjustment interval. For example, assuming that the color temperature adjustment interval of the light source is [3000K,6000K ], the control end may extend the fixed value 1000K to two sides of the color temperature adjustment interval of the light source to obtain an extended adjustment interval [2000K, 70000K ], or may extend different fixed values to two sides of the light source, for example, the interval extending toward the warm color temperature is smaller than the interval extending toward the cold color temperature, and so on.
In other embodiments, the control end may extend the fixed proportion to two sides on the basis of the color temperature adjustment interval of the light source, to obtain an extended adjustment interval. For example, assuming that the color temperature adjustment interval of the light source is [3000K,6000K ], the span of the color temperature adjustment interval of the light source is 3000K, and the control end may extend one third span (i.e., one third of 3000K, equal to 1000K) to both sides of the color temperature adjustment interval of the light source to obtain an extended adjustment interval [2000K, 70000K ]
In other embodiments, the control end may determine the expansion adjustment interval in other manners. The mode of setting the expansion adjustment interval on the control end is not limited in the embodiment of the application.
Furthermore, in other possible implementations, the control end may not limit the range of the color temperature to be adjusted according to the color temperature adjustment mode, but determine the color temperature adjustment mode according to the color temperature to be adjusted according to the user input.
When the control end responds to the operation of the user to obtain the color temperature to be adjusted, the control end can judge whether the color temperature to be adjusted is in the color temperature adjusting interval of the light source.
If the color temperature to be regulated is in the color temperature regulation interval of the light source, the control end sets the color temperature regulation mode as a basic mode and directly controls the light source according to the color temperature to be regulated.
For example, assume that the color temperature adjustment interval of the light source is [3000K,6000K ], and the color temperature to be adjusted input by the user is 3500K. At this time, the control end may set the color temperature adjustment mode as a basic mode, generate a control instruction according to the color temperature to be adjusted, and send the control instruction to the light source. And after the light source receives the control instruction, the color temperature of the light source is regulated to 3500K.
If the color temperature to be adjusted is not within the color temperature adjustment interval of the light source, the control end sets the color temperature adjustment mode to an extended mode. At this time, the control end may convert the color temperature to be adjusted into a target color parameter, and control the light source according to the target color parameter.
For example, assume that the color temperature adjustment section of the light source is [3000K,6000K ], and the color temperature to be adjusted input by the user is 7500K. At this time, the control end may set the color temperature adjustment mode to the expansion mode, and calculate the hue value and the saturation according to the color temperature to be adjusted. Then, the control end generates a control instruction according to the calculated tone value and saturation, and sends the control instruction to the light source. After the light source receives the control instruction, the hue value of the light source is adjusted to the hue value in the control instruction, the saturation of the light source is adjusted to the saturation in the control instruction, and the color temperature of the light source is indirectly adjusted in a mode of adjusting the hue value and the saturation of the light source, so that the color temperature of the light source is close to 7500K.
In summary, under the condition that the light source cannot directly adjust the color temperature of the light source to the color temperature to be adjusted, the control end can use the color temperature adjusting method provided by the embodiment to convert the color temperature to be adjusted into other lighting parameters (namely, target color parameters), control the light source according to the target color parameters, and indirectly adjust the color temperature of the light source in a mode of adjusting the target color parameters, so that the color temperature of the light source is adjusted to the color temperature to be adjusted, the limitation of the light source on the color temperature is avoided, and the technical problems that the range of the color temperature adjusting interval of the light source of the current lighting equipment is small, and a user is difficult to adjust the color temperature outside the color temperature adjusting interval are solved.
When the target color parameters include a hue value and a saturation, the control end may directly calculate the hue value and the saturation according to the color temperature to be adjusted. Or the control end can convert the color temperature to be regulated into a red channel value, a green channel value and a blue channel value in an RGB color mode, and then calculate the hue value and the saturation in an HSV color mode according to the red channel value, the green channel value and the blue channel value, so that the calculation complexity is reduced.
When the target color parameter includes a color coordinate, the control end may calculate an abscissa x and an ordinate y of the color coordinate, with the color temperature to be adjusted and a preset coordinate conversion formula.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not limit the implementation process of the embodiment of the present application in any way.
Example two
Fig. 4 shows an example of a color temperature adjusting device, and for convenience of explanation, only a portion relevant to the embodiments of the present application is shown. The device comprises:
a color temperature acquisition module 201, configured to acquire a color temperature to be adjusted;
a parameter calculation module 202, configured to calculate a target color parameter according to a color temperature to be adjusted;
the color temperature adjusting module 203 is configured to control the light source of the lighting device according to the target color parameter.
Optionally, the target color parameters include: hue value and saturation;
the parameter calculation module 202 includes:
the RGB submodule is used for calculating a red channel value, a green channel value and a blue channel value according to the color temperature to be regulated;
and the HSV submodule is used for calculating the tone value and the saturation according to the red channel value, the green channel value and the blue channel value.
Optionally, the RGB sub-module includes:
the first red sub-module is used for setting a red channel value to 255 when the color temperature to be regulated is smaller than or equal to a first color temperature value;
The second red sub-module is used for calculating a red channel value according to the following when the color temperature to be regulated is larger than the first color temperature value:
T=CCT/100
R=T-A
R=a1*R b1
wherein, CCT is the color temperature to be regulated, T is a first intermediate variable, R is a red channel value, A is a red offset value, a1 is a red coefficient, and b1 is a red order.
Optionally, the RGB sub-module includes:
the first green sub-module is used for calculating a green channel value according to the following formula when the color temperature to be regulated is smaller than or equal to the first color temperature value:
T=CCT/100
G=T
G=a2*ln(G)-b2
the second green sub-module is used for calculating a green channel value according to the following formula when the color temperature to be regulated is larger than the first color temperature value:
G=T-B
G=a3*G b3
wherein, CCT is the color temperature to be regulated, T is a first intermediate variable, G is a green channel value, B is a first green offset value, a2 is a first green coefficient, B2 is a second green offset value, a3 is a second green coefficient, and B3 is a green order.
Optionally, the RGB sub-module includes:
the first blue sub-module is used for setting a blue channel value to 255 when the color temperature to be regulated is larger than a first color temperature value;
the second blue sub-module is used for calculating a blue channel value according to the following formula when the color temperature to be regulated is smaller than or equal to the first color temperature value and larger than the second color temperature value:
T=CCT/100
BL=T-C
BL=a4*ln(BL)-b4
Wherein CCT is the color temperature to be regulated, T is a first intermediate variable, BL is a blue channel value, C is a first blue offset value, a4 is a blue coefficient, and b4 is a second blue offset value;
and the third blue sub-module is used for setting the blue channel value to be 0 when the color temperature to be regulated is smaller than the second color temperature value.
Optionally, the parameter calculation module 202 further includes:
and the normalization sub-module is used for dividing the red channel value, the green channel value and the blue channel value by 255 to obtain a normalized red channel value, a normalized green channel value and a normalized blue channel value.
Optionally, the apparatus further includes:
the interval acquisition module is used for acquiring a color temperature adjustment interval of a light source of the lighting equipment;
the mode acquisition module is used for acquiring a color temperature adjustment mode;
the basic setting module is used for setting a color temperature adjusting interval of the color temperature to be adjusted as a color temperature adjusting interval of the light source when the color temperature adjusting mode is the basic mode;
the expansion setting module is used for setting the color temperature adjusting interval to be adjusted to an expansion adjusting interval when the color temperature adjusting mode is the expansion mode, and the expansion adjusting interval is larger than the color temperature adjusting interval of the light source.
Optionally, the RGB sub-module includes:
The maximum value submodule is used for acquiring the maximum value and the minimum value of the red channel value, the green channel value and the blue channel value;
and the calculating sub-module is used for calculating the tone value and the saturation according to the maximum value and the minimum value.
Optionally, the calculating submodule includes:
the first difference value submodule is used for calculating a first difference value of the green channel value and the blue channel value when the red channel value is the maximum value;
the first tone sub-module is used for dividing the first difference value by the target difference value to obtain a first target value, multiplying the first target value by a first preset coefficient, and adding a first preset offset value to obtain a tone value, wherein the target difference value is the difference value between the maximum value and the minimum value;
the second difference value submodule is used for calculating a second difference value of the blue channel value and the red channel value when the green channel value is the maximum value;
the second tone sub-module is used for dividing the second difference value by the target difference value to obtain a second target value, multiplying the second target value by a second preset coefficient and adding a second preset offset value to obtain a tone value;
a third difference value submodule, configured to calculate a third difference value between the red channel value and the green channel value when the blue channel value is the maximum value;
The third tone sub-module is used for dividing the third difference value by the target difference value to obtain a third target value, multiplying the third target value by a third preset coefficient and adding a third preset offset value to obtain a tone value;
and the tone updating sub-module is used for adding a fourth preset offset value to the tone value to obtain an updated tone value when the tone value is smaller than 0.
Optionally, the calculating submodule includes:
and the saturation sub-module is used for dividing the target difference value by the maximum value and multiplying the target difference value by the saturation coefficient to obtain the saturation, wherein the target difference value is the difference value between the maximum value and the minimum value.
Optionally, the target color parameters include: color coordinates;
the parameter calculation module 202 is specifically configured to calculate an abscissa and an ordinate of the color coordinate according to the color temperature to be adjusted.
Optionally, the parameter calculation module 202 includes:
the first abscissa submodule is used for calculating the abscissa of the color coordinate according to the following formula when the color temperature to be regulated is larger than or equal to the third color temperature:
x=a8*(10 9 /CCT 3 )+a9*(10 6 /CCT 2 )+a10*(10 3 /CCT)+a11
the second abscissa submodule is used for calculating the abscissa of the color coordinate according to the following formula when the color temperature to be regulated is smaller than the third color temperature value and is larger than or equal to the fourth color temperature value:
x=a12*(10 9 /CCT 3 )+a13*(10 6 /CCT 2 )+a14*(10 3 /CCT)+a15
and the third abscissa submodule is used for calculating the abscissa of the color coordinate according to the following formula when the color temperature to be regulated is smaller than the fourth color temperature value:
x=a16*(10 9 /CCT 3 )+a17*(10 6 /CCT 2 )+a18*(10 3 /CCT)+a19
Where x is the abscissa, a8 is the first abscissa parameter, a9 is the second abscissa parameter, a10 is the third abscissa parameter, a11 is the fourth abscissa parameter, a12 is the fifth abscissa parameter, a13 is the sixth abscissa parameter, a14 is the seventh abscissa parameter, a15 is the eighth abscissa parameter, a16 is the ninth abscissa parameter, a17 is the tenth abscissa parameter, a18 is the eleventh abscissa parameter, and a19 is the twelfth abscissa parameter.
Optionally, the parameter calculation module 202 further includes:
the ordinate submodule is used for calculating the ordinate of the color coordinates according to the following formula:
y=b8*x 2 +b9*x+b10
where y is the ordinate, b8 is the first ordinate parameter, b9 is the second ordinate parameter, and b10 is the third ordinate parameter.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the embodiment of the method of the present application, specific functions and technical effects thereof may be referred to a part of the embodiment of the method, and will not be described herein again.
Example III
Fig. 5 is a schematic diagram of a terminal device provided in a third embodiment of the present application. As shown in fig. 5, the terminal device 3 of this embodiment includes: a processor 30, a memory 31 and a computer program 32 stored in the memory 31 and executable on the processor 30. The steps of the various method embodiments described above are implemented when the processor 30 executes the computer program 32. Alternatively, the processor 30, when executing the computer program 32, performs the functions of the modules/units of the device embodiments described above.
Illustratively, the computer program 32 may be partitioned into one or more modules/units that are stored in the memory 31 and executed by the processor 30 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions for describing the execution of the computer program 32 in the terminal device 3. For example, the computer program 32 may be divided into a color temperature acquisition module, a parameter calculation module, and a color temperature adjustment module, each of which specifically functions as follows:
the color temperature acquisition module is used for acquiring the color temperature to be regulated;
the parameter calculation module is used for calculating a target color parameter according to the color temperature to be regulated;
and the color temperature adjusting module is used for controlling the light source of the lighting equipment according to the target color parameter.
The terminal device may include, but is not limited to, a processor 30, a memory 31. It will be appreciated by those skilled in the art that fig. 5 is merely an example of the terminal device 3 and does not constitute a limitation of the terminal device 3, and may include more or less components than illustrated, or may combine certain components, or different components, e.g., the terminal device may further include an input-output device, a network access device, a bus, etc.
The processor 30 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware cards, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 31 may be an internal storage unit of the terminal device 3, for example, a hard disk or a memory of the terminal device 3. The memory 31 may be an external storage device of the terminal device 3, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided in the terminal device 3. Further, the memory 31 may include both the internal storage unit and the external storage device of the terminal device 3. The memory 31 is used for storing the computer program and other programs and data required for the terminal device. The above-described memory 31 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a 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 process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
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 solution. 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 manners. For example, the apparatus/terminal device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each method embodiment described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.
Claims (12)
1. A color temperature adjustment method, comprising:
acquiring a color temperature to be regulated;
calculating a target color parameter according to the color temperature to be regulated;
controlling the light source of the lighting device according to the target color parameter;
the target color parameters include: hue value and saturation;
the calculating the target color parameter according to the color temperature to be adjusted includes:
calculating a red channel value, a green channel value and a blue channel value according to the color temperature to be regulated;
calculating the hue value and the saturation from the red channel value, the green channel value and the blue channel value;
The calculating the red channel value, the green channel value and the blue channel value according to the color temperature to be regulated comprises the following steps:
when the color temperature to be regulated is smaller than or equal to a first color temperature value, setting the red channel value to 255;
when the color temperature to be regulated is larger than a first color temperature value, calculating the red channel value according to the following formula:
T=CCT/100
R=T-A
R=a1*R b1
wherein CCT is the color temperature to be adjusted, T is a first intermediate variable, R is the red channel value, a is a red offset value, a1 is a red coefficient, and b1 is a red order.
2. The color temperature adjusting method according to claim 1, wherein the calculating of the red channel value, the green channel value, and the blue channel value according to the color temperature to be adjusted includes:
when the color temperature to be regulated is smaller than or equal to a first color temperature value, calculating the green channel value according to the following formula:
T=CCT/100
G=T
G=a2*ln(G)-b2
when the color temperature to be regulated is larger than a first color temperature value, calculating the green channel value according to the following formula:
G=T-B
G=a3*G b3
wherein CCT is the color temperature to be adjusted, T is a first intermediate variable, G is the green channel value, B is a first green offset value, a2 is a first green coefficient, B2 is a second green offset value, a3 is a second green coefficient, and B3 is a green order.
3. The color temperature adjusting method according to claim 1, wherein the calculating of the red channel value, the green channel value, and the blue channel value according to the color temperature to be adjusted includes:
when the color temperature to be regulated is larger than a first color temperature value, setting the blue channel value to 255;
when the color temperature to be adjusted is smaller than or equal to the first color temperature value and larger than a second color temperature value, calculating the blue channel value according to the following formula:
T=CCT/100
BL=T-C
BL=a4*ln(BL)-b4
wherein CCT is the color temperature to be regulated, T is a first intermediate variable, BL is the blue channel value, C is a first blue offset value, a4 is a blue coefficient, and b4 is a second blue offset value;
and when the color temperature to be regulated is smaller than a second color temperature value, setting the blue channel value to be 0.
4. The color temperature adjusting method according to any one of claims 1 to 3, further comprising, before the acquisition of the color temperature to be adjusted:
acquiring a color temperature adjustment interval of a light source of the lighting equipment;
acquiring a color temperature adjusting mode;
when the color temperature adjusting mode is a basic mode, setting a color temperature adjusting interval of the color temperature to be adjusted as a color temperature adjusting interval of the light source;
when the color temperature adjusting mode is an extension mode, setting the color temperature adjusting interval of the color temperature to be adjusted as an extension adjusting interval, wherein the extension adjusting interval is larger than the color temperature adjusting interval of the light source.
5. The color temperature adjustment method according to claim 1, wherein said calculating said hue value and said saturation from said red channel value, said green channel value, and said blue channel value comprises:
obtaining maximum and minimum values of the red channel value, the green channel value and the blue channel value;
and calculating the hue value and the saturation according to the maximum value and the minimum value.
6. The color temperature adjustment method according to claim 5, wherein said calculating said hue value and said saturation from said maximum value and said minimum value comprises:
calculating a first difference between the green channel value and the blue channel value when the red channel value is the maximum value;
dividing the first difference value by a target difference value to obtain a first target value, multiplying the first target value by a first preset coefficient, and adding a first preset offset value to obtain the tone value, wherein the target difference value is the difference value between the maximum value and the minimum value;
calculating a second difference between the blue channel value and the red channel value when the green channel value is the maximum value;
Dividing the second difference value by a target difference value to obtain a second target value, multiplying the second target value by a second preset coefficient, and adding a second preset offset value to obtain the tone value;
calculating a third difference between the red channel value and the green channel value when the blue channel value is the maximum value;
dividing the third difference value by a target difference value to obtain a third target value, multiplying the third target value by a third preset coefficient, and adding a third preset offset value to obtain the tone value;
and when the tone value is smaller than 0, adding a fourth preset offset value to the tone value to obtain an updated tone value.
7. The color temperature adjustment method according to claim 5, wherein said calculating said hue value and said saturation from said maximum value and said minimum value comprises:
dividing the maximum value by a target difference value, and multiplying the maximum value by a saturation coefficient to obtain the saturation, wherein the target difference value is the difference value between the maximum value and the minimum value.
8. The color temperature adjustment method according to claim 1, wherein the target color parameters include: color coordinates;
The calculating the target color parameter according to the color temperature to be adjusted includes:
and calculating the abscissa and the ordinate of the color coordinates according to the color temperature to be regulated.
9. The color temperature adjusting method according to claim 8, wherein the calculating of the abscissa and the ordinate of the color coordinates from the color temperature to be adjusted includes:
when the color temperature to be regulated is larger than or equal to the third color temperature, calculating the abscissa of the color coordinates according to the following formula:
when the color temperature to be adjusted is smaller than the third color temperature value and larger than or equal to the fourth color temperature value, calculating the abscissa of the color coordinates according to the following formula:
x=a12*(10 9 /CCT 3 )+a13*(10 6 /CCT 2 )+a14*(10 3 /CCT)+a15
when the color temperature to be regulated is smaller than the fourth color temperature value, calculating the abscissa of the color coordinates according to the following formula:
x=a16*(10 9 /CCT 3 )+a17*(10 6 /CCT 2 )+a18*(10 3 /CCT)+a19
wherein CCT is the color temperature to be adjusted, x is the abscissa, a8 is a first abscissa parameter, a9 is a second abscissa parameter, a10 is a third abscissa parameter, a11 is a fourth abscissa parameter, a12 is a fifth abscissa parameter, a13 is a sixth abscissa parameter, a14 is a seventh abscissa parameter, a15 is an eighth abscissa parameter, a16 is a ninth abscissa parameter, a17 is a tenth abscissa parameter, a18 is an eleventh abscissa parameter, and a19 is a twelfth abscissa parameter.
10. The color temperature adjusting method according to claim 9, wherein the calculating of the abscissa and the ordinate of the color coordinates from the color temperature to be adjusted further comprises:
the ordinate of the color coordinates is calculated according to the following formula:
y=b8*x 2 +b9*x+b10
where y is the ordinate, b8 is a first ordinate parameter, b9 is a second ordinate parameter, and b10 is a third ordinate parameter.
11. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-10 when executing the computer program.
12. A computer readable storage medium storing a computer program, which when executed by a processor implements the method according to any one of claims 1-10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110484887.6A CN113260127B (en) | 2021-04-30 | 2021-04-30 | Color temperature adjusting method, terminal equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110484887.6A CN113260127B (en) | 2021-04-30 | 2021-04-30 | Color temperature adjusting method, terminal equipment and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113260127A CN113260127A (en) | 2021-08-13 |
CN113260127B true CN113260127B (en) | 2023-04-25 |
Family
ID=77223771
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110484887.6A Active CN113260127B (en) | 2021-04-30 | 2021-04-30 | Color temperature adjusting method, terminal equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113260127B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116312312B (en) * | 2022-09-05 | 2024-06-28 | 深圳市集贤科技有限公司 | Color data processing method, light source system, device, equipment and storage medium |
CN117042266B (en) * | 2023-10-10 | 2024-02-23 | 深圳市千岩科技有限公司 | Control method, control device, electronic equipment and computer readable storage medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112616225A (en) * | 2020-12-09 | 2021-04-06 | 漳州立达信光电子科技有限公司 | Color light lamp illumination control method and terminal equipment |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI323141B (en) * | 2006-09-15 | 2010-04-01 | Coretronic Corp | Method of remedying a plurality of monochromatic light from a plurality of light-emitting diodes and the light-emitting diode control system utilizing the method |
KR20120139390A (en) * | 2011-06-17 | 2012-12-27 | 삼성전자주식회사 | Device, system and method for controlling light source to photograph |
US9607575B2 (en) * | 2013-05-13 | 2017-03-28 | Asustek Computer Inc. | Display mode adjusting method of display device and display mode adjusting module thereof |
CN103486466B (en) * | 2013-08-26 | 2015-07-08 | 深圳大学 | LED (light-emitting diode) lamp |
CN105430790B (en) * | 2015-11-13 | 2019-12-27 | 欧普照明股份有限公司 | Light mixing method for LED light source and linear lighting lamp |
CN109000886A (en) * | 2018-05-23 | 2018-12-14 | Oppo广东移动通信有限公司 | A kind of light source detection method and device thereof, equipment and storage medium |
CN109032468B (en) * | 2018-07-06 | 2020-11-17 | 维沃移动通信有限公司 | Method and terminal for adjusting equipment parameters |
CN109661059B (en) * | 2018-11-27 | 2020-12-29 | 温州大学 | LED dimming and color mixing method and system |
CN112584574A (en) * | 2020-12-15 | 2021-03-30 | 海洋王照明科技股份有限公司 | Color temperature adjusting circuit and system |
-
2021
- 2021-04-30 CN CN202110484887.6A patent/CN113260127B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112616225A (en) * | 2020-12-09 | 2021-04-06 | 漳州立达信光电子科技有限公司 | Color light lamp illumination control method and terminal equipment |
Also Published As
Publication number | Publication date |
---|---|
CN113260127A (en) | 2021-08-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113260127B (en) | Color temperature adjusting method, terminal equipment and computer readable storage medium | |
RU2628532C1 (en) | Method and device for colour adjustment | |
US8593074B2 (en) | Systems and methods for controlling an output of a light fixture | |
US10057549B2 (en) | Computer-implemented system and method for color sensing, storage and comparison | |
CN113453396B (en) | WRGB color mixing method and device based on additive color mixing, terminal equipment and storage medium | |
CN112616225A (en) | Color light lamp illumination control method and terminal equipment | |
US8619101B2 (en) | Methods and systems for white point adjustment | |
US20230199331A1 (en) | White balance compensation method and apparatus and electronic device | |
CN107633808A (en) | The brightness adjusting method and brightness regulating apparatus of display panel | |
CN112565727B (en) | Projection equipment control method, device, medium and electronic equipment | |
EP4053797A1 (en) | Method and apparatus for determining light source infromation, electronic device, and storage medium | |
CN115720727B (en) | Control design for perceptually uniform color adjustment | |
US20160133229A1 (en) | Signal processing device and signal processing method | |
CN110728962B (en) | Blue light adjusting method, blue light adjusting device, computer equipment and medium | |
CN105895051A (en) | Screen brightness adjustment method and device | |
CN111615714B (en) | Color adjustment method of RGB data | |
CN113129813B (en) | White balance adjusting method and device and computer equipment | |
CN115588405A (en) | Display parameter adjusting method, device, equipment and storage medium | |
CN115633425A (en) | Method and device for regulating and controlling mixed light source, lighting equipment and storage medium | |
CN111915688B (en) | Theme style generation method, electronic device and medium | |
CN104703335A (en) | Illumination control method, device and system | |
CN103106886A (en) | Display device capable of automatically adjusting colors and method for automatically color adjusting | |
CN112735352A (en) | Color temperature self-adaptive adjusting method, device, equipment and medium for display equipment | |
CN114615482B (en) | White balance debugging method, storage medium and intelligent television | |
CN112819908B (en) | White coordinate adjusting method and device, display and storage medium |
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 | ||
CP01 | Change in the name or title of a patent holder |
Address after: 518000 floor 2-4, building 21, Longjun Industrial Zone, Jiuwo, Longping community, Dalang street, Longhua District, Shenzhen City, Guangdong Province Patentee after: Shenzhen Aitushi Innovation Technology Co.,Ltd. Address before: 518000 floor 2-4, building 21, Longjun Industrial Zone, Jiuwo, Longping community, Dalang street, Longhua District, Shenzhen City, Guangdong Province Patentee before: APUTURE IMAGING INDUSTRIES Co.,Ltd. |
|
CP01 | Change in the name or title of a patent holder |