Exposure compensation method based on light intensity adaptive recognition

By dynamically identifying light intensity characteristics and local brightness complexity indicators, detecting highlight areas and performing temporal stability calculations, the problem of difficulty in distinguishing light source attributes and motion interference in existing technologies is solved, achieving precise zoned exposure control and steady-state light source detail preservation.

CN121691923BActive Publication Date: 2026-04-24NANJING EFL E-COMMERCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING EFL E-COMMERCE CO LTD
Filing Date
2026-02-10
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing technologies cannot accurately distinguish the physical properties of light sources when dealing with dynamic and complex scenes. They have weak resistance to motion interference and lack human eye perception adaptability, resulting in exposure adjustment errors, loss of texture details of steady-state light sources, or excessive response of transient light sources.

Method used

By acquiring the light intensity characteristics and local brightness complexity index of the video stream, the adaptive trigger threshold is dynamically determined, highlight areas are detected and temporal stability is calculated, and they are classified as transient highlights or steady-state highlights, and differentiated exposure adjustments are performed.

Benefits of technology

It achieves precise zone exposure control, effectively solving the problem of misjudgment caused by jitter or interference, preserving steady-state light source details while suppressing transient light spot flicker interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121691923B_ABST
    Figure CN121691923B_ABST
Patent Text Reader

Abstract

The application discloses an exposure compensation method based on light intensity adaptive recognition. The method extracts light intensity features and local brightness complexity, and dynamically determines an adaptive trigger threshold in combination with a nonlinear response function representing human eye perception characteristics. After activating compensation, the method detects a highlight area and extracts a brightness evolution track, removes interference by using motion compensation based on the median value of the centroid displacement and robust statistical analysis, performs time sequence stability calculation and evaluation on the track, and classifies the highlight area into a steady state or a transient state according to the classification result. Differentiated compensation coefficients are determined based on the classification result, strong compensation is performed on the steady state area to recover details, weak compensation is performed on the transient state area to prevent flickering, and adaptive feathering fusion output is performed. The application effectively solves the misjudgment problem caused by shaking or interference in a dynamic scene, and realizes accurate partition exposure control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to an exposure compensation method based on adaptive light intensity recognition. Background Technology

[0002] In high dynamic range applications such as security monitoring, vehicle-mounted visual perception, and mobile photography, accurate exposure control is crucial for ensuring the integrity of image information. Faced with complex environments with drastically changing lighting conditions, exposure algorithms not only need to respond quickly to avoid information loss due to highlight blowout, but also need intelligent recognition capabilities to strike a balance between suppressing overexposure, preserving shadow details, and maintaining temporal stability of the image. This directly affects the recognition accuracy of the backend visual algorithm and the reliability of the imaging system.

[0003] Currently, mainstream automatic exposure control technologies mainly rely on global metering or zone-weighted metering modes. The common approach is to calculate the average brightness of the entire image or a specific area, and when a brightness deviation from the target value is detected, adjust the gain or exposure time to maintain constant brightness. Some advanced solutions employ dynamic adjustment strategies based on inter-frame difference, which determine lighting changes by statistically analyzing pixel brightness differences between consecutive frames, and when high-brightness areas are detected, use histogram equalization or a uniform gain suppression strategy to prevent overexposure and adapt to scenes with changing lighting.

[0004] However, existing technologies suffer from several drawbacks when dealing with dynamic and complex scenes, including an inability to accurately distinguish the physical properties of light sources, weak resistance to motion interference, and a lack of adaptability to human visual perception. Specifically, methods based on simple inter-frame difference struggle to differentiate between changes in the brightness of the light source itself and pixel displacement caused by camera shake. When the camera is moving, it easily misjudges stationary, steady-state light sources (such as streetlights) as rapidly fluctuating transient objects, leading to incorrect exposure adjustments. Furthermore, existing solutions lack an effective classification mechanism for steady-state (such as light boxes) and transient (such as reflections) attributes in highlight areas, often employing a one-size-fits-all compensation strategy. This results in the loss of texture details from steady-state light sources due to over-suppression, or an over-response to transient flicker that causes a breathing effect in the image. Summary of the Invention

[0005] Purpose of the invention: To provide an exposure compensation method based on adaptive light intensity recognition, in order to solve one of the problems mentioned above in the existing technology.

[0006] Technical solution: An exposure compensation method based on adaptive light intensity recognition, comprising:

[0007] Acquire the current frame image of the video stream, extract the light intensity features of the current frame and the local brightness complexity index of the scene; store the current frame image into the temporal frame buffer, and calculate the temporal change rate of the light intensity features based on the light intensity features of adjacent frames in the temporal frame buffer;

[0008] Based on the temporal change rate of light intensity characteristics and the local brightness complexity index, the adaptive trigger threshold is dynamically determined, and the compensation process is activated when the temporal change rate meets the adaptive trigger threshold.

[0009] Detect the highlight regions in the current frame and extract the brightness evolution trajectory of each highlight region in the temporal frame buffer; perform temporal stability calculation and evaluation on the brightness evolution trajectory to obtain a temporal stability score, and classify the highlight regions into transient highlights or steady-state highlights based on the temporal stability score;

[0010] Based on the classification results, the differential compensation coefficients corresponding to each highlight region are determined, and the transient and steady-state highlights are adjusted by partitioning the exposure. The compensated image is then fused and output.

[0011] Beneficial effects: This invention effectively solves the problem of misjudgment caused by shaking or interference in dynamic scenes, and achieves precise zone exposure control. Attached Figure Description

[0012] Figure 1 This is a complete flowchart of the exposure compensation method based on adaptive light intensity recognition in the embodiments of this application.

[0013] Figure 2 This is a flowchart illustrating the steps involved in constructing a nonlinear response function and calculating the adaptive trigger threshold in detail, based on scene complexity, in the embodiments of this application.

[0014] Figure 3 This is a flowchart illustrating the steps of a lightweight global motion compensation method for a set of highlight regions in this application.

[0015] Figure 4 This is a flowchart illustrating the steps involved in solving the transient occlusion problem using robust statistical methods in an embodiment of this application.

[0016] Figure 5 This is a flowchart illustrating the steps of the scoring method based on the coefficient of variation (CV) and nonlinear mapping in the embodiments of this application. Detailed Implementation

[0017] Example 1, such as Figure 1 The diagram illustrates the complete processing flow of an exposure compensation method based on adaptive light intensity recognition. This embodiment provides an end-to-end exposure control architecture capable of intelligently triggering scenarios with varying rates and complexities of light change, and performing refined temporal stability analysis and differentiated compensation for highlight areas in the image. This effectively suppresses flickering interference from transient light spots while preserving details of steady-state light sources.

[0018] Step 101: Obtain the current frame image of the video stream, extract the light intensity features of the current frame and the local brightness complexity index of the scene; store the current frame image in the temporal frame buffer, and calculate the temporal change rate of the light intensity features based on the light intensity features of adjacent frames in the temporal frame buffer.

