基于GAP_TV算法实现视频压缩感知matlab源码

1 算法介绍

     We consider the total variation (TV) minimization problem used for compressive sensing and solve it using the generalized alternating projection (GAP) algorithm. Extensive results demonstrate the high performance of proposed algorithm on compressive sensing, including two dimensional images, hyperspectral images and videos. We further derive the Alternating Direction Method of Multipliers (ADMM) framework with TV minimization for video and hyperspectral image compressive sensing under the CACTI and CASSI framework, respectively. Connections between GAP and ADMM are also provided.

 

 

 

 

 

 

2 部分代码

% 'test_DeSCI.m' tests 'Generalized alternating projection based total variation minimization (GAP-TV)' algorithm 
% for video reconstruction in 'coded aperture compressive temporal imaging (CACTI)'





% The main reconstruction function 'TV4_ADMM_CACTI_adaw' called in line 63 and the subfunctions it invokes are writen fully in Matlab code
% A faster version, 'TV4_ADMM_CACTI_adaw_ap', is aslo available in this package that invokes a C-written denosing core ('tvden.mexw64') 
% and shortens the run-time by ~5X (Matlab2018a or higer version required)

%% [0] environment configuration
clear; 
clc;
close all

addpath(genpath('./GAP_TV_algorithm'));             % algorithm package

datasetdir = './dataset';                           % dataset dictionary
para.dataname = 'meas_waterBalloon_cr_10';          % select a 2D measurement
para.cr = str2double(para.dataname(end-1:end));     % compression ratio of the selected measurement, i.e., number of video frames to be recovered from each single 2D measurement
para.numRec = 1;                                    % number of measurement frames to be reconstructed

datapath = sprintf('%s/%s.mat',datasetdir,para.dataname);  % path of the selected 2D measurement

%% [1] load dataset
load(datapath);               % load measurement
load('./dataset/mask.mat');   % load mask

meas = meas(:,:,1:para.numRec);
meas = 255*meas/max(meas(:));
mask = double(255*mask(:,:,1:para.cr));
mask = mask/max(mask(:));

%% [2] reconstruction

% [2.1] algorithm para
A = @(z) A_xy(z, mask);
At = @(z) At_xy_nonorm(z, mask);

Phi_sum = sum(mask.^2,3);
Phi_sum(Phi_sum==0)=1;
para.lambda = 1;  
para.Phi_sum = Phi_sum;
para.iter =100;     
para.TVweight = 1; 
para.eta = 10; 

% [2.2] run reconstruction
recon = zeros([size(meas,1),size(meas,2),para.cr*size(meas,3)]);
tic;
for i_meas = 1:para.numRec
    meas_single = meas(:,:,i_meas);
    
    vgaptv  =  TV4_ADMM_CACTI_adaw(meas_single, para, A,At);

    recon(:,:,(i_meas-1)*para.cr +(1:para.cr)) = vgaptv;
    
    fprintf( 'ADMM-TV, %dth frame out of %d, time to now: %d s\n', i_meas, para.numRec, round(toc) );
end


%% [3] show results in figure

% [3.0] rotate and crop
recon_rotate = zeros(725,725,para.numRec*para.cr);

for np=1:para.numRec*para.cr
    recon_rotate(:,:,np) = imrotate(recon(:,:,np),-135);
end

recon_rotate = recon_rotate(182:182+363,182:182+363,:);
recon_rotate = recon_rotate/max(recon_rotate(:));

% [3.1] show results in figure
figure;
for i=1:para.numRec*para.cr
    imshow(recon_rotate(:,:,i));
%     pause(0.2);
end

3 仿真结果

 

4 参考文献

 [1] M. Qiao, Z. Meng, J. Ma, X. Yuan, Deep learning for video compressive sensing, APL Photonics 5, 030801 (2020).

 [2] Yuan, Xin. "Generalized alternating projection based total variation minimization for compressive sensing." 2016 IEEE International Conference on Image Processing (ICIP). IEEE, 2016.
 

5 代码下载

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Matlab科研辅导帮

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值