Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
LEAK DETECTION
Document Type and Number:
WIPO Patent Application WO/2015/143569
Kind Code:
A1
Abstract:
Apparatus and corresponding method are invented for detecting a leak in equipment forming a target, such as a stuffing box. The apparatus includes an image analyzer configured to receive an image from camera and analyze the image to determine if a leak on the equipment is present by comparing a color channel of the image with a reference and the image analyzer having an output port for delivering a notification upon the image analyzer determining that a leak is present on the equipment.

Inventors:
BADAWY WAEL (CA)
RAHMAN ASHIQ (CA)
ROGERS SHANE (CA)
DU SHAN (CA)
Application Number:
PCT/CA2015/050244
Publication Date:
October 01, 2015
Filing Date:
March 27, 2015
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
INTELLIVIEW TECHNOLOGIES INC (CA)
International Classes:
G01M3/04
Foreign References:
US20120269430A12012-10-25
US6539106B12003-03-25
Other References:
JADIN ET AL.: "Gas Leakage Detection Using Thermal Imaging Technique", UKSIM-AMSS 16TH INTERNATIONAL CONF. ON COMPUTER MODELLING AND SIMULATION (UKSIM, 26 March 2014 (2014-03-26), pages 302 - 306, XP032738453, ISBN: 978-1-4799-4923-6
GARCÍA-ALEGRE ET AL.: "Color index analysis for automatic detection of eggshell defects", PROCEEDING OF THE SPIE, vol. 3966, 2000, pages 380 - 387, XP055227105
SARAVANAN: "Color Image to Grayscale Image Conversion", 2010 SECOND INTERNATIONAL CONFERENCE ON COMPUTER ENGINEERING AND APPLICATIONS (ICCEA, vol. 2, 19 March 2010 (2010-03-19), pages 196 - 199, XP031656429
KOSCHAN ET AL.: "Detection and classification of edges in color images.", IEEE SIGNAL PROCESSING MAGAZINE, vol. 22, no. Issue 1, 2005, pages 64 - 73, XP011128686, ISSN: 1053-5888
Attorney, Agent or Firm:
LAMBERT, Anthony R. (- 81 Ave.Edmonton, Alberta T6E1X2, CA)
Download PDF:
Claims:
THE EMBODIMENTS OF THE INVENTION IN WHICH AN EXCLUSIVE PROPERTY OR PRIVILEGE IS CLAIMED ARE DEFINED AS FOLLOWS:

1. A method of detecting a leak in equipment forming a target, the method comprising: acquiring a test image of the target with a camera, in which the test image comprises pixel values that are representative of color;

sending the test image to an image analyzer;

analyzing the test image to determine if a leak is present on the equipment from the pixel values that are representative of color; and

upon determining that a leak is present, generating a notification of the presence of a leak.

2. The method of claim 1 in which analyzing the test image comprises comparing a color channel of the test image with a reference.

3. The method of claim 2 in which the reference comprises color information from a reference image of the target.

4. The method of claim 1, 2 or 3 in which the test image represents color in a first color space and analyzing the test image comprises transforming the first color space to a second color space.

5. The method of claim 4 in which the second color space has a blue-yellow axis and a red-green axis.

6. The method of any one of claims 1-5 in which analyzing the test image comprises determining a dominant color channel of the test image.

7. The method of any one of claims 1-6 in which the presence of a leak is determined by the following protocol: the target is relatively dark when dominantly red or yellow or the target is relatively bright when dominantly green or blue.

8. The method of any one of claims 1-7 in which analyzing is carried out by analysis of a region of interest in the test image.

9. The method of any one of claims 1-7 in which analyzing is carried out by analysis of a segmented portion of a region of interest in the test image.

10. The method of claim 8 or claim 9 in which the region of interest is user selected.

11. The method of any one of claims 1-8 in which analyzing comprises removing pixel values representative of glare from the test image.

12. The method of any one of claims 1-8 in which analyzing comprises removing pixel values representative of snow from analysis of the test image.

13. The method of any one of claims 1-12 in which the equipment is a stuffing box.

14. Apparatus for detecting a leak in equipment forming a target, the apparatus comprising:

an image analyzer configured to receive an image from camera and analyze the image to determine if a leak on the equipment is present by comparing a color channel of the image with a reference and the image analyzer having an output port for delivering a notification upon the image analyzer determining that a leak is present on the equipment.

15. The apparatus of claim 14 further comprising a camera connected to send an image of the target to the image analyzer.

16. An image analysis system comprising a camera and a server with an input port and an output port, the server being configured to carry out the method steps of any one of claims 1- 13.

Description:
LEAK DETECTION

TECHNICAL FIELD

[0001] Leak detection.

BACKGROUND

[0002] Oil wells generally comprise a positive pressure pump located beneath the surface within the oil source. The pump is mechanically operated from the surface by a rod string operated by a walking beam apparatus. The rod string passes into the well at the surface of wellhead through a stuffing box, and the upper portion of the rod string is enclosed in a polished rod which provides a smooth surface to wear against the seals in the stuffing box. The reciprocating motion of the polished rod makes the oil flow up to the wellhead from where it is piped to storage. The stuffing box uses seals or packing to prevent leakage from passing out of the stuffing box from around the reciprocating rod. However, the harsh environment at the wellhead (corrosive chemicals, sand and abrasives, etc.) can cause the seals or packing in the stuffing box to deteriorate rapidly, thereby allowing oil to pass through the worn seals and be thrown about the immediate environment due to the reciprocating action of the rod. The Environmental Protection Agency has developed strict regulations against such occurrences and therefore it is important to provide sensors at the wellhead for recognizing stuffing box failure and for generating a signal to alert responsible operators to take appropriate action.

[0003] There are some existing apparatus to detect stuffing box leakage. Some methods surround the stuffing box by a reservoir of lubricant maintained at a static fluid pressure, which is substantially higher than the pressure at which the oil is produced from the well. A drop of the pressure in the reservoir indicates a leakage of the stuffing box. Some methods use container/salvage chamber to collect leaking oil. When the level of fluid in the container reaches a certain point, the leakage is detected. Existing methods require disruption of the oil well operation for their installation, and some even require modification to the stuffing box and/or wellhead piping and components. There is room for a new method and apparatus that is easy to install without interfering with wellhead operation. SUMMARY

[0004] In an embodiment, there is provided a method of detecting a leak in equipment forming a target, the method comprising acquiring a test image of the target with a camera, in which the test image comprises pixel values that are representative of color, sending the test image to an image analyzer, analyzing the test image to determine if a leak is present on the equipment from the pixel values that are representative of color; and upon determining that a leak is present, generating a notification of the presence of a leak.

[0005] In an embodiment, there is provided an apparatus for detecting a leak in equipment forming a target, the apparatus comprising an image analyzer configured to receive an image from camera and analyze the image to determine if a leak on the equipment is present by comparing a color channel of the image with a reference and the image analyzer having an output port for delivering a notification upon the image analyzer determining that a leak is present on the equipment.

[0006] In an embodiment, there is provided an image analysis system comprising a camera and a server with an input port and an output port, the server being configured to carry out leak detection steps based on color information in a test image.

[0007] In various embodiments, there may be included any one or more of the following features: analyzing the test image comprises comparing a color channel of the test image with a reference; the reference comprises color information from a reference image of the target; the test image represents color in a first color space and analyzing the test image comprises transforming the first color space to a second color space; the second color space has a blue-yellow axis and a red-green axis; analyzing the test image comprises determining a dominant color channel of the test image; the presence of a leak is determined by the following protocol: the target is relatively dark when dominantly red or yellow or the target is relatively bright when dominantly green or blue; analyzing is carried out by analysis of a region of interest in the test image; analyzing comprises removing pixel values

representative of glare from the test image; and the equipment is a stuffing box.

[0008] These and other aspects of the device and method are set out in the claims, which are incorporated here by reference. BRIEF DESCRIPTION OF THE FIGURES

[0009] Embodiments will now be described with reference to the figures, like reference characters denote like elements, by way of example, and in which:

[0010] Fig. 1 is a schematic showing equipment for detecting a leak in equipment;

[0011] Fig. 2 is an exemplary reference image;

[0012] Fig. 3 is an exemplary test image; and

[0013] Fig. 4 illustrates processing steps carried out by the image analyzer; and

[0014] Fig. 5 illustrates exemplary method steps.

DETAILED DESCRIPTION

[0015] Immaterial modifications may be made to the embodiments described here without departing from what is covered by the claims.

[0016] Referring to Fig. 1, an apparatus for leak detection is shown having one or more cameras 10 installed in the oil field facing a wellhead stuffing box 11. The camera 10 has a field of view 12 and the field of view will include the stuffing box 1 l .The camera 10 acquires an image of the stuffing box 11. In an initialization stage, the image is a reference image. In onsite operation, the camera 10 acquires a test image. The acquisition of the test image may occur on a schedule, for example at fixed intervals, such as daily or at shorter or longer intervals as the operator determines.

[0017] An image is a set of pixel values determined by light received in the camera

10 at locations on an imaging device in the camera corresponding to locations in the field of view. The images can be sent to a conventional input port of a server 14 directly via a conventional cable, or indirectly via a suitable communications channel such as a radio 13 that communications through a telecommunications network 15. In some embodiments, the server 14 may be formed of a local processor (for example to carry out basic control of the camera) as well as a remote processor for carrying out other functions such as image analysis.

[0018] The server 14 analyzes the images and then determines if the stuffing box 11 has leaked or not. The server 14 functions as an image analyzer. The method and apparatus may be applied to other targets. A stuffing box is an example of a target. The server 14 may cause a notification 17 to be generated and output from an output port of the server 14, which may be any of a variety of notifications, and may be communicated directly to an operator or through a network 16, which may be the same network as network 15, via suitable methods such as through a fixed station 18, web interface 20, email 22 or smart phone 24. The output port may be for example a USB port, network interface, display driver or other conventional output port of a computer. The notification 17 may comprise an electronic message indicative of a leak, or the generation of a sound, light signal, mechanical signal or other signal that may be observed by a human or monitoring equipment. The server 14 may communicate two-way with a further remote server (not shown) or other remote device such as a smart phone 24. In on demand operation, the remote device may instruct the server 14 to acquire a test image from the camera 10 and the test image 10 is then processed by the server 14. In some embodiments, the server 14 may be a remote server and need not be situated with the camera 10.

[0019] For image analytics, color information is proposed to be used. Since the crude oil color is generally different from the stuffing box color, if there is a leakage, the top of the stuffing box will gather some black or dark brown oil as shown in Fig. 3.

[0020] A difficulty of this project is that many factors affect color appearance. The first thing is the lighting conditions. Since the stuffing box 11 is on a wellhead 26 and the wellhead 26 is in the field, the sunlight changes (cloudy, sunset, night, glare, shadow) affect the appearance of the captured images. As with any outdoor applications, weather condition is another big problem. For example, storm, snow, rain, and fog, also affects the image appearance. Occlusion, such as water drops on the stuffing box 11, dirt, rust, and snow gathered on the top of the stuffing box, is another challenge of the detection.

[0021] Since the images are captured at various distance, direction and zoom level, the users may be required in an initialization step 40 (Fig. 4) to define a region of interest (ROI) 30 on the target stuffing box 11 by themselves. A software interface in the server 14 lets users draw a surrounding rectangle box around the ROI 30 on a reference image 32. The reference image 32 appears as for example a window on a display device associated with the server 14. Box selection of pixels from an image is a known process, as for example the snapshot function in Adobe™ Reader, and need not be further described. The ROI 30 is then processed. For one wellhead stuffing box, this initialization only needs one time since the camera 10 is fixed. For a testing image (Fig. 3), its ROI 36 is determined by the same position of the reference ROI 30.

[0022] Because of the color difference between the stuffing box 11 and the crude oil of a leak 38, color information is the major feature proposed in our approach. For determining a reference, we prefer to analyze a reference image 32 for color information that will correlate to color information in an ROI 36 of a test image. The reference image 32 is preferably an image of the same stuffing box 11 as is in the test image. However, in some embodiments, a reference image may be acquired from a representative stuffing box and used as a reference for test images from other stuffing boxes, if the environment is suitably stable. In other embodiments, the analyzer 14 may intelligently compare the test image with a reference or reference image, using more sophisticated statistical analysis than a greater than - less than analysis. For example, where a suite of reference images is available of one or more stuffing boxes, including the target stuffing box, and one or more test images of the target stuffing box are available, perhaps being separated in time by hours or days, statistical analyses such as Bayesian or neural network analysis may be applied to determine a probability of a leak.

[0023] There are many different color models to describe colors. A color model is an abstract mathematical model describing the way colors can be represented as tuples of numbers, typically as three or four values of color components. RGB model (Red, Green, and Blue) is the basic one that is associated with the original pixel values. Since the RGB values are very sensitive to the illumination changes, it is hard to use RGB color space to detect oil leak. We need to convert RGB to other color space in this situation. By

investigating many color spaces, such as HSV, YCbCr, YUV, HSI, etc., we choose the CIE L*a*b* color space preferably, although other color spaces may be used.

[0024] A color space for example CIE L*a*b* color space or the like that encompass all colors the average human can see may be used. It is robust to image variations since even under bad environment we can still differentiate non-neutral colors (e.g., red, yellow, green). An L*a*b* color space is a color-opponent space with dimension J* for lightness and a* and b* for the color-opponent dimensions, based on nonlinearly compressed CIE XYZ color space coordinates. The vertical L* represents lightness ranging from 0-100. The horizontal axes are represented by a* and b*. They are at right angles to each other and cross each other in the center, which is neutral (gray, black or white). They are based on the principle that a color cannot be both red and green, or blue and yellow. The a* axis is green at one extremity (represented by -a), and red at the other (+a). The b* axis has blue at one end (-b) and yellow (+b) at the other. The center of each axis is 0. A value of 0, or very low numbers of both a* and b* will describe a neutral or near neutral. In theory there are no maximum values of a* and b*, but in practice they are usually numbered from -128 to +127 (256 levels).

[0025] There may be no direct formulas for conversion between RGB values and

L*a*b*, because the RGB color model is device dependent. The RGB values first need to be transformed to CIE XYZ and then transformed to L*a*b* (as for example in equations ((1)- (4))·

0.412453 0.357580 0.180423

0.212671 0.715160 0.072169

0.019334 0.119193 0.950227

(lie x Y 1 ' 2 for Υ > 0.008856

[0027] - ie

~ (903.3 X Y for Y < 0.008856 ( '

[0028] a = 500 x (f(X) - f(Y)) + delta (3)

[0029] b = 200 x (f(Y) - f{Z)) + delta (4)

Where (t) =

128 for 8— bit images

And delta =

0 for floating— point image

[0030] This outputs 0 < L≤ 100, -128 < a≤ 127, and -128 < b≤ 127

[0031] For 8-bit images, the values are then converted to the destination data type: [0032] L = L X 255/100 (5)

[0033] a = a + 128 (6)

[0034] b = b + 128 (7)

[0035] The reference image 32 needs to be analyzed first. A reference image 32 is a comparatively clear image of the stuffing box 1 1 without leak. From the reference image 32, we need to get the information of the stuffing box position, ROI size and dominant color. The illumination of the reference image 32 should be good, no glares, no shading.

[0036] To detect oil leak 38, we need to detect the color change on the top of the stuffing box 1 1. If there is a leak, the color of the stuffing box 1 1 must be covered by the oil partially or totally. Thus, we first need to know the dominant color of the stuffing box 1 1. The dominant color of a stuffing box 1 1 is determined by an automatic analysis in the L*a*b* domain. As we already know, a* channel is representing red-green color, and b* channel is representing yellow-blue color. If a* is positive, the stuffing box is reddish.

Otherwise, it is greenish. If b* is positive, the stuffing box is yellowish. Otherwise, it is bluish. Since there are two color channels obtained from L*a*b*, we need to select the dominant one and focus on it to analyze the color change.

[0037] In an example of an information extraction step 42 in the proposed method

(Fig. 4), the dominant color is determined at step 44 by selecting the channel that has the most apparent non-neutral color (not white, black or gray). To select this channel, an image of the target is analyzed. If the target does not occupy all or a substantial portion of the field of view of the target, a mask may be applied to eliminate portions of the field of view that do not correspond to the target and thus segment the ROI. In the case of a stuffing box, for example, the shaft that passes through the stuffing box may be removed from the image by masking. In a typical field of view of a stuffing box, the top of a stuffing box will appear as an oval shape and the mask may have this oval shape, with the shaft removed. Referring back to equations (6) and (7), the values are added by factor, in this case 128, which corresponds to the neutral color, e.g., black. Whichever channel is more apparent (brighter average or summed values of the pixels) is selected and the dominant color of the stuffing box is represented by that channel. If the ROI is segmented by a mask to isolate relevant portions of the ROI, then the processing is carried out on the segmented ROI. [0038] To determine the major channel automatically, we use the following equation, where the value 128 depends on the selection of the factor in equations (6) and (7). For each channel, get

[0039] suml =∑(x r - 128) where (x r - 128 > 5)

[0040] suml =∑((x r - 128) where (x r - 128 < -5)

[0041] sum = max(|siiml|, |sum2|)

[0042] Major Channel = argmax(sum) (8)

[0043] x r is the reference image pixel.

[0044] To determine the presence of a leak, a test image 34 is analyzed at step 46.

The test image is segmented first by the ROI position (step 45 in Fig. 5) and size obtained from the reference image. The mask used on the reference image may be used to select a segmented part of the ROI 36 in the test image. Then only the segmented ROI 36 is analyzed. After the major channel of the testing ROI is obtained, it is compared at step 48 with the major channel of the reference ROI to determine if there is a leak. The condition that we use to determine the leak is the color change from the reference in the major channel. As mentioned before, outdoor applications are always affected by environmental factors. Sometimes, lighting can generate glares at the top of the stuffing box. Since the glares always change the box color significantly and generate similar response in the major color channel as the oil, in situations where the target may be subject to glare as for example a stuffing box in an outdoor location, we need to remove the glares from the test image first (step 47 in Fig. 5).

[0045] From our observation, even though glares have similar response as oil, they still have specific characteristics. If the stuffing box color is reddish or yellowish, the response in the major channel is bright, much brighter than the oil color which is around 128. The glares always generate the darkest values. If the stuffing box color is greenish or bluish, the response in the major channel is dark, much darker than the oil which is around 128. The glares always generate the brightest values. Using these kinds of characteristics, we can remove all the glares from the test image before testing. Since we require that the selected reference image must have no glare, we determine the glares based on the reference image. For reddish or yellowish stuffing box, the glares' response is darker than the lowest value of the reference response. If the lowest value is higher than 128, then it is darker than 128.

Thus, we have the following equation.

[0046] For reddish or yellowish stuffing box,

[0047] MinVal = min(min(x r ) , 128) (9)

[0048] if (x < MinVal— 5) x is test image pixel

[0049] then

[0050] x is a glare pixel

[0051] For greenish or bluish stuffing box, the glares' response is brighter than the highest value of the reference response. If the highest value is lower than 128, then it is brighter than 128. Thus, we have the following equation.

[0052] For greenish or bluish stuffing box,

[0053] MaxVal = max(max(x r ) , 128) (10)

[0054] if (x > MaxVal + 5)

[0055] then

[0056] x is a glare pixel

[0057] The glare pixels will be excluded from the leak detection determination in this embodiment (step 47).

[0058] To determine if a pixel x is oil leak or not, we compare a test major channel with the reference major channel at step 48. When the stuffing box is reddish or yellowish, the oil's response is darker. When the stuffing box is greenish or bluish, the oil's response is brighter. Thus, we use the following conditions to evaluate (step 50).

[0059] For reddish or yellowish stuffing box,

[0060] if (x < threshold + 2) (a)

[0061] 8i8i if (x < x r ) b

[0062] && if (R > 210&&G > 210&&S > 210) (c)

[0063] then

[0064] x is potential oil leak point

[0065] Here, R, G, B are the pixel's RGB values. [0066] Condition (a) means x is a neutral color (black, white or gray). Condition (b) measures if the pixel is darker than the reference. Condition (c) measures if the pixel is white (snow).

[0067] Similarly, for greenish or bluish stuffing box,

[0068] if (x > threshold - 2) (a)

[0069] && if (x > x r ) b

[0070] && if (R > 210&&G > 210&&S > 210) (c)

[0071] then

[0072] x is potential oil leak point

[0073] Condition (a) means x is a neutral color (black, white or gray). Condition (b) measures if the pixel is brighter than the reference. Condition (c) measures if the pixel is white (snow). In effect, snow pixels are removed from consideration in the analysis. In the above, the threshold is chosen to be 128.

[0074] Even under some bad environment, e.g., storm, rain, light change, the stuffing box can still present some color if there is no leak. If there is no color and if it is darker (reddish/yellowish base) or brighter (greenish/bluish base) than the reference, it must be some leak.

[0075] When the oil leak points occupy a certain percentage of the area of the stuffing box, an alarm is triggered (step 52). The wellhead operators will receive a message and the associated image showing the leak. The percentage we chose is 20% in one embodiment.

[0076] In our experimental testing, the dataset we used was captured from 6 different wellhead stuffing boxes, totally 215 images. For each stuffing box, 30-40 images were used with various illumination conditions, various weather conditions and under different complex situations. Some stuffing boxes have residual oil from previous leak; some stuffing boxes have color peeled off.

[0077] Among the 215 test images, 97 have no leak and 118 have a leak. We got 4 false alarms and 3 missing leaks. The true detection rate is 96.6% and the false detection rate is 3.09%). We found that our proposed method is robust to varying outdoor environments. [0078] This invention presents a novel image analytics based approach that can automatically detect oil wellhead stuffing box leakage and generate alarms. The approach takes advantage of the color difference between the stuffing box and oil to detect the leak. The proposed method is robust to the varying outdoor environments, such as lighting change, weather change, paint peeling, etc. The associated system is easy to install without interfering with wellhead operation. The method may also be used to test for the presence of leaks in other targeted equipment, where a surface or region of interest on the equipment is susceptible to a leak that exhibits a color change.

[0079] In the claims, the word "comprising" is used in its inclusive sense and does not exclude other elements being present. The indefinite articles "a" and "an" before a claim feature do not exclude more than one of the feature being present. Each one of the individual features described here may be used in one or more embodiments and is not, by virtue only of being described here, to be construed as essential to all embodiments as defined by the claims.