Sunteți pe pagina 1din 37

Procesarea

Imaginilor

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .

UNITARE
TRANSFORMARI

Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 1 of 37

Mihai Ivanovici
Universitatea Transilvania din Brasov

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Prelucr
ari integrale
Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 2 of 37

Z Z

g(k, l) = [

f (k, l)]
k

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Transformarile unitare = prelucrari de tip integral (la


calculul noii valori a unui pixel al imaginii transformate contribuind valorile tuturor pixelilor din imaginea originala)

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .

Transformarea se refera la o clasa de matrici unitare


folosite pentru reprezentarea imaginilor ntr-o baza (de
imagini)
O matrice A de dimensiune N N este unitara daca
inversa ei este matricea A T

Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 3 of 37

JJ

II

- ,
1

AA

= AA

=A

A = IN

unde reprezinta operatia de complementare n


multimea numerelor complexe, T reprezinta operatia de

Full Screen
Search
Close
PI 2008

transpunere a unei matrici, iar IN este matricea identitate


de dimensiune N N:
Titlul

IN =

1 0 0 ... 0
0 1 0 ... 0
0 0 1 ... 0
. . . ... .
. . . ... .
0 0 0 ... 1

integrale
Prelucrari
unitare . . .
Transformari

Pentru un vector uni-dimensional u de dimensiune N, de


forma:

Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 4 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

u=

u(0)
u(1)
.
.
.
u(N 1)

= [u(0), u(1), ..., u(N 1)]T

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

se numeste transformare unitar


a direct
a relatia:

Page 5 of 37

N1

v(k) =

a(k, n) u(n),

0 k N 1

(1)

n=0

JJ

II

- ,
Full Screen

unde v(k) reprezinta elementele vectorului transformat v,


iar a(k, n) snt elementele matricii A.

Search
Close
PI 2008

Matricial aceasta relatie se poate scrie astfel:

v = Au

Titlul
integrale
Prelucrari
unitare . . .
Transformari

Transormarea unitar
a invers
a este data de relatia:

Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard

N1

u(n) =

Transformata Haar

v(k) a (k, n),

0 n N 1

k=0

care se scrie matricial astfel:

Page 6 of 37

JJ

II

- ,
u = A T v

Full Screen
Search
Close
PI 2008

Transform
ari unitare
bidimensionale

Pentru o imagine u(m, n), de dimensiune N N,


transformarea directa are urmatoarea forma:

Titlul
integrale
Prelucrari
unitar . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .

N1 N1

v(k, l) =

u(m, n) ak,l (m, n),

Transformata Hadamard

0 k, l N 1

iar transformarea inversa:


N1 N1

u(m, n) =

v(k, l) ak,l (m, n),

Transformata Haar

Page 7 of 37

m=0 n=0

0 m, n N 1

k=0 k=0

JJ

II

- ,
Full Screen
Search

unde coeficientii {ak,l (m, n)} poarta numele de


transformare unitar
a bidimensional
a, si reprezinta un

Close
PI 2008

set de matrici de baza ortonormale, iar v(k, l) reprezinta


transformata imaginii u(m, n).
Aceste matrici de baza respecta conditia de
ortonormalitate:
N1 N1

Titlul
integrale
Prelucrari
unitar . . .
Transformari

ak,l (m, n) ak0 ,l 0 (m, n) = (k k0 , l l 0 )

m=0 n=0

Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

(k k , l l ) =

1, k = k0 & l = l 0 ,
n rest.
0,

pentru k, l.
O astfel de transformare este caracterizata de N 4
coeficienti ak,l (m, n).
Pentru calculul unui singur element este nevoie de N 2
nmultiri = complexitatea este O(N 4 ) (putand fi redusa
la O(N 3 ) daca transformarea este separabila)

Page 8 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

O transformare este separabil


a, daca elementele
ak,l (m, n) ce o definesc pot fi scrise ca produs de
alte doua elemente, grupate dupa perechi de indici

Titlul
integrale
Prelucrari
unitar . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .

ak,l (m, n) = ak (m) bl (n) = a(k, m) b(l, n)

Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 9 of 37

