% HCI colour fusion % written by Stavri Nikolov (stavri.nikolov@bristol.ac.uk), University of Bristol, UK % directory containing the input images dirname='c:\testimages\'; % input images. e.g % high-resolution spot image fname1='denver-spot.bmp'; % and low-resolution landsat image fname2='denver-landsat.bmp'; % note: this is just an example and the test images are not % provided with this script % load input images [im1,map1]=imread([dirname fname1],'bmp'); [im2,map2]=imread([dirname fname2],'bmp'); % convert index images to rgb images rgbim1=ind2rgb(im1,map1); rgbim2=ind2rgb(im2,map2); % convert second rgb image to hsv hsvim2 = rgb2hsv(rgbim2); % replace it's value/intensity channel with that of the first image hsvim2(:,:,3)=rgbim1(:,:,3); % convert back from hsv to rgb hsvim = hsv2rgb(hsvim2); % show the hsi fused image imshow(hsvim); % and save it imwrite(hsvim,[dirname 'denver-hsv-fusion.bmp'],'bmp');