Professional Documents
Culture Documents
Procesimi Imazheve
Procesimi Imazheve
Procesimi i imazheve
Computer Vision
Segmentation
Procesimi i imazheve Digital Imaging KrijimiinjImazhi Dixhitalizimi injpamje Image Editing (preprocessing) Error Correction Eliminimiizhurms(noise) Rritja/Zvoglimiikontrastit Crop /prerjaefotografis Rrotullimi Image Processing Procesiinxjerrjessinformatavenganjimazh Edge Detection Segmentimi Identifikimiiobjektevennjimazh ReprezentimiiObjekteve ComputerVision/Image Analysis Ekstrahimi /Analizaeatributeveteobjekteve AtributetGjeometrike Klasifikimidheinterpretimiiobjekteve
Ligjerues: Astrit Hyseni
Procesimi i imazheve
E ( x, y, z, )
r ( x, y, z, )
Dritaereflektuarshtfunksioniburimittdritsdhevetivereflektuesetesiprfaqeve tjera:
c( x, y, z, ) = E ( x, y, z, ) r ( x, y, z, )
E ( x, y, z, )
c( x, y, z, ) = E ( x, y, z, ) r ( x, y, z, )
KAMERA(c( x, y, z, )) =
Ligjerues: Astrit Hyseni
( x 1 , y 1 ) = [ c p ( x 1 , y 1 , ) = P ( c ( x , y , z , )])
Cka eshte nje signaldiskret? Kohe diskrete,vlera analoge Cka eshte nje signaldigjital? kohe diskrete,vlera diskrete SignalAnalog signaldiskret analoge,kohe diskrete) Signaldiskret +vlera diskrete diskrete,kohe analoge) Sampling. (vlera Quantization. (vlera
Cka po i bje kjo te dixhitalizimi i nje imazhi? Sampling pixel Quantization intenziteti,ngjyra
Ligjerues: Astrit Hyseni
Procesimi i imazheve Diskretizimi Aliasing Simund ta perkufizojme nje imazh permes nje funksioni?
Funksion2dimensionalosenjematrice f ( x, y )
Ligjerues: Astrit Hyseni
f ( x, y ) [0,255]
10
Procesimi i imazheve
MATLABImageProcessingToolbox.
Vektoret Definimi i nje vektori? >> v = [3 1 4 5 12 15] Sitransformojme nje vektore nga rreshti neshtylle v = [3 1 7 -21 5 6]' Cfare vektori jep sintaksa v = [1:8] Simund ta krijojme nje vektore nete njejten menyre mirepo meinkrement 0.5 v = [1:0.5:4] Cfare rezultati kthen v(1:3)? 3 1 4 Cfare rezultati kthen v(1:2:4)? 3 4 Detyre krijo nje vektore meelementet prej 0,deri ne4nehapa nga 1 u = [0:-1:-4]
11
Procesimi i imazheve
Vektoret Definimi i nje vektori? >> v = [3 1 4 5 12 15] Sitransformojme nje vektore nga rreshti neshtylle v = [3 1 7 -21 5 6]' Cfare vektori jep sintaksa v = [1:8] Simund ta krijojme nje vektore nete njejten menyre mirepo meinkrement 0.5 v = [1:0.5:4] Cfare rezultati kthen v(1:3)? 3 1 4 Cfare rezultati kthen v(1:2:4)? 3 4 Detyre krijo nje vektore meelementet prej 0,deri ne4nehapa nga 1 u = [0:-1:-4]
12
Procesimi i imazheve
Vektoret Definimi i nje vektori? >> v = [3 1 4 5 12 15] Sitransformojme nje vektore nga rreshti neshtylle v = [3 1 7 -21 5 6]' Cfare vektori jep sintaksa v = [1:8] Simund ta krijojme nje vektore nete njejten menyre mirepo meinkrement 0.5 v = [1:0.5:4] Cfare rezultati kthen v(1:3)? 3 1 4 Cfare rezultati kthen v(1:2:4)? 3 4 Detyre krijo nje vektore meelementet prej 0,deri ne4nehapa nga 1 u = [0:-1:-4]
13
Procesimi i imazheve
I ( x, y ) [0,255]
h(i) numriipixelave prejimazhitI qkavlerneintenzitetit i
h(i ) = card{(u , v) | I (u , v) = i}
Ligjerues: Astrit Hyseni
14
Procesimi i imazheve
15
Procesimi i imazheve
Detyre:lexoimazhinlulja01,shenderro neimazhgridhetregohistogramin afer sikurse nefiguren larte. Imread,subplot, subimage,imhist gri_I =0.2989*R+0.5870*G+0.1140 Vetiteimazheveqmundtanalizohenprmeshistogramit. Kontrasti Dinamika Ndriimi
Ligjerues: Astrit Hyseni
16
Procesimi i imazheve
17
Procesimi i imazheve
Detyre:lexoimazhet lulja01,02,03,shenderroi neimazhgridhetregohistogramete tyre nenje matrix3x2 Imread,subplot, subimage,imhist gri_I =0.2989*R+0.5870*G+0.1140
18
Procesimi i imazheve
19
Procesimi i imazheve
20
Procesimi i imazheve
21
Procesimi i imazheve
Bining
8 Bit
h(i ) = card{(u , v) | I (u , v) = i}
14 bit? Bin =kov/kofe Njhistogram imadhesise B(Bnumriikovafe)
22
Procesimi i imazheve
214 = 16384
214 kB = = 64 256
h(0) 0 I (u , v) < 64 h(1) 64 I (u, v) < 128 h(2) 128 I (u, v) < 192 . h( j ) a j I (u , v) < a j +1 . h(255) 16320 I (u, v) < 16384
23
Procesimi i imazheve
POINToperators(Operacionet punktuale)
I ' ( x, y ) = f ( I ( x, y )) i ' f (i )
Siinterpretohetshprehjamelarte? Tentonimeiprmenddisaoperacionepunktuale? Operacionethomogjene Tepavarurangakoordinatat(prsecilinpixel funksionishtinjjte) NdrrimiikontrastitdheIndriimit Invertimi iimazheve Treshholding /Binarizimi Operacionetjohomogjene
I ' ( x, y ) = f ( I ( x, y ), x, y )
24
Procesimi i imazheve
f k (i ) = i 1.5
f n (i ) = i + 10
Kushtrreziku? Overflow?] If i>255theni=255 IfI<0thenI=0 clamping Sieimplementojm nmatlab? Detyr: Lexoimazhinndertesa01.tif,rritjakontrastinper 30%dhetregonenje raster 2x2 imazhinmehistogram pararritjessekontrastitdhepasrritjessekontrastit
25
Procesimi i imazheve
OperatoretPunktual
26
Procesimi i imazheve
Pse thjesht kur mujna mekompliku? clc; gri_I = imread('..\images\ndertesa_01.tif'); [rows,columns]=size(gri_I); subplot(2,2,1); subimage(gri_I); subplot(2,2,3); imhist(gri_I); gri_I =gri_I*1.3; for i=1:rows for j=1:columns if gri_I(i,j)>255 gri_I(i,j)=255; elseif gri_I(i,j)<0 gri_I(i,j)=0; end end end subplot(2,2,2); subimage(gri_I); subplot(2,2,4); imhist(gri_I); Pse mekompliku kur mujna thjesht clc; gri_I = imread('..\images\ndertesa_01.tif'); subplot(2,2,1); subimage(gri_I); subplot(2,2,3); imhist(gri_I); gri_I = gri_I*1.3; gri_I = max(min(gri_I,255),0); subplot(2,2,2); subimage(gri_I); title(sprintf('I(x,y)=I(x,y)*%2.2f ',1.3)); subplot(2,2,4); imhist(gri_I);
27
Procesimi i imazheve
I ' ( x, y ) = f ( I 1 ( x, y ), I 2 ( x, y ).....I n ( x, y ))
AlphaBlending
I ' ( x, y ) = I BG ( x, y ) + (1 ) I FG ( x, y )
Lexoimazhinplazhi.tifsisfond,imazhinanija.tifsikurse prapavi dhebashkoitedyjat mealpha blending mefaktore 0.5.
28
Procesimi i imazheve
29
Procesimi i imazheve
30
Procesimi i imazheve
31
Procesimi i imazheve
I ' ( x, y ) = f ( I 1 ( x, y ), I 2 ( x, y ).....I n ( x, y ))
Operacionet Aritmekore Substrahimi
I ' ( x, y ) = I BG ( x, y ) + (1 ) I FG ( x, y )
32
Procesimi i imazheve
Filtert
I ' ( x, y ) =
p 0 = I ( x, y )
p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 9 I ( x 1, y 1) + I ( x, y 1) + I ( x + 1, y 1) + 1 I ' ( x, y ) = I ( x 1, y 1) + I ( x, y 1) + I ( x + 1, y 1) + 9 I ( x 1, y 1) + I ( x, y 1) + I ( x + 1, y 1)
1 1 1 I ' ( x, y ) = I ( x + i , v + j ) 9 j =11 i =1
Ligjerues: Astrit Hyseni
33
Procesimi i imazheve
Filtert
I ( x 1, y 1) + I ( x, y 1) + I ( x + 1, y 1) + 1 I ' ( x, y ) = I ( x 1, y 1) + I ( x, y 1) + I ( x + 1, y 1) + 9 I ( x 1, y 1) + I ( x, y 1) + I ( x + 1, y 1)
1 9 H (i, j ) = 1 19 9
1 1
1 1 1
9 9 9
1 1 1 1 9 1 = 1 1 1 1 9 9 1 1 1 1 9
Filter Linear
I ' ( x, y ) = I ( x + i, v + j ) H (i, j )
i = 1 j = 1
34
Procesimi i imazheve
I ' ( x, y ) =
Ligjerues: Astrit Hyseni
i = 11 j = 1
I ( x + i, v +
j ) H (i, j )
35
Procesimi i imazheve
36
Procesimi i imazheve
Filterat Linear
Nj lloj tjetr i nj filteri linear. Si interpretohet ky filter.
Matrice enormalizuar
37
Procesimi i imazheve
Filterat Linear
s=
1 H ' (i, j )
Adobephotoshop /Customfilter
38
Procesimi i imazheve
Filterat Linear
a)Boxfilter
b)GaussFilter
c)laplace filter
39
Procesimi i imazheve
I ' ( x, y ) = I ( x + i, v + j ) H (i, j )
i = 1 j = 1
I ' ( x, y ) = I ( x i, v j ) H (i, j )
i = j =
LinearCorrelation
I ' ( x, y ) = I ( x + i, v + j ) H (i, j )
i = j =
LinearConvultion
40
Procesimi i imazheve
I *H = H *I
Lineariteti
( I ) * H = I * ( H ) = * ( I H )
( I1 + I 2 ) * H = ( I1 * H ) + ( I 2 * H )
Asociativiteti
A * ( B * C ) = ( A * B) * C
41
I * H = I * ( H 1 * H 2 * H 3 ...H n )
Ndarjanedydimenzionex,y
42
maxfilter
Ligjerues: Astrit Hyseni
minfilter
43
Procesimi i imazheve
Medianfilteri
44
Procesimi i imazheve
WeightedMedianfilteri
45
Procesimi i imazheve
Edge Detection
Simundtashprehimformalishtnjteh? Sishtdefinicioniinjderivati?
46
Procesimi i imazheve
Edge Detection
Funksioniiintenzitetit nnjdimenzion (vetem nkordinatn xp.sh.)dhe derivati
I ( x. y ) =
(I x) + I y
2
47
Procesimi i imazheve
Edge Detection
Funksioniiintenzitetit nnjdimenzion (vetem nkordinatn xp.sh.)dhe derivati
48
Procesimi i imazheve
Edge Detection
I x x I ( x, y ) = = I y y
I ( x. y ) =
I ( x, y ) x
x
I ( x, y ) y
(I x) + I y
2
2
y
49