文件名称:SPIHT(Matlab).zip
-
所属分类:
- 标签属性:
- 上传时间:2008-07-07
-
文件大小:227.42kb
-
已下载:3次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
% Matlab implementation of SPIHT (without Arithmatic coding stage)
%
% By Jing Tian, scuteejtian@hotmail.com
fprintf('----------- Welcome to SPIHT Matlab Demo! ----------------\n');
fprintf('----------- Load Image ----------------\n');
infilename = 'lena512.bmp';
outfilename = 'lena512_reconstruct.bmp';
Orig_I = double(imread(infilename));
rate = 1;
OrigSize = size(Orig_I, 1);
max_bits = floor(rate * OrigSize^2);
OutSize = OrigSize;
image_spiht = zeros(size(Orig_I));
[nRow, nColumn] = size(Orig_I);
fprintf('done!\n');
fprintf('----------- Wavelet Decomposition ----------------\n');
n = size(Orig_I,1);
n_log = log2(n);
level = n_log;
% wavelet decomposition level can be defined by users manually.
type = 'bior4.4';
[Lo_D,Hi_D,Lo_R,Hi_R] = wfilters(type);
[I_W, S] = func_DWT(Orig_I, level, Lo_D, Hi_D);
fprintf('done!\n');
fprintf('----------- Encoding ----------------\n');
img_enc = func_SPIHT_Enc(I_W, max_bits, nRow*nColumn, level);
fprintf('done!\n');
fprintf('----------- Decoding ----------------\n');
img_dec = func_SPIHT_Dec(img_enc);
fprintf('done!\n');
fprintf('----------- Wavelet Reconstruction ----------------\n');
img_spiht = func_InvDWT(img_dec, S, Lo_R, Hi_R, level);
fprintf('done!\n');
fprintf('----------- PSNR analysis ----------------\n');
imwrite(img_spiht, gray(256), outfilename, 'bmp');
Q = 255;
MSE = sum(sum((img_spiht-Orig_I).^2))/nRow / nColumn;
fprintf('The psnr performance is %.2f dB\n', 10*log10(Q*Q/MSE));
%
% By Jing Tian, scuteejtian@hotmail.com
fprintf('----------- Welcome to SPIHT Matlab Demo! ----------------\n');
fprintf('----------- Load Image ----------------\n');
infilename = 'lena512.bmp';
outfilename = 'lena512_reconstruct.bmp';
Orig_I = double(imread(infilename));
rate = 1;
OrigSize = size(Orig_I, 1);
max_bits = floor(rate * OrigSize^2);
OutSize = OrigSize;
image_spiht = zeros(size(Orig_I));
[nRow, nColumn] = size(Orig_I);
fprintf('done!\n');
fprintf('----------- Wavelet Decomposition ----------------\n');
n = size(Orig_I,1);
n_log = log2(n);
level = n_log;
% wavelet decomposition level can be defined by users manually.
type = 'bior4.4';
[Lo_D,Hi_D,Lo_R,Hi_R] = wfilters(type);
[I_W, S] = func_DWT(Orig_I, level, Lo_D, Hi_D);
fprintf('done!\n');
fprintf('----------- Encoding ----------------\n');
img_enc = func_SPIHT_Enc(I_W, max_bits, nRow*nColumn, level);
fprintf('done!\n');
fprintf('----------- Decoding ----------------\n');
img_dec = func_SPIHT_Dec(img_enc);
fprintf('done!\n');
fprintf('----------- Wavelet Reconstruction ----------------\n');
img_spiht = func_InvDWT(img_dec, S, Lo_R, Hi_R, level);
fprintf('done!\n');
fprintf('----------- PSNR analysis ----------------\n');
imwrite(img_spiht, gray(256), outfilename, 'bmp');
Q = 255;
MSE = sum(sum((img_spiht-Orig_I).^2))/nRow / nColumn;
fprintf('The psnr performance is %.2f dB\n', 10*log10(Q*Q/MSE));
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : SPIHT_Matlab_Demo.zip 列表 func_Mywavedec2.m func_MyDescendant.m func_SPIHT_Enc.m func_Myappcoef2.m func_InvDWT.m func_DWT.m func_SPIHT_Dec.m func_SPIHT_Demo_Main.m lena512.bmp contents.m func_Mywaverec2.m
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.