A scene adaptive recognition system and method for security monitoring
Patent Information
- Application Number
- CN202611135174.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-10-27
AI Technical Summary
[0005]为此,本发明提供一种用于安防监控的场景自适应识别系统及方法,用以通过多参数自适应递进处理与分段阈值调整,克服现有技术因参数固定且缺乏场景在线补偿机制导致在低照度、高动态恶劣场景中适应性不足引起的漏报误报率高的问题
[0016]与现有技术相比,本发明的有益效果在于,通过实时采集图像信噪比、亮度方差比、拖影长度和方向熵这四个直接反映环境物理特性的参数,构建了从光照强度到光学畸变再到运动模糊的自适应递进处理链路。图像信噪比作为光照条件的直观表征,当其低于预设低照阈值时触发低照度候选场景判定,此时亮度方差比的时序波动特征和分布偏度能够有效区分镜头渐晕与均匀低照,进而通过阈值偏离幅度计算补偿增益修正拖影长度,避免光学不均匀性对运动目标检测的干扰。方向熵值通过对运动矢量方向随机性的量化,准确区分高动态混叠场景与低动态均匀场景,结合修正后的拖影长度与图像信噪比计算状态强度,从而动态调整检测灵敏度与识别阈值,实现低照度下运动模糊与噪声的平衡抑制。对于非低照度场景,则依据亮度方差比的波动和拖影长度变化调整背景更新率,使背景建模适应不同纹理复杂度的静态场景。最终基于历史调整时刻的加权信噪比均值反馈修正低照阈值,形成闭环优化。能够使监控系统能够自适应各类复杂场景,显著降低误报率并提升目标识别的鲁棒性。
Smart Images

