Está en la página 1de 53

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.

vn

=-=.LI CM N
Ti xin by t lng bit n su sc n TS. Bi Th Hng tn tnh
hng dn, ch bo v ht lng gip ti c th hon thnh lun vn ca
mnh.
Xin cm n Khoa Cng ngh thng tin i hc Thi Nguyn to
iu kin gip ti trong sut qu trnh lm lun vn nghin cu.




Thi Nguyn, ngy thng nm 2009
Tc gi lun vn



NGUYN HNG NGC

I HC THI NGUYN
KHOA CNG NGH THNG TIN






NGUYNC HNG NGC






NGHIN CU MT S K THUT NN D LIU DA
TRN PHP BIN I SNG NH RI RC V NG
DNG TRONG MY NH K THUT S









LUN VN THC S CNG NGH THNG TIN











THI NGUYN - 2009

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn


I HC THI NGUYN
KHOA CNG NGH THNG TIN




NGUYN HNGN NGC





NGHIN CU MT S K THUT NN D LIU DA
TRN PHP BIN I SNG NH RI RC V NG
DNG TRONG MY NH K THUT S

Chuyn ngnh: Khoa hc my tnh
M s: 60.48.01





LUN VN THC S CNG NGH THNG TIN




NGI HNG DN KHOA HC
TS. BI TH HNG






THI NGUYN - 2009






S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

LI CM N

Ti xin by t lng bit n su sc n thy gio TS. Bi Th Hng -
Vin Cng ngh Thng tin thuc Vin Khoa hc v Cng ngh Vit Nam l
ngi trc tip hng dn, ch bo tn tnh v ht lng gip ti trong
sut thi gian lm lun vn ny.
Xin cm n cc thy gio, c gio, cng tc ti Phng C s d liu
Vin Cng ngh thng tin, cc thy c gio cng tc ti Khoa cng ngh
thng tin HTN, cng tp th cc bn hc vin lp cao hc Kha 6 lun
gip , ng vin v nhit tnh chia s vi ti nhng kinh nghim hc tp,
nghin cu trong sut kho hc.
Xin c cm n Ban lnh o Trng CCN Vit c, cng ton th
cc bn ng nghip trong Khoa CNTT nhit tnh to iu kin gip c
v thi gian, vt cht v tinh thn ti hon thnh c kha hc ca mnh.
Thi Nguyn, ngy 10 thng 11 nm 2009
Hc vin


Nguyn Hng Ngc

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

LI CAM OAN

Ti xin cam oan ton b ni dung bn lun vn ny l do ti t su tm,
tra cu v sp xp cho ph hp vi ni dung yu cu ca ti.
Ni dung lun vn ny cha tng c cng b hay xut bn di bt k
hnh thc no v cng khng c sao chp t bt k mt cng trnh nghin
cu no.
Tt c phn m ngun ca chng trnh u do ti t thit k v xy
dng, trong c s dng mt s th vin chun v cc thut ton c cc
tc gi xut bn cng khai v min ph trn mng Internet.
Nu sai ti xin ti xin hon ton chu trch nhim.

Thi Nguyn, ngy 10 thng 11 nm 2009
Ngi cam oan


Nguyn Hng Ngc

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

i
MC LC


CHNG 1 .................................................................................................................. 4
TNG QUAN V CC K THUT NN NH ......................................................... 4
1.1. Gii thiu chung v nn nh s ............................................................................... 4
1.2. Phn loi cc k thut nn ....................................................................................... 6
1.2.1. Nn tn hao v khng tn hao ......................................................................... 6
1.2.2. M ho d on v m ho da trn php bin i ........................................... 6
1.2.3. M ho bng con .............................................................................................. 7
1.3. Tiu chun nh gi cht lng m ho nh ........................................................... 7
1.4. Cc k thut nn c tn hao .................................................................................... 7
1.4.1. K thut m ho bng con ............................................................................... 7
1.4.2. K thut m ha da trn php bin i ........................................................... 9
1.4.2.1. K thut m ha da trn php bin i DCT ................................................ 9
1.4.2.2. K thut m ho da trn php bin i DWT. Mi quan h gia bin i
Wavelet v Fourier .................................................................................................. 10
CHNG 2 C S L THUYT CA BIN I WAVELET ............................... 13
2.1. C s ton hc. ..................................................................................................... 13
2.1.1. Bin i Wavelet lin tc. .............................................................................. 13
2.1.2. Bin i Wavelet ri rc................................................................................. 13
2.1.3. Tnh cht ca bin i Wavelet. ..................................................................... 14
2.2. Gii thiu mt s h Wavelet. ............................................................................... 15
2.2.1. Bin i Wavelet Haar. .................................................................................. 15
2.2.2. Bin i Wavelet Meyer................................................................................. 15
2.2.3. Bin i Wavelet Daubechies. ........................................................................ 16
2.3. Mt s ng dng ni bt ca Wavelet. .................................................................. 16
2.3.1. Nn tn hiu. .................................................................................................. 16
2.3.2. Kh nhiu. ..................................................................................................... 17

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

ii
2.3.3. M ho ngun v m ho knh. ...................................................................... 17
CHNG 3 CHUN NN NH TNH DA TRN BIN I WAVELET
JPEG2000 ................................................................................................................... 18
3.1. Lch s ra i v pht trin chun JPEG2000. ...................................................... 18
3.2. Cc tnh nng ca JPEG2000 ............................................................................... 18
3.3. Cc bc thc hin nn nh theo chun JPEG2000. ............................................. 19
3.3.1. X l trc bin i. ...................................................................................... 19
3.3.2. Bin i lin thnh phn. ................................................................................ 19
3.3.3. Bin i ring thnh phn (bin i Wavelet). ................................................ 20
3.3.4. Lng t ho - Gii lng t ho. .................................................................. 20
3.3.5. M ho v kt hp dng d liu sau m ho. .................................................. 21
3.3.6. Phng php m ho SPIHT. ......................................................................... 21
3.3.7. Phng php m ho EZW. ............................................................................ 23
3.4. So snh chun JPEG2000 vi JPEG v cc chun nn nh tnh khc. ............ 24
CHNG 4 NG DNG THY VN TRONG MY NH K THUT S .................. 27
4.1. Gii thiu v my nh k thut s. ........................................................................ 27
4.2. K thut thu vn s dng php bin i DWT. .................................................... 28
4.3. xut qui trnh nn v thy vn nh trong my nh s........................................ 42

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

iii
CC HNH V, BNG BIU TRONG LUN VN

Hnh 1.1 S b khi qut h thng nn nh 5
Hnh 1.2. S minh ho k thut m ho bng con M bng con 8
Hnh 1.3. S b m ho theo chun JPEG 10
Hnh 2.1. Minh ho li nh t dyadic vi cc gi tr ca m v n 14
Hnh 3.1: Trnh t m ho (a) v gii m JPEG2000 (b) 19
Bng 3.1: So snh JPEG v JPEG2000 25
Hnh 4.1. Lc chung cho qu trnh giu tin 28
Hnh 4.2. Lc chung cho qu trnh gii m. 29
Hnh 4.3. S nhng thu vn. 32
Hnh 4.4. S tch thu vn. 33



S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

iv
THUT NG TING ANH


CWT

DCT

DPCM

DWT

EZW

IDWT
JPEG

JPEG2000
MRA

MSE

PCM
PSNR

RLC
SPIHT

STFT

Wavelet
Wavelet Decomposition Tree
Bin i Wavelet lin tc (Continuous
Wavelet Transform)
Bin i Cosine ri rc (Discrete Cosine
Transform)
iu xung m vi sai (Differized Pulse Code
Modulation)
Bin i Wavelet ri rc (Discrete Wavelet
Transform)
Wavelet cy zero (Embedded Zerotree
Wavelet)
Bin i Wavelet ri rc ngc
Chun nn nh ca y ban JPEG quc t
(Joint Photographic Experts Group)
Chun nn nh JPEG2000
Phn tch a phn gii (Multi Resolution
Analysis)
Sai s bnh phng trung bnh (Mean Square
Error)
iu xung m (Pulse Code Modulation)
T s tn hiu nh trn nhiu (Peak Signal to
Noise Ratio)
M ho lot di (Run Length Coding)
Phng php m ho phn cp theo vng
(Set partitioning in hierarchical trees)
Bin i Fourier thi gian ngn (Short
Time Fourier Transform)
Bin i bng con Wavelet
Cy phn gii Wavelet

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

1

M U

