IHS wavelet image fusion

2 Ansichten (letzte 30 Tage)
Tanya
Tanya am 2 Mai 2014
The code uses two images one panchromatic and other multispectral. The images are to be fused using IHS based wavelet image fusion technique.I am using the following code for image fusion but facing problem at the end line:
img_pan = imread('C:\Documents and Settings\admin\Desktop\TM\tanya\img3.tif');
img_msi = imread('C:\Documents and Settings\admin\Desktop\TM\tanya\img4.tif');
[r c] = size(img_pan);
img_msi_re = imresize(img_msi,[r c],'bilinear');
img_pan=im2double(img_pan);
img_msi=im2double(img_msi);
r=img_msi(:,:,1);
g=img_msi(:,:,2);
b=img_msi(:,:,3);
th=acos((0.5*((r-g)+(r-b)))./((sqrt((r-g).^2+(r-b).*(g-b)))+eps));
H=th;
H(b>g)=2*pi-H(b>g);
H=H/(2*pi);
S=1-3.*(min(min(r,g),b))./(r+g+b+eps);
I=(r+g+b)/3;
hsi=cat(3,H,S,I);
HE=H*2*pi;
HE=histeq(HE);
HE=HE/(2*pi);
SE=histeq(S);
IE=histeq(I);
figure, imshow(hsi),title('HSI Image');
img_msi_re_hsi = hsi;
I = img_msi_re_hsi(:,:,3);
hespc = imhist(I);
img_pan_histeq = histeq(img_msi,hespc);
error:
??? Error using ==> iptcheckinput
Function HISTEQ expected its first input, I, to be two-dimensional.
Error in ==> histeq at 100
iptcheckinput(a,{'uint8','uint16','double','int16','single'}, ...

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by