An adaptive environmental image processing method for industrial gas detection

Through feature point detection and optical flow tracking technology, combined with affine transformation parameters, adaptive environmental image processing is achieved, which solves the problem of unstable image data in complex industrial sites in traditional methods and improves the accuracy and reliability of gas detection.

CN120339965BActive Publication Date: 2025-09-30BEIJING SMART SHARING TECH SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510808832.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-09-30
Estimated Expiration
2045-06-17

AI Technical Summary

Technical Problem

Traditional industrial gas detection methods are difficult to adapt to environmental changes in complex and dynamic industrial sites, resulting in unstable image data, false alarms and missed alarms, and affecting the long-term stable operation of the system.

Method used

By adopting feature point detection and optical flow tracking technology, combined with affine transformation parameters, adaptive environmental image processing is achieved through image motion trajectory processing algorithm, and the image processing strategy is optimized to adapt to environmental changes.

Benefits of technology

It improves the accuracy and reliability of industrial gas detection systems, can accurately identify gas diffusion trajectories in complex environments, and meet the needs of industrial applications with high real-time performance and high stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120339965B_ABST
    Figure CN120339965B_ABST
Patent Text Reader

Abstract

The present invention discloses an adaptive environmental image processing method for industrial gas detection, which relates to the field of industrial gas detection. The method comprises: extracting feature points of the current frame using a feature point detection algorithm based on image frames of an industrial monitoring video stream, and combining the optical flow tracking technology to obtain the coordinates of the feature points between frames; generating affine transformation parameters, and using the affine transformation parameters to transform and decompose the feature point coordinates, extracting posture change parameters, and obtaining the image motion trajectory; predicting the image motion trajectory using an image trajectory processing algorithm, and comparing the predicted image motion trajectory with the real-time image motion trajectory generated by the current frame; optimizing the affine transformation parameters, and using the optimized affine transformation parameters to process the video stream frame by frame. The present invention, through feature point detection and optical flow tracking algorithms, can extract image motion information from industrial monitoring videos, meeting the industrial application requirements of high real-time performance and high stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial gas detection, and in particular to an adaptive environmental image processing method for industrial gas detection. Background Art

[0002] With the continuous advancement of industrial automation and intelligence, industrial gas detection is playing an increasingly important role in key industries such as petrochemicals, electric power, and emergency safety. Traditional gas detection methods rely primarily on point sensors, laser rangefinders, or infrared spectrometers. While these methods can provide highly accurate data in certain static and stable environments, their adaptability, coverage, and real-time performance remain limited in complex and dynamic industrial environments.

[0003] In recent years, image-based video surveillance and image recognition technologies have become a growing trend to improve detection efficiency and intelligence. Advanced equipment such as infrared thermal imaging and spectral cameras have enabled non-contact identification and early warning of gas leaks and their diffusion status. However, in unmanned, continuously operating industrial scenarios, such systems must withstand long-term operational pressures and cope with a range of complex environmental interference factors, such as periodic equipment rotation and inspection, switching between cooling and non-cooling modes, and image blur and contrast changes caused by structural vibration. These issues affect the stability and reliability of the raw image data, thereby compromising the accuracy of subsequent image processing and gas identification.

[0004] Currently, most image processing methods usually rely on fixed parameter settings and lack the ability to self-adjust to changes in the working environment. This makes it difficult to effectively suppress interference, correct motion offset or improve image quality. As a result, false alarms and missed alarms are prone to occur in long-term continuous detection tasks, which is not conducive to the long-term stable operation of the system.

[0005] Currently, no effective solutions have been proposed for the problems in related technologies. Summary of the Invention

[0006] In response to the problems in the related art, the present invention proposes an adaptive environmental image processing method for industrial gas detection to overcome the above technical problems existing in the existing related art.

[0007] To this end, the specific technical solutions adopted in the present invention are as follows:

[0008] An adaptive environmental image processing method for industrial gas detection, the method comprising:

[0009] S1. Based on the image frames of the industrial monitoring video stream, the feature point detection algorithm is used to extract the feature points of the current frame, and the optical flow tracking technology is combined to obtain the coordinates of the feature points between frames;

[0010] S2. Based on the acquired feature point coordinates, generate affine transformation parameters, and use the affine transformation parameters to transform and decompose the feature point coordinates, extract the posture change parameters, and obtain the image motion trajectory;

[0011] S3, using an image trajectory processing algorithm to predict the image motion trajectory, and comparing the predicted image motion trajectory with the real-time image motion trajectory generated by the current frame;

[0012] S4. Based on the comparison result, optimize the affine transformation parameters, and use the optimized affine transformation parameters to process the video stream frame by frame.

[0013] Optionally, based on the image frames of the industrial monitoring video stream, feature points of the current frame are extracted using a feature point detection algorithm, and optical flow tracking technology is combined to obtain the coordinates of the feature points between frames, including:

[0014] S11. In an image frame of the industrial monitoring video stream, extract features of the current frame using a feature point detection algorithm based on spot detection to generate a set of candidate feature points;

[0015] S12, using a feature point response threshold mechanism to screen the candidate feature point set, and combining it with a preset inertia filtering ratio threshold to establish a feature point set;