Trong thi i ca Internet, thng tin ngy cng c s dng rng ri
v lng thng tin c trao i qua mng cng ln mnh. Tuy nhin, vi
lng thng tin ln nh vy th nguy c truy cp d liu tri php cng tng
ln. V th, nhu cu m bo an ton v bo v bn quyn v s hu tr tu
sn phm ang l mt nhu cu cp thit. Mt trong nhng gii php hu hiu
cho vn ny l giu thng ip vo nhng phng tin cha. Phng tin
cha c dng ph bin l cc bc nh.
Ngy nay, hu ht cc bc nh u c chp bng cc my nh k
thut s. thu gn ln ca cc files nh, ngi ta s dng cc k
thut nn d liu khc nhau v pht sinh ra cc nh dng nh tng ng.
Cc k thut ny c th c nhng trc tip vo trong nh v l mt khu
trong qui trnh to nh.
Lun vn ny nghin cu v xut mt k thut thy vn cc bc nh
s ngay trong qui trnh to nh c nn bng k thut sng nh ri rc
DWT nh l mt minh chng cho bn quyn tc gi khi cn thit. So vi cc
k thut nn s dng php bin i nh bin i Fourier (FT), bin i
cosine ri rc (DCT), bin i xp chng (LT),.., bin i Wavelet (DWT)
c nhiu u im khng ch trong x l nh m cn nhiu ng dng khc.
Bng chng l s ra i ca chun nn JPEG2000 (da trn DWT) c tnh
nng vt tri so vi JPEG (DCT). Tuy nhin chun JPEG, MPEG hay ngay
c JPEG2000 cng ch tp trung vo hiu qu nn (t s nn) v cht lng.
Trong lun vn trnh by mt k thut nn nh s dng bin i Wavelet
hiu nng em li hiu qu nn, cht lng hnh nh.


S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

2
C s nghin cu v mc ch ca lun vn

c th s dng cc dch v Internet v cc thng tin s rng ri cn
c mt k thut, mt cng ngh mang li nhiu ha hn trong ng dng bo
v bn quyn, khng b bin dng, iu khin truy cp i vi cc d liu a
phng tin. Phng php gim kch thc d liu bng cc k thut nn l
mt cch tip cn hiu qu gii quyt cc kh khn trn.
Mc d cho n nay c rt nhiu k thut nn d liu a phng tin
nh: chun JPEG (da trn bin i DCT), chun JPEG2000 (da trn
bin i Wavelet) v chun MPEG, tuy nhin nhng k thut ny ch tp
trung vo hiu qu nn v c gng nh mt cht lng nh t v th chng
b qua vn tiu hao nng lng trong qu trnh nn v truyn. Lun vn
ny trnh by mt k thut hiu qu khc phc nhng kh khn trn cho
d liu a phng tin. l k thut nn nh s dng bin i Wavelet
thch nghi, hiu nng cho d liu a phng tin trong thng tin v k
thut nhng thy vn vo sn phm m khng nh hng n cht lng v
bo v bn quyn tc gi, y l ng dng c bn bn nht ca k thut thy
vn s. Mt thng tin no mang ngha quyn s hu tc gi gi l thy
vn s c nhng vo trong cc sn phm, thy vn ch mt mnh ngi
ch s hu hp php cc sn phm c v c dng lm minh chng cho
bn quyn sn phm.
T chc lun vn
Lun vn c trnh by thnh 4 chng v 1 ph lc.
Chng 1 trnh by khi qut cc k thut nn nh, phn loi cc
nguyn l nn v nh ngha mt s thut ng c s dng rng ri nh
MSE, PSNR v SNR. Chng ny cng trnh by c s l thuyt ca cc

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

3
nguyn l nn c tn hao in hnh nh: m ho bng con; m ho da
trn bin i cosine ri rc (DCT), bin i xp chng (LT), bin i
Wavelet ri rc (DWT).

Chng 2, trnh by c s ton hc, tnh cht ca bin i Wavelet.
Ni dung ca chng ny l l thuyt nn tng cho cc ng dng Wavelet.

Chng 3, gii thiu tng quan v chun nn JPEG2000 da trn
bin i Wavelet. V trong chng ny, trnh by tm tt cc bc thc
hin nn nh theo JPEG200 v so snh n vi chun JPEG v cc chun nn
nh tnh khc.

Chng 4, t rnh by ng dng thy vn trong my nh k thut s.


S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

4
CHNG 1
TNG QUAN V CC K THUT NN NH
1.1. Gii thiu chung v nn nh s
Nn nh s l mt ti nghin cu rt ph bin trong lnh vc x l
d liu a phng tin. Mc ch l lm th no lu tr bc nh di
dng c kch thc nh hn hay di dng biu din m ch yu cu s bt
m ho t hn so vi bc nh gc. Nn nh thc hin c l do mt thc
t: thng tin trong bc nh khng phi l ngu nhin m c trt t, c t
chc. V th nu bc tch c tnh trt t, cu trc th s bit c phn
thng tin no quan trng nht trong bc nh biu din v truyn i vi
s lng bt t hn so vi nh gc m vn m bo tnh y thng tin.
pha thu, qu trnh gii m s t chc, sp xp li c bc nh xp x gn
chnh xc so vi nh gc nhng vn tho mn cht lng yu cu, m bo
thng tin cn thit.
Tm li, tn hiu nh, video hay audio u c th nn li bi chng c
nhng tnh cht nh sau:
C s tng quan (d tha) thng tin v khng gian: Trong phm vi
mt bc nh hay mt khung video tn ti s tng quan ng k (d
tha) gia cc im nh ln cn.
C s tng quan (d tha) thng tin v ph: Cc d liu thu c t
cc b cm bin ca thit b thu nhn nh tn ti s tng quan ng
k gia cc mu thu, y chnh l s tng quan v ph.
C s tng quan (d tha) thng tin v thi gian: Trong mt
chui nh video, tn ti s tng quan gia cc im nh ca cc

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

5
khung video (frame).
S ca mt h thng nn d liu tng qut nh sau:


Hnh 1.1 S b khi qut h thng nn nh
Trong hnh1.1, b m ho d liu thc hin qu trnh nn bng cch
gim kch thc d liu nh gc n mt mc ph hp vi vic lu tr v
truyn dn trn knh. Tc bt u ra ca b m ho c tnh l s bt
cho mt mu (im nh). B m ho knh thc hin vic chuyn i lung
bt c nn thnh dng tn hiu ph hp c cho vic lu tr v truyn
dn, thng b m ho knh s dng cc k thut: m ho c di thay
i RLC (Run Length Coding)[4], m ho Huffman[4], m ho s hc
[4]. B gii m thc hin qu trnh ngc li so vi b m ho.
Trong cc h thng nn, t s nn chnh l tham s quan trng nh gi
kh nng nn ca h thng, cng thc c tnh nh sau:
T s nn = Kch thc d liu gc / Kch thc d liu nn
i vi nh tnh, kch thc chnh l s bt biu din ton b bc
nh. i vi nh video, kch thc chnh l s bt biu din mt
khung hnh video (video frame).

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

6

1.2. Phn loi cc k thut nn
Cc k thut nn ch yu c phn loi nh sau:
1.2.1. Nn tn hao v khng tn hao
Trong cc k thut nn khng tn hao (losses compression), nh
khi phc ging hon ton so vi nh gc. Tuy nhin, nn khng tn hao
ch t c hiu qu nn rt nh. Tri li, cc k thut nn c tn hao (lossy
compression) c th t c hiu qu nn cao hn rt nhiu m iu
kin cm nhn hnh nh thng thng s mt mt thng tin khng cm
nhn c v v th vn m bo cht lng nh. Mt s k thut nn c tn
hao gm: iu xung m vi sai DPCM, iu xung m PCM, lng t ho
vct VQ, m ho bin i v bng con. nh khi phc trong h thng nn
c tn hao lun c s suy gim thng tin so vi nh gc bi v: phng php
nn ny loi b nhng thng tin d tha khng cn thit.
1.2.2. M ho d on v m ho da trn php bin i
i vi m ho d on (predictive coding) cc gi tr mang thng tin
c gi hay ang sn c s c s dng d on cc gi tr khc, v
ch m ho s sai lch gia chng. Phng php ny n gin v rt ph
hp vi vic khai thc cc c tnh cc b ca bc nh. K thut DPCM
chnh l mt v d in hnh ca phng php ny. Trong khi , m ho
da trn php bin i (transform based coding) th li thc hin nh sau:
trc tin thc hin php bin i vi nh chuyn s biu din nh t
min khng gian sang mt min biu din khc. Cc php bin i
thng dng l: DCT - bin i Cosine ri rc, DWT - bin i Wavelet ri
rc, LT - bin i trng (lapped) , tip thc hin m ho i vi cc h s
bin i. Phng php ny c hiu sut nn cao hn rt nhiu so vi

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

