mbfilter
Section: MB-System 5.0 (1)
Updated: 3 June 2013
Index
NAME
mbfilter - Apply some simple filter functions to sidescan or beam amplitude 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 -Rwest/east/south/north -Smode/xdim/ldim/iteration[/threshold_lo/threshold_hi] -V -H]DESCRIPTION
mbfilter applies one or more simple filters to the specified sidescan or beam amplitude data. The filters include:
-S1: boxcar mean for low-pass filtering
-S2: gaussian mean for low-pass filtering
-S3: boxcar median for low-pass filtering
-S4: inverse gradient for low-pass filtering
-D1: boxcar mean subtraction for high-pass filtering
-D2: gaussian mean subtraction for high-pass filtering
-D3: boxcar median subtraction for high-pass filtering
-C1: edge detection for contrast enhancement
-C2: gradient magnitude subtraction for contrast enhancementThese filters are mostly intended for use with sidescan data. In particular, the low-pass or smoothing filters can be used for first-order speckle reduction in sidescan data, and the high-pass filters can be used to emphasize fine scale structure in the data. A combination of low-pass and high-pass filtering can effectively perform band-pass filtering. The contrast enhancing filters can, under certain circumstances, sharpen sidescan images of the seafloor. The low-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.
Low-pass filters are specified with the -S option, high-pass filters with the -D option, and contrast enhancement with the -C option. Users can apply up to ten filters in any order; the filters are applied in the order in which they are specified on the command line. 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 high-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 high-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 high-passed data so that it is positive (negative values are considered flagged as bad in some formats and not allowed in others). The high-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 filtered amplitude or sidescan data are written to ancilliary files located parallel to the input swath data files. Filtered amplitude data will be in files named by adding ".ffa" to the input file name, and sidescan data will be in files with an ".ffs" suffix. Filtered amplitude or sidescan data can be plotted with mbm_plot by appending "F" to that macro's mode argument (e.g. -G4F for filtered amplitude data, and -G5F for filtered sidescan data). If accessing mbswath directly rather than through mbm_plot, plot the filtered data by appending "F" to the program's mode argument (e.g. -Z4F for filtered amplitude data, and -Z5F for filtered sidescan data). When using mbmosaic to generate mosaics of amplitude or sidescan data, the filtered data can be accessed by appending "F" to the data kind argument (e.g. -A3F for amplitude and -A4F for sidescan data.
AUTHORSHIP
David W. Caress (caress@mbari.org)
Monterey Bay Aquarium Research Institute
Dale N. Chayes (dale@ldeo.columbia.edu)
Lamont-Doherty Earth ObservatoryOPTIONS
Last Updated: 3 June 2013