fusion of satellite images

2 ビュー (過去 30 日間)
dakhli mohamed
dakhli mohamed 2019 年 1 月 24 日
コメント済み: Eylem Dalgic 2021 年 12 月 7 日
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 Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by