Problem with wavelet decomposition-recosntruction
Mostra commenti meno recenti
I've performed 3 level transform on 'lena.gif' image using 'wavedec2' function, then I performed reconstruction using 'waverec2' function. The reconstructed image is saved by naming it as 'lena2.gif'. After that,I again perform 3- level decomposition on 'lena2.gif' image and found that the wavelet coefficient of 'lena.gif' and 'lena2.gif' differs in values!!.. Why this is happening? How can I solve this problem.
Thanks in advance.
Risposte (1)
Wayne King
il 28 Ago 2011
Hi, you haven't told us whether you modified the coefficients at all before you reconstructed the image. Did you simply execute:
X = waverec2(C,S,'wname');
Did you verify that you had perfect reconstruction of the image in MATLAB?
Also, you have to take into consideration the class of the image before and after you create the gif file.
I suspect there were some differences introduced in the writing process. When you reread the new fig file in MATLAB, was it identical to the original? I'm guessing it wasn't and therefore the wavelet coefficients should not be the same.
For example:
load woman
[C,S] = wavedec2(X,3,'db2');
X1 = waverec2(C,S,'db2');
% verify perfect reconstruction
norm(X-X1,2)
Then if I write a new GIF file and read the data back in, the data will be in unsigned 8-bit integers.
imwrite(uint8(X1),'woman.gif','GIF')
newwoman = imread('woman.gif');
Now the data is uint8.
Wayne
1 Commento
snake eyes
il 29 Ago 2011
Categorie
Scopri di più su Image Analysis in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!