Brightness gradient control method and system based on visual perception
By using a visual perception-based brightness mapping method and segmented mapping technology, the problem of uneven brightness gradient in LEDs is solved, achieving natural and smooth brightness changes. This method is suitable for display and lighting devices, has low resource consumption, and is applicable to MCUs.
Patent Information
- Application Number
- CN202511918428.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-03-06
AI Technical Summary
In existing technologies, when a microcontroller controls the brightness of an LED via PWM, the human eye perceives it as unnatural, with uneven brightness transitions and noticeable abrupt changes. Furthermore, gamma correction methods cannot meet the requirement for smooth brightness transitions.
A brightness mapping method based on visual perception is adopted. By segmenting the mapping, the PWM output changes conform to the human eye's brightness perception law. Linear and cubic mapping formulas are used to achieve a smooth gradual change in brightness from 0% to 100% within a set time. This includes obtaining the brightness input value, normalization processing, segmented mapping, and PWM value conversion.
It achieves a smooth, natural, and gentle gradual change in LED brightness within a set time, eliminating any sense of abruptness. It is suitable for various display and lighting devices, has low resource consumption, and is compatible with MCUs.
Smart Images

Figure CN121619701A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of brightness control technology, and in particular to a method and system for gradual brightness control based on visual perception. Background Technology
[0002] In the existing technology, microcontrollers (MCUs) typically control the brightness of LEDs through pulse width modulation (PWM). The duty cycle of the PWM is basically linearly related to the physical brightness of the LED, that is, 0% duty cycle corresponds to the darkest brightness and 100% duty cycle corresponds to the brightest brightness.
[0003] However, the human eye's perception of brightness is not linear. Its response curve is closer to the power function or the brightness function defined by the CIE (Central Image Quality) model standard. Therefore, when the PWM duty cycle changes linearly from low to high, the human eye will perceive that the LED brightness increase process is not obvious in the early stage and changes too quickly in the later stage, resulting in uneven brightness change and producing obvious jumps or unnatural abrupt changes.
[0004] Currently, common gamma correction methods typically use fixed power functions, but in actual brightness transitions, they may still deviate from CIE standards or human eye perception, failing to meet the need for smooth brightness gradients.
[0005] Therefore, a technical solution is needed that can make the PWM output achieve a smooth brightness change that conforms to perceptual equivalence within a set time period based on the characteristics of human visual vision. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the prior art. This invention provides a brightness mapping method and system based on visual perception, which makes the changes in PWM output conform to the changes in brightness perception of the human eye, so as to achieve a gradual effect of brightness from 0% to 100% in a set time that is smooth, natural and gentle for the human eye. This solves the problem that the human eye perceives uneven brightness changes during the lighting process, which produces obvious jumps or unnatural abrupt changes.
[0007] This invention provides a brightness gradient control method based on visual perception, comprising the following steps: S1: obtaining a linearly changing brightness input value Y;
[0008] S2: Normalize the brightness input value Y obtained in real time in step S1 to obtain the normalized brightness value. Y max This represents the maximum linear brightness.
[0009] S3: Based on the visual brightness model, a piecewise mapping method is used to map the normalized brightness value x to the perceived brightness value y:
[0010] When the normalized brightness value x < 0.08, the linear mapping formula is used:
[0011] When x ≥ 0.08, the cubic mapping formula is used:
[0012] S4: Map the perceived brightness value y to a pulse width modulation (PWM) value for driving the light source.
[0013] A further feature of the present invention is that the mapping calculation formula for the PWM signal is: PWM = y·Y max .
[0014] A further feature of the present invention is that the brightness input value Y increases or decreases by ΔY at equal intervals until it reaches the maximum linear brightness value Y. max Or 0.
[0015] Another objective of this invention is to provide a brightness gradient control system based on visual perception, comprising a processor and a memory, wherein the memory stores a computer program, and the processor includes: a linear brightness input module for generating a linear brightness input value Y;
[0016] The normalization module, connected to the luminance input module, is used to normalize the luminance input value Y to obtain a luminance normalized value x, where...
[0017] Segmented mapping module: used to map the normalized brightness value x to the perceived brightness value y.
[0018] When the normalized brightness value x < 0.08, the linear mapping formula is used:
[0019] When x ≥ 0.08, the cubic mapping formula is used:
[0020] The PWM output module is used to map the perceived brightness value y into a pulse width modulation (PWM) signal to drive the light source. The PWM signal is given by PWM = y·Y. max generate.
[0021] Compared with the prior art, the present invention has the following beneficial effects: by using a piecewise nonlinear mapping that conforms to the characteristics of human visual perception, the brightness transition is more in line with the laws of human visual perception and is smoother, eliminating the sense of jerkiness under linear PWM control and eliminating the problem of sudden brightening in the low brightness area, thus achieving a smooth, natural, and jerk-free gradual change effect in brightness from 0% to 100%; the calculation method of this piecewise mapping is simple, applicable to any MCU, has extremely low resource consumption, and can be widely used in display devices, lighting fixtures and backlight systems. Attached Figure Description
[0022] Figure 1This is a flowchart illustrating Embodiment 1 of the present invention;
[0023] Figure 2 This is a comparison curve of the brightness change when the light is on between the linear brightness control method provided in this embodiment and the method of this invention.
[0024] Figure 3 This is a graph comparing the brightness changes of the linear brightness control method provided in this embodiment of the invention with the method of the present invention when the lights are turned off. Detailed Implementation
[0025] The technical solutions in this embodiment will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] Embodiment 1 of the present invention provides a brightness gradient control method based on visual perception, such as... Figure 1 As shown, it includes the following steps:
[0027] Step S1: Obtain the linearly varying brightness input value Y. The MCU internally generates a value that linearly increases from 0 to Y. max Or from Y max The brightness input value Y initially decreases linearly to 0. Within a predetermined time period, the brightness is increased by ΔY at regular intervals until Y... max Or decrease the ΔY brightness at regular intervals until it reaches 0;
[0028] Step S2: Normalize the brightness input value Y to obtain the normalized brightness value x. The normalization formula is: This makes the range of x between 0 and 1.
[0029] Step S3: Based on the visual brightness model, the normalized brightness value x is segmented and mapped to obtain the perceived brightness value y. The specific judgment and calculation are as follows:
[0030] Determine if x is less than 0.08: If x < 0.08, then use the linear mapping formula: If x ≥ 0.08, then the cubic mapping formula is used:
[0031] Step S4: Convert the perceived brightness value y into a PWM value for driving the LED. The conversion formula is: PWM = y·Y max The PWM value is written into the MCU's PWM output register, thereby controlling the brightness output of the LED.
[0032] Repeat the above method until the brightness input value Y changes to Y max Alternatively, 0. Specifically, taking the lighting of a light as an example, a 2-second gradient time period can be set, increasing every 10ms for a total of 200 increments. Each brightness input value Y is converted into a PWM value through the above steps until the maximum linear brightness value Y is reached. max The increment of 10ms can be changed, as long as the intervals are uniform.
[0033] During the process of LED gradually changing from 0% brightness to 100% brightness within 2 seconds, the brightness change conforms to the non-linear model of human eye perception, achieving a smooth and seamless visual gradient effect.
[0034] Embodiment 2 of the present invention provides a brightness gradient control system based on visual perception. The system includes a processor and a memory. The memory stores a computer program. When the processor executes the program, it implements the method of Embodiment 1 described above. The processor includes a brightness input module, a normalization module, a perception mapping module, and a PWM output module.
[0035] The brightness input module is used to generate a linear brightness input value Y.
[0036] In this embodiment, the module can be a timer or software counter inside an MCU, configured to linearly increment from 0 to Y within 2 seconds. max .
[0037] The normalization module is connected to the luminance input module and is used to convert the luminance input value Y into a normalized luminance value x. The conversion formula is as follows:
[0038] The perception mapping module is connected to the normalization module and is used to map the brightness normalization value x to the perceived brightness value y.
[0039] This module is specifically configured to use a linear mapping formula when x < 0.08. When x ≥ 0.08, the cubic mapping formula is used:
[0040] The PWM output module is connected to the sensing mapping module and is used to convert the sensed brightness value y into a PWM signal. The conversion formula is PWM = y·Y. max The PWM signal directly drives the LED light source.
[0041] All of the above modules can be integrated into a single MCU and implemented through software programming; they can also be partially or entirely implemented through dedicated hardware circuits, such as FPGAs or ASICs; or they can be implemented using a combination of software and hardware.
[0042] Experimental verification
[0043] To verify the actual effect of the present invention, comparative experiment one and comparative experiment two were conducted. The setup for comparative experiment one is as follows:
[0044] Group A: Linear brightness control, the brightness input value Y increases linearly from 0 to Yb. max And directly used as PWM output;
[0045] Group B: Using the method of this invention, the brightness input value Y also increases linearly from 0 to Y. max However, after the perceived brightness value y is calculated by the method of Embodiment 1 of the present invention, it is mapped to the final PWM output;
[0046] Both sets of experiments controlled the same LED to gradually increase its brightness from 0% to 100% within 2 seconds, updating the brightness value every 10ms. Light intensity data was collected using a photodiode and an ADC. Y... max The value was set to 1, and six participants were invited to conduct a subjective visual evaluation.
[0047] Experimental results are as follows Figure 2 As shown: Group A linear brightness control method, namely the linear PWM group in the figure. The brightness corresponding to the PWM output of this group increases proportionally with the increase of the brightness input Y. When the brightness input Y increases at equal intervals, the PWM output increases linearly. The time interval required for the same brightness increase range is the same. However, since the human eye is more sensitive to low brightness and high brightness, there is a sudden jump in brightness in the early stage.
[0048] Group B adopted the brightness mapping algorithm based on the visual perception model of this invention, namely... Figure 2 The brightness curve of the CIE-sensing PWM group is approximately a cubic function, consistent with the CIE sensing model. The brightness rises more slowly in the first 20% of the brightness region, requiring a longer time than group A, so that the human eye can perceive the brightness change. In the medium to high brightness region, the brightness change gradually accelerates to match the human eye's perception of brightness. Figure 2 The horizontal axis shown represents the linear brightness input value Y compared to Y0. max The ratio of the final PWM output to the Y-axis, with the vertical axis representing the ratio of the final PWM output to the Y-axis. max The ratio coefficient corresponding to the maximum value of the PWM output is the PWM duty cycle.
[0049] The subjective evaluation results are shown in Table 1 below:
[0050] Serial Number Observation Project Group A (Comparative Example) Group B (Experimental Example) 1 Smoothness in low-brightness areas Poor (Blackening remains unchanged) good 2 blip in mid-to-high brightness range obvious none 3 Overall Gradient Naturalness generally excellent 4 Visual comfort generally high
[0051] Table 1
[0052] The conclusion of the comparative experiment shows that the brightness mapping algorithm based on the visual perception model adopted in this invention can significantly improve the smoothness of brightness gradient, effectively eliminate the abrupt change under linear brightness control, and the output light intensity change is highly consistent with the brightness pattern perceived by the human eye.
[0053] The setup for comparative experiment two is as follows:
[0054] Group A: Linear brightness control, brightness input value Y is determined by Y0. max It is linearly reduced to 0 and directly used as the PWM output;
[0055] Group B: Using the method of this invention, the brightness input value Y is also determined by Yb. max The perceived brightness value y is linearly reduced to 0, but after being calculated by the method of Embodiment 1 of the present invention, it is mapped to the final PWM output;
[0056] Both sets of experiments controlled the same LED to gradually decrease from 100% brightness to 0% brightness within 2 seconds, updating the brightness value every 10ms. Light intensity data was collected using a photodiode and an ADC. Y... max The value was set to 1, and six participants were invited to conduct a subjective visual evaluation.
[0057] Experimental results are as follows Figure 3 As shown: Group A linear brightness control method, namely the linear PWM group in the figure. The brightness corresponding to the PWM output of Group A decreases proportionally as the brightness input Y decreases. The time interval required for the same brightness reduction interval in Group A is the same. However, since the human eye is more sensitive to low brightness and higher brightness, there is a sudden change in brightness after the lights are turned off.
[0058] Group B adopted the brightness mapping algorithm based on the visual perception model of this invention, namely... Figure 3 The brightness PWM group in the CIE-sensing model exhibits a brightness curve that approximates a cubic function form, consistent with the CIE sensing model. Figure 3 The brightness decreases more slowly in the 20%-0 range than in group A, allowing the human eye to clearly perceive the change in brightness. In the medium-high brightness range, the brightness change is faster than in the low brightness range, in accordance with the human eye's perception of brightness. Figure 3 The horizontal axis shown represents the linear brightness input value Y compared to Y0. max The ratio of the final PWM output to the Y-axis, with the vertical axis representing the ratio of the final PWM output to the Y-axis. max The ratio coefficient corresponding to the maximum value of the PWM output is the PWM duty cycle.
[0059] The subjective evaluation results of Experiment 2 are shown in Table 2 below:
[0060] Serial Number Observation Project Group A (Comparative Example) Group B (Experimental Example) 1 Smoothness in low-brightness areas Poor (Blackening remains unchanged) good 2 blip in mid-to-high brightness range obvious none 3 Overall Gradient Naturalness generally excellent 4 Visual comfort generally high
[0061] Table 2
[0062] Therefore, this invention is not only applicable to LED brightness control, but can also be widely applied to any electronic device that needs to achieve smooth and gradual brightness changes through PWM, including the following fields: backlight control of display devices: such as mobile phones, tablets, monitors, televisions, etc.; lighting devices: such as smart lamps, table lamps, ambient lights, etc.; professional lighting: such as stage lighting, photography lighting, architectural lighting, etc.; automotive lighting: such as interior ambient lights, dashboard backlights, etc.
[0063] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are feasible for those skilled in the art. If the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
Claims
1. A method for controlling luminance gradation based on visual perception, characterized by, The method comprises the following steps: S1: obtaining a linearly changed luminance input value Y; S2: normalizing the luminance input value Y obtained in step S1 to obtain a luminance normalized value wherein Y max is a luminance maximum value; S3: based on a visual luminance model, mapping the luminance normalization value x to a perceived luminance value y in a segmented mapping manner: When the luminance normalized value x < 0.08, a linear mapping formula is used: When x ≥ 0.08, the cubic mapping formula is used: S4: mapping the perceived luminance value y to a pulse width modulation PWM value for driving a light source.
2. The method of claim 1, wherein the method is based on visual perception. The mapping calculation formula of the PWM signal is: PWM=y·Y max .
3. The method of claim 1, wherein the method further comprises: The luminance input value Y is converted by equal intervals of time ΔY until the luminance maximum value Y max or 0.
4. A visual perception-based luminance ramping control system, characterized by, The processor comprises a linear luminance input module for generating a linear luminance input value Y; 5. The visual perception based luminance ramping control system of claim 4, wherein, A normalization module connected to the linear luminance input module for normalizing the luminance input value Y to calculate a luminance normalization value x; A segmented mapping module for mapping the luminance normalization value x to a perceived luminance value y; A PWM output module for mapping the perceived luminance value y to a pulse width modulation PWM signal to drive a light source. The processor comprises a linear luminance input module for generating a linear luminance input value Y; A normalization module connected to the linear luminance input module for normalizing the luminance input value Y to calculate a luminance normalization value x; A segmented mapping module for mapping the luminance normalization value x to a perceived luminance value y; A PWM output module for mapping the perceived luminance value y to a pulse width modulation PWM signal to drive a light source.