SlideShare a Scribd company logo
DIGITAL IMAGE PROCESSING
(2ND EDITION)
RAFAEL C. GONZALEZ
RICHARD E.WOODS
Dr Moe Moe Myint
(Assistant Lecturer)
Technological University (Kyaukse)
MISCELLANEA
 Lectures: A
 Monday 1:00 – 3:00
 Tuesday 2:00 – 4:00
 Lectures: B
 Monday 8:00 – 10:00
 Wednesday 1:00 – 3:00
 Slideshare: www.slideshare.net/MoeMoeMyint
 E-mail: moemoemyint@moemyanmar.ml
 Blog: drmoemoemyint.blogspot.com
2
CONTENTS FOR CHAPTER 2
2.1 Elements of Visual Perception
2.2 Light and the Electromagnetic Spectrum
2.3 Image Sensing and Acquisition
2.4 Image Sampling and Quantization
2.5 Some Basic Relationships Between Pixels
2.6 Linear and Nonlinear Operations
3
4
Digital Image
Digital image = a multidimensional
array of numbers (such as intensity image)
or vectors (such as color image)
Each component in the image
called pixel associates with
the pixel value (a single number in
the case of intensity images or a
vector in the case of color images).












39871532
22132515
372669
28161010












39656554
42475421
67965432
43567065












99876532
92438585
67969060
78567099
2.3 IMAGE SENSING AND ACQUISITION
Image Sensing
o Scene
o Molecules
o Human Brains
o …
o Illumination
o Radar
o Infrared
o X-ray
o Sun
o …
o Reflection
5
CONT’D
6
Single imaging
Sensor
Line Sensor
Array Sensor
IMAGE ACQUISITION USING A SINGLE SENSOR
7
The most familiar sensor of
this type is the photodiode
It is constructed of silicon
materials and whose output
voltage waveform is
proportional to light.
The use of a filter in front of a
sensor improves selectivity.
For example, a green (pass)
filter in front of a light sensor
favors light in the green band
of the color spectrum.
As a consequence, the sensor
output will be stronger for
green light than for other
components in the visible
spectrum.
IMAGE ACQUISITION USING SENSOR STRIPS
8
Image Acquisition Using Sensor Strip
9
IMAGE ACQUISITION USING SENSOR ARRAYS
10
CCD KAF-3200E from Kodak.
(2184 x 1472 pixels,
Pixel size 6.8 microns2)
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
Image Sensors : Array Sensor
11
A SIMPLE IMAGE FORMATION MODEL
12
f(x,y) = i(x,y)  r(x,y)
0 < i(x,y) < 
0 < r(x,y) < 1
(from total absorption to
total reflectance)
Sample values of
r(x,y):
0.01: black velvet
0.93: snow
Intensity of a monochrome
image f at (x0,y0): gray level l
of the image at that point
l=f(x0, y0)
Lmin ≤ l ≤ Lmax
Where:
Lmin: Positive
Lmax: Finite
In practice:
Lmin = Imin rmin
Lmax = Imax rmax
e.g. for indoor image processing:
Lmin ≈ 10 Lmax ≈ 1000
[Lmin, Lmax] : gray scale
Often shifted to [0,L-1] 
l=0: black
l=L-1: white
All intermediate values are shades
of gray
CONT’D
13
2.4 Image Sampling and Quantization
• The output of most sensors is continuous in
amplitude and spatial coordinates.
• Converting an analog image to a digital image
require sampling and quantization
• Sampling: is digitizing the coordinate values
• Quantization: is digitizing the amplitude values
14
SAMPLING & QUANTIZATION
 The spatial and amplitude digitization of f(x,y) is
called:
 image sampling when it refers to spatial coordinates
(x,y) and
 gray-level quantization when it refers to the amplitude.
15
Image Sampling and Quantization
Spatial sampling is
accomplished by sensor
arrangement and
mechanical movement.
16
IMAGE SAMPLING AND QUANTISATION
A digital sensor can only measure a limited number of
samples at a discrete set of energy levels
Quantisation is the process of converting a continuous
analogue signal into a digital representation of this signal
17
IMAGE SAMPLING AND QUANTISATION
18
IMAGE SAMPLING AND QUANTISATION
19
IMAGE SAMPLING AND QUANTISATION
(CONT…)
Remember that a digital image is always only an
approximation of a real world scene
20
21
original Sampled by 2 Sampled by 4
Sampled by 8 Sampled by 16
22
UNIFORM QUANTIZATION
 Digitized in amplitude (or pixel value)
 PGM – 256 levels  4 levels