7
phng php nn d on bi v chnh cc php bin i (s dng cc
thuc tnh nn nng lng ca mnh) gi gn ton b nng lng bc
nh ch bng mt s t cc h s, s ln cc h s cn li t c ngha hn s
b loi b sau khi lng t ho.
1.2.3. M ho bng con
Bn cht ca k thut m ho bng con (subband coding) l chia bng
tn ca tn hiu (nh) thnh nhiu bng con (subband). m ho cho mi
bng con, chng ta s dng mt b m ho v mt tc bt tng ng vi
tnh cht thng k ca bng con.
1.3. Tiu chun nh gi cht lng m ho nh
nh gi cht lng ca bc nh (hay khung nh video) u ra ca
b m ho, ngi ta thng s dng hai tham s: Sai s bnh phng trung
bnh MSE (mean square error) v t s tn hiu trn nhiu nh PSNR
(peak to signal to noise ratio). MSE thng c gi l phng sai lng t.
Mt tham s khc hay s dng trong cc h thng vin thng l t s
tn hiu trn nhiu - SNR.
1.4. Cc k thut nn c tn hao
Trong phn ny, trnh by hai k thut nn tn hao cho nn nh tnh v
nh ng l: m ho bng con (subband coding) v m ho s dng php
bin i (transform coding). y l hai k thut nn in hnh v cho hiu qu
nn cng nh cht lng nh cao.
1.4.1. K thut m ho bng con
T tng chnh ca k thut m ho bng con l: cc nh c ly mu
u vo c phn ly thnh cc bng tn khc nhau (gi l cc tn hiu bng

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

8
con). Yu cu ca k thut ny l lm th no cc bng con khng b chng
cho ln nhau. c th phn ly tn hiu b m ho (encoder) thnh cc
bng con, nh c cho qua mt bank lc (filter bank) gi l bank lc phn
tch v mi u ra ca bank lc bng con c ly mu xung h s 2. Cc
u ra bng con tn s c ly mu xung s ln lt c: lng t ho c
lp bng cc b lc v hng khc nhau, m ho entropy, lu tr v truyn i.
pha b gii m (decoder), qu trnh c thc hin ngc li: gii lng t
bng con tn s, ly mu ln vi h s 2, cho i qua bank lc bng con tng
hp ri cng tt c cc u ra ca b lc khi phc li nh.
Hnh 1.2 di y l s tng qut gii thch k thut m ho bng
con.

Hnh 1.2. S minh ho k thut m ho bng con M bng con
Trong cc h thng m ha bng con hai chiu thc t, ngi ta chia
min tn s - khng gian hai chiu ca nh gc thnh cc bng khc nhau
bt k mc no.

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

9
1.4.2. K thut m ha da trn php bin i
Mt php bin i l mt hm ton hc c s dng bin i mt
tp cc gi tr ny thnh mt tp gi tr khc v to ra mt cch biu din mi
cho cng mt ngun tin. Tt c cc php bin i trnh by di y u l
khng tn hao (lossless); vi s chnh xc ca cc php ton s hc th cc
php bin i vn bo tn c chnh xc bt k mc no. Nhng hu
ht cc k thut m ho u c tn hao bc lng t ha do c s lm trn
gi tr cho cc h s php bin i.
1.4.2.1. K thut m ha da trn php bin i DCT
Php bin i cosine ri rc DCT (Discrete Cosine Transform) bin
i thng tin nh t min khng gian sang min tn s c th biu din
di dng gn hn. hiu r k thut ny trc ht ta cn tm hiu bin i
Fourier.
* Bin i Fourier FT
Bin i Fourier FT (Fourier Transform) l mt php bin i thun
nghch, n cho php s chuyn i thun nghch gia thng tin v tn hiu
c x l. Php bin i FT cng c th c p dng cho tn hiu khng n
nh (non-stationary) nu ch quan tm n thnh phn ph no c trong tn
hiu m khng quan tm n khi no xut hin trong tn hiu. Tuy nhin, nu
thng tin v thi gian xut hin ca ph trong tn hiu l cn thit, th php
bin i FT khng c kh nng p ng c yu cu ny, y l hn ch ca
php bin i ny.
* Nn v gii nn nh da theo php bin i DCT trong JPEG
JPEG l chun nn s quc t u tin cho cc nh tnh c tng mu
lin tc gm c nh n sc v nh mu. Trong k thut ny cc khi nh kch

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

10
thc 8x8 c p dng thc hin DCT, sau lng t ho cc h s ri
m ho entropy sau lng t.
i vi nhng nh mu RGB, p dng k thut nn ny, trc ht
phi chuyn sang ch mu YUV (Y l thnh phn chi, U v V l 2 thnh
phn mu). Thnh phn chi l nh n sc xm. Hai thnh phn mu cn
li cha thng tin v mu. S khi b m ho v gii m ca JPEG nh
sau:



Hnh 1.3. S b m ho theo chun JPEG

1.4.2.2. K thut m ho da trn php bin i DWT. Mi quan h gia
bin i Wavelet v Fourier
Wavelet l php bin i c s dng phn tch cc tn hiu khng
n nh (non-stationary) l nhng tn hiu c p ng tn s thay i theo
thi gian.
khc phc nhng hn ch ca bin i FT, php bin i Fourier
thi gian ngn STFT c xut.
Trn c s cch tip cn bin i STFT, bin i Wavelet c pht
trin gii quyt vn v phn gii tn hiu m STFT vn cn hn ch.

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

11
Bin i Wavelet c thc hin theo cch: tn hiu c nhn vi hm
Wavelet ri thc hin bin i ring r cho cc khong tn hiu khc nhau
trong min thi gian ti cc tn s khc nhau. Cch tip cn nh vy cn
c gi l: phn tch a phn gii MRA (Multi Resolution Analysis): phn
tch tn hiu cc tn s khc nhau v cho cc phn gii khc nhau.
MRA khi phn tch tn hiu cho php: phn gii thi gian tt v phn gii
tn s km cc tn s cao; phn gii tn s tt v phn gii thi gian km cc
tn s thp.
* Bin i Wavelet ri rc DWT
Bc ny c th hiu php bin i DWT nh l p dng mt tp cc
b lc: thng cao v thng thp. Thit k cc b lc ny tng ng nh k
thut m ho bng con (subband coding). Tuy nhin khc vi m ho bng
con, cc b lc trong DWT c thit k phi c p ng ph phng,
trn v trc giao.
T bin i DWT mt chiu c th m rng nh ngha bin i DWT
hai chiu theo cch: S dng cc b lc ring bit, thc hin bin i
DWT mt chiu d liu vo (nh) theo hng ri thc hin theo ct. Theo
cch ny nu thc hin bin i DWT mc 1, s to ra 4 nhm h s
bin i.
* Hai thut ton nn s dng DWT in hnh.
Nn nh da trn bin i DWT c nhng ci tin ng k, l
bc t ph s dng DWT nn nh bt u l k thut m ho EZW
(embedded zero-tree wavelet).
Thut ton EZW da trn kh nng khai thc cc thuc tnh a
phn gii ca bin i Wavelet a ra mt thut ton t phc tp trong

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

12
tnh ton m vn cho hiu qu nn cao. Nhng ci tin v nng cp ca
EZW v sau ra i mt s thut ton tng t nh: SPIHT (set
partitationing in hierarchical tree cy phn cp phn tp) v ZTE
(zero-tree entropy coding m ho entropy cy zero).
Gn y cn c thm mt thut ton na c xut l LS
(lifting scheme) s dng to cc bin i Wavelet s nguyn. K thut
ny s dng cc b lc Wavelet trc giao em li hiu qu rt cao cho cc
ng dng nn nh c tn hao.


S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

13
CHNG 2
C S L THUYT CA BIN I WAVELET
2.1. C s ton hc.
2.1.1. Bin i Wavelet lin tc.
Bin i Wavelet lin tc (Continuous Wavelet Transform - CWT) ca mt
hm f (t) c bt u t mt hm Wavelet m (mother Wavelet) (t ) . Hm
Wavelet m (t) c th l bt k mt hm s thc hoc phc lin tc no tho mn
cc tnh cht sau y:
- Tch phn suy rng trn ton b trc t ca hmt l bng 0.
- Tch phn nng lng ca hm trn ton b trc t l mt s hu
hn.
2.1.2. Bin i Wavelet ri rc.
Vic tnh ton cc h s Wavelet ti tt c cc t l l mt cng vic ht
sc phc tp. gim thiu cng vic tnh ton ngi ta ch chn ra mt
tp nh cc gi tr t l v cc v tr tin hnh tnh ton. Qu trnh chn
cc t l v cc v tr tnh ton nh trn to thnh li nh t
(dyadic). Mt phn tch nh trn hon ton c th thc hin c nh
bin i Wavelet ri rc (DWT). Do , vic tnh ton bin i DWT thc
cht l s ri rc ho bin i Wavelet lin tc (CWT); vic ri rc ho
c thc hin vi s la chn cc h s a v b nh sau:
a = 2
m
; b = 2
m
n; m, ne Z (2.1)
Vic tnh ton h s ca bin i Wavelet c th d dng thc hin bng
cc bng lc s nhiu nhp a knh, mt l thuyt rt quen thuc trong x l tn

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

