Infrared thermal imaging fast automatic focusing method and system

By optimizing the automatic focusing algorithm of infrared thermal imaging equipment and combining Gaussian and median filtering, the problems of focusing oscillation and long time consumption are solved, and a fast, smooth and precise focusing effect is achieved, which is suitable for security monitoring applications in complex environments.

CN120455843BActive Publication Date: 2025-10-24HANGZHOU HUANYU VISION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510887006.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-10-24
Estimated Expiration
2045-06-30

AI Technical Summary

Technical Problem

Existing infrared imaging devices have problems with large fluctuations and long focusing time, especially when switching scenes, the picture is blurred and the clarity changes frequently, affecting the user experience.

Method used

An infrared thermal imaging fast automatic focusing method is adopted. Through the steps of image data acquisition, clarity evaluation, median filtering processing, real-time recording of clarity evaluation value, control of focusing direction and step size, overshoot detection and backoff, etc., combined with Gaussian filter and median filter modules, the focusing algorithm is optimized, and the lens optical path is adjusted using the motor drive module.

Benefits of technology

It reduces the oscillation phenomenon during the focusing process, provides a smooth user experience, significantly speeds up the focusing speed, improves the focusing accuracy and the ability to adapt to complex environments, and expands the application range of infrared thermal imaging equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455843B_ABST
    Figure CN120455843B_ABST
Patent Text Reader

Abstract

The application discloses an infrared thermal imaging rapid automatic focusing method and system, which reduces the large amplitude oscillation phenomenon generated by the traditional focusing mode during picture switching or triggering focusing by optimizing the focusing algorithm, provides a smoother user experience, can significantly speed up the focusing speed without sacrificing the focusing accuracy, especially when far away from the clear point, the peak point can be quickly approached by increasing the step size, and when close to the clear point, the step size is reduced to ensure accurate positioning, a Gaussian filter is introduced to exclude noise interference, and median filter processing is adopted to process abnormal data, the accuracy and reliability of the definition evaluation value are improved, the focusing accuracy is improved, the application is suitable for security monitoring applications in high and low temperature difference scenes, can effectively cope with challenges in complex environments, and enhances the application range and effect of the infrared thermal imaging equipment.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of infrared imaging, in particular to an infrared thermal imaging fast automatic focusing method and system. BACKGROUND

[0002] At present, the existing product automatic focusing scheme mostly adopts a large range search clear point way to focus. This focusing way usually has a large amplitude shock feeling in the picture when the scene is switched and the focusing is triggered, which affects the user experience. Especially when the current picture is already clear, but still needs to trigger the focusing, the picture will first be blurred in a large range, then clear, and then blurred again, thus bringing the shock feeling and increasing the focusing time consumption.

[0003] In view of the above, there is a need for an infrared thermal imaging fast automatic focusing method and system to solve the problems existing in the prior art. SUMMARY

[0004] In view of the deficiencies of the prior art, the present application provides an infrared thermal imaging fast automatic focusing method and system, which aims to solve the above problems.

[0005] To achieve the above purpose, the present application provides the following technical scheme: an infrared thermal imaging fast automatic focusing method, comprising the following steps:

[0006] Step S1: image data acquisition, the thermal imaging detector captures the thermal radiation of the object, the lens focuses the infrared thermal radiation image on the infrared sensor, and the original image data is collected and sent to the FPGA module for processing;

[0007] Step S2: sharpness evaluation calculation, extracting image edge information, calculating the sharpness evaluation value of the current picture through the sharpness evaluation function;

[0008] Step S3: median filter processing, storing the sharpness evaluation value data of each frame of the image into a queue, sorting the sharpness evaluation value in the queue, and taking the median as the filtered sharpness evaluation value;

[0009] Step S4: recording the maximum value of the sharpness evaluation value and the corresponding Focus motor position in real time;

