A method for adaptive dimming of dynamic infrared field range interference
By identifying dynamic interference regions through pixel-by-pixel differential and clustering algorithms, constructing a decision tree model, and employing multi-parameter collaborative interpolation and inertial compensation mechanisms, the problem of insufficient flexibility in dimming strategies in existing technologies is solved, and the image quality stability and adaptability of infrared imaging technology under complex interference are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 南京海汇装备科技有限公司
- Filing Date
- 2025-07-09
- Publication Date
- 2026-05-12
Smart Images

Figure CN120730149B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of adaptive dimming technology, specifically a method for adaptive dimming in response to dynamic interference in the infrared field of view. Background Technology
[0002] Infrared imaging technology, with its unique advantages, has been widely used in many fields such as security monitoring, industrial production, and medical testing. In security monitoring scenarios, it can accurately capture the movement of people and objects at night or under poor lighting conditions; in industrial production, it can be used to detect abnormal heating of equipment and prevent malfunctions.
[0003] Existing technologies mostly employ simple global thresholding methods to detect dynamic interference, relying solely on overall image brightness changes and failing to accurately identify subtle interference in localized areas. Faced with complex and ever-changing dynamic interference, existing dimming strategies lack specificity, typically using fixed dimming parameters such as fixed exposure time and gain values, unable to flexibly adjust based on the area, duration, and frequency of interference. When the interference situation changes and a dimming strategy needs to be switched, existing technologies often directly switch parameters without considering the impact of the strategy switching process on image quality. Summary of the Invention
[0004] The purpose of this invention is to provide a method for adaptive dimming of dynamic interference in the infrared field of view, so as to solve the problems raised in the prior art.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] In a first aspect, the present invention provides a method for adaptive dimming of dynamic interference in the infrared field of view, comprising the following steps:
[0007] Infrared detectors are used to acquire multiple consecutive frames of infrared image data. Pixel-by-pixel difference operations are performed on two adjacent frames to obtain a difference image. When the grayscale value of a pixel in the difference image changes beyond a set threshold, it is determined that there is dynamic interference in the area where that pixel is located.
[0008] Based on the distribution of dynamic interference points, a clustering algorithm is used to divide the interference points into different interference regions. Each interference region represents a relatively concentrated part of dynamic interference. The duration of each interference region is calculated, and the frequency of each interference region occurring within the duration is counted.
[0009] Collect sample data containing dynamic interference during infrared imaging, extract the area, duration, and frequency of each interference region within the duration, and combine them as input feature combination. Use the corresponding dimming strategy as the output label to construct a decision tree model. Divide the sample data into training set and test set, train the decision tree model, and obtain the dimming strategy of the input feature combination.
[0010] Matching is performed based on the current input feature combination to obtain the corresponding dimming strategy and execute it; when the area of the interference region changes and falls from one input feature combination to another, an overlapping buffer is set at the decision boundary of the input feature combination; multi-parameter collaborative interpolation is performed to realize the strategy mixing transition, an inertial compensation mechanism is executed, and dimming strategy adaptive switching is performed.
[0011] In conjunction with the first aspect, in a first embodiment of the first aspect of this application, the step of using an infrared detector to acquire multiple consecutive frames of infrared image data, and performing pixel-by-pixel difference operations on adjacent frames to obtain a difference image, includes:
[0012] The parameters of the infrared detector are initialized, the continuous acquisition mode is selected, and the acquisition frame rate is set. The continuously acquired infrared image data is stored sequentially in the memory buffer. Two adjacent frames of image data are read from the memory buffer in sequence, and image format conversion and preprocessing are performed. For the preprocessed two adjacent frames of image data, they are compared one by one according to the pixel position. For each pixel, the difference in gray value between the two frames is calculated. By iterating through all the pixels in the image, the pixel-by-pixel difference operation of the infrared image data is completed to obtain the difference image.
[0013] In conjunction with the first aspect, in the second embodiment of the first aspect of this application, the step of dividing the dynamic interference points into different interference regions using a clustering algorithm based on the distribution of the dynamic interference points, where each interference region represents a relatively concentrated dynamic interference component, includes:
[0014] The clustering algorithm uses the K-Means algorithm. The K value is set according to the number of interference regions with the highest frequency in historical data. The sum of squared errors within the cluster (WCSS) is calculated under different K values, and the curve of WCSS changing with K is plotted. When the curve has an inflection point, the corresponding K value is the optimal solution. K points are randomly selected from all dynamic interference points as initial cluster centers. For each dynamic interference point, the Euclidean distance from it to each cluster center is calculated, and each dynamic interference point is assigned to the cluster containing the nearest cluster center.
[0015] The average coordinates of all dynamic interference points in each cluster are taken to obtain a new cluster center, and the coordinates of the new cluster center are used to replace the old cluster center. The sum of the Euclidean distances between the new and old cluster centers is calculated. When the sum of the Euclidean distances is less than a set threshold or the maximum number of iterations is reached, the iteration is stopped. On the difference image, the interference region of each cluster is marked with different colors. The clustering result is saved as a mask matrix of the same size as the difference image, where each pixel value represents the cluster number to which it belongs.
[0016] In conjunction with the first aspect, in the third embodiment of the first aspect of this application, the step of calculating the duration of each interference region and statistically analyzing the frequency of occurrence of each interference region within the duration includes:
[0017] When a new interference region is detected for the first time, the timestamp of the current frame of the differential image is recorded as the start time. For an existing interference region, when the region is not detected in w consecutive frames, the timestamp of the current frame is recorded as the end time, where w is a positive integer set by the user. The duration of a single instance is obtained by subtracting the start time from the end time. When the same interference region appears in multiple time periods, the durations of each instance are summed to obtain the total duration. A fixed-length time window is set, and the number of occurrences of each interference region within the window is counted. The frequency of each interference within the duration is counted in units of interference events.
[0018] In conjunction with the first aspect, in the fourth embodiment of the first aspect of this application, the step of collecting sample data containing dynamic interference during infrared imaging, extracting the area of the interference region, the duration, and the frequency of occurrence of each interference region within the duration, combining them as input feature combinations, and using the corresponding dimming strategy as the output label to construct a decision tree model includes:
[0019] Collect sample data containing dynamic interference during infrared imaging, count the number of pixels contained in the data, and convert it into the area of the interference region based on the resolution of the infrared detector and the imaging distance. Combine the area of the interference region, the duration, and the frequency of each interference region within the duration into a three-dimensional vector, which serves as the input feature combination for the sample. Based on actual application requirements and experience, divide the dimming strategies into different categories, and assign a corresponding dimming strategy label to each sample data.
[0020] The CART algorithm is used as the decision tree model for model initialization.
[0021] In conjunction with the first aspect, in the fifth embodiment of the first aspect of this application, the step of dividing the sample data into a training set and a test set, training a decision tree model, and obtaining a dimming strategy based on the input feature combination includes:
[0022] The sample data is divided into training and test sets using random sampling. The input feature combinations in the training set are matched with the corresponding output labels as input for model training. The CART algorithm recursively divides the training data, selects the optimal features and split points, and constructs a decision tree. At each internal node, the training set is divided into two subsets based on the value of a certain feature. The recursion stops when the tree reaches its maximum depth or the number of samples contained in each leaf node is less than a set minimum value. The model is evaluated and optimized by inputting the area, duration, and frequency of each interference region obtained in the actual application into the optimized decision tree model to obtain the corresponding dimming strategy.
[0023] In conjunction with the first aspect, in the sixth embodiment of the first aspect of this application, the step of performing a matching search based on the current input feature combination to obtain and execute a corresponding dimming strategy includes:
[0024] Based on the current input feature combination, starting from the root node of the decision tree, the feature judgment condition of the current node is obtained. The left or right subtree is traversed according to the feature value of the feature combination until the leaf node is reached. The dimming strategy code corresponding to the leaf node is obtained, the dimming strategy parameters are extracted, and the control command is sent to the driver module of the infrared detector through the serial port to execute the dimming strategy.
[0025] In conjunction with the first aspect, in the seventh embodiment of the first aspect of this application, the step of setting an overlap buffer at the decision boundary of the input feature combination when the area of the interference region changes and falls from one input feature combination to another includes:
[0026] Based on the distribution pattern of historical input feature combinations, a multidimensional decision boundary is constructed, with each dimming strategy corresponding to an input feature combination region. A spatiotemporal overlap buffer is set at the boundary of adjacent dimming strategy regions. The range of the spatiotemporal overlap buffer is dynamically adjusted according to the spatiotemporal correlation of the interference region. The method is as follows: in the time dimension, the vertical expansion coefficient of the buffer is set based on the duration, and in the spatial dimension, the horizontal width of the buffer is determined based on the gradient of the change in the area of the interference region.
[0027] The threshold parameters of the boundaries of adjacent dimming strategy regions are updated in real time using a sliding window statistical method. When new interference is detected, the coverage of the buffer is expanded through online learning. Normalized distance calculation is performed on the feature points in the buffer to define the relative positional relationship between the current input feature combination and the boundaries of adjacent dimming strategy regions.
[0028] In conjunction with the first aspect, in the eighth embodiment of the first aspect of this application, the implementation of multi-parameter collaborative interpolation to achieve a hybrid transition strategy includes:
[0029] The activation weights of the old and new dimming strategies are calculated based on Gaussian membership functions as follows: When the input feature combination enters the overlap buffer, a continuously changing weight coefficient is generated based on the normalized distance between it and the boundary of the old and new dimming strategy regions; the weight coefficient is dynamically related to the rate of change of the area of the interference region, and the faster the rate of change, the greater the slope of the weight coefficient transition; the gain parameters of the old and new dimming strategies are mixed using linear interpolation, and the weight coefficient is applied to the arithmetic mean, which is the result of a weighted average calculation based on the weight coefficient;
[0030] Interpolation calculations are performed in the logarithmic domain to ensure the physical continuity of exposure time. The logarithmic domain is the mathematical space after converting physical quantities to a logarithmic scale. Combining the direction of the interference motion vector, a direction-weighted interpolation method is used to prioritize the enhancement of details on the motion trajectory. The direction of the interference motion vector is the direction of movement of the dynamic interference region obtained through image sequence analysis, specifically the displacement vector of the interference region between adjacent frames calculated using the optical flow method. A dynamic prediction model of the interference region is constructed using a Kalman filter to predict the changing trend of the interference area within future w frames. The weight coefficients are adjusted in advance based on the prediction results to compensate for the system response delay, so that the strategy switching is synchronized with the interference evolution. The system response delay is the time difference from detecting a change in the input feature combination to executing the dimming strategy to produce the actual effect. The interference evolution is a continuous change process of interference in the spatiotemporal dimensions, including the following time, spatial, and intensity dimensions. Specifically, a long short-term memory network is used to model the historical input feature combination sequence to predict the future evolution trend.
[0031] In conjunction with the first aspect, in the ninth embodiment of the first aspect of this application, the execution of the inertial compensation mechanism for adaptive switching of the dimming strategy includes:
[0032] After switching the dimming strategy, subsequent w frames of image data are collected, and the following evaluation indicators are extracted: local signal-to-noise ratio change rate, detail structure similarity index, and brightness gradient root mean square error. When the evaluation indicators are detected to exceed the preset stable range, dynamic damping adjustment is initiated. Based on the deviation of the local signal-to-noise ratio change rate, the gain and integral time of the current dimming strategy are corrected according to the proportional-integral-derivative rule, and the compensation amount of the digital enhancement coefficient is controlled by fuzzy logic.
[0033] If the stable threshold is not reached after w consecutive evaluations, it is determined to be a strategy mismatch, and the following methods are executed: freeze the parameters of the current dimming strategy, revert to the dimming strategy of the previous stable state, expand the overlap buffer range and reduce the switching rate, and re-transition the dimming strategy; wherein, whether the dimming strategy is in a stable state is determined based on the average image gradient and the residual interference pixel rate. If the average image gradient fluctuation of any frame in w consecutive frames is greater than the set threshold or the residual interference pixel rate is greater than the set threshold, it is determined that the dimming strategy has not reached a stable state.
[0034] Compared with the prior art, the beneficial effects of the present invention are:
[0035] 1. This invention can accurately identify dynamic interference points by performing pixel-by-pixel difference operations on two adjacent frames of images and combining them with a set threshold judgment; then, it uses a clustering algorithm to divide the interference points, clearly defining different interference regions, and calculating the duration and frequency of occurrence of each interference region, providing comprehensive data support for the formulation of subsequent dimming strategies.
[0036] 2. This invention extracts the area, duration, and frequency of interference as input features to construct a decision tree model. Through training and learning on a large amount of sample data, the decision tree model can automatically match the most suitable dimming strategy according to different interference features, thereby realizing the intelligent and precise dimming strategy.
[0037] 3. When the area of the interference region changes and a switching of the dimming strategy is required, this invention sets an overlapping buffer at the decision boundary and uses a multi-parameter collaborative interpolation method to achieve a smooth transition of the strategy. At the same time, an inertial compensation mechanism is executed to adjust the switching rate according to the trend of interference changes, so as to avoid image instability caused by strategy switching being too fast or too slow. Attached Figure Description
[0038] Fig. 1 This is a schematic diagram illustrating the steps of a method for adaptive dimming of dynamic interference in the infrared field of view according to the present invention;
[0039] Fig. 2 This is a flowchart of the adaptive switching procedure for the dimming strategy of an adaptive dimming method for dynamic interference in the infrared field of view according to the present invention. Detailed Implementation
[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] Example: Figs. 1-2 As shown, the present invention provides a technical solution.
[0042] like Fig. 1 A schematic diagram illustrating the steps of a method for adaptive dimming to dynamic interference in the infrared field of view is shown. This invention provides a method for adaptive dimming to dynamic interference in the infrared field of view, comprising the following steps:
[0043] Step S100: Use an infrared detector to acquire multiple consecutive frames of infrared image data, perform pixel-by-pixel difference operation on two adjacent frames to obtain a difference image; when the gray value of a pixel in the difference image changes beyond a set threshold, it is determined that there is dynamic interference in the area where the pixel is located.
[0044] Specifically, the parameters of the infrared detector are initialized, the continuous acquisition mode is selected, and the acquisition frame rate is set. The continuously acquired infrared image data is stored sequentially in the memory buffer. Two adjacent frames of image data are read from the memory buffer in sequence, and image format conversion and preprocessing are performed. For the preprocessed two adjacent frames of image data, they are compared one by one according to the pixel position. For each pixel, the difference in gray value between the two frames is calculated. By iterating through all the pixels in the image, the pixel-by-pixel difference operation of the infrared image data is completed to obtain the difference image.
[0045] In one specific embodiment, infrared detectors are used to monitor the interior of a factory warehouse to detect any abnormal movement of people or objects. The warehouse has an area of approximately 500 square meters, and the infrared detectors are installed in the center of the warehouse ceiling, covering the entire warehouse area.
[0046] The infrared detector was configured with parameters set to continuous acquisition mode, and the frame rate was set to 25 frames per second. To ensure image quality, parameters such as detector gain and exposure time were optimized, with the gain set to a medium level and the exposure time adjusted to a suitable value based on the average temperature and environmental conditions in the warehouse, ensuring the images were neither too bright nor too dark. The infrared detector was then activated to begin continuously acquiring infrared image data. During acquisition, the continuously acquired images were sequentially stored in a memory buffer. For example, in a 10-second acquisition period, 250 frames were acquired and stored in the memory buffer, awaiting subsequent processing.
[0047] The system reads adjacent frames of image data sequentially from the memory cache. First, it converts the original infrared image data to grayscale to facilitate grayscale value comparison. Then, it preprocesses the converted images, using median filtering to remove noise and smooth the image. Next, it compares each pixel of the preprocessed adjacent frames. For example, a pixel at coordinates (100, 100) has a grayscale value of 80 in the first frame and 100 in the second frame, resulting in a difference of 20. By iterating through all 800 × 600 = 480,000 pixels in the image, the difference in grayscale value for each pixel between the two frames is calculated. Finally, the pixel-by-pixel difference operation on the adjacent infrared image frames is completed, yielding the difference image.
[0048] Step S200: Based on the distribution of dynamic interference points, a clustering algorithm is used to divide the interference points into different interference regions. Each interference region represents a relatively concentrated part of dynamic interference. The duration of each interference region is calculated, and the frequency of each interference region occurring within the duration is counted.
[0049] Specifically, the clustering algorithm uses the K-Means algorithm. The K value is set according to the number of interference regions with the highest frequency in historical data. The sum of squared errors within the cluster (WCSS) is calculated under different K values, and a curve of WCSS changing with K is plotted. When the curve has an inflection point, the corresponding K value is the optimal solution. K points are randomly selected from all dynamic interference points as initial cluster centers. For each dynamic interference point, the Euclidean distance from it to each cluster center is calculated, and each dynamic interference point is assigned to the cluster containing the nearest cluster center.
[0050] The average coordinates of all dynamic interference points in each cluster are taken to obtain a new cluster center, and the coordinates of the new cluster center are used to replace the old cluster center. The sum of the Euclidean distances between the new and old cluster centers is calculated. When the sum of the Euclidean distances is less than a set threshold or the maximum number of iterations is reached, the iteration is stopped. On the difference image, the interference region of each cluster is marked with different colors. The clustering result is saved as a mask matrix of the same size as the difference image, where each pixel value represents the cluster number to which it belongs.
[0051] Furthermore, when a new interference region is detected for the first time, the timestamp of the current frame of the differential image is recorded as the start time; for an existing interference region, when the region is not detected in w consecutive frames, the timestamp of the current frame is recorded as the end time, where w is a positive integer set by the user; the duration of a single occurrence is obtained by subtracting the start time from the end time; when the same interference region appears in multiple time periods, the durations of each occurrence are accumulated to obtain the total duration; a fixed-length time window is set, and the number of occurrences of each interference region within the window is counted, with each interference event as the unit, and the frequency of each interference within the duration is counted.
[0052] In one specific embodiment, by analyzing historical warehouse monitoring data from the past week, it was found that the number of the most frequently occurring interference areas was between 3 and 5. Therefore, the sum of squared errors within each cluster (WCSS) was calculated for K values of 2, 3, 4, 5, and 6. For example, when K=2, the calculated WCSS was 500; when K=3, WCSS was 300; when K=4, WCSS was 200; when K=5, WCSS was 180; and when K=6, WCSS was 170. After plotting the curve of WCSS versus K, a clear inflection point was observed at K=4, so the optimal K value was determined to be 4. There were a total of 1000 dynamic interference points. Four points were randomly selected from all detected dynamic interference points as initial cluster centers. The coordinates of these four selected points were (100, 100), (300, 200), (500, 300), and (700, 400).
[0053] For each dynamic disturbance point, calculate its Euclidean distance to the four cluster centers. For example, a dynamic disturbance point with coordinates (120, 110) has Euclidean distances of approximately 28.28 (to (100, 100)), approximately 201.99 (to (300, 200)), approximately 401.25 (to (500, 300)), and approximately 600.17 (to (700, 400)). Since the distance to (100, 100) is the closest, this dynamic disturbance point is assigned to the cluster centered at (100, 100). In this way, all 1000 dynamic disturbance points are assigned to the cluster containing the nearest cluster center.
[0054] The average coordinates of all dynamic disturbance points in each cluster are used to obtain new cluster centers. For example, if the first cluster has 200 dynamic disturbance points, the average coordinates of these points are calculated to obtain a new cluster center with coordinates (110, 110). This new coordinate replaces the original cluster center (100, 100). The sum of the Euclidean distances between the old and new cluster centers is calculated. After the first iteration, the sum of the Euclidean distances between the four old and new cluster centers is 30. The threshold is set to 10, and the maximum number of iterations is 20. Since 30 is greater than 10 and the number of iterations is 1 (less than 20), the iteration continues. After several iterations, the iteration stops when the sum of the Euclidean distances becomes 8 (less than 10).
[0055] On the difference image, the interference regions of each cluster are marked with different colors. The first cluster is marked in red, the second in blue, the third in green, and the fourth in yellow. The clustering results are saved as a mask matrix of the same size as the difference image (800×600 pixels), where each pixel value represents the cluster number it belongs to; for example, a pixel value of 1 indicates belonging to the first cluster, a pixel value of 2 indicates belonging to the second cluster, and so on.
[0056] When a new interference region is detected for the first time, the timestamp of the current frame of the differential image is recorded as 10:00:00. The user-defined positive integer w is 5. For an existing red interference region, if it is not detected for 5 consecutive frames, the timestamp of the current frame is recorded as 10:00:05 as the end time. Subtracting the start time from the end time gives the single duration of the red interference region as 5 seconds. If the red interference region reappears later, with a start time of 10:00:10 and an end time of 10:00:13, then the total duration, summed from each occurrence, is 5 + 3 = 8 seconds.
[0057] A fixed time window of 1 minute was set. Within this minute, the frequency of each interference area was counted. The statistics showed that the red interference area appeared 5 times, the blue interference area appeared 3 times, the green interference area appeared 4 times, and the yellow interference area appeared 2 times. Using interference events as the unit, the frequency of the red interference area within its duration (8 seconds) can be understood as the average number of times it appeared every 8 seconds within this 1 minute, i.e., 5 times / 8 seconds × 60 seconds ≈ 37.5 times / minute. Similarly, the frequencies of the other interference areas within their respective durations can be calculated.
[0058] Step S300: Collect sample data containing dynamic interference during infrared imaging, extract the area of the interference region, duration, and frequency of each interference region within the duration, and combine them as input feature combination. Use the corresponding dimming strategy as the output label to construct a decision tree model. Divide the sample data into training set and test set, train the decision tree model, and obtain the dimming strategy of the input feature combination.
[0059] Specifically, sample data containing dynamic interference during infrared imaging is collected, the number of pixels contained in the data is counted, and the area of the interference region is calculated based on the resolution of the infrared detector and the imaging distance. The area of the interference region, the duration, and the frequency of each interference region within the duration are combined into a three-dimensional vector, which is used as the input feature combination for the sample. Based on actual application needs and experience, dimming strategies are divided into different categories, and a corresponding dimming strategy label is assigned to each sample data.
[0060] The CART algorithm is used as the decision tree model for model initialization.
[0061] Furthermore, random sampling is used to divide the sample data into training and test sets. The input feature combinations in the training set are matched with the corresponding output labels as input for model training. The CART algorithm recursively divides the training data, selects the optimal features and split points, and constructs a decision tree. At each internal node, the training set is divided into two subsets based on the value of a certain feature. The recursion stops when the tree reaches its maximum depth or the number of samples contained in each leaf node is less than a set minimum value. Model evaluation and optimization are performed by inputting the area, duration, and frequency of each interference region obtained in the actual application into the optimized decision tree model to obtain the corresponding dimming strategy.
[0062] In one specific embodiment, 100 sets of sample data containing dynamic interference were collected. For one set of samples, the number of pixels contained in the interference region was counted, and the interference region of that sample contained 8000 pixels. Given that the infrared detector has a resolution of 800×600 pixels, an imaging distance of 5 meters, and each pixel corresponds to an actual physical size of 0.01 meters × 0.01 meters, the interference region area can be calculated to be 8000 × (0.01 × 0.01) = 0.8 square meters.
[0063] For this sample, the duration of the interference region was statistically determined to be 15 seconds, and the frequency of the interference region within these 15 seconds was 3 times. The interference region area of 0.8 square meters, the duration of 15 seconds, and the frequency of occurrence (3 times) were combined into a three-dimensional vector [0.8, 15, 3], which served as the input feature combination for this sample. This process was repeated for 100 sets of sample data to obtain their respective input feature combinations.
[0064] Based on practical application needs and experience, dimming strategies are categorized into three types: local dimming, comprehensive dimming, and no dimming required. Local dimming only adjusts the detector integration time, while comprehensive dimming adjusts both the detector integration time and gain. For the aforementioned sample, due to its small interference area (0.8 square meters), short duration (15 seconds), and low frequency (3 occurrences), it was determined based on experience to be assigned a local dimming strategy label. Dimming strategy labels were assigned to all 100 sample data sets using similar criteria.
[0065] The CART algorithm is used as the decision tree model. The model is initialized with a maximum tree depth of 5 and a minimum of 5 samples per leaf node. 100 sets of data are randomly divided into training and test sets at a 70% to 30% ratio (70 training sets and 30 test sets). The 70 input feature combinations in the training set are matched with their corresponding output labels as input for model training. The CART algorithm recursively divides these 70 training sets, selecting the optimal features and split points to construct the decision tree. For example, at a certain internal node, based on the feature value of the interference region area, the training set is divided into two subsets: one subset contains samples with interference region areas greater than a certain value, and the other subset contains samples with interference region areas less than or equal to that value. This recursive process continues until the tree reaches its maximum depth of 5 or the number of samples per leaf node is less than 5.
[0066] The trained decision tree model was evaluated using 30 sets of sample data from the test set. Model performance was measured by metrics such as accuracy and recall. The calculated accuracy was 80% and the recall was 75%. Based on the evaluation results, the decision tree model was optimized and adjusted, with appropriate adjustments to parameters such as the maximum tree depth and the minimum number of leaf node samples. After optimization, the model performance was evaluated again, and the accuracy improved to 85% and the recall to 80%. In practical applications, a new set of interfering data was detected, with an interference area of 1.2 square meters, a duration of 20 seconds, and a frequency of 4 occurrences within that duration. This data was combined into an input feature vector [1.2, 20, 4] and input into the optimized decision tree model, resulting in a comprehensive dimming strategy.
[0067] like Fig. 2The flowchart of the adaptive switching procedure for the dimming strategy of a method for adaptive dimming of dynamic interference in the infrared field of view is shown. Step S400: Based on the current input feature combination, a matching search is performed to obtain the corresponding dimming strategy and execute it; when the area of the interference region changes and falls from one input feature combination to another, an overlapping buffer is set at the decision boundary of the input feature combination; multi-parameter collaborative interpolation is performed to realize the strategy mixing transition, an inertial compensation mechanism is executed, and the dimming strategy is adaptively switched.
[0068] Specifically, based on the current input feature combination, starting from the root node of the decision tree, the feature judgment conditions of the current node are obtained, and the left or right subtree is traversed according to the feature value of the feature combination until the leaf node is reached; the dimming strategy code corresponding to the leaf node is obtained, the dimming strategy parameters are extracted, and the control command is sent to the driver module of the infrared detector through the serial port to execute the dimming strategy.
[0069] Furthermore, based on the distribution pattern of historical input feature combinations, a multidimensional decision boundary is constructed, with each dimming strategy corresponding to an input feature combination region; a spatiotemporal overlap buffer is set at the boundary of adjacent dimming strategy regions, and the range of the spatiotemporal overlap buffer is dynamically adjusted according to the spatiotemporal correlation of the interference region. The method is as follows: in the time dimension, the vertical expansion coefficient of the buffer is set based on the duration, and in the spatial dimension, the horizontal width of the buffer is determined based on the gradient of the change in the area of the interference region.
[0070] The threshold parameters of the boundaries of adjacent dimming strategy regions are updated in real time using a sliding window statistical method. When new interference is detected, the coverage of the buffer is expanded through online learning. Normalized distance calculation is performed on the feature points in the buffer to define the relative positional relationship between the current input feature combination and the boundaries of adjacent dimming strategy regions.
[0071] Furthermore, the activation weights of the old and new dimming strategies are calculated based on the Gaussian membership function as follows: When the input feature combination enters the overlap buffer, a continuously changing weight coefficient is generated based on its normalized distance from the boundary of the old and new dimming strategy regions; the weight coefficient is dynamically correlated with the rate of change of the interference region area, and the faster the rate of change, the greater the slope of the weight coefficient transition; the gain parameters of the old and new dimming strategies are mixed using linear interpolation, and the weight coefficient is applied to the arithmetic mean, which is the result of a weighted average calculation based on the weight coefficient;
[0072] Interpolation calculations are performed in the logarithmic domain to ensure the physical continuity of exposure time. The logarithmic domain is the mathematical space after converting physical quantities to a logarithmic scale. Combining the direction of the interference motion vector, a direction-weighted interpolation method is used to prioritize the enhancement of details on the motion trajectory. The direction of the interference motion vector is the direction of movement of the dynamic interference region obtained through image sequence analysis, specifically the displacement vector of the interference region between adjacent frames calculated using the optical flow method. A dynamic prediction model of the interference region is constructed using a Kalman filter to predict the changing trend of the interference area within future w frames. The weight coefficients are adjusted in advance based on the prediction results to compensate for the system response delay, so that the strategy switching is synchronized with the interference evolution. The system response delay is the time difference from detecting a change in the input feature combination to executing the dimming strategy to produce the actual effect. The interference evolution is a continuous change process of interference in the spatiotemporal dimensions, including the following time, spatial, and intensity dimensions. Specifically, a long short-term memory network is used to model the historical input feature combination sequence to predict the future evolution trend.
[0073] Furthermore, after switching the dimming strategy, subsequent w frames of image data are collected, and the following evaluation indicators are extracted: local signal-to-noise ratio change rate, detail structure similarity index, and brightness gradient root mean square error. When the evaluation indicators are detected to exceed the preset stable range, dynamic damping adjustment is initiated. Based on the deviation of the local signal-to-noise ratio change rate, the gain and integral time of the current dimming strategy are corrected according to the proportional-integral-derivative rule, and the compensation amount of the digital enhancement coefficient is controlled by fuzzy logic.
[0074] If the stable threshold is not reached after w consecutive evaluations, it is determined to be a strategy mismatch, and the following methods are executed: freeze the parameters of the current dimming strategy, revert to the dimming strategy of the previous stable state, expand the overlap buffer range and reduce the switching rate, and re-transition the dimming strategy; wherein, whether the dimming strategy is in a stable state is determined based on the average image gradient and the residual interference pixel rate. If the average image gradient fluctuation of any frame in w consecutive frames is greater than the set threshold or the residual interference pixel rate is greater than the set threshold, it is determined that the dimming strategy has not reached a stable state.
[0075] In one specific embodiment, the input feature combination formed by the currently detected set of interference data is [interference area 1.5 square meters, duration 25 seconds, occurrence frequency 5 times]. Starting from the root node of the decision tree, the feature judgment condition of the root node may be whether the interference area is greater than 1.2 square meters. Since the interference area in the current feature combination is 1.5 square meters, which is greater than 1.2 square meters, the right subtree is traversed. The judgment continues according to the feature judgment condition of the node until the leaf node is reached. The dimming strategy stored in the leaf node is encoded as comprehensive dimming. The corresponding dimming strategy parameters are extracted, the integration time is adjusted to 0.8 times the original, and the gain is adjusted to 1.2 times. Control commands are sent to the driver module of the infrared detector through the serial port. The driver module adjusts the integration time and gain of the detector according to the received commands and executes the comprehensive dimming strategy.
[0076] Based on the distribution patterns of historical input feature combinations, a multidimensional decision boundary is constructed. For the boundaries of the two dimming strategy regions, local dimming and integrated dimming, in the time dimension, the vertical expansion coefficient of the buffer is set to 0.2 based on the duration. That is, if the original maximum duration of the local dimming region is 20 seconds, the buffer will expand this boundary to 20 × (1 + 0.2) = 24 seconds. In the spatial dimension, the horizontal width of the buffer is determined based on the gradient of the interference region area change. If the gradient of the interference region area change is large, the buffer width increases accordingly. Currently, the gradient of the interference region area change at the boundary of the local dimming and integrated dimming regions is moderate, and the horizontal width of the buffer is set to 0.3 square meters. That is, based on an area of 1.2 square meters, the buffer expands to a range from 1.2 - 0.3 = 0.9 square meters to 1.2 + 0.3 = 1.5 square meters.
[0077] When the input feature combination [interference area changes from 1.1 square meters to 1.3 square meters, duration 22 seconds, frequency 4 times] enters the overlap buffer, the activation weights of the old and new dimming strategies are calculated based on the Gaussian membership function. According to the normalized distance calculation, the normalized distance between the current input feature combination and the boundary of the local dimming region is 0.3, and the normalized distance with the boundary of the integrated dimming region is 0.7. The weight coefficients generated by the Gaussian membership function are: 0.6 for the local dimming strategy and 0.4 for the integrated dimming strategy. Since the rate of change of the interference area is moderate, the slope of the weight coefficient transition is adjusted according to a pre-set rule. A linear interpolation method is used to mix the gain parameters of the old and new dimming strategies. For example, if the gain of the local dimming strategy is 1.0 and the gain of the integrated dimming strategy is 1.2, the mixed gain is 0.6 × 1.0 + 0.4 × 1.2 = 1.08. Interpolation calculations of the exposure time are performed in the logarithmic domain to ensure physical continuity. Combining the direction of the interference motion vector (calculated by optical flow, the interference area moves from the upper left to the lower right), a direction-weighted interpolation method is used to prioritize the preservation of detail enhancement along the motion trajectory. A Kalman filter is used to predict the changing trend of the interference area within the next 5 frames. Since the interference area is predicted to gradually increase, the weighting coefficients are adjusted in advance: the weight of the overall dimming strategy is adjusted to 0.5, and the weight of the local dimming strategy is also adjusted to 0.5 to compensate for system response delay and synchronize strategy switching with interference evolution.
[0078] After switching the dimming strategy, five subsequent frames of image data were acquired. Evaluation metrics such as local signal-to-noise ratio (SNR) change rate, detail structure similarity index, and luminance gradient root mean square error (RMSE) were extracted. The local SNR of the first frame was 20 dB, and after switching the dimming strategy, the local SNR of the second frame was 18 dB. Therefore, the local SNR change rate was (18-20) / 20 = -0.1; the detail structure similarity index was 0.8 in the first frame and 0.75 in the second; and the luminance gradient MRM was 10 in the first frame and 12 in the second. The preset stability range was set as follows: local SNR change rate within ±0.05, detail structure similarity index within ±0.1, and luminance gradient MRM within ±2.
[0079] Because the local signal-to-noise ratio (SNR) change rate exceeds the preset stable range, dynamic damping adjustment is initiated. Based on the deviation of the local SNR change rate, the gain and integration time of the current dimming strategy are corrected according to the proportional-integral-derivative rule, adjusting the gain to 1.05 and the integration time to 0.9 times the original. Fuzzy logic is used to control the compensation amount of the digital enhancement coefficient, which is adjusted to 0.2. If, in any of the five consecutive evaluations, the average image gradient fluctuation exceeds a set threshold (set threshold is 15) or the residual interference pixel rate exceeds a set threshold (set threshold is 8%), the dimming strategy is deemed not to have reached a stable state. In the third evaluation, the average image gradient fluctuation is 18, greater than 15, indicating a strategy mismatch. At this point, the parameters of the current dimming strategy are frozen, and the strategy reverts to the previous stable state (local dimming strategy). The overlap buffer range is expanded, increasing the buffer's expansion coefficient in the time dimension to 0.3 and its width in the spatial dimension to 0.4 square meters. The switching rate is reduced, and the dimming strategy transition is restarted.
[0080] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A method for adaptive dimming to dynamic interference in the infrared field of view, characterized in that, Includes the following steps: Infrared detectors are used to acquire multiple consecutive frames of infrared image data. Pixel-by-pixel difference operations are performed on two adjacent frames to obtain a difference image. When the grayscale value of a pixel in the difference image changes beyond a set threshold, it is determined that there is dynamic interference in the area where that pixel is located. Based on the distribution of dynamic interference points, a clustering algorithm is used to divide the interference points into different interference regions. Each interference region represents a relatively concentrated part of dynamic interference. The duration of each interference region is calculated, and the frequency of each interference region occurring within the duration is counted. Collect sample data containing dynamic interference during infrared imaging, extract the area, duration, and frequency of each interference region within the duration, and combine them as input feature combination. Use the corresponding dimming strategy as the output label to construct a decision tree model. Divide the sample data into training set and test set, train the decision tree model, and obtain the dimming strategy of the input feature combination. Matching is performed based on the current input feature combination to obtain the corresponding dimming strategy and execute it; when the area of the interference region changes and falls from one input feature combination to another, an overlapping buffer is set at the decision boundary of the input feature combination; multi-parameter collaborative interpolation is performed to realize the strategy mixing transition, an inertial compensation mechanism is executed, and dimming strategy adaptive switching is performed. The aforementioned inertial compensation mechanism, which adaptively switches the dimming strategy, includes: After switching the dimming strategy, subsequent w frames of image data are collected, and the following evaluation indicators are extracted: local signal-to-noise ratio change rate, detail structure similarity index, and brightness gradient root mean square error. When the evaluation indicators are detected to exceed the preset stable range, dynamic damping adjustment is initiated. Based on the deviation of the local signal-to-noise ratio change rate, the gain and integral time of the current dimming strategy are corrected according to the proportional-integral-derivative rule, and the compensation amount of the digital enhancement coefficient is controlled by fuzzy logic. If the stable threshold is not reached after w consecutive evaluations, it is determined to be a strategy mismatch, and the following methods are executed: freeze the parameters of the current dimming strategy, revert to the dimming strategy of the previous stable state, expand the overlap buffer range and reduce the switching rate, and re-transition the dimming strategy; wherein, whether the dimming strategy is in a stable state is determined based on the average image gradient and the residual interference pixel rate. If the average image gradient fluctuation of any frame in w consecutive frames is greater than the set threshold or the residual interference pixel rate is greater than the set threshold, it is determined that the dimming strategy has not reached a stable state.
2. The method for adaptive dimming of dynamic interference in the infrared field of view according to claim 1, characterized in that, The process of acquiring multiple consecutive frames of infrared image data using an infrared detector, and performing pixel-by-pixel difference operations on adjacent frames to obtain a difference image includes: The parameters of the infrared detector are initialized, the continuous acquisition mode is selected, and the acquisition frame rate is set. The continuously acquired infrared image data is stored sequentially in the memory buffer. Two adjacent frames of image data are read from the memory buffer in sequence, and image format conversion and preprocessing are performed. For the preprocessed two adjacent frames of image data, they are compared one by one according to the pixel position. For each pixel, the difference in gray value between the two frames is calculated. By iterating through all the pixels in the image, the pixel-by-pixel difference operation of the infrared image data is completed to obtain the difference image.
3. The method for adaptive dimming of dynamic interference in the infrared field of view according to claim 1, characterized in that, Based on the distribution of dynamic interference points, a clustering algorithm is used to divide the interference points into different interference regions. Each interference region represents a relatively concentrated part of dynamic interference, including: The clustering algorithm uses the K-Means algorithm. The K value is set according to the number of interference regions with the highest frequency in historical data. The sum of squared errors within the cluster (WCSS) is calculated under different K values, and the curve of WCSS changing with K is plotted. When the curve has an inflection point, the corresponding K value is the optimal solution. K points are randomly selected from all dynamic interference points as initial cluster centers. For each dynamic interference point, the Euclidean distance from it to each cluster center is calculated, and each dynamic interference point is assigned to the cluster containing the nearest cluster center. The average coordinates of all dynamic interference points in each cluster are taken to obtain a new cluster center, and the coordinates of the new cluster center are used to replace the old cluster center. The sum of the Euclidean distances between the new and old cluster centers is calculated. When the sum of the Euclidean distances is less than a set threshold or the maximum number of iterations is reached, the iteration is stopped. On the difference image, the interference region of each cluster is marked with different colors. The clustering result is saved as a mask matrix of the same size as the difference image, where each pixel value represents the cluster number to which it belongs.
4. The method for adaptive dimming of dynamic interference in the infrared field of view according to claim 1, characterized in that, The calculation of the duration of each interference region and the statistical analysis of the frequency of each interference region occurring within that duration include: When a new interference region is detected for the first time, the timestamp of the current frame of the differential image is recorded as the start time. For an existing interference region, when the region is not detected in w consecutive frames, the timestamp of the current frame is recorded as the end time, where w is a positive integer set by the user. The duration of a single instance is obtained by subtracting the start time from the end time. When the same interference region appears in multiple time periods, the durations of each instance are summed to obtain the total duration. A fixed-length time window is set, and the number of occurrences of each interference region within the window is counted. The frequency of each interference within the duration is counted in units of interference events.
5. The method for adaptive dimming of dynamic interference in the infrared field of view according to claim 1, characterized in that, The process of collecting sample data containing dynamic interference during infrared imaging involves extracting and combining the area, duration, and frequency of each interference region within that duration as input features. Using the corresponding dimming strategy as the output label, a decision tree model is constructed, including: Collect sample data containing dynamic interference during infrared imaging, count the number of pixels contained in the data, and convert it into the area of the interference region based on the resolution of the infrared detector and the imaging distance. Combine the area of the interference region, the duration, and the frequency of each interference region within the duration into a three-dimensional vector, which serves as the input feature combination for the sample. Based on actual application requirements and experience, divide the dimming strategies into different categories, and assign a corresponding dimming strategy label to each sample data. The CART algorithm is used as the decision tree model for model initialization.
6. The method for adaptive dimming of dynamic interference in the infrared field of view according to claim 1, characterized in that, The process of dividing sample data into training and testing sets, training a decision tree model, and obtaining a dimming strategy based on input feature combinations includes: The sample data is divided into training and test sets using random sampling. The input feature combinations in the training set are matched with the corresponding output labels as input for model training. The CART algorithm recursively divides the training data, selects the optimal features and split points, and constructs a decision tree. At each internal node, the training set is divided into two subsets based on the value of a certain feature. The recursion stops when the tree reaches its maximum depth or the number of samples contained in each leaf node is less than a set minimum value. The model is evaluated and optimized by inputting the area, duration, and frequency of each interference region obtained in the actual application into the optimized decision tree model to obtain the corresponding dimming strategy.
7. The method for adaptive dimming of dynamic interference in the infrared field of view according to claim 1, characterized in that, The process of matching and searching based on the current input feature combination to obtain and execute the corresponding dimming strategy includes: Based on the current input feature combination, starting from the root node of the decision tree, the feature judgment condition of the current node is obtained. The left or right subtree is traversed according to the feature value of the input feature combination until the leaf node is reached. The dimming strategy code corresponding to the leaf node is obtained, the dimming strategy parameters are extracted, and the control command is sent to the driver module of the infrared detector through the serial port to execute the dimming strategy.
8. The method for adaptive dimming of dynamic interference in the infrared field of view according to claim 1, characterized in that, When the area of the interference region changes and falls from one input feature combination to another, an overlap buffer is set at the decision boundary of the input feature combination, including: Based on the distribution pattern of historical input feature combinations, a multidimensional decision boundary is constructed, with each dimming strategy corresponding to an input feature combination region. An overlapping buffer is set at the boundary of adjacent dimming strategy regions. The range of the overlapping buffer is dynamically adjusted according to the spatiotemporal correlation of the interference region. The method is as follows: in the time dimension, the vertical expansion coefficient of the overlapping buffer is set based on the duration, and in the spatial dimension, the horizontal width of the overlapping buffer is determined based on the gradient of the change in the area of the interference region. The threshold parameters of the boundaries of adjacent dimming strategy regions are updated in real time using a sliding window statistical method. When new interference is detected, the coverage of the overlapping buffer is expanded through online learning. Normalized distance calculation is performed on the feature points in the overlapping buffer to define the relative positional relationship between the current input feature combination and the boundaries of adjacent dimming strategy regions.
9. A method for adaptive dimming of dynamic interference in the infrared field of view according to claim 1, characterized in that, The method of performing multi-parameter collaborative interpolation to achieve a hybrid transition strategy includes: The activation weights of the old and new dimming strategies are calculated based on Gaussian membership functions as follows: When the input feature combination enters the overlap buffer, a continuously changing weight coefficient is generated based on the normalized distance between it and the boundary of the old and new dimming strategy regions; the weight coefficient is dynamically related to the rate of change of the area of the interference region, and the faster the rate of change, the greater the slope of the weight coefficient transition; the gain parameters of the old and new dimming strategies are mixed using linear interpolation, and the weight coefficient is applied to the arithmetic mean, which is the result of a weighted average calculation based on the weight coefficient; Interpolation calculations are performed in the logarithmic domain to ensure the physical continuity of exposure time. The logarithmic domain is the mathematical space after converting physical quantities to a logarithmic scale. Combining the direction of the interference motion vector, a direction-weighted interpolation method is used to prioritize the enhancement of details on the motion trajectory. The direction of the interference motion vector is the direction of movement of the dynamic interference region obtained through image sequence analysis, specifically the displacement vector of the interference region between adjacent frames calculated using the optical flow method. A dynamic prediction model of the interference region is constructed using a Kalman filter to predict the changing trend of the interference area within future w frames. The weight coefficients are adjusted in advance based on the prediction results to compensate for the system response delay, so that the strategy switching is synchronized with the interference evolution. The system response delay is the time difference from detecting a change in the input feature combination to executing the dimming strategy to produce the actual effect. The interference evolution is a continuous change process of interference in the spatiotemporal dimensions, including the following time, spatial, and intensity dimensions. Specifically, a long short-term memory network is used to model the historical input feature combination sequence to predict the future evolution trend.