Effacer les filtres
Effacer les filtres

convert to grayscale image

1 vue (au cours des 30 derniers jours)
Saurabh Sakpal
Saurabh Sakpal le 5 Avr 2016
Commenté : Star Strider le 5 Avr 2016
Hi,
I need a grayscale image to input into a function I want to create mesh on, problem is the image i have at the moment is a niftii (used in mri machines), how do i convert it into a grayscale? It (niftii) image is a matrix essentially with values [0 1] range, i believe you need [0 255] for grayscale. Any help to convert this to grayscale?
Thank You
  2 commentaires
Muhammad Usman Saleem
Muhammad Usman Saleem le 5 Avr 2016
According to my understanding.
You have binary image and you want to convert it to gray scale.
It may deal us to resampling of 2 bit image to 8 bit image?
Kuifeng
Kuifeng le 5 Avr 2016
do yo have an example matrix to show here?

Connectez-vous pour commenter.

Réponses (2)

Star Strider
Star Strider le 5 Avr 2016
If the range is [0,1] it is most likely continuous, not binary. See if:
grayImage = uint8(niftii_image*255);
does what you want.
  1 commentaire
Star Strider
Star Strider le 5 Avr 2016
‘... values are between 0 to 1 in that matrix, so it can be 0.5 0.6 etc. Anything in between.
My code should do what you want.

Connectez-vous pour commenter.


Saurabh Sakpal
Saurabh Sakpal le 5 Avr 2016
Hi original poster again, Sorry values are between 0 to 1 in that matrix, so it can be 0.5 0.6 etc. Anything in between

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