[0016] S13. Use optical flow tracking technology to track the feature points in the feature point set frame by frame, and combine it with the adaptive window size adjustment mechanism to optimize the tracking accuracy and obtain the corresponding feature point coordinates between the current frame and the previous frame.

[0017] Optionally, the candidate feature point set is screened using a feature point response threshold mechanism, and combined with a preset inertia filter ratio threshold, the feature point set is established including:

[0018] S121, based on the generated candidate feature point set, using a multi-scale corner detection algorithm to perform response analysis in the image space domain, and calculating the response value of each feature point in the candidate feature point set in different scale spaces based on the analysis results;

[0019] S122, dividing the image into a plurality of sub-grid areas, setting a response threshold according to the mean and standard deviation of the response values ​​in each sub-grid area, and using the response threshold to preliminarily screen the candidate feature point set to establish an initial feature point set;

[0020] S123, calculating the ratio of the response value of each feature point in the initial feature point set to the maximum response value in the corresponding neighborhood, and combining the preset inertia filtering ratio threshold, performing a secondary screening on the initial feature point set to establish a feature point set.

[0021] Optionally, the ratio of the response value of each feature point in the initial feature point set to the maximum response value in the corresponding neighborhood is calculated, and the initial feature point set is secondary screened in combination with a preset inertia filtering ratio threshold. Establishing the feature point set includes:

[0022] S1231, using the persistent homology algorithm, performing neighborhood response analysis on each feature point in the initial feature point set, and calculating the response ratio of the response value of each feature point to the maximum response value in the corresponding neighborhood;

[0023] S1232. Construct a dual-threshold screening condition based on the calculated response ratio and the preset inertia filtering ratio threshold, and use the dual-threshold screening condition as a constraint condition to perform a secondary screening on the initial feature point set to construct a feature point set.

[0024] Optionally, using a persistent homology algorithm, performing neighborhood response analysis on each feature point in the initial feature point set, and calculating a response ratio between a response value of each feature point and a maximum response value in a corresponding neighborhood includes:

[0025] S12311, using the response value of each feature point in the initial feature point set as a scalar function, sequentially constructing a sub-level set filter sequence in the feature response space, gradually filling the response space and recording the evolution process of the topological structure;

[0026] S12312. Extract the persistence features of each feature point by analyzing the evolution of the topological invariant in the feature response subspace with scale changes within the local neighborhood of each feature point;

[0027] S12313. Calculate the ratio of the response value of each feature point to the maximum response value of the longest persistent feature in the corresponding neighborhood, and combine with normalization processing to obtain the response ratio of each feature point.

[0028] Optionally, generating affine transformation parameters based on the acquired feature point coordinates, and using the affine transformation parameters to transform and decompose the feature point coordinates, extracting posture change parameters, and obtaining the image motion trajectory includes:

[0029] S21, based on the acquired feature point coordinates, using a feature matching algorithm to establish feature point matching pairs between the current frame and a preset reference frame, and generating affine transformation parameters by least squares fitting to obtain an affine transformation matrix;

[0030] S22. Using the obtained affine transformation matrix, transform the coordinates of each feature point in the current frame to decompose the posture change parameters of each feature point;

[0031] S23. Perform kinematic integration on the posture change parameters of the current frame and the motion information of the historical frames, superimpose the affine transformation matrix at each moment, and obtain the image motion trajectory.

[0032] Optionally, the posture change parameters include: translation change parameters along the horizontal direction and the vertical direction, and rotation angle change parameters around the image center.

[0033] Optionally, kinematic integration is performed on the pose change parameters of the current frame and the motion information of the historical frames, and the affine transformation matrix at each moment is superimposed to obtain the image motion trajectory, including:

[0034] S231, based on the posture change parameters of each feature point, recursively fuse the posture change parameters of the current frame with the motion information of the historical frames through a kinematic integration algorithm to establish a kinematic constraint model between frames;

[0035] S232, using a sliding window mechanism, performing temporal multiplication and accumulation on the affine transformation matrices of multiple consecutive frames, and performing correction processing in combination with spatiotemporal constraints to obtain a posture transformation matrix;

[0036] S233: Analyze the obtained posture transformation matrix, extract the motion parameters of each frame image in the spatiotemporal sequence, and generate the image motion trajectory.

[0037] Optionally, a sliding window mechanism is used to perform temporal multiplication and accumulation of the affine transformation matrices of multiple consecutive frames, and correction processing is performed in combination with spatiotemporal constraints to obtain a pose transformation matrix including:

[0038] S2321. Based on the established kinematic constraint model, select a sequence of affine transformation matrices of several consecutive frames through a sliding window mechanism, and cumulatively calculate the global pose transformation corresponding to the current frame through a time-series multiplication operation of the matrices;

[0039] S2322. Combine spatial and temporal constraints to perform joint error correction on the calculated global pose transformation, and construct a nonlinear optimization objective function that includes the geometric and temporal relationship between image frames;

[0040] S2323. Using the Lie algebra optimization algorithm, the pose sequence is optimized and solved based on the constructed optimization objective function, and the optimization results are post-processed in combination with smoothing to obtain the pose transformation matrix.

[0041] Optionally, predicting the image motion trajectory using an image trajectory processing algorithm and comparing the predicted image motion trajectory with the real-time image motion trajectory generated by the current frame includes:

