Ab Dip 2 Fundamentals
Ab Dip 2 Fundamentals
Digital image
Digital Image
• An image is a 2D array of pixels
o N pixels wide (columns)
o M pixels high (row)
• Each pixel is a small square on the screen
• For gray image, each pixel has intensity associated with it
(3rd Dimension)
• For color image each pixel has a color associated with it
• Image requires 3D representation (row, column and pixel
value)
• Digital image requires sampling and quantization of
Camera Image
4
Image Resolution
• Gives the degree of distinguishable details of image
• Depends on sampling and quantization
• Broadly classified into
(i) spatial resolution
• smallest discernible detail in an image
• depends on the number of pixels
(ii) gray-level resolution
• refers to the smallest discernible change in the
gray level of pixels
• depends on the number of gray levels
5
255
0 255 0 0 255
0 255 0 0 255
0 255 0 0 255
0 255 0 0 255
0 255 0 0 255
Binary Image Image matrix
255 255 255 255 255
10 0 … 86
22 33 … 75
: : … :
255 51 … 100
255
Binary
grey
10 29 0 230 0 36 0 255
236 35 12 37 252 36 0 36
200 21 38 240 216 36 36 252
235 255 16 15 255 255 0 0
8-bit image 3-bit image
28
1 bit/pixel
29
1 bit/pixel 2 bits/pixel
30
Good resolution
useful for reading
number plate
32
Spatial Resolution (M x N)
Spatial Resolution (M x N)
Spatial Resolution (M x N)
Spatial Resolution (M x N)
64x64 image
38
Spatial Resolution
• Depends on the number of pixels in an image
• It depends on the rows and columns
• An image can be either down sampled to reduce
resolution or
• upsampled to increase resolution in spatial
domain
39
2 1 0 2 2 5
Down sampling 0 1 6 1 1 6
4 0 6 0 6 4
2 1 0 2 2 5 6 2 5 1 7 6
0 1 6 1 1 6 7 5 7 0 4 0
4 0 6 0 6 4 1 3 3 0 5 7
6 2 5 1 7 6 down sampled with sampling rate 2
7 5 7 0 4 0
1 3 3 0 5 7 2 0 2
4 6 6
Original Image Matrix
7 7 4
Up sampling 2 0 0 0 2 0
0 0 0 0 0 0
2 0 2 4 0 6 0 6 0
4 6 6 0 0 0 0 0 0
7 7 4 7 0 7 0 4 0
0 0 0 0 0 0
Original Image Matrix
To be up sampled with sampling rate 2
2 0 0 0 2 0
2 1 0 1 2 0
3 0 3 0 4 0
3 3 3 3 4 0
4 0 6 0 6 0
4 5 6 6 6 0
6 0 6 0 5 0
6 6 6 5 5 0
7 0 7 0 4 0
7 7 7 5 4 0
0 0 0 0 0 0
0 0 0 0 0 0
Up sampled Image Matrix using averaging
Method on columns Up sampled Image Matrix using averaging
Method on rows
41