Image Processing Reference

In-Depth Information

A

Bits, Bytes and Binary Numbers

When working with images it is useful to know something about how data are stored

in the memory of the computer. Most values associated with images are closely

related to the internal representation of the numbers. The value of one pixel is often

stored as one byte for example.

The memory of the computer can basically be seen as an enormous amount of

switches that can either be turned on or off. Each switch is called a bit (binary digit)

and can therefore be assigned either the value 0 or the value 1. So if you just wanted

to store values of either 0 or 1 it would be perfectly fine. However, this is rarely the

case and bits are combined to represent other types of number.

The binary number system is also called a base-2 system, since the basic unit only

has two values. Our
normal
system is a base-10 system and is called the decimal

system. To understand the base-2 system better, let us first have a look at the base-

10 system. When you see the following two numbers, 137 and 209814, you should

actually think like this in terms of the base-10 system:

10
2

10
1

10
0

1

·

+

3

·

+

7

·

=

100

+

30

+

7

=

137

(A.1)

10
5

10
4

10
3

10
2

10
1

10
0

2

·

+

0

·

+

9

·

+

8

·

+

1

·

+

4

·

=

200000

+

0

+

9000

+

800

+

10

+

4

=

209814

(A.2)

To generalize the formula we have

10
n

10
n
−
1

10
2

10
1

10
0

···

x
n
·

+

x
n
−
1
·

+···+

x
2
·

+

x
1
·

+

x
0
·

(A.3)

The
x
values are the
coefficients
of the base-10 system and they define the fi-

nal decimal number. This formula is similar no matter what base you use. Below

the general formulas for calculating a decimal number for base-16 (hexadecimal

numbers) and base-2 (binary numbers) can be seen:

16
n

16
n
−
1

16
2

16
1

16
0

(A.4)

Base-16:

···

x
n
·

+

x
n
−
1
·

+···+

x
2
·

+

x
1
·

+

x
0
·

2
n

2
n
−
1

2
2

2
1

2
0

Base-2:

···

x
n
·

+

x
n
−
1
·

+···+

x
2
·

+

x
1
·

+

x
0
·

(A.5)