包含K-SVD和MOD两种算法对信号和图像处理代码例子。使用DCT字典,使用OMP算法计算稀疏系数。
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3779 2015-11-13 18:43 KSVDallkindsofmethodscompare.m
文件 41080 2018-01-19 16:12 KSVDBJ200_14.BMP
文件 218 2015-10-30 20:40 KSVDDCT_test.m
文件 1907 2018-03-28 16:31 KSVDdemo1.m
文件 3594 2018-01-19 16:28 KSVDdemo2.m
文件 8504 2006-12-28 13:57 KSVDdemo3.m
文件 6840 2018-01-23 15:40 KSVDdenoiseImageDCT.m
文件 6565 2018-01-23 14:12 KSVDdenoiseImageGlobal.m
文件 10446 2018-03-28 16:45 KSVDdenoiseImageKSVD.m
文件 4337 2018-01-22 11:42 KSVDdisplayDictionaryElementsAsImage.m
文件 1896 2006-12-11 14:25 KSVDgererateSyntheticDictionaryAndData.m
文件 5749450 2005-09-21 08:35 KSVDglobalTrainedDictionary.mat
文件 16429 2018-03-28 15:28 KSVDKSVD.m
文件 11585 2006-12-28 14:02 KSVDKSVD_NN.m
文件 263222 2015-11-04 16:05 KSVDlena.bmp
文件 8053 2006-12-12 08:35 KSVDMOD.m
文件 857 2018-01-23 13:43 KSVDmy_im2col.m
文件 1105 2006-12-24 16:00 KSVDNN_BP.m
文件 954 2007-04-29 10:17 KSVDOMP.m
文件 1372 2015-11-12 17:13 KSVDOMPerr.m
文件 22408 2015-11-04 17:20 KSVDw.jpg
..A..H. 162 2018-04-17 15:52 KSVD~$表示KSVD.docx
.....H. 15605 2018-01-24 19:37 KSVD~WRL1849.tmp
文件 116486 2018-04-17 15:52 KSVD稀疏表示KSVD.docx
目录 0 2018-04-17 15:52 KSVD
----------- --------- ---------- ----- ----
6296854 25
%============================================================
% demo2 - denoise an image
% this is a run_file the demonstrate how to denoise an image
% using dictionaries. The methods implemented here are the same
% one as described in “Image Denoising Via Sparse and Redundant
% representations over Learned Dictionaries“ (appeared in the
% IEEE Trans. on Image Processing Vol. 15 no. 12 December 2006).
% ============================================================
clear
bb=8; % block size
RR=4; % redundancy factor 冗余因素
K=RR*bb^2; % number of atoms in the dictionary
sigma = 50;
%pathForImages =‘‘;
%imageName = ‘barbara.png‘;
% [IMin0pp]=imread(‘cameraman.tif‘);
[IMin0pp]=imread(‘w.jpg‘);
IMin0=im2double(IMin0);
if (length(size(IMin0))>2)
IMin0 = rgb2gray(IMin0);
end
if (max(IMin0(:))<2)
IMin0 = IMin0*255;
end
IMin=IMin0+sigma*randn(size(IMin0));%%%%%%此处有随机函数
PSNRIn = 20*log10(255/sqrt(mean((IMin(:)-IMin0(:)).^2)));
% %==========================================================================
% % P E R F O R M D E N O I S I N G U S I N G O V E R C O M P L E T E
% % D C T D I C T I O N A R Y
% %==========================================================================
% tic
% [IoutDCToutputCoefs] = denoiseImageDCT(IMin sigma K);
%
% PSNROut = 20*log10(255/sqrt(mean((IoutDCT(:)-IMin0(:)).^2)));
% figure;
% subplot(131); imshow(IMin0[]); title(‘Original clean image‘);
% subplot(132); imshow(IMin[]); title(strcat([‘Noisy image ‘num2str(PSNRIn)‘dB‘]));
% subplot(133);
% imshow(IoutDCT[]); title(strcat([‘Clean Image by DCT dictionary ‘num2str(PSNROut)‘dB‘]));
% figure;
% I = displayDictionaryElementsAsImage(output.D floor(sqrt(K)) floor(size(output.D2)/floor(sqrt(K)))bbbb0);%当不输入0时,效果不一样,具体的看内部代码
% title(‘The DCT dictionary‘);
% toc
%==========================================================================
% P E R F O R M D E N O I S I N G U S I N G G L O B A L
% ( O R G I V E N ) D I C T I O N A R Y
%==========================================================================
% tic
% [IoutGlobaloutput] = denoiseImageGlobal(IMin sigmaK);
%
% PSNROut = 20*log10(255/sqrt(mean((IoutGlobal(:)-IMin0(:)).^2)));
% figure;
% subplot(131); imshow(IMin0[]); title(‘Original clean image‘);
% subplot(132); imshow(IMin[]); title(strcat([‘Noisy image ‘num2str(PSNRIn)‘dB‘]));
% subplot(133);
% imshow(IoutGlobal[]); title(strcat([‘Clean Image by Global Trained dictionary ‘num2str(PSNROut)‘dB‘]));
% figure;
% I = displayDictionaryElementsAsImage(output.D floor(sqrt(K)) floor(size(output.D2)/floor(sqrt(K)))bbbb);
% title(‘The dictionary trained on patches from natural images‘);
% toc
%==========================================================================
% P E R F O R M D E N O I S I N G U S I N G A D I C T I O N A R Y
% T R A I N
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3779 2015-11-13 18:43 KSVDallkindsofmethodscompare.m
文件 41080 2018-01-19 16:12 KSVDBJ200_14.BMP
文件 218 2015-10-30 20:40 KSVDDCT_test.m
文件 1907 2018-03-28 16:31 KSVDdemo1.m
文件 3594 2018-01-19 16:28 KSVDdemo2.m
文件 8504 2006-12-28 13:57 KSVDdemo3.m
文件 6840 2018-01-23 15:40 KSVDdenoiseImageDCT.m
文件 6565 2018-01-23 14:12 KSVDdenoiseImageGlobal.m
文件 10446 2018-03-28 16:45 KSVDdenoiseImageKSVD.m
文件 4337 2018-01-22 11:42 KSVDdisplayDictionaryElementsAsImage.m
文件 1896 2006-12-11 14:25 KSVDgererateSyntheticDictionaryAndData.m
文件 5749450 2005-09-21 08:35 KSVDglobalTrainedDictionary.mat
文件 16429 2018-03-28 15:28 KSVDKSVD.m
文件 11585 2006-12-28 14:02 KSVDKSVD_NN.m
文件 263222 2015-11-04 16:05 KSVDlena.bmp
文件 8053 2006-12-12 08:35 KSVDMOD.m
文件 857 2018-01-23 13:43 KSVDmy_im2col.m
文件 1105 2006-12-24 16:00 KSVDNN_BP.m
文件 954 2007-04-29 10:17 KSVDOMP.m
文件 1372 2015-11-12 17:13 KSVDOMPerr.m
文件 22408 2015-11-04 17:20 KSVDw.jpg
..A..H. 162 2018-04-17 15:52 KSVD~$表示KSVD.docx
.....H. 15605 2018-01-24 19:37 KSVD~WRL1849.tmp
文件 116486 2018-04-17 15:52 KSVD稀疏表示KSVD.docx
目录 0 2018-04-17 15:52 KSVD
----------- --------- ---------- ----- ----
6296854 25
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)