资源简介
运用压缩感知原理 稀疏采样 图像重构 图像去噪
代码片段和文件信息
function ResIm = Image_Denoising_Global_Denoising(Im trueIm)
% Denoise image by denoising its patches using a pre-determined dictionary.
% Patches are denoised WITHOUT overlap.
%
% Inputs :
% Im : image to denoise double [0 255]
% trueIm : This is used (unfairly) to optimize the parameters for the algorithm
%
% Outputs :
% ResIm : Result Image for the best parameter
%% Parameters
imLen = numel(Im);
%% Create the dictionary - Haar
[HaarDict atomNorms] = Generate_Haar_Matrix(size(Im) 2);
atomNorms = atomNorms(:);
invAtomNorms = 1 ./ atomNorms;
% Show_Haar_Dict(HaarDict size(Im));
nAtoms = size(HaarDict 2); % = 1 + 3 * nLevels
%% Prepare the projections of the image onto the dictionary
projs = HaarDict‘ * Im(:);
absProjs = abs(projs);
%% Test for different values of T
Tvalues = [0 : 200];
resPSNRs = zeros(1 length(Tvalues));
fprintf(‘%d T values: ‘ length(Tvalues));
for Tind = 1 : length(Tvalues)
if mod(Tind 10) == 0 fprintf(‘%d ‘ Tind); end;
% Current threshold
T = Tvalues(Tind);
% Compute the hard-thresholding result
resProjs = projs .* (absProjs > (T .* invAtomNorms));
% Compute the result signal by multiplying by the dictionary
currResIm = HaarDict * resProjs;
currResIm = reshape(currResIm size(Im));
% Compute error result
resPSNRs(Tind) = Compute_Error_Stats(currResIm trueIm);
end
fprintf(‘\n‘);
%% Find the best value and plot the results
[~ maxPSNRind] = max(resPSNRs);
bestT = Tvalues(maxPSNRind);
if 1
figure;
plot(Tvalues resPSNRs ‘+r‘);
title(‘PSNR as a function of T‘);
end
%% Reconstruct the image for the best value of T
resProjs = projs .* (absProjs > (bestT .* invAtomNorms));
ResIm = HaarDict * resProjs;
ResIm = reshape(ResIm size(Im));
%%
return;
% [nm]=size(Haar);
% W=[0.25*ones(n*41); 0.5*ones(n*31)];
function [HaarDict atomNorms] = Generate_Haar_Matrix(imSize nLevels)
atomNorms = [];
% Prepare the first level bands
basicH = [1 -1];
basicL = [1 1];
HH1 = kron(basicH‘ basicH);
HaarDict = Construct_One_Haar_Band(imSize HH1);
atomNorms = [atomNorms ones(1 prod(imSize)) * sqrt(sum(HH1(:).^2))];
LH1 = kron(basicL‘ basicH);
HaarDict = [HaarDict Construct_One_Haar_Band(imSize LH1)];
atomNorms = [atomNorms ones(1 prod(imSize)) * sqrt(sum(LH1(:).^2))];
HL1 = kron(basicH‘ basicL);
HaarDict = [HaarDict Construct_One_Haar_Band(imSize
- 上一篇:四元数matlab工具箱2.6版
- 下一篇:波长与RGB的转换
相关资源
- 压缩感知(Compressed Sensing CS)matlab代
- matlab图像压缩感知
- 图像分块BCS稀疏表示与重建
- 压缩感知之GPSR算法
- 贝叶斯压缩感知matlab源代码
- 压缩感知经典文章附程序
- 贝叶斯压缩感知matlab函数包
- 基于压缩感知的分布式视频编码框架
- 压缩感知磁共振成像
- 压缩感知CS最全matlab程序,二维三维图
- 基于MIG25的正交匹配追踪算法ISAR成像
- MATLAB实现二维信号压缩感知的实现
- 压缩感知算法的matlab仿真源码
- 沙威教授用小波变换当测量矩阵的O
- 压缩感知somp代码
- 压缩感知去噪
- 多维压缩感知中三维图像处理Matlab
- 压缩感知Matlab-代码与文档-l1magic-1.1
- 压缩感知稀疏度自适应匹配追踪算法
- 压缩感知MP重构算法的matlab实现
- 压缩感知重构算法基追踪(BP)
- Matlab单像素成像算法比较
- 图像稀疏表示matlab193095
- 压缩感知测量矩阵产生
- MATLAB用压缩感知恢复一维信号
- 压缩感知 贪婪追踪算法成功率的比较
- 压缩感知小波变换synsq_toolboxmatlab代码
- 压缩感知代码,matlab,l1qc_logbarrier
- 压缩感知off grid代码论文见2013
- 压缩感知 OMP重构一维二维信号matlab仿
评论
共有 条评论