資源簡介
基于dft的圖像壓縮matlab實現.

代碼片段和文件信息
%demo2_compress_image
clc;
close?all;
img?=?imread(‘squirrel2.jpg‘);
figure?imshow(img);?
level?=?5;??%decomposition?level
basis?=?‘sym8‘;
[c?l]?=?wavedec2(img?level?basis);
opt?=?‘gbl‘;??%use?the?global?threshold
thr?=?200;?%threshold?value;
sorh?=?‘h‘;??%?Hard?thresholding
keepapp?=?1;?%?Approximation?coefficients?cannot?be?thresholded
[xdcxdlxdperf0perfl2]?=?wdencmp(optclbasislevelthrsorhkeepapp);
subplot(121)?subimage(img)
title(‘Original?Image‘)
subplot(122)?image(mat2gray(xd))
title([‘Compressed?Image?-?Global?Threshold?=?‘?num2str(thr)])
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????603??2012-10-25?20:57??demo2_compress_image.m
- 上一篇:粒子群SVM.rar
- 下一篇:信息熵·互信息代碼
評論
共有 條評論