Effacer les filtres
Effacer les filtres

Whether the RGB image which has been transformed into the Grayscale still have a 3D matrix?

1 vue (au cours des 30 derniers jours)
excuse me, i want to ask, i have saved grayscale images before, but why that still have 3D matrix and not 2D matrix although the image has been my saved as grayscale? because I intend to creating the image matrix X using grayscale image still need to use permute and tell permute that i want to transpose the 1st and 2nd dimension

Réponse acceptée

Geoff Hayes
Geoff Hayes le 18 Juin 2016
Alvindra - how are you creating the grayscale image? Which function are you using to do this conversion from RGB?
If you are expecting or need a 2D image, then just convert the 3D into one. For example, if gsImage is your grayscale image then
if ndims(gsImage) == 3
% covert the 3D into a 2D image
gsImage = gsImage(:,:,1);
end
The above assumes that gsImage(:,:,1) is identical to gsImage(:,:,2) and to gsImage(:,:,3).
  1 commentaire
Alvindra Pratama
Alvindra Pratama le 18 Juin 2016
i creating grayscale using rgb2gray, and then i saved it into .tif format. Thank you so much sir

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by