资源简介
小波omp,压缩感知程序,用于压缩感知的认识,对初学者和很有用

代码片段和文件信息
function Demo_CS_CoSaMP()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% the DCT basis is selected as the sparse representation dictionary
% instead of seting the whole image as a vector I process the image in the
% fashion of column-by-column so as to reduce the complexity.
% Author: Chengfu Huo roy@mail.ustc.edu.cn http://home.ustc.edu.cn/~roy
% Reference: D. Deedell andJ. Tropp “COSAMP: Iterative Signal Recovery from
% Incomplete and Inaccurate Samples” 2008.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%------------ read in the image --------------
img=imread(‘lena.bmp‘); % testing image
img=double(img);
[heightwidth]=size(img);
%------------ form the measurement matrix and base matrix ---------------
Phi=randn(floor(height/3)width); % only keep one third of the original data
Phi = Phi./repmat(sqrt(sum(Phi.^21))[floor(height/3)1]); % normalize each column
mat_dct_1d=zeros(256256); % building the DCT basis (corresponding to each column)
for k=0:1:255
dct_1d=cos([0:1:255]‘*k*pi/256);
if k>0
dct_1d=dct_1d-mean(dct_1d);
end;
mat_dct_1d(:k+1)=dct_1d/norm(dct_1d);
end
%--------- projection ---------
img_cs_1d=Phi*img; % treat each column as a independent signal
%-------- recover using omp ------------
sparse_rec_1d=zeros(heightwidth);
Theta_1d=Phi*mat_dct_1d;
for i=1:width
column_rec=cs_cosamp(img_cs_1d(:i)Theta_1dheight);
sparse_rec_1d(:i)=column_rec‘; % sparse representation
end
img_rec_1d=mat_dct_1d*sparse_rec_1d; % inverse transform
%------------ show the results --------------------
figure(1)
subplot(221)imagesc(img)title(‘original image‘)
subplot(222)imagesc(Phi)title(‘measurement mat‘)
subplot(223)imagesc(mat_dct_1d)title(‘1d dct mat‘)
psnr = 20*log10(255/sqrt(mean((img(:)-img_rec_1d(:)).^2)))
subplot(224)imagesc(img_rec_1d)title(strcat(‘1d rec img ‘num2str(psnr)‘dB‘))
disp(‘over‘)
%************************************************************************%
function hat_x=cs_cosamp(yT_Matm)
% y=T_Mat*x T_Mat is n-by-m
% y - measurements
% T_Mat - combination of random matrix and sparse representation basis
% m - size of the original signal
% the sparsity is length(y)/4
n=length(y); % length of measurements
s=floor(n/4); % sparsity
r_n=y; % initial residuals
sig_pos_lt=[]; % significant pos for last time iteration
for times=1:s % number of iterations
product=abs(T_Mat‘*r_n);
[valpos]=sort(product‘descend‘);
sig_pos_cr=pos(1:2*s); % significant pos for curretn iteration
sig_pos=union(sig_pos_crsig_pos_lt);
Aug_t=T_Mat(:sig_pos); % current selected entries
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3456 2010-07-16 14:45 Wavelet_OMP\Demo_CS_CoSaMP.m
文件 1065 2009-10-14 18:27 Wavelet_OMP\DWT.m
文件 66614 2009-06-08 18:00 Wavelet_OMP\lena256.bmp
文件 2499 2009-10-14 18:13 Wavelet_OMP\Wavelet_OMP.m
目录 0 2016-01-24 18:19 Wavelet_OMP
----------- --------- ---------- ----- ----
73634 5
- 上一篇:f28335最小系统原理图
- 下一篇:dxp单片机元件库
相关资源
- 压缩感知常见测量矩阵一维仿真信号
- 压缩感知TwIST
- 非局部正则化的压缩感知图像重建算
- An introduction to compressed sensing
- 压缩感知图像重构算法工具包
- 压缩感知基础
- 稀疏信号与压缩感知系列讲座PPT李廉
- 压缩感知常见测量矩阵二维图像仿真
- 压缩感知 莱斯大学的一些代码
- Sparse and Redundant Representations 中文翻译
- 压缩感知基础资料两篇论文,一个p
- 压缩感知重建算法——GPSR算法
- KSVD稀疏表示字典训练程序
- 压缩感知测量矩阵构造方法的研究
- 压缩感知方法实现SAR三维成像
- GPSR 梯度投影法
- Wavelet_CoSaMP
- CASSI基于压缩感知的光谱成像源代码
- 压缩感知-单像素相机-RICE大学的源代
- 压缩感知原理及应用完整版
- 经典的介绍压缩感知原理的入门书籍
- 压缩感知中用OMP算法重构视频序列程
- 压缩感知各种重构算法经典论文合集
- A Mathematical Introduction to Compressive Sen
- 高维数据降维算法综述_景明利.pdf
- 压缩感知二维OMP
- 压缩感知文献综述
- 论文研究-基于SVD分解的二维多任务压
- 对压缩感知做出全面介绍通俗易懂
- 压缩感知BP LASSO OMP STOMP算法内含完整
评论
共有 条评论