A hybrid focusing system and method for infrared cameras based on MDP decision-making

Through a hybrid focusing system based on MDP decision-making, combined with temperature sensors, multi-frame mean filtering and Kalman filtering, the infrared camera can focus quickly and accurately in complex environments, solving the problems of inaccurate focusing and falling into local optimal solutions in existing technologies, and meeting the imaging needs of dynamic scenes.

CN120568200BActive Publication Date: 2025-09-30JILIN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511080307.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-04
Publication Date
2025-09-30
Estimated Expiration
2045-08-04

AI Technical Summary

Technical Problem

Existing infrared camera focusing technology has difficulty achieving fast and accurate automatic focusing in complex environments. It is easily affected by noise and ambient temperature changes, resulting in inaccurate focusing results and is prone to falling into local optimal solutions, which cannot meet the imaging requirements of dynamic scenes.

Method used

A hybrid focusing system based on MDP decision-making is adopted, including data acquisition, dual-mode noise suppression, MDP decision-making and automatic focusing modules. The ambient and target temperatures are collected through temperature sensors, and multi-frame mean filtering and Kalman filtering are used to eliminate noise. The MDP decision-making module is combined with global search and hill climbing algorithm for local optimization to achieve precise focusing.

Benefits of technology

It improves the stability and response speed of infrared cameras in complex environments, can quickly find the global optimal focus position, ensure high-quality image acquisition, and meet the imaging needs of dynamic targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120568200B_ABST
    Figure CN120568200B_ABST
Patent Text Reader

Abstract

The present invention, applicable to the fields of optical engineering and automatic control technology, provides a hybrid focusing system and method for infrared cameras based on MDP decision-making. The system comprises: a data acquisition module for capturing real-time images from the infrared camera, using a temperature sensor to collect ambient temperature and the surface temperature of the observed target; a dual-mode noise suppression module for preprocessing the acquired image information, calculating an evaluation value, and obtaining a smooth evaluation function; an MDP decision module for global search, locking the approximate interval of the optimal focus position; an autofocus module for local optimization, driving a stepper motor for precise focusing; and an interrupt response module for interrupting hardware control when optimal focus is achieved. This system significantly shortens focusing time and improves camera response speed, meeting the requirements for adapting to complex environments and rapidly focusing on dynamic targets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of optical engineering and automatic control technology, and in particular relates to an infrared camera hybrid focusing system and method based on MDP decision-making. Background Art

[0002] With the widespread application of infrared cameras in military and industrial fields, the demand for their focusing performance is becoming increasingly stringent. In military reconnaissance, infrared cameras must be able to quickly and accurately focus on targets, providing clear and accurate image intelligence for operational decision-making. In industrial equipment inspection, high-quality infrared images can help inspectors promptly detect potential equipment failures. Current infrared camera focusing technology still primarily relies on manual focusing or simple hill-climbing algorithms that perform global focusing. Some even have fixed focal lengths and are not adjustable. In real-world applications, environmental factors are complex and variable, and parameters such as the distance and temperature of the observed target are constantly changing. Fixed focal lengths are unable to meet imaging requirements in diverse situations. Manual focusing is inefficient and cannot achieve real-time, rapid focus adjustments, severely limiting the application of infrared cameras in dynamic scenes.

[0003] While existing autofocus technology has, to a certain extent, addressed the efficiency issues associated with manual focusing, it still has significant shortcomings. Some autofocus methods based on a single algorithm, such as those that rely solely on an image clarity evaluation function for focus judgment, are susceptible to image noise and environmental interference. In complex mid-infrared thermal imaging environments, noise can cause deviations in clarity evaluation values, leading to inaccurate focusing results. Changes in ambient temperature can also affect image clarity, making it difficult for the focusing algorithm to accurately determine the optimal focus position, which in turn affects image quality. Furthermore, some focusing algorithms are prone to falling into local optimal solutions when searching for the optimal focus position, failing to find the globally optimal focus position, resulting in images that never achieve optimal clarity. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide an infrared camera hybrid focusing system and method based on MDP decision-making, aiming to solve the problems raised in the above background technology.

[0005] The embodiment of the present invention is implemented as follows: an infrared camera hybrid focusing system based on MDP decision-making, comprising:

[0006] The data acquisition module is used to collect real-time images from the infrared camera and collect the ambient temperature and the surface temperature of the observed target through the temperature sensor;

[0007] The dual-mode noise suppression module is used to pre-process the collected image information, calculate the evaluation value and obtain a smooth evaluation function;

