I have a multispectral image (256*256*6)and hyperspectral image(64*64*191) how can I divide the hyperspectral image into six groups?

2 views (last 30 days)
I want to make a fusion of the hyperspectral image and multispectral image, so I want to use the giuded filter one of the steps procedure, how can I divide the hyperspectral image into six groups?

Accepted Answer

Walter Roberson
Walter Roberson on 30 Nov 2017
You have not indicated anything about how the images are to be divided into groups, so we will arbitrary decide that what you need is to divide the images into groups of consecutive panes to minimize the squared difference between the group and the mean of the group.
One way to find the best partitioning for this purpose is to use genetic algorithm:
A = your_hyperspectral_image;
V = @(M) M(:);
P = size(A, 3);
R = @(x) round(x);
obj = @(L) var(V(A(:,:,1:R(L(1)))))*R(L(1)) + var(V(A(:,:,R(L(1))+1:R(L(2)))))*(R(L(2))-R(L(1))) + var(V(A(:,:,R(L(2))+1:R(L(3)))))*(R(L(3))-R(L(2))) + var(V(A(:,:,R(L(3))+1:R(L(4)))))*(R(L(4))-R(L(3))) + var(V(A(:,:,R(L(4))+1:R(L(5)))))*(R(L(5))-R(L(4))) + var(V(A(:,:,R(L(5))+1:end)))*(P - R(L(5)));
ca = [1 -1 0 0 0;0 1 -1 0 0;0 0 1 -1 0;0 0 0 1 -1]; %linear constraints to ensure partition is sorted
cb = [-1 -1 -1 -1];
cAeq = [];
cbeq = [];
lb = [1 2 3 4 5];
ub = P-4:P;
cnonlcon = [];
options = optimoptions(@ga, 'Display', 'iter', 'PopulationSize', 2000);
[part, residue] = ga(obj, 5, cA, cb, cAeq, cbeq, lb, ub, cnonlcon, [1 2 3 4 5], options);
Now the partitions are
A(:,:,1:part(1))
A(:,:,part(1)+1:part(2))
A(:,:,part(2)+1:part(3))
A(:,:,part(3)+1:part(4))
A(:,:,part(4)+1:part(5))
A(:,:,part(5+1):end)
There are definitely other ways of dividing the hyperspectral image into 6 groups, but when we are not told what properties the groups should have, we get to invent our own definitions.
  3 Comments

Sign in to comment.

More Answers (1)

Henry Koren
Henry Koren on 29 Nov 2017
Edited: Henry Koren on 29 Nov 2017
The question is what format are these images stored in? We would like to take a look at your images if possible and work on a means of decoding them in MATLAB. Would you please be able to email them to support@imatest.com?
  1 Comment
Walter Roberson
Walter Roberson on 8 Dec 2017
I think the "divide into 6 groups" part is too vague for a meaningful solution at this point. The question does not appear to be about reading the images: the question appears to be about finding the coefficients for optimal fusion of the two images, but with the meaning of "optimal" not having been given to us.
The question puts me in mind of a question about fusion of hyperspectral images that went through about 2 or 3 years ago. I do not remember much about it at the moment, but I seem to recall that it ended up being solved efficiently by using the \ operator.
Or wait... maybe I am thinking of the question involving a four band TIFF sensor image that had to be matched against a known RGB image produced by a different program, with the question being how to get MATLAB to produce the same output as the other program when the algorithm used by other program was unknown; that one went through about a year ago.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!