Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Bip Lecture Note (Bme_tech)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

BI

OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

Uni
t-1(
Fundament
alsofDi
git
alI
mage)

I
mageFor
mat
ion
 Thet
wopar
tsoft
hei
magef
ormat
ionpr
ocess

 Thegeometryofi
mageformati
onwhi
chdeter
mineswher
eint
hei
magepl
anet
he
proj
ect
ionofapoi
nti
nthescenewi
l
lbel
ocat
ed.

 Thephysi
csofli
ghtwhi
chdeter
minesthebrightnessofapoi
nti
nthei
magepl
ane
asafunct
ionofi
l
lumi
nat
ionandsurf
aceproperti
es.

 Asi
mpl
emodel

 Thescenei
sil
l
umi
nat
edbyasi
ngl
esour
ce.

 Thescener
efl
ect
sradi
ati
ont
owar
dst
hecamer
a.

 Thecamer
asensesi
tvi
achemi
cal
sonf
il
m.

 I
mageFor
mat
ionModel
:

 Animageisdenot
edbyat wodimensionalfunct
ionoft
hefor
mf{x,y
}.Theval
ueor
ampli
tudeoffatspatialcoordi
nates{x,y
}i sa posi
ti
vescal
arquanti
tywhose
phy
sicalmeani
ngi
sdet
erminedbythesourceoftheimage.

 Whenani magei sgenerat


edbyaphy si
calprocess,i
tsval
uesarepropor
ti
onalt
o
energy
r adi
atedbyaphy si
calsour
ce.Asaconsequence,f
(x,
y)mustbenonzer
oand
fi
nit
e;thatiso<f
(x,
y)<co.
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 Thef
unct
ionf
(x,
y)maybechar
act
eri
zedbyt
wocomponent
s-

 Theamountoft
hesour
cei
l
lumi
nat
ioni
nci
dentont
hescenebei
ngv
iewed.

 The amountoft he source i


ll
uminat
ion refl
ect
ed back by the obj
ectsi nt he
sceneThesearecall
edill
uminati
onandr ef
lect
ancecomponentsandar edenotedby
i(x,
y)andr(x,
y)respecti
vel
y.Thefunct
ionscombineasapr oducttoformf(x,y
).We
call
theint
ensit
yofamonochr omei mageatanycoordi
nates(x,
y)thegrayl
ev el(l
)of
theimageatthatpoint

l
=f(
x,y
.)

Lmi
n≤l≤Lmax

 Lmi
nist
obeposi
ti
veandLmaxmustbef
ini
teLmi
n=i
minr
min,
Lamx=i
maxr
max

 Thei nterval[Lmin,Lmax]i scalledgr ayscale.Commonpr acti


cei stoshif
tthis
i
ntervalnumer icall
ytotheinter
val[0,L-l]wher
el =0i
sconsideredblackandl=L-1is
consideredwhi teonthegrayscale.All
int er
mediatev
aluesareshadesofgrayofgray
var
yingf rom blacktowhite.

 Vi
sualPer
cept
ion
 Inhumanv i
sual
percepti
on,
theeyesactast
hesensororcamer
a,neur
onsactast
he
connect
ingcabl
eandt hebr
ainact
sastheprocessor
.

 Thebasi
cel
ement
sofv
isual
per
cept
ionsar
e:

1)St
ruct
ureofEy
e

2)I
mageFor
mat
ioni
ntheEy
e

3)Br
ight
nessAdapt
ati
onandDi
scr
imi
nat
ion

1)St
ruct
ureofEy
e:
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 Thehumaney ei sasl ightlyasymmet ri


calspher
ewithanav eragediameterofthe
l
engthof20mm t o25mm.I thasav ol
umeofabout6. 5cc.Theey eisjustli
kea
camera.Theexternalobj ectisseenast hecamerat
aket hepictur
eofanyobj ect
.
Li
ghtenterst
heey et hroughasmal lholecall
edthepupil
,ablacklookingapert
ure
havi
ngthequali
tyofcont ract
ionofeyewhenexposedt obr i
ghtli
ghtandisfocused
ontheret
inawhichislikeacamer af
ilm.

 Thelens,ir
is,andcorneaarenouri
shedbyclearf
luid,knowasant
eri
orchamber.The
fl
uidflowsfrom cil
iar
ybodyt ot
hepupilandisabsorbedthr
oughthechannel
sinthe
angleoft heant er
iorchamber.Thedel i
cat
ebal anceofaqueousproducti
onand
absorpti
oncont r
olspressur
ewithi
ntheeye.

 Conesineyenumberbet ween6to7mi l
l
ionwhichar
ehighl
ysensiti
vetocol
or s.
Humanv i
sual
izest
hecoloredi
mageindayli
ghtduetot
hesecones.Theconevi
sion
i
salsocal
ledasphotopi
corbri
ght
-l
ightv
isi
on.

 Rodsintheeyearemuchlargerbet
ween75to150mil
li
onandar
edi
stri
but
edover
ther
eti
nalsur
face.Rodsar
enotinvol
vedi
nthecol
orv
isi
onandar
esensi
ti
vetol
ow
l
evel
sofill
uminat
ion.

2)I
mageFor
mat
ioni
ntheEy
e:

 Whent helensoftheeyefocusani mageoft heoutsi


deworl
dontoal i
ght-
sensi
ti
ve
membr aneinthebackoftheey e,cal
ledret
inathei
magei sf
ormed.Thelensofthe
eyefocusesli
ghtonthephotorecepti
vecell
softheret
inawhi
chdetect
sthephotons
ofli
ghtandrespondsbyproducingneurali
mpulses.

 Thedistancebetweenthel