[0019] In this embodiment, data acquisition is the starting point of the entire processing flow. The acquired video stream can be real-time video data from surveillance cameras, dashcams, or handheld devices. The video stream is typically input in RGB or YUV format. For RGB format images, the system converts them to YUV or grayscale color space and extracts the Y channel, i.e., the luminance channel, as the basis for subsequent processing. The light intensity feature can be specifically represented as the global average luminance value of the entire frame image, or a weighted luminance value based on histogram statistics. The local luminance complexity index is used to calculate the degree of unevenness in the distribution of light and dark areas in the current scene.

[0020] Specifically, the system can divide the image into M×M grid blocks, such as 8×8 or 16×16, calculate the standard deviation of pixel brightness within each block, and perform a weighted sum of these standard deviations. Preferably, to highlight the importance of the central region of the image, a weight matrix with a Gaussian decay distribution from the center is used for weighting. For example, if the standard deviation of the central block is large, it indicates that the lighting structure of the core area of ​​the scene is complex, and the calculated local brightness complexity index is high. This embodiment constructs a temporal frame buffer of length N, for example, N is 5 to 8 frames, to store the brightness data of the most recent few frames, providing historical reference for subsequent temporal analysis.

[0021] Step 102: Based on the temporal change rate of light intensity characteristics and the local brightness complexity index, dynamically determine the adaptive trigger threshold, and activate the compensation process when the temporal change rate meets the adaptive trigger threshold.

[0022] This embodiment intelligently determines when exposure compensation is needed, avoiding frequent and unnecessary parameter adjustments. The calculation of the temporal change rate relies on historical frame data stored in the temporal frame buffer.

[0023] Specifically, the system synchronously writes the extracted light intensity features into a temporal frame buffer, ensuring that this buffer always stores the brightness data of the most recent N frames. The system calculates the difference in light intensity features between the current frame and the previous frame, and divides it by the inter-frame time interval to obtain the temporal change rate. The calculation formula is: r = (L... current -L previous ) / Δt; where, L current L represents the light intensity characteristics of the current frame. previous Δt represents the light intensity characteristics of the previous frame, and Δt represents the inter-frame time interval.

[0024] The system calculates the difference in light intensity characteristics between the current frame and the previous frame, and divides it by the inter-frame time interval to obtain the temporal change rate. Simultaneously, instead of using a fixed threshold, the system dynamically calculates an adaptive trigger threshold using two factors: the temporal change rate and the local brightness complexity index. When the absolute value of the temporal change rate is greater than or equal to this adaptive trigger threshold, the system determines that the current lighting environment has undergone a change sufficient to cause visual discomfort or information loss, and activates the subsequent compensation process; conversely, if the change rate is less than the threshold, the current exposure parameters are maintained, saving computational resources and keeping the image stable. This mechanism can effectively distinguish between sudden changes in real-world lighting and minor fluctuations in sensor noise.

[0025] Step 103: Detect the highlight regions in the current frame and extract the brightness evolution trajectory of each highlight region in the temporal frame buffer.

[0026] After the compensation process is activated, the system needs to pinpoint the specific overexposure source in the image. The system identifies pixels in the current frame whose brightness exceeds a certain threshold (e.g., 220 or 230 for an 8-bit image) as highlight pixels and uses connected component analysis to aggregate adjacent highlight pixels into independent highlight regions. For each detected highlight region, the system traces its historical position and brightness value over the past N frames in the temporal frame buffer. This typically involves region matching or optical flow tracing techniques to ensure that the extracted brightness sequence indeed belongs to the same physical object. The extracted time series containing the brightness values ​​of the current and historical frames constitutes the brightness evolution trajectory. This trajectory accurately records the brightness changes of the region over time and serves as the basis for subsequent determination of its physical properties.

[0027] Step 104: Perform temporal stability calculation and evaluation on the brightness evolution trajectory to obtain a temporal stability score, and classify the highlight region into transient highlight or steady-state highlight based on the temporal stability score.

[0028] This embodiment aims to reveal the physical nature of highlight areas. The temporal stability calculation and evaluation is a computational process whose input is the brightness evolution trajectory, and whose output is a normalized numerical value, i.e., a temporal stability score. This score reflects the predictability or stability of the brightness in the area. For example, a score closer to 1 indicates stable brightness in the area, most likely a fixed lighting device such as a street lamp or light box, i.e., steady-state highlight; a score closer to 0 indicates drastic brightness fluctuations or random flickering in the area, most likely interference items such as metallic reflections or water ripples, i.e., transient highlight. Based on a preset classification threshold, such as 0.6, the system marks areas with scores above the threshold as steady-state highlights and those below the threshold as transient highlights. This classification result will determine the subsequent compensation strategy.

[0029] Step 105: Based on the classification results, determine the differential compensation coefficients corresponding to each highlight region, perform zoned exposure adjustment on transient and steady-state highlights, and fuse and output the compensated image.

[0030] The system employs drastically different processing logics for different types of highlight areas. For steady-state highlights, the system assigns a strong compensation coefficient to minimize brightness and restore internal texture details, such as the clarity of text on a lightbox. For transient highlights, the system assigns a weaker protective compensation coefficient, applying only slight suppression to prevent visual flickering in the next frame when the area darkens due to overcompensation. The system generates a full-resolution gain map based on these differentiated compensation coefficients and fuses it with the original image. This fusion process typically involves an inverse color space transformation, combining the original chroma components, such as the UV or CbCr channels, with the processed luminance channel to synthesize the final RGB image for output.

[0031] Example 2, as follows Figure 2 As shown, this paper describes how to construct a nonlinear response function and how to combine scene complexity to finely calculate the adaptive trigger threshold, simulating the perception characteristics of the human visual system (HVS) to changes in illumination.

[0032] Step 201: Construct a nonlinear response basis function, which characterizes the human visual system's tolerance to the rate of change of light.

[0033] This embodiment establishes a mathematical model to describe the differences in human eye sensitivity to changes in the rate of light change. Human visual research shows that when ambient light changes rapidly and drastically, the human eye's adaptive mechanisms, such as pupil constriction, are in a dynamic adjustment phase, during which it has a higher tolerance for brightness fluctuations. Conversely, when light changes slowly, the human eye is more sensitive to minute vibrations. Based on this principle, this embodiment constructs a nonlinear response basis function. The design goal of this function is: when the rate of change of the input is large, it outputs a smaller response value, indicating a higher trigger threshold and tolerance for fluctuations; when the rate of change of the input is small, it outputs a larger response value, indicating a lower trigger threshold and maintaining sensitivity.

[0034] Step 202: The temporal rate of change of light intensity characteristics is used as the independent variable to input the nonlinear response basis function, and the output value of the nonlinear response basis function is calculated.

[0035] Specifically, the output value f(r) of the nonlinear response basis function is calculated based on an exponential function. Its formula is as follows:

[0036] ;

