资源简介
融合.zip
代码片段和文件信息
clear
I1=imread(‘C:\Users\攀攀\Desktop\融合\spot.bmp‘);
I2=imread(‘C:\Users\攀攀\Desktop\融合\tm_743.bmp‘);
I1=double(I1);
I2=double(I2);
mI1=mean2(I1);
I2r=I2(::1);
I2g=I2(::2);
I2b=I2(::3);
mI2r=mean2(I2r);
mI2g=mean2(I2g);
mI2b=mean2(I2b);
%加权融合
r_r=sum(sum((I1-mI1).*(I2r-mI2r)))/(sqrt(sum(sum((I1-mI1).^2))*sum(sum((I2r-mI2r).^2))));
r_g=sum(sum((I1-mI1).*(I2g-mI2g)))/(sqrt(sum(sum((I1-mI1).^2))*sum(sum((I2g-mI2g).^2))));
r_b=sum(sum((I1-mI1).*(I2b-mI2b)))/(sqrt(sum(sum((I1-mI1).^2))*sum(sum((I2b-mI2b).^2))));
RHr=((1+abs(r_r)).*I1+(1-abs(r_r)).*I2r)/2;
RHg=((1+abs(r_g)).*I1+(1-abs(r_g)).*I2g)/2;
RHb=((1+abs(r_b)).*I1+(1-abs(r_b)).*I2b)/2;
RH1=cat(3RHrRHgRHb);%融合成三维
RH1=uint8(RH1);
%比值变换
B1=I2r;
B2=I2g;
B3=I2b;
D=I1;
DB1=(B1./(B1+B2+B3)).*D;
DB2=(B2./(B1+B2+B3)).*D;
DB3=(B3./(B1+B2+B3)).*D;
RH2=cat(3DB1DB2DB3);
RH2=uint8(RH2);
%乘积变换
db1=D.*B1/mI1;
db2=D.*B2/mI1;
db3=D.*B3/mI1;
RH3=cat(3db1db2db3);
RH3=uint8(RH3);
%融合后图像显示
subplot(131);imshow(RH1);title(‘加权融合后图像‘);
subplot(132);imshow(RH2);title(‘比值变换后图像‘);
subplot(133);imshow(RH3);title(‘乘积变换后图像‘);
%融合效果评价
RH1=double(RH1);
RH2=double(RH2);
RH3=double(RH3);
hdr = mI2r;
hdg = mI2g;
hdb = mI2b; %原始多光谱影像
hd1r = mean2(RH1(::1));
hd1g = mean2(RH1(::2));
hd1b = mean2(RH1(::3)); %加权融合后
hd2r = mean2(RH2(::1));
hd2g = mean2(RH2(::2));
hd2b = mean2(RH2(::3)); %比值变换后
hd3r = mean2(RH3(::1));
hd3g = mean2(RH3(::2));
hd3b = mean2(RH3(::3)); %乘积变换后
%相关系数
r1R = sum(sum((I2r - hdr).*(RH1(::1) - hd1r))) / sqrt((sum(sum((I2r - hdr).*(I2r - hdr)))) * (sum(sum((RH1(::1) - hd1r).*(RH1(::1) - hd1r)))));
r1G = sum(sum((I2g - hdg).*(RH1(::2) - hd1g))) / sqrt((sum(sum((I2g - hdg).*(I2g - hdg)))) * (sum(sum((RH1(::2) - hd1g).*(RH1(::2) - hd1g)))));
r1B = sum(sum((I2b - hdb).*(RH1(::3) - hd1b))) / sqrt((sum(sum((I2b - hdb).*(I2b - hdb)))) * (sum(sum((RH1(::3) - hd1b).*(RH1(::3) - hd1b)))));
r2R = sum(sum((I2r - hdr).*(RH2(::1) - hd2r))) / sqrt((sum(sum((I2r - hdr).*(I2r - hdr)))) * (sum(sum((RH2(::1) - hd2r).*(RH2(::1) - hd2r)))));
r2G = sum(sum((I2g - hdg).*(RH2(::2) - hd2g))) / sqrt((sum(sum((I2g - hdg).*(I2g - hdg)))) * (sum(sum((RH2(::2) - hd2g).*(RH2(::2) - hd2g)))));
r2B = sum(sum((I2b - hdb).*(RH2(::3) - hd2b))) / sqrt((sum(sum((I2b - hdb).*(I2b - hdb)))) * (sum(sum((RH2(::3) - hd2b).*(RH2(::3) - hd2b)))));
r3R = sum(sum((I2r - hdr).*(RH3(::1) - hd3r))) / sqrt((sum(sum((I2r - hdr).*(I2r - hdr)))) * (sum(sum((RH3(::1) - hd3r).*(RH3(::1) - hd3r)))));
r3G = sum(sum((I2g - hdg).*(RH3(::2) - hd3g))) / sqrt((sum(sum((I2g - hdg).*(I2g - hdg)))) * (sum(sum((RH3(::2) - hd3g).*(RH3(::2) - hd3g)))));
r3B = sum(sum((I2b - hdb).*(RH3(::3) - hd3b))) / sqrt((sum(sum((I2b - hdb).*(I2b - hdb)))) * (sum(sum((RH3(::3) - hd3b).*(RH3(::3) - hd3b)))));
%均值偏差:
b1R = abs(hdr - hd1r) / hd1r;
b1G = abs(hdg - hd1g) / hd1g;
b1B = abs(hdb - hd1b) / hd1b;
b2R = abs(hdr
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3966 2015-10-29 13:57 融合\Fusion.m
文件 187904 2015-10-29 14:54 融合\Thumbs.db
文件 17241982 2015-10-21 20:01 融合\spot.bmp
文件 51689158 2015-10-22 15:03 融合\tm_743.bmp
文件 305 2015-10-29 16:49 融合\融合精度.txt
目录 0 2015-10-29 13:58 融合\
相关资源
- HadoopSpark生态系统操作与实战指南.余
- ACR122,PM03,日期,楼层,管理软件
- vss2005汉化包.zip
- 迅捷转换器破解r.zip
- networkdisk.rar
- winmail.zip
- ANSYSWorkbench结构工程高级应用978-7-51
- 炸金花服务端源码.zip
- 带参数的火灾检测界面GUI版配论文.
- LabVIEW从入门到精通(第二版).rar
- 数字存储示波器通用规范-GB15289-2013
- 文章.zip
- 深度学习:卷积神经网络从入门到精
- UNIX网络编程卷1:套接字联网API第3版
- 20160915112121114.zip
- 7.8.rar
- HJ独立版3.1.3.zip
- dps.rar
- VentSIM_6118.zip
- [电子学第二版].霍罗威茨.扫描版.pd
- 深度学习之PyTorch实战计算机视觉-唐进
- 偷窥狂破解版+使用教程+端口扫描+破
- mingw64+opencv.zip
- SpreadJS_3.20151.16.zip
- HeimaCodeUtil_V2.4.rar
- 禾匠-榜店商城小程序V4_4.2.37独立版开
- Node.js书本汇总.zip
- H5炸_金花_比鸡_牛牛集合版.rar
- person.zip
- Xmind破解8.7z
评论
共有 条评论