[0042] S31. Based on the acquired image motion trajectory, a Kalman filter algorithm is used to establish a nonlinear motion model including the image position and posture state, and the nonlinear motion model is used to predict the image motion trajectory of subsequent frames to obtain a prediction result of the image motion trajectory of the current frame;

[0043] S32, comparing the predicted image motion trajectory with the real-time image motion trajectory generated by the current frame frame by frame, and constructing an error vector containing the joint deviation of position and posture by calculating the spatial Euclidean distance and the attitude angle difference;

[0044] S33. Use a weighted allocation algorithm to adjust the weights of the position deviation and posture deviation in the error vector to obtain a quantized trajectory comparison result.

[0045] The beneficial effects of the present invention are:

[0046] 1. Through feature point detection and optical flow tracking algorithms, the present invention can extract image motion information from industrial monitoring videos and achieve accurate tracking of feature points between frames, thereby having good adaptability to environmental changes, thereby improving the system's perception of dynamically changing targets such as equipment operating status and gas diffusion trajectories, and meeting the needs of industrial applications with high real-time performance and high stability.

[0047] 2. The present invention predicts motion trends through an image trajectory processing algorithm and compares the prediction results with the image trajectory of the current frame, thereby effectively identifying motion estimation errors; by introducing a trajectory comparison mechanism, the prediction deviation can be corrected in real time, thereby improving the accuracy and robustness of motion modeling.

[0048] 3. By using the optimized affine transformation parameters to process the video stream frame by frame, the present invention can achieve accurate modeling of image posture changes in different industrial scenarios, and can adaptively adjust the image processing strategy according to the dynamic changes of the environment, thereby improving the accuracy, reliability and applicability of the gas detection system. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0050] Figure 1 The present invention is a flowchart of an adaptive environmental image processing method for industrial gas detection according to an embodiment of the present invention. DETAILED DESCRIPTION

[0051] To further illustrate each embodiment, the present invention provides drawings, which are part of the disclosure of the present invention. They are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. By referring to these contents, ordinary technicians in this field should be able to understand other possible implementation methods and the advantages of the present invention.

[0052] According to an embodiment of the present invention, an adaptive environmental image processing method for industrial gas detection is provided.

[0053] The present invention will now be further described with reference to the accompanying drawings and specific embodiments. Figure 1 As shown, according to an embodiment of the present invention, an adaptive environmental image processing method for industrial gas detection includes:

[0054] S1. Based on the image frames of the industrial monitoring video stream, the feature point detection algorithm is used to extract the feature points of the current frame, and the optical flow tracking technology is combined to obtain the coordinates of the feature points between frames.

[0055] In this optional embodiment, based on the image frames of the industrial monitoring video stream, the feature points of the current frame are extracted using a feature point detection algorithm, and the coordinates of the feature points between frames are obtained by combining the optical flow tracking technology.

[0056] S11. In the image frame of the industrial monitoring video stream, a feature point detection algorithm based on spot detection is used to extract features of the current frame to generate a set of candidate feature points.

[0057] It should be noted that, in the image frame of the industrial monitoring video stream, a specific embodiment of extracting features of the current frame using a feature point detection algorithm based on spot detection to generate a candidate feature point set is as follows:

[0058] First, the image is Gaussian blurred to reduce the interference of noise on subsequent feature extraction. Then, the Harris corner detection algorithm or the FAST feature detection algorithm is used to identify the spot areas in the image as potential feature points. Next, by analyzing the grayscale changes in the image, the response value of each candidate feature point is calculated to further screen the most recognizable feature points. This process can extract stable and discriminative feature points under different lighting conditions, thereby providing reliable data support for subsequent image matching, object tracking, and motion analysis. For example, in a typical industrial environment, changes in the movement of the robotic arm and the operating status of the equipment in the image may cause the feature points in different areas to have obvious displacement or deformation. The feature point detection method based on spot detection can effectively capture these changes and ensure that clear feature points can still be extracted in complex backgrounds and dynamic environments. In this way, not only the accuracy of feature extraction is improved, but also the processing speed of image frames in the monitoring video stream can be greatly improved, adapting to the high requirements of real-time and robustness in the industrial production process, thereby providing strong support for accurate monitoring and fault detection and reducing the need for manual intervention.

[0059] S12. Filter the candidate feature point set using the feature point response threshold mechanism, and establish a feature point set in combination with a preset inertia filtering ratio threshold.

[0060] In this optional embodiment, the candidate feature point set is screened using a feature point response threshold mechanism, and combined with a preset inertia filter ratio threshold, the feature point set is established including:

[0061] S121. Based on the generated candidate feature point set, a multi-scale corner detection algorithm is used to perform response analysis in the image space domain, and based on the analysis results, a response value of each feature point in the candidate feature point set in different scale spaces is calculated.

[0062] S122: Divide the image into several sub-grid areas, set a response threshold according to the mean and standard deviation of the response values ​​in each sub-grid area, and use the response threshold to preliminarily screen the candidate feature point set to establish an initial feature point set.

[0063] S123, calculating the ratio of the response value of each feature point in the initial feature point set to the maximum response value in the corresponding neighborhood, and combining the preset inertia filtering ratio threshold, performing a secondary screening on the initial feature point set to establish a feature point set.

