MATLAB: How to have to get the rgb image back with good quality? I had performed several operations on it but i am not getting the proper output. I am merging two images for more information. But it’s a distorted image. Please help me out.

figureImage Processing Toolbox

firstim=imread('IM1.JPG');
img1=imresize(firstim,[256 256]);
[~, ~]=size(img1);
newimg=rgb2hsv(img1);
H1=newimg(:,:,1);
S1=newimg(:,:,2);
V1=newimg(:,:,3);
I3=imadjust()
secondim=imread('IM2.JPG');
img2=imresize(secondim,[256 256]);
[~, ~]=size(img2);
newimg1=rgb2hsv(img2);
H2=newimg1(:,:,1);
S2=newimg1(:,:,2);
V2=newimg1(:,:,3);
hue=H1+H2;
saturation=S1+S2;
int1=fft(V1);
int2=fft(V2);
int=int1+int2;
ifft_intensity=ifft(int);
img = [];
for i = 1:256
for j = 1:256
img(i,j,1) = hue(i,j);
img(i,j,2) = saturation(i,j);
img(i,j,3) = ifft_intensity(i,j);
end
end
fi_im=hsv2rgb(img);
figure, imshow(fi_im);

Best Answer

True. If you perform several operations on an image it will most likely be changed/distorted, and not be the same as the original. That's why, if you need that original image again, you should save the original image.