-
Notifications
You must be signed in to change notification settings - Fork 326
/
multidim_3_multispectral.py
35 lines (29 loc) · 1.05 KB
/
multidim_3_multispectral.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
def exo1():
"""
Implement the inverse transform to recover an approximation |M1| from
the coefficients |UWT|.
proximation error
isplay
"""
M1 = UWT
for i in 1: p:
M1(: , : , i) = perform_wavelet_transf(M1(: , : , i), Jmin, -1)
M1 = reshape(M1, [n*n p])'
M1 = idct(M1)
M1 = reshape(M1', [n n p])
e = snr(M, M1)
imageplot(M(: , : , rgbsel), 'Original', 1, 2, 1)
imageplot(clamp(M1(: , : , rgbsel)), strcat(['Approximated, SNR = ' num2str(e, 2) 'dB']), 1, 2, 2)
def exo2():
"""
Compare the approximation error (both in term of SNR and visually)
of a multispectral image with a 3D Haar basis and with a tensor product
of a 2D Haar and a DCT.
"""
def exo3():
"""
Compare the denoising (both in term of SNR and visually) of a multispectral image with an independant
thresholding of each channel within a translation invariant 2D wavelet basis,
and with a thresholding of the DCT/invariant wavelet representation. For
each method, compute the optimal threshold value.
"""