difference in compression ratio for same wname..

조회 수: 4 (최근 30일)
tamanna
tamanna 2013년 5월 30일
when i used this code
image2=('C:\Users\hp\Desktop\data\1 (2).JPG');
wavemngr('del','josh');
WAVEMNGR('add','shivjoshi','josh',1,'','newwavelet.m')
OUT1 = WAVEMNGR('read')
[C,S] = wavedec2(image2,2,'josh');
thr=1.0000;
[Xcomp,CXC,LXC,PERF0,PERFL2] =wdencmp('gbl',C,S,'josh',2,thr,'h',1);
and put the value in function 'newwavelet' same as value of 'db4',i.e. [-0.0106 0.0329 0.0308 -0.1870 -0.0280 0.6309 0.7148 0.2304] i am getting different results. e.g. in this code, m getting
The compression ratio is 58.8000
Retained Energy is 99.9999
PSNR value of decompressed image is 91.1471
and when i used the code
image=rgb2gray(imread('C:\Users\hp\Desktop\data\1 (2).jpg'));
K=image;
% wavelet decomposition
[C,S] = wavedec2(image,3,'db4');
thr=1.0000;
[Xcomp,CXC,LXC,PERF0,PERFL2] =wdencmp('gbl',C,S,'db4',2,thr,'h',1);
, m getting
The compression ratio is 55.0297
Retained Energy is 99.9997
PSNR value of decompressed image is 117.8089
why the results are varying??

채택된 답변

Wayne King
Wayne King 2013년 5월 30일
편집: Wayne King 2013년 5월 30일
I get exactly the same. Can you try to reproduce with an image from MATLAB
imdata = imread('ngc6543a.jpg');
[C,S] = wavedec2(imdata,3,'josh');
[C1,S1] = wavedec2(imdata,3,'db4');
thr=1.0000;
[Xcomp,CXC,LXC,PERF01,PERFL2] =wdencmp('gbl',C,S,'db4',2,thr,'h',1);
[Xcomp,CXC,LXC,PERF02,PERFL2] =wdencmp('gbl',C,S,'josh',2,thr,'h',1);
I get 80.4151 for a compression score in both cases.
Perhaps you have entered the filter coefficients in your M-file without the full resolution that they are stored in MATLAB?

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Denoising and Compression에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by