Académique Documents
Professionnel Documents
Culture Documents
learn basic theories and methods of image processing easy to use image processing software and equipments can develop software and hard ware of image processing establish foundation for further research
Digital Image Processing Dr.Rong Zhang 2
References: Books
KRCastleman Digital Image Processing , R. C. Gonzales , Digital Image Processing Second Edition
Digital Image Processing Dr.Rong Zhang 3
: R. C. Gonzales
Chapter1: Introduction Chapter2: Fundaments of Image and Vision Chapter3: Image Transforms Chapter4: Image Enhancement Chapter5: Image Restoration and Reconstruction Chapter6: Image Coding Chapter7: Image Segmentation Chapter8: Object Representation and description
Digital Image Processing Dr.Rong Zhang 4
References: Journals
Digital Image Processing Dr.Rong Zhang 5
References: Journal
IEEE Transactions on
Image Processing Signal Processing Medical Image Geoscience and Remote Sensing Pattern analysis and machine intelligence
Chapter1 Introduction
1.1 What Is Digital Image Processing 1.2 The Origins of Digital Image Processing 1.3 Example of Fields that Use Digital Image Processing 1.4 Fundamental Steps in Digital Image Processing 1.5 Components of an Image Processing System
162 162 163 159 155 156 157 158 156 155
161 161 158 157 157 157 156 157 155 155
159 159 159 159 156 155 156 155 156 157
161 161 159 156 156 151 156 155 153 154
162 162 160 159 158 157 156 156 156 157
160 160 158 159 157 156 156 155 155 155
158 158 155 154 156 155 154 155 156 157
156 156 155 152 155 156 156 155 155 158
156 156 156 155 154 156 155 155 154 158
161 161 158 153 156 154 155 155 156 158
gray image
64 63 75 120 135 55
95 157 99 75 116 67
Color image
71 31 10 62 33 23 31 46 36 48 57 35 46 73 33 24 46 34 29 51 30 28 54 36 42 40 48 46 42 43
10
39 46 52 29 39 69
Video video
11
Scale enlargement
35120 colors
94 colors
18
19
21
Medical application:
Time: 1970s System: CT, X-ray
22
Gamma-Ray Imaging X-Ray Imaging Imaging in the Ultraviolet Band Imaging in the Visible and Infrared Bands Imaging in the Microwave Band Imaging in the Radio Band Example in Which Other Modalities Are Used
Digital Image Processing Dr.Rong Zhang 24
26
29
30
CCD
32
33
34
Mustek PowerPro
Digital Camera
Max resolution Low resolution Image ratio w:h Effective pixels Sensor size Sensor type Colour filter array
Olympus u300
Max shutter
Digital Image Processing Dr.Rong Zhang
37
Look Up Table
1 2 3 4 5 6 7 8
1 4 9 16 25 36 49 64
LUT
D/A
LUT
D/A
38
DAC
39
42
43
Pixel Processing
512 x 512, 8-bit images.
Neighborhood operations
convolution (3x3) convolution (5x5) convolution (7x7) convolution (9x9) convolution (13x13) median Filter laplacian/sobel histogram histogram equalization erosion
1.3 mSecs 2.6 mSecs 2.6 mSecs 5.2 mSecs 10.5 mSecs 2.6 mSecs 2.6 mSecs 1.3 mSecs 2.6 mSecs 1.0 mSecs
Statistical operations
Morphology
44
46
Cobra/C6
200 MHz Operating Frequency 64k of high speed on-die cache memory 800 Mbytes/sec I/O bandwidth 1.6 Gigabyte/sec on-chip transfer rates Executes up to eight instructions simultaneously Integrated on-chip host port for control Six 32/40 bit ALUs Two 16 bit single cycle multipliers VLIW simplifies parallel programming
Digital Image Processing Dr.Rong Zhang 47
48
49
Frame Buffer
11111111 00000000 00000000 00000000 11111111 00000000 00000000 00000000 11111111 00000000 00000000 00000000
51
52
Dot Matrix of I
Dot Matrix of R
53
Dither Technique
Digital Image Processing Dr.Rong Zhang 54
Ink-jet Printer
55
1.5.5 Software
Photoshop PhotoshImpact Corel Custom Photo MS PhotoDraw Fireworks ACDSee
56
57
58
Shape: nearly a sphere, diameter=20mm Components: cornea(), sclera(), choroid(), retina(), lens, fovea(), blind spot(), nerve ()and sheath().
59
Fovea area: 1.5mm*1.5mm Density of cones: 15000/mm2 Cones in fovea: 337 000
Digital Image Processing Dr.Rong Zhang 60
61
d (ln I ) = dI / I
Definitions of Contrast:
Cp = (I1 I )/ I = I / I
CI = I max / I min
Weber Ratio=0.02=2%
Digital Image Processing Dr.Rong Zhang 62
Although all the center squares have the same intensity,they appear to the eye to become darker as the background gets lighter.
Digital Image Processing Dr.Rong Zhang 63
64
S = k B / B
'
S = k ' ln B + k0 = k lg B + k0
65
66
H (u , v) = G (u , v) / F (u , v)
| H (u , v) |=| G (u, v) | / | F (u , v) |
Digital Image Processing Dr.Rong Zhang 67
68
69
70
71
72
C = X [ R ] + Y [G ] + Z [ B ]
Eg: Red=1[R]+0[G]+0[B] Yellow=1[R]+1[G]+0[B] Cyan=0[R]+1[G]+1[B] Magenta=1[R]+0[G]+1[B] Black=0[R]+0[G]+0[B] White=1[R]+1[G]+1[B]
73
X x= X +Y + Z
Y y= X +Y + Z
x + y + z =1
Z z= X +Y + Z
75
76
77
H 0 120 240 0 0
S 1 1 1 0 0
78
S
Digital Image Processing Dr.Rong Zhang
I
79
80
1 I = ( R + G + B) 3
3 S = 1 [min( R, G, B )] ( R + G + B)
(2.3.5)
(2.3.6)
(2.3.7)
81
B = I (1 S ) S cos H R = I 1 + cos(60 H )
G = 3I ( B + R )
Digital Image Processing Dr.Rong Zhang
R = I (1 S )
S cos ( H 120) G = I 1 + cos(180 H )
B = 3I ( R + G )
Digital Image Processing Dr.Rong Zhang
G = I (1 S )
R = 3I (G + B)
d
r1d dr d cd 1 cd = lm/sr
I=
85
dS' dS
cd/m2
86
0 < f ( x, y ) <
f(x,y) can be characterized by two components called the illumination and reflectance components which are denoted by i(x,y) and r(x,y).
f ( x, y ) = i ( x, y ) r ( x, y )
where
0 < i ( x, y ) <
0 < r ( x, y ) < 1
Digital Image Processing Dr.Rong Zhang 87
(XYZ)
O
(x,y)
z,Z
2.5.1
88
X x= Z
Y y= Z
89
w = [X Y Z ]
its homogeneous coordinates is
wh = [kX
1 0 p= 0 0
kY
0 0
kZ k ]
0 1 0 0 0 1 0 0 1 1
Digital Image Processing Dr.Rong Zhang 90
1 0 ch = Pwh = 0 0
0 0 1 0 0 1 0 1
0 kX kX kY 0 kY = 0 kZ kZ 1 + kZ k k
c = [x
z]
X = Z
Y Z
Z Z
91
wh = P ch
0 0 1 0 1 1 0 0
1 0 1 P = 0 0
0 1 0 0
92
ch = [kx' ky ' 0 k ]
wh = [kx' ky ' 0 k ]
Y Z ] = [x'
T
w = [X
y ' 0]
93
Y=
y'
( Z )
ch = [kx' ky ' kz k ]
w = [X Y Z]
T
( Z )
wh = kx' ky ' kz
T
kz
+ k
x ' = + z
y ' +z
z + z
94
y ' Y= +z z Z= +z
x ' X= +z
X=
x'
y'
( Z )
Y=
( Z )
95
96
We often use a more traditional matrix notation to denote a digital image and its elements.
a0,0 a 1,0 A= M a M 1,0 a0,1 a1,1 M a M 1,1 L L a0, N 1 a1, N 1 M a M 1, N 1
Clearly,
aij = f (i, j )
Digital Image Processing Dr.Rong Zhang 97
A[M][N] M*N
A[i][j]
98
Bits/pixel 1 8 24
99
Binary Image
Gray Image
Color Image
100
j = 0,1,K N 1
101
Name
raw data format Bit-mapped format Tagged file format
type
*.dat, *.raw *.bmp *.tif
usage
Dos, UNIX and Macintosh image Microsoft Windows format Dos, UNIX and Macintosh image
102
113
112
Digital Image Processing Dr.Rong Zhang
100
103
104
Length Name
2 4 2 2 4 bfType bfSize bfReserved1 bfReserved2 bfOffBits
Description
BM Size of file 0 0 Offset after file head
105
Length Name
4 4 4 2 2 4 4 biSize biWidth biHeight biPlanes biBitCount biCompression bfSizeImag
Digital Image Processing Dr.Rong Zhang
Description
Size of bitmap head, 40 Width of Image Height of Image Always 1 Bits/pixel, 1,4,8 or 24 Size of compressed file Offset after file head
106
Length
4 4 4 4 4*N
Name
Description
biXPelsPerMeter Resolution in horizon direction biYPelsPerMeter Resolution in vertical direction biClrUsed biClrImportant bmiColors Color number used Important colors number Color Mapping table
107
Length
1 1 1 1
Name
rgbBlue rgbGreen rgbRed rgbReserved
Description
Value of blue Value of green Value of red 0
108
rgbBlue
0 1 . . . 255
rgbGreen
0 1 . . . 255
rgbRed
0 1 . . . 255
109
Tag points
G=2
M =2
N =2
b = M N k
When M=N :
b=N k
2
Digital Image Processing Dr.Rong Zhang 111
112
113
( x, y 1)
( x 1, y ) ( x, y ) ( x + 1, y ) 0 ( x, y + 1) 0
114
N D ( p)
(x 1, y 1) 0 (x 1, y +1)
N D ( p ) together with of p,denoted by N8 ( p )
0 (x, y) 0
115
0 1 1 0 1 0 0 0 1
0 0 0
1 L 1 P M N 1 O 0 1 0
0 0 0
1 L 1 M 1 O 0 1 0
T
0 1 1 0 1 0 1 0 0 0 0 0
1 0 1 00 0 1 1 00 0 0 1 01 0 1 0 10
118
S
1 0 0 0 0 1 0 1
q
1 1 1 0 0 0 0 1
T
0 0 1 1 0 0 1 0 1 1 0 0 0 0 0 0
119
For pixels p,q and z ,with coordinates (x,y),(s,t),and(u,v),respectively, D is a distance function or metric if (a) D( p, q ) 0 ( D( p, q) = 0, if p = q) (b) D ( p, q ) = D( q, p ), and (c) D ( p, z ) D( p, q ) + D (q, z )
120
De ( p, q ) = [( x s ) 2 + ( y t ) ]
1 2 2
D8 ( p, q) = max( x s , y t ) The Dm distance is defined as the shortest mpath between the points.
Digital Image Processing Dr.Rong Zhang 121
122
1(q ) 1
M 1( p )
0
N L 1
1(q )
0
N
1( p ) Dm ( p, q ) = 2 1 L 1(q ) 0
N M 1
Dm ( p, q ) = 3 1 L 1(q ) 1
M 1( p ) M L 1
1( p ) Dm ( p, q ) = 3
Dm ( p, q ) = 4
Digital Image Processing Dr.Rong Zhang 123
Problem: consider the image segment shown Let V={0,1} and compute the lengths of the shortest 48- and m-path between p and q. if a particular path does not exist between these two points, explain why.
0 1 2 1 2 2 0 2 2 3 1 1 1 0 1 2
p
124
0 2 2 1
1 2 3 0
2 0 1 1
1 2 1 2
a)
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 4adjacent and also have values from V .
b) The shortest 8-path is shown in right Figure, its length (shown magenta) is 4. The length of shortest m-path (shown blue) is 5.
0 2 2 1
1 2 3 0
2 0 1 1
1 2 1 2
125
126
NOT(S)
(S)AND(T)
(S)OR(T)
(S)XOR(T)
[NOT(S)] AND(T)
2.8.1
127
B( x, y ) = f ( A( x, y )) B( x, y ) = f ( A( x s, y t )) s = 0,1,K S 1 t = 0,1,KT 1
Usually, S=T=1,3,5,7
128
1 1 z = ( z1 + z2 + L + z9 ) = zi 9 9 i =1
z = w1 z1 + w2 z2 + wn zn =
i =1
z1 z 2 z 3 ...z4 z5 z6 ... wi zi z7 z8 z9
(a) 2.8.2
... ...
w1 w2 w3 w4 w5 w6 w7 w8 w9
(b)
129
summary
Basic idea of the eye in perceiving pictorial information Color fundamentals and color models Fundamentals of images, include presentation, read, write display, sampling and quantization, relationship between pixels, and so on.
130
131
H (u , v)
F (u , v) H (u, v)
IDFT
Postprocessing
f ( x, y )
g ( x, y )
132
and analysis this chapter deals with two-dimensional transforms and their properties image transforms are used in image enhancement, restoration, reconstruction, encoding and description
Digital Image Processing Dr.Rong Zhang 133
134
F (u ) =
f ( x) =
f ( x )e
j 2 ux
dx
F (u )e j 2 xu du
135
F (u ) = f ( x)e
1 f ( x) = N
N 1
u = 0,1,L N 1
F (u )e
u =0
2 ux N
x = 0,1,L N 1
136
F (u ) = R(u ) + jI (u )
or
F (u ) = F (u ) exp[ j (u )]
Eulers formula:
F (u ) = R (u ) + I (u )
2 2
(u ) = arctan[I (u ) R(u )]
P(u ) = F (u ) = R 2 (u ) + I 2 (u )
2
138
139
| F (0) |= 3.25
| F (1) |= [(2 / 4) 2 + (1/ 4) 2 ]1/ 2 = 5 / 4
| F (2) |= [(1/ 4) 2 + (0 / 4) 2 ]1/ 2 = 1/ 4
|F(u)|
(u)
0 1 2 3x
-0.85 0 -0.85 0
u
1 2 3
141
F (u , v) =
x =0
M 1
y =0
N 1
f ( x, y )e j 2 (ux / M + vy / N )
N 1 v=0
v = 0,1,L N 1
u = 0,1,L M 1
1 M 1 f ( x, y) = MN u=0
j 2 (ux / M +vy / N ) ( , ) F u v e
y = 0,1,L N 1
x = 0,1,L M 1
142
F (u , v) = R (u, v) + I (u, v)
2 2
12
143
image
Magnitude
Phase
144
145
146
D1 (u , v ) = log(1 + F (u , v ) )
Or
instead of
F (u , v)
Digital Image Processing Dr.Rong Zhang 147
1 f ( x, y ) = N
148
3.2.2 21-D2-D
149
150
F (u, v) = F (u , v)
Or more interestingly,
F (u , v) = F (u, v)
Digital Image Processing Dr.Rong Zhang 151
f ( x, y ) exp[ j 2 (u0 x + v0 y ) N ] F (u u0 , v v0 )
and
152
153
f ( x, y )(1) x + y F (u N / 2, v N / 2)
154
f (r , + 0 ) F ( w, + 0 )
155
156
F { f1 ( x, y ) + f 2 ( x, y )} = F { f1 ( x, y )}+ F { f 2 ( x, y )}
And, in general that,
F { f1 ( x, y ) f 2 ( x, y )} F { f1 ( x, y )} { f 2 ( x, y )}
157
and
f (ax, by ) 1 u v F , ab a b
158
1 f ( x, y ) = 2 N
f ( x, y)
x =0 y =0
~
N 1 N 1
f ( x, y)
x =0 y =0
N 1 N 1
1 f ( x, y ) = F (0,0) N
159
f ( x) g ( x) =
f ( z ) g ( x z )dz
160
1/2 z
f(z)g(x-z)
f(x)*g(x)
z 0 x-1 1 x
1/2 0 1 (g) 2
(f) 1-D
161
g(,)
g(-,-)
g(x-, y-)
f(,)
162
B+N-1
y
f(,) *g(x-, y-)
f(x,y)*g(x,y)
163
f ( x, y ) g ( x, y ) F (u , v) G (u , v)
164
0 x A 1
A x M 1
0 x B 1
B x M 1
f ( m) g ( x m)
e e
x=0,1,,M-1
165
0 y B 1
B y N 1
A x M 1 or
0 x C 1 and 0 y D 1 g ( x, y ) g e ( x, y ) = C x M 1 0 or D y N 1
1 f e ( x, y ) g e ( x, y ) = MN
M 1 N 1 m =0 n =0
f (m, n) g ( x m, y n)
e e
x = 0,1,..., M 1
y = 0,1,..., N 1
166
f ( x) o g ( x) =
f ( z ) g ( x + z )dz
1 f e ( x) o g e ( x) = M
M 1 m =0
f e ( m) g e ( x + m)
x = 0,1,..., M 1
167
f ( x , y ) o g ( x, y ) =
f ( p, q)g ( x + p, y + q)dpdq
f e (m, n) g e ( x + m, y + n)
x = 0,1,..., M 1
y = 0,1,..., N 1
168
169
polynomial expression
t0, N 1 x0 x L t1, N 1 1 M O L t N 1, N 1 x N 1 L
Y = TX
matrix expression
Digital Image Processing Dr.Rong Zhang 170
171
F = Tf
f = T 1 F
T 1 = T t
1 f ( x) = N
F (u )e
u =0
N 1
2 ux N
It is a Unitary transform
Digital Image Processing Dr.Rong Zhang 172
(i, j , m, n) Can be thought of as a MN-by-MN block matrix have M rows of M blocks, each of which is an N-by-N matrix
173
j =0
N 1
xi , jTc ( j , n) ] Tr (i, m)
174
j =0
N 1
xi , jT ( j , n) ] T (i, m)
or
Y = TXT
Digital Image Processing Dr.Rong Zhang 175
lets
WM = exp( j 2 / M ) WN = exp( j 2 / N )
then
176
L L L O
( M 1) 2( M 1) L WM WM
( M 1) WM 2( M 1) WM M ( M 1)2 WM
0 WM
f (0, 0) f (1, 0) M f ( N 1, 0)
f (0,1) f (1, 0) M
L L O
f ( N 1, 0) L
L L L O L
WN ( N 1) WN2( N 1) M 2 WN ( N 1)
0 WN
177
G=WM FWN
And the inverse is:
F =W GW
1 M
1 N
178
( M 1) 2( M 1) WM WM
0 WN L ( N 1) L WN L WN2( N 1) O M L W ( N 1)2 N
179
(2 x + 1)u f ( x) cos 2N
x=0,1,N-1 u=0,1,N-1
(2 x + 1)u f ( x) = a (u )C (u ) cos 2N u =0
where
1N a(u ) = 2 N
M O cos 3( N 1) / 2 N L
181
u,v=0,1,N-1
(2 x + 1)u (2 y + 1)v f ( x, y ) = a (u )a (v)C (u , v) cos cos 2N 2N u =0 v =0
N 1 N 1
x,y=0,1,N-1
Digital Image Processing Dr.Rong Zhang 182
184
n1i ( u )
x =0
N 1
f ( x ) (1)bi ( x ) bn1i (u )
i =0
n 1
Where bk(z) is the kth bit in the binary representation of z. Eg: n=3, z=6 (110 in binary), we have that b0(z)=0, b1 (z)=1, and b2(z)=1
Digital Image Processing Dr.Rong Zhang 185
0 1 2 3 4 5 6 7
+ + + + + + + +
+ + + + -
+ + + + -
+ + + +
+ + + + -
+ + + +
+ + + +
+ + + + -
186
n 1
f ( x) = W (u ) (1)bi ( x ) bn1i ( u )
u =0
187
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
188
0 1 2 3 4 5 6 7
+ + + + + + + +
+ + + + -
+ + + + -
+ + + +
+ + + + -
+ + + +
+ + + +
+ + + + -
0 1 3 2 7 6 4 5
189
the row
0 1 2 3 4 5 6 7
+ + + + + + + +
+ + + + -
+ + + +
+ + + + -
+ + + -
+ + + + +
+ + _
+ +
+ + -
+ +
0 1 2 3 4 5 6 7
190
f ( x, y) (1)
x =0 y =0 i =0
N 1 N 1
n 1
[ bi ( x ) bn1i ( u ) + bi ( y ) bn1i ( v )]
1 f ( x, y ) = N
W (u, v) (1)
u =0 v =0 i =0
N 1 N 1
n 1
[ bi ( x ) bn1i ( u ) + bi ( y ) bn1i ( v )]
191
g ( x, y, u, v) = g1 ( x, u ) g1 ( y, v) = h1 ( x, u )h1 ( y, v)
So it can be implemented in two steps
192
Where the summation in the exponent is performed in modulo 2 1-D Hadamard transform of a function f(x), denote by H(u), is:
1 H (u ) = N
x =0
N 1
f ( x)(1) i=0
bi ( x )bi (u )
n 1
194
bi ( x ) bi ( u )
n 1
f ( x) = H (u )(1) i=0
u =0
bi ( x ) bi ( u )
n 1
195
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
196
0 1 2 3 4 5 6 7
+ + + + + + + +
+ + + + -
+ + + + -
+ + + +
+ + + + -
+ + + +
+ + _
+ -
+ + + -
+ +
0 7 3 4 1 6 2 5
197
And for successively larger N, these can be generated from The block matrix from
H2N H N = H N HN = H2 H N H N
199
1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1
1 1 1 1
1 1
200
1 g ( x, u ) = (1) i=0 N
p0 (u ) = bn 1 (u )
bi ( x ) pi ( u )
n1
where
p1 (u ) = bn 1 (u ) + bn 2 (u ) M pn 1 (u ) = b1 (u ) + b0 (u )
h( x, u ) = (1) i=0
Digital Image Processing Dr.Rong Zhang
bi ( x ) pi ( u )
201
n1
0 1 2 3 4 5 6 7
+ + + + + + + +
+ + + + -
+ + + +
+ + + + -
+ + + -
+ + + + +
+ + _
+ +
+ + -
+ +
0 1 2 3 4 5 6 7
202
1 H (u ) = N
x =0
N 1
f ( x)(1) i=0
n1
bi ( x ) pi ( u )
f ( x) = H (u )(1) i=0
u =0
N 1
n 1
bi ( x ) pi ( u )
203
1 g ( x, y, u, v) = (1) i=0 N
[ bi ( x ) bi ( u )+bi ( y ) bi ( v )]
Both the direct and inverse kernel function are Separable and Symmetric, because
g ( x, y, u, v) = g1 ( x, u ) g1 ( y, v) = h1 ( x, u )h1 ( y, v)
204
1 H (u , v) = N
f ( x, y)(1)
x =0 y =0
N 1 N 1
[ bi ( x ) bi ( u )+bi ( y ) bi ( v )]
i =0
n1
1 f ( x, y ) = N
i =0 ( , )( 1) H u v
N 1 N 1 x =0 y =0
[ bi ( x ) bi ( u )+bi ( y ) bi ( v )]
n1
205
1 g ( x, y, u, v) = h( x, y, u, v) = (1) i=0 N
1 H (u, v) = N
1 f ( x, y ) = N
f ( x, y)(1)
x =0 y =0
N 1 N 1
i =0
n1 [ b ( x ) p ( u )+b ( y ) p ( v )] i i i i
i =0 ( , )( 1) H u v
N 1 N 1 x =0 y =0
n1 [ b ( x ) p ( u )+b ( y ) p ( v )] i i i i
207
k = 2 + q 1
p
Where 2p is the largest power of 2 such that 2 p k and q-1 is The remainder For example, k=1=20+1-1, k=23=24+8-1, k=100=26+37-1,
Digital Image Processing Dr.Rong Zhang
h0 ( z ) = h00 ( z ) = 1
2 p 2 1 p2 hk ( z ) = hpq ( z ) = 2 N 0
z [0,1]
q 1 2 2p
p
z<
q 1 2 2p q
q 1 2
z<
2p
others
210
h0 ( N 1/ N ) L h1 ( N 1/ N ) O M K hN 1 ( N 1/ N ) L
211
h0 (0 / 2) = h00 (0 / 2) =
k=0 k=1
1 1 1 H2 = 2 1 1
1 H8 = 8
1 1 2 0 2 0 0 0
1 1 2 0 2 0 0 0
1 1 2 0 0 2 0 0
1 1 2 0 0 2 0 0
1 1 0 2 0 0 2 0
1 1 0 2 0 0 2 0
1 1 0 2 0 0 0 2
1 1 0 2 0 0 0 2
213
CN =
1 1 1 1 w8 = 1 1 1 1
1 1 1 1 1 1
1 1
1 1 1
1 1 1 1
1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1
1 H8 = 8
1 1 2 0 2 0 0 0
1 1 2 0 2 0 0 0
1 1 2 0 0 2 0 0
1 1 2 0 0 2 0 0
1 1 0 2 0 0 2 0
1 1 0 2 0 0 2 0
1 1 0 2 0 0 0 2
1 1 0 2 0 0 0 2
214
G = HF
F = H 1G
1 1 2 0 0 2 0 0 1 1 2 0 0 2 0 0 1 1 0 2 0 0 2 0 1 1 0 2 0 0 2 0 1 1 0 2 0 0 0 2 1 f0 f 1 1 0 f2 2 f3 0 f4 0 f5 f 0 6 f7 2
215
image
Haar transform
217
1 1 1 S2 = 2 1 1
L L L M I ( N / 2) 2 M L L L M 0 M
1 aN
L L L M I ( N / 2) 2 M
L 0
M M M 0 0 SN / 2 M L L M I ( N / 2) 2 M M L L L L L M M 0 M L L 0 M SN / 2 M I ( N / 2) 2 M M
218
N2 4 bN = 2 4( N 1)
12
220
x = x
k
k 0
k 1
L x
T k N 1
C x = E{( x mx )( x mx )T }
where
mx = E{x}
Digital Image Processing Dr.Rong Zhang 223
and
1 M 1 k Cx = ( x mx )( x k mx )T M k =0 1 M 1 k k T T = x x m x mx M k =0
224
[Cx i I ]Ti = 0
T0T T T1 A= M T TN 1
X = AT Y + mx
225
[Cx i I ]Ti = 0
T0T T T1 A= M T TN 1
CxTi = iTi Cx AT = AT
where
0 = 0
0 O N 1
226
my = 0
The covariance matrix of the Y vector is given by
AA = I
T
C y = ACx AT = AAT =
0 1 2 Cy = O N 0
Cx AT = AT
A =A
and
X = A Y + mx
T
If we form A from K eigenvectors corresponding to the largest eigenvalues as AK, the recovered vector will be
T X = AK Y + mx
It can be shown that the mean square error, ems, between X is given by the expression and X
ems = j j = j
j =0 j =0 j=K
Digital Image Processing Dr.Rong Zhang 229
N 1
k 1
N 1
x0
Digital Image Processing Dr.Rong Zhang 230
x = x
k
k 0
x
k 1
k=0,1, 26
1 25 mx = xk = [ 4.444 4.2963] 27 k =0
1 25 T ( )( ) Cx = x m x m i x i x 27 k =0 3.4103 3.2479 = 3.2479 4.7550
Digital Image Processing Dr.Rong Zhang 231
Cx I = 0
3.4103 3.2479
3.2479 4.7550
=0
0 = 7.3993 1 = 0.7659
let [C x i I ] Ti = 0
0.6314 0.7755 T0 = T = 1 0.6314 0.7755
y = A( x mx )
Digital Image Processing Dr.Rong Zhang 232
x1
y1
y0
x0
233
Summary
Basic function Sinusoidal transforms (a) Discrete Fourier Transform (b) Discrete Cosine Transform (c) Discrete Sine Transform (d) Hartly Transform
e = cos + i sin
cos sin cos + sin
234
Summary
Rectangular wave transforms (a) Hadamard Transform (b) Walsh Transform (c) Slant Transform (d) Haar Transform
235
Summary
Eigenvector-based transforms (a) Hotelling Transform (K-LT) (b) SVD Transform
236
237
238
g ( x, y ) = T [ f ( x i, y j )] i, j = 0, 1, 2L
where T is a operator on f, defined over some neighborhood of (x,y) when the neighborhood is of size 1*1,( a single pixel), we define
r = f ( x, y )
and
s = g ( x, y )
Point operator
s = T (r )
Digital Image Processing Dr.Rong Zhang
240
p ( sk ) = nk / n
k = 0,1,L , L 1
Where sk is the the kth gray level and the nk is the number of Pixels in the image having gray level sk apparently
p( s ) = 1
k =0 k
Digital Image Processing Dr.Rong Zhang 241
L 1
242
243
s = T (r ) = ar + b r [ A, B] s [C , D]
D C BC AD s= r+ B A B A
255
s = 1.7 r 122.2
245
d c
246
s = c log(1 + r )
247
Where
s = cr
248
0 r 1
We hope the Probability Density Function (PDF) of s is Inverse transform exist and, if r1 < r2 then s1 < s2 T (r ) satisfies the following conditions: (a) is single-valued and monotonically in the interval 0 r 1 (b) 0 s 1 for 0 r 1 s has the same range as the r
Digital Image Processing Dr.Rong Zhang 249
ps ( s ) = 1
ds pr (r ) = dr ps ( s ) ps ( s ) = 1
s = pr ( x)dx
0
namely T (r ) = r pr ( x)dx
0
250
nj n
k = 0,1, 2,..., L 1
251
s
k = 0,1, 2L L 1
Histogram equalization z
vk = G ( zk ) = pz ( zi )
i =0 k
v
k = 0,1, 2L L 1
let
vk = sk
then
zk = G 1 (vk ) = G 1 ( sk ) = G 1 (T (rk ))
252
8bit
. . . . . . . .
0
Digital Image Processing Dr.Rong Zhang
253
254
: f ( x, y ) noise: ( x, y ) g ( x, y ) = f ( x, y ) + ( x, y )
1 g (x, y) = K
Averaging:
i=1
gi(x, y)
E{g ( x, y )} = f ( x, y )
2 g ( x, y ) =
1 2 ( x, y ) K
g ( x, y ) =
1 K
( x, y )
255
256
257
Mask coefficients
w(-1,1)
w(0,-1)
w(0,0)
w(0,-1)
w(1,-1)
w(1,0)
w(1,1)
mask
f(x-1,y-1) f(z-1,y) f(x-1,y+1)
f(x,y)
f(x,y-1) f(x,y) f(x,y+1)
f(x+1,y-1)
f(x+1,y)
f(x+1,y+1)
258
g ( x, y ) =
i = a j = b
w(i, j ) f ( x + i, y + j )
Digital Image Processing Dr.Rong Zhang 259
positive
x 0 (b)
0 (a)
260
1 9
1 1
1 16
261
262
263
g ( x, y ) =
i = a j = b
w(i, j ) f ( x + i, y + j )
g ( x , y ) - f ( x, y ) > T others
g ( x, y ) ( x, y ) = g f ( x, y )
264
265
266
min
267
min { f ( x + i, y + j )}]
268
X=[4 5 9 5 4] [4 4 5 5 9] [4 5 5 5 4]
269
g ( x, y ) = median{ f ( x + i, y + j )}
( i , j = 0, 1L)
271
1 g ( x, y ) = N 2
N i=
272
formulate
g ( x, y ) = h ( x , y ) * f ( x, y ) G (u , v) = H (u , v) F (u , v)
where
1 if H (u , v) = 0 if
D(u, v) = [(u M / 2) + (v N / 2) ]
Digital Image Processing Dr.Rong Zhang
273
PT = P(u , v) = F (u , v)
u =0 v =0 u =0 v =0
M 1 N 1
M 1 N 1
= 100 P(u, v) / PT
u =0 v =0
M 1 N 1
274
275
1 H (u , v) = 2n 1 + [ D(u , v) / D0 ]
where
D(u, v) = [(u M / 2) + (v N / 2) ]
2
2 1/ 2
276
277
H (u , v ) = e
where
D 2 ( u , v ) / 2 D0 2
D(u, v) = [(u M / 2) + (v N / 2) ]
2
2 1/ 2
278
279
Origin
Ideal filter
Origin
Ideal filter
Origin
Ideal filter
283
284
(2) Second-order derivative : Laplacian LoG (3) High-pass filter in frequency domain : Idea high-pass filter (IHPF) Butterworth high-pass filter (BHPF) Gaussian high-pass filter (GHPF)
285
287
Magnitude:
f f f = + x y
2 2
f f f + x y
Direction:
Gy ( x, y ) = tan Gx
1
f f f max , y x
288
y, j
f Gy = = f ( x, y + 1) f ( x, y ) y
x, i
289
F(u)
f(x)
0 (c)
u
0 (d)
290
f ( x, y )
g ( x , y ) = f
Prewitt operator
1 1 1 Gx = 0 0 0 1 1 1
1 Gx = 0 2 0 1 0
Sobel operator
1 2 1
292
2 1 0 0 1 2 1 2 1 G1 = 1 0 1 G2 = 0 0 0 G3 = 1 0 1 0 1 2 2 1 0 1 2 1
1 2 1 2 1 0 0 1 2 G5 = 1 0 1 G6 = 0 0 0 G7 = 1 0 1 0 1 2 1 2 1 2 1 0
1 0 1 G4 = 2 0 2 1 0 1
f max {Gi }
i = 0,1...7
Digital Image Processing Dr.Rong Zhang
G3 G4 G5
G2 G1 G0 G7 G6
293
f max {Gi }
i = 0,1...7
Digital Image Processing Dr.Rong Zhang
G3 G4 G5
G2 G1 G0 G7 G6
294
where
2 f = f ( x + 1, y ) + f ( x 1, y ) 2 f ( x, y ) 2 x
2 f = f ( x, y + 1) + f ( x, y 1) 2 f ( x, y ) 2 y
namely
2 f = [ f ( x + 1, y ) + f ( x 1, y ) + f ( x , y + 1) + f ( x , y 1) 4 f ( x , y )]
Digital Image Processing Dr.Rong Zhang 295
296
297
h(r ) = e
r = x2 + y 2
Laplacian sharpening
r h( r ) = e 4
2 2 2
r2 2 2
298
299
original
Sobel
LoG
300
0 if H (u , v) = 1 if
301
302
1 H (u , v) = 2n 1 + [ D0 / D(u , v)]
303
304
H (u , v) = 1 e
D 2 ( u , v ) / 2 D02
305
306
let
z ( x, y ) = ln f ( x, y ) = ln i ( x, y ) + ln r ( x, y )
307
308
309
f ( x, y ) = ck if f ( x, y ) Vk
310
311
band1
band2
band3
band5
band4
band3
Digital Image Processing Dr.Rong Zhang
313
314
si = kri i = 1, 2,3
0 < k <1
s3 = kr3 s1 = r1 s2 = r2
315
I S
HS HI
316
0 < k <1
317
318
319
320
321
5.1 Introduction
5.1.1 Purpose "compensate for" or "undo" defects which degrade an image. 5.1.2 Degrade Causes (1) atmospheric turbulence (2) sampling, quantization (3) motion blur (4) camera misfocus (5) noise
322
5.1 Introduction
5.1.3 degradation model n(x,y)
f(x,y)
g(x,y)
g ( x, y ) = f ( x, y ) * h ( x, y ) + n ( x, y )
Where h(x,y) is called as Point Spread Function (PSF)
Digital Image Processing Dr.Rong Zhang 323
5.1 Introduction
5.1.4 Methods Unconstrained Restoration: inverse filtering Constrained Restoration: wiener filtering 5.1.5 problem expression Estimate a true image f(x,y) from a degraded image g(x,y) based on prior knowledge of PSF h(x,y)and the statistical properties of noise n(x,y)
324
5.2 Diagonalization
5.2.1 Matrix expression of degradation model: 1-D
g ( x ) = f ( x ) * h( x )
f ( x) 0 x A 1 f e ( x) = else 0 h( x ) 0 x B 1 he ( x) = else 0
325
5.2 Diagonalization
5.2.1 Matrix expression of degradation model: 1-D
g e ( x) = f e (m)he ( x m) + ne ( x)
m=0
M 1
M=A+B x=0,1,,M-1
326
5.2 Diagonalization
5.2.1 Matrix expression of degradation model: 1-D
he ( x) = he ( x + M )
he ( M 1) he (0) h (1) he (0) e H= M M he ( M 1) he ( M 2) L he (1) L he (2) O M L he (0)
H is circulant
Digital Image Processing Dr.Rong Zhang 327
5.2 Diagonalization
5.2.1 Matrix expression of degradation model: 2-D
f ( x, y ) f e ( x) = 0 h ( x, y ) he ( x) = 0
0 x A 1 and 0 y B 1 A x M 1 or B y N 1 0 x C 1 and 0 y D 1 A x M 1 or B y N 1
328
5.2 Diagonalization
5.2.1 Matrix expression of degradation model: 2-D
g e ( x, y ) = f e (m, n)he ( x m, y n)
m =0 n =0 M 1 N 1
x=0,1,,M-1 y=0,1,,N-1
H0 H g = Hf + n = 1 M H M 1
H M 1 H0 M H M 2
H is block-circulant
Digital Image Processing Dr.Rong Zhang 329
5.2 Diagonalization
5.2.1 Matrix expression of degradation model: 2-D where
he (i, N 1) he (i, 0) h (i,1) he (i, 0) Hi = e M M he (i, N 1) he (i, N 2) L he (i,1) L he (i, 2) O M L he (i, 0)
330
5.2 Diagonalization
5.2.2 Diagonliztion: 1-D The eigenvector and eigenvalue of a circulant matrix H are
2 w(k ) = 1 exp j M 2 ( M 1)k k L exp j M
T
H = WDW 1
where
D(k , k ) = (k )
331
5.2 Diagonalization
5.2.2 Diagonliztion: 1-D for
g = Hf + n
W 1 g = W 1 Hf + W 1n = W 1WDW 1 f + W 1n = DW 1 f + W 1n
G (u ) = H (u ) F (u ) + N (u )
Digital Image Processing Dr.Rong Zhang 332
5.2 Diagonalization
5.2.2 Diagonliztion: 2-D
2 W (i, m) = exp j im WN M 2 WN (k , n) = exp j kn N
H = WDW 1
G (u , v) = H (u , v) F (u , v) + N (u , v)
in Spatial Coordinates in frequency domain in vector form
Digital Image Processing Dr.Rong Zhang 333
G (u , v) = H (u, v) F (u , v)
334
deconvolution
5.3.4 properties
or u,v
if H (u, v) < d k M (u , v) = else 1/ H (u , v)
Digital Image Processing Dr.Rong Zhang 336
Original image
Blurred image
Restored image
337
Restored image
338
}
339
H (u , v)
where
Sn (u , v) = N (u, v) S f (u, v) = F (u , v)
2 2
S g (u , v) = H (u , v) S f (u , v) + S n (u, v)
2
5.4.4 properties
Sg(u,v)
u,v
341
342
Gs (u , v) H s (u , v) = (u , v) F s
343
(x,y)
then
h(x,y)
g(x,y)
g ( x, y ) = ( x, y ) * h ( x, y ) = h ( x, y )
344
H (u , v) = e
where k is a constant
k ( u 2 + v 2 )5 / 6
345
where x0(t) and y0(t) are the time varying components of motion in the x-direction and y-direction. Its Fourier transform is
G (u , v) =
g ( x, y )e 2 j (ux + vy ) dxdy
T = f [ x x0 (t ), y y0 (t )]dt e 2 j ( ux + vy ) dxdy 0
346
347
G (u , v) = H (u, v) F (u , v)
Suppose that the image in question undergoes uniform linear motion in the x-direction only, at a rate given by x0 (t ) = at / T
H (u , v) = e 2 j[ux0 (t )+ vy0 (t )]dt = e 2 juat / T dt
0 0 T T
T sin( ua)e j ua ua
Digital Image Processing Dr.Rong Zhang 348
349
g ( x, y ) = T [( f ( x, y )] = f ( x ', y ')
where
350
. . . . . . . .
(x,y)
. .
( x, , y, )
g (x , y )
, ,
f(x,y)
r ( x, y ) = a1 x + a2 y + a3 s ( x, y ) = b1 x + b2 y + b3
Quadratic correction
r ( x, y ) = a1 x 2 + a2 y 2 + a3 xy + a4 x + a5 y + a6 s ( x, y ) = b1 x 2 + b2 y 2 + b3 xy + b4 x + b5 y + b6
352
g ( x, y ) = f ( x ', y ') = f (i + u, j + v)
u , v (0,1) i, j Z
(i,j) u f(i+1,j) v
f(i,j+1)
(i,j+1) f(i+1,j+1)
(i+1,j+1)
353
f ( x ', y ') = f (i + u , j + v)
u , v (0,1) i, j Z
f(i,j+1)
(1 u )(1 v) (1 u )v u (1 v) uv
Digital Image Processing Dr.Rong Zhang 354
x = r cos
y = r sin
355
Summary
Inverse filtering is a very easy and accurate way to restore an image provided that we know what the blurring filter is and that we have no noise Wiener filtering is the optimal tradeoff between the inverse filtering and noise smoothing It is possible to restore an image without having specific knowledge of degradation filter and additive noise. However, not knowing the degradation filter h imposes the strictest limitations on our restoration capabilities.
Digital Image Processing Dr.Rong Zhang 356
357
Preview
CT reconstruction
CT machine
MRI TCT
358
Preview
CT reconstruction
SPECT
projections
3D reconstruction
359
6.1 Introduction
6.1.1 Overview of Computed Tomography (CT)
parallel-beam
fan-beam
360
6.1 Introduction
6.1.2 Classification
(1) Transmission Computed Tomography TCT (2) Emission Computed Tomography, ECT (3) Reflection Computed Tomography, RCT (4) Magnetic resonance imaging, MRI
361
6.1 Introduction
6.1.3 Physical basis of projection Let us consider the simplest case, a single block of homogeneous tissue and a monochromatic beam of X-rays. The linear attenuation coefficient is defined by
I = I 0e L
where L is the length of the block I and I0 are incident and attenuated intensities of the X-ray, respectively
362
6.1 Introduction
6.1.3 Physical basis of projection Let (x,y) denote the sectional attenuation variation. For an infinitely thin beam of monochromatic X-rays, the detected intensity of the X-ray along a straight line Lis expressed as
I = I 0e
( x , y ) dl
L
I ln = ( x, y )dl I0 L
363
6.1 Introduction
6.1.4 Purpose Reconstruction (x,y) from its projections 6.1.5 Methods Fourier Inversion ( frequency domain) convolution and backprojection ( spatial domain) Finite series-expansion ( spatial domain)
364
f ( x, y )dy f ( x, y )dx
p( y) =
f ( x, y )ds
365
t x
S ( ) = F ( , )
where F(,) is the polar coordinate expression of F(u,v)
367
F (u , v) =
Let v=0
f ( x, y ) exp(2 jux)dxdy
F (u, 0) = P(u )
In other words, the Fourier transform of the vertical projection of an image is the horizontal radial profile of the 2D Fourier transform of the image.
Digital Image Processing Dr.Rong Zhang 368
S ( ) = F ( , )
369
projection 1D-DFT
F (u, 0) = P(u )
370
371
f ( x, y ) =
Let
u = cos
v = sin
Because
F ( + , ) = F ( , )
372
let
t = x cos + y sin
f ( x, y ) =
S ( w) exp [ 2 j t ] d d
p (t ) h(t )
S ( )
where
h(t ) = F ( )
1
f ( x, y ) = d p (t )h(t )d
0
Digital Image Processing Dr.Rong Zhang 373
h(t ) = F ( ) =
1
exp(2 j t )d
2
If
c =
1 2
h(t ) =
1 sin(2 t / 2 ) 1 sin(2 t / 2 ) 2 2 2 2 t / 2 4 2 t / 2
1 2
1 2
f ( x, y ) = p' (t )d
0
375
backprojection
sinogram
Filtered sinogram
Digital Image Processing Dr.Rong Zhang 376
377
378
379
f ( x, y ) = { f 0 , f1 L f N 1}
The projection of i-th ray is
pi = wi , j f j
j =0
N 1
i = 0,1,L M 1
where
380
p1
p1
p0
p0
f (1)
(0) w f p0 (0) 0 = f w0 w0 w0
f ( k +1)
(k ) w f pk (k ) k wk = f wk wk
6.4.3 Arithmetic of finite series-expansion Step1: given an initial estimation f(0), k=0 Step2: adjust f(k) by a projection equation to get f(k+1) ,k=k+1 Step3: repeat step2 until the adjust value less than
383
384
7.1 Introduction
7.1.1 why code data? 7.1.2 Classification Lossless compression: reversible Lossy compression: irreversible
Video data
same resolution 25 frames per second 33 Mbyte/second
385
7.1 Introduction
7.1.3 Compression methods Entropy coding: Huffman coding, arithmetic coding Run length coding: G3, G4 LZW coding: arj(DOS), zip(Windows), compress( UNIX) Predictive coding: linear prediction, non-linear prediction Transform coding: DCT, KLT, Walsh-T, WT(wavelet) Others: vector quantization (VQ), Fractal coding the second generation coding
386
RD=0
C R , RD 1
Digital Image Processing Dr.Rong Zhang 387
or
Three basic image redundancy Coding redundancy Interpixle redundancy psychovisual redundancy
Digital Image Processing Dr.Rong Zhang 388
where L is the number of gray levels, nk is number of times that the kth gray level appears in the image, and n is the total number of pixels in the image
389
L 1
For example
rk r0 r1 r2 r3 r4 r5 R6 r7 Pr(rk) Code1 l1(rk) Code2 l2(rk)
3 3 3 3 3 3 3 3
2 2 2 3 4 5 6 7
390
1 RD = 1 = 0.099 1.11
391
392
1 N 1n A(n) = f ( x , y ) f ( x , y + n ) N n y =0
393
394
8bits/pixel
4bits/pixel
Digital Image Processing Dr.Rong Zhang
2bits/pixel
395
Let represent an input image and f ( x, y)denote the Decompressed image. For any value x and y, the error e(x,y) bewteen f ( x, y ) and f ( x, y) can be defined as
^
f ( x, y )
e( x, y ) = f ( x, y ) f ( x, y )
So that the total error between the two images is
M 1 x =0
[ f ( x, y) f ( x, y)]
y =0
Digital Image Processing Dr.Rong Zhang 396
N 1
f ( x, y )
is
x =0
2 1/ 2 f x y f x y [ ( , ) ( , )] } y =0
N 1
SNRrms = 10 lg M 1
x =0
2 [ ( , ) ( , )] f x y f x y y =0
x =0 y =0 N 1 ^
N 1 ^
f ( x, y ) 2
397
SNR = 10 lg
x =0 M 1
f ( x, y ) f ( x, y ) y =0
^ N 1 y =0 ^
N 1
x =0
2 [ ( , ) ( , )] f x y f x y
PSNR = 10 lg M 1
x =0 ^ y =0
N 1
f max 2
x =0
2 [ ( , ) ( , )] f x y f x y y =0
Digital Image Processing Dr.Rong Zhang
N 1
f max 2 = 10 lg 2 erms
398
f ( x, y )
399
400
1 I ( E ) = log = log P ( E ) P( E )
For example P( E ) = 0,
P( E ) = 1,
I (E) =
I (E) = 0
Unit:
Base=2, bits ( binary digits) Base=e, nats ( nature digits) Base=10, Hartly
Digital Image Processing Dr.Rong Zhang 401
then
N 1 1 H ( X ) = p ( x j ) log = p( x j ) log p ( x j ) p( x j ) j =0 j =0
N 1
402
1 p( xi )
1 p( xi xi 1 ) 1 p ( xi xi 1 xi 2 ) 1 p ( xi xi 1 L xi m )
H1 ( X ) = p ( xi ) p ( xi | xi 1 ) log
i i
H 2 ( X ) = p( xi ) p( xi | xi 1 xi 2 ) log
i i
H m ( X ) = p( xi ) p ( xi | xi 1 L xi m ) log
i i
property
Zero-order entropy:
H 0 ( X ) = p( xi ) log
i
1 p( xi )
= 1.81bits / pixel
405
First-order entropy:
H1 ( X ) = p ( xi ) p ( xi | xi 1 ) log
i i
1 p( xi xi 1 )
= 1.25bits / pixel
Digital Image Processing Dr.Rong Zhang 406
H ( X ) Lavg
For memoryless (zero-memory) source:
1 H ( X ) = p ( xi ) log p( xi ) i
But, the image data usually are Markov source, how to code?
Digital Image Processing Dr.Rong Zhang 407
409
410
411
Lavg > H 0 ( X )
412
413
probabilites
Initial intervals
416
The most probable category is coded with 1-bit code word 0 The other two category is coded with 2-bit code word 10 and 11 The code assigned to the mixed intensity category is used as a prefix
417
(1,8) (0,3) (1,14) (0,4) (1, 28) (0,3) (1,23) (0,3) (1,29) (0, 3) (1,28) (0,3) (1,31) (0,4) (1,25) (0,4) (1,38) (0,4)
8 9
3 14 3 31
4 28 4 25
3 23 4 38
3 4
29
3 28
418
419
420
en = f n f n
decoder
f n = en + f n
Digital Image Processing Dr.Rong Zhang 421
where
422
( x, y ) = round [ f ( x, y 1)] f
Original image
0 1 2 3 4 5 6 7
Null
Location of pixels
425
-1
1 1
0 1 1
21 20 22 21
20 21 23 20
22 22 21 20
21 23 22 21
2 1
2 -2
-1 1
-1
-1
-1
-3
-1 0 1
-1
426
MAW
SNMAW
Cost?
Digital Image Processing Dr.Rong Zhang 427
Figure, exam
428
1 2 3 4 5 6
429
& =e & f + f n n n
decoder
430
= f f i n i n
i =1
2 m 2 E{en } = E f n i f n 1 i =1
431
f(x-1,y-1) f(x,y-1)
f(x-1,y) f(x,y)
f(x-1,y+1)
432
original
433
435
ym,n = xi , j (i, j , m, n)
X (m, n)
= Y (k , l )
k =0 l =0
M 1 N 1
H(X)=Hm(X)
H0(X)>H0(Y)
original
DFT
Digital Image Processing Dr.Rong Zhang
DCT
437
encoder
Merge n*n subimage
Bits stream
Symbol encoder
Inverse transform
f ( x, y )
decoder
438
KLT>DCT>DFT>WHT WHT<DCT<DFT<KLT
Zonal mask
Bit allocation
Digital Image Processing Dr.Rong Zhang 440
1 1 1 1 1 0 0 0
1 1 1 1 0 1 0 0
0 1 1 0 0 0 0 0
1 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
Zig-zag
threshold mask
441
443
444
DCT
quantizer
Zig-zag
445
447
H.264
448
ME
449
These partition and sub-partition give rise to a large mumber of possible combinations within a macroblock
Digital Image Processing Dr.Rong Zhang 450
Example:
451
quantization
QP515253550
Digital Image Processing Dr.Rong Zhang 452
deblocking