You are on page 1of 51

UNIT - 2

by
S Pramod Kumar
Assistant Professor,
Dept.of ECE,KIT,
Tiptur
9/7/2016 I.P@K.I.T 1
9/7/2016 I.P@K.I.T 2
• Sensor arrangements used to transform
illumination energy into digital images

9/7/2016 I.P@K.I.T 3
Images © 2002 Gonzalez & Woods
• Microdensitometers

9/7/2016 I.P@K.I.T 4
Images © 2002 Gonzalez & Woods
9/7/2016 I.P@K.I.T 5
Images © 2002 Gonzalez & Woods
9/7/2016 I.P@K.I.T 6
Images © 2002 Gonzalez & Woods
f ( x , y )  i ( x, y ) r ( x , y )

f ( x, y) : intensity at the point (x, y)


i( x, y) : illumination at the point (x, y )
(the amount of source illumination incident on the scene)
r ( x, y) : reflectance/transmissivity at the point (x, y)
(the amount of illumination reflected/transmitted by the object)
where 0 < i( x, y) <  and 0 < r ( x, y) < 1

9/7/2016 I.P@K.I.T 7
• Sampling: Digitizing the coordinate values (spatial resolution)
• Quantization: Digitizing the amplitude values (intensity levels)

Digitizing the
coordinate
values Digitizing the
amplitude
values
9/7/2016 I.P@K.I.T 8
Images © 2002 Gonzalez & Woods
The representation of an M×N numerical
array as

 f (0, 0) f (0,1) ... f (0, N  1) 


 f (1, 0) f (1,1) ... f (1, N  1) 
f ( x, y )  
 ... ... ... ... 
 
 f ( M  1, 0) f ( M  1,1) ... f ( M  1, N  1) 
9/7/2016 I.P@K.I.T 9
• The representation of an M×N numerical array
as
 a0,0 a0,1 ... a0, N 1 
 a a1,1 ... a1, N 1 
A  1,0

 ... ... ... ... 


 
 aM 1,0 aM 1,1 ... aM 1, N 1 

• Discrete intensity interval [0, L-1], L=2k

• The number b of bits required to store a M × N


digitized image
b=M×N×k
9/7/2016 I.P@K.I.T 10
• Sampling is the principal factor determining the
spatial resolution of an image

9/7/2016 I.P@K.I.T 11
Images © 2002 Gonzalez & Woods
9/7/2016 I.P@K.I.T 12
Images © 2002 Gonzalez & Woods
• Gray-level resolution similarly refers to the
smallest discernible change in gray level

false contouring

9/7/2016 I.P@K.I.T 13
Images © 2002 Gonzalez & Woods
9/7/2016 I.P@K.I.T 14
Images © 2002 Gonzalez & Woods
Effects on image quality produced by varying N and k
simultaneously

9/7/2016 I.P@K.I.T 15
Images © 2002 Gonzalez & Woods
• Shannon sampling theorem
– If the function is sampled at a rate equal to or greater
than twice its highest frequency, it is possible to
recover completely the original function from its
sample.

• If the function is undersampled, then a


phenomenon called aliasing corrupts in the
sampled image.

• The effect of aliased frequencies can be seen


under the right conditions in the form of so called
Moiré patterns
9/7/2016 I.P@K.I.T 16
9/7/2016 I.P@K.I.T 17
• Pixel replication

9/7/2016 I.P@K.I.T 18
• Pixel replication
• Nearest neighbor interpolation

9/7/2016 I.P@K.I.T 19
• Pixel replication
• Nearest neighbor interpolation
• Bilinear interpolation

9/7/2016 I.P@K.I.T 20
9/7/2016 I.P@K.I.T 21
Images © 2002 Gonzalez & Woods
9/7/2016 I.P@K.I.T 22
• Neighbors of a pixel p at coordinates (x,y)

 4-neighbors of p, denoted by N4(p):


(x-1, y), (x+1, y), (x,y-1), and (x, y+1).

9/7/2016 I.P@K.I.T 23
• Neighbors of a pixel p at coordinates (x,y)

 4-neighbors of p, denoted by N4(p):


(x-1, y), (x+1, y), (x,y-1), and (x, y+1).

 4 diagonal neighbors of p, denoted by ND(p):


(x-1, y-1), (x+1, y+1), (x+1,y-1), and (x-1, y+1).

9/7/2016 I.P@K.I.T 24
• Neighbors of a pixel p at coordinates (x,y)

 4-neighbors of p, denoted by N4(p):


(x-1, y), (x+1, y), (x,y-1), and (x, y+1).

 4 diagonal neighbors of p, denoted by ND(p):


(x-1, y-1), (x+1, y+1), (x+1,y-1), and (x-1, y+1).

 8 neighbors of p, denoted N8(p)


N8(p) = N4(p) U ND(p)

9/7/2016 I.P@K.I.T 25
• Adjacency
Let V be the set of intensity values

4-adjacency: Two pixels p and q with values


from V are 4-adjacent if q is in the set N4(p).

8-adjacency: Two pixels p and q with values


from V are 8-adjacent if q is in the set N8(p).

9/7/2016 I.P@K.I.T 26
• Adjacency
Let V be the set of intensity values
 m-adjacency: Two pixels p and q with values from V
are m-adjacent if
(i) q is in the set N4(p), or
(ii) q is in the set ND(p) and the set N4(p) ∩ N4(q) has no pixels
whose values are from V.