ensandt
her
eti
nai
sabout17mm andt
hef
ocall
engt
his
appr
ox i
mat el
y14mm to17mm.

3)Br
ight
nessAdapt
ati
onandDi
scr
imi
nat
ion:

 Theeyesabi
li
tytodi
scr
imi
nateblackandwhit
eatdi f
ferentint
ensi
tyl
evel
sisan
i
mport
antconsi
der
ati
oni
npresent
ingi
mageprocessi
ngresult
.

 Therangeoflighti
ntensit
ylevel
stowhichthehumanvi
sualsy
stem canadaptisof
theorderof1010fr
om t hescotopi
cthr
esholdt
othegl
arel
imit
.Inaphotopi
cvision,
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

t
her
angei
sabout106.

 CCDSensor
s
 TheareaonaCCD( ChargeCoupledDev i
ce)sensorisdivi
dedi nt
opixel
susinga
ser
iesofchannelst
opsandgat es.Whil
ethesensorisexposing,phot
onsthatf
allon
apixel
areconvert
edintoelect
ronsandstoredaschargepackets.

 Tor eadoutthesensoraft
ertheexposure,we‘cl
ock’t
hegatesthatfor
mt hepi xel
s.
Thismov esthechargepacketsdownt heimagesensorandi ntothehorizontal
readoutregist
er.Onceinthi
sregist
er,wecanuseasi mi
larmethodofclockingt o
mov ethechar gepacket
sonebyonet oanampl i
fi
erthatconv
ertsthenumber sof
electr
onst oavolt
age.

 Becauset hi
sdigit
alconversionhappensoutsi
dethesensor,ahighquali
ty16bi t
anal
oguet odigi
talconver
ter(ADC)canbeused.Everypi
xeli
salsobeingconvert
ed
usi
ngt hesameampl ifi
erwhichgivesexcel
l
entpi
xelt
opixelr
epr
oducibi
li
ty,
resul
ti
ng
i
nsensor swithexcel
lentl
i
near i
ty.

 CMOSSensor
s
 CMOS( orCompl ementaryMet al-
Oxide-Semiconduct
or)aseachpixelcanber ead
i
ndividuall
yandsi multaneously,andal argenumberofADCsar eused,thi
sgreatl
y
i
ncreasest hereadspeedoft hesensor .Italsomeanst hattheADC andimage
sensorar eont hesamesi l
icondi e,whi chcangi vev erylow r
ead noi
se.Itis
i
mpor t
anttonot e,though,thatr eadnoi seonaCMOSsensori sli
nkedtoful
lwell
depth,andusi ngt hesensorati tsl owestr eadnoisesetti
ngsisusuall
yatt he
expenseofwel ldepth.Atthef ullwelldepthswet endt
ousef ordeepskyimagi
ng.
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

I
magesampl
ing,
ImageQuant
izat
ion
 Tocreat
eadigi
tali
mage,
weneedt oconv
ertt
heconti
nuoussenseddat
aint
odi
git
al
for
m.Thisi
nvol
vestwopr
ocesses:
sampli
ngandquanti
zati
on.

 Acont i
nuousimageƒt hatwewantt oconver
tt odi
gitalf
orm.Animagemaybe
cont
inuouswithrespecttothex-andy -
coor
dinat
es.andal soinamplitude.To
conv
ertittodi
git
alfor
m,wehav etosamplethefuncti
oninbothcoor
dinat
esandi n
ampli
tude.Digi
ti
zing t
he coor
dinatev al
ues i
s call
ed sampli
ng.Digit
izing t
he
ampli
tudeval
uesiscall
edquant
izat
ion.

 Sampl
ingPr
ocess:

 Inordert oprocesst hesignaldigital


ly,thesi gnaltobet ransmi t
tedmustbei nt he
discretetimef orm.Ifthemessagesi gnali scomi ngf r
om adi git
alsour ce(e.g.a
digit
alcomput er)theniti
sint hepr operf ormf orprocessingdigital
ly.Butthisisnot
alway sthecase.Themessagesi gnalcanbeanal oginnat ur
e( e.g.speechorv ideo
signal).I
nsuchacasei thastobef i
rstconv ertedintoadiscretet i
mesi gnal.Weuse
the" samplingprocess"todot his.Thususi ngt hesampl i
ngpr ocessweconv erta
continuoust i
mesi gnali
ntoadi scretetimesi gnal.Forthesampl ingpr ocesstobeof
practicaluti
li
tyitisnecessaryt ochooset hesampl i
ngrat eproperly.Thesampl i
ng
processshoul dsatisf
ythefoll
owi ngrequi rement s:

 Sampl
edsi
gnal
shoul
drepr
esentt
heor
igi
nal
signal
fai
thf
ull
y.

 Weshoul
dbeabl
etor
econst
ructt
heor
igi
nal
signal
from i
tssampl
edv
ersi
on.

Fi
g.2.86(a):
sampling
pr
ocess
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 Quant
izat
ionPr
ocess:

 Quantizati
onisapr ocessofappr oximationorr oundingoff.Thesampledsignalis
appli
ed t othe quanti
zerbl ock.Quant i
zerconv ertsthe sampled si
gnalinto an
approximatequantizedsignalwhichconsi stsofonlyaf i
nitenumberofpredecided
volt
agel evel
s.Eachsampl edv al
ueatt hei nputofthequantizeri
sapproxi
mat edor
roundedof ftotheneareststandardpredeci dedvol
tagelevel
.Thesestandar
dl evel
s
areknownast he"quanti
zati
onl evel
s".Refert oFi
g.2.90tounderstandtheprocess
ofquant i
zati
on.

 Two-
