Professional Documents
Culture Documents
Chapter 2 - Basic Techniques in Image Processing
Chapter 2 - Basic Techniques in Image Processing
Chapter 2 - Basic Techniques in Image Processing
2
COURSE CONTENT
3
Chapter 2:
BASIC TECHNIQUES IN
IMAGE PROCESSING
5
Chapter 2
2.1 FUNDAMENTAL OF
DIGITAL IMAGE
6
2.1.1 ELEMENTS OF VISUAL PERCEPTION
STRUCTURE OF THE HUMAN EYE
7
1.The lens contains 60-70% water, 6% of fat.
2.The iris diaphragm controls amount of light that enters the
eye.
3.Light receptors in the retina
- About 6-7 millions cones for bright light vision called
photopic
- Density of cones is about 150,000 elements/mm2.
- Cones involve in color vision.
- Cones are concentrated in fovea about 1.5x1.5 mm2.
- About 75-150 millions rods for dim light vision called
scotopic
- Rods are sensitive to low level of light and are not involved
color vision.
4. Blind spot is the region of emergence of the optic nerve
from the eye. 8
IMAGE FORMATION IN THE EYE
RGB components
10 10 16 28
9 656 7026
56 43
3756 78
32 99 54 96 67
70
15 256013 902296 67
21 54 47 42
32 158587 853943 92
54 65 65 39 13
32 65 87 99
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 14
Image Types : Index Image
Index image
Each pixel contains index number
pointing to a color in a color table
Color Table
Origin
y
f(x,y)
16
MxN numerical matrix form
(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)
(x1,y1)
(x-1,y) p (x+1,y)
(x,y1)
(x+1,y1)
(x1,y)
(x-1,y+1) (x,y+1) (x+1,y+1) (x+1,y)
N8(p) = (x1,y+1)
(x,y+1)
(x+1,y+1)
(x1,y1)
p
(x+1,y1)
ND(p) = (x1,y+1)
(x+1,y+1)
(x-1,y+1) (x+1,y+1)
21
Distance
22
Distance Measures
The Euclidean Distance between p and q is
defined as:
De (p, q) = [(x – s)2 + (y - t)2]1/2
23
Distance Measures
D4-distance (city-block distance) is defined as
D4 ( p, q) x s + y t
2 q (s,t)
2 1 2
2 1 0 1 2
2 1 2 D4
2 p (x,y)
D8 ( p, q) max( x s , y t )
q (s,t)
2 2 2 2 2
2 1 1 1 2
D8(b)
2 1 0 1 2
2 1 1 1 2 p (x,y) D8(a)
2 2 2 2 2
D8 = max(D8(a) , D8(b))
25
2.1.4 IMAGE SAMPLING AND QUANTIZATION
The output of most sensors is a continuous voltage
waveform whose amplitude and spatial behavior are
related to the physical phenomenon being sensed.
To create a digital image, we need to convert the
continuous sensed data into a digital format. This
requires two processes: sampling and quantization.
An image may be continuous with respect to the x- and
y-coordinates, and in amplitude.
To digitize it, we have to sample the function in both
26
coordinates and also in amplitude.
Digitizing the coordinate values is called sampling.
Digitizing the amplitude values is called quantization.
27
How to choose the spatial resolution
Spatial resolution = Sampling locations
Original image
Sampled image
28
Image Quantization
Image quantization:
discretize continuous pixel values into discrete numbers
Nc 2 b
29
A B A B
30
IMAGE SAMPLING
Image Formation
projection
through lens
image of object
31
Image Formation
projection onto
discrete sensor
digital camera
array.
32
Image Formation
continuous
colors, discrete
locations.
discrete real-
valued image
33
QUANTIZATION
continuous colors
mapped to a finite,
discrete set of colors.
34
Sampling and Quantization
35
Effect of Spatial Resolution
37
64 levels 32 levels
Effect of Quantization Levels (cont.)
16 levels 8 levels
In this image,
it is easy to see
false contour.
4 levels 2 levels 38
Chapter 2
39
2.2.1 COLOR FUNDAMENTALS
40
2.2.1 COLOR FUNDAMENTALS
42
2.2.1 COLOR FUNDAMENTALS
Achromatic light
Its only attribute is its intensity, or amount.
Viewers see on a black and white.
The term gray level refers to a scalar measure of intensity that
rages from black, to grays, and finally to white
44
2.2.1 COLOR FUNDAMENTALS
45
2.2.1 COLOR FUNDAMENTALS
47
2.2.1 COLOR FUNDAMENTALS
48
2.2.1 COLOR FUNDAMENTALS
49
2.2.1 COLOR FUNDAMENTALS
Characteristics of colors
Brightness
The chromatic notion of intensity
Hue
An attribute associated with the dominant wavelength in a
mixture of light waves
Representing dominant color as perceived by an observer
Saturation
Referring to relative purity or the amount of white mixed with a
hue
Saturation is inversely proportional to the amount of white light
50
2.2.1 COLOR FUNDAMENTALS
51
2.2.1 COLOR FUNDAMENTALS
Chromaticity diagram
Showing color composition as a function of x(R) and y(G)
For any value of x and y, z(B) = 1 – (x + y)
The positions of the various spectrum colors are indicated
around the boundary of the tongue-shaped
The point of equal energy = equal fractions of the three
primary colors = CIE standard for white light
Boundary : completely saturated
Useful for color mixing
A triangle(RGB) does not enclose the entire color region
53
2.2.2 COLOR MODELS
54
2.2.2 COLOR MODELS
55
2.2.2 COLOR MODELS
56
2.2.2 COLOR MODELS
57
2.2.2 COLOR MODELS
Usefulness
The intensity is decoupled from the color information
60
2.2.2 COLOR MODELS
Hue and saturation in the HSI color model. The dot is any color point. The
angle from the red axis gives the hue. The length of the vector is the
saturation. The intensity of all colors in any of these planes is given by the
position of the plane on the vertical intensity axis.
62
2.2.2 COLOR MODELS
2 THE HSI COLOR MODELS
B I (1 S )
S cos H
R I 1 +
cos(60 o
H )
G 3I ( R + B )
66
2.2.2 COLOR MODELS
4 CONVERTING COLOR FROM HSI TO RGB
GB sector (120 H 240 ) BR sector (240 H 360 )
H H 120o H H 240o
R I (1 S ) G I (1 S )
S cos H S cos H
G I 1 + B I 1 +
cos(60 o
H ) cos(60 o
H )
B 3I ( R + G ) R 3I (G + B)
67
2.2.2 COLOR MODELS
4 CONVERTING COLOR FROM HSI TO RGB
Example
The HSI values
corresponding to
the image of the
RGB color cube
68
2.2.2 COLOR MODELS
4 CONVERTING COLOR FROM HSI TO RGB
Manipulating HSI component images
69
2.2.2 COLOR MODELS
4 CONVERTING COLOR FROM HSI TO RGB
70
2.2.3 PSEUDOCOLOR IMAGE PROCESSING
1. Intensity Slicing
Intensity slicing can be expressed by the
following equation
f ( x, y ) ck if f ( x, y ) Vk
72
2.2.3 PSEUDOCOLOR IMAGE PROCESSING
73
2.2.3 PSEUDOCOLOR IMAGE PROCESSING
74
2.2.3 PSEUDOCOLOR IMAGE PROCESSING
75
2.2.3 PSEUDOCOLOR IMAGE PROCESSING
76
2.2.3 PSEUDOCOLOR IMAGE PROCESSING
77
2.2.4 BASICS OF FULL-COLOR IMAGE
PROCESSING
cR ( x, y ) R ( x , y )
c( x, y ) cG ( x, y ) G ( x, y )
cB ( x, y ) B ( x, y )
78
2.2.4 BASICS OF FULL-COLOR IMAGE
PROCESSING
79
2.2.5 COLOR TRANSFORMATIONS
1. FORMULATION
si kri + (1 k ), i 1,2,3.
81
2.2.5 COLOR TRANSFORMATIONS
A full-color
image and its
various color-
space
components.
83
2.2.5 COLOR TRANSFORMATIONS
(b)
(a)
2. COLOR COMPLEMENTS
Complements : the hues directly opposite one another
on the color circle.
Color complements are useful for enhancing detail that is
embedded in dark regions of a color image.
Color
complements on
the color circle.
2.2.5 COLOR TRANSFORMATIONS
Color
complement
transformations.
(a) Original image.
(a) (b) (b) Complement
transformation
functions.
(c) Complement
of (a) based on
the RGB mapping
functions.
(d) An approximation
(c) of the RGB
(d) complement using
HIS transformations.
2.2.5 COLOR TRANSFORMATIONS
3. COLOR SLICING
W
0.5 , if rj a j , i 1, 2, , n
si 2 any 1 j n
r , otherwise
i
si
0 . 5 , if
j 1
( r j a j ) 2
R0 , i 1, 2, , n
2
r , otherwise
i
2.2.5 COLOR TRANSFORMATIONS
89
2.2.5 COLOR TRANSFORMATIONS
(a) (b)
Color-slicing transformations that detect (a) reds within an RGB cube of
width W = 0 2549 centered at (0.6863, 0.1608, 0.1922), and (b) reds within
an RGB sphere of radius 0.1765 centered at the same point. Pixels
outside the cube and sphere were replaced by color (0.5, 0.5, 0.5).