[0010] Step S5: controlling the focusing direction and step length, calculating the slope of the sharpness evaluation value curve, and adjusting the Focus motor step length according to the slope;

[0011] Step S6: overshoot detection and backtracking, detecting the sharpness evaluation value, if the sharpness evaluation value is continuously reduced, it is determined that the Focus motor has passed the clear point, the Focus motor is driven to reverse and retreat to the recorded maximum sharpness evaluation value position, and the focusing is completed.

[0012] Optionally, in the step S1, the FPGA module performs image preprocessing by the following method:

[0013] The image is smoothed by a Gaussian filter, and the smoothing degree is controlled by adjusting the standard deviation.

[0014] The Gaussian filter formula is:

[0015] ,

[0016] In the formula, σ is the standard deviation, x is the horizontal coordinate of the pixel point, and y is the vertical coordinate of the pixel point.

[0017] Optionally, in the step S3, the median is taken as the filtered definition evaluation value by the following method:

[0018] The queue length is set to L, and the queue length is determined. If the queue length is odd, the median is:

[0019] , ,

[0020] If the queue length is even, the median is:

[0021] .

[0022] Optionally, in the step S5, the slope of the definition evaluation value curve is calculated by the following method:

[0023] D fv = (FV1-FV2) / FV2, in which FV1 is the current field definition evaluation value, and FV2 is the previous field definition evaluation value.

[0024] Optionally, in the step S5, the Focus motor step size is adjusted according to the slope by the following method:

[0025] When the slope is less than the slope threshold, the definition evaluation value curve is flat, and the Focus motor step size is increased.

[0026] When the slope exceeds the slope threshold, the Focus motor step size is decreased.

[0027] Optionally, when the Focus motor is in the definition peak value region, the step size of the Focus motor is proportional to the curve slope D fv , and the step size adjustment amount is:

[0028] , in which k and m are compensation adjustment coefficients, k is the scaling amount of the slope, m is the offset amount of the slope value, and D fv is the slope of the definition evaluation value curve.

[0029] An infrared thermal imaging rapid automatic focusing system adopts an infrared thermal imaging rapid automatic focusing method, and comprises an infrared thermal imaging core module, a data processing module, a median filter module, a focusing control algorithm module, an overshoot detection and back-off module and a motor driving module.

[0030] The infrared thermal imaging core module is used for collecting infrared thermal radiation data of a target object.

[0031] The data processing module is used for receiving an original image, performing bottom layer filtering, edge extraction and definition evaluation.

[0032] The median filter module is used for performing sliding window median filtering on the definition evaluation value, and eliminating abnormal data.

[0033] The focusing control algorithm module is used for dynamically adjusting motor compensation according to a definition evaluation value slope, and controlling a focusing direction.

[0034] The overshoot detection and back-off module is used for detecting a continuous decrease of the definition evaluation value, triggering a back-off mechanism, and driving the motor to return to a maximum definition evaluation value position.

[0035] The motor driving module is used for receiving an algorithm instruction, controlling the motor to move, and adjusting a lens optical path.

[0036] Optionally, a working process of the infrared thermal imaging module is as follows: an infrared detector captures thermal radiation data, generates an original gray scale image, and transmits the original gray scale image to an FPGA module.

[0037] A working process of the data processing module is as follows: the original gray scale image is received, Gaussian filtering is performed, edge information is extracted, and a current definition evaluation value is calculated.

[0038] Optionally, a working process of the median filter module is as follows: a queue length is set, a sliding window is used to update definition evaluation value data in real time, and a median is output after sorting.

[0039] A working process of the focusing control algorithm module is as follows: a slope of a definition evaluation value curve is calculated, and a step length is dynamically adjusted according to the calculated slope.

[0040] Optionally, a working process of the overshoot detection and back-off module is as follows: the definition evaluation value is detected, when the definition evaluation value is continuously decreased, the definition evaluation value is returned to a maximum definition evaluation value position, and focusing is completed.

