Working with large hyperspect​ral/multis​pectral multiband image files in MATLAB

6 Ansichten (letzte 30 Tage)
How do I work with a large hyperspectral/multispectral image in MATLAB when the file is too large to store in RAM or MATLAB workspace? For instance a BIL, BIP, or BSQ file that has hundreds or thousands of bands, making the file very large.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 18 Jun. 2019
Bearbeitet: MathWorks Support Team am 17 Jun. 2019
Here are two suggested options for working with large mulitband images. Both involve loading only a portion of the image into the MATLAB workspace at a time, but each has advantages and disadvantages in terms of computation speed and hard drive space:
1) Operate on the image using subsets of bands
If you do not need all of the bands at once to perform your operations, you can load only a subset of the bands into the workspace at a time. To do this use the "multibandread" function, but specify that you only want a subset of the bands in the input. This would work if many of the bands are irrelevant to your analysis or if the types of operations you are performing allow you to work on the data one subset at a time.
For an example of only reading certain bands with the "multibandread" function, go to this link:
Here the "multibandread" function only read bands 4,3, and 2; as specified in the input "{'Band','Direct',[4 3 2]}":
CIR = multibandread('paris.lan', [512, 512, 7], 'uint8=>uint8',...
128, 'bil', 'ieee-le', {'Band','Direct',[4 3 2]});
For more information on the "multibandread" function, refer to the documentation:
2) Split the image into multiple files and use a datastore object
This option is similar to option 1, but use a "datastore" object to deal with the large file. To do this you will first have to read each band of the file one-by-one, using a method similar to that in option 1, then save each band as a grey-scale image somewhere in memory. Then you can load this collection of images into an "imagedatastore" or "datastore" object which can make performing certain operations easier and may be faster due to the prepossessed splitting of the image into bands. This method will be especially faster than option 1 if the "multibandread" function takes a significant amount of time and you want to operate on the image more than once. Note that doing this will take up additional hard drive space nearly equal that of the original file, but this may be a good trade-off for increase speed.
See the links below for more details:
Datastore documentation:
ImageDatastore documentation:
Example of analyzing a collection of images with datastores:

Weitere Antworten (0)

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by