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 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