Figure CN122990609A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of security monitoring technology, and in particular to a scene adaptive recognition system and method for security monitoring. Background Technology
[0002] With the widespread application of video surveillance systems in fields such as safe cities, smart transportation, and intelligent buildings, the complexity and dynamism of monitoring scenarios are becoming increasingly prominent. Factors such as changes in ambient light, lens optical distortion, motion blur, and background texture fluctuations under different time periods, weather conditions, and motion modes are coupled with each other, making it difficult for traditional monitoring algorithms based on fixed parameters to maintain stable detection performance in harsh scenarios such as low light and high dynamics. The false alarm rate and false alarm rate have increased significantly, and the insufficient adaptive capability of the system has become a key challenge restricting the implementation of intelligent security.
[0003] Chinese Patent Publication No. CN112380905A discloses an abnormal behavior detection method based on histogram-based entropy in surveillance video. The method includes: Step 1, extracting optical flow information using dense optical flow: using the Farneback dense optical flow algorithm to extract optical flow information within the moving area; Step 2, statistically converting the optical flow information obtained in Step 1 into a direction-amplitude histogram, and calculating the direction entropy, amplitude entropy, and velocity variance of the histogram; Step 3, calculating the combination entropy S, which represents the degree of behavioral disorder, using the product of the histogram's direction entropy, amplitude entropy, and velocity variance; Step 4, determining whether abnormal behavior exists based on the magnitude of the combination entropy S, with a larger combination entropy S indicating a greater likelihood of abnormal behavior.
[0004] Therefore, the existing technology has the following problems: it relies on the Farneback dense optical flow algorithm to perform point-by-point calculations on all pixels of the entire image, and the amount of computation increases linearly with resolution, which can easily lead to insufficient real-time performance and difficulty in deployment on embedded devices; it only uses a single indicator, the product of directional entropy, amplitude entropy and velocity variance, to determine abnormal behavior, without distinguishing the impact of different lighting conditions on optical flow extraction, which can easily generate a large number of false anomaly alarms in low-light environments; it lacks a compensation mechanism for the edge attenuation of the optical flow field caused by lens vignetting, and the confidence of optical flow information in the edge area of the image decreases significantly, making it easy to miss real abnormal behavior occurring in the edge area. Summary of the Invention
[0005] To address this issue, the present invention provides a scene adaptive recognition system and method for security monitoring. This system overcomes the problem of high false alarm and missed alarm rates in existing technologies due to insufficient adaptability in low-light, high-dynamic, and harsh scenes caused by fixed parameters and the lack of online scene compensation mechanisms. This is achieved through multi-parameter adaptive progressive processing and segmented threshold adjustment.
[0006] To achieve the above objectives, in one aspect, the present invention provides a scene adaptive recognition method for security monitoring, comprising: The system acquires the image signal-to-noise ratio, brightness variance ratio, and target edge trailing length in the monitored scene in real time during the monitoring process based on a preset detection sensitivity. The target edge is determined based on a preset recognition threshold, and the monitoring process is updated with a preset background update rate. Based on the comparison result between the image signal-to-noise ratio and the preset low-light threshold, it is determined whether the monitored scene is a candidate scene for low-light conditions. Based on the judgment result of the monitoring scene being the low-light candidate scene, the brightness variance ratio within the preset state is used to determine whether lens vignetting occurs. Based on the determination of lens vignetting, the vignetting compensation gain is determined according to the threshold deviation of the brightness variance ratio in order to correct the motion blur length. The direction entropy value of the motion vector in the monitored scene is obtained, and combined with the preset high entropy trigger threshold, the state type of the low-light candidate scene is determined, and the corresponding recognition result is output. Based on the state type, the state strength of the state type is determined according to the corrected trailing length and the image signal-to-noise ratio; Based on the state intensity, the preset detection sensitivity is reduced and / or the preset recognition threshold is increased; Based on the determination that the monitored scene is not the low-light candidate scene, the preset background update rate is adjusted according to the brightness variance ratio and the shadow length within the preset determination period; The preset low-light threshold is adjusted based on the timestamp of the low-light candidate scene within the preset correction period, the timestamp of the preset background update rate, and the image signal-to-noise ratio.
[0007] Furthermore, the process of determining whether a monitored scene is a candidate low-light scene based on the comparison result of the image signal-to-noise ratio and the preset low-light threshold includes: When the image signal-to-noise ratio is less than a preset low-light threshold, the monitored scene is determined to be a low-light candidate scene.
[0008] Furthermore, the process of determining whether lens vignetting occurs based on the brightness variance ratio within a preset time period includes: Calculate the first-order difference sequence of the brightness variance ratio within the preset state determination time period, and count the number of positive and negative alternations and the amplitude ratio in the first-order difference sequence; When the amplitude ratio is greater than a preset fluctuation threshold and the number of positive and negative alternations is less than a preset stable number, the lens vignetting state is determined to have occurred. Otherwise, the absolute value of the skewness coefficient of the cumulative distribution function of the brightness variance ratio is calculated, and the lens vignetting state is determined to occur when the absolute value of the skewness coefficient is greater than the preset skewness coefficient threshold.
[0009] Further, the process of determining the vignetting compensation gain based on the threshold deviation of the brightness variance ratio to correct the motion blur length includes: Calculate the absolute value of the difference between the brightness variance ratio and the preset optical uniformity reference value to obtain the threshold deviation range; When the threshold deviation is less than a preset first deviation threshold, the vignetting compensation gain is set to a preset initial value; When the threshold deviation is between the preset first deviation threshold and the preset second deviation threshold, the vignetting compensation gain is calculated based on a preset linear interpolation formula; When the threshold deviation is greater than or equal to the preset second deviation threshold, the vignetting compensation gain is set to the preset maximum gain; The obtained trailing shadow length is multiplied by the vignetting compensation gain to obtain the corrected trailing shadow length.
[0010] Furthermore, the process of obtaining the direction entropy value of motion vectors within the monitored scene, and combining it with a preset high entropy trigger threshold to determine the state type of low-light candidate scenes, includes: Acquire images from the monitored scene, divide them into several grid blocks, calculate the direction angle of the motion vectors within each grid block, and statistically analyze the histogram distribution of the direction angles of all grid blocks. Calculate the directional entropy value based on the histogram distribution; When the directional entropy value is greater than the preset high entropy trigger threshold, the state type of the low-light candidate scene is determined to be high dynamic aliasing type; When the directional entropy value is less than or equal to the preset high entropy trigger threshold, the state type of the low illumination candidate scene is determined to be low dynamic aliasing type.
[0011] Furthermore, based on the state type, the process of determining the state strength of the state type according to the corrected trailing shadow length and the image signal-to-noise ratio includes: When the state type is the high dynamic range aliasing type, the ratio of the corrected trailing length to the preset trailing reference length is calculated, the ratio of the preset signal-to-noise ratio reference value to the image signal-to-noise ratio is calculated, and the product of the two ratios is calculated to obtain the state intensity. When the state type is the low dynamic aliasing type, the ratio of the corrected trailing length to the preset trailing reference length is calculated, the ratio of the image signal-to-noise ratio to the preset signal-to-noise ratio reference value is calculated, and the absolute value of the difference between the two ratios is calculated to obtain the state intensity.
[0012] Furthermore, the process of reducing the preset detection sensitivity and / or increasing the preset recognition threshold based on the state intensity includes: When the state intensity is greater than a preset first intensity threshold, the preset detection sensitivity is reduced by a preset first percentage, while the preset recognition threshold is increased by a preset second percentage. When the state intensity is between a preset first intensity threshold and a preset second intensity threshold, the preset detection sensitivity is reduced by a preset third percentage only. When the state intensity is less than a preset second intensity threshold, the preset identification threshold is increased by a preset fourth percentage.
[0013] Furthermore, the process of adjusting the preset background update rate based on the brightness variance ratio and the ghosting length within the preset determination period includes: Within the preset determination period, calculate the variance of the time series of the brightness variance ratio and the average value of the trailing shadow length; When the variance value is greater than a preset variance threshold and the average value of the trailing shadow length is less than a preset trailing shadow threshold, the preset background update rate is increased based on the preset first step length. When the variance value is less than or equal to the preset variance threshold and the average value of the trailing shadow length is greater than or equal to the preset trailing shadow threshold, the preset background update rate is reduced based on the preset second step size.
[0014] Furthermore, the process of adjusting the preset low-light threshold based on the timestamps of low-light candidate scenes within a preset correction period, the timestamps of adjusting the preset background update rate, and the image signal-to-noise ratio includes: Within the preset correction period, all low-light candidate scene determination events and all events that adjust the preset background update rate are counted to obtain the total number of events; the time difference between each timestamp and the current time, and the corresponding image signal-to-noise ratio are also calculated. The weighted average signal-to-noise ratio is calculated based on the time difference of each event and the preset time decay constant. Divide the weighted average signal-to-noise ratio by the preset reference signal-to-noise ratio to obtain the ratio coefficient, and calculate the product of the preset low-light threshold and the ratio coefficient to adjust the preset low-light threshold, and limit the adjusted preset low-light threshold between the preset adjustment threshold lower limit and the preset adjustment threshold upper limit.
[0015] On the other hand, the present invention also provides a scene adaptive recognition system for security monitoring, comprising: The acquisition module is used to acquire in real time the image signal-to-noise ratio, brightness variance ratio and target edge trailing length in the monitored scene during the monitoring process based on the preset detection sensitivity. The target edge is determined based on the preset recognition threshold, and the monitoring process is updated with the preset background update rate. The candidate determination module is used to determine whether the monitoring scene is a low-light candidate scene based on the comparison result between the image signal-to-noise ratio and the preset low-light threshold. The state determination module is used to determine whether lens vignetting occurs based on the determination result that the monitoring scene is the low-light candidate scene and the brightness variance ratio within the preset state determination time. The correction module is used to determine the vignetting compensation gain based on the threshold deviation of the brightness variance ratio, based on the determination result of the occurrence of lens vignetting, so as to correct the motion blur length. The type determination module is used to obtain the direction entropy value of the motion vector in the monitored scene, and combine it with the preset high entropy trigger threshold to determine the state type of the low-light candidate scene, and output the corresponding recognition result. An intensity determination module is used to determine the state intensity of the state type based on the state type, the corrected trailing length, and the image signal-to-noise ratio. The first adjustment module is used to reduce the preset detection sensitivity and / or increase the preset recognition threshold based on the state intensity. The second adjustment module is used to adjust the preset background update rate based on the determination result that the monitoring scene is not the low-light candidate scene, according to the brightness variance ratio and the shadow length within the preset determination period. The threshold adjustment module is used to adjust the preset low-light threshold based on the timestamp of the low-light candidate scene within the preset correction period, the timestamp of the preset background update rate, and the image signal-to-noise ratio.
[0016] Compared with existing technologies, the advantages of this invention lie in its ability to construct an adaptive progressive processing chain from illumination intensity to optical distortion and then to motion blur by real-time acquisition of four parameters that directly reflect the physical characteristics of the environment: image signal-to-noise ratio (SNR), brightness variance ratio (BVR), shadow length, and directional entropy. Image SNR, as a direct representation of illumination conditions, triggers low-light candidate scene determination when it falls below a preset low-light threshold. At this point, the temporal fluctuation characteristics and distribution skewness of the BVR effectively distinguish between lens vignetting and uniform low-light conditions. Furthermore, the shadow length is corrected by calculating compensation gain based on the threshold deviation amplitude, avoiding interference from optical inhomogeneity in moving target detection. The directional entropy value, by quantifying the randomness of motion vector direction, accurately distinguishes between highly dynamic aliased scenes and low-dynamic uniform scenes. Combined with the corrected shadow length and image SNR, the state intensity is calculated, thereby dynamically adjusting the detection sensitivity and recognition threshold to achieve a balanced suppression of motion blur and noise under low-light conditions. For non-low-light scenes, the background update rate is adjusted based on the fluctuation of the BVR and changes in shadow length, allowing background modeling to adapt to static scenes with different texture complexities. Finally, the low-light threshold is corrected based on the weighted signal-to-noise ratio mean at historical adjustment times, forming a closed-loop optimization. This enables the monitoring system to adapt to various complex scenarios, significantly reducing the false alarm rate and improving the robustness of target recognition. Attached Figure Description
[0017] Figure 1 This is a flowchart of the scene adaptive recognition method for security monitoring in this embodiment; Figure 2 This is a logic diagram for determining low-light candidate scenes in this embodiment; Figure 3 This is a logic diagram for determining the lens vignetting state in this embodiment; Figure 4 This is a schematic diagram of the scene adaptive recognition system used for security monitoring in this embodiment. Detailed Implementation
[0018] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0019] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0020] Please see Figure 1 As shown, this is a flowchart of the scene adaptive recognition method for security monitoring in this embodiment. On one hand, this embodiment provides a scene adaptive recognition method for security monitoring, including: The system acquires the image signal-to-noise ratio, brightness variance ratio, and target edge trailing length in the monitored scene in real time during the monitoring process based on a preset detection sensitivity. The target edge is determined based on a preset recognition threshold, and the monitoring process is updated with a preset background update rate. Based on the comparison result between the image signal-to-noise ratio and the preset low-light threshold, it is determined whether the monitored scene is a candidate scene for low-light conditions. Based on the judgment result of the monitoring scene being the low-light candidate scene, the brightness variance ratio within the preset state is used to determine whether lens vignetting occurs. Based on the determination of lens vignetting, the vignetting compensation gain is determined according to the threshold deviation of the brightness variance ratio in order to correct the motion blur length. The direction entropy value of the motion vector in the monitored scene is obtained, and combined with the preset high entropy trigger threshold, the state type of the low-light candidate scene is determined, and the corresponding recognition result is output. Based on the state type, the state strength of the state type is determined according to the corrected trailing length and the image signal-to-noise ratio; Based on the state intensity, the preset detection sensitivity is reduced and / or the preset recognition threshold is increased; Based on the determination that the monitored scene is not the low-light candidate scene, the preset background update rate is adjusted according to the brightness variance ratio and the shadow length within the preset determination period; The preset low-light threshold is adjusted based on the timestamp of the low-light candidate scene within the preset correction period, the timestamp of the preset background update rate, and the image signal-to-noise ratio.
[0021] In this embodiment, the current monitoring scene is automatically determined by the real-time on-site images captured by the security camera. The system has preset detection sensitivity to control the trigger threshold for moving target detection and preset recognition threshold to determine whether edge pixels belong to the target outline. The image signal-to-noise ratio is obtained by calculating the ratio of the grayscale mean to the standard deviation of a 64x64 pixel textureless flat window selected in the center of the image. If multiple flat windows exist, the average value is taken. The brightness variance ratio is obtained by calculating the grayscale variance of the circular area in the center of the image and the square areas at the four corners, and then calculating the ratio of the mean variance of the corner areas to the variance of the center area. The motion vector is calculated by using the Farneback dense optical flow method to calculate the motion vector of the preceding and following frames, combining it with Canny edge detection to extract the target edge pixels, searching for grayscale extreme points along the normal direction and calculating the distance, and then multiplying it by the ratio of the exposure time to the frame interval. Those skilled in the art only need to embed the above-mentioned standard image processing modules such as window selection, mean and variance calculation, optical flow field solution, edge detection, orientation angle statistics, and threshold segmentation adjustment into existing surveillance cameras to obtain these parameters.
[0022] The preset detection sensitivity is the threshold value in the moving target detection algorithm for judging whether a pixel change belongs to a moving target. Its setting depends on the background noise level of the monitoring scene and the statistical distribution of the target's motion amplitude. It is usually set between 0.1 and 0.5 to balance the detection rate and false alarm rate. In this embodiment, it is set to 0.25, which enables stable detection of human-shaped targets under normal lighting conditions while suppressing false alarms caused by leaf swaying.
[0023] The preset recognition threshold is the gradient magnitude threshold used in the edge detection operator to determine whether a pixel belongs to the target contour. Its setting depends on the statistical characteristics of the gradient intensity distribution between the target edge and the background texture in the monitored image. It is usually set between 30 and 100 to distinguish between strong and weak edges. In this embodiment, it is set to 60, which can ensure that the complete human contour can still be extracted in a low-contrast environment without introducing too much texture noise.
[0024] The preset low-light threshold is the image signal-to-noise ratio critical value for determining whether a monitored scene is a candidate low-light scene. Its setting depends on the noise characteristics of the camera sensor under low-light conditions and the acceptable lower limit of signal-to-noise ratio. It is usually set between 1.5 and 3.0 to avoid normal lighting being misjudged as low light. In this embodiment, it is set to 2.0, which can trigger the low-light processing link in time when the ambient light drops to the twilight level.
[0025] The preset state determination duration is the length of the time window used to statistically analyze the timing characteristics of the brightness variance ratio. Its setting depends on the matching relationship between the typical speed of lens vignetting state changes and the camera frame rate. It is usually set between 0.5 seconds and 2 seconds to ensure sufficient samples without delaying the response. In this embodiment, it is set to 1 second, which can capture the vignetting fluctuation characteristics caused by lens temperature or mechanical changes and eliminate instantaneous noise interference.
[0026] The preset high-entropy trigger threshold is the critical value of directional entropy for determining whether a low-light candidate scene belongs to the high-dynamic aliasing type or the low-dynamic aliasing type. Its setting depends on the entropy boundary between random motion mode and ordered motion mode in a typical monitoring scene. That is, when the directional entropy is lower than the threshold, the motion direction is concentrated in a few angles, corresponding to low-dynamic scenes such as vehicle driving or one-way flow of crowds. When the directional entropy is higher than the threshold, the motion direction is widely dispersed, corresponding to high-dynamic scenes such as falling rain and snow, swaying branches and leaves, or irregular movement of dense small targets. It is usually set between 2.5 and 4.0 bits to cover the motion complexity range of most monitoring scenes. In this embodiment, it is set to 3.2 bits, which can accurately distinguish between two completely different motion modes, namely, swaying tree shadows and straight-moving vehicles, thus providing a reliable basis for subsequent state intensity calculation using product formulas or difference formulas.
[0027] The preset judgment period is the evaluation time period for determining whether to adjust the background update rate in non-low illumination scenes. Its setting depends on the time constant of background texture changes and the typical dynamic level of the monitored scene. It is usually set between 5 and 30 seconds to balance stability and adaptability. In this embodiment, it is set to 10 seconds, which can adjust the background modeling speed in time when the scene changes from open to crowded without causing model jitter.
[0028] The preset correction period is the time interval for feedback adjustment of the preset low light threshold. Its setting depends on the seasonal pattern of ambient light changes and the system's adaptive convergence speed requirements. It is usually set between 1 hour and 24 hours to prevent frequent fluctuations in the threshold. In this embodiment, it is set to 6 hours, which allows the low light threshold to gradually decrease with sunset and filters out instantaneous light changes caused by brief clouds.
[0029] By real-time acquisition of four parameters directly reflecting the physical characteristics of the environment—image signal-to-noise ratio (SNR), brightness variance ratio (BVR), ghost length, and directional entropy—an adaptive progressive processing chain is constructed, from illumination intensity to optical distortion and then to motion blur. Image SNR, as a direct representation of illumination conditions, triggers low-light candidate scene determination when it falls below a preset low-light threshold. At this point, the temporal fluctuation characteristics and distribution skewness of the BVR effectively distinguish between lens vignetting and uniform low light. The ghost length is then corrected by calculating compensation gain based on the threshold deviation, avoiding interference from optical inhomogeneities in moving target detection. The directional entropy value, by quantifying the randomness of motion vector directions, accurately distinguishes between highly dynamic aliased scenes and low-dynamic uniform scenes. Combined with the corrected ghost length and image SNR, the state intensity is calculated, thereby dynamically adjusting the detection sensitivity and recognition threshold to achieve a balanced suppression of motion blur and noise under low light conditions. For non-low-light scenes, the background update rate is adjusted based on the fluctuation of the BVR and changes in ghost length, allowing background modeling to adapt to static scenes with different texture complexities. Finally, the low-light threshold is corrected based on the weighted signal-to-noise ratio mean at historical adjustment times, forming a closed-loop optimization. This enables the monitoring system to adapt to various complex scenarios, significantly reducing the false alarm rate and improving the robustness of target recognition.
[0030] Please see Figure 2 As shown, this is the logic diagram for determining low-light candidate scenes in this embodiment. In this embodiment, the process of determining whether a monitored scene is a low-light candidate scene based on the comparison result of the image signal-to-noise ratio and the preset low-light threshold includes: When the image signal-to-noise ratio is less than a preset low-light threshold, the monitored scene is determined to be a low-light candidate scene.
[0031] Image signal-to-noise ratio (SNR) is determined by the microscopic fluctuations of sensor thermal noise, photon shot noise, and readout noise. Its value monotonically decreases as ambient light decreases. Therefore, directly comparing the image SNR with a preset low-light threshold allows for accurate identification of low-light candidate scenes without the need for complex lighting sensors. This judgment logic relies solely on the statistical characteristics of a single frame, requiring minimal computation and achieving a response time of once per frame. This provides timely and reliable scene classification for subsequent lens vignetting detection, motion blur correction, and sensitivity adjustment. By determining low-light candidate scenes through a single comparison of the image SNR with the preset low-light threshold, the risk of misjudgment by the monitoring system under low-light conditions such as dusk or night is effectively reduced.
[0032] Please see Figure 3 As shown, this is the logic diagram for determining the lens vignetting state in this embodiment. In this embodiment, the process of determining whether lens vignetting occurs based on the brightness variance ratio within a preset time period includes: Calculate the first-order difference sequence of the brightness variance ratio within the preset state determination time period, and count the number of positive and negative alternations and the amplitude ratio in the first-order difference sequence; When the amplitude ratio is greater than a preset fluctuation threshold and the number of positive and negative alternations is less than a preset stable number, the lens vignetting state is determined to have occurred. Otherwise, the absolute value of the skewness coefficient of the cumulative distribution function of the brightness variance ratio is calculated, and the lens vignetting state is determined to occur when the absolute value of the skewness coefficient is greater than the preset skewness coefficient threshold.
[0033] When the absolute value of the skewness coefficient is less than or equal to the preset skewness coefficient threshold, it is determined that no lens vignetting has occurred.
[0034] In this embodiment, the amplitude ratio is calculated by extracting all adjacent positive and negative difference pairs in the first-order difference sequence, i.e., a positive difference followed by a negative difference, or a negative difference followed by a positive difference, calculating the ratio of the absolute value of the positive difference to the absolute value of the negative difference in each pair, and then taking the median of all these ratios as the amplitude ratio.
[0035] In this embodiment, the process of calculating the absolute value of the skewness coefficient of the cumulative distribution function of the luminance variance ratio includes: firstly, collecting time series data of the luminance variance ratio within a predetermined time period in a preset state, obtaining a total of L sample values, calculating the arithmetic mean of these L values, then subtracting the average value from each sample value to obtain the corresponding difference, calculating the sum of the cubes of all differences and dividing by the number of samples L to obtain the third central moment, then calculating the sum of the squares of all differences and dividing by L to obtain the second central moment, taking the square root of the second central moment as the standard deviation, and finally dividing the third central moment by the cube of the standard deviation to obtain the skewness coefficient, and taking the absolute value of the skewness coefficient as the final result.
[0036] The preset fluctuation threshold is used to determine whether the amplitude ratio of the first difference sequence of the brightness variance ratio is sufficient to characterize the significant changes caused by lens vignetting. Its setting depends on the statistical distribution of the random fluctuation amplitude of the brightness variance ratio under normal lighting. It is usually set between 2.0 and 4.0 to exclude spurious fluctuations caused by minor noise or slight shaking. In this embodiment, it is set to 3.0, which can ensure that further analysis of vignetting determination is triggered only when the amplitude ratio exceeds three times the normal fluctuation level.
[0037] The preset number of stable cycles is the critical value used to determine whether the luminance variance ratio exhibits a unidirectional monotonic change rather than rapid oscillation within a predetermined time period under a preset state. Its setting depends on the number of frames required for the luminance variance ratio to deviate from the normal value to a stable state during the lens vignetting process, as well as the time scale of random environmental disturbances. It is usually set between 3 and 8 cycles to balance sensitivity and anti-interference capability. In this embodiment, it is set to 5 cycles, which can identify the monotonic drift feature of the luminance variance ratio alternating between positive and negative less than 5 times within 1 second, thereby accurately capturing the temporal evolution law of vignetting.
[0038] The preset skewness coefficient threshold is used to determine the lens vignetting state by the degree of asymmetry of the brightness variance ratio distribution when the fluctuation characteristics are not obvious. Its setting depends on the theoretical range of skewness when the brightness variance ratio is approximately normally distributed under uniform illumination and the typical amplitude of positive or negative skew introduced by vignetting. It is usually set between 0.5 and 1.2 to avoid misjudging slightly tilted distributions as vignetting. In this embodiment, it is set to 0.8, which can effectively identify the distribution skew caused by optical inhomogeneity when the first difference fluctuation characteristics of the brightness variance ratio are blurred, thereby improving the coverage and accuracy of vignetting judgment.
[0039] Lens vignetting causes a gradual decrease in image brightness from the center to the edges. This optical non-uniformity manifests in the temporal domain as a slow drift in the brightness variance ratio rather than rapid random fluctuations, and its distribution exhibits an asymmetrical skewed characteristic. Calculating the first-order difference sequence of the brightness variance ratio within a predetermined time period under a preset state and statistically analyzing the number of positive and negative alternations and the amplitude ratio can effectively distinguish between the unidirectional gradual change caused by vignetting and random oscillations caused by non-vignetting factors such as leaf movement. When the number of positive and negative alternations is lower than the preset stable number and the amplitude ratio is larger, it precisely reflects the monotonic change trend of the brightness variance ratio. For samples that do not conform to the above fluctuation characteristics, the skewness coefficient of the cumulative distribution function is further calculated. Under vignetting conditions, the distribution of the brightness variance ratio often deviates from normality and the tailing direction is consistent, resulting in a significant increase in the absolute value of the skewness coefficient. Therefore, by using the number of positive and negative alternations and the amplitude ratio in conjunction with the skewness coefficient for dual verification, the temporal drift characteristics of vignetting can be quickly captured while eliminating other interference factors, significantly improving the accuracy and robustness of lens vignetting state determination.
[0040] Specifically, the process of determining the vignetting compensation gain based on the threshold deviation of the brightness variance ratio to correct the motion blur length includes: Calculate the absolute value of the difference between the brightness variance ratio and the preset optical uniformity reference value to obtain the threshold deviation range; When the threshold deviation is less than a preset first deviation threshold, the vignetting compensation gain is set to a preset initial value; When the threshold deviation is between the preset first deviation threshold and the preset second deviation threshold, the vignetting compensation gain is calculated based on the preset linear interpolation formula, wherein the vignetting compensation gain = preset initial value + (preset maximum gain - preset initial value) × (threshold deviation - preset first deviation threshold) / (preset second deviation threshold - preset first deviation threshold). When the threshold deviation is greater than or equal to the preset second deviation threshold, the vignetting compensation gain is set to the preset maximum gain; The obtained trailing shadow length is multiplied by the vignetting compensation gain to obtain the corrected trailing shadow length.
[0041] The preset optical uniformity reference value is the expected value of the ratio of brightness variance between the center and edge of the image under ideal conditions without lens vignetting. Its setting depends on the optical design parameters of the camera lens and the factory calibration data. It is usually set between 0.8 and 1.2 to reflect the small deviations caused by the actual lens assembly tolerance. In this embodiment, it is set to 1.0, which can serve as a zero-point reference for measuring the severity of vignetting. The larger the deviation of the brightness variance ratio from this value, the stronger the optical non-uniformity.
[0042] The preset first deviation threshold is the minimum deviation that triggers the vignetting compensation gain to rise from the initial value. Its setting depends on the range of variance ratio changes corresponding to the brightness non-uniformity that can be perceived by the human eye and the sensor noise level. It is usually set between 0.05 and 0.15 to avoid unnecessary compensation for small fluctuations. In this embodiment, it is set to 0.1, which can activate the linear compensation interval when the brightness variance ratio deviates from the reference value by more than 10%.
[0043] The preset initial value is the vignetting compensation gain used when the threshold deviation is less than the first deviation threshold. The basis for this setting is that slight deviation can be regarded as fluctuation within the normal tolerance range of the lens and does not require additional compensation. Therefore, the gain should be kept at 1 to not change the original motion blur length. It is usually set between 0.95 and 1.05. In this embodiment, it is set to 1, which can ensure that the motion blur length is not subject to any gain correction when there is no vignetting or very little vignetting, thereby maintaining the original measurement value.
[0044] The preset second deviation threshold is the critical point at which the vignetting compensation gain reaches saturation and no longer increases with the deviation magnitude. Its setting depends on the optical attenuation limit under the maximum vignetting level of the lens and the risk that excessive compensation gain will amplify noise. It is usually set between 0.25 and 0.5 to ensure that even the most severe vignetting can be fully compensated. In this embodiment, it is set to 0.3, which can lock the compensation gain in severe vignetting scenes at the preset maximum gain value to avoid overcompensation.
[0045] The preset maximum gain is the upper limit of the vignetting compensation gain used when the threshold deviation reaches or exceeds the second deviation threshold. Its setting depends on the inverse of the illuminance attenuation in the worst case of the theoretical optical model and the maximum multiple by which the trailing length is underestimated in actual measurement. It is usually set between 1.2 and 1.8 to prevent excessive gain from introducing artifacts. In this embodiment, it is set to 1.5, which can restore the corrected trailing length to the true value level by multiplying by 1.5 when the illuminance loss at the lens edge is about 30%.
[0046] Lens vignetting reduces the brightness at the edges of the image, leading to an underestimation of the target edge's trailing shadow length in the edge region due to the gentler edge gradient under low contrast. This is addressed by quantifying the deviation of lens optical inhomogeneity using the brightness variance ratio. The difference between this ratio and a preset optical uniformity benchmark is used to obtain a threshold deviation. A larger deviation indicates more severe vignetting and greater edge illumination loss, requiring a higher compensation gain to recover the true trailing shadow length. A piecewise linear interpolation method is employed to determine the vignetting compensation gain, ensuring a smooth transition of compensation with the deviation without abrupt changes. This maintains the original trailing shadow measurement value under low vignetting while avoiding overcompensation that introduces new errors under high vignetting. Multiplying the original trailing shadow length by this compensation gain yields a corrected trailing shadow length, eliminating the interference of optical system inhomogeneities on motion blur assessment. This makes subsequent calculations of state intensity based on the trailing shadow length and adjustments to detection sensitivity and recognition thresholds more accurate and reliable. This threshold deviation-driven piecewise gain compensation mechanism effectively restores the true trailing shadow length of the target edge, improving the adaptive capability of moving target detection in low-light conditions.
[0047] Specifically, the process of obtaining the direction entropy value of motion vectors within the monitored scene, and combining it with a preset high entropy trigger threshold to determine the state type of low-light candidate scenes includes: Acquire images from the monitored scene, divide them into several grid blocks, calculate the direction angle of the motion vector within each grid block, and statistically analyze the histogram distribution of the direction angles of all grid blocks. Calculate the directional entropy value based on the histogram distribution; When the directional entropy value is greater than the preset high entropy trigger threshold, the state type of the low-light candidate scene is determined to be high dynamic aliasing type; When the directional entropy value is less than or equal to the preset high entropy trigger threshold, the state type of the low illumination candidate scene is determined to be low dynamic aliasing type.
[0048] In this embodiment, the current frame image is divided into 16 equal parts horizontally and 9 equal parts vertically, forming a total of 144 grid blocks. For each grid block, the Lucas-Kanade sparse optical flow method is used to extract the Shi-Tomasi corner points, and the motion vector direction angle of each corner point from the previous frame to the current frame is calculated. The direction angle ranges from 0 degrees to 360 degrees. The entire circumference is evenly divided into 36 intervals, each interval being 10 degrees. The direction angles of all corner points in all 144 grid blocks within each interval are statistically analyzed. The count of each interval is used to obtain a histogram distribution. Then, the count of each interval is divided by the total number of corner points to obtain the probability value corresponding to each interval. This probability sequence constitutes a normalized histogram distribution. Finally, the 36 probability values are substituted into the Shannon entropy formula, that is, each probability value is multiplied by its base-2 logarithm, the negative value is taken, and the sum is obtained. The result is the orientation entropy value of the image frame. Those skilled in the art only need to embed the above-mentioned standard algorithm modules for grid division, corner detection, optical flow calculation, histogram statistics, and logarithmic summation into the camera embedded system to obtain the orientation entropy value in real time.
[0049] The directional entropy value of a motion vector reflects the degree of disorder in the motion direction of various local areas within a monitored scene. A high entropy value indicates a disordered and random distribution of motion directions, corresponding to high-dynamic aliasing scenes such as falling rain or swaying branches. A low entropy value indicates highly consistent motion directions, corresponding to low-dynamic uniform scenes such as vehicles moving straight or people moving in a directional direction. By dividing the image into grid blocks and calculating the histogram distribution of direction angles, Shannon entropy can be calculated. This transforms the qualitative differences in motion patterns into quantifiable numerical indicators. Combined with a preset high entropy trigger threshold, low-light candidate scenes can be automatically classified into high-dynamic aliasing and low-dynamic aliasing types. This classification result provides crucial prior information for subsequent state intensity calculations, enabling the use of the product relationship between trailing length and signal-to-noise ratio in high-dynamic scenes and the difference relationship in low-dynamic scenes. This avoids erroneous adjustments caused by a single indicator failing to distinguish motion attributes. Accurate classification of motion patterns through directional entropy values improves the targeting and effectiveness of scene adaptation.
[0050] In this embodiment, the process of outputting the recognition result corresponding to the state type includes writing the determined high dynamic aliasing type or low dynamic aliasing type into the scene state variable in the system shared memory in a structured data format, and pushing the variable value to the real-time display module and log storage module of the monitoring platform through a serial communication interface or network protocol, so that the operator can view the motion mode classification label of the current scene on the client interface and use it for subsequent parameter adjustment module.
[0051] Specifically, based on the state type, the process of determining the state intensity of the state type according to the corrected trailing shadow length and the image signal-to-noise ratio includes: When the state type is the high dynamic range aliasing type, the ratio of the corrected trailing length to the preset trailing reference length is calculated, the ratio of the preset signal-to-noise ratio reference value to the image signal-to-noise ratio is calculated, and the product of the two ratios is calculated to obtain the state intensity. When the state type is the low dynamic aliasing type, the ratio of the corrected trailing length to the preset trailing reference length is calculated, the ratio of the image signal-to-noise ratio to the preset signal-to-noise ratio reference value is calculated, and the absolute value of the difference between the two ratios is calculated to obtain the state intensity.
[0052] The preset motion blur baseline length is the statistical average of the edge motion blur length when the camera captures a standard-sized target under ideal conditions without motion blur. Its setting depends on the default value of the camera's exposure time and the range of motion blur caused by the normal movement speed of the target in the frame. It is usually set between 1 pixel and 5 pixels to cover the physical characteristics of cameras with different resolutions. In this embodiment, it is set to 2.5 pixels, which can provide a normalized reference point for subsequent ratio calculations so that the degree to which the motion blur length deviates from the baseline value accurately reflects the severity of motion blur.
[0053] The preset signal-to-noise ratio (SNR) benchmark is the statistical average of the image SNR when the camera shoots a gray card under standard lighting conditions, such as 100 lux of illuminance. Its setting depends on the typical performance parameters of the sensor model and gain settings, and is usually set between 10 dB and 25 dB to characterize the noise level of a clear image. In this embodiment, it is set to 15 dB, which can serve as a benchmark to measure the degree of degradation in the current lighting quality. When the SNR is lower than this benchmark, it indicates that noise reduction needs to be enhanced or the detection parameters need to be adjusted.
[0054] For high-dynamic aliasing, the scene features chaotic motion directions accompanied by rain, snow, or irregular swaying of branches and leaves. In this case, the trail length is dominated by motion blur, while the image signal-to-noise ratio (SNR) is dominated by low-light noise. The coupling of these two factors degrades the target detection quality. Therefore, multiplying the ratio of the corrected trail length to the preset trail baseline length by the ratio of the preset SNR baseline value to the current image SNR, where both ratios are greater than 1, results in a sharp increase in state intensity. This accurately reflects the nonlinear superposition effect of detection difficulty under high-dynamic low-light conditions. For low-dynamic aliasing, the scene features concentrated motion directions and clear target motion patterns. The excessively long trail length is mainly caused by excessively fast target speed, while the low image SNR is mainly caused by insufficient lighting. The contributions of these two factors to detection failure are relatively independent and mutually exclusive. Since there is a possibility of mutual cancellation, the absolute value of the difference between the ratio of the corrected trailing length to the preset trailing baseline length and the ratio of the image signal-to-noise ratio to the preset signal-to-noise ratio baseline value is calculated. The larger the difference, the more severe the imbalance between the two, that is, the one with excessively long trailing or excessively strong noise dominates the detection failure, thereby guiding the system to more specifically reduce the detection sensitivity or increase the recognition threshold. By distinguishing between high dynamic and low dynamic state types and using different state intensity calculation formulas, a refined model of the interaction between motion blur and low-light noise is achieved, making the subsequent sensitivity and threshold adjustments more in line with the physical mechanism of the actual scene. The state intensity is constructed by using the product of the ratio of trailing length and signal-to-noise ratio or the absolute value of the difference, which significantly improves the accuracy and robustness of scene adaptive recognition.
[0055] Specifically, the process of reducing the preset detection sensitivity and / or increasing the preset recognition threshold based on the state intensity includes: When the state intensity is greater than a preset first intensity threshold, the preset detection sensitivity is reduced by a preset first percentage, while the preset recognition threshold is increased by a preset second percentage. When the state intensity is between a preset first intensity threshold and a preset second intensity threshold, the preset detection sensitivity is reduced by a preset third percentage only. When the state intensity is less than a preset second intensity threshold, the preset identification threshold is increased by a preset fourth percentage.
[0056] The preset first intensity threshold is the upper boundary value that distinguishes between the three intervals of high, medium and low intensity. Its setting depends on the critical statistical value of motion blur and noise jointly deteriorating the detection performance in a large number of low-light monitoring samples. That is, when the intensity exceeds the threshold, the false alarm rate and the false alarm rate both rise sharply, and two parameters need to be adjusted at the same time. It is usually set between 2.0 and 4.0 to cover the dynamic range of cameras with different resolutions. In this embodiment, it is set to 3.0, which can trigger the joint adjustment of detection sensitivity and recognition threshold when the intensity reaches three times the baseline level, so as to cope with extreme and harsh scenarios.
[0057] The preset second intensity threshold is the lower boundary value that distinguishes between the medium and low intensity ranges of the state. Its setting depends on the critical statistical value in a large number of low-light monitoring samples where the false alarm rate increases significantly due to the decrease in signal-to-noise ratio alone, but motion blur has not yet had a significant impact. That is, when the state intensity is lower than this threshold, only the recognition threshold needs to be increased without reducing the detection sensitivity. It is usually set between 0.8 and 1.5 to ensure coverage of the range where the signal-to-noise ratio decreases slightly to a moderate level. In this embodiment, it is set to 1.2, which can determine that motion blur is dominant when the state intensity is higher than 1.2 and lower than 3.0 and only reduce the detection sensitivity. When the state intensity is lower than 1.2, it can determine that the decrease in signal-to-noise ratio is the main problem and only increase the recognition threshold, thereby achieving precise partitioning of the adjustment strategy.
[0058] The preset first percentage is the preset reduction in detection sensitivity. Its setting depends on the statistical value of the proportion of false motion triggers caused by motion blur in high dynamic low light scenes. Excessive reduction will miss real targets, while insufficient reduction will fail to suppress false alarms. It is usually set between 20% and 50% to ensure sufficient suppression effect without losing slow targets. In this embodiment, it is set to 30%, which can reduce the detection threshold by 30% when the ghosting is severe, effectively filtering interference such as tree branch swaying while retaining effective motion such as people walking.
[0059] The preset second percentage is the amount by which the preset recognition threshold is increased when the state intensity is greater than the preset first intensity threshold. Its setting depends on the boundary point between the gradient magnitude distribution of noise edges and the gradient magnitude distribution of real target edges in low signal-to-noise ratio images. That is, after increasing this percentage, noise points are eliminated while the real contour can still be preserved. It is usually set between 15% and 40% to avoid over-filtering and missed detection. In this embodiment, it is set to 25%, which can increase the recognition threshold by one-quarter when the signal-to-noise ratio drops significantly, so that false edges generated by noise are no longer mistaken for target contours.
[0060] The preset third percentage is the amount by which the preset detection sensitivity is reduced when the state intensity is between the preset first intensity threshold and the preset second intensity threshold. Its setting depends on the statistical value of the increase in false motion triggers when motion blur is dominant and the signal-to-noise ratio is still acceptable. At this time, there is no need to adjust the recognition threshold, so the reduction is slightly less than the first percentage to avoid missing slow targets. It is usually set between 10% and 30%. In this embodiment, it is set to 20%, which can reduce the detection sensitivity by 20% when the trailing shadow is moderately lengthened, effectively suppressing false triggers caused by motion blur without affecting normal target detection.
[0061] The preset fourth percentage is the amount by which the preset recognition threshold is increased when the state intensity is less than the preset second intensity threshold. Its setting depends on the ratio of the gradient intensity of the noise edge to the real target edge when the signal-to-noise ratio drop is the main problem and the motion blur is slight. That is, after increasing this percentage, the noise is filtered out while the real edge can still pass the recognition threshold. It is usually set between 10% and 30% to avoid the real target being missed. In this embodiment, it is set to 15%, which can effectively eliminate dark light noise by 15% in low-light but clear motion scenes while ensuring the complete extraction of slow target contours.
[0062] State intensity comprehensively reflects the degree of interference of motion blur and noise superposition on target detection under low illumination. Its value is calculated by the trailing shadow length and signal-to-noise ratio using a formula adapted to state type. When the state intensity is greater than a preset first intensity threshold, it indicates that both motion blur and noise are very severe, and both jointly dominate detection failure. Therefore, the detection sensitivity is reduced to suppress false motion triggering, and the recognition threshold is increased to reduce false detections. These two adjustments are performed in parallel to keep the system stable under harsh conditions. When the state intensity is between the preset first intensity threshold and the preset second intensity threshold, motion blur is dominant while the signal-to-noise ratio is still acceptable. In this case, only the detection sensitivity is reduced to reduce missed detections of trailing targets, while the recognition threshold remains unchanged to avoid over-filtering real targets. When the state intensity is less than the preset second intensity threshold, the decrease in signal-to-noise ratio is the main problem, while motion blur is slight. In this case, only the recognition threshold is increased to filter false edges caused by noise, while the detection sensitivity remains unchanged to maintain the responsiveness to stationary targets. This segmented adjustment mechanism assigns differentiated weights to motion blur and low-light noise based on the different intervals of state intensity, ensuring that the adjustment strategies for detection sensitivity and recognition threshold match the main interference sources in the current scene, thus avoiding performance loss caused by blindly adjusting both parameters simultaneously. This embodiment achieves refined adaptive control of the monitoring system under different degradation conditions through state intensity-driven segmented parameter adjustment, effectively reducing false alarm and false negative rates.
[0063] Specifically, the process of adjusting the preset background update rate based on the brightness variance ratio and the ghost length within the preset determination period includes: Within the preset determination period, calculate the variance of the time series of the brightness variance ratio and the average value of the trailing shadow length; When the variance value is greater than a preset variance threshold and the average value of the trailing shadow length is less than a preset trailing shadow threshold, the preset background update rate is increased based on the preset first step length. When the variance value is less than or equal to the preset variance threshold and the average value of the trailing length is greater than or equal to the preset trailing threshold, the preset background update rate is reduced based on a preset second step size; Otherwise, maintain the current preset background update rate.
[0064] The preset variance threshold is used to determine whether the fluctuation of the brightness variance ratio over time has reached a critical value that requires accelerated background updates. Its setting depends on the upper limit of the statistical variance of the optical uniformity fluctuation caused by the slow change in illumination under normal monitoring scenarios. That is, exceeding this threshold indicates that the ambient illumination or lens status has changed significantly and rapidly, requiring the background model to respond quickly. It is usually set between 0.01 and 0.05 to cover the optical dynamic range of different scenarios. In this embodiment, it is set to 0.02, which can determine that the optical environment has changed drastically when the brightness variance ratio fluctuation variance exceeds 0.02, thereby triggering an increase in the background update rate.
[0065] The preset motion blur threshold is a critical value used to determine whether the severity of motion blur in the image has reached the point where background updates need to be slowed down. Its setting depends on the statistical upper limit of the edge motion blur length of a slow-moving target within the normal exposure time. That is, when the average motion blur length exceeds this threshold, the moving target is easily mistakenly absorbed into the background model, requiring a reduction in the update rate. It is usually set between 2 and 6 pixels to adapt to the physical characteristics of cameras with different resolutions. In this embodiment, it is set to 4 pixels, which can determine that the motion blur is severe when the average motion blur length exceeds 4 pixels, thereby triggering a reduction in the background update rate.
[0066] The preset first step length is the magnitude of the preset background update rate. Its setting depends on the balance between the speed at which the background model needs to catch up with the real background under rapid changes in the optical environment and the avoidance of introducing motion noise. It is usually set between 5% and 20% to ensure a fast enough response speed without making the model too sensitive. In this embodiment, it is set to 10%, which can increase the background update rate by 10% when the illumination changes abruptly, so that the background model can complete the update within one second without producing false foreground.
[0067] The preset second step length is the magnitude of the reduction in the preset background update rate. Its setting depends on the minimum update rate reduction required to prevent moving targets from being incorrectly learned into the background model under severe motion blur conditions. It is usually set between 10% and 30% to effectively suppress motion blur absorption without making the background model too rigid. In this embodiment, it is set to 15%, which can reduce the background update rate by 15% when motion blur is significant, so that slow pedestrians will not blend into the background within five seconds, thereby maintaining the stability of foreground detection.
[0068] The time-series variance of the luminance variance ratio reflects the degree of fluctuation in the optical uniformity of the image. A larger variance value indicates a faster change in ambient lighting or lens conditions. The average motion blur length reflects the overall level of motion blur in the image; a smaller average value indicates that moving targets are clear and there is no severe motion blur. When the variance of the luminance variance ratio is greater than a preset variance threshold and the average motion blur length is less than a preset motion blur threshold, it indicates that the optical environment is changing rapidly, but moving targets are still clearly identifiable. In this case, increasing the preset background update rate allows the background model to quickly follow the optical changes and avoid false foregrounds. At the same time, a faster update rate will not cause motion blur due to motion blur. The background absorbs erroneous images due to shadows. When the variance of the brightness variance ratio is less than or equal to the preset variance threshold and the average length of the shadow is greater than or equal to the preset shadow threshold, it indicates that the optical environment is relatively stable but motion blur is severe. In this case, reducing the preset background update rate can suppress the shadow target from being incorrectly learned into the background model and prevent slow-moving objects from blending into the background and causing missed detection. By jointly determining the adjustment direction of the background update rate by the fluctuation of the brightness variance ratio and the severity of the shadow length, the background model can not only respond quickly to changes in the real environment, but also resist the interference of motion blur, which significantly improves the accuracy of foreground segmentation in complex monitoring scenarios.
[0069] Specifically, the process of adjusting the preset low-light threshold based on the timestamp of the low-light candidate scene within the preset correction period, the timestamp of adjusting the preset background update rate, and the image signal-to-noise ratio includes: Within the preset correction period, all low-light candidate scene determination events and all events that adjust the preset background update rate are counted to obtain the total number of events K; for the timestamp of the i-th event and the time difference Δti between the current time, and the corresponding image signal-to-noise ratio Si; The weighted average signal-to-noise ratio Sw is calculated based on the time difference of each event and the preset time decay constant τ. ; Divide the weighted average signal-to-noise ratio by the preset reference signal-to-noise ratio to obtain the ratio coefficient, and calculate the product of the preset low-light threshold and the ratio coefficient to adjust the preset low-light threshold, and limit the adjusted preset low-light threshold between the preset adjustment threshold lower limit and the preset adjustment threshold upper limit.
[0070] The preset time decay constant depends on the typical cycle of ambient light changes and the requirements of the monitoring system for the response speed to sudden changes in light. That is, the smaller the constant, the greater the weight of recent data and the more sensitive the threshold adjustment, while the larger the constant, the more smoothly the historical data affects the threshold change. It is usually set between 1 hour and 12 hours. In this embodiment, it is set to 6 hours, which can reduce the signal-to-noise ratio weight of 6 hours ago within the half-day correction cycle to about 37%, filter the instantaneous light fluctuations caused by brief clouds, and respond in a timely manner to the light decrease trend from dusk to night.
[0071] The preset reference signal-to-noise ratio depends on the long-term average signal-to-noise ratio of the camera when shooting a typical scene under standard daytime lighting conditions. This value serves as a proportional reference point for threshold adjustment, increasing the low-light threshold when the weighted average signal-to-noise ratio is higher than the reference signal-to-noise ratio and decreasing it when it is lower. It is usually set between 10 and 20 dB. In this embodiment, it is set to 15 dB, which ensures that when the weighted average signal-to-noise ratio is about 15 dB during normal daytime, the ratio coefficient is close to 1, thus keeping the low-light threshold unchanged. At dusk, when the weighted average signal-to-noise ratio drops to 10 dB, the ratio coefficient is about 0.67, causing the low-light threshold to be lowered by about one-third.
[0072] The preset adjustment threshold depends on the lowest signal-to-noise ratio threshold that the camera sensor can still extract effective target features under extremely dark conditions. If it is lower than this threshold, the low-light candidate scene will be over-triggered and the system will remain in a high-sensitivity adjustment state, which will reduce the detection stability. It is usually set between 1.0 and 1.8. In this embodiment, it is set to 1.5, which can ensure that the low-light threshold is not lower than 1.5 so that only scenes with an image signal-to-noise ratio lower than 1.5 will enter the low-light candidate scene, effectively preventing invalid calculations under completely black scenes.
[0073] The preset adjustment threshold upper limit depends on the threshold boundary at which the camera can still sensitively identify the decrease in low light when the signal-to-noise ratio is extremely high under strong light conditions. That is, if it is higher than the upper limit, the system will be too insensitive to slight decreases in illumination under normal lighting conditions and will miss low light scenes. It is usually set between 2.5 and 4.0. In this embodiment, it is set to 3.5, which can ensure that the low light threshold does not exceed 3.5. This ensures that scenes with an image signal-to-noise ratio higher than 3.5 will not be misjudged as low light candidate scenes even at dusk, avoiding unnecessary adjustments due to cloud cover during the day.
[0074] Long-term changes in ambient light simultaneously affect both the image signal-to-noise ratio (SNR) and the trigger frequency of low-light candidate scenes. Furthermore, adjustments to the background update rate occur precisely at moments of significant optical environmental change. Therefore, the timestamps of these two types of events naturally carry historical information about the evolution of illumination. The closer an event is to the present moment, the higher its SNR data's guiding value for current threshold correction. The exponential decay function precisely assigns decreasing weights according to time proximity, ensuring that the weighted SNR mean accurately reflects recent average illumination levels. Multiplying the ratio of this mean to the reference SNR by the current low-light threshold achieves adaptive threshold scaling: when the recent SNR is low, the ratio is less than 1, and the low-light threshold is automatically lowered to relax the low-light judgment criteria; conversely, the threshold is raised to tighten the judgment. Combined with upper and lower limit constraints to prevent threshold runaway, the entire mechanism allows the low-light threshold to automatically converge to the optimal value with the day-night cycle and weather changes, significantly enhancing the monitoring system's scene adaptability under different time periods and climatic conditions.
[0075] Please see Figure 4As shown, this is a schematic diagram of the scene adaptive recognition system for security monitoring in this embodiment. Furthermore, this embodiment also provides a scene adaptive recognition system for security monitoring, including: The acquisition module is used to acquire in real time the image signal-to-noise ratio, brightness variance ratio and target edge trailing length in the monitored scene during the monitoring process based on the preset detection sensitivity. The target edge is determined based on the preset recognition threshold, and the monitoring process is updated with the preset background update rate. The candidate determination module, which is connected to the acquisition module, is used to determine whether the monitoring scene is a low-light candidate scene based on the comparison result of the image signal-to-noise ratio and the preset low-light threshold. The state determination module is connected to the candidate determination module and the acquisition module respectively. It is used to determine whether lens vignetting occurs based on the determination result that the monitoring scene is the low-light candidate scene and the brightness variance ratio within the preset state determination time. The correction module, which is connected to the state determination module and the acquisition module respectively, is used to determine the vignetting compensation gain based on the determination result of the occurrence of lens vignetting state and the threshold deviation of the brightness variance ratio, so as to correct the motion blur length. The type determination module, which is connected to the candidate determination module, is used to obtain the direction entropy value of the motion vector in the monitored scene, and combine it with the preset high entropy trigger threshold to determine the state type of the low-light candidate scene, and output the corresponding recognition result. An intensity determination module, which is connected to the correction module and the type determination module respectively, is used to determine the state intensity of the state type based on the state type, according to the corrected trailing length and the image signal-to-noise ratio. The first adjustment module is connected to the intensity determination module and is used to reduce the preset detection sensitivity and / or increase the preset recognition threshold based on the state intensity. The second adjustment module is connected to the candidate determination module and the acquisition module respectively, and is used to adjust the preset background update rate based on the determination result that the monitored scene is not the low illumination candidate scene, according to the brightness variance ratio and the shadow length within the preset determination period. A threshold adjustment module, which is connected to the second adjustment module, the acquisition module and the candidate determination module respectively, is used to adjust the preset low-light threshold based on the timestamp of the low-light candidate scene within the preset correction period, the timestamp of the preset background update rate and the image signal-to-noise ratio.
[0076] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A scene adaptive recognition method for security monitoring, characterized in that, include: The system acquires the image signal-to-noise ratio, brightness variance ratio, and target edge trailing length in the monitored scene in real time during the monitoring process based on a preset detection sensitivity. The target edge is determined based on a preset recognition threshold, and the monitoring process is updated with a preset background update rate. Based on the comparison result between the image signal-to-noise ratio and the preset low-light threshold, it is determined whether the monitored scene is a candidate scene for low-light conditions. Based on the judgment result of the monitoring scene being the low-light candidate scene, the brightness variance ratio within the preset state is used to determine whether lens vignetting occurs. Based on the determination of lens vignetting, the vignetting compensation gain is determined according to the threshold deviation of the brightness variance ratio in order to correct the motion blur length. The direction entropy value of the motion vector in the monitored scene is obtained, and combined with the preset high entropy trigger threshold, the state type of the low-light candidate scene is determined, and the corresponding recognition result is output. Based on the state type, the state strength of the state type is determined according to the corrected trailing length and the image signal-to-noise ratio; Based on the state intensity, the preset detection sensitivity is reduced and / or the preset recognition threshold is increased; Based on the determination that the monitored scene is not the low-light candidate scene, the preset background update rate is adjusted according to the brightness variance ratio and the shadow length within the preset determination period; The preset low-light threshold is adjusted based on the timestamp of the low-light candidate scene within the preset correction period, the timestamp of the preset background update rate, and the image signal-to-noise ratio.
2. The scene adaptive recognition method for security monitoring according to claim 1, characterized in that, The process of determining whether a monitored scene is a candidate low-light scene based on the comparison result of the image signal-to-noise ratio and the preset low-light threshold includes: When the image signal-to-noise ratio is less than a preset low-light threshold, the monitored scene is determined to be a low-light candidate scene.
3. The scene adaptive recognition method for security monitoring according to claim 2, characterized in that, The process of determining whether lens vignetting occurs based on the brightness variance ratio within a preset time period includes: Calculate the first-order difference sequence of the brightness variance ratio within the preset state determination time period, and count the number of positive and negative alternations and the amplitude ratio in the first-order difference sequence; When the amplitude ratio is greater than a preset fluctuation threshold and the number of positive and negative alternations is less than a preset stable number, the lens vignetting state is determined to have occurred. Otherwise, the absolute value of the skewness coefficient of the cumulative distribution function of the brightness variance ratio is calculated, and the lens vignetting state is determined to occur when the absolute value of the skewness coefficient is greater than the preset skewness coefficient threshold.
4. The scene adaptive recognition method for security monitoring according to claim 3, characterized in that, The process of determining the vignetting compensation gain based on the threshold deviation of the brightness variance ratio to correct the motion blur length includes: Calculate the absolute value of the difference between the brightness variance ratio and the preset optical uniformity reference value to obtain the threshold deviation range; When the threshold deviation is less than a preset first deviation threshold, the vignetting compensation gain is set to a preset initial value; When the threshold deviation is between the preset first deviation threshold and the preset second deviation threshold, the vignetting compensation gain is calculated based on a preset linear interpolation formula; When the threshold deviation is greater than or equal to the preset second deviation threshold, the vignetting compensation gain is set to the preset maximum gain; The obtained trailing shadow length is multiplied by the vignetting compensation gain to obtain the corrected trailing shadow length.
5. The scene adaptive recognition method for security monitoring according to claim 4, characterized in that, The process of obtaining the direction entropy value of motion vectors within the monitored scene, and combining it with a preset high entropy trigger threshold to determine the state type of low-light candidate scenes includes: Acquire images from the monitored scene, divide them into several grid blocks, calculate the direction angle of the motion vectors within each grid block, and statistically analyze the histogram distribution of the direction angles of all grid blocks. Calculate the directional entropy value based on the histogram distribution; When the directional entropy value is greater than the preset high entropy trigger threshold, the state type of the low-light candidate scene is determined to be high dynamic aliasing type; When the directional entropy value is less than or equal to the preset high entropy trigger threshold, the state type of the low illumination candidate scene is determined to be low dynamic aliasing type.
6. The scene adaptive recognition method for security monitoring according to claim 5, characterized in that, Based on the state type, the process of determining the state intensity of the state type according to the corrected trailing length and the image signal-to-noise ratio includes: When the state type is the high dynamic range aliasing type, the ratio of the corrected trailing length to the preset trailing reference length is calculated, the ratio of the preset signal-to-noise ratio reference value to the image signal-to-noise ratio is calculated, and the product of the two ratios is calculated to obtain the state intensity. When the state type is the low dynamic aliasing type, the ratio of the corrected trailing length to the preset trailing reference length is calculated, the ratio of the image signal-to-noise ratio to the preset signal-to-noise ratio reference value is calculated, and the absolute value of the difference between the two ratios is calculated to obtain the state intensity.
7. The scene adaptive recognition method for security monitoring according to claim 6, characterized in that, The process of reducing the preset detection sensitivity and / or increasing the preset recognition threshold based on the state intensity includes: When the state intensity is greater than a preset first intensity threshold, the preset detection sensitivity is reduced by a preset first percentage, while the preset recognition threshold is increased by a preset second percentage. When the state intensity is between a preset first intensity threshold and a preset second intensity threshold, the preset detection sensitivity is reduced by a preset third percentage only. When the state intensity is less than a preset second intensity threshold, the preset identification threshold is increased by a preset fourth percentage.
8. The scene adaptive recognition method for security monitoring according to claim 7, characterized in that, The process of adjusting the preset background update rate based on the brightness variance ratio and the ghost length within a preset judgment period includes: Within the preset determination period, calculate the variance of the time series of the brightness variance ratio and the average value of the trailing shadow length; When the variance value is greater than a preset variance threshold and the average value of the trailing shadow length is less than a preset trailing shadow threshold, the preset background update rate is increased based on the preset first step length. When the variance value is less than or equal to the preset variance threshold and the average value of the trailing shadow length is greater than or equal to the preset trailing shadow threshold, the preset background update rate is reduced based on the preset second step size.
9. The scene adaptive recognition method for security monitoring according to claim 8, characterized in that, The process of adjusting the preset low-light threshold based on the timestamps of low-light candidate scenes within a preset correction period, the timestamp of adjusting the preset background update rate, and the image signal-to-noise ratio includes: Within the preset correction period, all low-light candidate scene determination events and all events that adjust the preset background update rate are counted to obtain the total number of events; the time difference between each timestamp and the current time, and the corresponding image signal-to-noise ratio are also calculated. The weighted average signal-to-noise ratio is calculated based on the time difference of each event and the preset time decay constant. Divide the weighted average signal-to-noise ratio by the preset reference signal-to-noise ratio to obtain the ratio coefficient, and calculate the product of the preset low-light threshold and the ratio coefficient to adjust the preset low-light threshold, and limit the adjusted preset low-light threshold between the preset adjustment threshold lower limit and the preset adjustment threshold upper limit.
10. A scene adaptive recognition system for security monitoring, constructed based on the scene adaptive recognition method for security monitoring according to any one of claims 1-9, characterized in that, include: The acquisition module is used to acquire in real time the image signal-to-noise ratio, brightness variance ratio and target edge trailing length in the monitored scene during the monitoring process based on the preset detection sensitivity. The target edge is determined based on the preset recognition threshold, and the monitoring process is updated with the preset background update rate. The candidate determination module is used to determine whether the monitoring scene is a low-light candidate scene based on the comparison result between the image signal-to-noise ratio and the preset low-light threshold. The state determination module is used to determine whether lens vignetting occurs based on the determination result that the monitoring scene is the low-light candidate scene and the brightness variance ratio within the preset state determination time. The correction module is used to determine the vignetting compensation gain based on the threshold deviation of the brightness variance ratio, based on the determination result of the occurrence of lens vignetting, so as to correct the motion blur length. The type determination module is used to obtain the direction entropy value of the motion vector in the monitored scene, and combine it with the preset high entropy trigger threshold to determine the state type of the low-light candidate scene, and output the corresponding recognition result. An intensity determination module is used to determine the state intensity of the state type based on the state type, the corrected trailing length, and the image signal-to-noise ratio. The first adjustment module is used to reduce the preset detection sensitivity and / or increase the preset recognition threshold based on the state intensity. The second adjustment module is used to adjust the preset background update rate based on the determination result that the monitoring scene is not the low-light candidate scene, according to the brightness variance ratio and the shadow length within the preset determination period. The threshold adjustment module is used to adjust the preset low-light threshold based on the timestamp of the low-light candidate scene within the preset correction period, the timestamp of the preset background update rate, and the image signal-to-noise ratio.
Citation Information
Patent Citations
Abnormal behavior detection method based on histogram combined entropy of monitoring video
CN112380905A