Infrared zoom lens control method and system based on machine vision
By using a machine vision-based infrared zoom lens control method, multi-scale wavelet transform and sliding window integral algorithm are employed to optimize focal plane compensation, thus solving the problem of unstable focusing in traditional infrared zoom lens control and achieving stable imaging clarity and continuous focal length adjustment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-02
- Publication Date
- 2026-03-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional infrared zoom lens control methods struggle to accurately represent the focal plane shift trend during zooming. Local noise interference leads to distortion of the sharpness curve, and the reduced correlation between the mechanical travel reference and the actual imaging plane results in unstable focus adjustment, slow convergence, and disordered image sharpness recovery.
An infrared zoom lens control method based on machine vision is adopted. The infrared image thermal texture gradient is extracted by multi-scale wavelet transform algorithm, multi-scale thermal texture gradient amplitude matrix is generated, cross-scale thermal texture coupling feature matrix is calculated, dominant scale layer is identified and focal length adjustment weighting parameters are generated, sliding window integral algorithm is executed to optimize focal plane compensation step amount, and lens focal length adjustment command is generated.
It achieves continuous output of focus adjustment during zooming, with smooth step amplitude and stable convergence process, improving the problems of frequent jumps and compensation lag in traditional control, and improving the stability of image sharpness.
Smart Images