[0064] It should be noted that the specific embodiment of using the feature point response threshold mechanism to screen the candidate feature point set and combining it with the preset inertia filter ratio threshold to establish the feature point set is as follows:

[0065] First, a hyperspectral infrared imaging system is used to collect infrared images of the gas leakage area and construct a Gaussian pyramid ( s = 1.0, 1.5, 2.0) for multi-scale spatial analysis; in the pipeline weld micro-leakage scenario, the candidate feature points correspond to the maximum curvature points of the gas diffusion edge; for example, small scale ( s = 1.0) detected a 0.1 ppm methane leak point response value of 0.92, large scale ( s = 2.0), the response value at the same leak point decays to 0.75 (approximately 18.5% attenuation), consistent with the smooth nature of gas diffusion. A multi-scale response decay rate threshold (e.g., ≤ 20%) is used to screen stable corner points and reduce false detections due to gas concentration gradients. Secondly, the hyperspectral image is divided into 16×16 pixel subgrids, and the mean and standard deviation of the response values ​​within each grid are dynamically calculated. For example, if the mean of a leak region in a subgrid is 0.68 and the standard deviation is 0.15, the response threshold is set to 0.53 (mean minus standard deviation). Finally, for the leakage points in the initial feature point set, the ratio of their response value to the maximum response value of the neighborhood (5×5 pixel window) is calculated. For example, the response value of a leakage point is 0.65, the maximum value of the neighborhood is 0.82, and the ratio is 0.79, which is higher than the preset inertial filtering ratio threshold of 0.7, so this point is retained. Combined with the conical prior knowledge of the gas diffusion shape, interference objects such as the human body and equipment are further eliminated (the false alarm rate is reduced by 42%). Finally, in complex scenes with metal reflections and steam interference, the accuracy of locating the gas leak source can reach 98.73%.

[0066] In this optional embodiment, the ratio of the response value of each feature point in the initial feature point set to the maximum response value in the corresponding neighborhood is calculated, and the initial feature point set is secondary screened in combination with a preset inertia filtering ratio threshold. Establishing the feature point set includes:

[0067] S1231. Using the persistent homology algorithm, perform neighborhood response analysis on each feature point in the initial feature point set, and calculate the response ratio of the response value of each feature point to the maximum response value in the corresponding neighborhood.

[0068] In this optional embodiment, using the persistent homology algorithm, performing neighborhood response analysis on each feature point in the initial feature point set, and calculating the response ratio of the response value of each feature point to the maximum response value in the corresponding neighborhood includes:

[0069] S12311, using the response value of each feature point in the initial feature point set as a scalar function, sequentially constructing a sub-level set filter sequence in the feature response space, gradually filling the response space and recording the evolution process of the topological structure;

[0070] S12312. Extract the persistence features of each feature point by analyzing the evolution of the topological invariant in the feature response subspace with scale changes within the local neighborhood of each feature point;

[0071] S12313. Calculate the ratio of the response value of each feature point to the maximum response value of the longest persistent feature in the corresponding neighborhood, and combine with normalization processing to obtain the response ratio of each feature point.

[0072] S1232. Construct a dual-threshold screening condition based on the calculated response ratio and the preset inertia filtering ratio threshold, and use the dual-threshold screening condition as a constraint condition to perform a secondary screening on the initial feature point set to construct a feature point set.

[0073] It should be noted that the ratio of the response value of each feature point in the initial feature point set to the maximum response value in the corresponding neighborhood is calculated, and the initial feature point set is secondary screened in combination with a preset inertia filtering ratio threshold. The specific embodiment of establishing the feature point set is as follows:

[0074] A persistent homology analysis is performed on the initial set of feature points (approximately 5,000 candidate points). The response ratio of each feature point is calculated by constructing a neighborhood topology (e.g., a 3-pixel circular neighborhood). For example, a leak point has a response value of 0.85, a maximum response value of 0.95 in its neighborhood, and a response ratio of 0.89. A metal reflective interference point has a response ratio of 0.45 (its own response value is 0.3, and the maximum response value in its neighborhood is 0.67). The persistent homology algorithm distinguishes true leaks from transient noise by identifying topological "holes" in the response ratio distribution (e.g., areas of continuous high ratios). The inertial filtering ratio threshold is set to 0.7 (a preset empirical value), and a dual-threshold condition is constructed based on the response ratio:

[0075] Condition 1: Response ratio ≥ 0.7 (retaining characteristic points with stable topological structure);

[0076] Condition 2: Response value attenuation rate ≤ 20% (excluding instantaneous high response points caused by gas concentration fluctuations).