0
255
64
128
192
0
3
1
2
23
original 128 levels (7 bits) 16 levels (4 bits)
4 levels (2 bits) 2 levels (1 bit)
Representing Digital Images
24
Image “After snow storm”
Fundamentals of Digital Images
f(x,y)
x
y
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.
Origin
25
REPRESENTING DIGITAL IMAGES
0  ai,j  L-1 Where L = 2k
The dynamic range of an image is the range of values
spanned by the gray scale.
The number, b, of bits required to store a digitized image of
size M by N is
b = M  N  k
The pixel intensity levels (gray scale levels) are in the
interval of [0, L-1].
26
77 66 68 67 98 93 79 81
79 61 61 71 61 78 88 94
79 93 84 64 72 76 95 94
97 65 71 75 75 72 95 111
120 81 82 76 72 77 78 83
150 146 112 83 78 62 91 85
156 145 158 125 107 121 95 86
158 166 147 146 153 149 129 107
Elaine image of size 512
by 512 pixels (5 by 5
inches), The dynamic
range is [0, 255].
Find the following:
• The number of bits
required to represent a
pixel
• The size of the image in
bits?
Representing Digital Images
27
Representing Digital Images
28
Digital Image Types : Intensity Image
Intensity image or monochrome image
each pixel corresponds to light intensity
normally represented in gray scale (gray
level).












39871532
22132515
372669
28161010
Gray scale values
29












39871532
22132515
372669
28161010












39656554
42475421
67965432
43567065












99876532
92438585
67969060
78567099
Digital Image Types : RGB Image
Color image or RGB image:
each pixel contains a vector
representing red, green and
blue components.
RGB components
30
Image Types : Binary Image
Binary image or black and white image
Each pixel contains one bit :
1 represent white
0 represents black












1111
1111
0000
0000
Binary data
31
Image Types : Index Image
Index image
Each pixel contains index number
pointing to a color in a color table










256
746
941
Index value
Index
No.
Red
component
Green
component
Blue
component
1 0.1 0.5 0.3
2 1.0 0.0 0.0
3 0.0 1.0 0.0
4 0.5 0.5 0.5
5 0.2 0.8 0.9
… … … …
Color Table
32
Effect of Spatial Resolution
256x256 pixels
64x64 pixels
128x128 pixels
32x32 pixels
33
SPATIAL RESOLUTION
The spatial resolution of an image is determined by
how sampling was carried out
Spatial resolution simply refers to the smallest
discernable detail in an image
 Vision specialists will
often talk about pixel
size
 Graphic designers will
talk about dots per
inch (DPI)
34
Effect of Spatial Resolution
35
SPATIAL RESOLUTION (CONT…)
36
SPATIAL RESOLUTION (CONT…)
37
SPATIAL RESOLUTION (CONT…)
38
SPATIAL RESOLUTION (CONT…)
39
SPATIAL RESOLUTION (CONT…)
40
SPATIAL RESOLUTION (CONT…)
41
INTENSITY LEVEL RESOLUTION
Intensity level resolution refers to the number of
intensity levels used to represent the image
 The more intensity levels used, the finer the level
of detail discernable in an image
 Intensity level resolution is usually given in terms
of the number of bits used to store each intensity
level
Number of Bits
Number of Intensity
Levels
Examples
1 2 0, 1
2 4 00, 01, 10, 11
4 16 0000, 0101, 1111
8 256 00110011, 01010101
16 65,536 1010101010101010
42
INTENSITY LEVEL RESOLUTION (CONT…)
128 grey levels (7 bpp) 64 grey levels (6 bpp) 32 grey levels (5 bpp)
16 grey levels (4 bpp) 8 grey levels (3 bpp) 4 grey levels (2 bpp) 2 grey levels (1 bpp)
256 grey levels (8 bits per pixel)
43
INTENSITY LEVEL RESOLUTION (CONT…)
44
INTENSITY LEVEL RESOLUTION (CONT…)
45
INTENSITY LEVEL RESOLUTION (CONT…)
46
INTENSITY LEVEL RESOLUTION (CONT…)
47
INTENSITY LEVEL RESOLUTION (CONT…)
48
INTENSITY LEVEL RESOLUTION (CONT…)
49
INTENSITY LEVEL RESOLUTION (CONT…)
50
INTENSITY LEVEL RESOLUTION (CONT…)
51
SATURATION & NOISE
52
RESOLUTION: HOW MUCH IS ENOUGH?
The big question with resolution is always how much is
enough?
 This all depends on what is in the image and what you would
like to do with it
 Key questions include
 Does the image look aesthetically pleasing?
 Can you see what you need to see within the image?