[0008] The MDP decision module is used for global search and locking the approximate interval position of the best focus position;

[0009] Automatic focusing module, used for local optimization, drives the stepper motor to achieve precise focusing;

[0010] The interrupt response module is used to determine when the optimal focus is achieved and interrupt hardware control.

[0011] Further technical solutions, for the data acquisition module, the specific steps of collecting the ambient temperature and the surface temperature of the observed target through the temperature sensor are as follows: obtain the current The ambient temperature at the moment is calibrated as The infrared camera outputs a thermal image based on the infrared radiation emitted by the observed target surface. The value of each pixel is the radiation intensity received within a certain wavelength range. The relationship between radiation intensity and temperature is expressed by the formula:

[0012] ;

[0013] in, is the radiation intensity received by the infrared camera from the observed target surface; is the emissivity of the observed target surface, that is, the ratio of the radiation ability of the observed target surface to the radiation ability of the black body, which is between 0 and 1; is the Stefan-Boltzmann constant; is the absolute temperature of the observed target;

[0014] Reverse the formula to obtain the surface temperature of the observed target and obtain the surface temperature of the observed target at the current moment The formula is:

[0015] .

[0016] A further technical solution is that for the dual-mode noise suppression module, random noise is eliminated by multi-frame mean filtering when preprocessing image information. Specifically:

[0017] The infrared camera collects image sequences at a certain frame rate and transmits them to the dual-mode noise suppression module. For the N frames of images collected, for the coordinates The pixel, the gray value of the pixel after filtering for:

[0018] ;

[0019] in, Indicates the Frame image coordinates The grayscale value of the pixel at .

[0020] A further technical solution is to perform dynamic trend compensation on the clarity evaluation value by using Kalman filtering when preprocessing the image information. Specifically:

[0021] Construct a state space model, and the state equation is:

[0022] ;

[0023] Where, is the real evaluation value of the clarity at the current moment; is the surface temperature of the observed target at the current moment; is the autocorrelation function of clarity; is the influence coefficient of temperature on clarity; is the system process noise, which obeys the normal distribution ; is the random drift of temperature;

[0024] Observation equation:

[0025] ;

[0026] Where, is the clarity evaluation value calculated by the image algorithm, is the observation noise;

[0027] Using temperature data to predict clarity trends, the clarity estimate can be based on the previous moment and the current surface temperature of the observed target , predicting the prior estimate of the current clarity , the state prediction equation is:

[0028] ;

[0029] The covariance prediction equation is:

[0030] ;

[0031] is the a priori estimated covariance, reflecting the forecast uncertainty; is the process noise covariance; is the covariance estimate at the previous moment.

[0032] Then, the prediction is corrected using the observed value, the Kalman gain The calculation formula is as follows:

[0033] ;

[0034] In the above formula, if the observation noise Smaller, When it approaches 1, the observed value is more trusted; otherwise, the predicted value is more trusted; combined with the clarity evaluation value Correct the prior estimate to obtain the posterior estimate of clarity The expression:

[0035] ;

[0036] Corrected covariance Reflecting the reduction in estimation uncertainty, Updated to:

[0037] ;

[0038] Further technical solutions to obtain clarity evaluation values The specific logic is:

[0039] For images , whose Laplace transform is defined as:

[0040] ;

[0041] Perform Laplace template convolution on the grayscale image to obtain the edge response map ; For each pixel have:

[0042] ;

[0043] So, The calculation formula is:

[0044] ;

[0045] In the above formula, is the number of pixels in the image. The positive and negative symmetry of , the mean value is often close to 0, so the simplified The mean of:

[0046] .

[0047] Further technical solutions, for the MDP decision module, the specific steps of MDP decision definition state space are:

[0048] First, define the state space, state Including: current infrared camera focal length position , image clarity evaluation value , the surface temperature of the observed target , and search history ;

[0049] Then define the action space. Action A includes the strategy of adjusting the focal length of the camera lens. If the camera has a fixed step length, there are three actions: focus +, focus -, and stop. If the camera has an adjustable focal length, then the fixed focal length is defined as ,have 、 And 0 three actions;

[0050] Finally, define the reward function , divided into clarity improvement rewards, exploration rewards and environmental factor penalties;

[0051] For clarity improvement rewards, if the new state Image clarity rating Better than the current optimal clarity rating , give positive rewards , is the clarity bonus coefficient;

[0052] For exploration rewards, rewards are given for exploring new focal areas. ,in, Focus position Number of visits, is the clarity bonus coefficient;

