Two methods for volume flow calculation from images of methane leakages to the atmosphere are presented. The images contain calibrated gas concentration × path length pixel information, and are processed with a block matching method and a theoretical velocity field method. Results from known methane flow in two laboratory setups and one unknown real leakage from a gas processing plant are compared with the image processing methods. The methods are generic and can be implemented in common infrared systems for gas visualization. This work provides a new tool for estimating and reporting volume flow emissions from gas processing plants to the authorities.
© 2012 OSA
Gas leaks are significant hazards in several industry segments and especially in the oil and gas industry, where large volumes of highly explosive gases are transported, treated and stored. The consequences of gas leaks may be catastrophic to both life and investments. The industry and the society work together and develop efficient methods to find and minimize leakages of gas to the atmosphere also due to environmental reasons.
Gas processing plant operators searching for leaks with photoionization detectors or thermocouple devices (PID or TCD detectors) in combination with gas alarms based on point- and line detectors are frequently used methods to secure work today. Remote sensing with mobile LIDAR systems are used to monitor gas released from large areas such as gas processing plants and occasionally from volcanoes [1,2]. Point-detectors based on MEMS fabrication and thus miniaturization of the spectrometer could potentially complement existing point detectors .
Optical gas imaging with UV , infrared  or laser [6–8] assisted cameras helps the operator to cover a wider area and find leaks undetected by point- or line-monitoring. The Environmental Protection Agency in the US recently allowed optical gas imaging as an alternative work practice for regulatory gas detection. Much effort is now invested in taking the optical gas imaging from detection and quantification to flow rate estimation.
Gas detection work is nowadays easily performed with handheld infrared cameras such as the gas absorption band optimized cameras from FLIR Systems. Gas imaging in combination with a spectrometer combines the direct camera view with specific concentration × path length values of the gas in each pixel. Infrared Fourier transform cameras are available from TELOPS and can be used to detect, image and quantify several gases. Remote methane gas-correlation sensing of e.g. pipelines from airborn platforms are performed by the company Synodon.
The virtue of the imaging gas-correlation technique is the holistic discrimination between spectral frequencies with specific gas absorption and transparent areas, which is obtained by comparing a direct image to a image through an optically thick gas absorption cell . Varying thermal background, reflectance or emittance over the image are compensated when using the gas-correlation technique. Real time gas images produced at frame rates above 18 Hz, makes it possible for human eye perception to follow the optical flow back and pinpoint the gas leak without having to wait for post-processing of the images. The gas process operators situational awareness can thus be improved .
The gas vision system employed in this work is able to locate the source of a gas leakage with high spatial accuracy through a gas image fused with a visual image. At gas concentration × length above predefined thresholds, the system automatically records the gas plume in real time, tracking its development and path-integrated concentration. The data can be retrieved for immediate analysis, helping the operator to locate the leak and evaluate its severity. This makes subsequent maintenance easier and, above all, safer, and represents the first automatic, gas correlation based system for leak detection that can be used in proactive leak search and maintenance.
With the availability of gas concentration × length images in real time, quantitative flow calculations can be performed [11–14]. The present work is based on the calibrated gas images and the time shift between the images of turbulent gas to calculate the volume flow from a leak. Two image processing methods that produce results in good agreement with experimental data will be presented.
2. Setup and measurements
The gas vision system has been used in two experimental setups to produce quantified gas concentration × length sequences of images for this work. E.g. 100% gas over a depth of 0.01 m is equal to 10000 ppm × m. Calibration of the concentration length images was presented in detail earlier in . The images are a 2-dimensional projection of the 3-dimensional gas concentration volume. Two images are formed at the same time by two infrared telescopes with a field of view of 4.8° and a focal length of 125 mm. Inside one on the telescopes a methane gas filter cell is located (18000 ppm × m). Behind the telescopes two quantum well infrared photodetectors (QWIP), manufactured by AIM Infrarot-Module to have highest response at the methane absorption band at 7.7 µm, are positioned. The QWIP consists of 286 × 384 pixels with a pitch of 24 µm. The threshold value for the noise equivalent concentration length is set to 1600 ppm × m × ΔT (e.g. a methane gas cloud with 1 m optical depth and a temperature difference of 10 K is detected at a concentration of 160 ppm). Conversion from image pixels to object pixels are necessary in both the methods presented, thus the distance to the gas plume must be known. The instantaneous FOV of one pixel is 0.192 mrad. The camera was designed with a near focus of ~10 meters and at this distance the observed length of the object pixel is 19 mm (IFOV × R2), where R is the distance from the detector to the target. The idea behind the calculation of the volumetric flow was to multiply the concentration length by the area of the object pixel (e.g. 5000 ppm × m multiplied by 19 mm2) and then divide the obtained gas volume by the time it takes for the gas to move in the sequence of images. All the object pixels with gas moving away from the source are then added to the flow rate.
With the first setup images of controlled leaks were captured in a laboratory at a distance of 7.5 m. Gas was released under an exhaust hood which was placed 0.3 m in front of and above a temperature regulated blackbody radiator (ΔT was 10 to 20 °C between the gas temperature and the radiator).
A long flexible hose with an inner diameter of 10 mm was connected to a two-stage gas regulator to reduce the pressure from a methane gas cylinder (methane purity: 99.5%). This arrangement ensured that the gas had reached room temperature when it was released to the atmosphere. It should be noted that for all passive infrared gas imaging methods, the temperature difference between the gas and the background, ΔT, has to be known for a correct calibration and that for ΔT = 0 no gas absorption will be observed due to the fact that the absorption and emission cancel out. The gas plume moved perpendicular to the optical axis of the camera. The flow was then set in the range 1-10 liters/min with a calibrated rotameter with a repeatability of 0.05 liters/min. The nozzle was a circular 10 mm diameter short hose connected to the rotameter. Gas was also released instantly from a 0.5 liter plastic bag.
During work with the second setup images of controlled leaks were captured at a distance of 105 m with a concrete wall with windows as background. The flow was set with a needle valve, calibrated for two different flows: 18 ( ± 2) liters/min and 12.5 ( ± 0.8) liters/min.
Volumetric flow calculation is also performed on a real gas leak from a gas processing plant imaged from a distance of 95 m.
Two different methods have been developed for obtaining velocity fields describing the movements of gas in concentration × length images between consecutive image frames; one based on the optical flow technique of block matching  and one based on the theory of turbulent gas jets . Velocity fields are combined with corresponding regions of optically thin gas concentration pixels in order to calculate volume flows. Volume flow calculation is performed by moving the gas according to the velocity fields, whereby volume flow can be obtained either as a function of the radial distance from the source, or through arbitrary control volumes.
3.1 Block matching model
The movements of structures in turbulent gas leaks are tracked by comparing pixel blocks in one image with a corresponding block in an image taken 50 ms later. The best block match is found within a search region, which is selected to coincide with the region where the gas is optically thin, and the velocity corresponding to the movement from the first to the second block is then calculated. The penalty function in Eq. (1) is minimized to find the best match with corresponding velocity v. The first term is a pixel-by-pixel comparison between the two blocks. In addition, the constants β and γ take the properties of general gas leaks into account: penalty is added for deviating speed compared to neighboring pixels to ensure smooth speed changes. The constants used to set the strength of the restrictions were tested and increased with 4% for β and with 20% for γ. Minor improvements of the final flow results were obtained with the new values. Penalty is also added through a function G for deviating directions between the current velocity v and a selected direction o. If the gas leak has a specified source, o is taken to be the vector from the source to the current block for small distances from the source, or the mean velocity of the neighboring pixels for distances further from the source. Alternatively, volume flow can be calculated across the boundaries of an arbitrary control volume in the image, whereas o is taken to be the perpendicular directions to the control volume boundary. Four complete iterations of three different block sizes (32 × 32, 16 × 16 and 8 × 8 pixels) are used consecutively to account for turbulent structures of different scales, starting with the largest block size and increasing the accuracy with smaller block sizes. An iterative approach is used because of the inter-dependence between pixel velocities.
Velocities are calculated on a sub-pixel level by considering a 3x3 pixel block centered on the end point of a calculated integer velocity vector. Each pixel is assigned a function value from Eq. (1), these values are interpolated and the integer velocity is redirected to the minimum point on the resulting surface.
A simple test was made to see if even smaller block sizes could be used for low resolution images. A laboratory measurement gas concentration film with flow 5 liters/min was reduced to 1/8 in length resolution. Blocks with sides 16, 8 and 4 pixels gave worse results compared to the standard block sizes.
Generally, as many frames as possible should be used in order to average fluctuations in the gas-jet itself and also to average any errors in the model. The computation time should also be limited. For a low number of frames there are sudden changes due to either relatively large or small values for the additional frame. We have observed that 30 frames is a good compromise during these experiments. More frames might be needed for long-range measurements or difficult flow geometries.
Correct matches are not always found and a filter was developed to correct these velocities. Grossly deviating speeds are corrected by imposing a lower- and upper size limit derived from the median speed of the entire velocity field. Faulty directions are corrected by finding a median velocity within a local region in three consecutive images (faulty velocities are less likely to be consistent over time). Velocities with grossly deviating directions are redirected to the median direction and speed.
3.2 Velocity field model
A velocity field according to the theory of turbulent gas jets , can be applied to leaks with gas jet geometry. The velocity profiles of an axially symmetric jet are described with Eq. (2,3) and can be implemented in the form of a matrix with row and column numbers corresponding to radial and axial coordinates and element values containing the axial speed. The shape of the field is determined by the source exit speed and source opening diameter, see Fig. 1 . The axial speed Uo is a function of the exit speed UJ, nozzle diameter d and axial coordinate x. U(x,r1/2) = Uo (x,0) / 2. B and S are empirical constants and xo is called the virtual origin.
This velocity field was modified to take into account different velocities at infinity, e.g. due to ambient wind speed. The speed can also be set to be damped in the centre of the gas jet. This is because pixels in the centre of the gas jet contains gas positioned from r = 0 to r equal to the full gas jet radius. These pixels should be assigned a resulting speed that is lower than the speed at r = 0. The speeds are mapped onto the gas concentration images. The positions are calculated with respect to the skeleton (center) of the gas jet, which also determines the velocity directions. In order to find the right parameters, a velocity field is imposed on an “ideal” experimental flow (source diameter 10 mm, 4 liters/min) with known mean velocity field. The velocity at infinity is measured in the laboratory to be 10 ( ± 3) cm/s. This would be the upward drift velocity for methane in still ambient air, but including any upward wind speed caused by the heated black-body background used in the laboratory. The flow is then calculated for 60 frames as the flow out from circles of different sizes centered over the source; as done with the initial block matching model, but now with the theoretical velocity field. The results are shown in Table 1 . With just the velocity at infinity as a correction to the theory the calculated flow came very close to the correct value, within the error margin. A 2% damping of the central velocities was introduced to get closer to the set flow. Even if both results are within the error margins, it is physically motivated to introduce some damping of the central velocities as explained above.
The final velocity field is illustrated in Fig. 2 . In graph A, the velocity field is applied to the laboratory measurement of a simple gas jet in front of a black body radiator placed 30 cm behind the gas, Tbackground ≈45°C, Tair ≈25°C. When combining the velocity field with the concentration images, the flow was calculated to 5 liters/min, which agrees well with the set flow of 5 ( ± 0.24) liters/min.
When the velocity field has been calculated it can be combined with the amount of gas in each pixel to give an estimate of the total flow of the leak. This method for volume flow calculation applies a normalized velocity field (v-fields) to the gas concentration images, according to the theory for gas jets. These v-fields are then scaled and reshaped to find the fields that give the best fit between mass distributions of two consecutive images, measured from the source. The gas of the first image is moved according to the v-field, and the mass distribution of this image is compared with the mass distribution of the second, original, image. These should ideally be equal. With the use of sub-pixel velocities, the recreated images are sufficiently smooth to make good comparisons. This method best applies in the area close to the source where the gas is not driven by the wind. The leak should also ideally follow the theory for gas jets. The v-fields are, however, reshaped enough to give room for deviations from theory, in the following steps:
- I. A normalized v-field is mapped onto the concentration images. Block matching is done for a central region in two of the frames to give an initial scale factor.
- II. The v-fields are scaled in magnitude around the initial scale factor to find the best match. Scales from 0.5 to 1.5 times the initial scale value.
- III. The v-fields are then reshaped to profiles corresponding to different velocities at infinity, from −0.05 to 0.7 times the source exit velocity. This can be described as the axial velocity profile in Fig. 2C being tilted around its midpoint. This gives some room for interventions from ambient wind speed. Steps I and II are performed two times.
- IV. The gas jet is divided into segments for different distances from the source. These are scaled individually starting from the source to the end of the gas jet. This allows for deviations from theory and is performed twice since the fit depends on the neighboring segment velocities. The segments are scales from 0.7 to 1.3 times the previously obtained scale factor.
In order to be applicable to gas jets that are broader (larger radius) than predicted by theory, gas pixels that are beyond the theoretical radius of the gas jet are assigned speeds that are 20% of the closest axial speed. There is no guarantee that the best match corresponds to a correct velocity field. Consideration must be taken to which flow geometries the method can be applied to and how much the velocity fields are reshaped compared to the theoretical velocity field of a simple gas jet.
4. Numerical results
4.1 Controlled measurements
Results from laboratory measurements are presented in Table 2 . At every set flow, ten experiments were performed. Each calculation uses 30 frames (1.5 s long sequence, rate: 20 frames/s). Both methods underestimate volume flows to some extent, in agreement with previous observations for optical flow methods . A factor 0.8 of true flow for the block matching method and 0.7 for the velocity field method. However, for the block matching method there is a close to linear dependence between set flow and calculated flow (R2 = 0.995). For the velocity field method the R2 value is not descriptive as the curve is shaped as the letter S around the linear fit. The two last measurements in Table 2 are performed on obstructed flow but from the same hose with an inner diameter of 10 mm, which resulted in similar calculated volume flows but with increased standard deviations.
In Fig. 3 the flow was obstructed close to the source resulting in two gas jets originating from the same source. Gas movement is driven by the pressure difference, the methane buoyance in air, heated air from the blackbody radiator and the local exhaust hood placed above the upper left corner of the movie (Media 1).
There are many gas-leak geometries other than that of gas jets originating from a well defined source. For example gas clouds, leaks without a visible source, or if the gas is partially hidden behind obstacles. A program was written for calculating the flow through a line drawn by the user, see Fig. 4 . This can be a single line or a number of connected lines. The user draws a line in one frame, and indicates the direction of the flow, and the surrounding (e.g. 30) frames are uses to calculate the flow. The line is displaced ± 6 pixels in the perpendicular direction, which gives a limited number of flow calculations compared to the method used for gas-jets. The program works by marking two areas, one on each side of the line, each 40 pixels wide. The velocity field is obtained by block matching in these areas only. The penalty term for deviating velocity direction uses the perpendicular direction to the line, in the indicated flow direction. If multiple lines are drawn, the orientation of the closest line is used. This encourages velocities perpendicular to the line since it its assumed that the line is drawn perpendicular to the gas motion. The gas image is reconstructed according to the calculated velocity field, with no gas pixels allowed to exit the marked areas. The change in total concentration per time unit between the two marked areas is the flow. The mean is taken for all the displaced lines and all the frames. The block matching method in combination with the user drawn line was used to calculate volume flow for a rising gas cloud of methane with volume 0.5 ± 0.05 liter. This is shown in Fig. 4, where the volume flow across the horizontal line is calculated, starting the time just before the gas reaches the line and ending when the majority of the gas cloud has passed and only small concentrations remain in the images (Media 2). The instantaneous flow for each frame is presented in Fig. 5 as well as the total gas volume passing through the line, which reaches 0.48 liter after 70 frames (3.5 s), which is well within the error margins.
For measurements made at a 105 m distance, the gas leaks are affected by light wind. All possible sections of the gas concentration films are used where the gas predominantly moves in the image plane. Results are presented in Table 3 . The block matching method performs well, with a possible tendency to underestimate the flows. The velocity field method gives well positioned mean results, but with higher standard deviation and with an obvious inaccuracy for the section using 25 frames. A film of one of the measurements is shown in Fig. 6 (Media 3).
4.2 Application to a real gas leak
Both methods for volume flow calculations are tested on a real leak from a pilot installation at a gas processing plant; results in Table 4 . The leak changes direction in the wind from time to time and sections from the film are selected as previously mentioned. The selection with 20 frames has clearly higher flow than the other selections. When looking at this sequence, the gas is temporarily concentrated in a high concentration cloud, moving away from the source, resulting in high flow for some of these frames. The standard deviations are quite large for the two first sections, but some observations can be made about the performance. Firstly, there is some agreement between the two methods. Secondly, the leak can be compared with the measurement at 105 m distance with flux 18 liters/min in order to estimate if the calculated flows are plausible; see Fig. 7 . The concentration values are approx. 10 times higher in the images of the unknown leak (left hand image) compared to the known leak (right hand image). The mean velocity, as calculated with the block matching method, is 2.2 times higher for the unknown leak. With the estimated difference in concentrations and mean velocity we estimate the leak to approximately 400 liters/min. The leak is also spatially larger in size (larger width) and has a higher signal/noise ratio, which can be seen in the two frames in Fig. 7. These observations motivate the calculated values to be plausible.
4.3 Initial theoretical error analysis
The error in the calculated flow originates from three main parts; the gas concentration length, the velocity fields and the method used to calculate the flow using these two factors. The temperature imposed gas concentration length error multiplies with the calculated gas velocity error and they are the two fundamental factors of the theoretical volume flow error. The theoretical gas concentration length error due to an assumed temperature difference error ( ± 1 °C) was calculated for a room and gas temperature of Tg = 22 °C and ΔT = Tb - Tg, see Table 5 . For the general case, the accuracy in the concentration values is approx. ± 5% for concentration lengths up to 5000 ppm × m at a ΔT of 25 °C.
The 3-D velocity fields are projected on the 2-D images. If a gas leak is viewed from the side, the error from this projection should be neglectable since the radial speeds are approx. 1/40 of the axial speeds in the ideal gas jet case . The resolution of 1 pixel/frame contributes to a velocity error of 5% at 20 pixels/frame, 10% at 10 pixels/frame and 50% at 2 pixels/frame. The effect of this error on the calculated flow is much less if the error is equally distributed around zero, which approximately should be the case if many pixels and frames are used. With sub-pixel velocities enabled the mathematical resolution can be very high (e.g., 1/20 pixel is used in the present algorithm). Sub-pixel velocities improve the result for low resolution images and it can be concluded that the useful resolution is better than 1 pixel/frame.
5. Conclusions and future work
Two methods have been developed and used to calculate the flow from leakages of known flow rate in laboratory conditions, experimental outdoor leakages of known flow rates and one leakage of unknown flow at a gas processing plant. The results show that the method based on optical block matching is preferred for better accuracy in calculated methane gas flow. The verification of the block matching method produces more linear results and lower standard deviation with increasing flow than the model based on theoretical velocity fields. The block matching method typically underestimates the gas flow by 6-17%. However, scalar projections of the gas plume vectors perpendicular to the optical axis are necessary. In the case that the gas moves in the direction of the optical axis, both methods fail. This case can be rectified by adding more cameras to the proccessing plant. With more cameras the estimate can be improved by including a variable distance to the gas plume derived from several cameras seeing the same plume. Another explanation for the underestimation of gas flow is that methane disperse below the sensitivity of the camera. The number of frames selected should be 30-100 (20 frames/s) in order to get optimum results depending on the flow geometry and the signal/noise ratio. The block matching method relies on temporally stable structures between two frames. This is a limitation when automatically calculating flows from gas jets. However, this could be amended by implementing tools that allow the user to select areas in the frames where the gas jet has been diluted and moves slower. The image region where gas flow calculation should be performed is where the block matching model velocity vectors are stable and the standard deviation is low and where the gas is optically thin.
More investigations on real leakages and optimization of the algorithm to make it computationally faster would be advantageous before implementation in a gas visualisation and quantification system.
The work in the present paper is the result of collaboration between Lund university, Gasoptics Sweden AB and Statoil ASA. The authors are very grateful to present and past collaborators including T. E. Bustnes, J. K. Holen at Statoil ASA in Stavanger, Norway and B. Ardö, T. Christiansson, H. Edner, N. Ohlsson and S. Svanberg at the Physics department in Lund, Sweden. This work was financially supported by Statoil ASA and Gasoptics Sweden AB.
References and links
2. S. Svanberg, “Geophysical gas monitoring using optical techniques: volcanoes, geothermal fields and mines,” Opt. Lasers Eng. 37(2-3), 245–266 (2002). [CrossRef]
3. G. Lammel, S. Schweizer, and P. Renaud, “MEMS infrared gas spectrometer based on a porous silicon tunable filter,” in Proceedings of the 14th Int. IEEE Conf. on MEMS (IEEE, 2001), pp. 578–581.
4. G. J. S. Bluth, J. M. Shannon, I. M. Watson, A. J. Prata, and V. J. Realmuto, “Development of an ultra-violet digital camera for volcanic SO2 imaging,” J. Volcanol. Geotherm. Res. 161(1-2), 47–56 (2007). [CrossRef]
5. E. Hirsch and E. Agassi, “Detection of gaseous plumes in IR hyperspectral images - performance analysis,” IEEE Sens. J. 10(3), 732–736 (2010). [CrossRef]
7. D. Stothard, M. Dunn, and C. Rae, “Hyperspectral imaging of gases with a continuous-wave pump-enhanced optical parametric oscillator,” Opt. Express 12(5), 947–955 (2004), http://www.opticsinfobase.org/abstract.cfm?URI=oe-12-5-947. [CrossRef]
8. G. Gibson, B. V. Well, J. Hodgkinson, R. Pride, R. Strzoda, S. Murray, S. Bishton, and M. Padgett, “Imaging of methane gas using a scanning, open-path laser system,” New J. Phys. 8, 1–7 (2006).
9. J. Sandsten, P. Weibring, H. Edner, and S. Svanberg, “Real-time gas-correlation imaging employing thermal background radiation,” Opt. Express 6(4), 92–103 (2000), http://www.opticsinfobase.org/abstract.cfm?URI=oe-6-4-92. [CrossRef]
10. J. Sandsten, H. Edner, and S. Svanberg, “Gas visualization of industrial hydrocarbon emissions,” Opt. Express 12(7), 1443–1451 (2004), http://www.opticsinfobase.org/abstract.cfm?URI=oe-12-7-1443. [CrossRef]
11. J. L. Barron, D. J. Fleet, and S. S. Beauchemin, “Performance of optical flow techniques,” Int. J. Comput. Vis. 12(1), 43–77 (1994). [CrossRef]
12. J. Gao and M. B. Lythe, “The maximum cross-correlation approach to detecting translational motions from sequential remote-sensing images,” Comput. Geosci. 22(5), 525–534 (1996). [CrossRef]
13. T. J. Crone, R. E. McDuff, and W. S. D. Wilcock, “Optical plume velocimetry: a new flow measurement technique for use in seafloor hydrothermal systems,” Exp. Fluids 45(5), 899–915 (2008). [CrossRef]
14. J. L. Harley and K. C. Gross, “Remote quantification of smokestack effluent mass flow rates using imaging fourier transform spectrometry,” Proc. SPIE 8018, 801813, 801813-13 (2011). [CrossRef]
15. S. B. Pope, “Free shear flows,” in Turbulent Flows (Cambridge, 2000), pp. 96–103.