WHY IN GRAY IMAGE HAVE RGB??

4 vues (au cours des 30 derniers jours)
mohd akmal masud
mohd akmal masud le 16 Avr 2022
Commenté : Image Analyst le 17 Avr 2022
Dear Sir,
I have image below as gray image. The index value (439) indicate as gray level. But what I dont understand is, why the RGB value on it image?
Because as I know this is gray image.
The set of my images as attached.
Anyone can help me to explained to me?

Réponse acceptée

Image Analyst
Image Analyst le 16 Avr 2022
It's an RGB image. It's just that the red channel, the green channel, and the blue channel are all the same so it appears as gray scale. You can convert it to grayscale by taking any one of the color channels:
grayImage = rgbImage(:, :, 1);
  2 commentaires
mohd akmal masud
mohd akmal masud le 17 Avr 2022
But I got error
Unrecognized function or variable 'rgbImage'.
Image Analyst
Image Analyst le 17 Avr 2022
When I actually opened the dicom file I found out it's 256x256x1x142 so it's a 3-D image. You can do this:
fileName = 'I-13125610N1.dcm'
rgbImage = dicomread(fileName);
imageSize = size(rgbImage)
for slice = 1 : imageSize(4)
grayImage = rgbImage(:, :, 1, slice);
imshow(grayImage, []);
caption = sprintf('#%d of %d', slice, imageSize(4));
title(caption, 'FontSize', 14);
drawnow;
end
to display them all.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by