Main Content

Linear combination of images

When performing a series of arithmetic operations on a pair of images, you can achieve more accurate results if you use

`imlincomb`

to combine the operations, rather than nesting calls to the individual arithmetic functions, such as`imadd`

. When you nest calls to the arithmetic functions, and the input arrays are of an integer class, each function truncates and rounds the result before passing it to the next function, thus losing accuracy in the final result.`imlincomb`

computes each element of the output`Z`

individually, in double-precision floating point. If`Z`

is an integer array,`imlincomb`

clips elements of`Z`

that exceed the range of the integer type and rounds off fractional values.

`imadd`

| `imcomplement`

| `imdivide`

| `immultiply`

| `imsubtract`