CSfusion.m ( File view )

 北单比分zhibo www.603090.live 
			%  本程序實現基于壓縮傳感的圖像圖像融合
%  程序作者:趙昊,南京航空航天大學信息工程系
%  輸入變量:A是待融合的圖像矩陣,B是待融合的圖像矩陣
%  輸出變量:X3是融合后的圖像矩陣,大小于A,B相同
%  參考程序:沙威,WaveletOMP.m

%function X1=CSfusion(A,B)
A1=imread('F:\CS研究\CS\fusion program\CSfusion\1.jpg');%可見光圖像
figure;
subplot(2,2,1);
imshow(A1);
A=rgb2gray(A1);
B1=imread('F:\CS研究\CS\fusion program\CSfusion\2.jpg');%紅外圖像
subplot(2,2,2);
imshow(B1);
B=rgb2gray(B1);
%對原始圖像進行預處理
[a0,b0]=size(A);
a01=nextpow2(a0);
b01=nextpow2(b0);
if a01>b01
    M1=2^a01;
else
    M1=2^b01;
end
Am=[A,randn(a0,M1-b0);randn(M1-a0,M1)];
Bm=[B,randn(a0,M1-b0);randn(M1-a0,M1)];


Am=double(Am);
Bm=double(Bm);
[a,b]=size(Am);

%  小波變換矩陣生成
ww=DWT(a);
size(ww);
%  小波變換讓圖像稀疏化(注意該步驟會耗費時間,但是會增大稀疏度)
A1=ww*sparse(Am)*ww';
size(sparse(Am));%skjfskf;lsa;lf
A1=full(A1);
B1=ww*sparse(Bm)*ww';
B1=full(B1);

%  隨機矩陣生成
M=190;
R=randn(M,a); %高斯隨機分布函數

%  測量并融合
Y1=R*A1;
Y2=R*B1;
Y=(Y1+Y2)/2;

%  OMP算法
X2=zeros(a,b);  %  恢復矩陣
for i=1:b  %  列循環
    rec=omp(Y(:,i),R,a);
    X2(:,i)=rec;
end

%  壓縮傳感恢復的圖像
X3=ww'*sparse(X2)*ww;  %  小波反變換
X3=full(X3);
X1=X3(1:a0,1:b0);
%X1=uint8(X1);%顯示圖像最好用uint8
subplot(2,2,3);
imshow(X1,[]);
%  OMP的函數
%  s-測量;T-觀測矩陣;N-向量大小
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
01.97 kB
CSfusion.asv1.37 kB2014-12-02 08:52
CSfusion.m1.39 kB2014-12-02 08:53
DWT.m1.04 kB2009-10-14 18:27
omp.m1.25 kB2014-09-28 20:46
tuxiang1.jpg25.89 kB2009-04-24 21:20
tuxiang2.jpg23.90 kB2009-04-24 21:20
...
Sponsored links

CSfusion.m (53.75 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: [email protected]

切換到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
北单比分zhibo

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D
{ganrao}