14
hiu.






Hnh 2.1. Minh ho li nh t dyadic vi cc gi tr ca m v n

2.1.3. Tnh cht ca bin i Wavelet.
Bin i Fourier l mt bin i v ang c p dng rng ri
trong nhiu ngnh khoa hc v k thut khc nhau. Bin i Fourier
chuyn mt hm tn hiu t min thi gian sang min tn s. S dng bin
i Fourier ta c th bit c trong tn hiu f(t)c cc thnh phn tn s
no. Tuy nhin bin i Fourier c mt nhc im c bn l vi mt tn
hiu f(t) ta khng th bit c rng ti mt thi im t th tn hiu c cc
thnh phn tn s no. Mt php bin i tt hn bin i Fourier phi l
php bin i c y tnh nng ca bin i Fourier v c kh nng xc
nh xem ti mt thi im t bt k trong tn hiu f(t) c thnh phn tn s
no. Php bin i Wavelet ra i khc phc c cc nhc im ca
bin i Fourier trong phn tch tn hiu. Bin i Wavelet d ch lm vic
vi cc tn hiu mt chiu (lin tc hoc ri rc) nhng sau khi bin i
xong ta thu c mt hm s hai bin hoc mt tp cc cp gi tr W ( a, b
) minh ha cc thnh phn tn s khc nhau ca tn hiu xy ra ti thi
im t . Cc gi tr W ( a
i
, b ) to thnh mt ct (i=1, 2,...., n) cho bit mt
thnh phn tn s c trong nhng thi im t no v cc gi tr W ( a, b
i
) to
thnh hng cho bit ti mt thi im t ca tn hiu f(t) c cc thnh phn
m = -2 - - - - - - - - - - - - - - - -
m = -2 - - - - - - - -
m = -2
m = -2 - - - -
m = -2 -


S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

15
tn s no.
Tham s b trong bin i Wavelet cho bit khong dch ca hm
Wavelet m v phn gii cc tn s khc nhau ca f t c minh ha bi h
t l chnh l a. Bin i Wavelet ngy cng c p dng rng ri c bit l
trong x l ting ni, x l nh s. X l tn hiu nh s l x l tn hiu hai
chiu v do c im ca nh s l bao gi cng c tnh nh hng v tnh
nh v. Tnh nh hng ca mt nh ngha l trong nh bao gi cng c mt
s t cc thnh phn tn s nhng cc thnh phn tn s ny tri rng trn ton
b khng gian nh cn tnh nh v ca nh chnh l tnh cht biu th rng ti
mt vng ca nh c th c rt nhiu thnh phn tn s. nh biu th tnh nh
v r nht chnh l nh c nhiu bin vng phn tch r rt, ti cc ng bin
bao gi cng c nhiu thnh phn tn s khc nhau, cn hu ht cc nh c
tng lin tc u l nhng nh c tnh nh hng.
2.2. Gii thiu mt s h Wavelet.
2.2.1. Bin i Wavelet Haar.
Bin i Haar Wavelet l bin i n gin nht trong cc php
bin i Wavelet. Hnh v 2. 3 cho thy dng ca hm + (t ) vi bin i
Haar. Do tnh cht n gin ca bin i Haar m n c ng dng
tng i nhiu trong nn nh, khi p dng bin i ny nn nh th
thut ton nn nh trn my tnh c mt s im khc vi cng thc ton
hc ca bin i Haar.
2.2.2. Bin i Wavelet Meyer.
Yves Meyer l mt trong nhng nh khoa hc t nn mng cho
php bin i Wavelet. Php bin i Wavelet mang tn Meyer cng l
mt php bin i thng dng, bin i ny c kh nng phn tch tn

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

16
hiu tt hn nhiu so vi bin i Haar.

2.2.3. Bin i Wavelet Daubechies.
Ging nh Meyer, Daubechies cng l mt nh khoa hc c cng
lao to ln trong vic nghin cu pht trin php bin i Wavelet. Bin
i Daubechies l mt trong nhng php bin i phc tp nht trong
bin i Wavelet. H bin i ny c ng dng ht sc rng ri, bin
i Wavelet p dng trong JPEG2000 l mt bin i trong h bin i
Wavelet Daubechies.
2.3. Mt s ng dng ni bt ca Wavelet.
Phn ny ch nu ra cc lnh vc mang tnh cht tng qut cc ng
dng ca Wavelet vi tnh cht gii thiu v gi m.
2.3.1. Nn tn hiu.
Do c im ca mnh, Wavelet c bit tt khi s dng nn hay
phn tch cc tn hiu khng dng; c bit l tn hiu nh s v cc ng
dng nn ting ni, nn d liu. Vic s dng cc php m ho bng con,
bng lc s nhiu nhp v bin i Wavelet ri rc tng ng vi loi tn
hiu cn phn tch c th mang li nhng hiu qu rt r rt trong nn tn
hiu. Do tnh cht ch tn ti trong cc khong thi gian rt ngn (khi
phn tch tn hiu trong min thi gian tn s) m cc h s ca bin i
Wavelet c kh nng tp trung nng lng rt tt vo cc h s bin i.
Cc h s mang thng tin chi tit ca bin i Wavelet thng rt nh v c
th b qua m khng nh hng ti vic m ho d liu (trong phng php
m ho nh hay ting ni l nhng tn hiu cho php m ho c tn tht
thng tin).

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

17
2.3.2. Kh nhiu.
Tnh cht ca bin i Wavelet m chng ta xt ti trong phn ng
dng cho nn tn hiu c m rng bi Iain Johnstone v David
Donohos trong cc ng dng kh nhiu cho tn hiu. Phng php kh
nhiu ny c gi l Wavelet Shrinkage Denoising (WSD). tng c
bn ca WSD da trn vic tn hiu nhiu s l r khi phn tch bng bin i
Wavelet cc h s bin i bc cao. Vic p dng cc ngng loi b
tng ng vi cc bc cao hn ca h s Wavelet s c th d dng loi
b nhiu trong tn hiu.
2.3.3. M ho ngun v m ho knh.
S d Wavelet c ng dng trong m ho ngun v m ho knh v
trong m ho ngun th chng ta cn kh nng nn vi t l nn cao cn
trong m ho knh th cn kh nng chng nhiu tt. Bin i Wavelet
kt hp vi mt s phng php m ho nh m ho Huffman hay m ho
s hc c th thc hin c c hai iu trn.

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

18
CHNG 3
CHUN NN NH TNH DA TRN BIN I
WAVELET JPEG2000

3.1. Lch s ra i v pht trin chun JPEG2000.
Nh chng ta bit, s ra i ca JPEG mang li nhiu li ch to
ln v nhiu mt. JPEG c th gim nh kch thc nh, gim thi gian
truyn v lm gim chi ph x l nh trong khi cht lng nh l kh tt.
vic nn nh c hiu qu hn, y ban JPEG a ra mt chun nn
nh mi l JPEG2000. JPEG2000 s dng bin i Wavelet v cc
phng php m ho c bit c c nh nn u vit hn hn JPEG.
JPEG2000 hin vn ang tip tc c pht trin, nhng phn I c t
chc ISO chp nhn l chun nn nh quc t p dng cho nh tnh.
Chun nn nh JPEG2000 m xng sng l bin i Wavelet vi
tnh nng vt tri so vi JPEG chc chn s c s dng trong cc
ng dng.
3.2. Cc tnh nng ca JPEG2000
JPEG2000 c nhiu chc nng c bit hn mi chun nn nh
tnh khc nh JPEG hay GIF. Di y l cc chc nng u vit ca
JPEG2000 so vi cc chun nn nh tnh khc.
Cho cht lng nh tt nht khi p dng nn nh tnh c tn tht.
S dng c vi truyn dn v hin th lu tin v cht lng,
phn gii, cc thnh phn mu v c tnh nh v khng gian.
S dng cng mt c ch nn nh cho c hai dng thc nn.

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

19
Truy nhp v gii nn ti mi thi im trong khi nhn d liu.
Gii nn tng vng trong nh m khng cn gii nn ton b nh.
C kh nng m ho nh vi t l nn theo tng vng khc nhau.
Nn mt ln nhng c th gii nn vi nhiu cp cht lng tu theo
yu cu ca ngi s dng.
3.3. Cc bc thc hin nn nh theo chun JPEG2000.






Hnh 3.1: Trnh t m ho (a) v gii m JPEG2000 (b)

3.3.1. X l trc bin i.
Do s dng bin i Wavelet, JPEG2000 cn c d liu nh u
vo dng i xng qua 0. X l trc bin i chnh l giai on m
bo d liu a vo nn nh c dng trn. pha gii m, giai on x l
sau bin i s tr li gi tr gc ban u cho d liu nh.
3.3.2. Bin i lin thnh phn.
Giai on ny s loi b tnh tng quan gia cc thnh phn ca
nh. JPEG2000 s dng hai loi bin i lin thnh phn l bin i mu
thun nghch (Reversible Color Transform - RCT) v bin i mu khng
thun nghch (Irreversible Color Transform - ICT) trong bin i
M ho