[0041] The present application has the following beneficial effects:

[0042] 1. By optimizing the focusing algorithm, the present invention reduces the large fluctuations that occur in traditional focusing methods when switching between images or triggering focus, providing a smoother user experience and significantly accelerating focusing speed without sacrificing focus accuracy. In particular, when far from a clear point, the step size can be increased to quickly approach the peak point; when approaching a clear point, the step size is reduced to ensure precise positioning.

[0043] 2. In this invention, a Gaussian filter is introduced to eliminate noise interference, and a median filter is used to process abnormal data, thereby improving the accuracy and reliability of the clarity evaluation value, thereby enhancing the precision of focus. It is suitable for security monitoring applications in scenes with high and low temperature differences, can effectively cope with challenges in complex environments, and enhance the application scope and effect of infrared thermal imaging equipment;

[0044] 3. In the present invention, in order to address the problem of low control accuracy of DC motors, the step size is adjusted by adjusting the coefficients k and m, which effectively reduces the overshoot when approaching the clear point and ensures the smoothness of the focusing process. The system can record the maximum clarity evaluation value and its corresponding focus position information in real time, and when it detects that the clarity begins to decrease, it reverses and falls back to the optimal focus position to fix the focus, further ensuring the accuracy and efficiency of focusing. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 The present invention is a schematic diagram of a process structure of a method.

[0046] Figure 2 This is a clarity evaluation value curve diagram before median filtering of the present invention.

[0047] Figure 3 This is a clarity evaluation value curve diagram after median filtering of the present invention. DETAILED DESCRIPTION

[0048] In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0049] like Figure 1 、 2 As shown in FIG3 , a method for rapid automatic focusing of infrared thermal imaging comprises the following steps:

[0050] Step S1: Image data acquisition: The thermal imaging detector captures the thermal radiation of the object being photographed. The lens focuses the infrared thermal radiation image onto the infrared sensor, collects the original image data, and sends it to the FPGA module for processing.

[0051] Step S2: sharpness evaluation calculation, extracting image edge information, calculating the sharpness evaluation value of the current picture through the sharpness evaluation function;

[0052] Step S3: median filter processing, storing the sharpness evaluation value data of each frame of the image into a queue, sorting the sharpness evaluation values in the queue, and taking the median as the filtered sharpness evaluation value;

[0053] Step S4: recording the maximum value of the sharpness evaluation value and the corresponding Focus motor position in real time;

[0054] Step S5: controlling the focusing direction and step size, calculating the slope of the sharpness evaluation value curve, and adjusting the Focus motor step size according to the slope;

[0055] Step S6: overshoot detection and backtracking, detecting the sharpness evaluation value, if the sharpness evaluation value is continuously reduced, it is determined that the Focus motor has passed the sharpness point, and the Focus motor is driven in reverse to retreat to the position of the recorded maximum sharpness evaluation value, and the focusing is completed.

[0056] The infrared thermal imaging core is usually composed of special thermal imaging lenses, thermal imaging detectors and other components. Among them, the thermal imaging detector is mainly used to capture the thermal radiation of the object, and the lens is mainly used to focus the infrared thermal radiation image on the infrared sensor. After the thermal imaging detector collects the original image data, the image gray data is sent to the FPGA module for processing. The FPGA extracts the edge information of the current image source data through the bottom filter algorithm, and calculates and outputs the sharpness evaluation value of the picture, i.e. Focus Value, FV value, through the sharpness evaluation function. Generally, the clearer the picture, the larger the sharpness evaluation value.

[0057] Changing the Focus motor position will change the optical path in the lens, eventually making the imaging focal plane fall on the sensor plane, so as to obtain a clear picture. The automatic focusing algorithm, the algorithm module will give the direction, step size and other information of the Focus motor that needs to be driven next according to the current and historical picture sharpness evaluation value, and move the motor to make the picture finally clear. In order to further improve the accuracy of the sharpness evaluation value and exclude noise interference, a Gaussian filter is introduced in the filtering stage.

