Effacer les filtres
Effacer les filtres

Why image appear black and white image?

1 vue (au cours des 30 derniers jours)
hla hla myint
hla hla myint le 8 Oct 2020
Commenté : Rik le 9 Oct 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 commentaires
Image Analyst
Image Analyst le 9 Oct 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 le 9 Oct 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Convert Image Type 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