Figure CN121644941A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a method and system for controlling infrared zoom lenses based on machine vision. Background Technology
[0002] The field of computer vision technology involves using imaging devices to acquire visible or non-visible light images and performing machine-based analysis of image content through core processes such as feature extraction, target recognition, and scene understanding. Its overall technical system includes image acquisition, optical imaging, image preprocessing, visual feature construction, target localization, and multimodal imaging information fusion, and is widely used in scenarios such as security monitoring, autonomous driving, industrial inspection, and infrared detection.
[0003] The traditional infrared zoom lens control method refers to the control method in an infrared imaging device that uses the zoom group and focus group of the infrared lens to adjust the focal length and maintain the image sharpness. It uses the original infrared image output by the infrared detector as a basis, and acquires the image in real time during the zoom process. It uses a preset focal length position parameter table or mechanical stroke position as an adjustment reference, and calculates the current image using an image sharpness evaluation function to determine the focus direction and step amount. It relies on the execution of zoom drive and focus drive to complete the synchronous correction of focal length change and image plane position.
[0004] Traditional infrared zoom lens control relies on single-scale sharpness calculation and mechanical travel reference as the basis for judgment. During zooming, the thermal texture distribution of the image fluctuates non-uniformly with changes in the scene. Single-scale evaluation is weak in response to different texture levels and cannot accurately represent the focal plane shift trend. Local noise interference can easily cause sharpness curve distortion, resulting in unstable jumps in the focus direction and step size. The mechanical travel reference has reduced correlation with the real imaging surface under complex thermal fields, causing the compensation step to deviate from the proper trajectory. This leads to problems such as slow convergence, untimely correction, and disordered image sharpness recovery rhythm in zooming dynamics. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the existing technology and to propose a machine vision-based infrared zoom lens control method and system.
[0006] To achieve the above objectives, the present invention employs a machine vision-based infrared zoom lens control method, comprising the following steps:
[0007] S1: Multi-scale spatial sampling of infrared images is used to obtain thermal texture gradients. Multi-scale wavelet transform algorithm is used to extract thermal texture gradient amplitudes and statistically analyze spatial distribution characteristics to generate a multi-scale thermal texture gradient amplitude matrix.
[0008] S2: Call the multi-scale thermal texture gradient magnitude matrix, calculate the isotope ratio between adjacent scales pixel by pixel and perform smoothing, analyze the coupling strength change and extract the multi-scale gradient energy, and output the cross-scale thermal texture coupling feature matrix.
[0009] S3: Call the cross-scale thermal texture coupling feature matrix, perform first-order difference operation to detect extreme point migration and count the migration change, identify the dominant scale layer, and perform sign consistency judgment in combination with the current focal plane displacement value to generate focal length adjustment weighted parameters.
[0010] S4: Call the focal length control weighting parameters to perform weighted fusion of multi-scale gradient energy, use the sliding window integral algorithm to calculate the change in gradient energy after fusion, perform proportional mapping according to the weighting parameters, and output the focal plane compensation step amount.
[0011] S5: Call the focal plane compensation step amount, dynamically compress the current focal length step amount and optimize steady-state control, constrain the step amount within a preset stable threshold, and generate a lens focal length adjustment command.
[0012] As a further aspect of the present invention, the multi-scale thermal texture gradient magnitude matrix includes a gradient magnitude map, a scale index set, and a spatial distribution domain; the cross-scale thermal texture coupling feature matrix includes a scale coupling coefficient, an energy distribution sequence, and a ratio variation domain; the focal length control weighting parameters include a dominant scale weight, a displacement criterion value, and a sign consistency coefficient; the focal plane compensation step size includes a compensation step size, a proportional mapping coefficient, and a stability control threshold; and the lens focal length adjustment command includes a step control amount, an adjustment command code, and a feedback stabilization amount.
[0013] As a further aspect of the present invention, the step of obtaining the multi-scale thermal texture gradient magnitude matrix is as follows:
[0014] S111: Based on infrared images, a sampling interval is set in a multi-scale space. Gradient vector calculation is performed on the radiation intensity sequence of neighboring pixels of the sampling point. The gradient magnitude is compared with the scale weight threshold. Gradient vector indices with gradient magnitudes greater than the threshold are aggregated to generate a multi-scale gradient vector set.
[0015] S112: Call the gradient magnitude sequence in the multi-scale gradient vector set, perform multi-scale wavelet transform algorithm coefficient decomposition on the multi-scale sequence, compare the decomposed coefficient magnitude with the magnitude screening threshold, remove coefficient indices that are less than the threshold, reorganize the remaining indices, and obtain the scale magnitude coefficient group.
[0016] S113: Based on the amplitude sequence in the scale amplitude coefficient group, the sequence is arranged according to spatial location encoding, and the arranged amplitude units are matrixed according to the coordinate sequence number. Missing positions are filled with zero values to establish a multi-scale thermal texture gradient amplitude matrix.
[0017] As a further embodiment of the present invention, the scale weight threshold is set numerically by combining the mean gradient magnitude and the standard deviation of the gradient magnitude in a linear manner;
[0018] The amplitude screening threshold is calculated by taking the median and interquartile range of the coefficient amplitude sequence.
[0019] As a further aspect of the present invention, the step of obtaining the cross-scale thermal texture coupling feature matrix is as follows:
[0020] S211: Call the multi-scale thermal texture gradient magnitude matrix, extract the gradient magnitude data of corresponding pixel positions between adjacent scale levels, perform ratio calculation on the gradient magnitude of the same pixel in the upper and lower scales, arrange the ratio results according to the pixel coordinate position, and obtain the gradient ratio distribution matrix of adjacent scales.
[0021] S212: Using the adjacent-scale gradient ratio distribution matrix, extract the pixel gradient ratio and gradient magnitude change of the multi-scale layer using the following formula:
[0022] ;
[0023] Calculate the cross-scale thermal texture coupling rate, perform neighborhood mean filtering to smooth the numerical distribution of the coupling rate, analyze the characteristics of coupling strength variation, and obtain the coupling strength variation matrix;
[0024] in, Represents the cross-scale thermal texture coupling rate at pixel position (i, j). Represents the total number of scale layers. Represents the scale layer index. This represents the gradient ratio of scale layer s at pixel location (i, j). This represents the change in gradient magnitude at pixel location (i, j) of scale layer s. This represents the mean gradient ratio across multiple scales at pixel location (i, j). Represents the numerical stability constant;
[0025] S213: Call the coupling strength change matrix, perform differential operation on the pixel position coupling rate value along the scale dimension, statistically analyze the peak position and jump interval distribution of the coupling rate gradient, extract multi-scale gradient energy and fuse it with the coupling strength change data, and output a cross-scale thermal texture coupling feature matrix.
[0026] As a further aspect of the present invention, the step of obtaining the focal length adjustment weighted parameter is as follows:
[0027] S311: Call the cross-scale thermal texture coupling feature matrix, perform first-order difference operation on the multi-scale layer data, obtain the texture feature increment value of adjacent scale layers, detect the peak and valley positions in the increment value, record the coordinate offset between the position scale, statistically analyze the amplitude range, and generate the extreme point scale migration vector set.
[0028] S312: Based on the extreme point scale migration vector set, perform an accumulation operation on the migration vector magnitude within a single scale layer, calculate the scale layer dominance value, compare the dominance value with a preset dominance threshold, select scale layers that exceed the threshold, and identify them as dominant scale layer identifiers.
[0029] The preset dominant threshold is determined by dividing the original scale layer data into statistical intervals and based on the median value of the intervals.
[0030] S313: Based on the dominant scale layer identifier, extract the scale layer migration vector direction symbol, collect the current focal plane displacement value direction symbol, count the number of identical and opposite symbols, calculate the ratio of the number, assign a consistency factor, and integrate it with the migration cumulative intensity value to obtain the focal length control weighted parameter.
[0031] As a further aspect of the present invention, the step of obtaining the focal plane compensation step amount is as follows:
[0032] S411: Call the focal length control weighting parameter, perform element-wise weighting operation on the multi-scale gradient energy and weight vector, accumulate the weighted values with the same index, and perform matrix row and column normalization on the accumulated sequence to generate a weighted fused gradient energy matrix.
[0033] S412: Based on the weighted fusion gradient energy matrix, set the window length parameter and step parameter, extract the window gradient energy set according to the sliding window integration algorithm and perform interval integration operation, perform serialization aggregation and array processing on the integral value to obtain the fusion gradient energy change sequence;
[0034] S413: Based on the fusion gradient energy change sequence, call the focal length control weighting parameters as the scale coefficient set, perform item-by-item mapping on the sequence change and scale coefficients, and perform quantization and indexing processing on the mapped step values to output the focal plane compensation step amount.
[0035] As a further aspect of the present invention, the step of obtaining the lens focal length adjustment command is as follows:
[0036] S511: Based on the focal plane compensation step amount, perform amplitude retrieval on the current focal length step amount, calculate the difference between the two sets of amplitudes, perform interval judgment based on the difference sequence and the preset stable threshold, aggregate the differences within the threshold, and generate a compensation difference sequence.
[0037] S512: Call the compensation difference sequence to perform amplitude compression processing on the current focal length step, map the difference sequence to the corresponding elements of the step, and perform element-level summation to generate a compressed step sequence;
[0038] S513: Based on the compression step sequence, perform a limitation judgment on the sequence and the preset stable threshold, replace the elements higher than the threshold with the threshold, reconstruct the replaced sequence, convert it into an executable control instruction, and generate a lens focal length adjustment instruction.
[0039] As a further aspect of the present invention, the preset stability threshold is determined by extracting the upper limit of the interquartile range from the statistical results of the difference fluctuation range of the difference sequence;
[0040] The step of performing interval judgment based on the difference sequence and the preset stable threshold refers to selecting only the differences in the difference sequence whose absolute value does not exceed the preset stable threshold as the aggregation object, and generating the compensation difference sequence by linear accumulation.
[0041] The machine vision-based infrared zoom lens control system is used to execute the aforementioned machine vision-based infrared zoom lens control method. The system includes:
[0042] The image measurement module obtains thermal texture gradients by multi-scale spatial sampling of infrared images, extracts thermal texture gradient amplitudes and statistically analyzes spatial distribution features using a multi-scale wavelet transform algorithm, generates a multi-scale thermal texture gradient amplitude matrix, and transmits it to the scale analysis module.
[0043] The scale parsing module calls the multi-scale thermal texture gradient magnitude matrix, calculates the isotope ratio between adjacent scales pixel by pixel and performs smoothing, analyzes the coupling strength change and extracts the multi-scale gradient energy, outputs the cross-scale thermal texture coupling feature matrix, and passes it to the cross-layer coupling module.
[0044] The cross-layer coupling module calls the cross-scale thermal texture coupling feature matrix, performs first-order difference operation to detect extreme point migration and count the migration change, identifies the dominant scale layer, performs sign consistency judgment in combination with the current focal plane displacement value, generates focal length control weighting parameters, and passes them to the focal length weighting parameter module.
[0045] The focal length weighting parameter module calls the focal length control weighting parameter to perform weighted fusion of multi-scale gradient energy, uses the sliding window integral algorithm to calculate the change in gradient energy after fusion, performs proportional mapping according to the weighting parameter, outputs the focal plane compensation step amount, and transmits it to the step control module.
[0046] The step control module calls the focal plane compensation step amount to dynamically compress and optimize the steady-state control of the current focal length step amount, constraining the step amount within a preset stable threshold, and generating a lens focal length adjustment command.
[0047] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0048] In this invention, by constructing a multi-scale texture gradient structure from infrared images and extracting cross-scale coupling changes, the focus adjustment is made to determine the direction based on the coordinated trend of texture energy across scales. Extreme value migration analysis provides the dominant scale weight, so that the control is based on the global gradient evolution relationship rather than local strength differences. After fusion, the texture energy is extracted by integral method to reduce noise disturbances. The compensation step is kept within a stable range through mapping compression, so that the focus adjustment presents continuous output, smooth step amplitude and stable convergence process in the zoom stage, which improves the problems of frequent jumps and compensation lag in traditional control. Attached Figure Description
[0049] Figure 1 This is a schematic diagram of the workflow of the present invention;
[0050] Figure 2 This is a flowchart illustrating the process of obtaining the multi-scale thermal texture gradient magnitude matrix in this invention.
[0051] Figure 3 This is a flowchart illustrating the process of obtaining the cross-scale thermal texture coupling feature matrix in this invention.
[0052] Figure 4 This is a flowchart illustrating the acquisition of the focal length control weighting parameters in this invention.
[0053] Figure 5 This is a flowchart illustrating the process of obtaining the focal plane compensation step size in this invention.
[0054] Figure 6 This is a flowchart illustrating the process of obtaining the lens focal length adjustment command in this invention. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this invention clearer, the 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 merely illustrative and not intended to limit the invention.
[0056] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0057] Example 1
[0058] Please see Figure 1 This invention provides a machine vision-based method for controlling an infrared zoom lens, comprising the following steps:
[0059] S1: Multi-scale spatial sampling of infrared images is used to obtain thermal texture gradients. Multi-scale wavelet transform algorithm is used to extract thermal texture gradient amplitudes and statistically analyze spatial distribution characteristics to generate a multi-scale thermal texture gradient amplitude matrix.
[0060] S2: Call the multi-scale thermal texture gradient magnitude matrix, calculate the isotope ratio between adjacent scales pixel by pixel and perform smoothing, analyze the coupling strength change and extract the multi-scale gradient energy, and output the cross-scale thermal texture coupling feature matrix.
[0061] S3: Call the cross-scale thermal texture coupling feature matrix, perform first-order difference operation to detect extreme point migration and count the migration change, identify the dominant scale layer, combine the current focal plane displacement value to perform sign consistency judgment, and generate focal length adjustment weighted parameters.
[0062] S4: Call the focal length control weighting parameters to perform weighted fusion of multi-scale gradient energy, use the sliding window integral algorithm to calculate the change in gradient energy after fusion, perform proportional mapping according to the weighting parameters, and output the focal plane compensation step amount.
[0063] S5: Call the focal plane compensation step amount, dynamically compress the current focal length step amount and optimize steady-state control, constrain the step amount within the preset stable threshold, and generate lens focal length adjustment command.
[0064] The multi-scale thermal texture gradient magnitude matrix includes a gradient magnitude map, a scale index set, and a spatial distribution domain. The cross-scale thermal texture coupling feature matrix includes a scale coupling coefficient, an energy distribution sequence, and a ratio change domain. The focal length control weighting parameters include the dominant scale weight, displacement criterion value, and sign consistency coefficient. The focal plane compensation step size includes the compensation step size, the scaling factor, and the stability control threshold. The lens focal length adjustment command includes the step control amount, the adjustment command code, and the feedback stabilization amount.
[0065] Please see Figure 2 The specific steps for obtaining the multi-scale thermal texture gradient magnitude matrix are as follows:
[0066] S111: Based on infrared images, a sampling interval is set in a multi-scale space. Gradient vector calculation is performed on the radiation intensity sequence of neighboring pixels of the sampling point. The gradient magnitude is compared with the scale weight threshold. Gradient vector indices with gradient magnitudes greater than the threshold are aggregated to generate a multi-scale gradient vector set.
[0067] For fault monitoring scenarios, an infrared thermal imager with a resolution of 640×512 is used to acquire infrared radiation images of the target area. This infrared image is used as the basic data source. A multi-scale spatial hierarchy L is defined as three levels, with corresponding scale factors of 1, 0.5, and 0.25. The selected scale factor is... The original resolution level, setting the pixel sampling interval Using 2-pixel units, starting from the image center coordinates (320, 256), at intervals in the horizontal and vertical directions. Traverse the image, for a given sampling point For example, for a pixel with coordinates (120, 120), construct a 3×3 neighborhood window and extract the radiance values (grayscale values) of the 9 pixels within this window. Let the radiance of the center pixel be... The horizontally adjacent pixel intensities are respectively , The vertically adjacent pixel intensities are respectively , Perform gradient vector calculation, and calculate the horizontal gradient components respectively. With vertical gradient components Then, the gradient magnitude at that point is calculated:
[0068] ;
[0069] Repeat the above calculation for the sampling points at this scale to obtain the gradient magnitude sequence. Assuming we extract 5 consecutive values from this sequence... Perform statistical operations on the sequence to calculate the mean. Calculate the sum of squares of the differences between the values and the mean, and then obtain the standard deviation. Set linear combination coefficients This coefficient is preset based on the signal-to-noise ratio of the infrared image (set to 0.6 when the signal-to-noise ratio is higher than 30dB and to 0.8 when it is lower than 30dB), and the scale weight threshold is calculated. , convert the sequence Each value in Compare and determine , and Extract the gradient vector indices corresponding to the values that meet the conditions, and remove the low-frequency background noise indices corresponding to 25.50 and 22.10. Perform the above operations on the three scale levels respectively and aggregate the retained indices to generate a multi-scale gradient vector set.
[0070] S112: Call the gradient magnitude sequence in the multi-scale gradient vector set, perform multi-scale wavelet transform algorithm coefficient decomposition on the multi-scale sequence, compare the decomposed coefficient magnitude with the magnitude screening threshold, remove coefficient indices that are less than the threshold, reorganize the remaining indices, and obtain the scale magnitude coefficient group.
[0071] By calling the gradient magnitude sequence recorded in the multi-scale gradient vector set, and selecting the subsequence with a scale factor of 1 from the sequence to meet the needs of extracting minute temperature difference texture features in infrared images, a solution is found. For example, a sequence containing numerical values The Haar wavelet transform algorithm is applied to the sequence to perform single-level coefficient decomposition, separating approximate coefficients from detail coefficients, and extracting the magnitude sequence of detail coefficients. Assume the sequence of detail coefficients after decomposition and taking the absolute value is as follows: The coefficient sequence is sorted in ascending order to obtain Calculate the median of the sequence. The sequence length is 8, and the median is the average of the 4th and 5th digits. Calculate the quartiles, specifically the first quartile. The average of the second and third positions. Third and quartiles The average of the 6th and 7th digits. Calculate the interquartile range Set amplitude filtering coefficient (This coefficient is used to balance detail preservation and noise suppression; its value range is set to...) to (between), calculate amplitude filtering threshold , convert the sequence The original values in and Comparing them one by one, for the value 4, because It is determined to be invalid high-frequency noise and its index is removed. For numerical values... Coefficients greater than 4.75 are considered valid thermal texture features and their indices are retained. The remaining coefficient indices and their corresponding original amplitudes are recombined after filtering, and invalid items are removed to form a scale amplitude coefficient group of {85, 5, 90, 8, 88, 6, 92}.
[0072] S113: Based on the amplitude sequence in the scale amplitude coefficient group, the sequence is arranged according to spatial location encoding, and the arranged amplitude units are matrixed according to the coordinate sequence number. Zero values are used to fill in missing positions to establish a multi-scale thermal texture gradient amplitude matrix.
[0073] Extract the retained amplitude sequence and its corresponding spatial location coding information from the scale amplitude coefficient group. The spatial location coding includes the scale level. Horizontal coordinates with vertical coordinates As shown in Table 1, the table lists some of the filtered amplitude units and their corresponding spatial coordinate information. Based on the sampling range of the infrared image, a dimension of... The zero matrix is used as the initial multi-scale thermal texture gradient magnitude matrix, and the number of rows in the matrix is set. Column number (Corresponding to the local hotspot analysis area), read the data of serial number 1 in Table 1, obtain the amplitude 85 and its coordinates (15, 20), and assign the element in the 15th row and 20th column of the matrix to the value 85. Read the data of serial number 2, and assign the element in the 15th row and 22nd column of the matrix to the value 90. And so on, perform matrix construction on each amplitude unit in the sequence. For coordinates (15, 21), since no corresponding code was found in the coefficient group (the coefficient at this position was removed in the previous step because it was below the threshold), keep the matrix element at this position as the initial zero value, so as to fill the missing thermal texture position with zero value. Traverse the data of the coefficient group at all levels. If multi-scale fusion is involved, the amplitudes of different scales are superimposed on the same matrix dimension by interpolation. Finally, a multi-scale thermal texture gradient amplitude matrix reflecting the distribution characteristics of the target thermal radiation texture is established.
[0074] Table 1: Mapping Table of Amplitude Units and Spatial Coordinates After Filtering
[0075] Serial Number Amplitude value Scale level (s) Horizontal coordinate (x) Vertical coordinate (y) 1 85 1 15 20 2 90 1 15 22 3 88 1 16 20 4 92 1 16 22 5 120 0.5 8 10
[0076] As shown in Table 1, each row represents a retained feature point. The "amplitude value" comes from the screening result after wavelet transform, the "scale level" indicates the resolution level to which the feature belongs, and the "horizontal coordinate" and "vertical coordinate" precisely mark the position of the feature in the corresponding scale image matrix. The subsequent matrix assembly process strictly follows the coordinate information in this table to fill in the values.
[0077] Please see Figure 3 The specific steps for obtaining the cross-scale thermal texture coupling feature matrix are as follows:
[0078] S211: Call the multi-scale thermal texture gradient magnitude matrix, extract the gradient magnitude data of corresponding pixel positions between adjacent scale levels, perform ratio calculation on the gradient magnitude of the same pixel in the upper and lower scales, arrange the ratio results according to the pixel coordinate position, and obtain the gradient ratio distribution matrix of adjacent scales.
[0079] The constructed multi-scale thermal texture gradient magnitude matrix is invoked. This matrix has a dimension of 64×64 and contains gradient magnitude data for infrared images at S=3 scale levels (corresponding to scale factors of 1, 0.5, and 0.25). For any pixel coordinate position (i, j) in the matrix, for example, selecting the pixel with coordinates (15, 20), the gradient magnitude at that position is retrieved from the matrix dataset at multiple scales to obtain the gradient magnitude at the first scale level (original resolution). The gradient magnitude at the second scale level (0.5 times the resolution) And the gradient magnitude at the third scale level (0.25x resolution). The traversal range of the level index s is set to 1 to Z-1. That is, a loop operation is performed on level 1 and level 2 to calculate the gradient magnitude ratio of corresponding pixel positions between adjacent scale levels. For s=1, the ratio of the first level to the second level is calculated. For s=2, calculate the ratio of the second level to the third level. If the denominator is zero, the ratio is set to the preset extreme value of 10. After calculating the ratio of this pixel in adjacent layers, the generated ratio sequence is generated according to the pixel coordinates (15, 20). Spatial mapping and arrangement are performed, and the above extraction and ratio operation is repeated for 64×64 pixels in the matrix to construct a data structure with depth information and obtain the adjacent scale gradient ratio distribution matrix.
[0080] S212: Call the adjacent-scale gradient ratio distribution matrix to extract the pixel gradient ratio and gradient magnitude change of multi-scale layers, using the following formula:
[0081] ;
[0082] Calculate the cross-scale thermal texture coupling rate, perform neighborhood mean filtering to smooth the numerical distribution of the coupling rate, analyze the characteristics of coupling strength variation, and obtain the coupling strength variation matrix;
[0083] in, Represents the cross-scale thermal texture coupling rate at pixel position (i, j). Represents the total number of scale layers. Represents the scale layer index. This represents the gradient ratio of scale layer s at pixel location (i, j). This represents the change in gradient magnitude at pixel location (i, j) of scale layer s. This represents the mean gradient ratio across multiple scales at pixel location (i, j). Represents the numerical stability constant;
[0084] Call the adjacent scale gradient ratio distribution matrix and the original gradient magnitude data, and perform cross-scale thermal texture coupling rate quantization calculation for each pixel position (i, j). The parameters in the formula are defined as follows: Z=3 represents the total number of scale layers, s is the index of the scale layer being calculated (values 1 and 2), and (i, j) is the pixel coordinates being processed (e.g., (15, 20)). The calculated gradient ratio, The gradient magnitude change between adjacent scales is achieved through... Obtain This is the arithmetic mean of the ratios of the pixel across different scale layers. To prevent numerical stability constants with denominators of zero, it is set to... The advantage of the formula lies in the introduction of the gradient magnitude change. Ratio to gradient The weighted calculation couples the intensity variation of thermal texture in scale space with structural similarity. The numerator aggregates the amplitude variation energy weighted by the ratio, while the denominator utilizes the deviation of the ratio from the mean. The change is normalized as a penalty term, thereby highlighting the thermal texture features that maintain structural stability and significant energy across multiple scales, and suppressing spurious gradients caused by random noise. Actual calculations are performed based on the data of pixels (15, 20) as shown in Table 2: First, the change in gradient magnitude is calculated:
[0085] , ;
[0086] Calculate the mean of the ratios:
[0087] ;
[0088] Substitute the numerator of the formula into the summation operation:
[0089] item: ;
[0090] item: ;
[0091] Total of numerators ;
[0092] Substitute the values into the denominator of the formula and perform the summation operation:
[0093] item: ;
[0094] item: ;
[0095] Sum of denominators ;
[0096] Calculate the final coupling ratio: ;
[0097] The results show that the texture features at pixel (15, 20) have a high structural coupling degree (value greater than 1) in multi-scale space, and belong to significant thermal fault feature points. After the calculation of the pixel points, an initial coupling rate distribution map is generated, and a 3×3 neighborhood mean filter is performed on it. The mean coupling rate of the 9 pixels in the 3×3 region centered at (15, 20) is used to replace the original value to smooth local abrupt changes. The continuity of the smoothed values in space is analyzed to obtain the coupling strength change matrix.
[0098] Table 2: Multi-scale gradient and ratio parameter table at pixel (15, 20)
[0099] Parameters Values / Explanations First-level gradient magnitude ( ) 85 Second-level gradient magnitude ( ) 80 Third-level gradient magnitude ( ) 60 First-level gradient ratio ( ) 1.0625 Second-level gradient ratio ( ) 1.3333 Ratio Mean ( ) 1.1979
[0100] Table 2 lists the core basic data used to calculate the cross-scale thermal texture coupling rate, including the original gradient magnitudes at multiple scales and the calculated interlayer ratios. The data serves as the direct input for the formula calculation.
[0101] S213: Call the coupling strength change matrix, perform differential operation on the coupling rate values of pixel positions along the scale dimension, statistically analyze the peak position and jump interval distribution of the coupling rate gradient, extract multi-scale gradient energy and fuse it with the coupling strength change data, and output a cross-scale thermal texture coupling feature matrix.
[0102] The coupling strength change matrix is invoked. For each pixel location, the corresponding multi-scale hierarchical component terms (i.e., the corresponding terms for s=1 and s=2 in the numerator) are extracted during the formula calculation. Difference operations are performed along the scale dimension to calculate the coupling contribution difference between scale levels. For example, for pixel (15, 20), the calculation... The distribution of this difference across the entire map is statistically analyzed, and differences exceeding a preset peak threshold are identified. The location is marked as the peak position of the coupling rate gradient, and the interval where the value jumps is determined (such as the region where the difference suddenly increases from 5 to 20). The multi-scale gradient energy is extracted, and the energy value is obtained by calculating the sum of squares of the multi-scale gradient magnitudes. This energy value is compared with the smoothed coupling rate. Perform fusion multiplication to calculate fusion eigenvalues. This fusion operation is performed on pixels to output a cross-scale thermal texture coupling feature matrix.
[0103] Please see Figure 4 The specific steps for obtaining the focal length adjustment weighting parameters are as follows:
[0104] S311: Call the cross-scale thermal texture coupling feature matrix, perform first-order difference operation on multi-scale layer data, obtain the texture feature increment value of adjacent scale layer, detect the peak and valley positions in the increment value, record the coordinate offset between the position scale, statistically analyze the amplitude range, and generate the extreme point scale migration vector set.
[0105] The output cross-scale thermal texture coupling feature matrix is retrieved. This matrix contains thermal texture feature data at Z=3 scale levels. Taking the pixel (32, 32) in the center region of the matrix as an example, its feature value at the first scale level is extracted. , second-scale layer eigenvalues and the eigenvalues of the third scale layer Perform a first-order difference operation along the scale axis to calculate the feature increments between adjacent scales and obtain the first difference value. Second difference This operation is performed on the pixels within the matrix to construct a difference map. Within the neighborhood, the extreme point of the incremental value is retrieved. If the difference value of pixel (32, 32) is greater than the difference value of its 8 surrounding neighboring pixels, it is determined to be the peak position. The coordinate drift of this feature point between adjacent scale layers is tracked. Assuming that the center of the feature peak drifts to (33, 33) in the second scale layer, the coordinate offset between the scales of the recorded position is... An extreme point scale migration vector is constructed based on the coordinate offset and feature increment magnitude, and the vector magnitude is calculated. (A normalization coefficient of 1000 is introduced here to balance the magnitude), and the vector magnitudes across the entire map are statistically analyzed to generate a set of extreme point scale migration vectors containing position, direction, and magnitude information.
[0106] S312: Based on the extreme point scale migration vector set, perform an accumulation operation on the magnitude of the migration vector within a single scale layer, using the following formula:
[0107] ;
[0108] Calculate the dominance value of the scale layer, compare the dominance value with the preset dominance threshold, select the scale layer that exceeds the threshold, and identify it as the dominant scale layer.
[0109] in, This represents the dominance value at the m-th scale level. This represents the number of migration vectors for extreme points within the m-th scale layer. This represents the magnitude of the migration vector at the i-th extreme point in the m-th scale layer. The cross-scale thermal texture coupling feature matrix contains the total number of scale layers. Represents parameters for preventing zero disturbances;
[0110] The preset dominant threshold is determined by dividing the original scale layer data into statistical intervals and based on the median value of the intervals;
[0111] Based on the extreme point scale migration vector set, this targets the cross-scale thermal texture coupling feature matrix. Adjacent scale conversion layers (layers 1-2 are denoted as...) Levels 2-3 are denoted as Representative migration vector data from each multi-layer model (as shown in Table 3) were selected to perform quantization calculations of the dominance values at the scale layer. The parameter definitions and logic in the formulas are as follows: For the first The dominance value of each scale layer is used to measure the texture transfer activity of that layer during zooming. This represents the total number of valid migration vectors collected within this level. For the first Layer The magnitude of each vector; This represents the total number of conversion layers. Set as To prevent the denominator from being zero, the formula's advantage lies in the fact that the numerator multiplies the sum of vector magnitudes (L1 norm, representing the total migration) with the square root of the sum of squared magnitudes (L2 norm, representing energy concentration), nonlinearly amplifying migration features with high intensity and concentrated distribution. The denominator is a global normalization factor for the sum of hierarchical magnitudes, thus accurately highlighting the dominant scale layer with the most dramatic texture changes. Actual calculations are performed based on the data in Table 3.
[0112] For scale layer Calculate the cumulative sum of vector magnitudes:
[0113] ;
[0114] Calculate the square root of the sum of squares of amplitudes:
[0115] ;
[0116] The result for the numerator is:
[0117] ;
[0118] For scale layer Calculate the cumulative sum of vector magnitudes:
[0119] ;
[0120] Calculate the square root of the sum of squares of amplitudes:
[0121] ;
[0122] The result for the numerator is:
[0123] ;
[0124] Calculate the denominator (global sum):
[0125] ;
[0126] Calculate the autonomous dominance value:
[0127] , ;
[0128] For the magnitudes of the 6 vectors in Table 3 Sort the data and determine the median. Set the preset dominant threshold to the median. times The dominance value is compared with the threshold, because ,and This result indicates that the scale layer The transition layer (from the original resolution to 0.5x resolution) contains significant thermal texture migration features, which are identified as the dominant scale layer and the corresponding label is output.
[0129] Table 3: Parameters of the Scale Transfer Vector at Extreme Points
[0130] Vector numbering Scale level (m) migration vector magnitude ( ) Vector direction sign 1 1 2.5 +1 (Expansion) 2 1 3.0 +1 (Expansion) 3 1 2.8 +1 (Expansion) 4 2 1.2 -1 (contraction) 5 2 1.1 -1 (contraction) 6 2 1.3 -1 (contraction)
[0131] As shown in Table 3, the key vector parameters used to calculate the dominance value are listed. The "vector direction sign" indicates the spatial flow direction of the thermal texture during scale transformation (+1 represents outward expansion, -1 represents inward contraction). This data will be directly used for subsequent consistency analysis.
[0132] S313: Based on the dominant scale layer identifier, extract the scale layer migration vector direction sign, collect the current focal plane displacement value direction sign, count the number of identical and opposite signs, calculate the number ratio, assign a consistency factor, and integrate it with the migration cumulative intensity value to obtain the focal length control weighted parameter;
[0133] Based on the identified dominant scale layer identifier ( Extract the direction sign sequence of the migration vector at this level from Table 3. The direction sign of the current focal plane displacement value is collected by the encoder feedback of the infrared zoom lens. Assuming that the lens is currently in zoom mode, the displacement direction is positive (denoted as ). ), count the number of vectors with the same sign and the number of vectors with opposite signs respectively, and then count the number of vectors with the same sign. opposite quantity Calculate the consistency ratio Assign this ratio as the consistency factor. Extract the dominance value of the dominant scale layer As the cumulative migration strength value, a weighted integration calculation is performed. ( (As a reference value, set to 1.0), the calculation yields... This value is used as a weighted parameter for focal length adjustment, which is used to dynamically adjust the zoom speed or step size to achieve accurate focus tracking of thermal fault areas.
[0134] Please see Figure 5 The specific steps for obtaining the focal plane compensation step size are as follows:
[0135] S411: Call the focal length adjustment weighting parameter, perform element-wise weighting operation on the multi-scale gradient energy and weight vector, accumulate the weighted values with the same index, and perform matrix row and column normalization on the accumulated sequence to generate a weighted fused gradient energy matrix.
[0136] Call the calculated focal length adjustment weighted parameters Simultaneously, it calls the features contained in the generated cross-scale thermal texture coupling feature matrix. Gradient energy data at each scale level, for each pixel location For example, selecting coordinates For the central region pixels, extract the gradient energy components at the corresponding three scale levels, which are respectively , and Construct weight allocation vectors corresponding to scale levels, and set the basic weight ratio based on the determined dominant scale level (first layer). Weighted parameters for focal length adjustment As a gain coefficient applied to the base weights, vector multiplication is performed to obtain the actual weight vector. The extracted gradient energy components and the calculated weight vector are subjected to element-wise weighted operations to calculate the first layer weighted energy. Calculate the weighted energy of the second layer. Calculate the weighted energy of the third layer. The three weighted energy values at the same pixel index are summed to obtain the total fused energy value at that location. traversing the matrix Repeat the weighted accumulation process for each pixel, perform matrix normalization on the generated raw accumulated data matrix, and count the maximum accumulated value in the matrix. and minimum value The numerical values are normalized to a linear mapping method. arrive A 16-bit integer range, for coordinates The results after numerical calculation regularization The normalized values are then backfilled into the corresponding matrix coordinates, ultimately generating a weighted fusion gradient energy matrix with uniform dimensions and high dynamic range.
[0137] S412: Based on the weighted fused gradient energy matrix, set the window length parameter and step parameter, extract the window gradient energy set according to the sliding window integration algorithm and perform interval integration operation, perform serialization aggregation and array processing on the integral value to obtain the fused gradient energy change sequence;
[0138] Based on the weighted fusion gradient energy matrix, the sliding window parameters for capturing local texture focusing states are set, and the window length is defined. Pixels, setting the step parameters for window sliding. Pixel, initialize the sliding scan process, starting from the top left corner of the matrix. Begin by extracting the first set of covered row indexes. to Column index to of The local submatrix extracts 16 energy values within the window and performs interval integration, summing the normalized energy values of the pixels within the window. Assuming this region is located in a high-frequency texture area at the edge of a thermal fault, the average pixel value is... Then calculate the integral value. Keeping the row index unchanged, slide the window horizontally to the right along the step parameter until the column index is reached. to Extract the second submatrix and calculate the integral value. If the texture of this region is clearer, the integral value is increased to [value missing]. Following this pattern, scan the entire line, then start a newline, until the entire line is covered. The matrix is used to obtain a series of window gradient energy sets. The integral values are serialized and aggregated. The two-dimensional distributed integral values are reorganized into a one-dimensional data stream according to the scanning time order. The column processing is performed to remove invalid zero-value data caused by boundary filling or window overflow. The sequence is smoothed and denoised to obtain a fused gradient energy change sequence that reflects the trend of the focus of the whole image. The numerical fluctuations in this sequence are directly related to the sharpness changes of the lens focal plane.
[0139] S413: Based on the sequence of gradient energy changes, call the focal length control weighting parameters as the set of scaling coefficients, perform item-by-item mapping on the sequence changes and scaling coefficients, and perform quantization and indexing of the mapped step values to output the focal plane compensation step.
[0140] Based on the sequence of changes in fused gradient energy, as shown in Table 4, the window integral values and corresponding sequence indices in the table are used to re-invoke the focal length adjustment weighting parameters. As the core proportional coefficient set, the energy change of adjacent nodes in the sequence is calculated item by item, and the data of sequence indices 1 and 2 are extracted to calculate the energy change. Introducing the microstepping sensitivity constant of the motor drive The change is mapped to a theoretical step value, and the calculation formula is as follows: Substituting the numerical values, we obtain The mapped step value is then subjected to quantization normalization, and rounded to the nearest integer pulse number, i.e., the quantization step size. Simultaneously, the sign of the change is determined: a positive value indicates an increase in sharpness, and the driving direction remains positive (+1); a negative value indicates a decrease in sharpness, and the driving direction reverses (-1). For the cases of sequence indices 2 to 3 in Table 4, the energy changes from... Descending to , Computational theory step After quantification, it becomes The calculated quantization step is indexed and processed to establish the correspondence between the step and the time axis. Small reciprocating steps caused by jitter (such as continuous +1, -1) are removed. The focal plane compensation step is output after smoothing and logic verification, and the focusing motor of the infrared lens is instructed to perform precise position adjustment.
[0141] Table 4: Calculation Table of Fusion Gradient Energy Sequence and Step Size
[0142] Sequence Index Window integral value ( ) Energy change ( ) Theoretical step value ( ) Quantization step size ( ) 1 453040 - - 0 2 458000 +4960 1.6621 +2 3 456000 -2000 -0.6702 -1 4 461500 +5500 1.8430 +2 5 465000 +3500 1.1728 +1
[0143] Table 4 details the numerical changes of key nodes in the fused gradient energy change sequence. The "energy change" reflects the image sharpness feedback caused by the current focusing action, while the "theoretical step value" incorporates weighted parameters. The "quantization step size" is the final discrete control command sent to the motor actuator.
[0144] Please see Figure 6 The specific steps to obtain are as follows:
[0145] S511: Based on the focal plane compensation step, perform amplitude retrieval on the current focal length step and calculate the difference between the two sets of amplitudes. Perform interval judgment based on the difference sequence and the preset stable threshold, aggregate the differences within the threshold, and generate a compensation difference sequence.
[0146] The output focal plane compensation step sequence is called, assuming the step size of the 5 consecutive frames acquired is... This sequence reflects the dynamic adjustment needs of the lens in the process of finding the optimal focal plane. First, amplitude retrieval is performed on each element in the sequence, and the direction sign is removed to obtain the step amplitude sequence. Calculate the amplitude difference between adjacent frames, for example, the amplitude difference from frame 1 to frame 2. Become Difference (And so on, the difference is defined as) To form damped feedback, the initial difference sequence is obtained. The set of absolute values of this difference sequence Perform statistical analysis and sort the values in ascending order. Extract the median The upper bound of the statistical interval is set as the median. times Use this value to determine the preset stability threshold. Based on this threshold, interval filtering is performed on the initial difference sequence. For the difference... Its absolute value It is determined to be a valid aggregation object, and the difference is... Its absolute value It was determined to be an abnormal fluctuation, so it was removed and set as The filtered differences are arranged in chronological order. For positive steps (sign +), the sign of the difference is preserved; for negative steps (sign -), the sign of the difference is flipped to match the reverse damping requirement. The processed differences are then added to the sequence using a linear accumulation method, ultimately generating a compensation difference sequence for correcting step overshoot. .
[0147] S512: Call the compensation difference sequence to perform amplitude compression processing on the current focal length step, map the difference sequence to the corresponding elements of the step, and perform element-wise summation to generate a compressed step sequence;
[0148] Call the compensation difference sequence and the original focal plane compensation step size As shown in Table 5, amplitude compression is performed for each corresponding node in the sequence. Taking the second frame of data as an example, the original step size is... The corresponding compensation difference is The two are element-wise mapped and summed to calculate the compressed step value. This operation utilizes the negative feedback characteristic of the difference to suppress the drastic increase in the step size; for the third frame of data, the original step size is... The compensation difference is Calculations yielded For the 4th frame of data, the original step size is: Because the preceding difference exceeded the limit and was set to zero, the compensation value is... Calculations yielded ; Reverse stepping for frame 5 The compensation value is Calculations yielded By traversing the entire sequence, the corrected values are recombinated to generate a compressed step sequence. This process effectively smooths out abrupt changes in step size while preserving the focus direction trend, preventing the lens from experiencing mechanical vibrations due to excessive acceleration.
[0149] Table 5: Focal Length Step Correction Data Table
[0150] Frame number Original step size ( ) Amplitude change ( ) Compensation difference ( ) Compression step size ( ) Final instruction value ( ) 1 +1 - 0 +1 +1 2 +3 -2 -2 +1 +1 3 +5 -2 -2 +3 +2 4 +2 +3 (Removed) 0 +2 +2 5 -2 0 0 -2 -2
[0151] As shown in Table 5, the complete evolution process from the original step size to the final command value is illustrated. The "compensation difference" plays a key role in dynamic damping, while the "final command value" is the result after further limiting.
[0152] S513: Based on the compression step sequence, perform a limitation judgment on the sequence and the preset stable threshold, replace the elements above the threshold with the threshold, reconstruct the replaced sequence, convert it into an executable control command, and generate a lens focal length adjustment command.
[0153] Based on the compression step sequence Call the preset stability threshold again Perform a constraint judgment on each element in the sequence, and determine the compression step value for the 3rd frame. It is compared with the threshold, because The value is determined to be outside the stable driving range, and it is forcibly replaced with a threshold value. For the value in frame 5 Its absolute value Keeping the original values unchanged; after completing the amplitude limiting process for the entire sequence, the reconstructed and replaced sequence yields the final execution sequence. The numerical values in the sequence are converted into hexadecimal control instructions that the stepper motor controller can recognize, for example... This is converted to instruction 0x01 (forward microstepping). The command is converted into instruction 0x82 (reverse double step), encapsulated according to the timestamp, and a lens focus adjustment command is generated. This command is then sent to the focusing drive circuit of the infrared thermal imager via the serial port, driving the lens to move smoothly to the optimal observation position according to the planned trajectory.
[0154] The machine vision-based infrared zoom lens control system is used to execute the aforementioned machine vision-based infrared zoom lens control method. The system includes:
[0155] The image measurement module obtains thermal texture gradients by multi-scale spatial sampling of infrared images, extracts thermal texture gradient amplitudes and statistically analyzes spatial distribution features using a multi-scale wavelet transform algorithm, generates a multi-scale thermal texture gradient amplitude matrix, and transmits it to the scale analysis module.
[0156] The scale parsing module calls the multi-scale thermal texture gradient magnitude matrix, calculates the isotope ratio between adjacent scales pixel by pixel and performs smoothing, analyzes the coupling strength change and extracts the multi-scale gradient energy, outputs the cross-scale thermal texture coupling feature matrix, and passes it to the cross-layer coupling module.
[0157] The cross-layer coupling module calls the cross-scale thermal texture coupling feature matrix, performs first-order difference operation to detect extreme point migration and counts the migration change, identifies the dominant scale layer, performs sign consistency judgment in combination with the current focal plane displacement value, generates focal length control weighting parameters, and passes them to the focal length weighting parameter module.
[0158] The focal length weighting parameter module calls the focal length control weighting parameter to perform weighted fusion of multi-scale gradient energy, uses the sliding window integral algorithm to calculate the change in gradient energy after fusion, performs proportional mapping according to the weighting parameter, outputs the focal plane compensation step amount, and passes it to the step control module.
[0159] The step control module calls the focal plane compensation step amount to dynamically compress the current focal length step amount and optimize steady-state control, constraining the step amount within a preset stable threshold and generating a lens focal length adjustment command.
[0160] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for controlling an infrared zoom lens based on machine vision, characterized in that, The method comprises the following steps: S1: obtaining thermal texture gradient by sampling infrared image in multi-scale space, extracting thermal texture gradient amplitude by multi-scale wavelet transform algorithm, and counting spatial distribution characteristics to generate multi-scale thermal texture gradient amplitude matrix; S2: calling the multi-scale thermal texture gradient amplitude matrix, calculating the isotope ratio between adjacent scales pixel by pixel and performing smoothing processing, analyzing the coupling strength change and extracting multi-scale gradient energy, and outputting the cross-scale thermal texture coupling feature matrix; S3: calling the cross-scale thermal texture coupling feature matrix, performing first-order difference operation to detect extreme point migration and count migration change, identifying the dominant scale layer, combining the current focal plane displacement value to perform sign consistency judgment, and generating focal length control weighting parameter; S4: calling the focal length control weighting parameter, performing weighted fusion on multi-scale gradient energy, calculating the change of fused gradient energy by sliding window integral algorithm, and performing proportional mapping according to the weighting parameter to output focal plane compensation step; S5: calling the focal plane compensation step, dynamically compressing and optimizing the current focal length step, and constraining the step within the preset stable threshold to generate lens focal length adjustment instruction. 2.The method of claim 1, wherein, The multi-scale thermal texture gradient amplitude matrix includes gradient amplitude graph, scale index set and spatial distribution domain, the cross-scale thermal texture coupling feature matrix includes scale coupling coefficient, energy distribution sequence and ratio change domain, the focal length control weighting parameter includes dominant scale weight, displacement criterion value and sign consistency coefficient, the focal plane compensation step includes compensation step length, proportional mapping coefficient and stable control threshold, and the lens focal length adjustment instruction includes step control amount, adjustment instruction code and feedback stability. 3.The method of claim 1, wherein, The acquisition step of the multi-scale thermal texture gradient amplitude matrix is: S111: based on the sampling interval of infrared image in multi-scale space, performing gradient vector calculation on the neighborhood pixel radiation intensity sequence of the sampling point, comparing the gradient amplitude with the scale weight threshold value, aggregating the gradient vector index with gradient amplitude greater than the threshold value, and generating multi-scale gradient vector set; S112: calling the gradient amplitude sequence in the multi-scale gradient vector set, performing multi-scale wavelet transform algorithm coefficient decomposition on the multi-scale sequence, comparing the decomposition coefficient amplitude with the amplitude filtering threshold value, removing the coefficient index less than the threshold value, recombining the remaining index, and obtaining the scale amplitude coefficient group; S113: according to the amplitude sequence in the scale amplitude coefficient group, performing arrangement processing on the sequence according to spatial position coding, and performing matrix assembly on the arranged amplitude units according to coordinate serial number, filling the missing position with zero value, and establishing multi-scale thermal texture gradient amplitude matrix. 4.The method of claim 3, wherein, The scale weight threshold value is set by linear combination of the gradient amplitude mean value and the gradient amplitude standard deviation; The amplitude filtering threshold value is obtained by calculating the median and quartile deviation of the coefficient amplitude sequence. 5.The method of claim 3, wherein, The acquisition step of the cross-scale thermal texture coupling feature matrix is: S211: Call the multi-scale thermal texture gradient amplitude matrix, extract the gradient amplitude data of corresponding pixel positions between adjacent scale levels, perform ratio operation on the gradient amplitudes of the same pixel positions of the upper and lower two scales, arrange the ratio results according to the pixel coordinate positions, and obtain an adjacent scale gradient ratio distribution matrix; S212: Call the adjacent scale gradient ratio distribution matrix, extract the multi-scale layer pixel gradient ratio and gradient amplitude change, and calculate the cross-scale thermal texture coupling rate using the formula: ; The coupling strength change matrix is obtained by performing neighborhood mean filtering smoothing processing on the coupling rate value distribution, analyzing the coupling strength change characteristics, and calculating the cross-scale thermal texture coupling rate; wherein, represents a cross-scale heat texture coupling rate at pixel position (i, j), represents a total number of scale layers, represents a scale layer index, represents a gradient ratio value of scale layer s at pixel position (i, j), represents a gradient amplitude variation of scale layer s at pixel position (i, j), represents a multi-scale layer gradient ratio mean value at pixel position (i, j), represents a numerical stability constant; S213: Call the coupling strength change matrix, perform difference operation on the pixel position coupling rate value along the scale dimension, count the peak value position and jump interval distribution of the coupling rate gradient, fuse the multi-scale gradient energy and the coupling strength change data, and output the cross-scale thermal texture coupling feature matrix. 6.The method of claim 5, wherein, The acquisition step of the focal length control weighting parameter is: S311: Call the cross-scale thermal texture coupling feature matrix, perform first-order difference operation on the multi-scale layer data, obtain the texture feature increment value of the adjacent scale layer, detect the peak and valley positions in the increment value, record the coordinate offset between the positions and scales, count the amplitude range, and generate an extreme point scale migration vector set; S312: Based on the extreme point scale migration vector set, perform accumulation operation on the migration vector amplitude in a single scale layer, calculate the scale layer dominant degree value, compare the dominant degree value with the preset dominant threshold value, select the scale layer exceeding the threshold value, and identify it as a dominant scale layer identifier; S313: According to the dominant scale layer identifier, extract the scale layer migration vector direction symbol, collect the current focal plane displacement value direction symbol, count the number of same and opposite symbols, calculate the number ratio, assign a consistency factor, and integrate the migration cumulative intensity value to obtain the focal length control weighting parameter. 7.The method of claim 6, wherein, The acquisition step of the focal plane compensation step size is: S411: Call the focal length control weighting parameter, perform element-by-element weighting operation on the multi-scale gradient energy and the weight vector, perform accumulation on the same index weighted value, perform matrix row and column normalization on the accumulation sequence, and generate a weighted fusion gradient energy matrix; S412: According to the weighted fusion gradient energy matrix, set the window length parameter and the step size parameter, extract the window gradient energy set according to the sliding window integration algorithm and perform interval integration operation, perform serialization aggregation and column arrangement on the integral value, and obtain a fusion gradient energy change sequence; S413: According to the fusion gradient energy change sequence, call the focal length control weighting parameter as a proportionality coefficient set, perform item-by-item mapping on the sequence change and the proportionality coefficient, and perform quantization normalization and index arrangement on the mapped step size value, and output the focal plane compensation step size. 8.The method of claim 7, wherein, The acquisition step of the lens focal length adjustment instruction is: S511: Based on the focal plane compensation step size, perform amplitude retrieval on the current focal length step size, and perform difference calculation on the two groups of amplitudes, perform interval judgment on the difference sequence and the preset stable threshold value, aggregate the difference values within the threshold value, and generate a compensation difference sequence; S512: calling the compensation difference value sequence, performing amplitude compression processing on the current focal length step size, mapping the difference value sequence and the step size corresponding element, and performing element level addition to generate a compressed step size sequence; S513: according to the compressed step size sequence, performing limit judgment on the sequence and the preset stable threshold value, replacing the elements higher than the threshold value with the threshold value, and reconstructing the replaced sequence to convert into executable control instructions to generate lens focal length adjustment instructions. 9.The method of claim 8, wherein, The preset stable threshold value is determined by extracting the upper limit of the interquartile range from the statistical results of the difference value sequence difference fluctuation range; The interval judgment according to the difference value sequence and the preset stable threshold value selects only the difference value with an absolute value not exceeding the preset stable threshold value in the difference value sequence as the aggregation object, and generates the compensation difference value sequence by using linear accumulation.
10. A machine vision-based control system for an infrared zoom lens, characterized by The system is used to realize the machine vision-based infrared zoom lens control method of any one of claims 1-9, and the system comprises: An image measurement module acquires thermal texture gradients by multi-scale spatial sampling of infrared images, extracts thermal texture gradient amplitudes by using a multi-scale wavelet transform algorithm, and statistically analyzes spatial distribution characteristics to generate a multi-scale thermal texture gradient amplitude matrix, which is transmitted to a scale analysis module; The scale analysis module calls the multi-scale thermal texture gradient amplitude matrix, calculates the isometric ratio between adjacent scales pixel by pixel and performs smoothing processing, analyzes the coupling strength change and extracts the multi-scale gradient energy, outputs a cross-scale thermal texture coupling feature matrix, and transmits it to a cross-layer coupling module; The cross-layer coupling module calls the cross-scale thermal texture coupling feature matrix, performs first-order difference operation to detect extreme point migration and statistically analyze migration change, identifies the dominant scale layer, performs sign consistency judgment combined with the current focal plane displacement value, generates focal length control weighting parameters, and transmits them to a focal length weighting parameter module; The focal length weighting parameter module calls the focal length control weighting parameters, performs weighted fusion on the multi-scale gradient energy, calculates the change of the fused gradient energy by using a sliding window integral algorithm, proportionally maps the change according to the weighting parameters, and outputs the focal plane compensation step size, which is transmitted to a step control module; The step control module calls the focal plane compensation step size, performs dynamic compression and optimization of stable control on the current focal length step size, constrains the step size within a preset stable threshold value, and generates lens focal length adjustment instructions.