天天看點

【圖像去噪】基于空間光譜總變化減少高光譜圖像的混合噪聲(Matlab代碼實作)

 👨‍🎓個人首頁:​​研學社的部落格​​ 

💥💥💞💞歡迎來到本部落格❤️❤️💥💥

🏆部落客優勢:🌞🌞🌞部落格内容盡量做到思維缜密,邏輯清晰,為了友善讀者。

⛳️座右銘:行百裡者,半于九十。

📋📋📋本文目錄如下:🎁🎁🎁

目錄

​​💥1 概述​​

​​📚2 運作結果​​

​​🎉3 參考文獻​​

​​🌈4 Matlab代碼實作​​

💥1 概述

文獻來源:

【圖像去噪】基于空間光譜總變化減少高光譜圖像的混合噪聲(Matlab代碼實作)

 本文介紹了一種基于時空總變化的高光譜去噪算法。去噪問題被表述為混合降噪問題。已經考慮了一種通用噪聲模型,該模型不僅考慮了高斯噪聲,還考慮了稀疏噪聲。利用空間次元的二維總變化和光譜次元上的一維總變化,利用了高光譜圖像的固有結構。去噪問題被表述為一個優化問題,其解決方案是使用分裂布雷格曼方法推導的。實驗結果表明,所提算法能夠顯著降低真實噪聲高光譜圖像的噪聲。所提出的算法已與現有的先進方法進行了比較。定量和定性結果表明,所提算法在峰值信噪比、結構相似性和視覺品質方面具有優越性。

📚2 運作結果

【圖像去噪】基于空間光譜總變化減少高光譜圖像的混合噪聲(Matlab代碼實作)

部分代碼:

%% Some initializations

[m,n,dim]=size(noisy); mn=m*n;

y=reshape(noisy,mn*dim,1); 

b1=zeros(mn*dim,1); x=y;b2=b1; p=b1;q=b1; s=b1; 

% Make total variation matrix

Dh=TVmatrix(m,n,'H');

Dv=TVmatrix(m,n,'V');

D=opTV1(dim);D=D';

D1=kron(D',Dh); D2=kron(D',Dv);

%D1=KronProd({Dh,D'}); D2=KronProd({Dv,D'});

%% Main iteration

 for i=1:maxiter

    %solve subproblem for x

    bigY=(y-s)+nu*D1'*(p-b1)+nu*D2'*(q-b2);        

    [x,~]=lsqr(@afun,bigY,1e-15,10,[],[],x);  

     p=SoftTh(D1*x+b1,mu/nu);

     q=SoftTh(D2*x+b2,mu/nu);

     s=SoftTh(y-x,lambda);

     %Update B1,B2 and B3

     b1=b1+D1*x-p;

     b2=b2+D2*x-q;

    if rem(i,10)==0

        fprintf('%d iterations done of %d \n ',i,maxiter);

    end

 end

 denoised=reshape(x,m,n,dim); 

%% This is a function handle used in LSQR

 function y = afun(x,str)

       tempval= nu*((D1'*(D1*x))+(D2'*(D2*x)))+ x;

            switch str

                case 'transp'

                    y = tempval;

                case 'notransp'

                    y = tempval;

            end

  end

end

%% Soft Thresholding

function X=SoftTh(B,lambda)

       X=sign(B).*max(0,abs(B)-(lambda/2));

end

%%  Total Variation

%This function will generate total variation operator for an image of size

%mxn. Both horizontal and vertical total variation operators can be made

%using this code.

function opD=TVmatrix(m,n,str)

if str=='H' % This will give matrix for Horizontal Gradient

    D = spdiags([-ones(n,1) ones(n,1)],[0 1],n,n);

    D(n,:) = 0;

    D = kron(D,speye(m));

elseif str=='V' %This will give matrix for Verticle Gradient

   D = spdiags([-ones(m,1) ones(m,1)],[0 1],m,m);

   D(m,:) = 0;

   D = kron(speye(n),D);

end

opD=D;

end

%% This function will generate total variation operator for 1D signals

function opD=opTV1(m)

🎉3 參考文獻

​​🌈​​4 Matlab代碼實作

繼續閱讀