unde, matricile A = {a(k, m)} si B = {b(l, n)} trebuie sa


fie la randul lor unitare, adica:

JJ

II

- ,
T

AA

=A

A = IN

BB

=B

B = IN

Full Screen
Search

In ipoteza separabilitatii relatiile anterioare devin:

Close
PI 2008

N1 N1

a(k, m) u(m, n) b(l, n)

v(k, l) =

m=0 n=0

Titlul
integrale
Prelucrari
unitar . . .
Transformari
Transformata Fourier . . .

N1 N1

u(m, n) =

Transformata cosinus . . .

a (k, m) v(k, l) b (l, n)

k=0 k=0

Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 10 of 37

Matrial se poate scrie:

JJ

II

- ,

V = A U B

Full Screen
Search

U =A

V B

Close
PI 2008

unde U = {u(m, n)} reprezinta imaginea originala, iar


V = {v(k, l)} reprezinta imaginea transformata.
In practica se folosesc numai transformari separabile,
pentru care, n plus, se alege B = A
In acest caz, vom avea o singura matrice A unitara care
defineste transfomarea

Titlul
integrale
Prelucrari
unitar . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

N1 N1

v(k, l) =

a(k, m) u(m, n) a(l, n)

m=0 n=0

Page 11 of 37

JJ

II

- ,
N1 N1

u(m, n) =

Full Screen

a (k, m) v(k, l) a (l, n)

Search

k=0 k=0
Close
PI 2008

Matricial:

V = A U AT

Titlul
integrale
Prelucrari
unitar . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .

U = A T V A

Transformata Hadamard
Transformata Haar

Page 12 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Propriet
atile transform
arilor unitare
O transformare unitara conserva energia semnalului

Titlul
integrale
Prelucrari
unitar . . .
Transformari

Energia semnalului u este data de norma la patrat a


spatiului n care este reprezentat semnalul:

Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Ev = kvk2 = v T v = (Au) T Au =
u T A T Au = u T u = kuk2 = Eu
In general transformarea se alege astfel ncat energia sa
fie inegal distribuita n spatiul transformatei, chiar daca
ea era uniform distribuita n spatiul original.

Page 13 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Entropia unui semnal discret cu valori aleatoare se


conserva printr-o transformare unitara (se pastreaza
informatia continuta n semnal)

Titlul
integrale
Prelucrari
unitar . . .
Transformari
Transformata Fourier . . .

Coeficientii n spatiul transformatei sunt decorelati


sau aproape decorelati

Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 14 of 37

Transformata optima care compacteaza maximum de


