Image Processing: Ch2: Digital Image Fundamentals
Image Processing: Ch2: Digital Image Fundamentals
Image Processing: Ch2: Digital Image Fundamentals
Hanan Hardan 1
Image Acquisition:
Hanan Hardan 2
Image sampling and quantization
In order to process the image, it must be saved on
computer.
Hanan Hardan 3
Image sampling and quantization
To convert continuous image (in real life) to digital image (in
computer)
we use Two processes:
1.sampling
2.quantization.
Remember that:
the image is a function f(x,y),
x and y: are coordinates
F: intensity value (Amplitude)
Hanan Hardan 4
How does the computer digitize the continuous image?
Ex:
scan a line such as AB from the continuous image, and represent
the gray intensities.
Hanan Hardan 5
How does the computer digitize the
continuous image?
Quantization:
converting each
sample gray-
level value into
discrete digital
quantity.
Now:
the digital scanned line AB
representation on computer:
Hanan Hardan 7
Digital Image Representation
The result of sampling and quantization is a
matrix of real numbers
Assume that an image f(x,y) is sampled so that the resulting
image has M rows and N columns. We say that the image is of
size M x N.
The values of the coordinates (x,y) are discrete quantities. For
clarity, we use integer values for these discrete coordinates.
Hanan Hardan 8
Digital Image Representation
Images as Matrices
Hanan Hardan 9
Pixels!
Q:Suppose a pixel has 2 bit, how many gray levels can it represent?
Answer: 4 gray intensity levels
2Bit (00, 01, 10 ,11).
Now ..
if we want to represent 256 intensities of grayscale, how many bits
do we need?
Answer: 8 bits which represents: 28=256
Hanan Hardan 10
Number of storage of bits:
N * M: the no. of pixels in all the image.
K: no. of bits in each pixel
L: grayscale levels the pixel can represent
L= 2K
all bits in image= N*N*k
Hanan Hardan 11
Number of storage of bits:
EX: Here: N=32, K=3, L = 23 =8
# of pixels=N*N = 1024 . (because in this example: M=N)
# of bits = N*N*K = 1024*3= 3072
Hanan Hardan 13
Spatial and gray-level resolution
Hanan Hardan 14
Resolution: How Much Is Enough?
(cont…)
Hanan Hardan 17
Under sampling, we lost some image details!
How to choose the spatial resolution :
Original image
Sampled image
1mm
No detail is lost!
Spatial resolution
(sampling rate)
Hanan Hardan 18
Effect of Spatial Resolution
Example:
insufficient spatial
resolution
appearance of
checkerboard pattern
in the image
Hanan Hardan 19
64x64 pixels 32x32 pixels
Example: Spatial resolution
L2 k
Hanan Hardan 21
Effect of Quantization Levels
Example:
16 levels 8 levels
In this image,
it is easy to see
false contour.
4 levels
Hanan Hardan 2 levels 23
Digital Image Types:
Binary image (B&W)
Grayscale image
Color image (RGB)
Hanan Hardan 24
Common image formats include:
1 sample per point (B&W or Grayscale)
3 samples per point (Red, Green, and Blue)
Hanan Hardan 26
Image Types : Binary Image
Binary image or black and white image
Each pixel contains one bit :
1 represent white
0 represents black
Binary data
0 0 0 0
0 0 0 0
1 1 1 1
1 1 1 1
Hanan Hardan 27
Grayscale Images
Hanan Hardan 28
Digital Image Types : Intensity Image
Hanan Hardan 29
Color Images
Color image: A color image contains pixels
each of which holds three intensity values
corresponding to the red, green, and blue
or( RGB)
Hanan Hardan 30
Digital Image Types : RGB Image
RGB components
10 10 16 28
9 656 70 26
56 43
3756 78
32 99 54 96 67
70
15 256013 902296 67
21 54 47 42
85 85 43 92
32 15 87 39
Hanan Hardan
54 65 65 39 31
32 65 87 99