satellite image pre-processing
Ältere Kommentare anzeigen
Hello,
I have a satellite image with 365 bands. I intend to get the mean of every 8 bands(that is, (b1+b2+b3+b4+b5+b6+b7+b8)/8, then (b9+b10+b11....b16)/8, and so on? does somebody have a code for this?
Thanks, Booker.
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 22 Jan. 2012
Some image file formats are able to store multiple bands per image, and imread() can read all the bands in at the same time, either as an X by Y by 3 by Bands or X by Y by Bands array (depending on how the data is stored in the image file.)
You can
s = size(ImageMatrix);
By8 = reshape(ImageMatrix, [s(1:end-1), 8, s(end)/8]);
nd = ndims(By8);
mean(By8,nd)
However, you will have a problem because the number of bands you have is not evenly divisible by 8. How do you want to handle the final 5 bands?
1 Kommentar
Booker
am 23 Jan. 2012
Kategorien
Mehr zu CubeSat and Satellites finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!