Score the Hyperspectral image pixel value 0 to 100

3 views (last 30 days)
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.

Accepted Answer

Image Analyst
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.
title('Truecolor Composite (Un-Enhanced)')
'Image courtesy of Space Imaging, LLC',...

More Answers (1)

Abhishek Tripathi
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.
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
If you would like to explore more about the hyperspectral domain, kindly go through this:

Community Treasure Hunt

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

Start Hunting!