IP Module1
IP Module1
Fundamentals of
Digital Image Processing
01
Components of Image Processing
02
Components of Image Processing
03
Components of Image Processing
02
Components of Image Processing
02
Image Sensing & Acquisition
02
Image Formation
SUN
02
Image Formation
02
Digital Image Acquisition Process
04
Types of Image Sensors
Single Imaging
Sensor
Line Sensor
Array Sensor
06
Mathematical Modeling of Image contd…
07
Image Sampling & Quantization
08
Image Sampling & Quantization
❖ Sampling
– Converts infinite no. of image points to finite number of image
points
❖ Quantization
– Converts infinite no. of gray levels to finite no. of gray levels
09
Generating a Digital Image
13
Spatial Resolution
❖ Spatial Resolution
= smallest possible detail in an image
= number of samples (pixels) per unit area of the sampling
grid
14
Spatial Resolution contd…
17
Gray Level Resolution contd…
19
Choice of Spatial & Gray Level Resolution contd…
– Types of Interpolation
1. Nearest Neighbor Interpolation (Pixel Replication)
2. Bilinear Interpolation
22
Changing Spatial Resolution of Digital Images contd…
1 0 2 0 1 1 2 2
1 2 0 0 0 0 1 1 2 2
0 0 0 0 3 3 4 4
23
Replication:-
Q-1)Zoom the image given below by pixel replication.
1 2 3
4 5 6
Ans:-
Changing Spatial Resolution of Digital Images contd…
– Bilinear Interpolation
1 0 2 0 1 1.5 2 2
1 2 0 0 0 0 0 0 0 0
1 1.5 2 2 1 2 2 2
1.5 2.5 3 3 2 3 3 3
24
Changing Spatial Resolution of Digital Images contd…
26
Basic Relationships Between Pixels
27
Basic Relationships Between Pixels
❖ Neighbors of a pixel
For a pixel p(x,y)
➢ 4-Neighbors : N4(p)
– Horizontal & Vertical neighbors
– (x+1,y), (x-1,y), (x,y+1), (x,y-1)
➢ Diagonal-Neighbors : ND(p)
– (x+1,y+1), (x-1,y+1), (x-1,y+1), (x-1,y-1)
➢ 8-Neighbors : N8(p)
– N4(p) U ND(p)
– (x+1,y), (x-1,y), (x,y+1), (x,y-1), (x+1,y+1),
(x-1,y+1), (x-1,y+1), (x-1,y-1)
Some of the neighboring pixels fall outside the image if (x,y) is on the
border of the image
28
Basic Relationships Between Pixels contd…
❖ Adjacency
V = set of gray-level values used to define adjacency
➢ 4- adjacency :
– p & q with values from V are 4-adjacent if q is in the set N4(p)
➢ 8- adjacency :
– p & q with values from V are 8-adjacent if q is in the set N8(p)
29
Basic Relationships Between Pixels contd…
❖ Connectivity
– Two pixels p(x,y) & q(s,t) are connected if there exits a path
between them
– Path = (x0,y0), (x1,y1),…..,(xn,yn)
(x0,y0) = (x,y) &
(xn,yn) = (s,t) &
(xi,yi) is adjacent to (xi-1,yi-1) for 1≤ i ≤ n
– Length of path = n
– If x0,y0 = xn, yn then it’s a closed path
– 4-,8-, or m-paths depends on type of adjacency
– Ambiguity in 8-path can be overcome by using m-path
30
Basic Relationships Between Pixels contd…
Example of connectivity
V = {3,4} 1 4 4
2 3 1
1 1 4
1 4 4 1 4 4 1 4 4
2 3 1 2 3 1 2 3 1
1 1 4 1 1 4 1 1 4
31
Basic Relationships Between Pixels contd…
Example of connectivity
Consider the two image subsets S1 and S2. For V = {1} , determine whether
S1 and S2 are (a) 4-connected, (b) 8-connected, (c) m-connected
S1 S2
0 0 0 0 0 0 0 1 1 0
1 0 0 1 0 0 1 0 0 1
p
1 0 0 1 0 1 1 0 0 0
0 0 1 1 q1 0 0 0 0 0
0 0 1 1 1 0 0 1 1 1
➢ Connected Set
If only one connected component , then set S is connected set
33
Basic Relationships Between Pixels contd…
0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 1 1 0 0 0
0 0 0 1 1 1 1 0 0 0
0 0 0 1 1 1 0 0 0 0
0 0 0 1 1 1 0 0 0 0
0 0 0 1 1 1 1 1 0 0
0 0 0 0 0 1 1 1 0 0
0 0 0 0 0 0 1 1 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
34
Distance Measures
❖ Euclidean Distance
– For pixel p(x,y) and q(s,t)
De ( p, q) = ( x − s ) 2 + ( y − t ) 2
1.4 1 1.4
2 1 0 1 2
1.4 1 1.4
35
Distance Measures contd…
D4 ( p, q) = x − s + y − t
2 1 2
2 1 0 1 2
2 1 2
36
Distance Measures contd…
❖ D8 Distance
– For pixel p(x,y) and q(s,t)
D8 ( p, q) = max ( x − s , y − t )
– The pixels having a distance less than or equal to some value r
from (x, y), form a square centered at (x, y).
2 2 2 2 2
2 1 1 1 2
2 1 0 1 2
2 1 1 1 2
2 2 2 2 2
37
Distance Measures contd…
❖ Dm Distance
– It is the shortest m-path between the points.
– For finding Dm distance, the value of the distance (length of the
path) between two pixels depends on the values of the pixels
along the path as well as the values of their neighbors.
37
Distance Measures contd…
❖ Note
– The D4 and D8 between two points p and q is equal to the length
of the shortest 4-path and 8-path between these two points.
– The D4 and D8 between two points p and q are independent of
any paths that might exist between the points because these
distances involve only the coordinates of the points.
37
Questions ???
38