图像融合是将多个不同传感器对同一场景采集的多幅图片结合起来生成一幅图片更清晰,信息更丰富,包含所有源图像重要特征的图像,有助于人类和机器的理解以及后续的处理.目前图像融合技术在遥感,医学,军事,交通等方面得到广泛应用.其中,最主要的技术是红外与可见光图像的融合.它的原理是将经过配准的,描述同一场景的红外图像与可见光图像进行处理,综合有用信息,剔除冗余信息,方便进一步的观察和处理.这样的融合图像相比红外或可见光源图像,即保留了重要的信息,又减少了冗余的信息,而且往往具有更好的视觉效果.首先,介绍了图像融合的研究背景和意义,总结了红外与可见光融合技术的研究现状,明确了本文的研究内容及安排.其次,阐述了红外图像与可见光图像的成像原理,比较它们之间的优缺点,论证了图像融合的好处.
%% section I: Read source images(读取源图像) clear all set(0,'defaultfigurecolor','w') DistortFlag = 0;%input('Is there distortion of infrared image? :\n');(需要判断红外图像是否失真) [I1gray, I2gray, I1rgb, I2rgb, f1, f2, path] = cp_readImage;... % (0,'F:\',['I' num2str(infrared) '.jpg'], ['V' num2str(visible) '.jpg']); %% section II: Resize images based on the minimum imaclosege height(根据最小图像闭合高度调整图像大小) height = size(I1gray,1); [I1, I2, scale] = cp_resizeImage(I1gray,I2gray,height); %% section III: Registrate iteratively & Coarse matching(反复注册和粗略匹配) close all; clc; I1_itea = I1; iterationNum = 1; iteration = 0; Runtime = 0; maxRMSE = 4*ceil(size(I2,1)/300); AffineTrans = zeros([3 3 iterationNum]); while iteration < iterationNum fprintf('\n%d(th) iteration of registration...\n',iteration); [P1,P2, Rt,corner12] = cp_registration(I1_itea,I2, 20, maxRMSE,iteration, 1, 0, 6, 1 ,I2gray); % cp_registration(I1, I2, theta,maxRMSE,iteration,zoom+,zoom-,Lc,showflag,I2gray) Runtime = Rt + Runtime [I1_itea,affmat] = cp_getAffine(I1_itea,I2,P1,P2); % [v1,u1]==[v2,u2] iteration = iteration+1; AffineTrans(:,:,iteration) = affmat.T; end % Points of I1gray after resize (调整大小的点位置) P1 = [P1 ones([length(P1) 1])]; [pos_cor1,~] = find(corner12(:,1) == 0); for iteration = iteration:-1:2 P1 = P1 / AffineTrans(:,:,iteration-1); cor12 = [corner12(1:pos_cor1-1,1:2) ones(pos_cor1-1,1)] / AffineTrans(:,:,iteration-1); P1(:,1:2) = P1(:,1:2) ./ P1(:,3); P1(:,3) = ones(length(P1),1); corner12(1:pos_cor1-1,1:2) = cor12(:,1:2) ./ cor12(:,3); corner12(1:pos_cor1-1,3) = ones(pos_cor1-1,1); end P1 = P1(:,1:2); corner12 = corner12(:,1:2); % Correct matches in the source images P1(:,2) = size(I1gray,1) / 2 + scale(1) * ( P1(:,2)-size(I1,1)/2); P1(:,1) = size(I1gray,2) / 2 + scale(1) * ( P1(:,1)-size(I1,2)/2); corner12(1:pos_cor1-1,2) = size(I1gray,1) / 2 + scale(1) * ( corner12(1:pos_cor1-1,2)-size(I1,1)/2); corner12(1:pos_cor1-1,1) = size(I1gray,2) / 2 + scale(1) * ( corner12(1:pos_cor1-1,1)-size(I1,2)/2); P2(:,2) = size(I2gray,1) / 2 + scale(2) * ( P2(:,2)-size(I2,1)/2); P2(:,1) = size(I2gray,2) / 2 + scale(2) * ( P2(:,1)-size(I2,2)/2); corner12(pos_cor1+1:end,2) = size(I2gray,1) / 2 + scale(2) * ( corner12(pos_cor1+1:end,2)-size(I2,1)/2); corner12(pos_cor1+1:end,1) = size(I2gray,2) / 2 + scale(2) * ( corner12(pos_cor1+1:end,1)-size(I2,2)/2); %% section IV: Fine matching P3 = cp_subpixelFine(P1,P2); % Fine matching %% section V: Show visual registration result [~,affmat] = cp_getAffine(I1gray,I2gray,P1,P3); Imosaic = cp_graymosaic(I1gray, I2gray, affmat); figure, subplot(121),imshow(Imosaic);subplot(122),imshow(cp_rgbmosaic(I1rgb,I2rgb,affmat)); cp_showResult(I1rgb,I2rgb,I1gray,I2gray,affmat,3); % checkborder image cp_showMatch(I1rgb,I2rgb,P1,P2,[],'Before Subpixel Fining'); cp_showMatch(I1rgb,I2rgb,P1,P3,[],'After Subpixel Fineing'); % imwrite(cp_rgbmosaic(I1rgb,I2rgb,affmat),['D:\' f1(1:end-4) '_Mosaic.jpg']); %% Obtain reference transformation matrix manually
[1]曾文锋. "红外与可见光图像融合中的快速配准方法." 红外与激光工程 02(2002):66-68.
[2]叶锴. (2019). 红外和可见光图像融合技术研究. (Doctoral dissertation, 哈尔滨工程大学).