资源简介
转自乔治亚理工大学官网,利用convex optimization算法压缩图片,运行前请先进行compile
代码片段和文件信息
% camera_recovery_noiselet.m
%
% Create recovery curves for the 256x256 cameraman image
% Three approaches:
% linear approximation using dct2 (psnr_dct)
% TV recovery from lowpass dct2 coefficients (psnr_tvlp)
% TV recovery from 1000 lowpass + noiselet coefficients (psnr_cs)
%
% Written by: Justin Romberg Georgia Tech jrom@ece.gatech.edu
% Created: May 2007
%
addpath ./Measurements
addpath ./Optimization
addpath ./Utils
X = double(imread(‘cameraman.tif‘));
x = X(:);
n = size(X1);
N = n*n;
% for repeatable experiments
load RANDOM_STATES
rand(‘state‘ rand_state);
randn(‘state‘ randn_state);
%rand_state = rand(‘state‘);
%randn_state = randn(‘state‘);
% for linear approximation
lporder = bdct_linapprox_ordering(n n);
% low pass DCT2 K1 = number of lowpass coefficients
K1 = 1000;
OM1 = lporder(1:K1);
% for random projection avoid mean
q = randperm(N)‘;
% K2 = number of auxiliary measurements
% (either noiselet or more dct2)
K2 = 20000;
% measurement ensemble
OM2 = q(1:K2);
Phi = @(z) A_lpnlet(z n OM1 OM2);
Phit = @(z) At_lpnlet(z n OM1 OM2);
% for linear and tvlp approximations
OMlin = lporder(1:K1+K2);
Phi2 = @(z) A_dct2(z n OMlin);
Phi2t = @(z) At_dct2(z n OMlin);
% take measurements
y = Phi(x);
y2 = Phi2(x);
% min l2 for cs
PPt = @(z) Phi(Phit(z));
x0 = Phit(cgsolve(PPt y 1e-8 200));
% linear reconstruction
xlin = Phi2t(y2);
Xlin = reshape(xlin n n);
% parameters for optimization code
lbtol = 918; % 1e-3*tv(X);
mu = 5;
cgtol = 1e-8;
cgmaxiter = 800;
% lowpass tv recovery
epsilon2 = 1e-3*norm(y2);
t0 = clock;
xlptv = tvqc_logbarrier(xlin Phi2 Phi2t y2 epsilon2 lbtol mu cgtol cgmaxiter);
t1 = clock;
disp(sprintf(‘Elapsed time = %8.2f seconds‘ etime(t1t0)));
Xlptv = reshape(xlptv n n);
% cs recovery
epsilon = 1e-3*norm(y);
t0 = clock;
xp = tvqc_logbarrier(x0 Phi Phit y epsilon lbtol mu cgtol cgmaxiter);
t1 = clock;
disp(sprintf(‘Elapsed time = %8.2f seconds‘ etime(t1t0)));
Xp = reshape(xp n n);
disp(sprintf(‘\n‘));
disp(sprintf(‘K = %d + %d = %d‘ K1 K2 K1+K2));
disp(sprintf(‘DCT PSNR = %5.2f‘ psnr(XXlin)));
disp(sprintf(‘LPTV PSNR = %5.2f‘ psnr(XXlptv)));
disp(sprintf(‘CS PSNR = %5.2f‘ psnr(XXp)));
disp(sprintf(‘\n\n‘));
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6148 2008-01-22 18:18 SPmag-CS-Code\.DS_Store
文件 2247 2013-10-12 19:53 SPmag-CS-Code\camera_recovery_noiselet.m
文件 1048710 2007-03-29 12:09 SPmag-CS-Code\man.tiff
文件 6148 2008-01-22 18:18 SPmag-CS-Code\Measurements\.DS_Store
文件 245 2007-05-18 13:03 SPmag-CS-Code\Measurements\At_dct2.m
文件 341 2008-01-22 15:29 SPmag-CS-Code\Measurements\At_lpnlet.m
文件 234 2008-01-22 15:31 SPmag-CS-Code\Measurements\At_noiselet.m
文件 232 2007-05-18 13:02 SPmag-CS-Code\Measurements\A_dct2.m
文件 265 2008-01-22 15:29 SPmag-CS-Code\Measurements\A_lpnlet.m
文件 252 2008-01-22 15:31 SPmag-CS-Code\Measurements\A_noiselet.m
文件 2818 2006-12-14 15:46 SPmag-CS-Code\Measurements\realnoiselet.c
文件 614 2006-12-14 15:46 SPmag-CS-Code\Measurements\realnoiselet.m
文件 8704 2013-10-12 14:11 SPmag-CS-Code\Measurements\realnoiselet.mexw64
文件 62238 2013-10-15 21:00 SPmag-CS-Code\new.tif
文件 65126 2013-10-15 21:00 SPmag-CS-Code\old.tif
文件 6148 2008-01-22 14:50 SPmag-CS-Code\Optimization\.DS_Store
文件 1626 2007-04-04 18:55 SPmag-CS-Code\Optimization\cgsolve.m
文件 2880 2007-05-18 12:35 SPmag-CS-Code\Optimization\tvqc_logbarrier.m
文件 5563 2007-05-18 12:35 SPmag-CS-Code\Optimization\tvqc_newton.m
文件 531 2008-01-22 15:02 SPmag-CS-Code\RANDOM_STATES.mat
文件 963 2007-04-02 16:35 SPmag-CS-Code\Utils\bdct_linapprox_ordering.m
文件 715 2007-03-29 14:25 SPmag-CS-Code\Utils\dct2d_blocked.m
文件 454 2007-03-29 14:27 SPmag-CS-Code\Utils\idct2d_blocked.m
文件 1593 2007-03-30 17:28 SPmag-CS-Code\Utils\jpgzzind.m
文件 236 2006-08-08 13:17 SPmag-CS-Code\Utils\psnr.m
目录 0 2013-10-12 14:11 SPmag-CS-Code\Measurements
目录 0 2008-01-22 14:50 SPmag-CS-Code\Optimization
目录 0 2008-01-22 16:01 SPmag-CS-Code\Utils
目录 0 2013-10-15 21:00 SPmag-CS-Code
----------- --------- ---------- ----- ----
............此处省略2个文件信息
- 上一篇:跳跃式滑翔弹道仿真程序
- 下一篇:标记分水岭分割算法的matlab实现
相关资源
- 标记分水岭分割算法的matlab实现
- 跳跃式滑翔弹道仿真程序
- 高等光学仿真》matlab源程序
- 流形学习算法matlab
- 频域块LMS算法
- matlab7.1win764位破解版.rar
- 图像融合MATLAB程序
- 最大流MATLAB
- hdb3编译码 matlab
- arma模型_matlab源码
- MATLAB计算对极线程序
- matlab求取二维数组极大值与极小值
- MATLAB非线性优化fmincon详解
- 4CPM_matlab
- MATLAB获取neurosky专注度数据
- Matlab男女声在线识别系统
- 一维二维中值滤波均值滤波matlab编码
- matlab 2007
- matlab贝叶斯源码iris分类
- PSO粒子群算法万能matlab代码注释详细
- 计算可见光通信OOK调制方式的BER mat
- 粒子群算法优化问题matlab程序
- matlab编的一个用于对统计数据进行威
- 最优化 一维不精确搜索wolfe matlab
- Matlab 广义高斯分布建模
- 遗传算法 车辆调度Matlab仿真
- matlab编译的bm3d去噪代码
- 利用Gabor滤波器实现的MATLAB掌纹识别系
- SPS并联机器人可达工作空间绘制的M
- puma机器人运动学正解MATLAB算法
评论
共有 条评论