dimensi
onalsampl
ingt
heor
y
 Giv
enacont i
nuousfunct
iong(
x,y)wemayr epr
esentitwithanarr
ayofsampl
ed
val
ues.Thecl
osert
hesamplesare,
thebet
tert
hereconst
ruct
ionwi
l
lbe.

 Foraparti
cul
arclassoffuncti
ons,cal
l
edband- l
imi
ted,thereconstruct
ioni
sexacti
f
thespaci
ngamongsampl esdoesnotexceedacertainli
mi t
.Thisresul
tisknownas
theWhitt
aker
-Shannontheorem andwewillder
ivei
tbriefl
yinthefoll
owing.

 Consi
derasampl
edv
ersi
onoft
hef
unct
iong(
x,y
)

(
1.51)

 So thatGsconsi
stsofmanysamplessepar
ated byadi
stanceX al
ongt
hex
di
recti
onsot
hatandadi
stanceYal
ongt
heydir
ecti
on.

 Thespect
rum ofthesampl
edf
unct
ioni
sobt
ainedi
mmedi
atel
ywi
tht
heappl
i
cat
ion
oft
heconvol
utiontheor
em:

(
1.52)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 TheFouriert
ransfor
m oft
hecomb(
)funct
ioni
sanot
hercomb f
unct
ioni
nthe
fr
equencydomain:

(
1.53)

 Henceweobt
ain:

(
1.54)

 Hence,bydecr easi
ngt hesamplinginterval
sXandY,t hedi st
ances1/ Xand1/ Y
betweenconsecutiv
er egi
onsR( i
nt hefrequencyplane)i
ncreaseandt her egi
onsR
wil
leventuall
ynolongeroverl
ap.Final
lythespectr
um Gcanbeexact l
yr ecover
edby
fi
lt
eri
ngG,wi thaf i
lt
erthatpassesonl yonet erm of(1.54),suchas( n=0,
m=0)
wit
houtintroduci
nganydistor
ti
on.

 Hexagonalsampl
i
ng
 Hexagonalsamplingi st heopti
malsampl i
ngschemef orsi
gnalswhichar eband
l
imi t
edoveraci r
cularr egi
onoft heFourierpl
ane,inthesensethatexactr econ
struct
ionofthewav eformr equi
resal owersampli
ngdensi
tythanwithalternati
ve
schemes.Forsuchsi gnalshexagonalsampli
ngrequir
es13.4percentfewersam
plesthanrect
angularsampl i
ng.

 Model
shumanv
isual
syst
em mor
epr
eci
sel
y

 Thedi
stancebet
weenagi
venpi
xel
andi
tsi
mmedi
atenei
ghbor
sist
hesame

 Hexagonal
sampl
i
ngr
equi
res13%f
ewersampl
est
hanr
ect
angul
arsampl
i
ng

 Nonuni
for
m sampl
ing
 Nonuniform sampli
ngisabranchofsampli
ngtheor
yinvol
vi
ngresul
tsr
elat
edtothe
Nyquisttheorem.Nonunif
orm sampl
ingi
sbasedont herel
ati
onshi
pbetweeni
tsel
f
andthe( uni
form)sampli
ngtheorem.

 Thati
s,sampl
esnott akenequall
yspacedint i
me.Thesampli
ngt heor
yf ornon-
uni
for
m sampl
ingstat
est hataband-l
imi
tedsignalcanbeper
fect
lyreconstr
ucted
fr
om i
tssampl
esift
heav eragesampl
i
ngratesati
sfi
estheNy
qui
stconditi
on.

 Theaveragesampli
ngr at
e(uni
for
m orot
her
wise)mustbet
wicet
heoccupi
ed
bandwi
dthoft
hesignal
.
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 Opt
imalSampl
ing
 theinter
pr et
ati
ont hatthesampl ingprocesst r
ansformsacont i
nuousf unctionf(x, y
)
i
ntoasequencef (mAx,nAy )f r
om whi cht heor i
ginalfuncti
oncanber ecovered.
Therefor
e,t hecoef fi
cientsofanyconv er
gentser iesexpansionoff (x,y )canbe
consideredtogi veagener al
izedf orm ofsampl ing.Suchsampl ingi snotr est
ricted
tobandlimi t
edf uncti
ons.Forbandl imit
edf unctionst hesincfunctionsar eopt imal
forrecov eri
ng the originalf uncti
on f(x,y)f rom t he samples f(mAx,nAy ).For
bandlimi
t edrandom fields,ther econstr
uctedr andom f i
eldconvergestot heor i
ginal
i
nt hemeansquar esense.

 t
her
ear efuncti
onsthatar
eopti
mali nthesenset
hatt
heysampl
earandom image
t
ogiveaf i
nit
esequencesuchthatthemeansquareerr
orbet
weent
heorigi
naland
t
hereconstr
uctedi
magesisminimized.

 themeansquar eerr
orinthereconst
ruct
edimageismini
mum amongallpossi
ble
sampling f
unct
ions.Thi
s propert
yis usef
ulin dev
eloping dat
a compr
essi
on
techni
quesfori
mages.

 Nonuni
for
m Quant
izat
ion
 Thekeydi f
