Borrar filtros
Borrar filtros

Why image appear black and white image?

1 visualización (últimos 30 días)
hla hla myint
hla hla myint el 8 de Oct. de 2020
Comentada: Rik el 9 de Oct. de 2020
i convert 3 d image to 2 d image. Then I have used the imwrite function. But image was appeared the black and white image. Why?
  5 comentarios
Image Analyst
Image Analyst el 9 de Oct. de 2020
What is the class of (the poorly-named) c? Is it double or uint8 or uint16?
You forgot to attach your file so we can't run your code.
You need to put v.jpg in single quotes otherwise it will think that v is a structure and the jpg field of that structure is a character array, which is not what I think it is.
imwrite(c, 'v.jpg');
Do not use JPG for image analysis - it introduces bad compression artifacts. Use PNG format instead.
imwrite(c, 'v.png');
What does this show in the command window
whos a
whos b
whos c
Rik
Rik el 9 de Oct. de 2020
"Do not use JPG for image analysis - it introduces bad compression artifacts. Use PNG format instead."
I whole-heartedly agree, but in medical imaging it appears to be common to convert perfectly good 12 bit precision DICOM files to JPEG. I don't understand why, but that seems to be the standard. Judging by the use of niftiread I assume this is a medical purpose as well, meaning this might just be conforming with the input requirements of the next step in the pipeline.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by