Consider an image where the range of possible values for each pixel is not [0, 255], but a nonstandard range such as [0, 99]. How would we display the image so that a value of 99 represents white and a value of 0 represents black?

1 view (last 30 days)
Consider an image where the range of possible values for each pixel is not [0, 255], but a nonstandard range such as [0, 99]. How would we display the image so that a value of 99 represents white and a value of 0 represents black?

Answers (1)

Guillaume
Guillaume on 21 Sep 2014
imshow(img, [])
will do exactly what you want.
  1 Comment
John
John on 22 Sep 2014
Also if you wanted to work with your data with a native MATLAB data type whose standard ranges are understood by the various image processing functions in the image processing toolbox, you can convert them to double by normalizing the data. If 99 is the cap of the data range, then divide all elements in the image matrix by 99 and to yield an image represented by double.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!