資源簡介
CS_recovery_algorithms_OMP_SP_IHT.zip

代碼片段和文件信息
%???感謝親親使用此代碼,此代碼解決您的問題了嗎~(@^_^@)~
%???沒解決的話告訴親親一個(gè)好消息,登錄淘寶店鋪“大成軟件工作室”,可以下載(????)1分錢成品代碼(′▽‘〃)哦~
%???是的,親親真的沒有看錯(cuò),撓破頭皮的問題真的1分錢就可以解決了(づ??????)づ
%???小的這就把傳送門給您,記得要收藏好哦(づ ̄3 ̄)づ╭?~
%???傳送門:https://item.taobao.com/item.htm?spm=a1z10.1-c.w4004-15151018122.5.uwGoq5&id=538759553146
%???如果傳送門失效,親親可以來店鋪討要,客服MM等親親來騷擾哦~(*/ω╲*)
function?Demo_CS_CoSaMP()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?the?DCT?basis?is?selected?as?the?sparse?representation?dictionary
%?instead?of?seting?the?whole?image?as?a?vector?I?process?the?image?in?the
%?fashion?of?column-by-column?so?as?to?reduce?the?complexity.
%?Author:?Chengfu?Huo?roy@mail.ustc.edu.cn?http://home.ustc.edu.cn/~roy
%?Reference:?D.?Deedell?andJ.?Tropp?“COSAMP:?Iterative?Signal?Recovery?from
%?Incomplete?and?Inaccurate?Samples”?2008.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%------------?read?in?the?image?--------------
img=imread(‘lena.bmp‘);?????%?testing?image
img=double(img);
[heightwidth]=size(img);
%------------?form?the?measurement?matrix?and?base?matrix?---------------
Phi=randn(floor(height/3)width);??%?only?keep?one?third?of?the?original?data??
Phi?=?Phi./repmat(sqrt(sum(Phi.^21))[floor(height/3)1]);?%?normalize?each?column
mat_dct_1d=zeros(256256);??%?building?the?DCT?basis?(corresponding?to?each?column)
for?k=0:1:255?
????dct_1d=cos([0:1:255]‘*k*pi/256);
????if?k>0
????????dct_1d=dct_1d-mean(dct_1d);?
????end;
????mat_dct_1d(:k+1)=dct_1d/norm(dct_1d);
end
%---------?projection?---------
img_cs_1d=Phi*img;??????????%?treat?each?column?as?a?independent?signal
%--------?recover?using?omp?------------
sparse_rec_1d=zeros(heightwidth);????????????
Theta_1d=Phi*mat_dct_1d;
for?i=1:width
????column_rec=cs_cosamp(img_cs_1d(:i)Theta_1dheight);
????sparse_rec_1d(:i)=column_rec‘;???????????%?sparse?representation
end
img_rec_1d=mat_dct_1d*sparse_rec_1d;??????????%?inverse?transform
%------------?show?the?results?--------------------
figure(1)
subplot(221)imagesc(img)title(‘original?image‘)
subplot(222)imagesc(Phi)title(‘measurement?mat‘)
subplot(223)imagesc(mat_dct_1d)title(‘1d?dct?mat‘)
psnr?=?20*log10(255/sqrt(mean((img(:)-img_rec_1d(:)).^2)))
subplot(224)imagesc(img_rec_1d)title(strcat(‘1d?rec?img?‘num2str(psnr)‘dB‘))
disp(‘over‘)
%************************************************************************%
function?hat_x=cs_cosamp(yT_Matm)
%?y=T_Mat*x?T_Mat?is?n-by-m
%?y?-?measurements
%?T_Mat?-?combination?of?random?matrix?and?sparse?representation?basis
%?m?-?size?of?the?original?signal
%?the?sparsity?is?length(y)/4
n=length(y);???????????????????????????%?length?of?measurements
s=floor(n/4);?????????????????????????????????%?sparsity??????????????????
r_n=y;?????????????????????????????????%?initial?residuals
sig_pos_lt=[];?????????????????????????%?significant?pos?for?last?time?iteration
for?times=1:s?????
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2010-07-23?10:18??CS_recovery_algorithms_OMP_SP_IHT\
?????文件??????428181??2010-07-23?10:17??CS_recovery_algorithms_OMP_SP_IHT\CS?Recovery?Algorithms.pdf
?????目錄???????????0??2010-07-23?10:18??CS_recovery_algorithms_OMP_SP_IHT\software\
?????文件????????3932??2016-09-22?15:42??CS_recovery_algorithms_OMP_SP_IHT\software\Demo_CS_CoSaMP.m
?????文件????????8752??2016-09-22?15:43??CS_recovery_algorithms_OMP_SP_IHT\software\Demo_CS_GBP.m
?????文件????????3378??2016-09-22?15:43??CS_recovery_algorithms_OMP_SP_IHT\software\Demo_CS_IHT.m
?????文件????????3377??2016-09-22?15:43??CS_recovery_algorithms_OMP_SP_IHT\software\Demo_CS_IRLS.m
?????文件????????3814??2016-09-22?15:43??CS_recovery_algorithms_OMP_SP_IHT\software\Demo_CS_OMP.m
?????文件????????3908??2016-09-22?15:43??CS_recovery_algorithms_OMP_SP_IHT\software\Demo_CS_SP.m
?????文件???????66614??2010-05-11?20:29??CS_recovery_algorithms_OMP_SP_IHT\software\lena.bmp
- 上一篇:ZTE2017算法大賽題目及作品
- 下一篇:bianma.rar
評(píng)論
共有 條評(píng)論