fer
encebetweenunif
orm andnonunif
orm quant
izati
oni sthatuni
for
m
quanti
zat
ionhasequalstepsi
zeswhil
e,innonuni
for
m quantizat
ion,thestepsi
zes
arenotequal
.

 Quanti
zati
onmeansf i
rsttot akeanalogsi
gnalaft
erconverti
ntodi gi
talfor
m.After
thatI
ttakesthesampledi nputandgeneratesthequant
izedout put.Thequal
it
yof
thequanti
zerout
putdependsont henumberofquantizat
ionlevel
s.Fur t
hermor
e,the
spacebetweentwoadjacentquantizati
onl
evel
siscal
ledstepsize.

 Innonuni
for
m quant i
zati
on,thest epsi zeisunequal .Aft
erthequanti
zati
on,the
dif
fer
encebet
weenani nputval
ueandi t
squant i
zedv al
ueiscall
edthequanti
zati
on
err
or.Asmentionedabove,inuni
form quantizat
ion,
thestepsizeisequal
.Theref
ore,
somepartofthesignalmightnotcover.Thiscanincreasequant
izat
ioner
ror.

 However,i
ncaseofnonunif
orm quant
izati
on,t
hestepsi
zechangessoitwi
llhav
ea
minimum amountofer r
or. Aftercompleti
ngthequantizat
ion,t
henextstepis
encodi
ng.I
tdefi
neseachquanti
zati
onlevelbyabi
narycode.
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

I
mageFor
mat
s
 I
maget
ypessuchaTI
FFar
egoodf
orpr
int
ingwhi
l
eJPGorPNG,
arebestf
orweb.

1)TIFF(
.t
if,
.ti
ff)TaggedI
mageFi l
eFormatthi
sformatst
orei
magedatawi t
houtl
osing
anydata.Itdonotperf
orm anycompressi
ononimageshaveahigh-qual
i
tyimageis
obtai
nedbutsi zeofimagei salsolar
ge,whichisgoodforpr
inti
ng,prof
essi
onal
pri
nti
ng.

2)JPEG( .
jpg,.
jpeg)JointPhotographi
cExper
tsGroupisaloss-
pr one(lossy)for
mati n
whichdataisl osttoreducesizeofimage.Duetocompr ession,somedat aislost
butthatlossi sv er
yl ess.Iti
sav er
ycommonf ormatandar egoodf ordigit
al
cameras,nonprofessi
onal pr
int
s,E-Mai
l,
Powerpoi
ntetc.
,makingi ti
dealforwebuse.

3)GIF(.gi
f)GIForGraphi
csInt
erchangeFor
matfi
lesareusedforwebgraphics.
They
canbeani matedandarel
i
mi t
edt oonl
y256col
ors,canal
lowfort
ranspar
ency.GIF
fi
lesarety
picall
ysmal
li
ssizeandareport
abl
e.

4)PNG( .
png)PNGorPor tabl
eNetwor
kGr
aphi
csfil
esar
ealossl
essimagefor
mat
.It
wasdesignedtorepl
acegiffor
matasgi
fsupport
ed256col
orsunl
ikePNGwhi
ch
suppor
t16mi l
l
ioncol
ors.

5)Bi
tmap(.
bmp)Bi
tMapImagefi
lei
sdev
elopedbyMi
crosof
tforwi
ndows.I
tissame
asTI
FFduel
ossl
ess,
nocompr
essi
onpr
operty
.

 Ty
pesofnei
ghbor
hoods
 Ther
ear
etwodi
ff
erentway
stodef
inet
henei
ghbor
sofapi
xel
Plocat
edat
:(
x,y
)

1)4-
nei
ghbor
s

 The4-neighborsofpixelp,denot
edbyN_ 4(
p),ar
ethefourpi
xelslocat
edat(x-y,
1)
(x+y
,1)(
x,y-1)and(x,y+1)t herear
e,respecti
vel
y,abov
e(nort
h),below (
sout
h),to
thel
eft(west)andri
ght(east)oft
hepixelp.

2)8-
nei
ghbor
s

 The8-
neighbor
sofpi xelp,denotedbyN_ 8(p)
,includethefour4-
nei
ghborsandfour
pi
xel
s along the diagonaldi r
ecti
on located at( x-
1,y
-1)(
x+1,
y+1) (
x+1,
y-1) (
x-
1,
y+1)
(nort
hwest)
,(northeast
),(
southwest)and(southeast
).
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 Adj
acency:
 Letvbethesetofgr ay–levelval
uesusedt odef
ineadj
acency,i
nabi nar
yimage,
V={1}
.Inagr ay
-scal
ei mage,theideaisthesame,butVt ypi
cal
lycontai
nsmore
el
ements,
forexample,V={180,181,182,
…,200}
.

 I
fthepossi
blei
ntensi
tyv
alues0–255,Vsetcanbeanysubsetoft
hese256v
alues.
i
fweareref
erencetoadj
acencyofpi
xel
wit
hv al
ue.

 Thr
eet
ypesofAdj
acency
:

1)4-Adj
acency–t
wopi
xel
PandQwi
thv
aluef
rom Vi
sint
heset
N4(
P)

2)8-Adj
acency–t
wopi
xel
PandQwi
thv
aluef
rom Vi
sint
hesetN8(
P)

3)M-
adj
acency

 Connect
ivi
ty:
 LetSr epresentasubsetofpixel