53
RESOLUTION: HOW MUCH IS ENOUGH?
(CONT…)
The picture on the right is fine for counting the number of
cars, but not for reading the number plate
54
INTENSITY LEVEL RESOLUTION (CONT…)
Low Detail Medium Detail High Detail
55
INTENSITY LEVEL RESOLUTION (CONT…)
56
INTENSITY LEVEL RESOLUTION (CONT…)
57
INTENSITY LEVEL RESOLUTION (CONT…)
58
Basic Relationship of Pixels
x
y
(0,0)
Conventional indexing method
(x,y) (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)
59
Neighbors of a Pixel
p (x+1,y)(x-1,y)
(x,y-1)
(x,y+1)
4-neighbors of p:
N4(p) =
(x-1,y)
(x+1,y)
(x,y-1)
(x,y+1)
Neighborhood relation is used to tell adjacent pixels. It is
useful for analyzing regions.
Note: q N4(p) implies p N4(q)
4-neighborhood relation considers only vertical and
horizontal neighbors.
60
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)
CONT’D
8-neighbors of p:
(x-1,y-1)
(x,y-1)
(x+1,y-1)
(x-1,y)
(x+1,y)
(x-1,y+1)
(x,y+1)
(x+1,y+1)
N8(p) =
8-neighborhood relation considers all neighbor pixels.
61
p
(x+1,y-1)(x-1,y-1)
(x-1,y+1) (x+1,y+1)
Diagonal neighbors of p:
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.
CONT’D
62
If pixel p at location (x,y) then its neighbors are:
• 4-neighbors N4(p)
(x-1 , y), (x+1 , y), (x , y-1), (x , y+1)
• 4-diagonal neighbors ND(p)
(x-1 , y-1), (x-1 , y+1), (x+1 , y+1), (x+1 , y-1)
• 8-neighbors N8(p)
All pixels in N4(p) and in ND(p)
2.5 Some Basic Relationship Between Pixels
63
Three type of adjacency:
(a) 4-adjacency. Two pixels p and q with values from V
are 4-adjacent if q is in the set N4(p).
(b) 8-adjacency. Two pixels p and q with values from V
are 8-adjacent if q is in the set N8(p).
( c) m-adjacency (mixed adjacency). Two pixels p and q
with values from V are m-adjacent if
(i) q is in N4(p), or
(ii) q is in ND(p) and the set N4(p)  N4(q) has
no pixels whose values are from V
V: The set of gray-level values used to define adjacency
Adjacency
64
Adjacency
A pixel p is adjacent to pixel q is they are connected.
Two image subsets S1 and S2 are adjacent if some pixel
in S1 is adjacent to some pixel in S2
S1
S2
We can define type of adjacency: 4-adjacency, 8-adjacency
or m-adjacency depending on type of connectivity. 65
0 1 0
0 1 0
0 0 1
4-adjacency
q
p
8-adjacency
0 0 1
0 1 0
0 0 1
q
m-adjacency
0 1 1
0 1 0
0 0 1
q
0 1 1
0 1 0
0 0 1
q
8-adjacency
!?
Adjacency
66
CONT’D
 Subset adjacency
 S1 and S2 are adjacent if some pixel in S1 is adjacent to
some pixel in S2
A path (curve) from pixel p with coordinates (x,y) to pixel
q with coordinates (s,t) is a sequence of distinct pixels:
(x0,y0), (x1,y1), …, (xn,yn)
where (x0,y0)=(x,y), (xn,yn)=(s,t), and (xi,yi) is
adjacent to (xi-1,yi-1), for 1≤i ≤n ; n is the length of the
path.
If (x0, y0) = (xn, yn): A closed path.
67
 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
CONT’D
68
 Distance measures
 Euclidean distance
 City-block distance
 Chessboard distance
