CN116744508A - Method, apparatus, device and computer readable storage medium for controlling light emitting device - Google Patents

Method, apparatus, device and computer readable storage medium for controlling light emitting device Download PDF

Info

Publication number
CN116744508A
CN116744508A CN202310559402.4A CN202310559402A CN116744508A CN 116744508 A CN116744508 A CN 116744508A CN 202310559402 A CN202310559402 A CN 202310559402A CN 116744508 A CN116744508 A CN 116744508A
Authority
CN
China
Prior art keywords
variable
light
information
adjusted
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.)
Pending
Application number
CN202310559402.4A
Other languages
Chinese (zh)
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.)
Foshan Electrical and Lighting Co Ltd
Original Assignee
Foshan Electrical and Lighting Co 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 Foshan Electrical and Lighting Co Ltd filed Critical Foshan Electrical and Lighting Co Ltd
Priority to CN202310559402.4A priority Critical patent/CN116744508A/en
Publication of CN116744508A publication Critical patent/CN116744508A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/02Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the way in which colour is displayed
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/10Intensity circuits
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B45/00Circuit arrangements for operating light-emitting diodes [LED]
    • H05B45/10Controlling the intensity of the light
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B45/00Circuit arrangements for operating light-emitting diodes [LED]
    • H05B45/20Controlling the colour of the light
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B47/00Circuit arrangements for operating light sources in general, i.e. where the type of light source is not relevant
    • H05B47/10Controlling the light source
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B47/00Circuit arrangements for operating light sources in general, i.e. where the type of light source is not relevant
    • H05B47/10Controlling the light source
    • H05B47/165Controlling the light source following a pre-assigned programmed sequence; Logic control [LC]
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G2320/00Control of display operating conditions
    • G09G2320/06Adjustment of display parameters
    • G09G2320/0673Adjustment of display parameters for control of gamma adjustment, e.g. selecting another gamma curve
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Algebra (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Picture Signal Circuits (AREA)

Abstract

The invention discloses a control method, equipment and device of a light-emitting device and a computer readable storage medium, relating to the technical field of illumination, wherein the method comprises the following steps: acquiring light information to be adjusted of the light-emitting device; according to the light information to be adjusted, the formula out=in is adopted 2 ×in (n‑16)/8 ×level (8‑n)/8 Calculating light correction information, wherein out is the light correction information, in is the light information to be adjusted, n is a preset gamma adjustment factor, n is a positive integer, and level is a preset class number; adjusting light output information of the light emitting device to be identical to the lightThe correction information is consistent. By adopting the invention, the nonlinear correction can be carried out on the light information to be regulated of the light rays, so that the light information to be regulated accords with the visual characteristics of human eyes.

Description

Method, apparatus, device and computer readable storage medium for controlling light emitting device
Technical Field
The present invention relates to the field of lighting technologies, and in particular, to a method, an apparatus, a device, and a computer readable storage medium for controlling a light emitting device.
Background
Currently, gamma correction algorithms are often adopted in the market to carry out nonlinear correction on brightness, color and the like of lamplight and screen display so as to reduce the influence of uneven change process during dimming and color mixing, and enable the effect to be closer to the visual feeling characteristic of human eyes.
Accordingly, existing gamma correction algorithms generally employ the following formula:
out=(in÷level) γ ×level
wherein in is an input value, level is a level number, gamma is a gamma value, and out is an output value.
The calculation process comprises a floating point division operation, a first power operation and a floating point multiplication operation, and in C language, the power operation needs to call a function pow () of a library file math.h, the function occupies memory code about 2K Byte in a compiler Keil5, the function has large internal code operation amount and long execution time, and the function is a heavy burden from the aspects of memory occupation and execution speed for a common 8-bit singlechip.
In summary, the existing calibration method has a slow execution speed and large memory occupation, and is difficult to meet the actual demands of users, so that a new dimming control method needs to be developed to realize rapid and efficient adjustment of brightness and color.
Disclosure of Invention
The invention aims to solve the technical problem of providing a control method, equipment, a device and a computer readable storage medium of a light emitting device, which can carry out nonlinear rapid and efficient correction on light information to be adjusted of light rays so as to enable the light information to be adjusted to accord with human visual characteristics.
In order to solve the technical problems, the invention provides a hairA method of controlling an optical device, comprising: acquiring light information to be adjusted of the light-emitting device; according to the light information to be adjusted, the formula out=in is adopted 2 ×in (n-16)/8 ×level (8-n)/8 Calculating light correction information, wherein out is the light correction information, in is the light information to be adjusted, n is a preset gamma adjustment factor, n is a positive integer, and level is a preset class number; and adjusting the light output information of the light emitting device to be consistent with the light correction information.
As an improvement of the above scheme, the method uses the formula out=in according to the optical information to be adjusted 2 ×in (n-16)/8 ×level (8-n)/8 The step of calculating light correction information includes: constructing and calculating a first reference parameter in according to the light information to be adjusted and a preset gamma adjustment factor (n-16)/8 The method comprises the steps of carrying out a first treatment on the surface of the Constructing and calculating a second reference parameter level according to the preset grade number and the preset gamma adjustment factor (8-n)/8 The method comprises the steps of carrying out a first treatment on the surface of the According to the first reference parameter, the second reference parameter and the light information to be adjusted, the first reference parameter and the second reference parameter are calculated according to the formula out=in 2 ×in (n-16)/8 ×level (8-n)/8 Light correction information is calculated.
As an improvement of the above scheme, the first reference parameter in is constructed and calculated according to the light information to be adjusted and a preset gamma adjustment factor (n-16)/8 The method comprises the following steps: calculate in -1/8 Is a approximation of (a); according to Newton's iterative method for said in -1/8 Is optimized to generate in -1/8 Is a function of the optimization value of (a); according to the in -1/8 Calculating the first reference parameter in by the optimized value of (2) (n-16)/8 Is a value of (2).
As an improvement of the above scheme, the calculation in -1/8 The step of approximating the values of (a) comprises: defining a first variable of a float type, wherein the first variable is a function shape parameter and is used for receiving light information to be adjusted; defining a second variable of the float type, wherein the second variable is used for storing the light information to be adjusted; defining a third variable of a long type, performing an address taking operation on the first variable, converting an address taking result forced type of the first variable into a long type, and assigning a conversion result of the first variable to the third variableThe method comprises the steps of carrying out a first treatment on the surface of the Right shifting the value of the third variable by a preset bit number, subtracting the right-shifted value of the third variable by using a preset compensation number, and assigning a difference value result to the third variable; performing an address taking operation on the third variable, converting the forced type of the address taking result of the third variable into a (flow) type, and assigning the conversion result of the third variable to the first variable, wherein the value of the first variable is in -1/8 Is a similar value to (a) in the above.
As an improvement of the scheme, the second variable is 32-bit float type, the third variable is 32-bit long type, and the preset bit number is 3 bits.
As an improvement of the scheme, the method comprises the following steps of applying the Newton iteration method to the in -1/8 Is optimized to generate in -1/8 The step of optimizing the values of (a) comprises: constructing a function f (y) = (1/y) with y as an argument 8 ) -x=0, then f' (y) = -8y -9 The method comprises the steps of carrying out a first treatment on the surface of the Let f (y) = (1/y) 8 ) -x and f' (y) = -8y -9 Substituting the obtained product into Newton's iterative formula to obtain y- (f (y)/f' (y)) = (9 y/8) - (xy) 9 (8); the in is subjected to -1/8 The approximation of (c) is substituted into the formula y- (f (y)/f' (y)) = (9 y/8) - (xy) 9 And/8) performing an iterative process to generate the in -1/8 Is used for the optimization of the values of (a).
As an improvement of the above-described scheme, the light information to be adjusted includes a gray value, a luminance value, or a color temperature value.
Correspondingly, the invention also provides a control device of the light-emitting device, which comprises: the acquisition module is used for acquiring the light information to be adjusted of the light-emitting device; a calculation module for calculating out=in according to the light information to be adjusted 2 ×in (n -16)/8 ×level (8-n)/8 Calculating light correction information, wherein out is the light correction information, in is the light information to be adjusted, n is a preset gamma adjustment factor, n is a positive integer, and level is a preset class number; and the adjusting module is used for adjusting the light output information of the light emitting device to be consistent with the light correction information.
As an improvement of the above solution, the calculation module includes: a first calculation module for calculating the first calculation result according to the waiting timeAdjusting light information and constructing and calculating a first reference parameter in by a preset gamma adjusting factor (n-16)/8 The method comprises the steps of carrying out a first treatment on the surface of the A second calculation module for constructing and calculating a second reference parameter level according to the preset number of classes and the preset gamma adjustment factor (8-n)/8 The method comprises the steps of carrying out a first treatment on the surface of the A third calculation module configured to calculate out=in according to the first reference parameter, the second reference parameter, and the light information to be adjusted by a formula of out=in 2 ×in (n -16)/8 ×level (8-n)/8 Light correction information is calculated.
As an improvement of the above solution, the first calculation module includes: an approximation calculation unit for calculating in -1/8 Is a approximation of (a); an iterative optimization unit for optimizing the in according to Newton iterative method -1/8 Is optimized to generate in -1/8 Is a function of the optimization value of (a); a parameter calculation unit for calculating the parameter according to the in -1/8 Calculating the first reference parameter in by the optimized value of (2) (n-16)/8 Is a value of (2).
As an improvement of the above-described aspect, the approximation calculation unit includes: the first defining subunit is used for defining a first variable of a float type, wherein the first variable is a function shape parameter and is used for receiving the light information to be adjusted; the second definition subunit is used for defining a second variable of the float type, and the second variable is used for storing the optical information to be adjusted; a third defining subunit, configured to define a third variable of a long type, perform an address taking operation on the first variable, convert an address taking result forced type of the first variable into a long type, and assign a conversion result of the first variable to the third variable; a compensation subunit, configured to shift the value of the third variable by a preset number of bits, subtract the value of the third variable after the right shift by using the preset number of compensation, and assign a difference result to the third variable; a conversion subunit, configured to perform an address fetching operation on the third variable, convert an address fetching result forced type of the third variable into a (flow) type, and assign a conversion result of the third variable to the first variable, where a value of the first variable is in -1/8 Is a similar value to (a) in the above.
Correspondingly, the invention further provides a light-emitting device, and control equipment comprising the light-emitting device.
Accordingly, the present invention also provides a computer-readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the method of controlling a light emitting device as described in the claims.
The implementation of the invention has the following beneficial effects:
the invention can correct the nonlinearity of the light information (gray value, brightness value or color temperature value) to be adjusted of the light rays, so that the light information to be adjusted accords with the visual characteristics of human eyes. Specifically:
according to the invention, by sacrificing the accuracy of the gamma value gamma, a unique calculation formula and a reference parameter are constructed so as to avoid a power function pow (), which is called in a gamma correction algorithm, so that nonlinear correction is realized;
meanwhile, the invention utilizes the format characteristics of the floating point number specified in the binary floating point number arithmetic standard (IEEE 754), one number is stored in a certain address in a 32-bit float type storage format, when the number is read out in a 32-bit long type storage format, the read value and the logarithm of the number have a special corresponding relation, so that the 'logarithm' of the number is directly operated by combining the compensation number, the approximate value of the negative eighth of the number can be calculated, and the accurate value is further approximated by utilizing the Newton iteration method, thereby realizing in -1/8 And (3) the execution speed of the correction process is improved.
Drawings
FIG. 1 is a flow chart of an embodiment of a method of controlling a light emitting device of the present invention;
fig. 2 is a schematic structural view of an embodiment of a control apparatus of the light emitting device of the present invention;
fig. 3 is a schematic structural view of a first calculation module in the control apparatus of the light emitting device of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings, for the purpose of making the objects, technical solutions and advantages of the present invention more apparent.
Referring to fig. 1, fig. 1 shows a flowchart of an embodiment of a control method of a light emitting device of the present invention, which includes:
s101, acquiring light information to be adjusted of a light-emitting device;
it should be noted that, the light information to be adjusted may be directly input by the user, or may be collected by the sensor and uploaded. Preferably, the light information to be adjusted can be a gray level value, a brightness value or a color temperature value, but is not limited thereto, and can be adjusted according to actual requirements.
S102, according to the light information to be adjusted, according to the formula out=in 2 ×in (n-16)/8 ×level (8-n)/8 Calculating light correction information;
wherein out is light correction information, in is light information to be adjusted, n is a preset gamma adjustment factor, n is a positive integer, and level is a preset class number;
further, step S102 includes:
s102-1, constructing and calculating a first reference parameter in according to the light information to be adjusted and the preset gamma adjustment factor (n -16)/8
Unlike the prior art, the present invention does not utilize the gamma correction formula out= (in/level) γ The x level is directly calculated, but a unique calculation formula and a reference parameter are constructed by sacrificing the accuracy of the gamma value gamma, so that a power function pow () called in a gamma correction algorithm is avoided, the execution speed is improved, and the memory occupation is reduced.
Specifically, a first reference parameter in is constructed and calculated according to the light information to be adjusted and a preset gamma adjustment factor (n -16)/8 The method comprises the following steps:
(1) Calculate in -1/8 Is a approximation of (a);
the method comprises the steps of storing a number A in a certain address in a 32-bit float type storage format by utilizing the format characteristics of floating point numbers specified in a binary floating point arithmetic standard (IEEE 754), reading the number A in a 32-bit long type storage format (namely pointer forced type conversion) to obtain a number B, shifting the number B by M to the right, calculating the number B by combining with a compensation number, and reading the number C in a 32-bit float type storage format (namely pointer forced type conversion) to obtain a number CThe value is approximately (1/2 of the value of A M ) To the power. Thus, the present invention takes m=3, takes 1/8 as the smallest gamma regulatory unit, and introduces in -1/8 Can be suitable for most occasions. Correspondingly, calculate in -1/8 The step of approximating the values of (a) comprises:
(1.1) defining a first variable of the float type;
the first variable is a 32-bit float type, which is a function-shaped parameter for receiving the optical information to be adjusted.
(1.2) defining a second variable of the float type;
the second variable is a 32-bit float type, which is used to hold the optical information to be adjusted.
(1.2) defining a third variable of a long type, performing an address taking operation on the first variable, converting the forced type of the address taking result of the first variable into a long type, and assigning the conversion result of the first variable to the third variable;
the third variable is a 32 bit long type.
(1.4) right-shifting the value of the third variable by a preset number of bits, subtracting the right-shifted value of the third variable from the preset compensation number, and assigning a difference result to the third variable;
preferably, the preset number of bits is 3 bits, and the offset number is between 0x40000000 and 0x50000000, but not limited thereto.
(1.5) performing an address taking operation on the third variable, converting the forced type of the address taking result of the third variable into a (float) type, and assigning the conversion result of the third variable to the first variable;
the value of the first variable assigned in the step (1.5) is an approximation of the negative eighth of the input optical information to be adjusted, namely in -1/8 Is a similar value to (a) in the above.
(2) Couple in according to Newton's iterative method -1/8 Is optimized to generate in -1/8 Is a function of the optimization value of (a);
specifically, according to Newton's iterative method -1/8 Is optimized to generate in -1/8 The step of optimizing the values of (a) comprises:
(2.1) constructiony is a function f (y) = (1/y) of an argument 8 ) -x=0, then f' (y) = -8y -9
The newton's iterative formula is: x is X n+1 =X n -f(x n )/f’(x n );
Due to the optimized target in -1/8 To the power of negative one eighth of a number, i.e. y=x -1/8 1/y 8 =x; therefore, a function f (y) = (1/y) having y as an argument can be constructed 8 ) -x=0, then f' (y) = -8y -9
(2.2) f (y) = (1/y) 8 ) -x and f' (y) = -8y -9 Substituting the Newton iteration formula and simplifying the obtainable: y- (f (y)/f' (y))= (9 y/8) - (xy) 9 /8);
(2.3) will in -1/8 The approximation of (c) is substituted into the formula y- (f (y)/f' (y)) = (9 y/8) - (xy) 9 (8) performing iterative processing to generate in -1/8 Is used for the optimization of the values of (a).
It should be noted that the benefit is that in is found -1/8 Is only needed to get in -1/8 Is substituted into the reduced approximation of the formula y- (f (y)/f' (y)) = (9 y/8) - (xy) 9 And/8) iterating for 1-2 times to meet the precision required by the correction of the common grade number.
As can be seen from the above, the present invention utilizes the format characteristics of floating point numbers specified in the binary floating point arithmetic standard (IEEE 754), a number is stored in a certain address in a 32-bit float type storage format, when the number is read out in a 32-bit long type storage format, the read value has a special corresponding relation with the logarithm of the number, so that the 'logarithm' of the number is directly operated by combining the compensation number, the approximate value of the negative eighth of the number can be calculated, and the accurate value is further approximated by Newton iteration method, thereby realizing in -1/8 And (3) the execution speed of the correction process is improved.
(3) According to in -1/8 Calculating the first reference parameter in by the optimized value of (2) (n-16)/8 Is a value of (2).
S102-2, constructing and calculating a second reference parameter level according to the preset class number and the preset gamma adjustment factor (8 -n)/8
Wherein, the level is a preset class number; for example, if the number of luminance steps of the light emitting device is 100, the level value is 100.
S102-3, according to the first reference parameter, the second reference parameter and the light information to be adjusted, according to formula out=in 2 ×in (n-16)/8 ×level (8-n)/8 Calculating light correction information;
it should be noted that, the conventional gamma correction formula is: out= (in/level) γ X level, let γ=n/8, then the gamma correction algorithm can be reduced to: out=in 2 ×in (n-16)/8 ×level (8-n)/8 Where, in general, γ≡2.2 is taken, i.e. n=18.
That is, the in calculated in step S102-1 is used -1/8 Calculate in (n-16)/8 And calculates the level by step S102-2 (8-n)/8 And then in (n-16)/8 Level of (8-n)/8 Substitution of the reduced formula out=in 2 ×in (n-16)/8 ×level (8-n)/8 Light correction information can be calculated.
Therefore, through steps S102-1 to S102-3, the floating point division operation, the power operation and the floating point multiplication operation of the original correction formula can be converted into simple pointer operation, forced type conversion operation, bit operation and floating point multiplication/division operation, so that the calculation efficiency is greatly improved.
S103, adjusting the light output information of the light emitting device to be consistent with the light correction information.
For example, in the adjustment process, the calculated correction brightness (i.e., light correction information) is 100, and the brightness of the light emitting device is adjusted to 100.
Therefore, the invention can correct the nonlinearity of the light information (gray value, brightness value or color temperature value) to be adjusted, so that the light information to be adjusted accords with the visual characteristic of human eyes.
Referring to fig. 2, fig. 2 shows a specific structure of a control apparatus 100 of the light emitting device of the present invention, which includes:
the acquisition module 1 is used for acquiring the light information to be adjusted of the light-emitting device. Preferably, the sensor can collect the light information to be adjusted of the light emitting device and upload the light information to be adjusted to the acquisition module 1; the user can also input the light information to be adjusted of the light emitting device through the input equipment and upload the light information to be adjusted to the acquisition module 1; preferably, the light information to be adjusted can be a gray level value, a brightness value or a color temperature value, but is not limited thereto, and can be adjusted according to actual requirements.
A calculating module 2, configured to calculate out=in according to the optical information to be adjusted 2 ×in (n-16)/8 ×level (8 -n)/8 Calculating light correction information; wherein out is light correction information, in is light information to be adjusted, n is a preset gamma adjustment factor, n is a positive integer, and level is a preset class number;
an adjustment module 3 for adjusting the light output information of the light emitting device to be consistent with the light correction information; for example, in the adjustment process, the calculated correction brightness (i.e., light correction information) is 100, and the brightness of the light emitting device is adjusted to 100.
Further, the computing module 2 includes a first computing module 21, a second computing module 22, and a third computing module 23, wherein:
a first calculation module 21 for constructing and calculating a first reference parameter in according to the light information to be adjusted and the preset gamma adjustment factor (n-16)/8 Wherein in is the light information to be adjusted, n is a preset gamma adjustment factor and n is a positive integer;
a second calculation module 22 for constructing and calculating a second reference parameter level according to the preset number of levels and the preset gamma adjustment factor (8-n)/8 Wherein, the level is a preset class number; for example, if the number of luminance steps of the light emitting device is 100, the level value is 100.level (level) (8-n)/8 The result can be calculated in advance and used directly in the program as a constant.
A third calculation module 23 for calculating a third reference parameter according to the first reference parameter, the second reference parameter and the light information to be adjusted according to the formula out=in 2 ×in (n-16)/8 ×level (8-n)/8 Calculating light correction information; it should be noted that the gamma correction algorithm is: out= (in/level) γ X level, setGamma = n/8, then the gamma correction algorithm can be reduced to: out=in 2 ×in (n-16)/8 ×level (8-n)/8 Where, in general, γ≡2.2, i.e. n=18, is taken; that is, will in (n-16)/8 Level of (8-n)/8 Substitution of the reduced formula out=in 2 ×in (n-16)/8 ×level (8-n)/8 Light correction information can be calculated.
Unlike the prior art, the present invention does not utilize the gamma correction algorithm out= (in/level) γ The x level is directly calculated, but a unique calculation formula and a reference parameter are constructed by sacrificing the accuracy of the gamma value gamma so as to avoid a power function pow () called in a gamma correction algorithm, thereby improving the execution speed and reducing the memory occupation.
Therefore, the invention can correct the nonlinearity of the light information (gray value, brightness value or color temperature value) to be adjusted, so that the light information to be adjusted accords with the visual characteristic of human eyes.
As shown in fig. 3, the first calculation module 21 includes an approximation calculation unit 211, an iterative optimization unit 212, and a parameter calculation unit 213, specifically:
the approximation calculation unit 211 is used for calculating in -1/8 Is a approximation of (a);
the iterative optimization unit 212 is used for performing in according to Newton's iterative method -1/8 Is optimized to generate in -1/8 Is a function of the optimization value of (a);
the parameter calculation unit 213 is used for calculating the parameter according to in -1/8 Calculating the first reference parameter in by the optimized value of (2) (n-16)/8 Is a value of (2).
Further, the approximation calculation unit 211 includes:
the first defining subunit 2111 is configured to define a first variable of a float type, where the first variable is a function parameter and is configured to receive optical information to be adjusted; the first variable is a 32 bit float type.
A second definition subunit 2112 for defining a second variable of the float type; the second variable is a 32-bit float type, which is used to hold the optical information to be adjusted.
A third defining subunit 2113, configured to define a third variable of the long type, perform an address taking operation on the first variable, convert the forced type of the address taking result of the first variable into a long type, and assign the conversion result of the first variable to the third variable; the third variable is a 32 bit long type.
A compensation subunit 2114, configured to shift the value of the third variable by a preset number of bits, subtract the value of the third variable after the right shift by the preset number of compensation, and assign a difference result to the third variable; preferably, the preset number of bits is 3 bits, and the offset number is between 0x40000000 and 0x50000000, but not limited thereto.
A conversion subunit 2115, configured to perform an address operation on the third variable, convert the forced type of the address result of the third variable into a type (flow) and assign the conversion result of the third variable to the first variable, where the value of the first variable is in -1/8 Is a approximation of (a); the value of the assigned first variable is the approximate value of the negative eighth of the input light information to be adjusted, namely in -1/8 Is a similar value to (a) in the above.
Therefore, the floating-point division operation, the power operation and the floating-point multiplication operation of the original correction formula can be converted into simple pointer operation, forced type conversion operation, bit operation and floating-point multiplication/division operation by the approximation calculation unit 211, so that the operation efficiency is greatly improved.
In addition, the iterative optimization unit 212 includes:
a function construction subunit 2121 for constructing a function f (y) = (1/y) having y as an argument 8 ) -x=0, then f' (y) = -8y -9 The method comprises the steps of carrying out a first treatment on the surface of the It should be noted that, the newton iteration formula is: x is X n+1 =X n -f(x n )/f’(x n ) The method comprises the steps of carrying out a first treatment on the surface of the Due to the optimized target in -1/8 To the power of negative one eighth of a number, i.e. y=x -1/8 1/y 8 =x; therefore, a function f (y) = (1/y) having y as an argument can be constructed 8 ) -x=0, then f' (y) = -8y -9
A simplified subunit 2122 for converting f (y) = (1/y) 8 ) -x and f' (y) = -8y -9 Substituting the Newton iteration formula and simplifying the obtainable: y- (f (y)/f'(y))=(9y/8)-(xy 9 /8);
An iteration subunit 2123 for inserting in -1/8 The approximation of (c) is substituted into the formula y- (f (y)/f' (y)) = (9 y/8) - (xy) 9 (8) performing iterative processing to generate in -1/8 Is used for the optimization of the values of (a).
It should be noted that the benefit is that in is found -1/8 Is only needed to get in -1/8 Is substituted into the reduced approximation of the formula y- (f (y)/f' (y)) = (9 y/8) - (xy) 9 Iteration 1-2 times to approach in -1/8 Thereby meeting the accuracy required for common class number corrections.
As can be seen from the above, the calculation module 2 uses the format characteristics of the floating point number specified in the binary floating point number arithmetic standard (IEEE 754), a number is stored in a certain address in a 32-bit float type storage format, when the number is read in a 32-bit long type storage format, the read value and the logarithm of the number have a special corresponding relation, so that the 'logarithm' of the number can be directly operated by combining the compensation number, the approximate value of the negative eighth of the number can be calculated, and the accurate value is further approximated by Newton iteration method, thereby realizing in -1/8 And (3) the execution speed of the correction process is improved.
Correspondingly, the invention also discloses a light-emitting device, which comprises the control equipment 100 of the light-emitting device, wherein the control equipment 100 of the light-emitting device is arranged in the light-emitting device. It should be noted that the light emitting device may be a lighting device, such as an LED lamp, but may also be a display screen, etc., which is not limited in this aspect of the present invention. Meanwhile, the invention also discloses a computer readable storage medium, on which a computer program is stored, wherein the computer program realizes the steps of the control method of the light emitting device when being executed by a processor.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also intended to be within the scope of the invention.

Claims (13)

1. A method for controlling a light emitting device, comprising:
acquiring light information to be adjusted of the light-emitting device;
according to the light information to be adjusted, the formula out=in is adopted 2 ×in (n-16)/8 ×level (8-n)/8 Calculating light correction information, wherein out is the light correction information, in is the light information to be adjusted, n is a preset gamma adjustment factor, n is a positive integer, and level is a preset class number;
and adjusting the light output information of the light emitting device to be consistent with the light correction information.
2. The method of controlling a light emitting device according to claim 1, wherein the light information to be adjusted is represented by formula out = in 2 ×in (n-16)/8 ×level (8-n)/8 The step of calculating light correction information includes:
constructing and calculating a first reference parameter in according to the light information to be adjusted and a preset gamma adjustment factor (n-16)/8
Constructing and calculating a second reference parameter level according to the preset grade number and the preset gamma adjustment factor (8-n)/8
According to the first reference parameter, the second reference parameter and the light information to be adjusted, the first reference parameter and the second reference parameter are calculated according to the formula out=in 2 ×in (n-16)/8 ×level (8-n)/8 Light correction information is calculated.
3. The method of claim 2, wherein the first reference parameter in is constructed and calculated according to the light information to be adjusted and a predetermined gamma adjustment factor (n-16)/8 The method comprises the following steps:
calculate in -1/8 Is a approximation of (a);
according to Newton's iterative method for said in -1/8 Is optimized to generate in -1/8 Is a function of the optimization value of (a);
according to the in -1/8 Calculating the first reference parameter in by the optimized value of (2) (n-16)/8 Is a value of (2).
4. A control method of a light-emitting device according to claim 3, wherein the calculation in -1/8 The step of approximating the values of (a) comprises:
s1, defining a first variable of a float type, wherein the first variable is a function shape parameter and is used for receiving light information to be adjusted;
defining a second variable of the float type, wherein the second variable is used for storing the light information to be adjusted;
defining a third variable of a long type, performing an address taking operation on the first variable, converting an address taking result forced type of the first variable into a long type, and assigning a conversion result of the first variable to the third variable;
s2, right shifting the value of the third variable by a preset bit number, subtracting the right-shifted value of the third variable by a preset compensation number, and assigning a difference value result to the third variable;
s3, performing address taking operation on the third variable, converting the forced type of the address taking result of the third variable into a (float) type, and assigning the conversion result of the third variable to the first variable, wherein the value of the first variable is in -1/8 Is a similar value to (a) in the above.
5. The method of controlling a light emitting device according to claim 4, wherein the first variable and the second variable are 32-bit float types, the third variable is a 32-bit long type, and the preset number of bits is 3 bits.
6. A control method of a light-emitting device according to claim 3, wherein the in is calculated according to newton's method of iteration -1/8 Is optimized to generate in -1/8 The step of optimizing the values of (a) comprises:
constructing a function f (y) = (1/y) with y as an argument 8 ) -x=0, then f' (y) = -8y -9
Let f (y) = (1/y) 8 ) -x and f'(y)=-8y -9 Substituting the obtained product into Newton's iterative formula to obtain y- (f (y)/f' (y)) = (9 y/8) - (xy) 9 /8);
The in is subjected to -1/8 The approximation of (c) is substituted into the formula y- (f (y)/f' (y)) = (9 y/8) - (xy) 9 And/8) performing an iterative process to generate the in -1/8 Is used for the optimization of the values of (a).
7. The method of controlling a light-emitting device according to any one of claims 1 to 6, wherein the light information to be adjusted includes a gray value, a luminance value, or a color temperature value.
8. A control apparatus for a light emitting device, comprising:
the acquisition module is used for acquiring the light information to be adjusted of the light-emitting device;
a calculation module for calculating out=in according to the light information to be adjusted 2 ×in (n-16)/8 ×level (8-n)/8 Calculating light correction information, wherein out is the light correction information, in is the light information to be adjusted, n is a preset gamma adjustment factor, n is a positive integer, and level is a preset class number;
and the adjusting module is used for adjusting the light output information of the light emitting device to be consistent with the light correction information.
9. The control apparatus of a light emitting device according to claim 8, wherein the calculation module includes:
a first calculation module for constructing and calculating a first reference parameter in according to the light information to be adjusted and a preset gamma adjustment factor (n-16)/8
A second calculation module for constructing and calculating a second reference parameter level according to the preset number of classes and the preset gamma adjustment factor (8-n)/8
A third calculation module for calculating out=in according to the information of the light to be adjusted, the first reference parameter and the second reference parameter 2 ×in (n-16)/8 ×level (8-n)/8 Light correction information is calculated.
10. The control apparatus of a light emitting device according to claim 9, wherein the first calculation module includes:
an approximation calculation unit for calculating i n -1/8 Is a approximation of (a);
an iterative optimization unit for optimizing the in according to Newton iterative method -1/8 Is optimized to generate in -1/8 Is a function of the optimization value of (a);
a parameter calculation unit for calculating a parameter according to i n -1/8 Calculation of the optimized value of (a) first reference parameter i n (n-16)/8 Is a value of (2).
11. The control apparatus of a light emitting device according to claim 10, wherein the approximation calculation unit includes:
the first defining subunit is used for defining a first variable of a float type, wherein the first variable is a function shape parameter and is used for receiving the light information to be adjusted;
the second definition subunit is used for defining a second variable of the float type, and the second variable is used for storing the optical information to be adjusted;
a third defining subunit, configured to define a third variable of a long type, perform an address taking operation on the first variable, convert an address taking result forced type of the first variable into a long type, and assign a conversion result of the first variable to the third variable;
a compensation subunit, configured to shift the value of the third variable by a preset number of bits, subtract the value of the third variable after the right shift by using the preset number of compensation, and assign a difference result to the third variable;
a conversion subunit, configured to perform an address fetching operation on the third variable, convert an address fetching result forced type of the third variable into a (flow) type, and assign a conversion result of the third variable to the first variable, where a value of the first variable is in -1/8 Is a similar value to (a) in the above.
12. A light-emitting device comprising the control apparatus of any one of claims 8 to 11.
13. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202310559402.4A 2023-05-17 2023-05-17 Method, apparatus, device and computer readable storage medium for controlling light emitting device Pending CN116744508A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310559402.4A CN116744508A (en) 2023-05-17 2023-05-17 Method, apparatus, device and computer readable storage medium for controlling light emitting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310559402.4A CN116744508A (en) 2023-05-17 2023-05-17 Method, apparatus, device and computer readable storage medium for controlling light emitting device

Publications (1)

Publication Number Publication Date
CN116744508A true CN116744508A (en) 2023-09-12

Family

ID=87902017

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310559402.4A Pending CN116744508A (en) 2023-05-17 2023-05-17 Method, apparatus, device and computer readable storage medium for controlling light emitting device

Country Status (1)

Country Link
CN (1) CN116744508A (en)

Similar Documents

Publication Publication Date Title
US6888552B2 (en) High dynamic range image editing
CN110473502A (en) Control method, device and the terminal device of screen intensity
US7890558B2 (en) Apparatus and method for precision binary numbers and numerical operations
JP2005526408A (en) Automatic image quality improvement of digital images
CN109855727B (en) Ambient light detection method, ambient light detection device, electronic apparatus, and storage medium
JP6983874B2 (en) High dynamic range processing
CN104485069B (en) A kind of control method of LED display contrast and system
KR20140122982A (en) Electronic device, display controlling apparatus and method there of
CN1419669A (en) Window brightness enhancement for LCD display
CN115130373A (en) Intelligent proofreading system and method based on image processing
CN105007474B (en) image processing device and image processing method
CN114067731B (en) Low gray scale correction method and device for LED display screen and brightness correction system
CN116744508A (en) Method, apparatus, device and computer readable storage medium for controlling light emitting device
WO2020233652A1 (en) Exponential dimming method and system of light-emitting diode
CN107767327B (en) Image rendering method and device, computing equipment and display equipment
EP3570640B1 (en) Led dimming method, apparatus and device, and storage medium
US11804189B2 (en) Display device, method for generating offset current values and current offsetting system
TWI757078B (en) Electronic device and brightness adjustment method thereof
CN117221747B (en) SOPC-based single-period dead pixel compensation and non-uniform correction method
CN115315038B (en) Method and device for adjusting color temperature and color rendering of LED device
CN111276089B (en) Gray scale compensation calculation method and device and display device
US11688361B2 (en) Quantifying performance of a display device
CN114566131B (en) Display brightness control method and device and display lookup table acquisition method and device
JP6115109B2 (en) Gamma characteristic acquisition apparatus, method and program
US20230021602A1 (en) Global tone mapping of images based on luminance and chrominance

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