mbfilter
Section: MB-System 5.0 (l)
Updated: 9 August 2001
Index
NAME
mbfilter - Apply some simple filter functions to sidescan, beam amplitude, or bathymetry data from swath sonar data files.VERSION
Version 5.0SYNOPSIS
mbfilter [-Akind -Byr/mo/da/hr/mn/sc -Cmode/xdim/ldim/iteration -Dmode/xdim/ldim/iteration/offset -Eyr/mo/da/hr/mn/sc -Fformat -Iinfile -Nbuffersize -Ooutfile -Rwest/east/south/north -Smode/xdim/ldim/iteration -Tthreshold_lo/threshold_hi -V -H]DESCRIPTION
mbfilter applies one or more simple filters to the specified swath data (sidescan, beam amplitude, and/or bathymetry). The filters include:
- boxcar mean for lo-pass filtering
- gaussian mean for lo-pass filtering
- boxcar median for lo-pass filtering
- inverse gradient for lo-pass filtering
- boxcar mean subtraction for hi-pass filtering
- gaussian mean subtraction for hi-pass filtering
- boxcar median subtraction for hi-pass filtering
- edge detection for contrast enhancement
- gradient magnitude subtraction for contrast enhancementThese filters are mostly intended for use with sidescan data. In particular, the lo-pass or smoothing filters can be used for first-order speckle reduction in sidescan data, and the hi-pass filters can be used to emphasize fine scale structure in the data. A combination of lo-pass and hi-pass filtering can effectively perform band-pass filtering. The contrast enhancing filters can, under certain circumstances, sharpen sidescan images of the seafloor. The lo-pass and contrast enhancement filters are described in the paper by Sauter and Parson (1994) listed below.
The filtering used here is designed and applied in the same manner as spatial filters are applied to images. The swath data is treated as an image, with the x and y coordinates corresponding to pixel (or beam) number and ping number, respectively. The filters consist of M x N matrices which are convolved with the swath data image (M is the filter dimension in the acrosstrack direction and N is the filter dimension in the alongtrack direction). Missing or flagged data are ignored in the filtering process.
Users can apply up to three filters at a time (one each of the lo-pass, hi-pass, and contrast enhancement filters). If multiple filters are applied, the hi-pass will be applied first, followed by the lo-pass, followed finally by the contrast enhancement filter. Users can apply as many iterations of each filter as desired.
The user specifies the window size used by the filters (3x3 or 5x5 are typical for using smoothing filters iteratively to reduce speckle; larger windows like 3x20 are typical for hi-pass filtering).
The boxcar mean, gaussian mean, and median filter all achieve similar results in uniformly smoothing the data; the boxcar mean is faster to apply, the gaussian mean preserves the frequency content of the data better, and the median filter is least sensitive to spikes in the data. The inverse gradient filter applies averaging weights which depend on the inverse gradient of the data. This approach causes the filter to smooth regions without distinct edges much more than regions with edges, thus tending to preserve the sharpness of features more than the simpler smoothing filters.
The median smoothing filter can be set by the -T option to operate with low and high ratio thresholds (the value is changed only if the original value divided by the median value is less than the low threshold or greater than the high threshold). This allows the filter to preferentially despike the data. In particular, this approach is useful for suppressing "stripes" or "bad" pings which have amplitude or sidescan values differing significantly from surrounding pings.
The hi-pass filters are constructed by calculating a low-pass filtered version of the data and then subtracting that from the original data. An offset value is added to the hi-passed data so that it is positive (negative values are considered flagged as bad in some formats and not allowed in others). The hi-pass filters can be used to remove long-wavelength variations in seafloor reflectivity in order to emphasize fine-scale structure.
The contrast enhancement filters are generally only successful when applied after smoothing because of their tendency to amplify noise. The edge detection filter enhances contrast by tending to shift values on either side of a boundary away from the average value across the boundary. A 5 X 5 filter or larger is generally required for success with the edge detection algorithm. The gradient filter increases contrast by subtracting twice the local gradient magnitude from each value.
The default input and output streams are stdin and stdout.
AUTHORSHIP
David W. Caress (caress@mbari.org)
Monterey Bay Aquarium Research Institute
Dale N. Chayes (dale@ldeo.columbia.edu)
Lamont-Doherty Earth Observatory
OPTIONS
Last Updated: 9 August 2001