how the compression ratio is calculated
1 次查看(过去 30 天)
显示 更早的评论
i have a code
X=imread(file);
wavelet='haar'
level=2;
[c,s] = wavedec2(X,2,wavelet);
alpha = 1.5; m = 2.7*prod(s(1,:));
[thr,nkeep] = wdcbm2(c,s,alpha,m)
[xd,cxd,sxd,perf0,perfl2] = wdencmp('lvd',c,s,wname,n,thr,'h');
disp('Compression Ratio');disp(perf0);
the size of xd and X is same,plz tell how compression ratio is calculated
both images look like same ,how we can say it is compressed ny 84%
perf0 is 84%
0 个评论
采纳的回答
Wayne King
2012-12-24
perf0 is the percentage of zeros in the wavelet coefficients. So 84% indicates that 84 percent of the wavelet coefficients have been set to 0.
perfl2 is the ratio (as a percentage) between the L2 norm of the compressed wavelet coefficients and the original (before compression) wavelet coefficients.
Yes, the output compressed image is of course the same size as the input, the point is that it is constructed from a much smaller set of wavelet coefficients
5 个评论
Wayne King
2012-12-24
perf0 is just a scalar, so why would you use nnz() on that and expect something other than a 1?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Denoising and Compression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!