Score the Hyperspectral image pixel value 0 to 100
1 view (last 30 days)
Show older comments
jaeyoung gwak
on 23 Mar 2023
Edited: Abhishek Tripathi
on 23 Mar 2023
I'm wondering if i could score the hyperspectral image.
I found out that hyperspectral image is based on visual light colors.
What i want to make is making visual light colors to color map. And i click certain pixel in the image it shows the score based on visual light colormap.
Here's the drawing what i thought.
I know how to score the pixel value by comparing it with colormap.
But I have no idea how could make an colormap with visual light color spectrum basesd on Hyperspectral image.
Hope to get some advice.
Thanks.
0 Comments
Accepted Answer
Image Analyst
on 23 Mar 2023
From the help:
Create Truecolor Composite from Multispectral Image
The LAN file, paris.lan, contains a 7-band 512-by-512 Landsat image. A 128-byte header is followed by the pixel values, which are band interleaved by line (BIL) in order of increasing band number. They are stored as unsigned 8-bit integers, in little-endian byte order.
Read bands 3, 2, and 1 from the LAN file using the MATLAB® function multibandread. These bands cover the visible part of the spectrum. When they are mapped to the red, green, and blue planes, respectively, of an RGB image, the result is a standard truecolor composite. The final input argument to multibandread specifies which bands to read, and in which order, so that you can create an RGB composite in a single step.
truecolor = multibandread('paris.lan',[512, 512, 7],'uint8=>uint8', ...
128,'bil','ieee-le',{'Band','Direct',[3 2 1]});
The truecolor composite has very little contrast and the colors are unbalanced.
imshow(truecolor)
title('Truecolor Composite (Un-Enhanced)')
text(size(truecolor,2),size(truecolor,1)+15,...
'Image courtesy of Space Imaging, LLC',...
'FontSize',7,'HorizontalAlignment','right')
0 Comments
More Answers (1)
Abhishek Tripathi
on 23 Mar 2023
Edited: Abhishek Tripathi
on 23 Mar 2023
With our hyperspectral support package, you can generate false color and RGB image of a hyperspectral image. Use below code
% Read a hyperspectral data into the workspace.
hcube = hypercube('paviaU.dat');
% Estimate an RGB image of the hyperspectral data. Increase the image contrast by applying contrast stretching.
coloredImg = colorize(hcube,"Method","rgb","ContrastStretching",true);
% Display the contrast-stretched RGB image.
imshow(coloredImg)
For better visualization of hyperspectral images, I recommend to use hyperspectral Viewer app. Hyperspectral Viewer app enables you to read hyperspectral data, visualize individual band images and their histograms, create a spectrum plot for a pixel or region in a hyperspectral data cube, generate color or false-color representations of hyperspectral images, and display metadata.
% Load Hyperspectral Data into Workspace
hcube = hypercube('jasperRidge2_R198.img');
% View Hyperspectral Data in Hyperspectral Viewer
hyperspectralViewer(hcube)
If you would like to explore more about the hyperspectral domain, kindly go through this:
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!