[0077] For example, the response ratio of a leak point is 0.89 (satisfying condition 1), and the response value decay rate in three consecutive frames of images is 18% ( s =1.0 0.85 → s = 2.0 (0.72), which meets the second condition; while the response ratio of 0.45 and the attenuation rate of 35% of the reflection interference point are both filtered out.

[0078] S13. Use optical flow tracking technology to track the feature points in the feature point set frame by frame, and combine it with the adaptive window size adjustment mechanism to optimize the tracking accuracy and obtain the corresponding feature point coordinates between the current frame and the previous frame.

[0079] It should be noted that the optical flow tracking technology is used to track the feature points in the feature point set frame by frame, and the adaptive window size adjustment mechanism is combined to optimize the tracking accuracy. The specific embodiment of obtaining the corresponding feature point coordinates between the current frame and the previous frame is as follows:

[0080] The sparse optical flow algorithm is used to track the feature points frame by frame and calculate the displacement vector between adjacent frames. t The coordinates of the frame are (120, 80). t +1 frame displacement to (122, 83), optical flow vector (Δ x =2,Δ y = 3), and verify the rationality of its motion (e.g., the diffusion velocity conforms to the characteristic methane leak velocity of 0.5-3 m / s) using a gas diffusion model. A 5×5 pixel tracking window is set centered on the feature point, covering the area with significant gradients at the gas plume edge. A Kalm man filter is used to predict the rate of change in window size. For example, as the leak spreads, the window size gradually expands from 5×5 to 9×9 pixels. The Bhattacharyya coefficient within the window is calculated, and if the similarity between adjacent frames falls below 0.8, the window size is adjusted. Trajectory clustering analysis is performed on continuously tracked feature points, and the 3D coordinates of the leak source are reconstructed using the optical flow vector field. For example, in a 30-second video sequence, 50 stable feature points are tracked, and their motion vectors converge on the pipeline weld coordinates (3.2 m, 5.7 m, and 1.5 m), with a positioning error of less than 0.3 m.

[0081] S2. Based on the acquired feature point coordinates, generate affine transformation parameters, and use the affine transformation parameters to transform and decompose the feature point coordinates, extract the posture change parameters, and obtain the image motion trajectory.

[0082] In this optional embodiment, generating affine transformation parameters based on the acquired feature point coordinates, and using the affine transformation parameters to transform and decompose the feature point coordinates, extracting the posture change parameters, and obtaining the image motion trajectory includes:

[0083] S21. Based on the acquired feature point coordinates, a feature matching algorithm is used to establish feature point matching pairs between the current frame and the preset reference frame, and affine transformation parameters are generated by least squares fitting to obtain an affine transformation matrix.

[0084] It should be noted that based on the acquired feature point coordinates, a feature matching algorithm is used to establish feature point matching pairs between the current frame and the preset reference frame, and affine transformation parameters are generated by least squares fitting to obtain an affine transformation matrix. The specific embodiment is as follows:

[0085] The preset reference frame is a standard template image with no leakage, and the feature point set contains about 1200 key points. 800 candidate matching pairs are initially screened through feature descriptor matching, and then the RANSAC algorithm is used to eliminate incorrect matching points. Based on the coordinates of the matching point pairs, the least squares method is used to fit the affine transformation parameters. Assume that the reference frame coordinate matrix is P r , the current frame coordinate matrix is P c , by solving the linear equations P c = M*P r + T (in, M is a 2×2 rotation and scaling matrix, T is the translation vector). For example, a fitting parameter is obtained: rotation angle i =1.2°, scaling factor s =0.98 (local deformation due to gas diffusion), translation T = (5.3-2.7) pixels; the root mean square error of the fitting residual is 0.8 pixels, which meets the industrial detection accuracy requirements (error ≤ 1.5 pixels). The affine transformation matrix is ​​applied to the real-time image. After aligning the reference frame coordinate system, the 3D spatial position of the leak area is calculated using the coordinates of the centroid, such as the coordinates of the pipeline weld (3.5m, 2.1m, 0m). Combined with the time series data (frame rate 30fps), the optical flow vector of the feature point (such as the displacement of a leak point Δ x =2.1 pixels / frame, Δ y =1.8 pixels / frame), inverted gas diffusion velocity (0.6 m / s) and direction (15° east-northeast).

[0086] S22. Using the obtained affine transformation matrix, the coordinates of each feature point in the current frame are transformed to decompose the posture change parameters of each feature point.

[0087] In this optional embodiment, the posture change parameters include: translation change parameters along the horizontal direction and the vertical direction, and rotation angle change parameters around the image center.

[0088] It should be noted that the specific embodiment of using the obtained affine transformation matrix to transform the coordinates of each feature point in the current frame and decompose the posture change parameters of each feature point is as follows:

[0089] Based on hyperspectral infrared imaging (resolution 640×480, frame rate 30fps), the affine transformation matrix is ​​applied to the coordinates of the feature points in the leakage area to decompose: translation parameters, horizontal displacement of a leakage point Δ x =2.3 pixels / frame (about 0.15m / s), vertical displacement Δ y=1.8 pixels / frame (about 0.12m / s), reflecting the gas diffusion direction (12° northeast by east); rotation parameter, the rotation angle around the image center i =1.5° / frame, characterizing the morphological deflection of the leak cloud affected by wind speed. By inverting the 3D coordinates of the leak source, such as the pipeline weld (3.2m, 5.7m, and 1.5m), combined with a rotation-angle-corrected diffusion model (Gaussian plume correction factor +18%), the positioning error is reduced from 1.2m using traditional methods to 0.3m.

[0090] S23. Perform kinematic integration on the posture change parameters of the current frame and the motion information of the historical frames, superimpose the affine transformation matrix at each moment, and obtain the image motion trajectory.

[0091] In this optional embodiment, kinematic integration is performed on the pose change parameters of the current frame and the motion information of the historical frames, and the affine transformation matrix at each moment is superimposed to obtain the image motion trajectory, which includes:

[0092] S231. Based on the posture change parameters of each feature point, the posture change parameters of the current frame are recursively fused with the motion information of the historical frames through a kinematic integration algorithm to establish a kinematic constraint model between frames.

[0093] S232. Using the sliding window mechanism, the affine transformation matrices of multiple consecutive frames are accumulated in time series, and correction processing is performed in combination with the spatiotemporal constraints to obtain the posture transformation matrix.

[0094] In this optional embodiment, a sliding window mechanism is used to perform temporal multiplication and accumulation on the affine transformation matrices of multiple consecutive frames, and correction processing is performed in combination with spatiotemporal constraints to obtain a posture transformation matrix including:

[0095] S2321. Based on the established kinematic constraint model, select a sequence of affine transformation matrices of several consecutive frames through a sliding window mechanism, and cumulatively calculate the global pose transformation corresponding to the current frame through a time-series multiplication operation of the matrices;

[0096] S2322. Combine spatial and temporal constraints to perform joint error correction on the calculated global pose transformation, and construct a nonlinear optimization objective function that includes the geometric and temporal relationship between image frames;

[0097] S2323. Using the Lie algebra optimization algorithm, the pose sequence is optimized and solved based on the constructed optimization objective function, and the optimization results are post-processed in combination with smoothing to obtain the pose transformation matrix.

[0098] S233: Analyze the obtained posture transformation matrix, extract the motion parameters of each frame image in the spatiotemporal sequence, and generate the image motion trajectory.

[0099] It should be noted that the specific embodiment of performing kinematic integration of the posture change parameters of the current frame and the motion information of the historical frames and superimposing the affine transformation matrix at each moment to obtain the image motion trajectory is as follows:

[0100] Based on hyperspectral infrared imaging (640×480 pixels, 30fps), feature points of the leakage area are collected and the historical frame pose parameters (such as horizontal translation Δ x =2.3 pixels / frame, vertical translation Δ y =1.8 pixels / frame), constructing a kinematic constraint model of the leak cloud. A five-frame sliding window was used to perform sequential multiplication and accumulation of the affine transformation matrix, combined with a Kalman filter to correct for spatiotemporal constraints (such as the effect of wind speed on gas diffusion patterns). For example, after one correction, the rotation angle error was reduced from ±1.5° to ±0.3°, the translation parameter volatility was reduced by 42%, and the leak source location error was optimized from 1.2m (using traditional methods) to 0.3m. The pose transformation matrix was analyzed to extract spatiotemporal motion parameters (such as a 12° / frame diffusion direction deflection). These parameters were then combined with drone inspection data (covering 10 square kilometers / time) to generate a leak trajectory heat map.

[0101] S3. Predict the image motion trajectory using an image trajectory processing algorithm, and compare the predicted image motion trajectory with the real-time image motion trajectory generated by the current frame.

[0102] In this optional embodiment, predicting the image motion trajectory using an image trajectory processing algorithm and comparing the predicted image motion trajectory with the real-time image motion trajectory generated by the current frame includes:

[0103] S31. Based on the acquired image motion trajectory, a Kalman filter algorithm is used to establish a nonlinear motion model including the image position and posture state, and the nonlinear motion model is used to predict the image motion trajectory of subsequent frames to obtain a prediction result of the image motion trajectory of the current frame;

[0104] S32, comparing the predicted image motion trajectory with the real-time image motion trajectory generated by the current frame frame by frame, and constructing an error vector containing the joint deviation of position and posture by calculating the spatial Euclidean distance and the attitude angle difference;

[0105] S33. Use a weighted allocation algorithm to adjust the weights of the position deviation and posture deviation in the error vector to obtain a quantized trajectory comparison result.

[0106] It should be noted that the specific embodiment of using the image trajectory processing algorithm to predict the image motion trajectory and comparing the predicted image motion trajectory with the real-time image motion trajectory generated by the current frame is as follows:

[0107] A hyperspectral infrared imager (FLIR G306, frame rate 30fps) was used to capture dynamic image sequences of the methane leak area. A nonlinear motion model was constructed using the Kalman filter algorithm to fuse the image position (pixel coordinate error ±0.5) and attitude parameters (rotation angle error ±0.3°). For example, a leak point at the t The predicted trajectory of the frame is the horizontal displacement Δ x =2.1 pixels / frame (corresponding to the actual diffusion speed of 0.6m / s), attitude angle i =1.2° / frame, the model prediction residual root mean square is 0.8 pixels, which is better than the traditional linear model (RMSE=1.5 pixels). The predicted trajectory is compared with the real-time optical flow tracking results (such as the horizontal displacement Δ generated by the Lucas-Kanade algorithm). x =2.3 pixels / frame, vertical displacement Δ y =1.8 pixels / frame) for frame-by-frame comparison, and calculate the spatial Euclidean distance error (mean 0.6 pixels, standard deviation ±0.2) and attitude angle deviation (mean 0.5°, standard deviation ±0.1°). Using the joint deviation formula:

