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

4 次查看(过去 30 天)
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 个评论
Rik
Rik 2021-4-1
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 2021-5-26
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

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2021-4-1
There are (fairly) new Hyperspectral functions available; see https://www.mathworks.com/help/images/hyperspectral-image-processing.html
  6 个评论
Nagaraj rajendiran
编辑:Walter Roberson 2021-4-2
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 2021-4-2
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...)

请先登录,再进行评论。

更多回答(1 个)

Subhadeep Koley
Subhadeep Koley 2021-4-8
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.

类别

Help CenterFile Exchange 中查找有关 Hyperspectral Image Processing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by