<< >> Up Title Contents Index

Mathematics-based Operations

We distinguish in this section between binary arithmetic and ordinary arithmetic. In the binary case there are two brightness values "0" and "1". In the ordinary case we begin with 2B brightness values or levels but the processing of the image can easily generate many more levels. For this reason many software systems provide 16 or 32 bit representations for pixel brightnesses in order to avoid problems with arithmetic overflow.

Binary operations

Operations based on binary (Boolean) arithmetic form the basis for a powerful set of tools that will be described here and extended in Section 9.6, mathematical morphology. The operations described below are point operations and thus admit a variety of efficient implementations including simple look-up tables. The standard notation for the basic set of binary operations is:

The implication is that each operation is applied on a pixel-by-pixel basis. For example, . The definition of each operation is:

These operations are illustrated in Figure 22 where the binary value "1" is shown in black and the value "0" in white.

a) Image a b) Image b

c) NOT(b) = d) OR(a,b) = a + b e) AND(a,b) = a * b

f) XOR(a,b) = a b g) SUB(a,b) = a \ b

Figure 22: Examples of the various binary point operations.

The SUB(*) operation can be particularly useful when the image a represents a region-of-interest that we want to analyze systematically and the image b represents objects that, having been analyzed, can now be discarded, that is subtracted, from the region.

Arithmetic-based operations

The gray-value point operations that form the basis for image processing are based on ordinary mathematics and include:

Operation

Definition
preferred data type

ADD
c = a + b
integer

SUB
c = a - b
integer

MUL
c = a * b
integer or floating point

DIV
c = a / b
floating point

LOG
c = log(a)
floating point

EXP
c = exp(a)
floating point

SQRT
c = sqrt(a)
floating point

TRIG.
c = sin/cos/tan(a)
floating point

INVERT
c = (2B - 1) - a
integer

<< >> Up Title Contents Index