sinanimage,twopi xel
spandqar esai dtobe
connectedinSi fther
eexist
sapathbetweenthem consi
sti
ngent
ir
elyofpixel
sinS.
Foranypi xelpi nS,t hesetofpixel
sthatareconnectedtoitinSi scalleda
connectedcomponentofS.I fitonl
yhasoneconnectedcomponent,thensetSi s
cal
ledaconnect edset
.

 Regi
on:
 LetRbeasubsetofpi
xel
sinani
mage,wecal
lRar
egi
onoft
hei
magei
fRi
sa
connect
edset
.

 whenwerefertoaregion,wear ereferr
ingtosubsetofani
mage,andanypi
xel
sin
t
heboundar
yoft heregionthathappent ocoinci
dewitht
hebor
derofthei
mageare
i
ncl
udedimpli
cit
lyaspartoftheregionboundary.

 Boundar
yar
ies
 A boundaryisacont ourint heimageplanethatr
epr
esent
sachangei
npi
xel
ownershi
pfrom oneobjectorsur
facet
oanother
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 Col
ormodel
s
 Thepur poseofacol ormodeli stof acil
i
tatet hespecifi
cat
ionofcol orsinsome
standard.Inessence,acol ormodelisaspeci f
icati
onofacoor dinatesyst
em anda
subspacewi thi
nthatsy stem whereeachcol ori
sr epresent
edbyasi ngl
epoint.Most
colormodel sar eor i
entedei t
hertowar dspecifichar dwar
eort owardapplicat
ions.
Red,gr een,andbl ue,threeprimarycolors.Conecel lsinhumaney earer
esponsibl
e
forcolorv i
sion.

 Col
ori
magepr
ocessi
ng

 Newtondiscover
edt hatwhenabeam ofsunl ightpassesthroughagl asspr i
sm, t
he
emergi
ngbeam i sspl i
tintoaspect r
um ofcol or
s.Thehumanv i
sualsy stem can
di
sti
nguishhundredsoft housandsofdi f
fer
entcolorshadesandi nt
ensiti
es, butonl
y
ar
ound100shadesofgr ey .Theref
ore,i
nani mage,agr eatdealofextrai
nf ormati
on
maybecont ai
nedi nthecol or
,andt hisextrainfor
mat i
oncant henbeusedt o
si
mplif
yimageanal y
sis.
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

Uni
t-2(
ImageEnhancementi
nSpat
ialandFr
equencydomai
n)

 BASI
CGRAYLEVELTRANSFORMATI
ONS:
1)I
magenegat
ive

2)Logt
ransf
ormat
ions

3)Powerl
awt
ransf
ormat
ions

4)Pi
ecewi
se-
Lineart
ransf
ormat
ionf
unct
ions

 LI
NEARTRANSFORMATI
ON:

 Li
neart
ransf
ormat
ioni
ncl
udessi
mpl
eident
it
yandnegat
ivet
ransf
ormat
ion.

 I
denti
tytr
ansit
ionisshownbyast r
aightli
ne.Inthi
st r
ansiti
on,eachval
ueoft he
i
nputimageisdirect
lymappedtoeachot herval
ueofout puti
mage.Thatresul
tsin
t
hesamei nputimageandoutputi
mage.Andhencei scal
ledidenti
tytr
ansf
ormat
ion.

 NEGATI
VETRANSFORMATI
ON:

 Thesecondl ineart
ransfor
mati
onisnegat i
vetransfor
mation,whi
chisinver
tof
i
denti
tytr
ansformati
on.Innegat
ivet
ransf
ormati
on,eachv al
ueofthei
nputi
mageis
subt
ract
edfrom theL-1andmappedontotheoutputimage

 I
MAGENEGATI
VE:

 Theimagenegativ
ewi t
hgr ayl
evelv
aluei
ntherangeof[
0,L-
1]i
sobt
ainedby
negat
ivet
ransf
ormati
ongiv
enbyS=T( r
)orS=L-1–r

Wher
er=gr
ayl
evel
val
ueatpi
xel
(x,
y)

Li
sthel
argestgr
ayl
evel
consi
stsi
nthei
mage

I
tresul
tsi
nget
ti
ngphot
ogr
aphnegat
ive.
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 LOGTRANSFORMATI
ONS:
 Thel
ogt
ransf
ormat
ionscanbedef
inedbyt
hisf
ormul
a

S=cl
og(
r+1)
.

 WhereSandrar ethepixelv
aluesoftheoutputandt heinputi
mageandci sa
constant
.Thevalue1isaddedtoeachoft hepi
xelval
ueoftheinputi
magebecause
i
fthereisapixelint
ensi
tyof0int hei
mage,thenlog(0)isequalt
oinfi
nit
y.So,1i
s
added,tomakethemi ni
mum valueatl
east1.

 POWER–LAW TRANSFORMATI
ONS:
 Ther
earefur
thertwotr
ansfor
mati
onispowerlawtr
ansf
ormat
ions,t
hati
ncl
udenth
powerandnthr oott
ransf
ormat
ion.Thesetr
ansf
ormati
onscanbegi v
enbyt he
expr
essi
on:

S=Cr
γ

 Thi
ssymbolγi scal
ledgamma,duet owhichthist
ransfor
mationisalsoknownas
gammat r
ansformati
on.Variati
oni nthevalueofγv ar
iestheenhancementoft he
i
mages.Dif
ferentdi
splaydeviceshavethei
rowngammacor r
ecti
on,t
hat’swhythey
di
spl
aythei
rimageatdi f
fer
entintensi
ty,
wher ecandgarepositi
veconstant
s.So

S=C(
r+ε)γ
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 HI
STOGRAM PROCESSI
NG:
 Thehi st
