Regarding Hyperspectral Image Processing
9 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Subhadeep Koley
2020-11-2
% 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 个评论
Image Analyst
2020-10-15
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 个评论
Image Analyst
2020-10-16
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)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Hyperspectral Image Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!