How to load AVIRIS datasets

9 visualizaciones (últimos 30 días)
Cheryl S
Cheryl S el 29 de Dic. de 2020
Editada: Jennifer Lumbres el 4 de Jun. de 2022
Hi everyone, I have downloaded some AVIRIS datasets from https://aviris.jpl.nasa.gov/dataportal/ and have been trying to have a look at them in MATLAB. The images I obtained, however, are strange, and don't look anything like the data preview from the page. I have looked at a few resources, including
but still have not found a solution. Can anyone please shed some light on what I am doing wrong? Here is my code:
fileNameD = 'D:\Data\AVIRIS\f160620t01p00r06rdn_b\f160620t01p00r06rdn_b\f160620t01p00r06rdn_b_sc01_ort_img';
fileNameH = [fileNameD,'.hdr'];
GainFile = 'D:\Data\AVIRIS\f160620t01p00r06rdn_b\f160620t01p00r06rdn_b\f160620t01p00r06rdn_b.gain';
gainvals = importdata(GainFile);
info = envihdrread(fileNameH); %info.data_type=2 so 16-bit signed integer
X = multibandread(fileNameD,[info.lines,info.samples,info.bands],'int16',info.header_offset,info.interleave,info.byte_order,...
{'Row','Range',[4000 1 6000]}, {'Column','Range',[1 1 info.samples]});
X1 = bsxfun(@rdivide,double(X), reshape(gainvals(:,1),[1 1 length(gainvals(:,1))])); %divide by the gain to get radiance
and here is the resulting image I obtain when I plot RGB (i.e. figure, imagesc((X1(:,:,[31,20,10]))))
versus the RGB image preview @ https://aviris.jpl.nasa.gov/aviris_locator/y16_RGB/f160620t01p00r06_sc01_RGB.jpeg (note this shows the full image, while the above is only a subset)
It bears some semblance to the image but this does not seem right. I've also plotted the spectra for some pixels and it also looks strange, e.g.
I've tried this on 4 different radiance datasets so far, as well as reflectance datasets and obtained similar results. Any suggestions will be much appreciated, thank you!

Respuesta aceptada

Subhadeep Koley
Subhadeep Koley el 29 de Dic. de 2020
You can use the hypercube(__) function to read AVIRIS image .hdr files.
% Read the AVIRIS image (specify your image file name here)
hCube = hypercube('jasperRidge2_R198.hdr');
% Compute RGB, CIR, and falsecolored image
rgbImg = colorize(hCube, 'method', 'rgb', 'ContrastStretching', true);
cirImg = colorize(hCube, 'method', 'cir', 'ContrastStretching', true);
fcImg = colorize(hCube, 'method', 'falsecolored', 'ContrastStretching', true);
% Visualize results
figure
tiledlayout(1, 3)
nexttile
imagesc(rgbImg)
axis image off
title('RGB image')
nexttile
imagesc(cirImg)
axis image off
title('CIR image')
nexttile
imagesc(fcImg)
axis image off
title('False-colored image')
Note: All the above mentioned fetures come under Image Processing Toolbox's Hyperspectral Imaging Library support package, and can be downloaded from here.
  5 comentarios
Lahcen EDDAHBI
Lahcen EDDAHBI el 23 de Mzo. de 2022
thank you so much for the information.
i appriciate
Jennifer Lumbres
Jennifer Lumbres el 4 de Jun. de 2022
Editada: Jennifer Lumbres el 4 de Jun. de 2022
@Subhadeep Koley I followed your instructions and downloaded the same data. However, I'm getting an error with opening the data using hypercube:
Input:
hcube = hypercube('f160620t01p00r06rdn_b_sc01_ort_img.hdr');
Error output:
Error using hypercube>validateImageFile (line 1310)
Image file size must be 6062044800 bytes, but it is 6142384518 bytes.
Error in hypercube (line 281)
validateImageFile(imgfile, obj.Metadata);
Error in data_open_hypercube (line 1)
hcube = hypercube('f160620t01p00r06rdn_b_sc01_ort_img.hdr');
Any input will help me greatly. Thanks.
Edit: I downloaded the data through here: https://popo.jpl.nasa.gov/avcl/y16_data/f160620t01p00r06.tar.gz

Iniciar sesión para comentar.

Más respuestas (1)

Shiqi Feng
Shiqi Feng el 1 de Mzo. de 2022
hello, I want to ask how to get .hdi file from AVIRIS datasets?

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by