• 大小: 0.2M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-04-18
  • 语言: Matlab
  • 标签: BP  OMP  StOMP  压缩传感  

资源简介

四种压缩传感的重构算法,StOMP,BP,OMP,block_omp

资源截图

代码片段和文件信息

%  读文件
X=imread(‘lena.bmp‘);
X=double(X);
[ab]=size(X);
size_kuai=16*4;
X2=zeros(size_kuai);  %  恢复矩阵
X3=zeros(ab);  %  恢复矩阵
%  小波变换矩阵生成
ww=DWT(size_kuai);
%  随机矩阵生成
M=80;
R=randn(Msize_kuai);
tic
for i_x=1:ceil(a/size_kuai)
    for i_y=1:ceil(b/size_kuai)
        XX=X((i_x-1)*size_kuai+1:i_x*size_kuai(i_y-1)*size_kuai+1:i_y*size_kuai);
        %  小波变换让图像稀疏化(注意该步骤会耗费时间,但是会增大稀疏度)
        X1=ww*sparse(XX)*ww‘;
        X1=full(X1);
        %  测量
        Y=R*X1;
        %  OMP算法
        for i=1:size_kuai  %  列循环       
            rec=omp_fenkuai(Y(:i)Rsize_kuai);
            X2(:i)=rec;
        end
        X3((i_x-1)*size_kuai+1:i_x*size_kuai(i_y-1)*size_kuai+1:i_y*size_kuai)=ww‘*sparse(X2)*ww;  %  小波反变换
    end
end
X3=full(X3);
use_time=toc

%  原始图像
figure(1);
imshow(uint8(X));
title(‘原始图像‘);
%  压缩传感恢复的图像
figure(2);
imshow(uint8(X3));
title(‘分块恢复的图像‘);

%  误差(PSNR)
errorx=sum(sum(abs(X3-X).^2));        %  MSE误差
psnr=10*log10(255*255/(errorx/a/b))  %  PSNR

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1115  2013-10-24 21:02  gezhongsuanfa\block_omp\blk_omp.m

     文件        821  2013-10-18 10:53  gezhongsuanfa\block_omp\DWT.m

     文件      66614  2004-06-30 00:47  gezhongsuanfa\block_omp\lena.bmp

     文件       2217  2013-10-18 10:54  gezhongsuanfa\block_omp\omp_fenkuai.m

     文件        519  2013-10-14 16:00  gezhongsuanfa\BP\BP.m

     文件      66614  2004-06-30 00:47  gezhongsuanfa\BP\lena.bmp

     文件      54596  2006-07-30 14:13  gezhongsuanfa\BP\pdco.m

     文件      10186  2006-07-30 14:13  gezhongsuanfa\BP\pdcoSet.m

     文件       4483  2007-08-18 20:54  gezhongsuanfa\BP\SolveBP.m

     文件      66614  2009-06-08 18:00  gezhongsuanfa\OMP\lena.bmp

     文件        516  2013-10-14 16:10  gezhongsuanfa\OMP\omp.m

     文件       5451  2013-10-14 16:11  gezhongsuanfa\OMP\SolveOMP.m

     文件        525  2013-10-14 16:07  gezhongsuanfa\StOMP\fdrthresh.m

     文件      66614  2004-06-30 00:47  gezhongsuanfa\StOMP\lena.bmp

     文件        475  2013-10-14 16:07  gezhongsuanfa\StOMP\reverse.m

     文件       4889  2013-10-14 16:06  gezhongsuanfa\StOMP\SolveStOMP.m

     文件        532  2013-10-14 16:06  gezhongsuanfa\StOMP\StOMP.m

     目录          0  2013-10-18 11:03  gezhongsuanfa\block_omp

     目录          0  2013-10-18 11:00  gezhongsuanfa\BP

     目录          0  2013-10-24 20:41  gezhongsuanfa\OMP

     目录          0  2013-10-18 10:59  gezhongsuanfa\StOMP

     目录          0  2013-10-18 11:03  gezhongsuanfa

----------- ---------  ---------- -----  ----

               352781                    22


评论

共有 条评论