Unit 1 DIP
Unit 1 DIP
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Fundamental Steps in Digital Image Processing
18
19
Image Acquisition:
• The first step is to acquire a digital image using a digital camera, scanner, or any other image capture device.
• The image can be obtained from various sources such as photographs, videos, or medical imaging devices.
20
Image Enhancement:
• Image enhancement techniques aim to improve the visual quality of the image or highlight specific features of interest.
• Common enhancement techniques include filtering operations like sharpening, blurring, and noise reduction.
21
• Other methods like contrast stretching, histogram modification, and spatial domain operations can also be applied.
• Image restoration is used to recover images that have been degraded by noise, motion blur, or other
distortions.
• It involves techniques such as image deblurring, denoising, and image inpainting to reconstruct the
original image as accurately as possible.
22
• Morphological processing is a fundamental technique in digital image processing that deals with the shape and structure
of objects within an image.
• It is based on mathematical morphology, which analyzes the geometrical properties of objects by using set theory and
algebraic operations.
• Morphological processing is particularly useful in tasks such as image segmentation, noise removal, object detection, and
image analysis. 23
• Image segmentation involves partitioning an image into meaningful regions or objects.
• Techniques like thresholding, region growing, edge detection, and clustering algorithms are used for segmentation.
24
• Object recognition is a computer
vision task that involves
identifying and classifying objects
or specific patterns within digital
images or video frames.
25
• Representation and
description are crucial steps in
the process of analyzing and
interpreting digital images.
26
• Image compression reduces
the storage space required for
images while minimizing the
loss of visual quality.
27
• Color image processing
involves the analysis,
manipulation, and
enhancement of images that
contain color information.
28
29
Components of an Image Processing
System
30
Components of an Image Processing System
Image Sensors
• Starting with image sensing, there are two
elements required to acquire digital images.
31
Components of an Image Processing System
(Contd.)
Specialized Image Processing hardware
• Specialized image processing hardware usually
consists of the digitizer just mentioned, plus
hardware that performs other primitive operations,
such as an arithmetic logic unit (ALU), that performs
arithmetic and logical operations in parallel on
entire images.
33
Components of an Image Processing System
(Contd.)
Image Processing Software
• Software for image processing consists of
specialized modules that perform specific tasks.
34
Components of an Image Processing System
(Contd.)
Mass Storage
Mass storage capability is a must in image
processing applications. An image of size pixels, in
which the intensity of each pixel is an 8-bit
quantity, requires one megabyte of storage space if
the image is not compressed.
35
Components of an Image Processing System
(Contd.)
Image Displays
• Image displays in use today are mainly color (preferably
flat screen) TV monitors.
36
Components of an Image Processing System
(Contd.)
Hardcopy
• Hardcopy devices for recording images include laser
printers, film cameras, heat-sensitive devices, inkjet
units, and digital units, such as optical and CDROM
disks.
37
Components of an Image Processing System
(Contd.)
Networking
• Networking is almost a default function in any
computer system in use today.
38
Self Test Questions
1. Which step involves extracting relevant information 3. Which step involves presenting processed images or
or features from an image?
analysis results in a visually meaningful form?
a) Image Enhancement
a) Image Visualization
b) Image Restoration
b) Image Analysis
c) Image Segmentation
c) Image Restoration
d) Feature Extraction
d) Image Enhancement
Answer: d) Feature Extraction
Answer: a) Image Visualization
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
1. An Image segment is shown below. Let V be the set of gray level values used to define the
connectivity in the image. Compute D4 and D8 distance between pixels ‘p’ and ‘q’ for
I. V = {2,3}
3 1 2 1
II. V = {2,5}
0 2 0 2
1 2 1 1
1 0 1 2
71
Color fundamentals and models
72
Color fundamentals
• Physical phenomenon
• Physical nature of color is known
• Psysio-psychological phenomenon
• How human brain perceive and interpret color?
73
Physical quantities to describe a
chromatic light source
• Radiance: total amount of energy that flow from the light source,
measured in watts (W)
• RGB model
• CYM model
Suitable for hardware or
• CYMK model applications
• HSI model
- match the human description
75
RGB color model
76
Safe RGB colors
• Subset of colors is enough for some application
• Safe RGB colors (safe Web colors, safe browser colors)
(6)3 = 216
77
CMY model (+Black = CMYK)
• CMY: secondary colors of light, or primary colors of pigments
• Used to generate hardcopy output
C 1 R
M 1 G
Y 1 B
78
HSI color model
• Will you describe a color using its R, G, B components?
• Human describe a color by its hue, saturation, and brightness
• Hue : color attribute
• Saturation: purity of color (white->0, primary color->1)
• Brightness: achromatic notion of intensity
79
HSI color model (cont.)
• RGB -> HSI model
Colors on this triangle
Have the same hue
Intensity
line
saturation
80
Image Transforms
• Many times, image processing tasks can be best performed in a
domain other than the spatial domain.
• Key steps
(1) Transform the image
(2) Carry the task(s) in the transformed domain.
(3) Apply inverse transform to return to the spatial domain.
81
Representative Forward/Inverse
Equations
• Forward Transformation (discrete case)
82
Discrete Fourier Transform (DFT) (cont’d)
Forward DFT:
N 1 j 2 ux
F (u ) f ( x)e N
, u 0,1, 2,..., N 1
x 0
u-th sample (i.e., u is now an index)
Inverse DFT:
N 1 j 2 ux
1
f ( x)
N
F (u )e
u 0
N
, x 0,1, 2,..., N 1
x-th sample (i.e., x is now an index)
83
Discrete Fourier Transform (DFT) (cont’d)
Forward DFT N 1 j 2 ux
1
F (u )
N
f ( x )e
x 0
N
, u 0,1, 2,..., N 1
u-th sample (i.e., u is now an index)
Inverse DFT
N 1 j 2 ux
f ( x) F (u )e N
, x 0,1, 2,..., N 1
u 0
x-th sample (i.e., x is now an index)
84
Example
f(0) = 2
f(1) = 3
f(2) = 4
f(3) = 4
N 1 j 2 ux
1 13/4
F (u )
N
x 0
f ( x )e N
, u 0,1, 2,..., N 1
F(0) = 13/4 5 5
F(1) = 1/4(-2+j) 4 1 4
F(2) = -1/4
F(3) = -1/4(2+j)
85
DFT Properties: (1) Separability
Forward DFT:
This is because
the exponential ux vy ux vy
j 2 ( ) j 2 ( ) j 2 ( )
kernel is e N
e N
e N
separable!
86
DFT Properties: (1) Separability (cont’d)
• Let’s set: 1
2D DFT steps:
1. Compute F1(x,v)
• Then: 1
2. Compute F(u,v)
87
DFT Properties: (1) Separability (cont’d)
• How to compute F1(x,v)?
) x,v=0,1,2,…N-1
f(x,y)F1(x,v)F(u,v)
90
DFT Properties: (3) Symmetry
f ( x, y )
F (u, v) R (u, v ) jI (u , v)
91
DFT Properties: (4) Translation
f(x,y) F(u,v)
92
DFT Properties: (4) Translation (cont’d)
after translation
|F(u-N/2)|
93
DFT Properties: (4) Translation (cont’d)
• Use the following property to preform the
translation F(u-N/2,v-N/2):
)
N
Set
94
DFT Properties: (4) Translation (cont’d)
• Need to pre-multiply f(x,y) by (-1) x+y to see a full
period.
95
DFT Properties: (4) Translation (cont’d)
sinc
97
DFT Properties: (6) Addition/Multiplication
98
DFT Properties: (7) Scale
99
DFT Properties: (8) Average value
Average:
So:
100
DFT Properties
Property Description Formula Example
The 2D DFT of a real-valued signal has F(u, v) = conj(F(-u, -v)), for Real input with symmetric
Symmetry
conjugate symmetry. real-valued f(x, y). DFT magnitudes.
A spatial rotation of the input signal DFT(f_rot(x, y)) = F(u, v) * Rotating f(x, y) shifts F(u,
Rotation
results in a circular shift in the DFT. exp(-j(2π(ucosθ + vsinθ))) v) in a circular pattern.
101
Discrete Cosine Transform
The basis functions of DCT are real. (DFT has complex basis functions.)
DCT has very good energy compaction properties.
DCT can be expressed in terms of DFT, therefore, Fast Fourier Transform
implementation can be used.
In the case of block-based image compression, (e.g., JPEG), DCT
produces less artifacts along the boundaries than DFT does.
102
Discrete Cosine Transform
1D Discrete Cosine Transform (DCT)
N 1
(2n 1)k
F [ k ] f [ n] ( k ) cos
n 0 2N
1
for k 0
N
where k 0,1,..., N and
1 (k )
2 for k 1, 2,..., N 1
N
• Inverse DCT
N 1
(2n 1)k
f [n] F [k ] (k ) cos
k 0 2N
103
Discrete Cosine Transform
2D Discrete Cosine Transform (DCT)
M 1 N 1
(2m 1)k (2n 1)l
F [ k .l ] f [ m, n] (k ) (l ) cos cos
m0 n 0 2M 2N
1
for k 0
N
where k , l 0,1,..., N and
1 (k )
2 for k 1, 2,..., N 1
N
• Inverse DCT
M 1 N 1
(2m 1)k (2n 1)l
f [m, n] F [k , l ] (k ) (l ) cos cos
k 0 l 0 2M 2N
104
DCT and DFT
N-point DCT of x[n] can be obtained from 2N-point DFT
of symmetrically extended x[n].
(2n 1) k
N 1
DCT of x[n] : X C [k ] (k ) x[ n]cos
n 0 2N
k
(k ) j
X C [k ] e 2N
X F [k ]
2
105
Discrete Cosine Transform
DCT DFT
106
Discrete Cosine Transform
Matrix Representation of DCT
N 1
(2n 1)k
F [ k ] f [ n] ( k ) cos
n 0 2N
107
Discrete Cosine Transform
Matrix Representation of Inverse DCT
N 1
(2n 1)k
f [n] F [k ] (k ) cos
k 0 2N
D1
f D1F
108
Discrete Cosine Transform
Inverse DCT matrix is equal to the transpose of DCT
matrix!
D1 DT
DDT DT D I
109
Discrete Cosine Transform
2D Discrete Cosine Transform (DCT)
M 1 N 1
(2m 1)k (2n 1)l
F [ k .l ] f [ m, n] (k ) (l ) cos cos
m0 n 0 2M 2N
1
for k 0
N
where k , l 0,1,..., N 1 and (k )
2 for k 1, 2,..., N 1
N
• Inverse DCT
M 1 N 1
(2m 1)k (2n 1)l
f [m, n] F [k , l ] (k ) (l ) cos cos
k 0 l 0 2M 2N
110
Discrete Cosine Transform
For two-dimensional signals:
Β = DΑDT
T
=
Β D A D
111
Summary
Application in Application in
Transform Formula Explanation of Variables
Image Audio
112
113
114
THANK YOU
115