[0053] For environmental factor penalties, this part limits environmental information and gives negative rewards. , is the penalty coefficient; the overall formula is as follows:

[0054] ;

[0055] Further technical solutions, the specific steps of MDP decision in the global search phase are:

[0056] Randomly set the initial focal length within the focal length range of the infrared camera , or set the focus position of the infrared camera when it is turned on to , calculate the clarity evaluation value of the image at this time , get the current temperature , set the initial optimal clarity evaluation value , initialize the search history to empty, , get the initial state ;

[0057] The initial selection is chosen by a random strategy or a heuristic strategy, assuming that the focal length The step length is fixed; in the initial stage, the focus adjustment action is uniformly randomly selected. If the camera type and shooting scene have focus experience, a heuristic strategy is used to combine prior knowledge to set the initial action distribution;

[0058] based on The action selection of the greedy strategy is based on probability Randomly explore the action space to Select the current optimal strategy;

[0059] ;

[0060] in is the action value function, which means that in state Next action The expected long-term cumulative rewards; is the state transition probability;

[0061] Execute an action , adjust the camera lens focal length to get the new focal length , collect new image frames and calculate their clarity evaluation values , get the ambient temperature at this time , thus obtaining a new state , and record the current state and action in the search history; calculate the reward according to the reward function , update cumulative rewards ,in is the discount factor, .

[0062] Update the action-value function using the Time Series Query (TD) algorithm :

[0063] ;

[0064] In the above formula is the learning rate, which controls the step size of each update and can be reduced as the iteration proceeds, making the update gradually stable. The value gradually approaches the optimal action value, guiding strategy optimization.

[0065] When the accumulated rewards It tends to be stable, indicating that the strategy converges; the optimal clarity evaluation value is continuous If no update is made in the iterations, and it is determined that it has fallen into the local optimum, it is possible to consider re-initializing the state randomly and continue searching; the preset maximum number of iterations has been reached The MDP decision process ends when any of the above three conditions are met. And the optimal focus position is output. And the optimal clarity evaluation value .

[0066] A further technical solution is to use a local optimization hill climbing algorithm for the autofocus module, specifically:

[0067] Set the current focal length position as the calibration point , at this time the clarity evaluation value is ; Get an image of it when the focal length increases, set the focal length position to , the clarity evaluation value is ; Get an image of it with a reduced focal length and set the focal length position to , the clarity evaluation value is .

[0068] when When the calibration point is updated to position and perform the climbing action again.

[0069] when When the calibration point is updated to position and perform the climbing action again.

[0070] when and When , randomly update the calibration point to or position and perform the climbing action again.

[0071] when and , it is judged as the final focal length position.

[0072] A further technical solution is that for the interrupt response module, when the hill climbing algorithm is running, and When the stepper motor adjusts the focal length to When the focus is determined to be stable in the optimal area, a stop command for the motor brake is immediately sent to the hardware.

[0073] Another object of an embodiment of the present invention is to provide a hybrid focusing method for an infrared camera based on MDP decision-making, based on the above-mentioned system, comprising the following specific steps:

[0074] Step 1: Use an infrared camera to capture real-time images, and use a temperature sensor to collect ambient temperature and the surface temperature of the observed target;

[0075] Step 2: Perform image preprocessing through spatial domain mean filtering to eliminate instantaneous noise and obtain grayscale image data;

[0076] Step 3: Calculate the clarity evaluation value of the current image, and then perform dynamic trend compensation on the clarity evaluation value through Kalman filtering;

[0077] Step 4: Combine the image clarity evaluation value information and temperature data to establish a Markov decision model and perform the global search phase of autofocus;

[0078] Step 5: Perform local optimization using the hill climbing algorithm to determine the optimal focal length position;

[0079] Step 6: After the stepper motor reaches the optimal focal length position, send a stop command to the hardware to apply the motor brake.

[0080] The embodiment of the present invention provides a hybrid focusing method for an infrared camera based on MDP decision-making, which has the following beneficial effects:

[0081] (1) A dual-mode noise suppression module is adopted, integrating spatial domain mean filtering and frequency domain Kalman prediction; multi-frame mean filtering effectively eliminates random noise, ensures image quality, and lays the foundation for subsequent accurate focusing; Kalman filtering dynamically compensates the clarity evaluation value based on data such as ambient temperature, so that the system can adapt to imaging changes under different ambient temperatures, greatly improving the stability and reliability of the system in complex environments and reducing the interference of environmental factors on the focusing effect.

