fusion of satellite images

2 次查看(过去 30 天)
Hello
I want to make a fusion between 3 image (satellite type image attached) I tried with this code but it did not work someone has an idea and thank you in advance.
image(:,:,1)= load('C1fig.mat');
image(:,:,2)= load('C2fig.mat');
image(:,:,3)= load('C3fig.mat');

采纳的回答

Guillaume
Guillaume 2019-1-24
First, don't use image as a variable name, it's already the name of a matlab function that you may want to use. In the same vein, don't name your variables ans (as they are named in the mat files). This is a special variable in matlab. If these ans variable come from a function, then call that function with an output variable with a sensible name instead of calling that function with no output.
load with an output variable (which is the correct way to use load) creates a structure where each field is one of the variable in the mat file. So your first load will create field ans in image(:,:,1) variable. Because load always return a scalar structure, the : are equivalent to 1. With your code, you are in effect creating a 1x1x3 structure with field ans. A simpler and clearer way to achieve this is with:
imgs = []; %make sure it's empty before we load the mat file. Not calling it image but imgs
imgs(1) = load('C1fig.mat');
imgs(2) = load('C2fig.mat');
imgs(3) = load('C3fig.mat');
Now, it's not clear what you call fusion. Going by your original code, it looks like you want to merge all three greyscale images as a true colour image, with the first one being the red channel, the second the blue channel and the third the red channel. If that's the case, then:
img = cat(3, imgs.ans);
imshow(img)
If by fusion you mean something else entirely, then you need to clarify.
  4 个评论
dakhli mohamed
dakhli mohamed 2019-1-24
I made a bad handling that market thank you very much
Eylem Dalgic
Eylem Dalgic 2021-12-7
So how can we do this with a loop if there are too many images in jpg format?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by