X l tr-c
bin i
Bin i thun
lin thnh
phn

Bin i
thun ring
thnh phn

L-ng t ha
nh gc

nh sau
khi
m ho

(a)

X l sau
bin i

Gii m ho
Gii l-ng
t ho
Bin i
ng-c ring
thnh phn

Bin i
ng-c lin
thnh phn

nh m ho
nh khi
phc

(b)


S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

20
thun nghch lm vic vi cc gi tr nguyn, cn bin i khng thun
nghch lm vic vi cc gi tr thc. ICT v RCT chuyn d liu nh t
khng gian mu RGB sang YCrCb. RCT c p dng trong c hai dng
thc nn c tn tht v khng tn tht, cn ICT ch p dng cho nn c
tn tht. Vic p dng cc bin i ny trc khi nn nh khng nm ngoi
mc ch lm tng hiu qu nn. Cc thnh phn Cr, Cb c nh hng rt
t ti s cm nhn hnh nh ca mt trong khi thnh phn chi Y c nh
hng rt ln ti nh.
3.3.3. Bin i ring thnh phn (bin i Wavelet).
Bin i ring thnh phn c p dng trong JPEG2000 chnh l
bin i Wavelet. Do php bin i Wavelet khng phi l mt php bin
i trc giao nh bin i DCT m l mt php bin i bng con nn cc
thnh phn s c phn chia thnh cc bng tn s khc nhau v mi
bng s c m ha ring r. JPEG2000 p dng bin i Wavelet
nguyn thun nghch 5/3 (IWT) v bin i thc khng thun nghch
Daubechies 9/7. Vic tnh ton bin i trong JPEG2000 ny s c thc
hin theo phng php Lifting. Vic tnh ton bin i Wavelet 2D suy ra
t bin i Wavelet 1D theo cc phng php phn gii nh tu chn. Trong
JPEG2000 c 3 phng php phn gii nh nhng phng php c s
dng nhiu nht chnh l phng php kim t thp.
3.3.4. Lng t ho - Gii lng t ho.
Cc h s ca php bin i s c tin hnh lng t ho. Qu
trnh lng t ho cho php t t l nn cao hn bng cch th hin cc gi
tr bin i vi chnh xc tng ng cn thit vi mc chi tit ca nh
cn nn. Cc h s bin i s c lng t ho theo php lng t ho v
hng. Cc hm lng t ho khc nhau s c p dng cho cc bng con

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

21
khc nhau.
Trong dng bin i nguyn, t bc lng t bng 1.Vi dng bin
i thc th bc lng t s c chn tng ng cho tng bng con ring
r. Bc lng t ca mi bng do phi c trong dng bt truyn i
pha thu c th gii lng t cho nh.
3.3.5. M ho v kt hp dng d liu sau m ho.
JPEG2000 theo khuyn ngh ca u ban JPEG quc t c th s
dng nhiu phng php m ho khc nhau cng nh nhiu cch bin i
Wavelet khc nhau c th thu c cht lng nh tng ng vi ng
dng cn x l. Vic p dng cc phng php m ho khc nhau cng
c m rng sang lnh vc nn nh ng bng bin i Wavelet. Trong
thc t cc phng php m ho nh c p dng khi nn nh bng bin
i Wavelet cng nh JPEG2000 th c hai phng php c coi l c s v
c p dng nhiu nht: phng php SPIHT v phng php EZW.
Hin nay JPEG2000 vn c p dng m ho bng hai phng php
ny v mt phng php pht trin t hai phng php ny l phng
php m ho mt phng bt.
3.3.6. Phng php m ho SPIHT.
D p dng bin i Wavelet no hay cng vi n l mt php phn
gii nh no th trong cc bng con c s th t thp cng l nhng thnh
phn tn s cao (mang thng tin chi tit ca nh) trong khi nhng bng
con c s th t cao hn th s cha nhng thnh phn tn s thp (mang
thng tin chnh v nh). iu ngha l cc h s chi tit s gim dn t
bng con mc thp xung bng con mc cao v c tnh tng t v khng
gian gia cc bng con. Phng php SPIHT (Set partitioning in
hierarchical trees - phng php m ho phn cp theo phn vng).

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

22
Phng php SPIHT c thit k ti u cho truyn dn lu tin. iu
ny c ngha l ti mi thi im trong qu trnh gii nn nh theo
phng php m ho ny th cht lng nh hin th ti thi im y l tt
nht c th t c vi mt s lng bt a vo gii m tnh cho ti thi
im y. Ngoi ra, phng php ny s dng k thut embedded coding;
ngha l mt nh sau nn vi kch c (lu tr) ln (t l nn thp) s cha
chnh d liu sau nn ca nh c kch c (lu tr) nh (t l nn cao). B
m ho ch cn nn mt ln nhng c th gii nn ra nhiu mc cht lng
khc nhau. Gi s gi cc pixel trong mt nh p cn m ho l p
i, j
. p dng
mt php bin i Wavelet T no cho cc pixel trong nh to ra cc
h s ca php bin i Wavelet l c
i, j
. Cc h s ny to ra mt nh bin
i l C. Php bin i ny c vit di dng ton t nh sau: C=T(p).
Trong phng php truyn dn lu tin vi nh th b m ho s bt u
qu trnh khi phc (gii nn) nh bng cch t cc gi tr ca nh khi
phc t cc h s bin i l

C . S dng cc gi tr gii m ca cc h s
bin i to ra mt nh khi phc (vn cha p dng bin i ngc
Wavelet) l

C v sau p dng bin i ngc Wavelet to ra nh


cui cng l p . Chng ta c th vit di dng ton t nh sau:
1
( ) p T c

= .
Nguyn tc quan trng ca phng php truyn dn nh theo kiu
ly tin chnh l phng php ny lun truyn i cc gi tr mang thng
tin quan trng hn ca nh i trc. S d lm nh vy l do cc thng tin
chnh l cc thng tin s lm gim thiu nhiu nht mo dng ca
nh (s sai khc gia nh gc v nh khi phc). y chnh l l do ti sao
phng php SPIHT lun truyn i cc h s ln trc v cng l mt
nguyn tc quan trng ca phng php ny. Mt nguyn tc na l cc

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

23
bt c trng s ln bao gi cng mang thng tin quan trng nht trong
d liu nh phn. Phng php SPIHT s dng c hai nguyn tc ny; n
sp xp cc h s bin i v truyn i cc bt c trng s ln nht. Qu
trnh gii m c th dng li bt k mt bc no ng vi gi tr nh cn
m ho yu cu. y chnh l cch m phng php m ho SPIHT lm tn
tht thng tin.
3.3.7. Phng php m ho EZW.
Phng php m ho EZW (Embedded Zerotree Wavelet Encoder)
cng da trn c s php m ho lu tin (progressive coding) ging nh
phng php m ho SPIHT. Phng php ny ch yu da trn khi
nim v cy zero (zerotree).
Cy t phn: Sau khi p dng bin i Wavelet ng vi cc mc
phn gii khc nhau c th biu din cc h s bin i di dng mt
cy. Vi cy biu din c mi nt cha th c 4 nt con, do qu trnh bin
i Wavelet cc t l khc nhau. Ta gi y l cc cy t phn (quadtree).
Cy zero (zerotree): Cy zero l mt cy t phn, trong tt c cc
nt ca n u nh hn nt gc. Khi m ho s c m ho bng mt i
tng duy nht v khi gii m th cho tt c cc gi tr bng khng. Ngoi
ra c th m ho c cc h s Wavelet th gi tr ca nt gc phi
nh hn gi tr ngng ang c xem xt ng vi h s Wavelet .
Sau khi c cc khi nim cn thit v cy t phn v cy zero,
chng ta c th trnh by nguyn l hot ng ca thut ton. Thut ton s
m ho cc h s theo th t gim dn. Chng ta s dng mt gi tr gi
l ngng (threshold) v s dng ngng ny tin hnh m ho cc h
s bin i. Cc h s c m ho theo th t t vng tn s thp n vng
tn s cao. V ch nhng h s c gi tr tuyt i ln hn hoc bng

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