[0058] The image is smoothed through the Gaussian filter, and the smoothing degree is controlled by adjusting the standard deviation;

[0059] The Gaussian filter formula is:

[0060] ,

[0061] In the formula, σ is the standard deviation, x is the horizontal coordinate of the pixel point, and y is the vertical coordinate of the pixel point.

[0062] The slope of the sharpness evaluation value curve is calculated by the following method:

[0063] D fv = (FV1 - FV2) / FV2, where FV1 is the current field sharpness evaluation value, and FV2 is the last field sharpness evaluation value.

[0064] When the current Focus motor position is away from the sharpness point, the curve is relatively flat, that is, the sharpness evaluation value changes little with each step of the motor, that is, D fv is small, and the step size can be increased to quickly approach the peak point. When the real-time curve slope exceeds the preset slope threshold, the speed is reduced. Considering that the current thermal imaging lens uses a DC motor, which has lower control precision than a stepper motor, even if the current curve slope exceeds the preset threshold Dthreshold and the driving step size is reduced at the software level, there is still a problem of large overshoot. Therefore, when approaching the sharpness point, the speed needs to be further reduced; according to test data, it is found that the curve near the sharpness point is basically smooth, and its shape is close to the shape of the peak point of the normal distribution function curve, that is, when approaching the peak point, the step size of the Focus motor is proportional to the curve slope D fv , that is, the smaller D fv , the smaller the step size; therefore, it can be expressed by the following formula:

[0065] , where k and m are compensation adjustment coefficients, k is the scaling amount of the slope, m is the offset amount of the slope value, and D fv is the sharpness evaluation value curve slope.

[0066] Since D fv is positive before reaching the peak point, the step size adjustment amount is negative. If D fv is smaller, it indicates that the current Focus is closer to the sharpness point, and the step size adjustment amount△step is smaller. When added to the current step size data, it indicates that the step size is smaller. By adjusting the coefficients k and m, the overshoot amount when passing through the sharpness point during automatic focusing can be well reduced, thereby reducing the overshoot and shock feeling without sacrificing the focusing speed.

[0067] If the current Focus motor position is in a very blurred picture, the FV curve usually has no trend or appears as a burr, and there may even be occasional abnormal data. At this time, if the Focus adjustment step size is small, it may cause the final focus to be in a blurred position, resulting in a failed focus.

[0068] To solve this problem, the algorithm introduces a sliding window median filter module. After the Focus motor obtains the definition evaluation information for each frame, the current data is sent to the data queue Q. The data in the queue is arranged in the form of FILO (First In Last Out). The queue length L can be configured according to the actual debugging effect. The sliding window moves synchronously and fills the current FV data into the queue Q every time the Focus motor moves. When the data is filled, the entire data queue is sorted from small to large, and the median value is taken and output.

[0069] The queue length is set to L. If the queue length is odd, the median is:

[0070] , ,

[0071] If the queue length is even, the median is:

[0072] .

[0073] The output filtered data is the average of the middle two data after sorting.

[0074] In the above process, the program records the maximum FV value and the corresponding Focus position information in real time. When the program detects that the FV value starts to decrease and continuously decreases for n times, it is considered that the Focus motor has passed the clear point. At this time, the Focus motor is directly driven to retreat m steps in the reverse direction to the Focus position of the maximum FV value recorded, and the focusing process is completed.

[0075] An infrared thermal imaging rapid automatic focusing system adopts the infrared thermal imaging rapid automatic focusing method, and includes an infrared thermal imaging core module, a data processing module, a median filter module, a focusing control algorithm module, an overshoot detection and retreat module, and a motor driving module.

[0076] The infrared thermal imaging core module is used to collect infrared thermal radiation data of a target object.

[0077] The data processing module is used to receive an original image, perform bottom layer filtering, edge extraction, and definition evaluation.