ogr
am ofadi
git
ali
magewi
thgr
ayl
evel
sint
her
ange[
0,L-
1]i
sadi
scr
ete
funct
ionofthef
orm

H(
rk)
=nk

 wher
erkisthekt
hgraylevelandnkisthenumberofpixel
sint
hei
magehav
ingt
he
l
evel
rk.Anormal
i
zedhistogr
am isgi
venbytheequat
ion

P(
rk)
=nk/
nfork=0,
1,
2,
…..
,
L-1

 P(
rk)gi
vestheest
imateoftheprobabi
li
tyofoccur
renceofgrayl
evelr
k.Thesum of
al
lcomponentsofanormal i
zedhist
ogram i
sequalt o1.Thehist
ogram pl
otsare
si
mpleplot
sofH(r
k)=nkver
susrk.

 Inthedar ki
maget hecomponentsofthehist
ogr
am areconcentr
atedont
hedar
k
sideofthegrayscale.
Thehist
ogr
am ofalowcont
rasti
magewi l
lbenarr
owandwi
ll
becenteredt
owardst hemiddl
eofthegr
ayscal
e.

 Thecomponent
soft
hehi
stogr
am i
nthehi
ghcont
rasti
magecov
erabr
oadr
angeof
thegr
ayscal
e.
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 I
MAGECOMPRESSI
ONMODELS

 As an i mage compr ession sy


stem i s composed of two dist
inctf uncti
onal
component s:anencoderandadecoder .Theencoderperf
ormscompr essi
on,and
the decoderper forms t he complementary oper
ati
on ofdecompr ession.Both
operat
ionscanbeper f
or medinsoftware,asisthecasei
nWebbr owser sandmany
commer cialimage-
editi
ng appli
cations,orin a combinati
on ofhar dware and
fi
rmwar e,asi ncommer ci
alDVDpl ayers.Acodeci sadeviceorpr ogr am thati
s
capableofbot hencodi
nganddecodi ng.

 TheEncodi
ngorCompr
essi
onPr
ocess

 The encoderser i
es oft
hree independentoperat
ions.Inthe f
ir
ststage ofthe
encodingprocess,amappertransformsintoa(usual
lynonv
isual
)for
matdesigned
toreducespati
alandtemporal
r edundancy
.

 Run-
lengt
hcodi
ngi
sanexampl
eofamappi
ng.

 Thequant
izeri
nreducestheaccur
acyoft
hemapper
’sout
puti
naccor
dancewi
tha
pre-
est
abl
i
shedfidel
i
tycri
ter
ion.

 I
nt hethir
dandfinalstageoftheencodi
ngprocess,t
hesymbolcoderofgener
atesa
fi
xed-l
engthorvari
able-l
engt
hcodet orepr
esentthequant
izerout
put,andmapsthe
outputinaccor
dancewi tht
hecode.

 TheDecodi
ngorDecompr
essi
onPr
ocess

 Thedecoderofcont ai
nsonlytwocomponent s:asy mboldecoderandani nverse
mapper.Theyper f
orm,inrever
seor der,t
heinver
seoper at
ionsoft heencoder ’
s
symbol encoder and mapper . Because quant
izati
on result
s in irr
eversi
ble
i
nfor
mat i
onloss,aninver
sequantizerbl
ockisnotincludedi
nt hegeneraldecoder
model.
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 Whatar
elossl
essandl
ossycompr
essi
on?
 Lossl
essand lossyfi
lecompressi
ondescr
ibewhet
heral
lor
igi
naldat
acan be
recov
eredwhenthefi
l
eisuncompressed.

 Withlossl
esscompr ession,ever
ybitofdat aori
ginal
lyinaf il
eremainsafteri
tis
uncompressed,andallt
hei nf
ormati
onisrestor
ed.Lossycompr essi
onreducesafil
e
bypermanentl
yelimi
natingcertai
ninf
ormation,
especial
lyredundanti
nfor
mat i
on.

 Lossl
esscompr essi
onrest
oresandrebui
l
dsfil
edat
ainit
sorigi
nalf
orm aft
ert
hefil
e
i
sdecompr essed.Forexample,whenapict
ure'
sfi
l
esizeiscompressed,i
tsqual
i
ty
remai
nsthesame.

 Thefi
l
ecanbedecompressedtoit
sor
igi
nalqual
it
ywi
thoutanyl
ossofdat
a.Thi
s
compr
essi
onmet
hodisalsoknownasr
ever
sibl
ecompr
essi
on.

 I
nlossycompressi
on,thedatainaf il
eisremovedandnotr
est
oredtoit
sori
ginal
f
orm af
terdecompressi
on.Speci
fical
l
y,datai
spermanent
lyr
emoved,whi
chi
swhy
t
hismethodisal
soknownasi r
reversi
blecompr
essi
on.

 Lossl
esscompr
essi
oni
smai
nlyusedt
ocompr
ess:
images,
sound,
text

 Lossycompr
essi
oni
smai
nlyusedt
ocompr
ess:
images,
audi
o,v
ideo

 Var
iabl
elengt
hcodi
ng

 variabl
e-l
engt
hcodewor dst oeachsy mbol
,whereast hemostl i
kel
ysymbolsar e
assignedshortercodewords.I
nthecaseofimagecodi ng,t
hesymbolsmayber aw
pixelval
uesort henumeri
calval
uesobtai
nedattheoutputofthemapperst
age(e.g.
,
diff
erencesbetweenconsecuti
vepixel
s,r
un-
lengt
hs,et
c.).

 Ar
