Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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

Akzeptierte Antwort

Geoff Hayes
Geoff Hayes am 18 Jun. 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).

Weitere Antworten (0)

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by