[0078] The median filter module is used to perform sliding window median filtering on the definition evaluation value to eliminate abnormal data.

[0079] The focusing control algorithm module is used to dynamically adjust the motor compensation according to the definition evaluation value slope to control the focusing direction.

[0080] An overshoot detection and rollback module is configured to detect a continuous decrease in the sharpness evaluation value and trigger a rollback mechanism to drive the motor to return to the position of the maximum sharpness evaluation value.

[0081] A motor driving module is configured to receive algorithm instructions and control the movement of the motor to adjust the optical path of the lens.

[0082] The working process of the infrared thermal imaging module is as follows: the infrared detector captures thermal radiation data to generate a raw grayscale image, which is transmitted to the FPGA module.

[0083] The working process of the data processing module is as follows: the raw grayscale image is received, Gaussian filtering is performed, edge information is extracted, and the current sharpness evaluation value is calculated.

[0084] The working process of the median filter module is as follows: the queue length is set, the sliding window is used to update the sharpness evaluation value data in real time, and the median is output after sorting.

[0085] The working process of the focusing control algorithm module is as follows: the slope of the sharpness evaluation value curve is calculated, and the step size is dynamically adjusted according to the calculated slope.

[0086] The working process of the overshoot detection and rollback module is as follows: the sharpness evaluation value is detected, and when a continuous decrease in the sharpness evaluation value is detected, the system returns to the position of the maximum sharpness evaluation value to complete the focusing.

[0087] By optimizing the focusing algorithm, the present application reduces the large amplitude oscillation phenomenon caused by traditional focusing methods during picture switching or triggering focusing, provides a smoother user experience, and significantly speeds up the focusing speed without sacrificing focusing accuracy, especially when far away from the sharp point, the step size can be increased to quickly approach the peak point, and when close to the sharp point, the step size is reduced to ensure accurate positioning.

[0088] The Gaussian filter is introduced to eliminate noise interference, and the median filter is used to process abnormal data, which improves the accuracy and reliability of the sharpness evaluation value, thereby improving the accuracy of the focusing, and is suitable for security monitoring applications in high and low temperature difference scenes, can effectively cope with the challenges in complex environments, and enhances the application range and effect of the infrared thermal imaging equipment.

[0089] In view of the problem of low control accuracy of the DC motor, the step size is adjusted by adjusting the coefficients k and m, which effectively reduces the overshoot when approaching the sharp point, ensures the stability of the focusing process, and the system can record the maximum sharpness evaluation value and the corresponding focusing position information in real time, and when the sharpness starts to decrease, it is rolled back to the best focusing position to focus, which further ensures the accuracy and efficiency of the focusing.

[0090] The above merely describes preferred embodiments of the present application, and is not intended to limit the present application, and any modification, equivalent replacement or improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0091] The above described embodiments are only a preferred solution of the present application, and are not intended to limit the present application, and other variants and modifications can be made without departing from the technical solution recited in the claims.

Claims

1. A method for fast autofocusing of infrared thermal images, characterized by, The method comprises the following steps: Step S1: image data acquisition, a thermal imaging detector captures thermal radiation of an object, an infrared thermal radiation image is focused on an infrared sensor by a lens, original image data is collected and sent to an FPGA module for processing; Step S2: sharpness evaluation calculation, edge information of an image is extracted, and a sharpness evaluation value of a current picture is calculated by a sharpness evaluation function; Step S3: median filtering processing, the sharpness evaluation value data of each frame of the image is stored in a queue, the sharpness evaluation values in the queue are sorted, and a median is taken as a filtered sharpness evaluation value; Step S4: real-time recording of a maximum value of the sharpness evaluation value and a corresponding Focus motor position; Step S5: control of a focusing direction and a step size, calculation of a slope of a sharpness evaluation value curve, and adjustment of a Focus motor step size according to the slope; The slope of the sharpness evaluation value curve is calculated in the following manner: D fv = (FV1 - FV2) / FV2, where FV1 is the current field sharpness value, and FV2 is the previous field sharpness value. The step of the Focus motor is proportional to the slope D of the curve when the Focus motor is in the peak sharpness region fv The step adjustment amount is: , where k and m are compensation adjustment coefficients, k is a scaling amount of a slope value, m is an offset amount of a slope value, D fv is a curve slope of the definition evaluation value; Step S6: overshoot detection and back-off, detection of the sharpness evaluation value, determination that the Focus motor has passed a sharpness point if the sharpness evaluation value continuously decreases, and driving of the Focus motor in a reverse direction to back off to a position of a maximum sharpness evaluation value recorded, to complete focusing.

