Marine bubble detection using optical-flow techniques

Bubble detection and quantification is of high relevance for the observation of gas and fluid seeps within the marine environment. The presented work suggests and successfully investigates the application of an image processing strategy based on the optical flow concept followed by a customised thresholding and a new segmentation approach. Both are applicable for laboratory conditions and in situ video sequences, as shown for a deep-sea methane vent. [DOI: 10.2971/jeos.2010.10016s]


INTRODUCTION
Rising gas bubbles in the marine environment can originate from natural and anthropogenic sources.Among natural seepages, the release of methane is of high interest due to its expected climate impact.Although numerous gas seeps have been discovered worldwide, the amount of gas escaping from sediments has been estimated only at a few sites using postprocessed video analysis (see [1,2]).Anthropogenic sources, such as pipeline leakages, can be both of economic and ecological relevance, and mitigation of effects requires an in situ detection and quantification.
Optical as well as acoustical methods have been developed to address the issue of in situ bubble detection.Instrumentation using imaging optics can be divided into back light and frontal illumination systems [1]- [5].The latter make use of the increasing availability of high quality cameras and illumination onboard remotely operated vehicles and will be the focus of this work.One of the main challenges towards realisation is to find algorithms being robust enough to detect and trace upwelling bubbles in front of various backgrounds.This work will present a new image processing strategy and will validate its performance for laboratory tests as well as for video sequences from a deep-sea methane vent.

MATERIALS AND METHODS
All code development and testing was performed using the MATLAB release 2008b (v7.7) software suite and the image processing toolbox release 2008 (v8.0).The processing of the source video files was performed as a sequence of optical flow determination, thresholding and region filtering (see Figure 1).Individual steps and experimental set-up are described in the following paragraphs.

Optical flow determination
Segmentation is the first step of automatic image analysis, were objects of interest (bubbles/droplets/particles) are separated from the background.As image segmentation is a common problem of machine vision, many approaches based on different features such as intensity threshold, edge detection or uniformity of movement have been introduced in the past [6].Saworski and Zielinski compared these approaches for in situ oil seep detection and identified the optical flow determination as an appropriate approach [7].
The optical flow is the flow of objects, represented by pixels with distinguishable grey values in the image plane between two successive image frames.Assuming a completely homogeneous illumination, the optical flow is the apparent motion of the bubbles caused by relative motion between camera and scene.It can be expressed as a vector field, representing translational magnitude and direction of each pixel between two image frames.By treating the optical flow as a flowing liquid, the movement of gray values can be derived from the optical flow constraint equation Due to the aperture problem only one component of the velocity vector can be directly calculated.To avoid underestimation an additional assumption is required.
The Horn-Schunck algorithm [8] applied in this work is based on the constraint of smoothness of optical flow, where neighbouring surface points have approximately same local displacement vectors.
The result of this algorithm, gives the horizontal and vertical dislocation of each pixel within a given time interval by the matrices V x and V y .The variable V z can be derived and gives the distances each pixel was dislocated The resulting matrix V z can be visualised as greyscale image with pixels showing a high relative dislocation appearing as white spots (see Figure 2, right).As a consequence the Horn-Schunck algorithm is very sensitive to noise and often requires application of filters.

Thresholding
In the case of a fully stabilised camera system, application of an optical flow algorithm to video sequences will completely remove the background.As field operation, e.g. with ROVs, often implies a slow (compared to bubble rise velocities) movement of the camera, a movement compensation was applied.Calculating the mean velocity of the complete scene and smoothing this information in a running mean over the last 10 images, a general movement threshold is available to remove all background.
Additional artefacts can be observed in video source files if compression algorithms were applied for data reduction.These result in small bright pixels, spread over the scene.We cope with these pixels by applying an additional Wiener Filter [9] with a neighbourhood size of 5 pixels × 5 pixels.Thus, noise artefacts are blurred and do not pass the initial step of the thresholding procedure in the next step.

Region filtering
For a rigid body moving through a scene, all pixels representing the borders of the body should show the same grey value.With this assumption, segmentation can be easily performed by selecting all connected pixels with the same grey value.As a bubble can show significant deformations between two frames of a movie scene, it is evident that the brightness pattern will not be as uniform as that of a solid body.A new algorithm was developed to mask and identify these objects.In the first step, the original greyscale palette with 256 different levels (8-bit) was reduced to an equally distributed subset with 2 n levels: where L is the new or old colour value of a pixel respectively, b the colour depth of the image in bits and n the power for colour reduction with 0 < b and 0 < n < b.DIV is the integer division.Experiments revealed that n = 2 for an 8-bit greyscale image delivered robust and reliable results.
This can be understood as assigning 2 n successively brightening grey levels with equal frequency to the 2 b palette entries (see Figure 3).We now assume that a natural object that is well focused within the image is characterised by a gradient of all previous defined levels, starting from a bright centre (e.g. a reflection spot on a bubble).Starting with an identified object in the highest level (2 n ) of the colour palette, we use this for masking the next level and identifying the same object in that level (2 n − 1).Applying its structure for masking the next level and so on, we cascade down the reduced greyscale and end up with a full identified object.Only objects that show the full gradient of 2 n masked levels will succeed in being filtered.
To finalise region filtering and enable later enumeration, open structures are dilated and a rectangular box is drawn around the outer borders of the object via identification of its centre of gravity and its horizontal and vertical dimensions.

