• 大小: 2.92MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-16
  • 语言: 其他
  • 标签: 稀疏分解  MP  

资源简介

利用稀疏分解算法对图像进行修复,文中有一被破坏的LINA图像,修复效果可观

资源截图

代码片段和文件信息

function [Restemp] = asmpgaborr2c(ImNtermnNgenAffNNtemplet)

% Res = mpgaborr2(ImNtermnngenAff);
% Matching Pursuit analysis with real 2-D atoms

% Im : image to be analyzed
% Nterm: number of terms in decomposition
% n: number of chromosomes
% Ngen: number of genes
% Aff = 0 no display =1 display
% Res matrix of results: line -> term number 
%      - col 1 -> Projection
%      - col 2 -> location x
%      - col 3 -> location y
%      - col 4 -> scaling x
%      - col 5 -> scaling y
%      - col 6 -> rotation angle
%
%    Jean-Marc Vesin and Pierre Vandergheynst
%    Initial Version April 2000
%    Modified by Rosa M. Figueras i Ventura
%    May 2000
%imageatom=zeros(128);







sig = ones(61);
sig(1)=3;%input(‘standard deviation for mutation location x?‘);
sig(2)=3;%input(‘standard deviation for mutation location y?‘);
sig(3)=3;%input(‘standard deviation for mutation scaling?‘);
sig(4)=3;%input(‘standard deviation for mutation angle?‘);
sig(5)=4-0.001;
sig(6)=4;


base=Im;
Res=[];
[hxhy]=size(Im);
[xaya]=meshgrid(0:hy-10:hx-1);


yinexp=0:0.01:min(hxhy)/4;
yinexp=exp(-yinexp);



sig=sig*(min(hxhy)/128.);

temp= zeros(size(Im));
Res = zeros(Nterm6);

[rxry]=ass_r_relation(NNhxhy);

bst=NN*log2(min(hxhy))-NN;


bi=ones(51);
bs=ones(51);

%Atom Index Structure :
%12: positions 34: scaling 5: angle

%bi: lower bounds
%bs: upper bounds

bi(1)=0;
bi(2)=0;
bi(3)=0;
bi(4)=0;
bi(5)=0;

bs(1)=hx;
bs(2)=hy;
%bs(3)=round(NN*log2(min(hxhy))-NN);
%bs(3)=bsloop;
%bs(4)=bsloop;
bs(5)=min(hxhy);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
coef=sum(sum(Im))/(hx*hy);     %%%%%
atom=ones(hxhy);              %%%%%    First of all we take    
Im=Im-coef*atom;               %%%%%    The continuous from 
temp=coef*atom;                %%%%%    the image
Res(11)=coef;                 %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
coef

for loop =2:Nterm
    
%     if loop<100
%         bsloop=round(bst*(1-loop/100*0.3));
%     else
%         bsloop=round(bst*(-0.00075*loop+0.775));
%     end
  bsloop=round(bst*(1-loop/Nterm*0.5)); 
    
    bs(3)=bsloop;
    bs(4)=bsloop;
        
%   bsloop=round(bst);
    fprintf(‘ \n \n the step %d‘loop);

%    Im(1:81:8)
    
    % search of the best atom by ga (Genetic Algorithm) gaborr2
    [veccoefeq]=asygagaborr2c(ImsignNgenAffNNrxryNtermloopbsloophxhyxayayinexpbibstemplet);
    % computation of the atom
  
    
    
    
    %x=cos(pi*vec(4)/(min(hxhy)))*(xa-vec(1))+...
    %      sin(pi*vec(4)/(min(hxhy)))*(ya-vec(2));
    %y=cos(pi*vec(4)/(min(hxhy)))*(ya-vec(2))-...
    %      sin(pi*vec(4)/(min(hxhy)))*(xa-vec(1));
    %xx=x/2^(vec(3)/NN);
    %yy=y/2^(vec(3)/NN);
    %atom=(sqrt(2)/2^(vec(3)/NN))*(exp(-pi*(xx.*xx+yy.*yy)).*...
    %              exp(i*pi*min(hxhy)/(hx+hy)*xx));
    %a=sum(

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       6763  2008-11-29 16:06  图像信息修复\asmpgaborr2c.m

     文件       1375  2008-12-02 16:35  图像信息修复\ass_r_relation.m

     文件       5641  2008-11-28 22:53  图像信息修复\asygagaborr2c.m

     文件        779  2008-12-27 14:03  图像信息修复\atestprogramsc.m

     文件      78545  2009-07-27 11:25  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1.ctf

     文件       1190  2009-07-27 11:27  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_1_0.c

     文件      98304  2009-07-27 11:25  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_1_0.dll

     文件       9468  2009-07-27 11:27  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_1_0.h

     文件       1694  2009-07-27 11:25  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\atestprogram\asmpgaborr2c.m

     文件        914  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\atestprogram\ass_r_relation.m

     文件       1589  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\atestprogram\asygagaborr2c.m

     文件        854  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\atestprogram\atestprogramsc.m

     文件        869  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\atestprogram\atestprogramsc_test1.m

     文件       8704  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\atestprogram\strapecalculation.mexw32

     文件        614  2009-07-27 11:25  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\atestprogram\strapecalculation_mexw32.auth

     文件       3198  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\atestprogram_33AD0F442D2A84034A3FF64539D265B2\compopts.bat

     文件        248  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\atestprogram_33AD0F442D2A84034A3FF64539D265B2\matlab.prf

     文件         40  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\atestprogram_33AD0F442D2A84034A3FF64539D265B2\MLintDefaultSettings.txt

     文件        901  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\atestprogram_33AD0F442D2A84034A3FF64539D265B2\WebRenderer\pluginreg.dat

     文件         53  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\toolbox\compiler\Contents.m

     文件        824  2009-07-27 11:25  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\toolbox\compiler\ctfroot.m

     文件       3104  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\toolbox\compiler\deploy\deployprint.m

     文件       7168  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\toolbox\compiler\deploy\deploywhich.mexw32

     文件        629  2009-07-27 11:25  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\toolbox\compiler\deploy\deploywhich_mexw32.auth

     文件      10195  2006-05-27 14:02  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\toolbox\compiler\deploy\FigureMenuBar.fig

     文件       6944  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\toolbox\compiler\deploy\FigureToolBar.fig

     文件        749  2009-07-27 11:25  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\toolbox\compiler\deploy\fopen.m

     文件        869  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\toolbox\compiler\deploy\input.m

     文件        779  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\toolbox\compiler\deploy\pause.m

     文件        959  2009-08-07 08:57  图像信息修复\atestprogramsc_test1\distrib\atestprogramsc_test1_mcr\toolbox\compiler\deploy\printdlg.m

............此处省略176个文件信息

评论

共有 条评论