#### 2.4.4 Filtering Operations

##### Band Math

The Band Math module allows to perform complex mathematical operations over images. It is based on the mathematical parser library muParser and comes with a bunch of build-in functions and operators (listed here). This home-brewed digital calculator is also bundled with custom functions allowing to compute a full expression result simply and really quickly, since the filter supports streaming and multi-threading. The Monteverdi module provides an intuitive way to easily perform complex band computation. The module also prevents error in the mathematical command by checking the expression as the user types it, and notifying information on the detected error:

Figure  2.12 presents an example on how the band math can produce a threshold image on the NDVI value computed in one pass using built-in conditional operator “if” available in the parser.

An other operational example, on how this simple module can produce reliable information. Figure  2.13 shows the result of the subtraction of the Water indice on 2 images which was taken before and during the crisis event. The difference was produced by the band math module and allows to get a reliable estimation of the flood events.

##### Connected Component Segmentation module

The Connected Component Segmentation module allows segmentation and object analysis using user defined criteria at each step. This module uses muParser library using the the same scheme as it is done in Band math module (see 2.4.4 for a detailled explanation). It relies on three main steps process :

This mask is used as support of Connected Component segmentation (CC) . i.e zeros pixels are not taken into account by CC algorithm. Binarization criteria is defined by user, via muparser. This step is optional, if no Mask is given, entire image is processed. The following example creates a mask using intensity (mean of pixel values) parameter :
intensity > 200

Segmentation :
Connected Component Segmentation driven by user defined criteria. Segmentation process can be followed by a small object rejection step. The following example use distance (pixel intensity value difference ) parameter to define acception/rejection criteria between two adjacents pixels :
distance < 10

Object analysis post processing :
This step consists in post processing on each detected area using shape and statistical object characterization. The following example use elongation parameter to test labeled objects :
SHAPE_elongation > 2

A detailled presentation of parameters and variables, can be found on the wiki.

Results are then exported in shape file format. Graphical user interface is presented on Figure 2.14. At each step intemerdiate output can be seen using Display item list. Viewing windows are updated by clicking on Update button. Available display outputs are :

Input image :
input image.
input image multiplied by mask image.
Segmentation Output :
output of Connected Component segmentation filter.
Segmentation after small object rejection :
output of Connected Component segmentation after relabeling and small object rejection.
Filter Output :
final output after object based analysis opening post processing.

Available variables for each expression can be found using item list variables names. available functions can be found in help windows by clicking on Help button. The module also prevents error in the mathematical command by checking the expression as the user types it. Background value is set to green if formula is right, in red otherwise. If mask expression is left blank entire image is processed. If Object Analysis expression is left blank the whole set of label objects is considered.

After segmentation step, too small objects can be rejected using Object min area input. Eliminating too small objects at this step is needed to lighten further computation. min area is the pixel size of the label object.

When a first pass have been done, Specific label object properties can be displayed. Select the ”Filter Output” visualization mode, Update the visualization. Then use right click on selected object in image to display object properties.

Clicking on Save and Quit button export output to Monteverdi in vector data format.

A detailled presentation of this module, and examples can be found on the wiki.

A boat detection example is presented on Figure 2.15. Results can be seen on Figure 2.16.

##### Feature extraction

Under the term Feature Extraction, it include several techniques aiming to detect or extract infor- mations of low level of abstraction from images. These features can be objects : points, lines, etc.They can also be measures : moments, textures, etc.

##### Mean-shift segmentation

For a given pixel, the Mean-shift algorithm will build a set of neighboring pixels within a given spatial radius and a color range. The spatial and color center of this set is then computed and the algorithm iterates with this new spatial and color center. The Mean-shift can be used for edge-preserving smoothing, or for clustering.