[0037] Where e is the natural constant, with a value of approximately 2.71828; r is the amplitude of the temporal rate of change of the light intensity characteristic, i.e., the absolute value; α is the response sensitivity control parameter, used to adjust the descent rate of the function curve. In this embodiment, the preferred value range of α is 0.5 to 2.0, and a typical value can be set to 1.0; β is the nonlinear curvature control parameter, used to adjust the degree of compression for different rate of change intervals. Considering the nonlinear characteristics of Weber's law, β is usually set to a value less than 1, with a preferred range of 0.6 to 0.9, and a typical value can be set to 0.75. Through this formula, the original physical rate of change is mapped to a dimensionless coefficient between 0 and 1, which directly reflects the recommended sensitivity of the system at the current rate of change.

[0038] Step 203: Calculate the complexity modulation factor based on the local brightness complexity index.

[0039] In addition to considering the rate of change, this embodiment also incorporates the spatial characteristics of the scene. Complexity modulation factor M c This is used to adjust the trigger threshold based on the complexity of the image. The calculation formula is as follows:

[0040] ;

[0041] Among them, C norm γ is the normalized local brightness complexity index, with a value range of 0 to 1; γ is the modulation intensity parameter, used to control the influence weight of scene complexity on the threshold, with a preferred value range of 0.2 to 0.5. When the scene texture is complex and the contrast between light and dark is strong, C... norm When M is large, c It will be greater than 1, which will amplify the final threshold, making the system more conservative in complex scenarios and avoiding false triggering caused by local texture noise.

[0042] Step 204: Modulate the preset basic threshold parameter using the output value of the nonlinear response basis function and the complexity modulation factor to obtain the adaptive trigger threshold.

[0043] The final adaptive trigger threshold τ adapt It is obtained through a three-factor product coupling. The calculation formula is as follows:

[0044] ;

[0045] Where, τ adapt For adaptive trigger threshold, τ base This is a preset base threshold parameter, representing the baseline trigger line in a standard, simple scenario. A typical value can be set to 15 brightness units per second.

[0046] Based on this, for subsequent compensation calculations, this embodiment further generates the compensation foundation strength parameter P. base This parameter includes not only intensity but also directional information. A direction marker is generated based on the sign of the temporal rate of change, r: if r is greater than 0, indicating brightening, the marker is positive, corresponding to darkening compensation; if r is less than 0, indicating darkening, the marker is negative, corresponding to brightening compensation.

[0047] The strength amplitude is calculated using the logarithmic formula. The strength parameter P of the compensated foundation is also used. base The formula for calculating the amplitude is as follows:

[0048] ;

[0049] Here, κ is the intensity scaling factor, ranging from 0.3 to 0.6. This logarithmic mapping ensures that the compensation intensity increases smoothly with the degree of exceedance, avoiding the parameter abrupt changes that may be caused by linear mapping.

[0050] As a specific numerical calculation example: assume the system sets a basic threshold τ base The value is 15, with parameters α = 1.0, β = 0.75, and γ = 0.3.

[0051] Scene A is rapidly changing and complex: the rate of change of light, r, is 40. The high complexity of the scene leads to C. norm It is 0.8.

[0052] Calculate the nonlinear response: 40 0.75 Approximately 15.9; e (-15.9) The minimum value approaches 0; therefore, f(r) is approximately 1. The computational complexity is the modulation factor: M. c =1 + 0.3 * 0.8, the result is 1.24. The final threshold τ adapt =151*1.24, the result is 18.6. Since the rate of change 40 is greater than 18.6, activation compensation is determined.

[0053] Scene B is slow-changing and simple: the rate of change of light, r, is 5, and the scene complexity is low. norm The value is 0.2. Calculate the nonlinear response: 5 0.75 Approximately 3.34; e (-3.34) The value is approximately 0.035; therefore, f(r) = 1 - 0.035, and the result is 0.965.

[0054] Computational complexity: Modulation factor: M c =1 + 0.3 * 0.2, the result is 1.06. The final threshold τ adapt=150.965*1.06, the result is approximately 15.3. Since the rate of change 5 is less than 15.3, compensation is not activated. The calculation results show that this embodiment can dynamically adjust the threshold according to actual sensing needs, achieving intelligent trigger control.

[0055] Example 3, such as Figure 3 As shown, a lightweight global motion compensation method for a set of highlight regions is described, which aims to eliminate the misjudgment of stability scores caused by camera shake or translation.

[0056] Step 301: Before calculating the temporal stability score, perform interference removal preprocessing on the highlight area. Interference removal preprocessing aims to eliminate brightness fluctuations of non-light source bodies caused by camera movement, region boundary jitter, or local occlusion. Based on the data after interference removal preprocessing, calculate the temporal stability score.

[0057] This embodiment establishes a processing principle of cleaning first, then scoring. The original extracted brightness evolution trajectory is often mixed with various noises. If the camera shakes, the fixed streetlights in the image will shift in the pixel coordinate system. If sampling is done directly at the original coordinates, the edges of the streetlights or black areas of the background will be sampled, causing a sudden drop in brightness, which may be misjudged as flickering transient highlights. Therefore, such interfering factors must be removed first.

[0058] Step 302: Calculate the centroid coordinates of each highlight region in the current frame and the previous frame in the time frame buffer.

[0059] To calculate motion, feature points need to be extracted. This embodiment selects the brightness-weighted centroid of the highlight region as the feature point because it is more resistant to shape deformation interference than the geometric center. For the i-th highlight region in the k-th frame, assuming L(x,y) is the brightness value at pixel coordinates x,y, then its centroid coordinates C... i (k) The calculation formula is as follows:

[0060] ;

[0061] Among them, R i Let represent the set of pixels in the i-th highlight region. This formula allows us to obtain coordinates accurate to the sub-pixel level, effectively reducing positioning errors caused by jitter in region edge segmentation.

[0062] Step 303: Based on the difference in centroid coordinates between adjacent frames for the same highlight region, construct a set of centroid displacement vectors.

[0063] The system matches corresponding highlight regions in adjacent frames, such as between the current frame k and the previous frame k-1, based on region number or spatial overlap. For each successfully matched region, the difference vector d between their centroid coordinates is calculated.i =C i (k) -C i (k-1) If the current frame has M highlight regions, then a set d1, d2, ..., dm containing M vectors can be obtained. M .

[0064] Step 304: Calculate the median of the set of centroid displacement vectors and determine the median as the global motion vector.

[0065] Traditional full-image optical flow methods are computationally intensive, and directly averaging the values ​​is easily affected by interference from fast-moving objects such as the headlights of speeding cars. This embodiment uses the vector median statistical method.

