You are on page 1of 63

Digital Image Processing

Digital Image Fundamentals

Dr. P. Arulmozhivarman
Asso.Prof
DSP/ISP division
School of Electronics engineering
VIT university, Vellore
Elements of Visual Perception
 Structure of the human eye

Three membranes enclose the eye:


Cornea and sclera, Choroid, Retina

(Images from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 2nd Edition.
Retina
 When the eye is properly focused, light
from an outside object is imaged on the
retina
 Two classes of receptors are located over
the surface of retina: cones and rods
 Cone: 6-7 million in each eye, central part of
retina (fovea) and highly sensitive to color
 Rod: 75-150 million, all over the retina
surface and sensitive to low levels of
illumination

3
Retina
Cross-section of eye Cross section of retina

Pigmented
epithelium
Ganglion axons
Ganglion cell layer
Bipolar cell layer

Receptor layer
Retina up-close

Light
Rods and Cones
 Rods and cones in the retina
 Image formation in the eye

(Images from Rafael C. Gonzalez and Richard


Wood, Digital Image Processing, 2nd Edition.
 Brightness adaptation and
discrimination
 Brightness discrimination
 Weber ratio
 Perceived
brightness
 Simultaneous contrast
 Optical
illusion
Light and the Electromagnetic
Spectrum
The Multi-Wavelength Sun

X-Ray UV Visible

Composite
Infrared Radio
EM Spectrum Relative Sizes
The Visible Spectrum

Light waves extend in wavelength from about 400 to 700 nanometers.


 Wavelength
c


E  h
Image Sensing and Acquisition
Image Sensors : Array Sensor

Charge-Coupled Device (CCD)

w Used for convert a continuous


image into a digital image

w Contains an array of light sensors

w Converts photon into electric charges


accumulated in each sensor unit

CCD KAF-3200E from Kodak.


(2184 x 1472 pixels,
Pixel size 6.8 microns2)
Gate
Vertical Transport Register

Gate

Photosites
Vertical Transport Register
Image Sensor: Inside Charge-Coupled Device

Gate
Vertical Transport Register
Horizontal Transportation Register

Amplifier Output Gate


Output
Image Sensor: How CCD works

i h g Image pixel

f e d

c b a
i h g

f e d
i h g
Horizontal transport
register c b a
f e d

Vertical shift c b a Output

Horizontal shift
Fundamentals of Digital Images

Origin

y
f(x,y)
Image “After snow storm”
w An image: a multidimensional function of spatial coordinates.
w Spatial coordinate: (x,y) for 2D case such as photograph,
(x,y,z) for 3D case such as CT scan images
(x,y,t) for movies
w The function f may represent intensity (for monochrome images)
or color (for color images) or other associated values.
 Image acquisition using a single
sensor
 Using
sensor
strips
 A simple
image
formation
model
 Illumination and reflectance
 Illumination and transmissivity

f ( x, y)  i( x, y)r ( x, y)
Image Sampling and Quantization
 Sampling
and
quantization
 Representing digital images
 Number of storage bits
Digital Image Types : Intensity Image

Intensity image or monochrome image


each pixel corresponds to light intensity
normally represented in gray scale (gray
level).

Gray scale values


10 10 16 28
 9 6 26 37
 
15 25 13 22
 
32 15 87 39
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
Image Types : Index Image

Index image
Each pixel contains index number
pointing to a color in a color table

Color Table

Index Red Green Blue


component component component
No.
1 0.1 0.5 0.3
2 1.0 0.0 0.0
1 4 9
6 4 7  3 0.0 1.0 0.0
 
6 5 2 4 0.5 0.5 0.5
5 0.2 0.8 0.9
Index value … … … …
 Spatial and gray-level resolution
 Subsampled
and
resampled
 Varying
the
number
of gray
levels
 Varying
the
number
of gray
levels
 N and k in different-details images
 Isopreference
 Moire pattern
 Zooming
and
shrinking
Some Basic Relationships Between
Pixels

 Neighbors of a pixel
 N 4 ( p) : 4-neighbors of p
( x  1, y), ( x 1, y) , ( x, y  1) , ( x, y 1)

N D ( p) : four diagonal neighbors of p


( x  1, y  1) , ( x  1, y 1) , ( x 1, y 1) ,
( x 1, y  1)
N 8 ( p ) : 8-neighbors of p
N 4 ( p) and N D ( p)
Basic Relationship of Pixels

(0,0) x

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

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


y

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

Conventional indexing method


Neighbors of a Pixel

Neighborhood relation is used to tell adjacent pixels. It is


useful for analyzing regions.

(x,y-1) 4-neighbors of p:

(x1,y)
(x-1,y) p (x+1,y)
(x+1,y)
N4(p) = (x,y1)
(x,y+1)
(x,y+1)

4-neighborhood relation considers only vertical and


horizontal neighbors.

Note: q N4(p) implies p N4(q)


Neighbors of a Pixel (cont.)

(x-1,y-1) (x,y-1) (x+1,y-1) 8-neighbors of p:

(x1,y1)
(x-1,y) p (x+1,y)
(x,y1)
(x+1,y1)
(x1,y)
(x-1,y+1)(x,y+1)(x+1,y+1) (x+1,y)
N8(p) = (x1,y+1)
(x,y+1)
(x+1,y+1)

8-neighborhood relation considers all neighbor pixels.


Neighbors of a Pixel (cont.)

(x-1,y-1) (x+1,y-1) Diagonal neighbors of p:

(x1,y1)
p
(x+1,y1)
ND(p) = (x1,y1)
(x+1,y+1)
(x-1,y+1) (x+1,y+1)

Diagonal -neighborhood relation considers only diagonal


neighbor pixels.
Connectivity

Connectivity is adapted from neighborhood relation.


Two pixels are connected if they are in the same class (i.e. the
same color or the same range of intensity) and they are
neighbors of one another.

For p and q from the same class


w 4-connectivity: p and q are 4-connected if q N4(p)

w 8-connectivity: p and q are 8-connected if q N8(p)

w mixed-connectivity (m-connectivity):
p and q are m-connected if q N4(p)
or
q ND(p) and N4(p) N4(q) = 
 Adjacency
 V : The set of gray-level values used
to define adjacency
 4-adjacency: Two pixels p and q with
values from V are 4-adjacency if q is in
the set N 4 ( p)
 8-adjacency: Two pixels p and q with
values from V are 8-adjacency if q is in
the set N 8 ( p )
 m-adjacency (mixed adjacency): Two
pixels p and q with values from V are
m-adjacency if
 q is in N 4 ( p), or
 q is in N ( p )and the set N 4 ( p)  N 4 ( q)
D
has no pixels whose values are from V
 Subset adjacency
 S1 and S2 are adjacent if some pixel in
S1 is adjacent to some pixel in S2
 Path
 A path from p with coordinates ( x, y) to
pixel q with coordinates (s, t ) is a
sequence of distinct pixels with
coordinates
 ( x0 , y 0 ), ( x1 , y1 ) ,…, ( xn , y n )
where ( x0 , y0 )= ( x, y) , ( xn , yn ) = (s, t ) ,
and pixels ( xi , yi ) and ( xi 1 , yi 1 ) are
adjacent
 Region
 We call R a region of the image if R is a
connected set
 Boundary
 The boundary of a region R is the set of
pixels in the region that have one or
more neighbors that are not in R
 Edge
 Pixels with derivative values that
exceed a preset threshold
 Distance measures
 Euclidean distance
1
De ( p, q)  [( x  s) 2  ( y  t ) ]
2 2

 City-block distance
D4 ( p, q) | ( x  s) |  | ( y  t ) |

 Chessboard distance
D8 ( p, q)  max(| ( x  s ) |, | ( y  t ) |)
Distance

For pixel p, q, and z with coordinates (x,y), (s,t) and (u,v),


D is a distance function or metric if

w D(p,q) 0 (D(p,q) = 0 if and only if p = q)

w D(p,q) = D(q,p)

w D(p,z) D(p,q) + D(q,z)

Example: Euclidean distance

De ( p, q)  ( x  s)2  ( y  t )2
Distance (cont.)

D4-distance (city-block distance) is defined as

D4 ( p, q)  x  s  y  t

2 1 2

2 1 0 1 2

2 1 2

Pixels with D4(p) = 1 is 4-neighbors of p.


Distance (cont.)

D8-distance (chessboard distance) is defined as

D8 ( p, q)  max( x  s , y  t )

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

Pixels with D8(p) = 1 is 8-neighbors of p.


 Dm distance: The shortest m-path
between the points
 Linear operation
 H is said to be a linear operator if, for
any two images f and g and any two
scalars a and b,
H (af  bg)  aH ( f )  bH ( g )
Example
 Zooming and Shrinking Images by Pixel
Replication
 (a) Write a computer program capable of zooming
and shrinking an image by pixel replication.
Assume that the desired zoom/shrink factors are
integers. You may ignore aliasing effects.
 (b) use your program to shrink the image from
1024 x 1024 to 256 x 256 pixels.
 (c) Use your program to zoom the image in (b)
back to 1024 x 1024. Explain the reasons for their
differences.

You might also like