showing the grayscale matrix

5 Ansichten (letzte 30 Tage)
evangeline
evangeline am 23 Jan. 2014
Kommentiert: Image Analyst am 23 Jan. 2014
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

Akzeptierte Antwort

Image Analyst
Image Analyst am 23 Jan. 2014
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 Kommentare
evangeline
evangeline am 23 Jan. 2014
Bearbeitet: evangeline am 23 Jan. 2014
thanks, it worked. can I use this for a 3D matrix too? because I have the same problem with that
Image Analyst
Image Analyst am 23 Jan. 2014
You can use it to display a 2D slice from a 3D image.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by