Problem with wavelet decomposition-recosntruction
조회 수: 8 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
Wayne King
2011년 8월 28일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!