24
ngng th mi c m ho. Tip theo gim ngng v tip tc lm nh
vy cho ti khi ngng t ti mt gi tr nh hn gi tr ca h s nh
nht. Cch gim gi tr ngng y thc hin tng i c bit, gi tr
ca ngng gim xung mt na so vi trc . B gii m phi bit cc
mc ngng ny th mi c th gii m nh thnh cng. Khi di chuyn t
h s ny n h s khc theo th t nh th no. Vic sp xp ny cn phi
c quy c thng nht gia qu trnh m ho v qu trnh gii m
vic gii m nh c thnh cng.
3.4. So snh chun JPEG2000 vi JPEG v cc chun nn nh
tnh khc.
Mt tnh nng quan trng v l u im r nt nht ca JPEG2000 so
vi JPEG cng nh cc chun nn nh khc nh MPEG 4 VTC hay JPEG
- LS v. v.... l JPEG2000 a ra c hai k thut nn c tn tht v khng
tn tht theo cng mt c ch m ho ngha l JPEG2000 thc hin tt c
cc dng thc ca JPEG ch bng mt c ch m ho duy nht. Nu xt v
s tn ti ca hai k thut ny th JPEG cng c kh nng nn nh c tn
tht v khng tn tht thng tin. Tuy nhin vi JPEG th c ch m ho
vi hai dng ny l khc nhau v rt kh s dng c hai dng ny cng
lc cho cng mt ng dng. Do , c th thy rng JPEG c tnh mm do
hn bt k chun nn nh tnh. Hn th, chng ta thy rng tt c
cc phng php thit k cho chun JPEG2000 u u vit v c nhiu
tnh nng hn so vi JPEG; ngoi ra nhng thng k v thc t cho thy
vi cng mt t l nn v mt loi nh th nh c nn bi JPEG2000
hu nh lun c cht lng tt hn so vi JPEG.
Tnh nng u vit th hai ca JPEG2000 so vi JPEG chnh l
trong dng thc nn c tn tht thng tin, JPEG2000 c th a ra t l

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

25
nn cao hn nhiu so vi JPEG. Theo cng thc tnh PSNR trong n v
dB, chng ta c: (b l s bt dng biu din mt pixel trn nh gc)
PSNR(dB) = -20 log
RMSE
2 1
b
| |
|

\ .

S so snh v tham s PSNR cho trn bng 3.1. c th so snh d
dng hn, ta xt nh c nn vi cc t l khc nhau (o lng bi h s
bt/pixel hay bpp). Tt c cc s liu trn bng u cho thy JPEG2000 nn
nh tt hn l JPEG; hn th h s PSNR m chng ta xt trong bng c o
trong h n v logarit.
Bit per pixel 0. 125 0. 50 2.00
nh 1 theo JPEG 24.42 31.17 35. 15
nh 1 theo JPEG2000 28. 12 32.95 37. 35
nh 2 theo JPEG 22.6 28. 92 35. 99
nh 2 theo JPEG2000 24.85 31.13 38. 80

Bng 3.1: So snh JPEG v JPEG2000
Tnh nng u vit th 3 ca JPEG2000 so vi JPEG l chun nn
nh ny c th hin th c cc nh vi phn gii v kch thc khc
nhau t cng mt nh nn. Tnh nng ny l mt li th c bit quan
trng ca JPEG2000, thu c cht lng vi tng ln nn khc
nhau th vi JPEG2000 ta ch cn nn mt ln cn cht lng nh th s
c quyt nh tu theo ngi s dng trong qu trnh gii nn nh theo
JPEG2000.
JPEG2000 cn c mt kh nng c bit u vit hn so vi JPEG,
chnh l kh nng vt tri trong khi phc li. Khi mt nh c truyn
trn mng vin thng th thng tin c th b nhiu; vi cc chun nn nh

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

26
nh JPEG th nhiu ny s c thu vo v hin th, tuy nhin vi
JPEG2000, do c trng ca php m ho c th chng li, JPEG2000 c
th gim thiu cc li ny ti mc hu nh khng c.


S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

27
CHNG 4
NG DNG THY VN TRONG MY NH K THUT S
Cuc cch mng thng tin k thut s em li nhng thay i su
sc trong x hi v trong cuc sng ca chng ta. Nhng thun li m thng
tin k thut s mang li cng sinh ra nhng thch thc v c hi mi cho i
mi. S ra i nhng phn mm c tnh nng rt mnh, cc thit b mi nh
my nh k thut s, my qut cht lng cao, my in, my ghi m k thut
s, ... vi ti th gii tiu dng rng ln sng to, x l v thng thc
cc d liu a phng tin. Mng Internet tr thnh mt x hi thng tin s
ni din ra qu trnh trao i thng tin trong mi lnh vc chnh tr, qun s,
quc phng, kinh t, thng mi... V chnh trong mi trng m v tin nghi
nh vy xut hin nhng vn nn, tiu cc ang rt cn n cc gii php hu
hiu cho vn an ton thng tin nh nn n cp bn quyn, nn xuyn tc
thng tin, truy cp thng tin tri php... i tm gii php cho nhng vn
ny khng ch gip hiu thm v cng ngh phc tp ang pht trin rt
nhanh m cn a ra nhng c hi kinh t mi. Trong ni dung chng ny
i su vo ng dng ca thy vn vo my nh k thut s.
4.1. Gii thiu v my nh k thut s.
My nh s l mt my in t dng thu v lu gi hnh nh mt
cch t ng thay v phi dng phim nh ging nh my chp nh thng.
My nh k thut s c thit k a trn 2 nn tng l nhip nh v tin hc.
Cho ti ngy nay thit b in tch kp "Charged Couple Device gi tt l
CCD" v "Complement Metal Oxide Semiconductor gi tt l CMOS" c
gi chung l b cm bin hnh nh, y c th ni chnh l linh hn ca my
nh k thut s.

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

28
Cn nh s l nh c hp thnh bi cc phn t hnh nh (pixels),
cc phn t hnh nh ny rt nh.
Vi my nh k thut s th ta c th xem hnh trc tip khi va chp
xong, th hin qua mn hnh LCD nh nm pha sau my hoc c th ni my
vi mn hnh ti vi, my vi tnh, my phng .v.v....
Hnh nh chp t my nh KTS c lu gi theo mt nh dng ngy
cng ph thng (lu gi trn cc th nh hoc b nh trong ca my), khin
cho ngi dng c th d dng thuyn chuyn cc hnh nh gia cc loi thit
b v cc phn mm ng dng khc nhau. V d chn trc tip vo cn bn
(bo, bi hc .v.v..), gi hnh nh bng th in t, a hnh ln web .v.v.v....
Chnh v nhng yu t ny m nh s ngy cng c s dng rng ri,
ph bin.
4.2. K thut thu vn s dng php bin i DWT.
Giu thng tin l mt k thut nhng (giu) mt lng thng tin s no
vo trong mt i tng d liu s khc.
Di y l m hnh ca k thut giu tin c bn c m t theo hai
hnh v sau:

Hnh 4.1: Lc chung cho qu trnh giu tin.


S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

29
Hnh v trn biu din qu trnh giu tin c bn. Phng tin cha bao
gm cc i tng c dng lm mi trng giu tin nh ..., thng tin
giu l mt lng thng tin mang mt ngha no nh nh, logo, on vn
bn,... tu thuc vo mc ch ca ngi s dng. Thng tin s c giu vo
trong phng tin cha nh mt b nhng, b nhng l nhng chng trnh,
trin khai cc thut ton giu tin v c thc hin vi mt kho b mt
ging nh cc h m mt c in. Sau khi giu tin ta thu c phng tin
cha bn tin giu v phn phi s dng trn mng.


Hnh 4.2: Lc chung cho qu trnh gii m
Hnh v trn ch ra cc cng vic gii m thng tin giu. Sau
khi nhn c i tng phng tin cha c giu thng tin, qu trnh gii m
c thc hin thng qua mt b gii m tng ng vi b nhng thng tin
cng vi kho ca qu trnh nhng. Kt qu thu c gm phng tin cha
gc v thng tin giu. Bc tip theo thng tin giu s c x l kim
nh so snh vi thng tin giu ban u.
K thut giu thng tin nhm mc ch m bo an ton v bo
mt thng tin r rng hai kha cnh. Mt l bo mt cho gi liu c em
giu, hai l bo mt cho chnh i tng c dng giu tin. Hai kha cnh
khc nhau ny dn n hai khuynh hng k thut ch yu ca giu tin.
Khuynh hng th nht l giu tin mt. Khuynh hng ny tp trung vo cc
k thut giu tin sao cho thng tin giu c nhiu v quan trng l ngi

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

