I have multispectral image of [ 8225,8850,6]. How to read image and i need to seperate bands for analysis?

12 vues (au cours des 30 derniers jours)
I have multispectral image of dimension 8225*8850*6. kindly suggest me how to read that image in matlab and view it?( i tried imread and imshow -not works). also i need to seperate the bands for calculating NDWI. kindly suggest me to do this task.
  2 commentaires
Rik
Rik le 1 Avr 2021
Of course imshow will not work. It will only work for RGB images, which your 6-color image is not.
The way to read the image to a Matlab array depends on the file type, which you haven't told us.
Have a read here and here. It will greatly improve your chances of getting an answer.
Onur Kutlu
Onur Kutlu le 26 Mai 2021
hyper_data1 = load('data.adres');
hyper_data1 = (hyper_data1. HypeRvieW -min(min(min(hyper_data1. HypeRvieW))))/(max(max(max(hyper_data1. HypeRvieW)))- min(min(min(hyper_data1. HypeRvieW))));
%HypeRview is name to in hyper_data1 matris
%You can try this

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 1 Avr 2021
There are (fairly) new Hyperspectral functions available; see https://www.mathworks.com/help/images/hyperspectral-image-processing.html
  6 commentaires
Nagaraj rajendiran
Nagaraj rajendiran le 2 Avr 2021
Modifié(e) : Walter Roberson le 2 Avr 2021
Dear sir
I tried this procedure already. Displaying each band i also viewed by imtool() function. my exact question is to display the image which contains all the 6 bands like an RGB image. the displayed image it should by 6 bands at a time.
clc
clear all
A=imread('data3.tif');
b1=im2single(A(:,:,4));
imtool(b1)
i need to view like RGB image. what is the command or program to view single image with all bands.
Walter Roberson
Walter Roberson le 2 Avr 2021
There is no Mathworks-provided function to view multiband images with all bands.
If a remote sensing image is taken in NIR-I, NIR-II, soft-X-ray, hard-X-ray, and gamma ray bands, then what should the result look like ?
Is your assumption that the 6 bands of your image represent 6 different optical-wavelength filters on a single scene, and you want to reconstruct what the scene would look like in RGB, similar to the way that color images used to be constructed by taking black and white using three different filters? If so then you would need to know the filtering characteristics.
Or are some of the sensors not primarily optical wavelength but have some overlap with optical wavelengths and you want to reconstruct what the scene would look like in RGB ?
Or are you wanting to take each of the bands and pseudo-color each one according to a user-chosen palette for each, and then blend the RGB components ?
Or are you wanting to assign one band to R, another to G, another to B, and the other three to bands associated with special hardware you have installed for your display (such as IR and UV and... something...) in order to display the images for the rare tetrachromats and very very rare pentachromats and ... I don't think any hexachromats are believed to exist in the world (and the existance of pentachromats is disputed...)

Connectez-vous pour commenter.

Plus de réponses (1)

Subhadeep Koley
Subhadeep Koley le 8 Avr 2021
For visualization of individual pixel spectra / hyperspectral band image you can use the interactive hyperspetralViewer App. e.g.
% Read the data
cube = imread('data3.tif');
% Launch hyperspectral viewer
hyperspectralViewer(hCube)
You can also use spectralIndices(_) function to calculate MNDWI. However, to calculate indices with this function, you need construct a hypercube object with the TIF file and corresponding center wavelength for each band images. e.g.
% Construct the hypercube object
hCube = hypercube('data3.tif', wavelength); % Here wavelength is a C-element vector. C is the number of bands
% Calculate MNDWI image
C = spectralIndices(hCube, 'mndwi');
mndwiImg = C.IndexImage;
figure
imagesc(mndwiImg)
axis image off
title("MNDWI Image")
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.

Catégories

En savoir plus sur Hyperspectral Image Processing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by