2
1
22
])()[(),( tysxqpDe -+-
|)(||)(|),(4 tysxqpD -+-
|))(||,)(max(|),(8 tysxqpD --
CONT’D
69
mD distance: The shortest m-path between
the points
CONT’D
70
For pixels p, q, and z, with coordinates (x,y), (s,t), and
(v,w), respectively, D is a distance function or metric if
(a) D(p,q)  0 ,
(b) D(p,q) = D(q,p), (symmetry)
(c) D(p,z)  D(p,q) + D(q,z) (triangular inequality)
Euclidean distance between p and q is
De(p,q) = [ (x - s)2 + (y - t)2 ]1/2
For this distance measure, the pixels
having a distance less than or equal
to some value r from (x,y) are the
points contained in a disk of radius
r centered at (x,y).
Distance Measure (Euclidean)
71
The D4 distance (city-block) between p and q is
D4(p,q) = |x – s | + |y – t |
Diamond shape
The D8 distance (chessboard) between p and q is
D8(p,q) = max ( |x – s | , |y – t | )
2
2 1 2
2 1 0 1 2
2 1 2
2
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
Distance Measure (City block, Chessboard)
72
If distance depend on the path between two pixels such
as m-adjacency then the Dm distance between two pixels
is defined as the shortest m-path between the pixels.
0 0 1
0 1 0
1 0 0
q
Dm( p , q ) = 2
0 0 1
1 1 0
1 0 0p
Dm( p , q ) = 3
0 1 1
1 1 0
1 0 0
Dm( p , q ) = 4
Distance Measure of Path
73
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
22
)()(),( tysxqpDe -+-
74
D4-distance (city-block distance) is defined as
tysxqpD -+-),(4
1 2
10
1 2
1
2
2
2
2
2
2
Pixels with D4(p) = 1 is 4-neighbors of p. 75
D8-distance (chessboard distance) is defined as
),max(),(8 tysxqpD --
1
2
10
1
2
1
2
2
2
2
2
2
Pixels with D8(p) = 1 is 8-neighbors of p.
22
2
2
2
222
1
1
1
1
76
Path
A path from pixel p at (x,y) to pixel q at (s,t) is a sequence
of distinct pixels:
(x0,y0), (x1,y1), (x2,y2),…, (xn,yn)
such that
(x0,y0) = (x,y) and (xn,yn) = (s,t)
and
(xi,yi) is adjacent to (xi-1,yi-1), i = 1,…,n
p
q
We can define type of path: 4-path, 8-path or m-path
depending on type of adjacency. 77
p
q
p
q
p
q
8-path from p to q
results in some ambiguity
m-path from p to q
solves this ambiguity
8-path m-path
78
3 1 2 1
2 2 0 2
1 2 1 1
1 0 1 2
(p)
(q)
Find the shortest 4-, 8-, m-path
between p and q for
V= {0, 1} and V={1, 2}
Path Length
79
Images are represented by Matrices, and matrix division
is not defined. The following image division
C = A/B
means that the division is carried out between
corresponding pixels in the two images A and B to form
image C.
Image Operation on a Pixel Basis
80
H(af + bg) = a H( f ) + b H( g )
Linear and Nonlinear Operation
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,
81
IMAGE ADDITION
(AVERAGING)IMAGE ADDITION (AVERAGING)
82
IMAGE SUBTRACTION
83
IMAGE SUBTRACTION
84
IMAGE MULTIPLICATION (DIVISION)
85
IMAGE MULTIPLICATION (DIVISION)
86
REFERENCES
 “Digital Image Processing”, 2/ E, Rafael C. Gonzalez & Richard
E. Woods, www.prenhall.com/gonzalezwoods.
 Only Original Owner has full rights reserved for copied
images.
 This PPT is only for fair academic use.
87
88
Questions?
Think Smarter,
Work Harder

More Related Content

PPTX
Image Sensing and Acquisition.pptx
PPTX
Image Sampling and Quantization.pptx
PPTX
Image Restoration And Reconstruction
PDF
Image processing, Noise, Noise Removal filters
PPT
Enhancement in spatial domain
PPT
Image enhancement
PPT
Image segmentation
Image Sensing and Acquisition.pptx
Image Sampling and Quantization.pptx
Image Restoration And Reconstruction
Image processing, Noise, Noise Removal filters
Enhancement in spatial domain
Image enhancement
Image segmentation

What's hot (20)

PPTX
Simultaneous Smoothing and Sharpening of Color Images
PPTX
Color Image Processing
PPTX
Lecture 1 for Digital Image Processing (2nd Edition)
PPTX
Psuedo color
PPTX
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
PPTX
Color image processing Presentation
PPTX
digital image processing
PDF
PPT
image enhancement
PPT
Chapter 6 Image Processing: Image Enhancement
PPSX
Edge Detection and Segmentation
PPTX
Intensity Transformation and Spatial filtering
PPT
Image degradation and noise by Md.Naseem Ashraf
PPTX
Image restoration and degradation model
PPTX
Digital Image restoration
PPTX
Edge Detection using Hough Transform
PPTX
Chapter 1 and 2 gonzalez and woods
ODP
image compression ppt
PPT
Texture in image processing
Simultaneous Smoothing and Sharpening of Color Images
Color Image Processing
Lecture 1 for Digital Image Processing (2nd Edition)
Psuedo color
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
Color image processing Presentation
digital image processing
image enhancement
Chapter 6 Image Processing: Image Enhancement
Edge Detection and Segmentation
Intensity Transformation and Spatial filtering
Image degradation and noise by Md.Naseem Ashraf
Image restoration and degradation model
Digital Image restoration
Edge Detection using Hough Transform
Chapter 1 and 2 gonzalez and woods
image compression ppt
Texture in image processing
Ad

Viewers also liked (20)

PPTX
Lect 03 - first portion
PPTX
Lect 02 first portion
PPT
Digital Image Processing
PPTX
Digital image processing img smoothning
PPTX
Lect 02 first portion
PPSX
Digital image processing
PPT
Digital image processing lab 1
PPTX
COM2304: Digital Image Fundamentals - I
PPT
Dital Image Processing (Lab 2+3+4)
PPTX
Digital Image Processing (Lab 08)
PPT
Introduction to Networks & Networking Concepts
PPTX
Dip chapter 2
PPTX
Chapter 6 - Networking
PPT
Image enhancement ppt nal2
PDF
DATA COMMUNICATION AND NETWORKING
PPT
Networking Essentials Lesson 01 - Eric Vanderburg
PPT
Soliton
PPT
digital image processing
PDF
Image processing fundamentals
PPTX
Chapter 3 image enhancement (spatial domain)
Lect 03 - first portion
Lect 02 first portion
Digital Image Processing
Digital image processing img smoothning
Lect 02 first portion
Digital image processing
Digital image processing lab 1
COM2304: Digital Image Fundamentals - I
Dital Image Processing (Lab 2+3+4)
Digital Image Processing (Lab 08)
Introduction to Networks & Networking Concepts
Dip chapter 2
Chapter 6 - Networking
Image enhancement ppt nal2
DATA COMMUNICATION AND NETWORKING
Networking Essentials Lesson 01 - Eric Vanderburg
Soliton
digital image processing
Image processing fundamentals
Chapter 3 image enhancement (spatial domain)
Ad

Similar to Lect 02 second portion (20)

PPTX
quantization and sampling presentation ppt
PPT
PPTX
Digital Image Processing Unit 1 NotesPPT
PDF
Digital_image_processing introduction ppt for basic understanding
PDF
Lec_2_Digital Image Fundamentals.pdf
PDF
Computer_Vision-Lecture 2- Revision on Image.pdf
PPT
introduction to Digital Image Processing
PPTX
Digital-Image-processing-fundamenntal.pptx
PPT
sampling and efeects.pptyeyeyyyyywshdhdh
PPTX
Computer vision labs for improving in the subject
PDF
Fundamentals of image processing
DOCX
Multimedia digital images
PPT
03 digital image fundamentals DIP
PDF
Basics of image processing & analysis
PPTX
Image Acquisition and Representation
PPTX
Lectures 1 3 final (4)
PPT
Chapter01 (2)
PPT
PPTX
Distance measures in Image in Digital Image Processing
PPT
lecture3.ppt jrjdndjnrndkemneudbekksjeneiemen
quantization and sampling presentation ppt
Digital Image Processing Unit 1 NotesPPT
Digital_image_processing introduction ppt for basic understanding
Lec_2_Digital Image Fundamentals.pdf
Computer_Vision-Lecture 2- Revision on Image.pdf
introduction to Digital Image Processing
Digital-Image-processing-fundamenntal.pptx
sampling and efeects.pptyeyeyyyyywshdhdh
Computer vision labs for improving in the subject
Fundamentals of image processing
Multimedia digital images
03 digital image fundamentals DIP
Basics of image processing & analysis
Image Acquisition and Representation
Lectures 1 3 final (4)
Chapter01 (2)
Distance measures in Image in Digital Image Processing
lecture3.ppt jrjdndjnrndkemneudbekksjeneiemen

More from Moe Moe Myint (17)

PPTX
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
PPTX
Chapter 8 Embedded Hardware Design and Development (third portion)
PPTX
Chapter 8 Embedded Hardware Design and Development (second portion)
PPTX
Schematic and PCB Design Using Eagle
PPTX
Chapter 4 Embedded System: Application and Domain Specific
PPTX
Chapter 3 Charateristics and Quality Attributes of Embedded System
PPTX
Introduction to Embedded System I: Chapter 2 (5th portion)
PPTX
Introduction to Embedded System: Chapter 2 (4th portion)
PPTX
Introduction to Embedded System I : Chapter 2 (3rd portion)
PPTX
Introduction to Embedded System I : Chapter 2 (2nd portion)
PPTX
Introduction to Embedded Systems I: Chapter 2 (1st portion)
PPTX
Introduction to Embedded Systems I : Chapter 1
PPTX
Lect 06
PPTX
Digital Image Processing (Lab 09 and 10)
PPTX
Digital Image Processing (Lab 07)
PPTX
Digital Image Processing (Lab 06)
PPTX
Digital Image Processing (Lab 05)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Chapter 8 Embedded Hardware Design and Development (third portion)
Chapter 8 Embedded Hardware Design and Development (second portion)
Schematic and PCB Design Using Eagle
Chapter 4 Embedded System: Application and Domain Specific
Chapter 3 Charateristics and Quality Attributes of Embedded System
Introduction to Embedded System I: Chapter 2 (5th portion)
Introduction to Embedded System: Chapter 2 (4th portion)
Introduction to Embedded System I : Chapter 2 (3rd portion)
Introduction to Embedded System I : Chapter 2 (2nd portion)
Introduction to Embedded Systems I: Chapter 2 (1st portion)
Introduction to Embedded Systems I : Chapter 1
Lect 06
Digital Image Processing (Lab 09 and 10)
Digital Image Processing (Lab 07)
Digital Image Processing (Lab 06)
Digital Image Processing (Lab 05)

Recently uploaded (20)

PPTX
web development for engineering and engineering
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
PPT on Performance Review to get promotions
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
composite construction of structures.pdf
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Digital Logic Computer Design lecture notes
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
additive manufacturing of ss316l using mig welding
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
DOCX
573137875-Attendance-Management-System-original
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
web development for engineering and engineering
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Internet of Things (IOT) - A guide to understanding
PPT on Performance Review to get promotions
Operating System & Kernel Study Guide-1 - converted.pdf
R24 SURVEYING LAB MANUAL for civil enggi
CYBER-CRIMES AND SECURITY A guide to understanding
composite construction of structures.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Digital Logic Computer Design lecture notes
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Automation-in-Manufacturing-Chapter-Introduction.pdf
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
OOP with Java - Java Introduction (Basics)
additive manufacturing of ss316l using mig welding
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
573137875-Attendance-Management-System-original
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx

Lect 02 second portion

  • 1. DIGITAL IMAGE PROCESSING (2ND EDITION) RAFAEL C. GONZALEZ RICHARD E.WOODS Dr Moe Moe Myint (Assistant Lecturer) Technological University (Kyaukse)
  • 2. MISCELLANEA  Lectures: A  Monday 1:00 – 3:00  Tuesday 2:00 – 4:00  Lectures: B  Monday 8:00 – 10:00  Wednesday 1:00 – 3:00  Slideshare: www.slideshare.net/MoeMoeMyint  E-mail: moemoemyint@moemyanmar.ml  Blog: drmoemoemyint.blogspot.com 2
  • 3. CONTENTS FOR CHAPTER 2 2.1 Elements of Visual Perception 2.2 Light and the Electromagnetic Spectrum 2.3 Image Sensing and Acquisition 2.4 Image Sampling and Quantization 2.5 Some Basic Relationships Between Pixels 2.6 Linear and Nonlinear Operations 3
  • 4. 4 Digital Image Digital image = a multidimensional array of numbers (such as intensity image) or vectors (such as color image) Each component in the image called pixel associates with the pixel value (a single number in the case of intensity images or a vector in the case of color images).             39871532 22132515 372669 28161010             39656554 42475421 67965432 43567065             99876532 92438585 67969060 78567099
  • 5. 2.3 IMAGE SENSING AND ACQUISITION Image Sensing o Scene o Molecules o Human Brains o … o Illumination o Radar o Infrared o X-ray o Sun o … o Reflection 5
  • 7. IMAGE ACQUISITION USING A SINGLE SENSOR 7 The most familiar sensor of this type is the photodiode It is constructed of silicon materials and whose output voltage waveform is proportional to light. The use of a filter in front of a sensor improves selectivity. For example, a green (pass) filter in front of a light sensor favors light in the green band of the color spectrum. As a consequence, the sensor output will be stronger for green light than for other components in the visible spectrum.
  • 8. IMAGE ACQUISITION USING SENSOR STRIPS 8
  • 9. Image Acquisition Using Sensor Strip 9
  • 10. IMAGE ACQUISITION USING SENSOR ARRAYS 10
  • 11. CCD KAF-3200E from Kodak. (2184 x 1472 pixels, Pixel size 6.8 microns2) 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 Image Sensors : Array Sensor 11
  • 12. A SIMPLE IMAGE FORMATION MODEL 12 f(x,y) = i(x,y)  r(x,y) 0 < i(x,y) <  0 < r(x,y) < 1 (from total absorption to total reflectance) Sample values of r(x,y): 0.01: black velvet 0.93: snow Intensity of a monochrome image f at (x0,y0): gray level l of the image at that point l=f(x0, y0) Lmin ≤ l ≤ Lmax Where: Lmin: Positive Lmax: Finite In practice: Lmin = Imin rmin Lmax = Imax rmax e.g. for indoor image processing: Lmin ≈ 10 Lmax ≈ 1000 [Lmin, Lmax] : gray scale Often shifted to [0,L-1]  l=0: black l=L-1: white All intermediate values are shades of gray
  • 14. 2.4 Image Sampling and Quantization • The output of most sensors is continuous in amplitude and spatial coordinates. • Converting an analog image to a digital image require sampling and quantization • Sampling: is digitizing the coordinate values • Quantization: is digitizing the amplitude values 14
  • 15. SAMPLING & QUANTIZATION  The spatial and amplitude digitization of f(x,y) is called:  image sampling when it refers to spatial coordinates (x,y) and  gray-level quantization when it refers to the amplitude. 15
  • 16. Image Sampling and Quantization Spatial sampling is accomplished by sensor arrangement and mechanical movement. 16
  • 17. IMAGE SAMPLING AND QUANTISATION A digital sensor can only measure a limited number of samples at a discrete set of energy levels Quantisation is the process of converting a continuous analogue signal into a digital representation of this signal 17
  • 18. IMAGE SAMPLING AND QUANTISATION 18
  • 19. IMAGE SAMPLING AND QUANTISATION 19
  • 20. IMAGE SAMPLING AND QUANTISATION (CONT…) Remember that a digital image is always only an approximation of a real world scene 20
  • 21. 21 original Sampled by 2 Sampled by 4 Sampled by 8 Sampled by 16
  • 22. 22 UNIFORM QUANTIZATION  Digitized in amplitude (or pixel value)  PGM – 256 levels  4 levels 0 255 64 128 192 0 3 1 2
  • 23. 23 original 128 levels (7 bits) 16 levels (4 bits) 4 levels (2 bits) 2 levels (1 bit)
  • 25. Image “After snow storm” Fundamentals of Digital Images f(x,y) x y 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. Origin 25
  • 26. REPRESENTING DIGITAL IMAGES 0  ai,j  L-1 Where L = 2k The dynamic range of an image is the range of values spanned by the gray scale. The number, b, of bits required to store a digitized image of size M by N is b = M  N  k The pixel intensity levels (gray scale levels) are in the interval of [0, L-1]. 26
  • 27. 77 66 68 67 98 93 79 81 79 61 61 71 61 78 88 94 79 93 84 64 72 76 95 94 97 65 71 75 75 72 95 111 120 81 82 76 72 77 78 83 150 146 112 83 78 62 91 85 156 145 158 125 107 121 95 86 158 166 147 146 153 149 129 107 Elaine image of size 512 by 512 pixels (5 by 5 inches), The dynamic range is [0, 255]. Find the following: • The number of bits required to represent a pixel • The size of the image in bits? Representing Digital Images 27
  • 29. Digital Image Types : Intensity Image Intensity image or monochrome image each pixel corresponds to light intensity normally represented in gray scale (gray level).             39871532 22132515 372669 28161010 Gray scale values 29
  • 31. Image Types : Binary Image Binary image or black and white image Each pixel contains one bit : 1 represent white 0 represents black             1111 1111 0000 0000 Binary data 31
  • 32. Image Types : Index Image Index image Each pixel contains index number pointing to a color in a color table           256 746 941 Index value Index No. Red component Green component Blue component 1 0.1 0.5 0.3 2 1.0 0.0 0.0 3 0.0 1.0 0.0 4 0.5 0.5 0.5 5 0.2 0.8 0.9 … … … … Color Table 32
  • 33. Effect of Spatial Resolution 256x256 pixels 64x64 pixels 128x128 pixels 32x32 pixels 33
  • 34. SPATIAL RESOLUTION The spatial resolution of an image is determined by how sampling was carried out Spatial resolution simply refers to the smallest discernable detail in an image  Vision specialists will often talk about pixel size  Graphic designers will talk about dots per inch (DPI) 34
  • 35. Effect of Spatial Resolution 35
  • 42. INTENSITY LEVEL RESOLUTION Intensity level resolution refers to the number of intensity levels used to represent the image  The more intensity levels used, the finer the level of detail discernable in an image  Intensity level resolution is usually given in terms of the number of bits used to store each intensity level Number of Bits Number of Intensity Levels Examples 1 2 0, 1 2 4 00, 01, 10, 11 4 16 0000, 0101, 1111 8 256 00110011, 01010101 16 65,536 1010101010101010 42
  • 43. INTENSITY LEVEL RESOLUTION (CONT…) 128 grey levels (7 bpp) 64 grey levels (6 bpp) 32 grey levels (5 bpp) 16 grey levels (4 bpp) 8 grey levels (3 bpp) 4 grey levels (2 bpp) 2 grey levels (1 bpp) 256 grey levels (8 bits per pixel) 43
  • 53. RESOLUTION: HOW MUCH IS ENOUGH? The big question with resolution is always how much is enough?  This all depends on what is in the image and what you would like to do with it  Key questions include  Does the image look aesthetically pleasing?  Can you see what you need to see within the image? 53
  • 54. RESOLUTION: HOW MUCH IS ENOUGH? (CONT…) The picture on the right is fine for counting the number of cars, but not for reading the number plate 54
  • 55. INTENSITY LEVEL RESOLUTION (CONT…) Low Detail Medium Detail High Detail 55
  • 59. Basic Relationship of Pixels x y (0,0) Conventional indexing method (x,y) (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) 59
  • 60. Neighbors of a Pixel p (x+1,y)(x-1,y) (x,y-1) (x,y+1) 4-neighbors of p: N4(p) = (x-1,y) (x+1,y) (x,y-1) (x,y+1) Neighborhood relation is used to tell adjacent pixels. It is useful for analyzing regions. Note: q N4(p) implies p N4(q) 4-neighborhood relation considers only vertical and horizontal neighbors. 60
  • 61. 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) CONT’D 8-neighbors of p: (x-1,y-1) (x,y-1) (x+1,y-1) (x-1,y) (x+1,y) (x-1,y+1) (x,y+1) (x+1,y+1) N8(p) = 8-neighborhood relation considers all neighbor pixels. 61
  • 62. p (x+1,y-1)(x-1,y-1) (x-1,y+1) (x+1,y+1) Diagonal neighbors of p: 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. CONT’D 62
  • 63. If pixel p at location (x,y) then its neighbors are: • 4-neighbors N4(p) (x-1 , y), (x+1 , y), (x , y-1), (x , y+1) • 4-diagonal neighbors ND(p) (x-1 , y-1), (x-1 , y+1), (x+1 , y+1), (x+1 , y-1) • 8-neighbors N8(p) All pixels in N4(p) and in ND(p) 2.5 Some Basic Relationship Between Pixels 63
  • 64. Three type of adjacency: (a) 4-adjacency. Two pixels p and q with values from V are 4-adjacent if q is in the set N4(p). (b) 8-adjacency. Two pixels p and q with values from V are 8-adjacent if q is in the set N8(p). ( c) m-adjacency (mixed adjacency). Two pixels p and q with values from V are m-adjacent if (i) q is in N4(p), or (ii) q is in ND(p) and the set N4(p)  N4(q) has no pixels whose values are from V V: The set of gray-level values used to define adjacency Adjacency 64
  • 65. Adjacency A pixel p is adjacent to pixel q is they are connected. Two image subsets S1 and S2 are adjacent if some pixel in S1 is adjacent to some pixel in S2 S1 S2 We can define type of adjacency: 4-adjacency, 8-adjacency or m-adjacency depending on type of connectivity. 65
  • 66. 0 1 0 0 1 0 0 0 1 4-adjacency q p 8-adjacency 0 0 1 0 1 0 0 0 1 q m-adjacency 0 1 1 0 1 0 0 0 1 q 0 1 1 0 1 0 0 0 1 q 8-adjacency !? Adjacency 66
  • 67. CONT’D  Subset adjacency  S1 and S2 are adjacent if some pixel in S1 is adjacent to some pixel in S2 A path (curve) from pixel p with coordinates (x,y) to pixel q with coordinates (s,t) is a sequence of distinct pixels: (x0,y0), (x1,y1), …, (xn,yn) where (x0,y0)=(x,y), (xn,yn)=(s,t), and (xi,yi) is adjacent to (xi-1,yi-1), for 1≤i ≤n ; n is the length of the path. If (x0, y0) = (xn, yn): A closed path. 67
  • 68.  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 CONT’D 68
  • 69.  Distance measures  Euclidean distance  City-block distance  Chessboard distance 2 1 22 ])()[(),( tysxqpDe -+- |)(||)(|),(4 tysxqpD -+- |))(||,)(max(|),(8 tysxqpD -- CONT’D 69
  • 70. mD distance: The shortest m-path between the points CONT’D 70
  • 71. For pixels p, q, and z, with coordinates (x,y), (s,t), and (v,w), respectively, D is a distance function or metric if (a) D(p,q)  0 , (b) D(p,q) = D(q,p), (symmetry) (c) D(p,z)  D(p,q) + D(q,z) (triangular inequality) Euclidean distance between p and q is De(p,q) = [ (x - s)2 + (y - t)2 ]1/2 For this distance measure, the pixels having a distance less than or equal to some value r from (x,y) are the points contained in a disk of radius r centered at (x,y). Distance Measure (Euclidean) 71
  • 72. The D4 distance (city-block) between p and q is D4(p,q) = |x – s | + |y – t | Diamond shape The D8 distance (chessboard) between p and q is D8(p,q) = max ( |x – s | , |y – t | ) 2 2 1 2 2 1 0 1 2 2 1 2 2 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 Distance Measure (City block, Chessboard) 72
  • 73. If distance depend on the path between two pixels such as m-adjacency then the Dm distance between two pixels is defined as the shortest m-path between the pixels. 0 0 1 0 1 0 1 0 0 q Dm( p , q ) = 2 0 0 1 1 1 0 1 0 0p Dm( p , q ) = 3 0 1 1 1 1 0 1 0 0 Dm( p , q ) = 4 Distance Measure of Path 73
  • 74. 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 22 )()(),( tysxqpDe -+- 74
  • 75. D4-distance (city-block distance) is defined as tysxqpD -+-),(4 1 2 10 1 2 1 2 2 2 2 2 2 Pixels with D4(p) = 1 is 4-neighbors of p. 75
  • 76. D8-distance (chessboard distance) is defined as ),max(),(8 tysxqpD -- 1 2 10 1 2 1 2 2 2 2 2 2 Pixels with D8(p) = 1 is 8-neighbors of p. 22 2 2 2 222 1 1 1 1 76
  • 77. Path A path from pixel p at (x,y) to pixel q at (s,t) is a sequence of distinct pixels: (x0,y0), (x1,y1), (x2,y2),…, (xn,yn) such that (x0,y0) = (x,y) and (xn,yn) = (s,t) and (xi,yi) is adjacent to (xi-1,yi-1), i = 1,…,n p q We can define type of path: 4-path, 8-path or m-path depending on type of adjacency. 77
  • 78. p q p q p q 8-path from p to q results in some ambiguity m-path from p to q solves this ambiguity 8-path m-path 78
  • 79. 3 1 2 1 2 2 0 2 1 2 1 1 1 0 1 2 (p) (q) Find the shortest 4-, 8-, m-path between p and q for V= {0, 1} and V={1, 2} Path Length 79
  • 80. Images are represented by Matrices, and matrix division is not defined. The following image division C = A/B means that the division is carried out between corresponding pixels in the two images A and B to form image C. Image Operation on a Pixel Basis 80
  • 81. H(af + bg) = a H( f ) + b H( g ) Linear and Nonlinear Operation 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, 81
  • 87. REFERENCES  “Digital Image Processing”, 2/ E, Rafael C. Gonzalez & Richard E. Woods, www.prenhall.com/gonzalezwoods.  Only Original Owner has full rights reserved for copied images.  This PPT is only for fair academic use. 87