3.3.1 Simple calculus with channels

The BandMath application provides a simple and efficient way to perform band operations. The command line application and the corresponding Monteverdi module (shown in the section ??) are based on the same standards. It computes a band wise operation according to a user defined mathematical expression. The following code computes the absolute difference between first bands of two images:

otbcli_BandMath -il input_image_1 input_image_2  
                -exp "abs(im1b1 - im2b1)"  
                -out output_image

The naming convention ”im[x]b[y]” designates the yth band of the xth input image.

The BandMath application embeds built-in operators and functions (listed here), allowing a vast choice of possible operations.