Laboratory set-up and video sequences
The processed video sequences were recorded using a Prosilica GE1050C camera capable of a maximum frame rate of 60 fps at a resolution of 1024 pixels × 1024 pixels.The field of view was of 5 cm × 10 cm.A 200 litre standard aquarium was used as test environment.The camera and the frontal illumination were placed in front of the aquarium, with a distance of 30 cm to the bubble stream which was generated with air pumped through a bubble dispenser consisting of five equidistant capillary tubes with a diameter of 500 µm each (see Figure 4).All capillary tubes are lined up in a row to achieve an equal distance to the camera, eliminating out of focus images as a potential error source.
The segmentation strategy was tested with video sequences at frame rates of 60 fps and various volume streams from 5 ml to 200 ml norm volume per min (quantified with a thermal mass flow meter, red-y, V ögtlin) to the algorithm.To evaluate success of the algorithm, bubbles in a video sequence were counted manually three times and compared to the computed results.
For verification tests with field applications, videos of the ROV Quest (MARUM, University Bremen, Germany) were used.Video sequences showing low methane seepage in front of a highly heterogeneous background at the Vodyanitskii mud volcano [2] (see Figure 5) were recorded with the ROVs high definition camera using a wide angle optic with a large depth of field.
The observed bubble stream had a spatial extension of approximately 20 cm in the direction of the principal axis.The used wide-angle objective enabled to quantify bubble diameter with an estimation error of ±5%.Distance between camera and observation field was 2 m.Videos showed only small amounts of particulate inorganic and organic material as potential source of errors in object identification for the here presented method.The successful discrimination of rising bubbles from other objects was verified by observing a moving jellyfish (sequence not shown).

Laboratory validation
Bubble identification and quantification was successfully verified in the laboratory experiment for volume streams up to 200 ml norm volume.The algorithmic workflow produced reliable values of flow rates of up to 3300 bubbles per min showing very good linear correspondence to the manually counted reference (R 2 = 0.996) as shown in Figure 6.The mean bubble volume is approximately 0.06 ml = 60 mm 3 , a volume in good correspondence to the field observations in [2] estimating (80 ± 45) mm 3 .Automatic bubble enumeration shows the general tendency to underestimate the real number.This is due to overlapping bubbles as further segmentation within the bounding box is not covered by the algorithm and is prone to errors when investigating intense seepages.

ROV video sequences
Applying the described procedure of optical flow, thresholding and region filtering to ROV video sequences showed a successful identification of rising bubbles from a noisy, mov-  ing, heterogeneously texturised background (see Figure 7).Performing bubble quantification and comparing again with manual counts, we received a good agreement of 862 to 792 bubbles, which means a slight overestimation of approximately 9%, probably due to some rapid camera movements within the sequence.To further improve the segmentation success in future experiments, Table 1 provides a guideline for ROV observations of gas seeps.

CONCLUSIONS AND OUTLOOK
Segmentation of bubbles by using the optical flow algorithm, thresholding and region filtering as described in this paper showed to be a suitable, linear method up to 3300 bubbles per min in a small field of view.To improve bubble segmentation a new algorithm for masking was introduced.It successfully identifies bubbles by stepwise inclusion of neighbouring pixels with a smooth gradient around highlighted origins.Especially in connection with complex image backgrounds like encountered in ROV video sequences from sea floor bubble seeps, the procedure described within this work represents an important step towards automated quantification of rising bubble.Analysis of ROV videos from a methane seepage at the Vodyanitskii mud volcano, Black Sea, showed good bubble identification and quantification with a slight overestimation by the algorithm (< 10%).Processing of real bubble seepage videos also illustrated the need for stable, high-quality video recording since noise in the original images can only be eliminated partially by application of appropriate filters during post-processing.
Future activities will include variations of the laboratory setup with respect to different bubble dispensers, water turbidity, disturbing particles and small-scale currents regimes.
Achieving fully automated quantification of bubble formations will require the development of registration and tracking of bubbles to prevent multiple determinations of single bubbles along their path and to improve recognition of objects moving with respect to expected directions and velocities.Calculation of volume fluxes from video images will then require robust bubble volume estimates, completing the path from in situ frontal illuminated video observations towards seep flux quantification.

FIG. 1
FIG. 1 Schematic workflow of the video data processing for bubble detection and counting.For a description of the individual steps refer to the text.

FIG. 3
FIG.3Rising air bubble (left) before and (right) after application of region filtering.

O. Zielinski et al.FIG. 4 FIG. 5
FIG. 4 Laboratory set-up for the air bubble detection and quantification.

FIG. 6
FIG. 6 Linear correspondence of automatically and manually counted air bubbles per min for a volume stream of up to 200 ml norm volume as illustrated in Figure 4. Solid line represents 1:1 relation.Regression parameters y = 0.967x+ 0.206, R 2 = 0.996.

O
FIG. 7 Image from Figure 5 after applying the video image processing as described in the text.

TABLE 1
Guidelines for ROV observation of gas seeps with respect to improvement of video material for subsequent analysis.