30
khc kh pht hin c mt i tng c b giu tin bn trong hay khng.
Khuynh hng th hai l thu vn s. Khuynh hng thu vn s nh giu
vo i tng nhm khng nh bn quyn s hu hay pht hin xuyn tc
thng tin. Thu vn s c min ng dng ln hn nn c quan tm nghin
cu nhiu hn v thc t c nhiu nhng k thut dnh cho khuynh hng
ny. Mi ng dng ca thu vn c yu cu ring, do cc k thut thu
vn cng c nhng tnh nng khc bit tng ng
Trong k thut giu tin, th thu vn nh s ang c quan tm nhiu.
Khi thc hin thu vn nh s th cn phi c mt s tnh cht nh gi
cht lng ca gii thut. Cc tnh cht nh sau:
Tnh v hnh (Imperceptibility): Khi nhng thu vn vo trong nh, th phi
a theo gii thut thch hp ngi dng khng nhn thy s thay i .
Thu vn phi khng nh hng nhiu n cht lng ca nh. Thng thng
cc bit t nhy cm s c u tin dng cha thu vn.
Tnh bn vng (Robustness): Ty vo tng loi ng dng m c th xem
tnh bn vng ny bng nhiu im khc nhau, nu nh i vi cc ng dng
dng bo v quyn s hu th thu vn cn phi bn vng qua mt s cc
tc ng nh. Nu nh i vi ng dng chng lm gi hoc chng li s
thay i trn phng tin k thut s th i hi thu vn phi hu b khi xy
ra cc thao tc ny.
Tnh khng phn chia (Inseparability): Sau khi nh cha thu vn th rt
kh hoc khng th phn chia thnh 2 thnh phn ring bit nh lc u.
Bo mt (Security): Sau khi a thu vn nh, th yu cu l ch cho php
nhng ngi c quyn s dng dng c chnh sa v pht hin c thu
vn iu ny c thc hin nh vo kha m dng lm kho trong gii thut
a thu vn vo nh s v gii thut pht hin ra thu vn trong nh s.

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

31
Thu vn s c ng dng rt rng trong nhiu lnh vc, di y s lit k
mt s ng dng chnh ca thu vn.
Bo v quyn s hu (Copyright Protection): y l ng dng c bn nht
ca k thut thy vn. Mt thng tin no mang ngha quyn s hu tc
gi s c nhng vo trong cc sn phm, thy vn ch mt mnh ngi
ch s hu hp php cc sn phm c v c dng lm minh chng cho
bn quyn sn phm. bo v cc sn phm chng li cc hnh vi ly cp
hoc lm nhi cn phi c mt k thut "dn tem bn quyn" vo sn phm
ny. Vic dn tem hay chnh l vic nhng thy vn cn phi m bo khng
li mt nh hng ln no n vic cm nhn sn phm. Yu cu k thut
i vi ng dng ny l thy vn phi tn ti bn vng cng vi sn phm,
mun b thy vn ny m khng c php ca ngi ch s hu th ch cn
cch ph hu sn phm.
Chng nhn bn bt hp php (Copy Protection): Cc sn phm c cha
thu vn s biu hin cho vic sn phm ny khng c nhn bn, v nu
nhn bn s phm lut. Nh sn xut s trang b cho cc phng tin dng
nhn bn (nh CD writer) kh nng pht hin xem nh c cha thu vn
hay khng, nu c th s t chi khng nhn bn.
Theo di qu trnh s dng (Tracking): Thu vn s c th c dng
theo di qu trnh s dng ca nh s. Mi bn sao ca sn phm c cha
bng mt thu vn duy nht dng xc nh ngi c quyn s dng l ai.
Nu c s nhn bn bt hp php, th c th truy ra ngi vi phm nh vo
thu vn c cha bn trong nh s.
Chng gi mo (Tamper Proofing): Thu vn s c th c dng chng
s gi mo. Nu c bt c s thay i no v ni dung ca cc nh s th thu
vn ny s b hu i. Do rt kh lm gi cc nh s c cha thu vn.

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

32
Theo di truyn thng (Broadcast Monitoring): Cc cng ty truyn thng
v qung co c th dng k thut thu vn qun l xem c bao nhiu
khch hng dng dch v cung cp.
Truyn tin b mt (Concealed Communication): Bi v thu vn s l mt
dng c bit ca vic n d liu nn ngi ta c th dng truyn cc
thng tin b mt.
Thu vn s l mt trong nhng k thut giu d liu hin i. N
c nh ngha nh l qu trnh chn thng tin vo d liu a phng tin
nhng bo m khng cm th c, ngha l ch lm thay i nh d liu
gc.
Tt c cc phng php thu vn u c chung cc khi sau: mt h
thng nhng thu vn v mt h thng khi phc thu vn.







Hnh 4.3. S nhng thu vn
Hnh 4.3 trnh by qu trnh nhng thu vn tng qut. D liu u vo
l thu vn, d liu cn nhng v m c nhn hay cng cng. Thu vn c th
bt k dng no nh ch s vn bn hay hnh nh. Kho c th c dng
tng cng tnh bo mt, ngha l ngn chn nhng k khng c bn quyn

Thu vn
D liu
gc
D liu
nhng
M c nhn/
cng cng

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

33
khi phc hay ph hy thu vn. Cc h thng thc t dng t nht l mt
kho, thm ch kt hp nhiu kho. D liu u ra l d liu c thu
vn.






Hnh 4. 4. S tch thu vn
Qu trnh khi phc thu vn tng qut c cho Hnh 4.4. Cc d
liu u vo l d liu thu vn, kho v d liu gc (c th c hoc khng
tu thuc vo phng php). D liu u ra hoc l thu vn khi phc c
hoc i lng no ch ra mi tng quan gia n v thu vn cho trc
u vo.
Trong k thut thu vn th thng tin nhng c th l mt chui cc k
t, hay mt hnh nh no ... Vi kiu thu vn dng chui cc k t nhng
trc tip ln nh mang mt s thng tin thng l nhng thng tin c lin
quan n sn phm. Tuy nhin, kiu ny c mt hn ch l mt bit b li
th s lm sai c k t v ch cn mt php bin i n gin cng c th lm
cho thu vn b sai lch rt nhiu. Ngoi kiu thu vn dng chui cc k t
nhng trc tip, th kiu s dng nh nhng s cho nh trong nh. Khi gii
tin th mt s im nh c th b sai nhng hnh tng th s c gi nguyn.

Thu vn
D liu
nhng
Khi phc
thu vn
M c nhn/
cng cng

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

34
C nhiu php bin i cho nhng thu vn, mt trong cc php bin
i l php bin i sng nh ri rc (DWT).
Do c tnh a phn gii, s m ho Wavelets c bit thch hp cho
cc ng dng m tnh v hng v suy bin ng vai tr quan trng. Minh
chng cho iu ny l php bin i DWT c dng nh mt tiu
chun trong nn JPEG2000. Ngoi ra, tnh a phn gii ca Wavelets cn hu
ch trong vic phn phi thng ip vo i tng bao ph trong khi vn
m bo tnh bn vng v cht lng hin th. Do , k thut thu vn
nh s dng DWT lm d bo s sng cn ca thu vn sau tc ng nn c
tn hao JPEG2000 trong khi vn m bo s suy gim cht lng nh cho
php. Ni mt cch tng qut, bin i sng nh thc hin khai trin tn s -
khng gian a t l ca mt nh. Khai trin ny to ra cc h s xp x v cc
h s chi tit ngang, dc v cho. Qu trnh khai trin li tip tc vi cc h s
xp x cc mc phn tch cao hn. Cc h s xp x sau cng cha thng tin
v bng tn thp nht trong khi cc h s chi tit cha thng tin v bng tn
cao hn.
K thut thu vn nh s c to ra t b to s gi ngu nhin vi
mt kho b mt. Chiu di ca thu vn xc nh mc thu vn phn vo
nh. Trong phn ln trng hp, chiu di thu vn cng ln th mnh
thu vn i hi cng nh. Nhng ni chung, khng c chiu di thu vn
thch hp cho tt c cc nh.
Trong qu trnh nhng thu vn, chng ta thc hin DWT cho nh.
Mt tp cc h s ln nht (c chiu di bng chiu di thu vn) trong bng
tn thch hp c tch ra v cng vi thu vn. T c th thy rng cc
h s gc rt cn thit cho qu trnh tch.

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

35
Sau y l mt thut ton thy vn s dng php bin i DWT do tc
gi xut. Thut ton ny thy vn mt chui bit nh phn vo mt bc nh
ch a cp xm. Tuy nhin c th d dng m rng cho cc nh mu bng
cch nhng thy vn vo mt trong cc lp mu ca nh.

* M t thut ton
- Input:
Mt nh nh hoc mt dy cc bt nh phn c s dng lm thu vn
Mt nh F cn nhng thu vn bo v bn quyn
Mt kho b mt nhng v gii thu vn

- Output:
Mt nh sau khi thu vn, F

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

36
- Qui trnh nhng thu vn















c nh ch , thu vn v
kha b mt K
Dng DWT, phn tch nh ch thnh 4
bng A1, H1, V1, D1
t kho K lm ging
v sinh 2 chui gi ngu nhin
Ti nhng im thu vn bng 0, cng thm cho gi
tr tng ng ca bng H1 v V1 mt s gi ngu
nhin tng ng trong hai chui

