필터 지우기
필터 지우기

How to extract multispectral data using hypercube in matlab?

조회 수: 7 (최근 30일)
Devendra
Devendra 2024년 3월 27일
답변: Manasa Singam 2024년 3월 27일
Now I am using hypercube function as follows
img = hypercube(img_file.name);
red = img(:,:,2); % red band
rededge1 = img(:,:,3); % rededge1 band
rededge2 = img(:,:,4); % rededge2 band
rededge3 = img(:,:,5); % rededge3 band
nir = img(:,:,6); % near infrared band
it still gives following errors.
>> ds_indices_caf
img_path = 'C:\Data\'
20240129_MAWANA_SUBSET.img
hypercube with properties:
DataCube: "[3915x3677x7 uint16]"
Wavelength: [7×1 double]
Metadata: [1×1 struct]
Index in position 3 exceeds array bounds. Index must not exceed 1.
Error in ds_indices_caf (line 25)
red = img(:,:,2); % red band
I would really appreciate the kind cooperation in helping me out to fix this error.
Dave

채택된 답변

Manasa Singam
Manasa Singam 2024년 3월 27일
Here the variable "img" is hypercube object. The data is present in DataCube property.
Access the data using this command: red = img.DataCube(:,:,2);

추가 답변 (0개)

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by