Regarding Hyperspectral Image Processing
23 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi Everyone,
I am Akshay, I am working with (SPECIM IQ), it is a hyperspectral camera. After clicking the image, the output of the camera comes with ENVI format. It generates a 3D cube of data( with 2 axis would be pixel information and 3rd axis will contain the wavelength information. Now i want a code in such a way that when i keep a cursor on any particular pixel it should plot a graph with x axis being wavelength and y axis being intensity for that particular pixel location.
Thanks
0 comentarios
Respuestas (2)
Subhadeep Koley
el 2 de Nov. de 2020
% Read the ENVI format data
hCube = hypercube('yourENVIImage.hdr');
% Extract the 3D cube of data from the 'hCube' object
dataCube = hCube.DataCube;
For visualization of individual pixel spectra / hyperspectral image in different color schemes (False-coloured, RGB, CIR), you can use the interactive hyperspetralViewer App. E.g.,
hyperspectralViewer(hCube)
All the above mentioned fetures come under Image Processing Toolbox's Hyperspectral Imaging Library support package, and can be downloaded from here. For more information on Hyperspectral Imaging Library see the documentation.
0 comentarios
Image Analyst
el 15 de Oct. de 2020
You could do this:
[rows, columns, numWavelengths] = size(image3dcube)
spectrum = zeros(1, numWavelengths);
for w = 1 : numWavelengths
spectrum(w) = image3dcube(row, column, w); % You need to specify which row and column.
end
plot(spectrum, 'b.-', 'LineWidth', 2, 'MarkerSize', 18);
grid on;
xlabel('Wavelength [image slice]', 'FontSize', 17);
ylabel('Spectral Reflectance [gray levels]', 'FontSize', 17);
caption = sprintf('Spectral Reflectance at x (column) = %d, y (row) = %d vs. Wavelength', column, row);
title(caption, 'FontSize', 17);
Or you could do this (somewhat more cryptic way) instead of the zeros() and for loop, if you want a "vectorized" solution (though I don't think there won't be any time difference between the two methods):
spectrum = squeeze(image3dcube(row, column, :));
2 comentarios
Image Analyst
el 16 de Oct. de 2020
You mean like this?
% Have user browse for a file, from a specified "starting folder."
% For convenience in browsing, set a starting folder from which to browse.
startingFolder = pwd; % or 'C:\wherever';
if ~isfolder(startingFolder)
% If that folder doesn't exist, just start in the current folder.
startingFolder = pwd;
end
% Get the name of the file that the user wants to use.
defaultFileName = fullfile(startingFolder, '*.*');
[baseFileName, folder] = uigetfile(defaultFileName, 'Select a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!