2. The method of claim 1, wherein the infrared thermography rapid auto focus method is characterized by, In the step S1, the FPGA module performs image preprocessing in the following manner: An image is smoothed by a Gaussian filter, and the smoothing degree is controlled by adjusting a standard deviation; The Gaussian filtering formula is as follows: , In the formula, σ is the standard deviation, x is the horizontal coordinate of a pixel point, and y is the vertical coordinate of the pixel point.

3. The method of claim 1, wherein the infrared thermographic rapid auto focus method is characterized by, In the step S3, the median is taken as the filtered sharpness evaluation value in the following manner: The queue length is set as L, the queue length is judged, if the queue length is odd, the median is: , , If the queue length is even, the median is: 。 4. The method of claim 1, wherein the infrared thermography rapid auto focus method is characterized by, In the step S5, the Focus motor step size is adjusted according to the slope in the following manner: When the slope is less than a slope threshold value, the sharpness evaluation value curve is gentle, and the Focus motor step size is increased; When the slope exceeds the slope threshold value, the Focus motor step size is decreased.

5. An infrared thermographic rapid auto-focusing system employing the infrared thermographic rapid auto-focusing method according to any one of claims 1 to 4, characterized in that, The infrared thermal imaging core module, the data processing module, the median filtering module, the focusing control algorithm module, the overshoot detection and back-off module, and the motor driving module are included. The infrared thermal imaging core module is used for collecting infrared thermal radiation data of a target object. The data processing module is used for receiving an original image, performing bottom layer filtering, edge extraction, and sharpness evaluation. The median filtering module is used for performing sliding window median filtering on the sharpness evaluation value, to eliminate abnormal data. The focusing control algorithm module is used for dynamically adjusting motor compensation according to the slope of the sharpness evaluation value, to control a focusing direction. The overshoot detection and back-off module is used for triggering a back-off mechanism when the sharpness evaluation value continuously decreases, to drive the motor to return to a position of a maximum sharpness evaluation value. The motor driving module is used for receiving an algorithm instruction, controlling motor movement, and adjusting a lens optical path.

6. The infrared thermography rapid auto-focus system of claim 5, wherein, The working process of the infrared thermal imaging core module is as follows: an infrared detector captures thermal radiation data, generates an original gray-scale image, and transmits the original gray-scale image to an FPGA module. The working process of the data processing module is as follows: an original gray-scale image is received, Gaussian filtering is performed, edge information is extracted, and a current sharpness evaluation value is calculated.

7. The rapid auto-focus system for infrared thermography according to claim 5, wherein, The median filtering module workflow is: setting the queue length, real-time updating the definition evaluation value data by sliding window, sorting and outputting the median; The focus control algorithm module workflow is: calculating the slope of the definition evaluation value curve, and dynamically adjusting the step size according to the calculated slope.

8. The rapid auto-focus system for infrared thermography according to claim 5, wherein, The overshoot detection and back-off module workflow is: detecting the definition evaluation value, and when the definition evaluation value continuously decreases, back-off to the maximum definition evaluation value position, and complete the focusing.

Citation Information

Patent Citations

  • Automatic focus adjustment method for zoom camera systems

    CN106534676A