showing the grayscale matrix

조회 수: 4 (최근 30일)
evangeline
evangeline 2014년 1월 23일
댓글: Image Analyst 2014년 1월 23일
I have a 2D matrix , and I was trying to display it as an image, but the problem is that in the output axes, for all the numbers except 0, I see white in result, and black for zero, I want to see all gray colors (in grayscale) from black to white, what can I do? this is the resault I see

채택된 답변

Image Analyst
Image Analyst 2014년 1월 23일
It's probably a type double, which needs to be in the range 0-1, not 0-255 that you probably have. You can autoscale with []. Try
imshow(your2Dmatrix, []);
  댓글 수: 2
evangeline
evangeline 2014년 1월 23일
편집: evangeline 2014년 1월 23일
thanks, it worked. can I use this for a 3D matrix too? because I have the same problem with that
Image Analyst
Image Analyst 2014년 1월 23일
You can use it to display a 2D slice from a 3D image.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by