[0082] (2) Based on the MDP decision module, through the innovative state-action-reward modeling method, a global search is performed, and then the local hill climbing algorithm is used to further search for the absolute optimal focus position within the MDP pre-screening area, which can effectively avoid falling into the local optimal solution. At the same time, by combining different strategies, such as random strategies and heuristic strategies, the system can flexibly select actions according to the characteristics of the scene, improve search efficiency and accuracy, and provide a strong guarantee for obtaining high-quality images. When the clarity evaluation value exceeds the preset threshold, the system can trigger the hardware closed-loop control signal to terminate the focus in real time.

[0083] Compared with traditional automatic focusing methods, the present invention significantly shortens the focusing time and improves the response speed of the camera, meeting the needs of adapting to complex environments and quickly focusing on dynamic targets. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] Figure 1 A schematic structural diagram of an infrared camera hybrid focusing system based on MDP decision-making provided by an embodiment of the present invention;

[0085] Figure 2 A flowchart of a hybrid focusing method for an infrared camera based on MDP decision-making is provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0086] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0087] The specific implementation of the present invention is described in detail below with reference to specific embodiments.

[0088] like Figure 1 As shown, an infrared camera hybrid focusing system based on MDP decision-making is provided in one embodiment of the present invention, including:

[0089] The data acquisition module is used to collect real-time images from the infrared camera and collect the ambient temperature and the surface temperature of the observed target through the temperature sensor;

[0090] The dual-mode noise suppression module is used to pre-process the collected image information, calculate the evaluation value and obtain a smooth evaluation function;

[0091] The MDP decision module is used for global search and locking the approximate interval position of the best focus position;

[0092] Automatic focusing module, used for local optimization, drives the stepper motor to achieve precise focusing;

[0093] The interrupt response module is used to determine when the optimal focus is achieved and interrupt hardware control.

[0094] As a preferred embodiment of the present invention, for the data acquisition module, the specific steps of collecting the ambient temperature and the surface temperature of the observed target through the temperature sensor are as follows:

[0095] Get the current temperature through the thermometer The ambient temperature at the moment is calibrated as The infrared camera outputs a thermal image based on the infrared radiation emitted by the observed target surface. The value of each pixel is the radiation intensity received within a certain wavelength range. The relationship between radiation intensity and temperature is expressed by the formula:

[0096] ;

[0097] in, is the radiation intensity received by the infrared camera from the observed target surface; is the emissivity of the observed target surface, that is, the ratio of the radiation ability of the observed target surface to the radiation ability of the black body, which is between 0 and 1; is the Stefan-Boltzmann constant; is the absolute temperature of the observed target;

[0098] Reverse the formula to obtain the surface temperature of the observed target and obtain the surface temperature of the observed target at the current moment The formula is:

[0099] .

[0100] In this embodiment of the present invention, comprehensive image and temperature data acquisition provides multi-dimensional information for subsequent processing. The inclusion of temperature data can be used to dynamically compensate for the clarity rating, enabling the system to adapt to imaging requirements in varying temperature environments and enhancing its applicability in complex environments.

[0101] As a preferred embodiment of the present invention, for the dual-mode noise suppression module, when pre-processing image information, random noise is eliminated by multi-frame mean filtering, specifically:

[0102] The infrared camera collects image sequences at a certain frame rate and transmits them to the dual-mode noise suppression module. For the N frames of images collected, for the coordinates The pixel, the gray value of the pixel after filtering for:

[0103] ;

[0104] in, Indicates the Frame image coordinates The grayscale value of the pixel at .

[0105] As a preferred embodiment of the present invention, when pre-processing image information, dynamic trend compensation is performed on the clarity evaluation value through Kalman filtering, specifically:

[0106] Construct a state space model, and the state equation is:

[0107] ;

[0108] Where, is the real evaluation value of the clarity at the current moment; is the surface temperature of the observed target at the current moment; is the autocorrelation function of clarity; is the influence coefficient of temperature on clarity; is the system process noise, which obeys the normal distribution ; is the random drift of temperature.

[0109] Observation equation:

[0110] ;

[0111] Where, It is the clarity evaluation value calculated by the image algorithm. is the observation noise.

[0112] Using temperature data to predict clarity trends, we can estimate the clarity based on the previous moment. and the current surface temperature of the observed target , predicting the prior estimate of the current clarity , the state prediction equation is:

[0113] ;

[0114] The covariance prediction equation is:

[0115] ;

[0116] is the a priori estimated covariance, reflecting the forecast uncertainty; is the process noise covariance; is the covariance estimate at the previous moment.

[0117] Then, the prediction is corrected using the observed value, the Kalman gain The calculation formula is as follows:

[0118] ;

[0119] In the above formula, if the observation noise Smaller, If it approaches 1, the observed value is more trusted; otherwise, the predicted value is more trusted. Combined with the clarity evaluation value Correct the prior estimate to obtain the posterior estimate of clarity The expression:

[0120] ;

[0121] Corrected covariance Reflecting the reduction in estimation uncertainty, Updated to:

[0122] ;

[0123] In this embodiment, the clarity evaluation value is obtained The specific logic is:

[0124] For images , whose Laplace transform is defined as:

[0125] ;

[0126] Perform Laplace template convolution on the grayscale image to obtain the edge response map For each pixel have:

[0127] ;

[0128] So, The calculation formula is:

[0129] ;

[0130] In the above formula, is the number of pixels in the image. The positive and negative symmetry of , the mean value is often close to 0, so it can be simplified The mean of:

[0131] ;

[0132] Dual-modal filtering combines spatial domain mean filtering and frequency domain Kalman prediction. Multi-frame mean filtering effectively eliminates random noise in the image, improves image quality, and lays the foundation for accurate focusing. Kalman filtering considers the impact of temperature on clarity, dynamically compensates the clarity evaluation value, reduces interference from environmental factors, makes the evaluation function smoother and more stable, and improves the stability and reliability of the system in complex environments.

[0133] As a preferred embodiment of the present invention, for the MDP decision module, the specific steps of MDP decision-making to define the state space are:

[0134] The core logic of MDP decision-making in the global search stage is to model the search space as a dynamic system of "state-action-reward", guide the search direction by maximizing long-term cumulative rewards, and avoid falling into local optimality.

[0135] First, define the state space, state Including: current infrared camera focal length position , image clarity evaluation value , the surface temperature of the observed target , and search history .

[0136] Then define the action space. Action A includes the strategy of adjusting the focus of the camera lens. If the camera has a fixed step length, then there are three actions: focus +, focus -, and stop. If the camera has an adjustable focus, then the fixed focus is defined as ,have 、 And these three actions 0.

[0137] Finally, define the reward function , which is divided into three parts: clarity improvement reward, exploration reward and environmental factor penalty.

[0138] The first part is a reward for clarity improvement. If the new state Image clarity rating Better than the current optimal clarity rating , give positive rewards , is the clarity bonus coefficient.

[0139] The second part is the exploration reward, which rewards the action of exploring a new focal area (the focal position has not appeared in the historical search) ,in Focus position Number of visits, is the clarity bonus coefficient.

[0140] The third part is the environmental factor penalty, which can limit the environmental information and can be modified according to the specific parameters of the camera. For example, if the absolute temperature T of the observed target exceeds the appropriate range, or if the large focal length change does not significantly improve the clarity, a negative reward will be given. , is the penalty coefficient. The overall formula is as follows:

[0141] ;

[0142] In this embodiment, the specific steps of MDP decision-making in the global search phase are:

[0143] Randomly set the initial focal length within the focal length range of the infrared camera , or set the focus position of the infrared camera when it is turned on to , calculate the clarity evaluation value of the image at this time , get the current temperature , set the initial optimal clarity evaluation value , initialize the search history to empty, , get the initial state .

[0144] There are random strategies and heuristic strategies for selecting the initial choice. It should be noted here that, assuming the focal length is a fixed step size. In general situations (random scenes or scenes never before encountered), the initial stage uses uniformly random selection of focus adjustment actions to quickly explore the image clarity corresponding to different focal lengths. If there is sufficient focus experience for the camera type and shooting scene, and a rough estimate of the possible focal length range can be made, a heuristic strategy can be used to combine prior knowledge to set the initial action distribution.

[0145] If you have prior knowledge of focus, this refers to focal length adjustment. After that, under certain temperature conditions, the probability distribution of the state transition to the new clarity evaluation value and focus position is: If there is no prior knowledge, the transfer model can be fitted through historical data to determine .

[0146] based on The action selection of the greedy strategy is based on probability Randomly explore the action space to Select the current optimal strategy.

[0147] ;

[0148] in is the action value function, which means that in state Next action The expected long-term cumulative rewards; is the state transition probability.

