필터 지우기
필터 지우기

convert to grayscale image

조회 수: 1 (최근 30일)
Saurabh Sakpal
Saurabh Sakpal 2016년 4월 5일
댓글: Star Strider 2016년 4월 5일
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
Muhammad Usman Saleem
Muhammad Usman Saleem 2016년 4월 5일
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 2016년 4월 5일
do yo have an example matrix to show here?

댓글을 달려면 로그인하십시오.

답변 (2개)

Star Strider
Star Strider 2016년 4월 5일
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
Star Strider
Star Strider 2016년 4월 5일
‘... 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.

댓글을 달려면 로그인하십시오.


Saurabh Sakpal
Saurabh Sakpal 2016년 4월 5일
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

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by