Tng hp nh ch bng IDWT t cc bng A1, D1
v cc bng nhng thu vn H1 v H2


S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

37
- Qui trnh tm li thu vn

















c nh ch thu vn
c thu vn gc v kha K
Phn tch DWT mc 1 cho nh ch
thu vn
t kho K lm ging cho b sinh chui
gi ngu nhin
Tnh cc h s ng tng quan gia cc bng
H1, V1vi cc dy s gi ngu nhin
Xc nh cc bit thu vn thng qua
cc h s ng tng quan

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

38
* Chng trnh thc nghim trn MATLAB7
+ Chng trnh nhng thy vn
%Mc ch: Nhng thu vn vo nh ch bng DWT
clear all;

% ghi lai thi gian bt u
tgbd=cputime;

k=2; % t h s nhng

% c nh ch
tentep='_Bachtuyet_std_bw.bmp';
anhchu=double(imread(tentep));

% xc nh c ca nh ch
Mc=size(anhchu,1);
Nc=size(anhchu,2);

% c nh thu vn v chuyn thnh mt vector
tentep='_Banquyen.bmp';
thuyvan=double(imread(tentep));
Mm=size(thuyvan,1);
Nm=size(thuyvan,2);
thuyvan_vector=round(reshape(thuyvan,Mm*Nm,1)./256);

% c kho lm trng thi cho b sinh s gi ngu nhin
tentep='_key.bmp';

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

39
key=double(imread(tentep))./256;

% t trng thi cho b sinh s gi ngu nhin v trng thi "key"
rand('state',key);
% bin i DWT mt mc cho nh ch
[cA1,cH1,cV1,cD1] = dwt2(anhchu,'haar');

% cng thm dy s gi ngu nhin vo cc bng H1 v V1 khi thuyvan
= 0
for (kk=1:length(thuyvan_vector))
pn_sequence_h=round(2*(rand(Mc/2,Nc/2)-0.5));
pn_sequence_v=round(2*(rand(Mc/2,Nc/2)-0.5));

if (thuyvan_vector(kk) == 0)
cH1=cH1+k*pn_sequence_h;
cV1=cV1+k*pn_sequence_v;
end
end

% bin i ngc (tng hp) IDWT
anhchu_thuyvan= idwt2(cA1,cH1,cV1,cD1,'haar',[Mc,Nc]);

% chuyn sang dng uint8
anhchu_thuyvan_uint8=uint8(anhchu_thuyvan);

% ghi nh ch thu vn ln a
imwrite(anhchu_thuyvan_uint8,'anhchu_thuyvan_dwt.bmp','bmp');

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

40

% hin thi gian thc hin
elapsed_time=cputime-start_time,

% hin nh thu vn
figure(1)
imshow(anhchu_thuyvan_uint8,[ ])
title(Anh da duoc thuy van)


+ Chng trnh gii thy vn
%Mc ch: Gii thu vn t nh c nhng thu vn bng DWT

clear all;

% ghi li thi gian bt u
tgbd=cputime;

% c nh thu vn bng DWT
tentep='anhchu_thuyvan_dwt.bmp';
anhchu_thuyvan=double(imread(tentep));

%xc nh c ca nh ch
Mw=size(anhchu_thuyvan,1);
Nw=size(anhchu_thuyvan,2);

% c nh thu vn gc

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

41
tentep='_Banquyen.bmp';
thuyvan_goc=double(imread(tentep));

Mo=size(thuyvan_goc,1);
No=size(thuyvan_goc,2);

% c kho cho b sinh s gi ngu nhin
tentep='_key.bmp';
key=double(imread(tentep))./256;

rand('state',key);

% khi to thu vn tt c bng 1
thuyvan_vector=ones(1,Mo*No);

[cA1,cH1,cV1,cD1] = dwt2(anhchu_thuyvan,'haar');

% Tnh cc h s ng tng quan gia cc bng cH1, cV1 vi cc dy
gi ngu nhin
for (kk=1:length(thuyvan_vector))
pn_sequence_h=round(2*(rand(Mw/2,Nw/2)-0.5));
pn_sequence_v=round(2*(rand(Mw/2,Nw/2)-0.5));

correlation_h(kk)=corr2(cH1,pn_sequence_h);
correlation_v(kk)=corr2(cV1,pn_sequence_v);
correlation(kk)=(correlation_h(kk)+correlation_v(kk))/2;
end

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

42
for (kk=1:length(thuyvan_vector))
if (correlation(kk) > mean(correlation))
thuyvan_vector(kk)=0;
end
end

% hiu chnh thuyvan_vector v hin thu vn tm thy .
figure(2)
thuyvan=reshape(thuyvan_vector,Mo,No);
imshow(thuyvan,[ ])
title('Thuy van da tim thay')

% hin thi gian thc hin
tgth=cputime tgbd

4.3. xut qui trnh nn v thy vn nh trong my nh s.
Cn c qui trnh nn nh trong phn 3.3, c th a ra mt qui trnh kt
hp vic nn nh vi vic nhng thu vn bn quyn ngay trong cc my nh
s. Qui trnh ny c th bao gm cc bc sau:
1. X l trc bin i
2. Bin i lin thnh phn
3. Bin i ring thnh phn
4. Lng t ho
5. Nhng thy vn bn quyn
6. M ho
Do thi gian c hn nn tc gi mi ch a ra qui trnh nhng cha c
iu kin th nghim.

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

43
KT LUN

* Kt qu t c v ng dng ca lun vn.
Lun vn trnh by cc k thut nn nh, cc nguyn l nn v mt
s khi nim quan trng trong lnh vc x l nh. V tp trung trnh by cc
nguyn l nn c tn hao in hnh ang l cc k thut ct li ca cc chun
nn (JPEG, JPEG2000, MPEG,).
Vi mc ch ca lun vn l nghin cu v k thut nn nh s dng
bin i Wavelet t p dng trong my nh k thut s, nn i su
nghin cu c s l thuyt ca php bin i ny ng thi cng gii thiu
chun nn nh JPEG2000 l chun nn ph bin da trn bin i Wavelet.
Hn na chun ny cng s l mt la chn hiu qu b sung chun JPEG
ang c s dng trong cc server chuyn i nh dng nh.
Lun vn cng gii thiu mt k thut thy vn nhng trong nh s,
mt phng tin, mt cng ngh mi c nh gi mang li nhiu ha hn
trong ng dng bo v bn quyn, pht hin xuyn tc, iu khin truy cp
i vi cc d liu a phng tin. Qua qu trnh kho st, c th kt lun
rng thc hin k thut thu vn nh s trong min DWT lm cho h thng
tr nn mnh m v bn vng trong khi vn m bo yu cu, c bit l
trong cc tc ng nn JPEG2000, lc trung bnh, lc Gaussian, lc sc nt v
co dn nh. Xt v mt thi gian cng nh phc tp th vic thc hin
nhng thu vn trong min DWT l hon ton kh thi. iu ny m ra mt
hng nghin cu dng php bin i sng nh trong k thut thu vn cho
cc ng dng i hi thi gian thc nh iu khin v chng sao chp hay
xc nhn ly du tay.



S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

44
* Hng pht trin nghin cu.
Tc gi xin cp mt s hng nghin cu trong tng lai:
- Tin hnh thc hin k thut nhng thu vn cho chui d liu video
vi mt s iu chnh hp l t kt qu tt hn.
- Kt hp thc hin vi d liu audio nhng thu vn cho d liu ca
cc phng tin k thut s khc.

S ha bi Trung tm Hc liu i hc Thi Nguyn http://www.lrc-tnu.edu.vn

45
TI LIU THAM KHO

1. PGS. TS. H Anh Tu - X l tn hiu s (2002)
2. Lng Mnh B - TS. Nguyn Thanh Thu - Nhp mn x
l nh s(1999)
3. Nguyn Kim Sch X l nh v video s NXB KHKT, 1997
4. Anil K. Jain - Fundamental of Digital Image Processing(1994)
5. Geoffrey Davis - Arina Nosratinia - Waveled-Based Image
Encoding - Overview (1997)
6. Jin Li - Image Compression - the Mechanics of the
JPEG2000(2001)
7. Michael David Adams - JPEG2000 - The Next Standard for Still
Image Compressing (12/2002)
8. Martin Vetterli - Jelena Kovacevic - Wavelet and Subband
Coding(1995)
9. R. Mehul and R. Priti, Discrete Wavelet Transform Based Multiple
Watermarking Scheme Proceedings of IEEE Region 10 Technical
Conference on Convergent Technologies for the Asia-Pacific,
Bangalore, India, October 14-17, 2003.
10. Thomas Sikora MPEG-1 and MPEG-2 Digital Video Coding
Standards.
11. Thomas Sikora Digital Video Coding Standards and Their
Role in Video Communications - Signal Processing for
Multimedia, J.S. Byrnes (Ed), IOS Press, 1999.