[0149] Execute an action , adjust the camera lens focal length to get the new focal length , collect new image frames and calculate their clarity evaluation values , get the ambient temperature at this time , thus obtaining a new state , and record the current state and action in the search history. Calculate the reward based on the reward function , update cumulative rewards ,in is the discount factor, .

[0150] Update the action-value function using the Time Series Query (TD) algorithm :

[0151] ;

[0152] In the above formula is the learning rate, which controls the step size of each update and can be reduced as the iteration proceeds, making the update gradually stable. The value gradually approaches the optimal action value, guiding strategy optimization.

[0153] When the accumulated rewards It tends to be stable, indicating that the strategy converges; the optimal clarity evaluation value is continuous If no update is made in the iterations, and it is determined that it has fallen into the local optimum, it is possible to consider re-initializing the state randomly and continue searching; the preset maximum number of iterations has been reached The MDP decision process ends when any of the above three conditions are met. And the optimal focus position is output. And the optimal clarity evaluation value .

[0154] The MDP decision module uses a "state-action-reward" model to search for a focal position globally, effectively avoiding being trapped in a local optimum. The reward function design comprehensively considers clarity improvement, new area exploration, and environmental factors, guiding the system to balance exploration and development during the search process, improving search efficiency and accuracy. Combining stochastic and heuristic strategies allows for flexible action selection based on different scenarios, enhancing the system's adaptability and robustness.

[0155] As a preferred embodiment of the present invention, a local optimization hill climbing algorithm is used for the autofocus module, specifically:

[0156] Set the current focal length position as the calibration point , at this time the clarity evaluation value is ; Get an image of it when the focal length increases, set the focal length position to , the clarity evaluation value is ; Get an image of it with a reduced focal length and set the focal length position to , the clarity evaluation value is .

[0157] when When the calibration point is updated to position and perform the climbing action again.

[0158] when When the calibration point is updated to position and perform the climbing action again.

[0159] when and When , randomly update the calibration point to or position and perform the climbing action again.

[0160] when and , it is judged as the final focal length position.

[0161] A localized, refined search is performed within the pre-screened area obtained through global search, fully leveraging the results of the global search to improve focusing accuracy. The hill climbing algorithm is simple and efficient, quickly converging to the local optimal solution. Combined with the MDP decision module, it achieves an organic integration of global search and local optimization, ensuring the absolute optimal focusing position is found.

[0162] As a preferred embodiment of the present invention, for the interrupt response module, when the hill climbing algorithm is running, and When the stepper motor adjusts the focal length to When the focus is determined to be stable in the optimal area, a stop command for the motor brake is immediately sent to the hardware.

[0163] The interrupt response module can detect the focus status in real time and trigger a hardware interrupt in time when the optimal focus position is reached, terminating the focus adjustment, avoiding over-adjustment, shortening the focusing time, and improving the response speed of the infrared camera to meet the demand for fast focusing on dynamic targets, ensuring the real-time performance and accuracy of the system.

[0164] like Figure 2 As shown, a hybrid focusing method for an infrared camera based on MDP decision-making is provided in one embodiment of the present invention, based on the above system, including the following specific steps:

[0165] Step 1: Use an infrared camera to capture real-time images, and use a temperature sensor to collect ambient temperature and the surface temperature of the observed target;

[0166] Step 2: Perform image preprocessing through spatial domain mean filtering to eliminate instantaneous noise and obtain grayscale image data;

[0167] Step 3: Calculate the clarity evaluation value of the current image, and then perform dynamic trend compensation on the clarity evaluation value through Kalman filtering;

[0168] Step 4: Combine the image clarity evaluation value information and temperature data to establish a Markov decision model and perform the global search phase of autofocus;

[0169] Step 5: Perform local optimization using the hill climbing algorithm to determine the optimal focal length position;

[0170] Step 6: After the stepper motor reaches the optimal focal length position, send a stop command to the hardware to apply the motor brake.

