Error , find entropy of 3d volumetric image on GLCM features ?
Show older comments
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.
Answers (2)
Walter Roberson
on 25 Aug 2022
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
on 25 Aug 2022
0 votes
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 Comments
Walter Roberson
on 25 Aug 2022
This is a potential problem -- but it would not affect the fact that rgb2gray does not accept two parameters.
Abderrahim. B
on 25 Aug 2022
How can I forget that rgb2gray accept only one input argument! Thanks @Walter Roberson
Hla Hla
on 25 Aug 2022
Edited: Walter Roberson
on 28 Aug 2022
Walter Roberson
on 28 Aug 2022
What is size(b) after you read it?
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!