필터 지우기
필터 지우기

How can I find 2D matrix of each channel in hypercube of dimensions M*N*D

조회 수: 2 (최근 30일)
Himanshu Joshi
Himanshu Joshi 2022년 8월 18일
댓글: Himanshu Joshi 2022년 8월 21일
In the code we have (472*475*20) 3D array and if I view only one channel then the image is not correct. The image in hyperspectral viewer and the result is attached in the screenshot below
2D one layer Image in hyperspectral viewer:
One channel image using code

답변 (2개)

Image Analyst
Image Analyst 2022년 8월 18일
I can't run an image. I can only run code if it's in text form.
It looks like you have a lot of salt and pepper noise. You can remove it with a modified median filter like I've attached. Once removed, imagesc should scale it better. Alternatively you can use imadjust or imadjustn.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

Himanshu Joshi
Himanshu Joshi 2022년 8월 18일
Data for the code is :
Code is written as
clc
clear
info = enviinfo('20220814_130323.hdr');
% edit ('20220814_130323.hdr')
hcube = hypercube('20220814_130323.dat');
% edit ('Cropped_Cancer.hdr')
% hcube
% rgbImg = colorize(hcube,'Method','RGB');
% %image of the data
% figure
% title('RGB Image of Data Cube')
% X = multibandread('20220814_130323.dat',[472,475,301],'single',0,'bsq','ieee-be');
% X = multibandread(...,subset1,subset2,subset3)
sig = fippi(hcube,5);
newhcube = selectBands(hcube,sig,'NumberOfBands',10);
enviwrite(newhcube,'newData');
newhcube
rgbImg = colorize(newhcube,'Method','RGB');
X = multibandread('20220814_130323.dat',[472,475,20],'single',0,'bsq','ieee-be');
%
for i=1:1:20
J=X(:,:,(i));
figure
colormap('gray')
imagesc(J)
end

카테고리

Help CenterFile Exchange에서 Hyperspectral Image Processing에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by