energie ntr-un numar dat de coeficienti si care n acelasi
timp decoreleaza complet acesti coeficienti, este
transformarea Karhunen-Lo`eve.

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Transformata Fourier discret


a
Transformata Fourier unidimensional
a
Titlul

Pentru un semnal unidimensional u de dimensiune N,


transformarea Fourier directa este data de relatia:

integrale
Prelucrari
unitare . . .
Transformari
Transformata Fouri . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard

N1

v(k) =

u(n) e

2Njkn

Transformata Haar

k = 0..N 1

n=0

iar transformarea Fourier inversa de relatia:


2 jkn
1 N1
u(n) =
v(k) e N n = 0..N 1
N k=0

Page 15 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Astfel definita, transformarea Fourier nu este unitara.


Urmatoarele relatii definesc transformarea Fourier
unitara, directa si inversa:
Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fouri . . .

2 jkn
1 N1
k = 0..N 1
v(k) = u(n) e N
N n=0

Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 16 of 37

2 jkn
1 N1
u(n) = v(k) e N
n = 0..N 1
N k=0

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fouri . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard

Daca definim matricea F = { f (k, n)} a transformarii,


avand elementele:
2 jkn
1
f (k, n) = e N k, n = 0..N 1
N

Transformata Haar

Page 17 of 37

JJ

II

- ,
Full Screen
Search

atunci transformarea Fourier se poate scrie matricial


astfel:

Close
PI 2008

v = F u
Titlul

u = F v

integrale
Prelucrari
unitare . . .
Transformari
Transformata Fouri . . .
Transformata cosinus . . .

Matricea F are proprietate ca F

= FT .

Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 18 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Transformarea Fourier bidimensional


a
Fie o imagine U = {u(m, n)}m,n=0..N1 , de dimensiune
N N. Imaginea transformata Fourier
V = {v(k, l)}k,l=0..N1 , n ipoteza separabilitatii:

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fouri . . .
Transformata cosinus . . .

N1 N1

v(k, l) =

Transformata sinus di . . .

1
u(m, m) e
N m=0
n=0

2 j(km+ln)

iar transformarea Fourier inversa este:

2 j(km+ln)
1 N1 N1
u(m, n) =
v(k, l) e N
N k=0
l=0

Transformata Hadamard
Transformata Haar

Page 19 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Matricial:

V = F U F

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fouri . . .
Transformata cosinus . . .

U = F V F

Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 20 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Transformata cosinus discret


a
Transformata cosinus este o transformata unitara
separabila, definita de matricea C = {c(k, n)}

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosin . . .
Transformata sinus di . . .
Transformata Hadamard

c(k, n) =

1 ,
qN
(2n+1)k
2
,
N cos
2N

Transformata Haar

k = 0, 0 n N 1
1 k N 1, 0 n N 1

Transformata cosinus, directa si inversa, pentru un


semnal unidimensional, este data de relatiile:

Page 21 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

N1

v(k) = (k)

u(n)cos

n=0

(2n + 1)k
, 0 k N 1
2N

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .

N1

(2n + 1)k
u(n) = (k)v(k)cos
, 0 n N 1
2N
n=0

Transformata cosin . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 22 of 37

unde

JJ

II

- ,
r
(0) =

1
, (k) =
N

2
, 1 k N 1
N

Full Screen
Search
Close
PI 2008

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosin . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 23 of 37

V = C U C

U = CT U C

JJ

II

- ,
Full Screen

Matricea C are proprietatea ca C = C , elementele sale


fiind numere reale

Search
Close
PI 2008

Transformarea cosinus nu este partea reala a transformarii Fourier


Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosin . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 24 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Transformata sinus discret


a

Transformata sinus este o transformata unitara separabila, definita de matricea S = {s(k, n)}

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus . . .
Transformata Hadamard
Transformata Haar

r
s(k, n) =

2
(k + 1)(n + 1)
sin
, 0 k, n N 1
N +1
N +1

Baza de functii sinus:

Page 25 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus . . .
Transformata Hadamard
Transformata Haar

Page 26 of 37

Relatiile ce definesc transformarea sinus unidimensionala,


directa si inversa, sunt urmatoarele:

JJ

II

- ,
r
v(k) =

2 N1
(k + 1)(n + 1)
u(n)sin N + 1 , 0 k N 1
N + 1 n=0

Full Screen
Search
Close
PI 2008

r
u(n) =

2 N1
(k + 1)(n + 1)
v(k)sin N + 1 , 0 n N 1
N + 1 k=0

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .

Matricial:

Transformata cosinus . . .
Transformata sinus . . .
Transformata Hadamard
Transformata Haar

V = S U S
U = S V S
Matricea S are proprietatea ca S = S = ST = S1

Page 27 of 37

JJ

II

- ,
Full Screen

Transformarea sinus nu este partea imaginara a


transformarii Fourier

Search
Close
PI 2008

Transformata Hadamard

Elementele bazei de vectori ce caracterizeaza


transformata Hadamard iau valori binare 1 =
transformata Hadamard e mai potrivita pentru analiza
semnalelor digitale
Matricile Hn ale transformatei Hadamard sunt matrici de
dimensiune N N, unde N este o putere a lui 2,
N = 2n , n = 1, 2, 3..., si sunt generate pornind de la
matricea de baza:

1
H1 =
2

1
1

1
1

folosind recurenta produsului Kronecker:

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hada . . .
Transformata Haar

Page 28 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

1
Hn = Hn1 H1 = H1 Hn1 =
2

Hn1
Hn1

Hn1
Hn1


Titlul
integrale
Prelucrari

De exemplu, pentru n = 3, matricile Hadamard vor fi:

unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hada . . .

H3 = H1 H2

Transformata Haar

Page 29 of 37

H2 = H1 H1

JJ

II

- ,
Full Screen
Search
Close
PI 2008

1
H3 =
8

1
1
1
1

1
1
1
1

1
1
1
1

1
1
1
1

1
1
1
1

1
1
1
1

1
1
1
1

1
1
1
1

|
|
|
|

|
|
|
|

1
1
1
1

1
1
1
1

1
1
1
1

1
1
1
1

1
1
1
1

1
1
1
1

1
1
1
1

1
1
1
1

Matricial, transformata Hadamard unidimensionala a


unui vector u, de dimensiune N 1, este un vector v:

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hada . . .
Transformata Haar

Page 30 of 37

JJ

II

- ,
Full Screen

v = Hu
iar transformarea inversa:

Search
Close
PI 2008

u = Hv
Titlul

unde H = Hn , iar n = log2 N.


Formele explicitate ale acestor relatii sunt urmatoarele:

integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hada . . .
Transformata Haar

N1

1
v(k) = u(m)(1)b(k,m) , 0 k N 1
N m=0

1
u(m) =
N

N1

v(k)(1)b(k,m) ,
k=0

0 m N 1

Page 31 of 37

JJ

II

- ,
Full Screen
Search

unde

Close
PI 2008

n1

b(k, m) =

ki mi ;

ki , mi = 0, 1

i=0

Titlul
integrale
Prelucrari
unitare . . .
Transformari

iar {ki }, {mi } sunt reprezentarile binare ale lui k si m:

Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hada . . .

k = k0 + 2k1 + ... + 2n1 kn1


m = m0 + 2m1 + ... + 2n1 mn1

Transformata Haar

Page 32 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hada . . .
Transformata Haar

Page 33 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Transformata Haar

Functiile Haar hk (x) se definesc pe un interval continuu,


x [0, 1], pentru k = 0, ..., N 1, unde N = 2n . Numarul
ntreg k poate fi descompus n mod unic ca:

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .

k = 2p + q 1
unde 0 p n 1, q = 0, 1 pentru p = 0 si 1 q 2 p
pentru p 6= 0.
De exemplu, pentru N = 4, valorile k, p si q sunt
urmatoarele:
k 0 1 2 3
p 0 0 1 1
q 0 1 1 2

Transformata Hadamard
Transformata Haar

Page 34 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Pornind de la reprezentarea numarului ntreg k printr-o


pereche de numere ntregi (p, q), functiile Haar se
definesc astfel:
Titlul
integrale
Prelucrari

1
h0 (x) = h0,0 (x) = , x [0, 1]
N

unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 35 of 37

q 12
2 p/2 , q1
2p x < 2p
1
q 1
hk (x) = h p,q (x) =
2 p/2 , 2 p2 x < 2qp
N

0, x [0, 1]

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Transformata Haar se obtine pentru valori discrete ale lui


x de tip m/N, pentru m = 0, 1, .., N 1. Pentru N = 8,
matricea H a transformarii Haar este urmatoarea:
Titlul
integrale
Prelucrari

1
H=
8

1
1
2
0
2
0
0
0

1
1
2
0
2
0
0
0

1
1
2
0
0
2
0
0

1
1
2
0
0
2
0
0

1
1
0
2
0
0
2
0

1
1
0
2
0
0
2
0

1
1
0
2
0
0
0
2

1
1
0
2
0
0
0
2

unitare . . .
Transformari
Transformata Fourier . . .

Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 36 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

Titlul
integrale
Prelucrari
unitare . . .
Transformari
Transformata Fourier . . .
Transformata cosinus . . .
Transformata sinus di . . .
Transformata Hadamard
Transformata Haar

Page 37 of 37

JJ

II

- ,
Full Screen
Search
Close
PI 2008

S-ar putea să vă placă și