it
hmet
iccodi
ng

 Inar i
thmeti
ccoding,whichcanbetr
acedtothewor kofEl
ias(Abramson[1963])
,a
one-to-onecorr
espondencebet
weensour
cesy mbolsandcodewor dsdoesnotexist
.
Instead,anentir
esequenceofsourcesymbols(ormessage)isassignedasi ngle
arit
hmet iccodewor d.Thecodewor di
tsel
fdefinesani nt
ervalofrealnumber s
between0and1.

 Asthenumberofsy mbolsi
nthemessagei ncreases,theint
erval
usedtorepresenti
t
becomes small
er,and the numberofi nfor
mat ion units(say,bi
ts)requir
ed to
repr
esentt
heint
ervalbecomeslar
ger.Eachsymbol ofthemessagereducesthesize
ofthei
nter
val
inaccordancewithi
tsprobabil
it
yofoccur r
ence.
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 thebasicarit
hmet i
ccodi ngprocess.Here,afi
ve-symbolsequenceormessage,
a1a2a3a3a4,f
rom af our
-symbolsourcei
scoded.Atthestar
toft hecodi
ngprocess,
themessageisassumedt ooccupytheent
irehal
f-
openint
erval[
0, 1)
.Thi
sint
ervali
s
subdi
vided i
nit
ial
l
yi ntof ourregi
onsbasedont heprobabil
i
tiesofeachsour ce
symbol.

 LZW CODI
NG

 Thetechnique,call
edLempel-Zi
v-Wel
ch(LZW)codi
ng,assi
gnsf
ixed-
lengt
hcode
wor
dst ovari
ablelengt
hsequencesofsour
cesy
mbols.

 Akeyfeat
ureofLZW compressi
onhasbeenint
egr
atedi
ntoav
ariet
yofmai
nst
ream
i
magingfi
lefor
mat s,i
ncl
udi
ngGIF,TI
FF,andPDF.ThePNGformatwascr
eat
edto
getar
oundLZW li
censi
ngrequi
rement
s.

 LZW codi ngisconcept ual


lyv erysi mple.Att heonsetoft hecodi ngpr ocess,a
codebookordi cti
onarycont ai
ningt hesourcesy mbolst obecodedi sconst r
ucted.
For8-bitmonochromei mages,t hef ir
st256wor dsoft hedi ctionaryareassignedt o
i
ntensiti
es0,1,2,…,255.Ast heencodersequent i
all
yexami nesimagepi xels,
i
ntensitysequencest hatar enoti nt hedictionaryar epl aced in al
gori
thmi call
y
determined(e.
g.,thenextunused)l ocati
ons.Ifthef i
rsttwopi xelsoftheimagear e
white,forinst
ance,sequence“ 255–255”mi ghtbeassi gnedt olocati
on256,t he
addressfoll
owingt helocationsr eservedforintensit
ylevels0t hrough255.Thenext
ti
met woconsecut ivewhi tepixelsar eencount ered,codewor d256,theaddr essof
thelocati
oncontainingsequence255–255, isusedt or epresentt hem.Ifa9- bi
t,512-
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

worddi
cti
onaryisemploy
edinthecodi
ngprocess,theor
igi
nal(
8+8)bit
sthatwer
e
usedt
orepresentt
hetwopixel
sarer
epl
acedbyasi ngl
e9-bi
tcodewor
d.

 Lossycompr
essi
on

 Lossycompressiontechniquesdel
iberatelyint
roduceacertainamountofdist
ort
ion
totheencodedimage,explori
ngthepsy chovisualr
edundanciesoftheor
igi
nali
mage.
Thesetechniquesmustf indanappr opriatebalancebetweent heamountoferror
(l
oss)andtheresul
ti
ngbi tsavi
ngs.
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 Asagener alguideli
ne,lossycompr essionshouldbeusedf orgener alpurpose
photogr
aphi
ci mages.wher easl osslesscompr essionshould bepreferred when
deali
ngwit
hlineart,t
echnicaldr
awi ngs,cart
oons,etc.ori
magesi nwhichnol ossof
detai
lmaybet ol
erabl
e(mostnot ably,spaceimagesandmedi calimages).

 WAVELETCODI
NG

 wav eletcodi ng isbased on t heideat hatthecoef f


ici
entsofat ransf
orm t hat
decor relat
est hepixel
sofani magecanbecodedmor eef f
ici
entlythantheoriginal
pixelst hemsel ves.I
ft hebasi
sf unct
ionsoft hetransf
orm( i
nt hiscasewav elets)
packmostoft heimpor t
antvisuali
nfor
mat i
onintoasmal lnumberofcoef fi
cients,
ther emai ningcoeffi
cientscanbequant i
zedcoarselyortruncatedt ozerowit
hl itt
le
i
magedi stort
ion.

 Toencodea2^ J×2^
Ji mage,ananaly
zingwavel
et,¥,andmi ni
mum decomposi ti
on
l
evel,
J-P, ar
eselectedandusedtocomputethedi scr
etewavelett
ransform ofthe
i
mage.I fthewav el
ethasacompl ementar
yscalingfuncti
on¢,t hef astwav el
et
tr
ansfor
m canbeused.

 Oneormor elosslesscodingmethods,suchasrun-l
ength,Huff
man,arit
hmetic,and
bit
-pl
anecoding,canbeincorpor
atedintothefi
nalsymbolcodingstep.Decodingis
accompli
shed by i nver
ti
ng the encoding operat
ions,wi t
ht he excepti
on of
quanti
zat
ion,
whi chcannotberever
sedexactl
y.

 Ineithercase,thecomput edtransfor