[0108] ;

[0109] Based on leak diffusion characteristics (such as the upward trend caused by methane's lower density than air), a weighted allocation algorithm was used to assign a weight of 0.7 to position deviations and a weight of 0.3 to attitude deviations. Through adaptive adjustments, the trajectory comparison error fluctuation rate was reduced from 12% to 5% in scenarios with sudden wind speed changes (e.g., 4 m / s to 8 m / s), achieving leak source location accuracy of 0.3 m (compared to 1.2 m using traditional methods).

[0110] S4. Based on the comparison result, optimize the affine transformation parameters, and use the optimized affine transformation parameters to process the video stream frame by frame.

[0111] It should be noted that, based on the comparison results, the affine transformation parameters are optimized, and the specific embodiment of using the optimized affine transformation parameters to process the video stream frame by frame is as follows:

[0112] Based on the comparison results, the RANSAC algorithm was used to select the SIFT feature matching inliers (error threshold 10 pixels, 1000 iterations) and optimize the affine transformation parameters. The initial affine matrix residual root mean square was 1.8 pixels. After sliding window weighted optimization (window size 5 frames) and Kalman filter dynamic compensation, the residual was reduced to 0.8 pixels. The horizontal translation parameter Δ x =5.3 pixels / frame (corresponding to the actual diffusion speed of 0.6m / s), rotation angle i=1.2° / frame. Using optimized affine parameters, the video stream is subjected to sub-pixel deformation correction. Combined with a kinematic integration algorithm and historical frame data, the 3D trajectory of the leak cloud (covering a 10 square kilometer area) is reconstructed. An error vector weighting mechanism (position deviation weighting 0.7, attitude deviation weighting 0.3) distinguishes gas diffusion trajectories from steam interference, reducing the false alarm rate from 15% to 3%. Combined with acoustic sensor data fusion, the methane concentration inversion error is ≤3ppm, with a sensitivity of 0.05ppm. Error feedback updates the affine parameters, improving pose estimation accuracy and effectively suppressing accumulated errors caused by interference factors such as vibration and illumination changes. This enables more stable and continuous image motion modeling, enhancing the system's image processing robustness and detection reliability in complex industrial environments.

[0113] In summary, with the help of the above technical solutions of the present invention, through feature point detection and optical flow tracking algorithms, it is possible to extract image motion information from industrial monitoring videos, achieve accurate tracking of feature points between frames, and thus have good adaptability to environmental changes, thereby improving the system's ability to perceive dynamically changing targets such as equipment operating status and gas diffusion trajectories, and meet the requirements of high real-time and high stability industrial applications. The motion trend is predicted by the image trajectory processing algorithm, and the predicted result is compared with the image trajectory of the current frame, thereby effectively identifying the motion estimation error; by introducing a trajectory comparison mechanism, the prediction deviation can be corrected in real time, thereby improving the accuracy and robustness of motion modeling. By using the optimized affine transformation parameters to process the video stream frame by frame, it is possible to achieve accurate modeling of image posture changes in different industrial scenarios, and to adaptively adjust the image processing strategy according to the dynamic changes of the environment, thereby improving the accuracy, reliability and applicability of the gas detection system.

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

Claims

1. An adaptive environmental image processing method for industrial gas detection, characterized in that: The method includes: S1. Based on the image frames of the industrial monitoring video stream, the feature point detection algorithm is used to extract the feature points of the current frame, and the optical flow tracking technology is combined to obtain the coordinates of the feature points between frames; S2. Based on the acquired feature point coordinates, generate affine transformation parameters, and use the affine transformation parameters to transform and decompose the feature point coordinates, extract the posture change parameters, and obtain the image motion trajectory; S3, using an image trajectory processing algorithm to predict the image motion trajectory, and comparing the predicted image motion trajectory with the real-time image motion trajectory generated by the current frame; S4. Based on the comparison result, optimizing the affine transformation parameters, and processing the video stream frame by frame using the optimized affine transformation parameters; The method of obtaining feature point coordinates between frames includes: performing feature extraction on the current frame using a feature point detection algorithm based on spot detection to generate a candidate feature point set, performing preliminary screening on the candidate feature point set, and establishing an initial feature point set; using the response value of each feature point in the initial feature point set as a scalar function, sequentially constructing a sub-level set filtering sequence in the feature response space, gradually filling the response space and recording the evolution of the topological structure; within the local neighborhood of each feature point, extracting the persistent features of each feature point by analyzing the evolution of the topological invariant in the feature response subspace as the scale changes; calculating the ratio of the response value of each feature point to the maximum response value with the longest persistent feature in the corresponding neighborhood, and combining it with normalization processing to obtain the response ratio of each feature point; constructing a dual-threshold screening condition based on the calculated response ratio and a preset inertia filtering ratio threshold, and using the dual-threshold screening condition as a constraint condition to perform a secondary screening on the initial feature point set to construct a feature point set.

2. The adaptive environmental image processing method for industrial gas detection according to claim 1, characterized in that: The method of extracting feature points of the current frame using a feature point detection algorithm based on the image frames of the industrial monitoring video stream and obtaining the coordinates of the feature points between frames in combination with the optical flow tracking technology also includes: S12, using a feature point response threshold mechanism to screen the candidate feature point set, and combining it with a preset inertia filtering ratio threshold to establish a feature point set; S13. Use optical flow tracking technology to track the feature points in the feature point set frame by frame, and combine it with the adaptive window size adjustment mechanism to optimize the tracking accuracy and obtain the corresponding feature point coordinates between the current frame and the previous frame.

3. The adaptive environmental image processing method for industrial gas detection according to claim 2, characterized in that: The method of screening the candidate feature point set by using the feature point response threshold mechanism and establishing the feature point set in combination with a preset inertia filtering ratio threshold comprises: S121, based on the generated candidate feature point set, using a multi-scale corner detection algorithm to perform response analysis in the image space domain, and calculating the response value of each feature point in the candidate feature point set in different scale spaces based on the analysis results; S122, dividing the image into a plurality of sub-grid areas, setting a response threshold according to the mean and standard deviation of the response values ​​in each sub-grid area, and using the response threshold to preliminarily screen the candidate feature point set to establish an initial feature point set; S123, calculating the ratio of the response value of each feature point in the initial feature point set to the maximum response value in the corresponding neighborhood, and combining the preset inertia filtering ratio threshold, performing a secondary screening on the initial feature point set to establish a feature point set.

4. The adaptive environmental image processing method for industrial gas detection according to claim 3, characterized in that: The calculation of the ratio of the response value of each feature point in the initial feature point set to the maximum response value in the corresponding neighborhood and the combination of the preset inertia filtering ratio threshold to perform a secondary screening on the initial feature point set, and establishing the feature point set further includes: S1231. Using the persistent homology algorithm, perform neighborhood response analysis on each feature point in the initial feature point set, and calculate the response ratio of the response value of each feature point to the maximum response value in the corresponding neighborhood.

5. The adaptive environmental image processing method for industrial gas detection according to claim 4, characterized in that: The generating of affine transformation parameters based on the acquired feature point coordinates, and using the affine transformation parameters to transform and decompose the feature point coordinates, extracting the posture change parameters, and obtaining the image motion trajectory includes: S21, based on the acquired feature point coordinates, using a feature matching algorithm to establish feature point matching pairs between the current frame and a preset reference frame, and generating affine transformation parameters by least squares fitting to obtain an affine transformation matrix; S22. Using the obtained affine transformation matrix, transform the coordinates of each feature point in the current frame to decompose the posture change parameters of each feature point; S23. Perform kinematic integration on the posture change parameters of the current frame and the motion information of the historical frames, superimpose the affine transformation matrix at each moment, and obtain the image motion trajectory.

6. The adaptive environmental image processing method for industrial gas detection according to claim 5, characterized in that: The posture change parameters include: translation change parameters along the horizontal direction and the vertical direction, and rotation angle change parameters around the image center.

7. The adaptive environmental image processing method for industrial gas detection according to claim 6, characterized in that: The kinematic integration of the pose change parameters of the current frame and the motion information of the historical frames, and superposition of the affine transformation matrix at each moment to obtain the image motion trajectory includes: S231, based on the posture change parameters of each feature point, recursively fuse the posture change parameters of the current frame with the motion information of the historical frames through a kinematic integration algorithm to establish a kinematic constraint model between frames; S232, using a sliding window mechanism, performing temporal multiplication and accumulation on the affine transformation matrices of multiple consecutive frames, and performing correction processing in combination with spatiotemporal constraints to obtain a posture transformation matrix; S233: Analyze the obtained posture transformation matrix, extract the motion parameters of each frame image in the spatiotemporal sequence, and generate the image motion trajectory.

8. The adaptive environmental image processing method for industrial gas detection according to claim 7, characterized in that: The sliding window mechanism is used to perform temporal multiplication and accumulation of the affine transformation matrices of multiple consecutive frames, and correction processing is performed in combination with spatiotemporal constraints to obtain the posture transformation matrix, which includes: S2321. Based on the established kinematic constraint model, select a sequence of affine transformation matrices of several consecutive frames through a sliding window mechanism, and cumulatively calculate the global pose transformation corresponding to the current frame through a time-series multiplication operation of the matrices; S2322. Combine spatial and temporal constraints to perform joint error correction on the calculated global pose transformation, and construct a nonlinear optimization objective function that includes the geometric and temporal relationship between image frames; S2323. Using the Lie algebra optimization algorithm, the pose sequence is optimized and solved based on the constructed optimization objective function, and the optimization results are post-processed in combination with smoothing to obtain the pose transformation matrix.

9. The adaptive environmental image processing method for industrial gas detection according to claim 8, characterized in that: The method of predicting the image motion trajectory by using an image trajectory processing algorithm and comparing the predicted image motion trajectory with the real-time image motion trajectory generated by the current frame includes: S31. Based on the acquired image motion trajectory, a Kalman filter algorithm is used to establish a nonlinear motion model including the image position and posture state, and the nonlinear motion model is used to predict the image motion trajectory of subsequent frames to obtain a prediction result of the image motion trajectory of the current frame; S32, comparing the predicted image motion trajectory with the real-time image motion trajectory generated by the current frame frame by frame, and constructing an error vector containing the joint deviation of position and posture by calculating the spatial Euclidean distance and the attitude angle difference; S33. Use a weighted allocation algorithm to adjust the weights of the position deviation and posture deviation in the error vector to obtain a quantized trajectory comparison result.