[0066] Specifically, the system calculates the median dx of all vectors along the X-axis. med and the median dy of the Y-axis components med The combination yields the global motion vector d. global =(dx med ,dy med Since stationary light sources in the background, such as streetlights and neon lights, usually make up the majority, their displacement caused by camera movement is uniform. Therefore, the median can represent the global motion components of the camera with extremely high accuracy, while a few independently moving objects, i.e. outliers, will be automatically filtered out by the median statistical properties.

[0067] Step 305: Use global motion vectors to perform inverse motion compensation on the sampling position of the highlight area in the previous frame, and extract or correct the brightness evolution trajectory based on the compensated sampling position.

[0068] Specifically, the displacement deviation between the centroid displacement vector of each highlight region and the global motion vector is calculated; a preset deviation tolerance threshold is obtained; if the displacement deviation is less than the preset deviation tolerance threshold, it is determined that the displacement of the highlight region is caused by camera motion, and the global motion vector is applied to perform position compensation for the highlight region; if the displacement deviation is greater than or equal to the deviation tolerance threshold, it is determined that the highlight region has independent motion, and position compensation is not performed.

[0069] After obtaining the global motion vector, the system does not blindly compensate for all regions, but instead performs a validity check. For each highlight region, its own displacement vector d is calculated. i With global motion vector d global The Euclidean distance between them is the displacement deviation. If this deviation is less than the preset deviation tolerance threshold θ, then... d For example, if the value is 5 pixels, then the displacement in that area is determined to be mainly caused by camera movement, belonging to the follow-up region. The system uses d globalThe sampling mask coordinates of this region in the previous frame are reverse-shifted and corrected to ensure that the pixel brightness at the same physical location is always sampled in different frames. Conversely, if the deviation is greater than a threshold, it indicates that there is independent motion in this region, such as a moving vehicle. In this case, forced compensation is not performed to avoid smoothing out the real object motion.

[0070] As a specific numerical calculation example: Suppose that three highlight regions are detected in the current frame, and their inter-frame centroid displacement vectors are as follows:

[0071] Area 1 street light A: d1 is (5,5);

[0072] Area 2 street light B: d2 is (5,6);

[0073] The headlights of vehicles passing through area 3: d3 is (20,0).

[0074] The median of the X component set 5, 5, 20 is 5; the median of the Y component set 5, 6, 0 after sorting is 0, 5, 6, which is also 5.

[0075] Therefore, the global motion vector d global The value (5,5) indicates that the camera has shifted to the lower right.

[0076] Perform verification:

[0077] Region 1 Deviation: The distance between (5,5) and (5,5) is 0, which is less than 5, so it is judged as background and compensation is performed.

[0078] Region 2 Deviation: The distance between (5,6) and (5,5) is 1, which is less than 5, so it is judged as background and compensation is performed.

[0079] Region 3 deviation: The distance between (20,0) and (5,5) is approximately 15.8, which is greater than 5. Therefore, it is determined to be an independent motion, and no compensation is performed. Its original motion trajectory characteristics are preserved.

[0080] Through this process, the system successfully stabilized the brightness sampling of the background light source under moving shooting conditions, laying the foundation for accurate stability scoring in the future.

[0081] Example 4, such as Figure 4 As shown, this paper describes how to solve the segmentation boundary jitter problem through morphological operations and how to solve the instantaneous occlusion problem through robust statistical methods, so as to ensure that the data input to the scoring algorithm reflects the true physical characteristics of the light source.

[0082] Step 401: Calculate the area properties of the highlight region and determine the corrosion radius that is positively correlated with the area properties.

[0083] In video analytics, connected component segmentation is often unstable. Limited by image sensor noise, edge pixels in highlight regions frequently exhibit abrupt changes in brightness between adjacent frames, causing fluctuations in light intensity. This edge noise severely interferes with stability scoring. Therefore, this embodiment introduces an adaptive morphological erosion strategy. The system calculates the total number of pixels in the current highlight region as the area attribute, denoted as A. i To accommodate light sources of varying sizes (e.g., distant streetlights versus nearby car headlights), the corrosion radius r cannot be a fixed value; it must be linked to the linear scale of the region.

[0084] Specifically, the system maps the area to an equivalent circle radius and sets the corrosion depth according to a certain proportion (e.g., 15%). The formula for calculating the corrosion radius r is as follows:

[0085] ;

[0086] Here, `max` represents the maximum value operation. This formula ensures that for extremely small areas, at least 2 pixels of erosion radius are retained to remove edge noise; for large areas, the erosion radius increases linearly with the square root of the area, effectively stripping away wider edge blur bands.

[0087] Step 402: Perform morphological erosion on the spatial mask of the highlight area using the erosion radius to obtain the core area mask.

[0088] After determining the erosion radius r, the system uses a circular structuring element of radius r to apply a binary mask R to the original specular region. i Perform morphological erosion. Geometrically, this operation shrinks the region boundary inward by r pixels. However, in practical engineering applications, over-erosion may occur; that is, for some elongated or tiny regions, the erosion operation may cause the region to disappear. To enhance the robustness of the algorithm, this embodiment adds a backoff mechanism: after performing erosion, the system checks the core region mask R. i_core The number of pixels. If the number of pixels is 0, the area is determined to be unsuitable for erosion (possibly due to a point light source at a very distant location), and the system directly applies the original mask R. i Assign a value to the core region mask R i_core This means abandoning the current corrosion process to ensure that data can be collected in subsequent implementations.

[0089] Step 403: Only the brightness values ​​of pixels located within the core region mask are counted, and the brightness values ​​are used as the effective brightness of the highlight region in the current frame to generate or update the brightness evolution trajectory.

[0090] Specifically, the system successfully located the brightest and most stable central part of the light source. The system only calculates the average brightness of the pixels covered by the core region mask, representing the brightness value of that highlight area in the current frame. Compared to the average brightness across the entire region, the average brightness of the core region has extremely high inter-frame consistency, effectively shielding against false brightness fluctuations caused by segmentation algorithm jitter.

[0091] Step 404: Obtain the N-frame brightness sequence contained in the brightness evolution trajectory.

[0092] After cleaning the spatial dimension, the system further purifies the data in the temporal dimension. The system reads the corrected N frames of luminance values ​​from the temporal frame buffer, forming a luminance sequence L={L1,L2,...,L...} to be processed. N}

[0093] Step 405: Calculate the median and median absolute deviation (MAD) of the luminance sequence.

[0094] Traditional denoising methods commonly use the mean and standard deviation, but they are highly sensitive to outliers. For example, when a pedestrian crosses in front of a streetlight, the streetlight's brightness drops suddenly, causing the mean to be lowered and the standard deviation to be higher, misidentifying a stable streetlight as a flickering light source. To address this issue, this embodiment employs robust statistical metrics. The median (Median(L)) of the sequence is calculated. The absolute value of the deviation of each data point from the median is calculated, and the median absolute deviation (MAD) is taken as the median of these absolute deviations. MAD is a more robust measure of dispersion than the standard deviation and is less affected by extreme values.

[0095] Step 406: Detect the deviation between the brightness value of each frame in the brightness sequence and the median. If the absolute value of the deviation of a frame exceeds a preset multiple of the absolute deviation of the median (MAD), then mark the frame as an occlusion event frame.

[0096] The system utilizes MAD to construct a dynamic anomaly detection envelope. For the luminance L of the j-th frame in the sequence... j Determine whether it meets the abnormal conditions: |L j -Median(L)|>κ*MAD i Wherein, κ is the anomaly detection sensitivity coefficient, and a typical value can be set to 3.0. If this condition is met, it means that the brightness of the frame deviates from the reference brightness level of the area, which is very likely due to a brief occlusion or foreign object intrusion. The system then marks the frame as an occlusion event frame.