[0171] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An infrared camera hybrid focusing system based on MDP decision, characterized in that: include: The data acquisition module is used to collect real-time images from the infrared camera and collect the ambient temperature and the surface temperature of the observed target through the temperature sensor; The dual-mode noise suppression module is used to pre-process the collected image information, calculate the clarity evaluation value and obtain a smooth evaluation function; MDP decision module, used for global search and locking the interval position of the best focus position; Automatic focusing module, used for local optimization, drives the stepper motor to achieve precise focusing; Interrupt response module, used to interrupt hardware control when determining that optimal focus is achieved; The specific steps of MDP decision-making in the global search phase are: Randomly set the initial focal length d0 within the focal length range of the infrared camera, or set the focal length position of the infrared camera to d0 when it is turned on, and calculate the image clarity evaluation value z at this time t , get the current temperature T0, set the initial optimal clarity evaluation value z best =z0, initialize the search history to empty, Get the initial state s0=(d0,z0,T0,history 1:0 ); Assuming that the focal length Δd is a fixed step length, the focus adjustment action is uniformly randomly selected in the initial stage. If there is focus experience for the camera type and shooting scene, a heuristic strategy is used to combine prior knowledge to set the initial action distribution; Action selection based on ∈ greedy strategy, randomly explore the action space with probability ∈, and select the current optimal strategy with 1-∈; Where Q(s t ,a) is the action value function, which means that in state s t The expected long-term cumulative reward of executing action a under the following conditions; P is the state transition probability; Execute action a t , adjust the camera lens focal length to get the new focal length d t+1 , collect new image frames and calculate their clarity evaluation value z t+1 , get the ambient temperature T at this time t+1 , thus obtaining the new state s t+1 =(d t+1 ,z t+1 ,T t+1 ,history 1:t+1 ), and record the current state and action into the search history; calculate the reward r according to the reward function t =R(s t ,a t ,s t+1 ), update the cumulative reward G t+1 =G t +ξ t r t , where ξ is the discount factor, 0<ξ<1; Use the time series query algorithm to update the action value function Q(s t ,a t ): Q(s t ,a t )←Q(s t ,a t )+κ[r t +γmax a′ Q(s t+1 ,a′)-Q(s t ,a t )] In the above formula, κ is the learning rate, which controls the step size of each update. It can be reduced as the iteration proceeds, making the update gradually stable and the Q value gradually approaching the optimal action value, guiding the strategy optimization; When the cumulative reward G t The optimal clarity evaluation value is not updated for l consecutive iterations or reaches the preset maximum number of iterations p; the MDP decision process ends when any of the three conditions are met, and the optimal focus position d is output. best And the optimal clarity evaluation value z best .

2. The infrared camera hybrid focusing system based on MDP decision according to claim 1, characterized in that: For the data acquisition module, the specific steps for collecting the ambient temperature and the surface temperature of the observed target through the temperature sensor are as follows: The ambient temperature at the current moment t is obtained through a thermometer and calibrated as T t The infrared camera outputs a thermal image based on the infrared radiation emitted by the observed target surface. The value of each pixel is the radiation intensity received within a certain wavelength range. The relationship between radiation intensity and temperature is expressed by the formula: Where I is the radiation intensity received by the infrared camera from the observed target surface; is the emissivity of the surface of the observed target, that is, the ratio of the radiation ability of the surface of the observed target to the radiation ability of the black body, which is between 0 and 1; σ is the Stefan-Boltzmann constant; T is the absolute temperature of the observed target; Solve the formula inversely to obtain the surface temperature of the observed target and obtain the surface temperature t of the observed target at the current moment. t The formula is:

3. The infrared camera hybrid focusing system based on MDP decision according to claim 2, characterized in that: For the dual-mode noise suppression module, random noise is eliminated through multi-frame mean filtering when preprocessing image information. Specifically: The infrared camera collects image sequences at the set frame rate and transmits them to the dual-mode noise suppression module. For the N frames of images collected, for the pixel with coordinates (x, y), the filtered gray value I of the pixel is filtered (x,y) is: Among them, I i (x,y) represents the grayscale value of the pixel at coordinate (x,y) of the i-th frame image.

4. The infrared camera hybrid focusing system based on MDP decision according to claim 3, characterized in that: When preprocessing image information, Kalman filtering is used to perform dynamic trend compensation on the clarity evaluation value. Specifically: Construct a state space model, and the state equation is: Where x t is the real evaluation value of the clarity at the current moment; t t is the surface temperature of the observed target at the current moment; η is the autocorrelation function of clarity; b is the influence coefficient of temperature on clarity; w t is the system process noise, which obeys the normal distribution v t is the random drift of temperature; Observation equation: z t =x t +n t Where z t is the clarity evaluation value calculated by the image algorithm, n t is the observation noise; Use temperature data to predict clarity trends based on clarity estimates from the previous moment and the current target surface temperature t t , predicting the prior estimate of the current clarity The state prediction equation is: The covariance prediction equation is: is the prior estimate covariance, reflecting the prediction uncertainty; B is the process noise covariance; P t-1 is the covariance estimate at the previous moment; Then, the prediction is corrected using the observed value, and the Kalman gain K t The calculation formula is as follows: In the above formula, if the observation noise n t Little K. t As it approaches 1, the observed value is more trusted; On the contrary, the predicted value is more trusted; Combined with the clarity evaluation value z t Correct the prior estimate to obtain the posterior estimate of clarity The expression: Corrected covariance P t Reflecting the reduction of estimation uncertainty, P t Updated to:

