Soft photosensitive detection method adaptive to environment
By introducing an adaptive soft photosensitivity detection method into intelligent imaging devices, and utilizing continuous multi-frame analysis of EV values and temporal depth analysis, the problem of unstable mode switching in existing technologies is solved, achieving high-precision and stable detection in dynamic environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-03-27
AI Technical Summary
Existing photosensitive detection methods in intelligent imaging devices are unstable in dynamic environments, easily affected by transient light source interference leading to misjudgments, and lack in-depth analysis of illumination change trends, resulting in insufficient system flexibility and accuracy.
An adaptive soft photosensitivity detection method is adopted, which acquires the EV value of multiple consecutive frames within a predetermined time window, and combines temporal depth analysis and a dual-lock anti-oscillation mechanism to achieve adaptive mode switching decision.
It improves the detection accuracy and stability of the equipment in complex lighting environments, avoids frequent mode switching, and enhances the user experience.
Smart Images

Figure CN121740410A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent detection, and more specifically, to an adaptive soft photosensitivity detection method. Background Technology
[0002] In the field of photosensitivity detection in intelligent imaging devices, existing technologies generally employ static threshold segmentation or exposure value (EV) monitoring mechanisms within fixed time windows to achieve day / night mode switching. These methods use a preset single brightness threshold to binarize and determine the current environment; for example, when the ambient light intensity exceeds a set threshold, it switches to day mode, and vice versa, it enters night mode.
[0003] However, such technologies have revealed three key shortcomings in practical applications: First, static thresholds cannot adapt to dynamic lighting scenarios (such as the transition from dawn to dusk), leading to frequent oscillations or delayed responses during mode switching; second, brief light source interference (such as the instantaneous illumination of vehicle high beams) can easily trigger misjudgment mechanisms, causing disorder in mode switching logic; third, existing methods lack in-depth analysis of the temporal variation characteristics of EV values, relying solely on single-frame or short-term averages for judgment, ignoring the trend characteristics of light intensity changes and the inertial requirements of mode switching. Especially in dynamic scenarios, simply relying on a few fixed parameters for mode judgment is clearly insufficient to cope with rapidly changing lighting conditions, which limits the flexibility and accuracy of the system.
[0004] To overcome the above shortcomings, there is an urgent need for an adaptive soft photosensitivity detection method. Summary of the Invention
[0005] To address the aforementioned technical problems, this application is proposed. Embodiments of this application provide an adaptive soft photosensitivity detection method. This method utilizes the EV value's performance across multiple consecutive frames within a predetermined time window to perform adaptive soft photosensitivity detection, ensuring normal day / night switching and avoiding adverse effects. Compared to existing hard photosensitivity detection schemes, this method offers advantages such as lower cost, simpler hardware structure, better performance unaffected by temperature, and stronger environmental adaptability, accurately detecting photosensitivity in various environments, especially in reflective scenes, thus avoiding the degraded user experience caused by constantly switching between day and night modes.
[0006] According to one aspect of this application, an adaptive environment soft photosensitivity detection method is provided, comprising: The time queue for calling the ISP interface to obtain EV values; Extract the current mode, which is either day mode or night mode; Based on a predetermined time window, a target number of EV values are extracted from the time queue of the EV values to obtain the target time series of the EV values; Based on the target time series of the EV value and the current mode, determine whether to switch modes.
[0007] Compared with existing technologies, this application provides an adaptive soft photosensitivity detection method that utilizes the EV value across multiple consecutive frames within a predetermined time window for adaptive soft photosensitivity detection, ensuring normal day-night switching and avoiding adverse effects. Thus, compared to existing hard photosensitivity detection schemes, it has advantages such as lower cost, simpler hardware structure, better performance unaffected by temperature; and compared to existing soft photosensitivity detection schemes, it has stronger environmental adaptability, accurately detecting photosensitivity in various environments, especially in reflective scenes, avoiding the degraded user experience caused by constantly switching between day and night modes. Attached Figure Description
[0008] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0009] Figure 1 This is a flowchart of an adaptive environment soft photosensitivity detection method according to an embodiment of this application; Figure 2 This is a schematic diagram of the data flow of the adaptive environment soft photosensitizer detection method according to an embodiment of this application; Figure 3 This is a flowchart of the dual-lock anti-oscillation mechanism in the adaptive environment soft photosensitizer detection method according to an embodiment of this application.
[0010] Figure 4 This is a flowchart of another embodiment of sub-step S4 of the adaptive environment soft photosensitivity detection method according to the embodiments of this application. Detailed Implementation
[0011] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.
[0012] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
[0013] While this application makes various references to certain modules of the systems according to embodiments of this application, any number of different modules can be used and run on user terminals and / or servers. The modules described are merely illustrative, and different aspects of the systems and methods may use different modules.
[0014] Flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, various steps can be processed in reverse order or simultaneously as needed. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.
[0015] The technical solution of this application proposes an adaptive soft photosensitivity detection method. Figure 1 This is a flowchart of an adaptive environment soft photosensitivity detection method according to an embodiment of this application. Figure 2 This is a schematic diagram of the data flow in an adaptive environment soft photosensitizer detection method according to an embodiment of this application. Figure 1 and Figure 2 As shown, the adaptive environment soft photosensitivity detection method according to an embodiment of this application includes the following steps: S1, calling the ISP interface to obtain the time queue of EV values; S2, extracting the current mode, wherein the current mode is a daytime mode or a nighttime mode; S3, extracting a target number of EV values from the time queue of EV values based on a predetermined time window to obtain a target time series of EV values; S4, determining whether to switch modes based on the target time series of EV values and the current mode.
[0016] Specifically, S1 refers to the time queue for calling the ISP interface to obtain EV values. The ISP (Image Signal Processor) interface acts as a bridge between the camera sensor and image processing algorithms. It not only converts the raw image data captured by the sensor into a usable image format but also provides various key parameters, including exposure value (EV), white balance, and color correction. When implementing the time queue for calling the ISP interface to obtain EV values, the system first needs to initialize the connection with the ISP and ensure access to the required APIs or interface functions to extract the exposure value for the current scene from the ISP. This typically means that developers need to be familiar with the SDK or API documentation provided by the ISP vendor, understanding how to correctly set parameters and how to initiate query requests for specific data. It is worth noting that in practice, considering real-time performance and efficiency, the data acquisition process may also need to be optimized. For example, asynchronous I / O or multithreading techniques can be used to avoid blocking the main thread and ensure that the system's response speed is not affected.
[0017] Specifically, S2 involves extracting the current mode, which is either daytime mode or nighttime mode. It should be understood that in extracting the current mode, the system must first be able to identify and distinguish between daytime and nighttime modes. In one example, after obtaining the EV value, the system will determine the current operating mode based on a preset threshold or by analyzing the trend of EV value changes over a period of time. For example, in a simple application scenario, if the EV value corresponding to the current ambient light intensity is higher than a certain preset threshold, it can be considered daytime mode; conversely, if it is lower than the threshold, it is determined to be nighttime mode.
[0018] Specifically, in step S3, a target number of EV values are extracted from the time queue of the EV values based on a predetermined time window to obtain a target time series of EV values. Unlike traditional single-frame or short-time mean analysis, this method can more accurately reflect the changing trend of ambient light, so as to perform trend analysis and avoid misjudgments caused by transient light source interference.
[0019] Specifically, in step S4, based on the target time series of the EV values and the current mode, it is determined whether to switch modes. In the first embodiment, if the current mode is a daytime mode, each EV value in the target time series of the EV values is compared with a calibrated nighttime threshold to obtain a target time series of daytime mode comparison results; based on the target time series of the daytime mode comparison results, it is determined whether to switch modes. If the current mode is a nighttime mode, each EV value in the target time series of the EV values is compared with a calibrated daytime threshold to obtain a target time series of nighttime mode comparison results; based on the target time series of the nighttime mode comparison results, it is determined whether to switch modes. That is, in response to all daytime mode comparison results in the target time series of the daytime mode comparison results showing EV value changes outside the daytime mode range, it is determined to switch to the nighttime mode; in response to all nighttime mode comparison results in the target time series of the nighttime mode comparison results showing EV value changes outside the nighttime mode range, it is determined to switch to the daytime mode.
[0020] In the first embodiment, for example, during dusk, as the sun gradually sets, the ambient light gradually weakens. If the brightness value at a single moment is used to determine whether to switch from day mode to night mode, incorrect decisions may be made due to instantaneous brightness fluctuations at that moment. Instead, by analyzing the changes in EV value over a continuous period (e.g., 12 consecutive frames) and comparing it with preset threshold ranges for day or night modes, the true mode switching needs can be identified more accurately.
[0021] In the embodiments of this application, when the system detects that the EV value of 12 consecutive frames is significantly lower than the set daytime mode threshold range, it indicates that the current ambient light is no longer suitable for maintaining the daytime mode operation. At this time, the system will automatically switch to nighttime mode to adapt to the lower lighting conditions. Similarly, if the system detects that the EV value of 12 consecutive frames exceeds the upper limit of the nighttime mode threshold while in nighttime mode, it indicates that the ambient light has increased to a level sufficient to require switching back to daytime mode. Specifically, the system calculates the difference between the EV value of each frame within 12 frames and the previous frame. If these differences indicate that the EV value is continuously decreasing, and the EV value of all 12 frames is higher than the calibrated nighttime threshold, the system will determine that it needs to switch from daytime mode to nighttime mode. Conversely, if the differences indicate that the EV value is continuously decreasing (i.e., ambient light is increasing), and the EV value of all 12 frames is lower than the calibrated daytime threshold while in nighttime mode, the system will determine that it needs to switch from nighttime mode to daytime mode. This approach allows the system to reduce false triggering caused by transient light sources or other atypical lighting conditions while maintaining high accuracy, thereby providing a smoother and more natural user experience.
[0022] In a specific embodiment, the complete implementation process of the first embodiment is as follows: First, call the ISP interface to obtain the EV value; Then, determine whether the current mode is daytime or nighttime. If it is daytime, compare the EV value with the calibrated nighttime threshold; if it is nighttime, compare the EV value with the calibrated daytime threshold.
[0023] Next, if the EV value changes within 12 consecutive frames and are not within the range of the current mode, the mode will switch. That is, if it is daytime mode, and the EV value is greater than the nighttime threshold for 12 consecutive frames, it will switch to nighttime mode. If it is nighttime mode, and the EV value is less than the daytime threshold for 12 consecutive frames, it will switch to daytime mode. If there are no 12 consecutive frames where the EV value meets the above conditions, the current mode will continue to be maintained. A day / night switching flag signal will be output.
[0024] After generating the day / night switching signal, to prevent frequent mode switching due to sudden changes in ambient light, this application embodiment further introduces a dual-locking anti-oscillation mechanism. For example... Figure 3 As shown, the mechanism first performs the verification step of Lock 2, that is, confirms whether Lock 2 is open. Lock 2 is used to forcibly lock the night mode after confirming that an oscillation has occurred. If it is not open, it proceeds to the next step to determine the day / night switching flag. If it is open, it records the current time and the current ev value, and compares it with the lock time and lock ev value recorded when Lock 2 was opened. If the lock time exceeds 1 hour or the ev value changes by more than 40%, all flag data is cleared and the system switches to day mode. Otherwise, it continues to maintain the night mode.
[0025] Next, determine whether a day / night switch is needed. If not, maintain the current mode and no further action is required. If a day / night switch is needed, unlock lock 1 if it is night to day, record the current time and ev value, and switch to day mode. If it is day to night, proceed to the next step.
[0026] Then, if the mode changes from day to night and lock 1 is unlocked, proceed to the next step; otherwise, clear the data markers for lock 1 and switch to night mode.
[0027] Finally, if the daytime mode turns into nighttime mode and lock 1 is unlocked, and this happens 10 times in a row, then lock 2 is unlocked; otherwise, the data markers for lock 1 are cleared, and the mode is switched to nighttime mode.
[0028] In particular, in practical applications, judgment logic based on static thresholds or simple averages mainly relies on discrete amplitude comparisons, making it difficult to distinguish between two seemingly similar but fundamentally different lighting change scenarios: the first is a deterministic trend change in ambient light, such as during dusk when light smoothly and continuously weakens, and the EV value stably and unidirectionally crosses the switching threshold—this is the true mode switching signal; the second is a random transient fluctuation in ambient light, such as rapidly moving clouds and swaying tree shadows in cloudy weather, or the instantaneous flash of vehicle high beams at night, causing the EV value to fluctuate violently and irregularly around the threshold. If the trend correlation and dynamic stability of the EV value time series are ignored, the system may generate unnecessary frequent mode switching (i.e., oscillation) due to transient noise, or experience delayed switching response due to the inability to confirm the trend.
[0029] Therefore, in order to solve the problem of misjudgment caused by random fluctuations in illumination under complex lighting conditions, the technical solution of this application also provides an adaptive switching decision mechanism based on time-series deep analysis: based on the target time series of the EV value and the current mode, it is determined whether to switch modes.
[0030] Specifically, in the second embodiment of this application, as Figure 4 As shown, S4 includes: S41, performing time-series trend stability quantification on the target time series of EV values to obtain a trend stability score; S42, performing time-series weighted deviation amplitude aggregation on the target time series of EV values and the calibrated night threshold to obtain a weighted deviation amplitude; S43, performing adaptive switching confidence fusion and decision-making on the weighted deviation amplitude and trend stability score to obtain a switching decision signal.
[0031] Specifically, in step S41, the temporal trend stability of the target time series of EV values is quantified to obtain a trend stability score. Specifically, to distinguish between deterministic trend changes in ambient light (such as dusk transition) and random transient fluctuations (such as swaying tree shadows), the system first calculates the first-order difference sequence of the target time series of EV values to capture the direction and magnitude of changes between frames. Subsequently, the trend stability score is calculated based on dynamic trend entropy weight logic.
[0032] In one specific embodiment, the trend stability score It can be calculated using the following formula:
[0033]
[0034] in, The trend stability score represents the final output; It is a trend direction sequence obtained after symbolizing the first-order difference sequence of EV values; The normalized information entropy used to calculate the directional sequence is used to macroscopically assess the overall consistency of the trend. It is the mean of the original difference sequence, representing the average trend of change within the time window; It refers to the specific change in EV value per frame; This represents the first-order difference sequence of the target time series of EV values; The Sigmoid activation function has a product term inside it. The trend conformity of each frame is evaluated microscopically by determining whether the direction of change in a single frame is consistent with the average trend direction. For example, the sensitivity modulator is a sensitivity modulator. The value can range from 0.5 to 2.0, preferably 1.0. When When set to 1.0, it can better balance the ability to capture subtle trend changes and the ability to suppress noise; This represents the length of the time series.
[0035] Here, we can understand the normalized information entropy in the above formula. The calculation process includes the following steps: First, the symbolic generation of the trend direction sequence: First, for each element in the first-order difference sequence of EV values... Perform ternary symbolization to generate trend direction sequences. The symbolic function is defined as follows:
[0036] in, A preset noise tolerance dead zone threshold (e.g., set to 0 or a minimum value) is used to filter sensor noise floor. Thus, the trend direction is discretized into three states: .
[0037] The second step is probability distribution calculation: Statistically analyze the frequency of each state within the current time window and calculate the empirical probability of each state. :
[0038] in, For state In sequence The number of times it appears in This represents the total length of the sequence.
[0039] The third step is to calculate the normalized entropy value: based on the Shannon entropy definition and after normalization, we obtain... :
[0040] Among them, the denominator This is the maximum possible entropy value for a three-state system (i.e., the entropy when the probabilities of the three states are equal), used to normalize the calculation results to... Interval.
[0041] This computational logic integrates information theory and statistical characteristics: in scenes with smooth lighting transitions (such as dusk), the trend direction is singular, and the information entropy... Low, and most single-frame variations with the mean
[0042] In the same direction, making The score is relatively high; however, in scenarios with flickering light (such as swaying tree shadows), the trend direction is chaotic and the information entropy is high, resulting in a significant suppression of the score. Therefore, a quantitative indicator reflecting the purity and consistency of the trend is generated.
[0043] Specifically, in step S42, the target time series of EV values and the calibrated nighttime threshold are aggregated with time-weighted deviation magnitudes to obtain a weighted deviation magnitude. Specifically, considering that data closer to the current moment has a greater impact on decision-making, this step employs an exponentially decaying weighted aggregation method. Specifically, the weighted average deviation of the EV value series relative to the calibrated threshold (such as the nighttime threshold) is calculated.
[0044] In one specific embodiment, the weighted bias amplitude It can be calculated using the following formula:
[0045] in, This represents the calculated weighted deviation magnitude; To be applied to the first The exponential decay weight of the frame, where The decay coefficient controls the rate at which historical data is forgotten; for example, the decay coefficient... The value can range from 0.1 to 0.9. For example, Setting it to 0.8 means that the weight of historical data decreases by a factor of 0.8 over time, thus making the system more focused on the lighting deviation in the most recent frames and able to react quickly to sudden changes in light. Total number of frames Index of the current frame; It then accurately calculates the deviation amount below the threshold for each frame.
[0046] In this embodiment, the weighted deviation magnitude can intelligently measure the pressure of switching: in scenes where the light suddenly dims, the deviation of the most recent frames is large and has a high weight, which will quickly increase the pressure. Value; however, in scenes where occlusion is brief and recovery is rapid, even if there is a deviation of several frames, its weight is low or the deviation is small, thus having little impact on the overall performance. The contribution is limited, thus generating a comprehensive indicator that can dynamically reflect the severity and timeliness of EV values deviating from the threshold.
[0047] Specifically, in step S43, an adaptive switching confidence fusion and decision are performed on the weighted deviation magnitude and trend stability score to obtain a switching decision signal. Specifically, to achieve robust decision-making, this step uses trend stability as a gating mechanism to dynamically adjust the influence of the deviation magnitude on the final decision. Specifically, the switching confidence is calculated using a stability-gated confidence fusion model and compared with a decision threshold.
[0048] In one specific embodiment, the switching decision signal The determination logic is as follows:
[0049] in, To switch confidence levels; and These are the weighted hyperparameters that control the contribution of the deviation magnitude and the stability gating term, respectively. It is a preset decision threshold, for example, a weight parameter. It can be set to 0.5. The decision threshold can be set to 1.5. It can be set to 0.85.
[0050] In particular, Forming stability gating terms, where, The rating acts like a regulating valve: when the trend is stable ( (High value), valve opens, deviation range The influence is significantly amplified, system decisions become more decisive, and the ability to quickly respond to real mode-switching needs; when the trend is unstable ( When the value is low, the valve closes, and the system becomes cautious, only triggering a switch when the deviation amplitude itself reaches its maximum value. In this way, by constructing an adaptive decision model, the system can dynamically weigh the quality (stability) and strength (deviation amplitude) of evidence when making decisions, ultimately achieving high sensitivity to changes in the real environment and high immunity to noise interference.
[0051] In summary, this embodiment optimizes soft photosensitivity detection from static rule-based threshold comparison to dynamic adaptive decision-making based on temporal features by introducing trend stability quantification, time-series weighted deviation amplitude aggregation, and stability-gated confidence fusion mechanisms. Through nonlinear fusion of multi-dimensional features, this embodiment achieves accurate identification of the nature of illumination changes: on the one hand, by utilizing the synergistic effect of trend stability scoring and weighted deviation amplitude, the system can effectively identify deterministic trend changes in ambient illumination (such as continuous light variations during dusk or dawn), thus ensuring high sensitivity in real-world switching scenarios and avoiding switching response lag; on the other hand, by utilizing the stability gating mechanism, the system can effectively filter random transient fluctuations in ambient illumination (such as cloud movement, swaying tree shadows, or passing car headlights at night), thus maintaining high stability in complex interference scenarios and suppressing false triggering caused by noise. Therefore, this embodiment solves the mode oscillation problem commonly found in existing technologies while ensuring system response speed, significantly improving the device's environmental perception capability and decision robustness in various complex dynamic lighting environments.
[0052] In summary, the adaptive environment soft photosensitivity detection method according to the embodiments of this application is explained. It utilizes the performance of the EV value across multiple consecutive frames within a predetermined time window to perform adaptive environment soft photosensitivity detection, ensuring normal day-night switching and avoiding adverse effects. Compared to existing hard photosensitivity detection schemes, this method offers advantages such as lower cost, simpler hardware structure, better performance unaffected by temperature, and stronger environmental adaptability, accurately detecting photosensitivity in various environments, especially in reflective scenes, thus avoiding the degraded user experience caused by constantly switching between day and night modes.
[0053] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. An adaptive environment soft photosensitivity detection method, characterized in that, include: The time queue for calling the ISP interface to obtain EV values; Extract the current mode, which is either day mode or night mode; Based on a predetermined time window, a target number of EV values are extracted from the time queue of the EV values to obtain the target time series of the EV values; Based on the target time series of the EV value and the current mode, determine whether to switch modes.
2. The adaptive environment soft photosensitivity detection method according to claim 1, characterized in that, The predetermined time window is 12 consecutive frames.
3. The adaptive environment soft photosensitivity detection method according to claim 2, characterized in that, Based on the target time series of the EV value and the current mode, determine whether to switch modes, including: If the current mode is daytime mode, compare each EV value in the target time series of the EV values with the calibrated nighttime threshold to obtain the target time series of the daytime mode comparison results; Based on the target time series of the daytime mode comparison results, determine whether to switch modes; If the current mode is night mode, compare each EV value in the target time series of the EV values with the calibrated daytime threshold to obtain the target time series of the night mode comparison results; Based on the target time series of the night mode comparison results, determine whether to switch modes.
4. The adaptive environment soft photosensitivity detection method according to claim 3, characterized in that, If all daytime mode comparison results in the target time series of the daytime mode comparison results show that the EV value change is not within the daytime mode range, it is determined to switch to the nighttime mode; if all nighttime mode comparison results in the target time series of the nighttime mode comparison results show that the EV value change is not within the nighttime mode range, it is determined to switch to the daytime mode.
5. The adaptive environment soft photosensitivity detection method according to claim 1, characterized in that, Based on the target time series of the EV value and the current mode, determine whether to switch modes, including: The time series trend stability of the target EV value is quantified to obtain a trend stability score; The target time series of EV values and the calibrated nighttime threshold are aggregated with time-weighted deviation amplitudes to obtain the weighted deviation amplitude; An adaptive switching confidence fusion and decision-making process is performed on the weighted bias magnitude and trend stability scores to obtain the switching decision signal.