Reputation: 432
I have a satellite image in the BSQ format. I initially processed it using ENVI. Now, I am trying to read the image using Matlab's multibandread function.
This is the data pertaining to the image I am trying to load
samples = 911
lines = 3191
bands = 196
header offset = 0
data type = 2
interleave = bsq
byte order = 0
This is the code I've written to load the image.
I = multibandread('QUAC.bsq',[3191,911,196], ...
'int16','0','bsq','ieee-le',{'Band','Direct',[29,23,16]});
I am getting the following errors:
Error using multibandread>parseInputs (line 311)
Unable to open QUAC.bsq for reading.
Error in multibandread (line 112)
info = parseInputs(filename, dims,...
I looked up the format for the multibandread function on this website http://www.ehu.es/ccwintco/uploads/d/dc/LoadHypercubesMatlab.pdf
I checked the code for parseInputs on MATLAB, but I was unable to make any difference.
What mistake am I committing while trying to load the image?
Upvotes: 1
Views: 1955
Reputation: 41
The question is a bit old, but it may be useful for somebody else to know the answer.
This was most likely a wrong filename ('QUAC.bsq'), or that file was not located in the current MATLAB working directory.
There is another mistake in the list of arguments that, with a valid filename, returns this error in Matlab 2015b :
Error using multibandread>parseInputs (line 337)
Expected input to be one of these types:
double, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64
Instead its type was char.
Error in multibandread (line 111)
info = parseInputs(filename, dims,...
Replacing '0' with 0 in multibandread arguments should fix the problem, worked for me. The correct syntax is:
I = multibandread('QUAC.bsq',[3191,911,196], ...
'int16',0,'bsq','ieee-le',{'Band','Direct',[29,23,16]});
Upvotes: 3