9/7/2016 I.P@K.I.T 27
Images © 2002 Gonzalez & Woods
• Path
 A digital path from pixel p with coordinates (x0, y0) to
pixel q with coordinates (xn, yn) is a sequence of distinct
pixels with coordinates

(x0, y0), (x1, y1), …, (xn, yn)

Where (xi, yi) and (xi-1, yi-1) are adjacent for 1 ≤ i ≤ n.

 Here n is the length of the path.

 If (x0, y0) = (xn, yn), the path is closed path.

 We can define 4-, 8-, and m-paths based on the type of adjacency
used.
9/7/2016 I.P@K.I.T 28
• Path

9/7/2016 I.P@K.I.T 29
• Given pixels p, q and z with coordinates (x, y), (s, t),
(u, v) respectively, the distance function D has
following properties:

a. D(p, q) ≥ 0 [D(p, q) = 0, if p = q]

b. D(p, q) = D(q, p)

c. D(p, z) ≤ D(p, q) + D(q, z)

9/7/2016 I.P@K.I.T 30
Distance Measures
The following are the different Distance measures:

a. Euclidean Distance :
De(p, q) = [(x-s)2 + (y-t)2]1/2

b. City Block Distance:


D4(p, q) = |x-s| + |y-t|

c. Chess Board Distance:


D8(p, q) = max(|x-s|, |y-t|)

9/7/2016 I.P@K.I.T 31
• Let H be an operator
• H is said to be a linear operator if, for any two
images f and g and any two scalars a and b,

H(a f + b g) = a H( f ) + b H( g ).

• An operator that fails the test of Eq. is by


definition nonlinear.
9/7/2016 I.P@K.I.T 32
Consider the image segment shown.
(a) Let V={0, 1} and compute the lengths of the shortest 4-, 8-, and m-path
between p and q. If a particular path does not exist between these two points,
explain why.
(b) Repeat for V={1, 2}.

9/7/2016 I.P@K.I.T 33
• When V = {0,1}, 4-path does not exist between p and q because it is
impossible to get from p to q by traveling along points that are both
4-adjacent and also have values from V . Figure (a) shows this
condition; it is not possible to get to q.
• The shortest 8-path is shown in Figure (b); its length is 4.
• The length of the shortest m- path (shown dashed) is 5. Both of these
shortest paths are unique in this case.

(b) Repeat for V={1, 2}.

9/7/2016 I.P@K.I.T 34
• Consider the two image subsets, S1 and S2,
shown in the following figure. For V={1},
determine whether these two subsets are (a)
4-adjacent, (b) 8-adjacent, or (c) m-adjacent.

9/7/2016 I.P@K.I.T 35
• Let p and q be as shown in Fig. Then,
(a) S1 and S2 are not 4-connected because q is not in
the set N4(p);
(b) S1 and S2 are 8-connected because q is in the set
N8(p);
(c) S1 and S2 are m-connected because
(i) q is in ND(p), and
(ii)the set N4(p) ∩ N4(q) is empty.

9/7/2016 I.P@K.I.T 36
• Measure the distance between the p & q pixels
using different distance measurement technique.
The coordinates of p & q are (0,0) & (3,3)
respectively

a. Euclidean Distance :
De(p, q) = [(x-s)2 + (y-t)2]1/2

b. City Block Distance:


D4(p, q) = |x-s| + |y-t|

c. Chess Board Distance:


D8(p, q) = max(|x-s|, |y-t|)

9/7/2016 I.P@K.I.T 37
• Baud rate, as the number of bits transmitted per second. Generally,
transmission is accomplished in packets consisting of a start bit, a byte (8
bits) of information, and a stop bit. Then how many minutes would it take
to transmit a 1024*1024 image with 256 gray levels using a 56K baud
modem?

• The total amount of data (including the start and stop bit) in an 8bit, 1024
* 1024 image, is (1024)2 *[8 + 2] bits. The total time required to transmit
this image over a 56K baud link is (1024)2 * [8 + 2]=56000 = 187.25 sec or
about 3.1 min.

9/7/2016 I.P@K.I.T 38
9/7/2016 I.P@K.I.T 39
9/7/2016 I.P@K.I.T 40
9/7/2016 I.P@K.I.T 41
9/7/2016 I.P@K.I.T 42
9/7/2016 I.P@K.I.T 43
9/7/2016 I.P@K.I.T 44
9/7/2016 I.P@K.I.T 45
9/7/2016 I.P@K.I.T 46
9/7/2016 I.P@K.I.T 47
9/7/2016 I.P@K.I.T 48
9/7/2016 I.P@K.I.T 49
Calculating bilinear interpolation
There are several ways equivalent ways to calculate the
value of P. An easy way to calculate the value of P would be
to first calculate the value of the two blue dots, R2, and R1.
R2 is effectively a weighted average of Q12 and Q22, while
R1 is a weighted average of Q11 and Q21.
R1 = ((x2 – x)/(x2 – x1))*Q11 + ((x – x1)/(x2 – x1))*Q21
R2 = ((x2 – x)/(x2 – x1))*Q12 + ((x – x1)/(x2 – x1))*Q22
After the two R values are calculated, the value of P can
finally be calculated by a weighted average of R1 and R2.
P = ((y2 – y)/(y2 – y1))*R1 + ((y – y1)/(y2 – y1))*R2
The calculation will have to be repeated for the red, green,
blue, and optionally the alpha component of.
9/7/2016 I.P@K.I.T 50
9/7/2016 I.P@K.I.T 51

You might also like