[0097] Step 407: Remove the brightness data corresponding to the occlusion event frames from the brightness evolution trajectory. Count the number of valid frames remaining after removal; obtain the preset minimum sample size threshold, and determine whether the number of valid frames meets the preset minimum sample size threshold; if not, abandon the removal operation, and restore the original brightness sequence containing the occlusion event frames to the brightness evolution trajectory to avoid scoring distortion due to insufficient samples.

[0098] To prevent a single outlier from contaminating the overall score, the system removes frames marked as anomalous from the sequence. Building upon this, this embodiment also provides an important engineering protection logic: a valid frame count rollback mechanism. After the removal operation, the system counts the remaining valid frames. If the number of valid frames is too small, for example, less than half the window length N (N / 2), it indicates that the overall data quality in that area is poor, or the illumination change itself is very drastic (not caused by occlusion). In this case, forced removal may lead to insufficient samples and statistical bias. Therefore, the system abandons the removal operation and restores the original brightness sequence containing occlusion event frames to its brightness evolution trajectory. This mechanism embodies the data processing principle of preserving noise rather than taking things out of context, ensuring that the scoring algorithm always has a sufficient sample size.

[0099] Example 5, as Figure 5 As shown, a scoring method based on the coefficient of variation (CV) and nonlinear mapping is described, which aims to address situations where the stability assessment of light sources at different brightness levels is inconsistent.

[0100] Step 501: Perform statistical analysis on the brightness evolution trajectory and calculate the statistical dispersion index that characterizes the intensity of brightness sequence fluctuations.

[0101] After obtaining the clean brightness evolution trajectory through layers of cleaning (motion compensation, core extraction, and occlusion filtering), the system needs to calculate and score it. This embodiment calculates the basic statistics describing the dispersion of the sequence. For an effective brightness sequence of length K, the system calculates its arithmetic mean μ and standard deviation σ.

[0102] Step 502: Calculate the mean and standard deviation of the brightness evolution trajectory; determine the ratio of the standard deviation to the mean as the coefficient of variation to eliminate the influence of the absolute brightness difference in the highlight area on the fluctuation assessment.

[0103] Existing technologies typically use standard deviation σ to measure fluctuation, which has physical limitations: a high-brightness lightbox with a brightness value of 200 fluctuating by + / - 10 units is almost imperceptible to the human eye; however, a dark reflection with a brightness value of 20 fluctuating by + / - 10 units appears visually as a drastic change in brightness. If only the standard deviation is considered, the fluctuation amounts of both are the same, leading to their being judged as having the same stability, which does not conform to visual perception. Therefore, this embodiment introduces the coefficient of variation (CV) as a statistical dispersion index. Its calculation formula is as follows:

[0104] ;

[0105] Where, σ i μ is the standard deviation. i The mean is ε, and ε is a very small constant, such as 0.001, used to prevent division by zero errors caused by a mean of 0. The coefficient of variation (CV) is a dimensionless quantity that describes the fluctuation range per unit brightness. Using this metric, the CV value for a region with a brightness of 200 is 0.05, while the CV value for a region with a brightness of 20 is 0.5. The CV values ​​successfully differentiate between the two, allowing the algorithm to correctly identify the former as stable and the latter as unstable.

[0106] Step 503: The statistical dispersion index is converted into a normalized value using a preset mapping function to obtain the time series stability score; wherein, the lower the statistical dispersion index, the higher the stability indicated by the corresponding time series stability score.

[0107] Step 504: Use a preset mapping function to convert the statistical dispersion index into a normalized value that satisfies the following exponential decay mapping relationship.

[0108] To further improve the scoring's ability to distinguish stable regions, this embodiment abandons the linear normalization method and instead adopts a Gaussian-shaped exponential decay function. The time series stability score S i The calculation formula is as follows:

[0109] ;

[0110] Among them, S i For timing stability scoring, CV i Here, exp represents the coefficient of variation, and λ is the kurtosis coefficient, preferably set to 50. The physical characteristics of this function are as follows: when the CV value is close to 0 (extremely stable), the function curve is flat, and the score remains around 1.0; when the CV value increases slightly (slight fluctuation), the score decreases slowly; but once the CV value exceeds a certain critical point (obvious flickering begins), the score rapidly decays to 0 through an exponential effect. This type of non-linear kurtosis meets the requirements of exposure compensation control—giving high scores to true steady-state light sources and low scores to any suspected flickering sources.

[0111] As a specific example of numerical calculation:

[0112] Case A (steady-state street light): The brightness sequence after preprocessing is [200, 202, 199, 201, 200].

[0113] The mean μ is calculated to be 200.4, and the standard deviation σ is approximately 1.14.

[0114] The coefficient of variation (CV) is approximately 1.14 / 200.4 ≈ 0.0057.

[0115] Stability score S = exp(-50 * 0.0057) 2 =exp(-0.0016)≈0.998.

[0116] The score was extremely high, and the system classified it as a steady-state highlight, performing strong compensation.

[0117] Case B (water surface ripples): The brightness sequence after preprocessing is [100, 130, 90, 110, 140].

[0118] The mean μ is calculated to be 114, and the standard deviation σ is approximately 20.7.

[0119] The coefficient of variation (CV) is approximately 20.7 / 114.

[0120] Stability score S = exp(-50 * 0.18) 2 =exp(-1.62)≈0.198.

[0121] The score was extremely low, and the system classified it as transient highlighting, performing weak protective compensation.

[0122] As can be seen from the comparison, the algorithm in this embodiment can accurately distinguish light sources with different physical properties.

[0123] Example 6: Describes a stability scoring algorithm based on difference statistics.

[0124] The method in this embodiment has low computational complexity, does not require complex square root and exponentiation operations, and is more suitable for low-end embedded devices with extremely limited computing resources or application scenarios that are extremely sensitive to power consumption.

[0125] Step 601: Perform a first-order difference operation on the brightness evolution trajectory, calculate the standard deviation of the inter-frame brightness change sequence, and obtain the fluctuation amount of the change amplitude.

[0126] This embodiment uses the finite difference method to describe the fluctuation. The system calculates the first-order difference sequence D of the brightness evolution trajectory. diff That is, the difference in brightness between two adjacent frames: D i =L i+1 -L i Calculate the standard deviation of this difference sequence, denoted as σ. diff This metric directly reflects the severity of inter-frame transitions, i.e., the magnitude of the fluctuation. To standardize the measurement, it is usually normalized by dividing it by the mean brightness.

[0127] Step 602: Perform a second-order difference operation on the brightness evolution trajectory, count the number of times the second-order difference value exceeds the preset abrupt change threshold, and obtain the trend abrupt change frequency.

[0128] The first-order difference only reflects the magnitude of the change. To capture the specific behavior of flickering (i.e., repeated increases and decreases in brightness), the system further calculates the second-order difference sequence A. diff That is, the difference of the first-order differences: A j =D j+1 -D j The second-order difference reflects the rate of change (acceleration) of brightness variation. For periodically flickering light sources, the second-order difference value will be large. The system sets a sudden change detection threshold θ. mut This threshold is typically proportional to the average brightness of the region (e.g., 0.1 times the mean). The system statistically analyzes second-order difference sequences where the absolute value exceeds θ. mut The number of elements, denoted as n. mut . n mut Divide by the total sequence length to obtain the normalized trend mutation frequency.