5. The infrared camera hybrid focusing system based on MDP decision according to claim 4, characterized in that: Get the clarity evaluation value z t The specific logic is: For an image I(x,y), its Laplace transform is defined as: Perform Laplace template convolution on the grayscale image to obtain the edge response map L(x,y); for each pixel (i,j): L(i,j)=I(i-1,j)+I(i+1,j)+I(i,j-1)+I(i,j+1)-4I(i,j) Then z t The calculation formula is: In the above formula, M is the number of pixels in the image; and because of the positive and negative symmetry of L, the mean approaches 0, so L is simplified 2 The mean of:

6. The infrared camera hybrid focusing system based on MDP decision according to claim 5, characterized in that: For the MDP decision module, the specific steps of MDP decision definition state space are: First, define the state space. The state S includes: the current infrared camera focal length position d, the image clarity evaluation value z t , the surface temperature of the observed target t t , and search history history; Let's define the action space again. Action A includes the strategy for adjusting the camera lens focus. If the camera has a fixed step size, there are three actions: focus +, focus -, and stop. If the camera has an adjustable focus, the fixed focus is defined as Δd, and there are three actions: +Δd, -Δd, and 0. Finally, define the reward function R(s t ,a t ,s t+1 ), which is divided into clarity improvement rewards, exploration rewards, and environmental factor penalties; For clarity improvement reward, if the new state s t+1 Image clarity evaluation value z t+1 Better than the current optimal clarity evaluation value z best , give positive reward R = +α(z t+1 -z best ), α is the clarity reward coefficient; For exploration reward, the action of exploring new focal areas is rewarded R = +β / (1+N(d t+1 )), where N(d t+1 ) is the focus position d t+1 The number of visits, β is the clarity reward coefficient; For environmental factor penalties, it is used to limit environmental information and give a negative reward R = -γ, where γ is the penalty coefficient; the overall formula is as follows:

7. The infrared camera hybrid focusing system based on MDP decision according to claim 6, characterized in that: For the autofocus module, a local optimization hill climbing algorithm is used. Specifically: Set the current focal length position as the calibration point p n , at this time the clarity evaluation value is z n ; Get an image of it when the focal length increases, and set the focal length position to p n+1 , the clarity evaluation value is z n+1 ; Get an image of it with a reduced focal length and set the focal length position to p n-1 , the clarity evaluation value is z n-1 ; When z n-1 <z n <z n+1 When the calibration point is updated to p n+1 Position, re-execute the climbing action; When z n-1 >z n >z n+1 When the calibration point is updated to p n-1 Position, re-execute the climbing action; When z n-1 >z n And z n <z n+1 When the calibration point is randomly updated to p n+1 or p n-1 Position, re-execute the climbing action; When z n-1 <z n And z n >z n+1 , it is judged as the final focal length position.

8. The infrared camera hybrid focusing system based on MDP decision according to claim 7, characterized in that: For the interrupt response module, when the hill climbing algorithm is running, z appears n-1 <z n And z n >z n+1 When the stepper motor adjusts the focal length to p n When the focus is determined to be stable in the optimal area, a stop command for the motor brake is immediately sent to the hardware.

9. A hybrid focusing method for an infrared camera based on MDP decision, based on the hybrid focusing system for an infrared camera based on MDP decision according to any one of claims 1 to 8, characterized in that: The specific steps include: Step 1: Use an infrared camera to capture real-time images, and use a temperature sensor to collect ambient temperature and the surface temperature of the observed target; Step 2: Perform image preprocessing through spatial domain mean filtering to eliminate instantaneous noise and obtain grayscale image data; Step 3: Calculate the clarity evaluation value of the current image, and then perform dynamic trend compensation on the clarity evaluation value through Kalman filtering; Step 4: Combine the image clarity evaluation value information and temperature data to establish a Markov decision model and perform the global search phase of autofocus; Step 5: Perform local optimization using the hill climbing algorithm to determine the optimal focal length position; Step 6: After the stepper motor reaches the optimal focal length position, send a stop command to the hardware to apply the motor brake.