WHY IN GRAY IMAGE HAVE RGB??

4 visualizaciones (últimos 30 días)
mohd akmal masud
mohd akmal masud el 16 de Abr. de 2022
Comentada: Image Analyst el 17 de Abr. de 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?

Respuesta aceptada

Image Analyst
Image Analyst el 16 de Abr. de 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 comentarios
mohd akmal masud
mohd akmal masud el 17 de Abr. de 2022
But I got error
Unrecognized function or variable 'rgbImage'.
Image Analyst
Image Analyst el 17 de Abr. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by