[0129] Step 603: By using a weighted linear combination, the fluctuation range of change and the frequency of trend change are both mapped to the scoring space to obtain the time series stability score.

[0130] The final score S is obtained by linearly subtracting the above two indicators. The calculation formula is as follows:

[0131] ;

[0132] Where, σ' diff This represents the normalized fluctuation range; ω1 and ω2 are weighting coefficients, and ω1 + ω2 ≤ 1. For example, let ω1 = 0.55 and ω2 = 0.40. The logic of this formula is: the maximum score is 1, the greater the fluctuation, the more points are deducted, and the more frequent the mutation, the more points are deducted. Although this method is slightly less rigorous than the coefficient of variation method in terms of physical meaning, its calculations only involve addition, subtraction, multiplication, and division, making it extremely efficient and able to meet the engineering requirements with extremely high real-time requirements.

[0133] Example 7 describes how to convert the timing stability score into specific exposure adjustment parameters, especially how to resolve the contradiction between overexposure detail recovery and flicker suppression through classification strategies, boundary interpolation, and timing buffering techniques.

[0134] Step 701: For steady-state highlights, calculate the differential compensation coefficient using a steady-state compensation factor with a value range of 0.8 to 1.0 to restore the texture details of the highlight area.

[0135] After obtaining the classification labels for the highlight areas, the system needs to calculate the baseline compensation intensity reference value. This reference value is typically based on the baseline compensation intensity parameter P.base Its amplitude is logarithmically related to the degree of light exceeding the limit. For areas identified as steady-state highlights (such as streetlights, light boxes, and illuminated signs), the system's primary goal is information recovery. These light sources are continuous in time, and strongly suppressing them will not cause abruptness in the image. Therefore, the system sets a high steady-state compensation factor λ. stable Its value typically ranges from 0.8 to 1.0, with 0.9 being preferred. The differential compensation coefficient C for this region... stable The calculation formula is: C stable =P base ×λ stable By applying near-full compensation, the image sensor's gain in bright areas is reduced, allowing text or texture details to emerge from what would otherwise be a completely white area, thus improving the effective dynamic range of the image.

[0136] Step 702: For transient highlights, a differential compensation coefficient is calculated using a transient compensation factor that is lower than the steady-state compensation factor. Protective weak compensation is performed on transient highlights to prevent inter-frame flicker caused by excessive suppression.

[0137] For areas identified as transient highlights (such as passing car headlights or water reflections), the system's primary objective is visual comfort. These light sources are often fleeting or rapidly shifting in position. If the system strongly suppresses transient highlights in the current frame (e.g., reducing their brightness from 255 to 120), and the highlight shifts or disappears in the next frame, returning to background brightness, this drastic brightness jump will visually create noticeable black spot flickering or stroboscopic artifacts. Therefore, the system employs a protective weak compensation strategy, setting a low transient compensation factor λ. transient Its value typically ranges from 0.2 to 0.4, with 0.3 being preferred. The differential compensation coefficient C for this region... transient The calculation formula is: C transient =P base ×λ transient This type of weak compensation can slightly alleviate overexposure without causing a brightness band that is perceptible to the human eye, thus protecting the image.

[0138] Step 703: Obtain the preset classification threshold and identify the boundary highlight areas where the temporal stability score is located within the preset neighborhood of the classification threshold.

[0139] Building upon the binary classification (steady-state / transient), this embodiment further considers highlight regions within the gray area. If only a hard threshold (e.g., 0.6) is used, a region with a score of 0.59 would be treated as transient (coefficient 0.3), while a region with a score of 0.61 would be treated as steady-state (coefficient 0.9). This step change in the coefficient would cause brightness jumps in regions where the score fluctuates slightly near the threshold. Therefore, the system sets a boundary transition half-width Δ, for example, 0.08, defining the interval [θ-Δ, θ+Δ] as the boundary transition zone. Any region where the temporal stability score S falls within this interval is marked as a boundary highlight region.

[0140] Step 704: For the boundary highlight region, based on the position of the temporal stability score in the preset neighborhood, linear interpolation is performed on the steady-state compensation factor and the transient compensation factor to obtain the differential compensation coefficient of the region, so as to achieve a smooth transition between different classification regions.

[0141] For the boundary highlight region, the system constructs a smooth transition function Φ(S), which maps the score to the proportion of the steady-state weight. The formula for calculating the smooth transition function Φ(S) is as follows:

[0142] ;