m conver
tsalar
gepor ti
onoft
heorigi
nalimage
tohor i
zontal,ver
ti
cal,anddiagonaldecompositi
oncoeffi
cient
swithzer
omeanand
Laplacian-l
ikeprobabil
it
ies.Becausemanyoft hecomput edcoeff
ici
ent
scarryli
ttl
e
visualinfor
mat i
on,theycanbequant izedandcodedt
omi nimizei
nter
coeff
ici
entand
codingr edundancy.(Opti
onall
yeitherexpl
aini
n7mar k)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

 CHAI
NCODES

 Chaincodesareusedtorepresentaboundarybyaconnect
edsequenceofstrai
ght
-
l
inesegment sofspeci
fi
edlengthanddirect
ion.Weassumeinthissect
ionthatal
l
curv
es ar e cl
osed,si
mple curves (
i.
e.,curves t
hatare cl
osed and notself
i
ntersect
ing)
.

 Fr
eemanChai
nCodes

 Typicall
y,a chai
n code repr
esentat
ion i
s based on 4-or8-connecti
vi
tyoft he
segment s.Thedi
rect
ionofeachsegmentiscodedbyusi nganumberingscheme,as
i
nFi g.11.
3.Aboundar ycodefor
medasasequenceofsuchdi r
ect
ionalnumbersis
ref
erredtoasaFr eemanchaincode.

 Digitalimagesusual lyareacqui redandpr ocessedi nagr idf ormatwi t


hequal
spaci nginthex-andy -
dir
ections,soachaincodecoul dbegener atedbyfoll
owinga
boundar yin,say ,acl
ockwisedi r
ecti
onandassi gningadi rectiont othesegments
connect i
ngev erypairofpixels.Thislev
elofdet ailgenerallyisnotusedf ortwo
principalreasons:(1)Ther esult
ingchai
nwoul dbequi tel ongand( 2)anysmall
disturbancesal ongtheboundar yduet onoi seori mperf
ectsegment at
ionwould
causechangesi nthecodethatmaynotber elat
edtot hepri
nci palshapefeatur
esof
theboundar y.

 Sl
opeChai
nCodes

 UsingFreemanchai ncodesgener al
lyr equiresr esampl i
ngaboundarytosmooth
smallvari
ati
ons,aprocessthatimpliesdef iningagr i
dandsubsequentl
yassi
gni
ng
al
lboundar ypoint
st otheirclosestnei ghbor sint hegr i
d.Analt
ernati
vetothi
s
approachistouseslopechaincodes( SCCs)( Bribiesca[1992,
2013]
).

 Obtai
ninganSSCr equir
escal cul
ati
ngtheslopechangesbetweencontiguousline
segments,andnormali
zi
ngt hechangestotheconti
nuous(open)int
erv
al(,) .−11
Thisapproachrequi
resdef i
ningthelengt
hoft heli
nesegment s,asopposedt o
Freemancodes,whichr equi
redefini
ngagr i
dandassi gni
ngcurvepointstoi t
—a
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

muchmor
eel
abor
atepr
ocedur
e.

 Lossypr
edi
cti
vecodi
ng

 t
hequant
izerwhi
chreplacesthenear
estint
egerfunct
ionoftheerror
-fr
eeencoder,i
s
i
nser
tedbetweenthesymbolencoderandt hepointatwhichthepredict
ionerr
oris
f
ormed.I
tmapst hepredict
ionerr
orint
oal imi
tedrangeofout -put
s,denotede(n),
whi
chestabl
isht
heamountofcompr essi
onanddi st
orti
onthatoccurs.

 Inordertoaccommodat ethei nser


tionoft hequanti
zationst ep,theer ror
-f r
ee
encoderofmustbeal t
eredsot hatthepr edict
ionsgeneratedbyt heencoderand
decoderar e equi
val
ent.Thisis accompl i
shed by placing the lossy encoder'
s
predi
ctorwithi
naf eedbackloop,wher eitsinput,denotedf (
n),isgeneratedasa
funct
ionofpastpredict
ionsandt hecorrespondingquant i
zeder r
ors.Thatis,f(n)=
e(n)+f(n)

 Twowat
ermar
kedv
ersi
onsoft
hei
mageusi
ngt
heDCT.

1)St
ep1.Comput
ethe2-
DDCToft
hei
maget
obewat
ermar
ked.

2)St
ep2.Locat
eit
sKl
argestcoef
fi
cient
s..
..bymagni
tude.

3)Step3.Createawater
mar kbygener
ati
ngaK-cl
ementpseudo-
random sequenceof
numbers,w1,w2.
..
.wk.takenfr
om aGaussiandist
ri
buti
onwithmeanmu=0and
vari
ancesigma^2=1

4)St
ep4.Embedt
hewat
ermar
kfr
om st
ep3i
ntot
heKl
argestDCTcoef
fici
ent
sfr
om
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

step2usingthefol
l
owingequat i
onci^pri
me=c_ {
i}
(1+alpha*omega_{j
})1<=i<=
K( 8.
3-3)fora speci
fied constantal
pha > 0.
Replace t
he ori
ginalCi
,withthe
computedC'i
;fr
om Eq(8.3-
3).

5)St
ep5.Comput
ethei
nver
seDCToft
her
esul
tfr
om st
ep4.
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)
BI
OMEDI
CALI
MAGEPROCESSI
NG (
BME_
TECH)

You might also like