Error , find entropy of 3d volumetric image on GLCM features ?

조회 수: 1 (최근 30일)
Hla Hla
Hla Hla 2022년 8월 25일
댓글: Walter Roberson 2022년 8월 28일
I will find GLCM feature. But error follow as:
b=niftiread("D:\DATASET\Task01_BrainTumour\imagesTr\BRATS_001.nii");
b1=b(:,:,:,1);
cmap = copper(256);
recolored_image = rgb2gray(b1, cmap);
error as following;
Error using rgb2gray
Too many input arguments.

답변 (2개)

Walter Roberson
Walter Roberson 2022년 8월 25일
rgb2gray() has never supported more than one input, and has never supported recoloring images.
rgb2ind supports passing in a colormap. You could recolor an image by using
ind = rgb2ind(b1, cmap);
recolored_image = ind2rgb(ind, cmap);

Abderrahim. B
Abderrahim. B 2022년 8월 25일
Hi!
b1 is not truecolor image that is a m-by-n-by-3 numeric array. b1 in your case is a m by n by l by 1 (4 D array). use reshape to deal with this.
Hope this helps
  댓글 수: 4
Hla Hla
Hla Hla 2022년 8월 25일
편집: Walter Roberson 2022년 8월 28일
Dear sayar, i run above the code.
ind = rgb2ind(b1, cmap);
recolored_image = ind2rgb(ind, cmap);
Error occupy followas:
Error using rgb2ind>parse_inputs (line 145)
RGB image has to be M-by-N-by-3 array.
Error in rgb2ind (line 53)
[RGB,m,dith] = parse_inputs(varargin{:});
Walter Roberson
Walter Roberson 2022년 8월 28일
What is size(b) after you read it?

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by