[0143] Where, θ stable Let δ be the classification threshold and δ be the boundary transition half-width. Clearly, when S is at the lower boundary, Φ(S) is 0; when S is at the upper boundary, Φ(S) is 1. Based on this weight, the differential compensation coefficient C for the boundary region is... boundary The formula for calculating using linear interpolation is: C boundary =C transient +Φ(S)*(C stable -C transient This mechanism eliminates the hard-cutting effect of the classification boundary, allowing the compensation strength to increase smoothly with increasing stability.

[0144] Step 705: Establish a transient region state buffer and record the location and compensation intensity of the region identified as transient highlight in the previous frame; when determining the differential compensation coefficient of the current frame, refer to the historical data in the transient region state buffer to perform temporal smoothing limit on the compensation intensity of the current frame and suppress compensation jumps between consecutive frames.

[0145] As a further engineering optimization, the system introduces a damping mechanism in the time dimension. The system allocates a memory area as a transient region state cache, storing the ID of the transient region from the previous frame and the actual compensation coefficients used. When calculating the compensation coefficients for the current frame, the system checks whether the region was also transient in the previous frame. If so, the system limits the change in the coefficients of the current frame relative to the coefficients of the previous frame (e.g., the rate of change does not exceed 10%). If the theoretical coefficients calculated for the current frame change too much, the system will forcibly limit their amplitude and output the corrected coefficients. This strategy simulates the inertia of a physical system, effectively preventing the "breathing effect" of the screen caused by fluctuations in algorithm calculations.

[0146] Example 8 describes how to solve the patchy feeling caused by partition compensation by using an adaptive feathering algorithm that is linked to the area of ​​the region to achieve seamless integration between the compensation region and the background region.

[0147] Step 801: Feather the boundaries of each highlight region that has undergone exposure adjustment to generate a hybrid weight field that transitions from the compensated pixel value inside the region to the original pixel value outside the region.

[0148] If the pixels within the highlight region are directly multiplied by a compensation coefficient, while the pixels outside the region remain unchanged, a sharp brightness discontinuity line will inevitably form at the region boundary, making the image appear as if it is pieced together from patches of varying brightness. To eliminate this artificial artifact, feathering must be applied at the boundary. The system constructs a hybrid weight field W(x,y) of the same size as the image. Inside the region core, the weight is 1 (using the compensation value); outside the region, the weight is 0 (using the original value); and in the transition zone near the boundary, the weight smoothly decays from 1 to 0.

[0149] Step 802: Obtain the area attributes of each highlight region; adaptively calculate the feathering width based on the area attributes, where the larger the area of ​​the highlight region, the wider the corresponding feathering width.

[0150] Feathering refers to the width of the transition band. A fixed feather width cannot adapt to light sources with varying scales: for small light spots of a few pixels, wide feathering will cause them to completely blur and disappear; for large lightboxes occupying most of the image, narrow feathering will not provide a smoothing effect. Therefore, this embodiment adopts an adaptive strategy. The system reads the pixel area A of the highlight region and maps it to the feather width w. feather Feather width w feather The calculation formula is as follows:

[0151] ;

[0152] Among them, w min and w max These are the lower limit (e.g., 3 pixels) and upper limit (e.g., 20 pixels) of the feather width, respectively; Amin and A max This serves as a normalized reference range for the area. The square root of the area is used for mapping because the visual scale is more related to the linear dimension (side length) than the area itself. This formula ensures that the degree of feathering remains consistent with the visual size of the light source.

[0153] Step 803: Determine the transition range of the mixed weight field based on the feathering width.

[0154] After determining the width w feather Subsequently, the system generates a boundary distance field d(x,y), which represents the directed distance from a pixel to the region boundary (negative inside, positive outside). To obtain the most natural visual transition, this embodiment preferably uses a Gaussian error function to generate the blending weights. The formula for calculating the blending weights W(d) is as follows:

[0155] ;

[0156] Where erf is the Gaussian error function, d is the directed distance field from the pixel to the region boundary, and k is the kurtosis control factor (usually taken as 2.0 to 3.0). The weight curve generated by this function is S-shaped, changing gently when approaching pure interior and pure exterior, and changing uniformly in the middle transition section, which can simulate the optical defocusing effect to the greatest extent, so that the compensation area is dissolved in the background.

[0157] Step 804: Based on the hybrid weight field, the exposure-adjusted image data and the original image data are weighted and fused.

[0158] The system utilizes a hybrid weight field to perform pixel-level weighted summation: I out =W*I comp +(1-W)*I orig Among them, I comp This is the brightness after adjustment by the differentiation coefficient, where W is the mixture weight value generated based on the Gaussian error function, and I... orig This refers to the original brightness. After fusing the brightness channel Y, the system performs an inverse color space transformation. Using the fused Y channel data, combined with the original retained chroma channel data (such as Cb and Cr), the final color image is reconstructed using a standard YUV to RGB formula. This process ensures that while adjusting the brightness, the color information (hue and saturation) of the image does not shift, ultimately outputting a high-quality image with natural exposure, rich detail, and no artifacts.

[0159] Example 9 describes the hardware device architecture and software carrier for implementing an exposure compensation method based on adaptive light intensity recognition.

[0160] Step 901: The data acquisition module is configured to acquire the current frame image of the video stream, extract the light intensity features of the current frame and the local brightness complexity index of the scene. The current frame image is stored in the temporal frame buffer, and the temporal change rate of the light intensity features is calculated based on the light intensity features of adjacent frames in the temporal frame buffer.

[0161] This embodiment provides an exposure compensation device based on adaptive light intensity recognition. This device can be implemented as an embedded chip (System-on-Chip, SoC), a digital signal processor (DSP), or a firmware module integrated into a smart camera. The data acquisition module includes a video input interface (such as the Mobile Industry Processor Interface, MIPI) and a preprocessing unit. The preprocessing unit incorporates histogram statistics circuitry and edge detection operators, enabling high-speed parallel calculation of the global brightness mean (light intensity feature) and local variance (local brightness complexity index) at the hardware level, meeting the real-time processing requirements of high frame rate videos such as 4K 60FPS.

[0162] In terms of performance metrics, the data acquisition module can complete single-frame light intensity feature extraction and local brightness complexity calculation in less than 2ms under 4K resolution 60FPS video stream conditions. The end-to-end latency of the overall exposure compensation processing flow is controlled within 8ms, meeting the requirements of real-time video processing.

[0163] Step 902: The intelligent triggering module is configured to dynamically determine the adaptive triggering threshold based on the temporal change rate of light intensity characteristics and the local brightness complexity index, and activate the compensation process when the temporal change rate meets the adaptive triggering threshold.

[0164] The intelligent triggering module is a logic control unit that internally stores a lookup table (LUT) of nonlinear response basis functions to accelerate exponential operations. This module monitors the rate of change of light in real time and calculates dynamic thresholds based on scene complexity. To reduce power consumption, this module is typically designed with gated clock logic: it only sends an enable signal to subsequent high-power analysis modules when it determines that compensation is needed; during periods of stable lighting, these subsequent modules remain in sleep mode.

[0165] Step 903: The specular analysis module is configured to detect specular regions in the current frame and extract the brightness evolution trajectory of each specular region in the temporal frame buffer; perform temporal stability calculation and evaluation on the brightness evolution trajectory to obtain a temporal stability score, and classify the specular regions into transient specular or steady-state specular based on the temporal stability score.

[0166] The specular analysis module is the core computing unit of the device, typically accelerated by a graphics processing unit (GPU) or a neural network processing unit (NPU). It comprises a connected component analysis engine, an optical flow tracing engine, and a statistical analysis engine. The connected component analysis engine is responsible for quickly labeling specular pixels and aggregating regions; the optical flow tracing engine is responsible for tracing back the trajectory within the temporal frame buffer maintained in the on-chip cache (Static Random Access Memory SRAM) and performing motion compensation calculations based on centroid displacement; the statistical analysis engine is responsible for performing adaptive erosion, MAD filtering, and coefficient of variation scoring, outputting a list of specular regions with physical attribute labels (steady-state / transient).

[0167] Step 904: The partition compensation module is configured to determine the differential compensation coefficients corresponding to each highlight region based on the classification results, perform partition exposure adjustment on transient and steady-state highlights, and output the compensated image.

[0168] The zonal compensation module mainly consists of the post-processing pipeline in the image signal processor (ISP). It receives a list of highlight regions and their corresponding compensation coefficients, generating a pixel-level gain mask. This module incorporates hardware-implemented feathering logic, enabling it to generate Gaussian weights and perform alpha mixing in real-time based on the region area. Finally, the module merges the processed Y channel with the original UV channels, outputting the corrected video frame to the display interface or encoding module.

[0169] Step 905, a computer-readable storage medium storing a computer program thereon, characterized in that the computer program, when executed by a processor, implements an exposure compensation method based on adaptive light intensity recognition.

[0170] This embodiment also provides a computer-readable storage medium, such as flash memory, hard disk drive (HDD), optical disk, or cloud storage. The medium stores compiled computer program code or firmware image. When the program is loaded and executed by the processor of a computer device (such as a smartphone, security monitoring host, or autonomous driving domain controller), the processor sequentially performs steps such as data acquisition, intelligent triggering, highlight analysis, and zone compensation according to timing and logic, thereby implementing the exposure compensation method of this invention at the software level.

[0171] To address the difficulty of distinguishing between changes in light source and camera shake in existing technologies, this solution employs a global motion compensation technique based on the median displacement of the center of mass. By calculating the median displacement of the set of highlight regions, the camera motion component is accurately isolated, achieving stable locking of the physical position of the light source under dynamic shooting conditions and effectively avoiding misjudgments caused by camera shake.

[0172] To address the issues of weak anti-interference capability and misjudgment of occlusion, this solution introduces adaptive morphological erosion and MAD robust statistical filtering. The former eliminates edge segmentation jitter noise by using an erosion radius linked to the area, while the latter removes abnormal frames caused by pedestrian or foreign object occlusion by using the median absolute deviation, ensuring that the stability score only reflects the characteristics of the light source itself.

[0173] To address the one-size-fits-all compensation flaw caused by the lack of attribute classification, this solution constructs a scoring system based on the coefficient of variation and exponential mapping, achieving accurate binary classification of steady-state and transient highlights. By applying near-full-intensity compensation to steady-state light sources to restore texture details, and applying protective weak compensation to transient light sources to suppress flicker, combined with boundary interpolation and adaptive feathering fusion, both information integrity and visual comfort are taken into account.

[0174] The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all fall within the protection scope of the present invention.

Claims

1. An exposure compensation method based on adaptive light intensity recognition, characterized in that, include: Get the current frame image of the video stream, and extract the light intensity features and local brightness complexity index of the scene in the current frame; The current frame image is stored in the temporal frame buffer, and the temporal rate of change of the light intensity features is calculated based on the light intensity features of adjacent frames in the temporal frame buffer. Based on the temporal change rate of light intensity characteristics and the local brightness complexity index, the adaptive trigger threshold is dynamically determined, and the compensation process is activated when the temporal change rate meets the adaptive trigger threshold. Detect the highlight regions in the current frame and extract the brightness evolution trajectory of each highlight region in the temporal frame buffer; The temporal stability of the brightness evolution trajectory is calculated and evaluated to obtain a temporal stability score. Based on the temporal stability score, the highlight region is classified as transient highlight or steady-state highlight. Based on the classification results, the differential compensation coefficients corresponding to each highlight region are determined, and the transient and steady-state highlights are adjusted by partitioning the exposure. The compensated image is then fused and output. Dynamically determine the adaptive trigger threshold, including: Construct a nonlinear response basis function, which characterizes the human visual system's tolerance to the rate of change of light. The temporal rate of change of light intensity characteristics is used as the independent variable to input the nonlinear response basis function, and the output value of the nonlinear response basis function is calculated. The complexity modulation factor is calculated based on the local brightness complexity index. By using the output value of the nonlinear response basis function and the complexity modulation factor, the preset basic threshold parameter is modulated to obtain the adaptive trigger threshold; The preset basic threshold parameter is modulated using the output value of the nonlinear response basis function and the complexity modulation factor, satisfying the following calculation relationship: ; Where, τ adapt For adaptive triggering threshold, τ base These are the preset base threshold parameters; f(r) is the output value of the nonlinear response basis function, which is calculated based on the exponential function form: ; Where e is the natural constant, r is the amplitude of the temporal rate of change of the light intensity characteristic, α is the response sensitivity control parameter, and β is the nonlinear curvature control parameter; M c The complexity modulation factor is calculated in a way that satisfies: ; Where γ is the modulation intensity parameter, C norm This is the normalized local brightness complexity index; The temporal stability of the brightness evolution trajectory is evaluated, including: Before calculating the temporal stability score, interference removal preprocessing is performed on the highlight region. Interference removal preprocessing aims to eliminate brightness fluctuations of non-light source bodies caused by camera movement, region boundary jitter, or local occlusion. The temporal stability score is calculated based on the data after interference removal preprocessing.

2. The method according to claim 1, characterized in that, The interference removal preprocessing includes a global motion compensation step based on the median centroid displacement: Calculate the centroid coordinates of each highlight region in the current frame and the previous frame in the time frame buffer respectively; Based on the difference in centroid coordinates of the same highlight region between adjacent frames, a set of centroid displacement vectors is constructed. Calculate the median of the set of centroid displacement vectors, and determine the median as the global motion vector; The global motion vector is used to perform inverse motion compensation on the sampling position of the highlight area in the previous frame, and the brightness evolution trajectory is extracted or corrected based on the compensated sampling position.

3. The method according to claim 1, characterized in that, Interference removal preprocessing includes a core region extraction step based on adaptive morphological erosion: Calculate the area properties of the highlight region and determine the erosion radius that is positively correlated with the area properties; Morphological erosion operations are performed on the spatial mask of the highlight area using the erosion radius to obtain the core area mask; Only the brightness values ​​of pixels located within the core region mask are counted, and these brightness values ​​are used as the effective brightness of the highlight area in the current frame to generate or update the brightness evolution trajectory.

4. The method according to claim 1, characterized in that, Interference removal preprocessing includes a robust statistical-based transient occlusion event filtering step: Obtain the N-frame brightness sequence contained in the brightness evolution trajectory; Calculate the median and median absolute deviation (MAD) of the luminance sequence; The deviation between the brightness value of each frame in the brightness sequence and the median is detected. If the absolute value of the deviation of a frame exceeds a preset multiple of the absolute deviation of the median (MAD), the frame is marked as an occlusion event frame. Remove the brightness data corresponding to the occlusion event frames from the brightness evolution trajectory.

5. The method according to claim 1, characterized in that, Based on the data after interference removal preprocessing, a time series stability score is calculated, including: Statistical analysis was performed on the brightness evolution trajectory to calculate the statistical dispersion index characterizing the intensity of brightness sequence fluctuations. The statistical dispersion index is converted into a normalized value using a preset mapping function to obtain a time series stability score; the lower the statistical dispersion index, the higher the stability indicated by the corresponding time series stability score.

6. The method according to claim 5, characterized in that, The statistical dispersion index is the coefficient of variation; Calculate statistical dispersion indices that characterize the severity of fluctuations in a brightness sequence, including: Calculate the mean and standard deviation of the brightness evolution trajectory; The ratio of standard deviation to mean was determined as the coefficient of variation to eliminate the influence of absolute brightness differences in the highlight area on the fluctuation assessment. The statistical dispersion index is converted into a normalized value using a pre-defined mapping function, satisfying the following exponential decay mapping relationship: ; Among them, S i For timing stability scoring, CV i λ is the coefficient of variation, λ is the kurtosis coefficient, and exp is the exponential function with the natural constant as the base.

7. The method according to claim 5, characterized in that, Statistical dispersion indicators include the magnitude of change and the frequency of trend abrupt changes; The calculation of the time series stability score includes: Perform a first-order difference operation on the brightness evolution trajectory, calculate the standard deviation of the inter-frame brightness change sequence, and obtain the fluctuation amount of the change amplitude. Perform a second-order difference operation on the brightness evolution trajectory, and count the number of times the second-order difference value exceeds the preset abrupt change threshold to obtain the trend abrupt change frequency; By using a weighted linear combination, both the magnitude of change fluctuations and the frequency of trend abrupt changes are mapped to the scoring space to obtain a time series stability score.

Citation Information

Patent Citations

  • Automatic identification method for landing moment of standing long jump based on optical flow analysis

    CN118735966A

  • Chilled food safety storage intelligent monitoring system and method

    CN118762331A