imshow() black for max value and white for min value?

조회 수: 3 (최근 30일)
Milk
Milk 2020년 7월 23일
댓글: Milk 2020년 7월 23일
If you specify an empty matrix ([]), then imshow uses a display range of [min(I(:)) max(I(:))]. In other words, the minimum value in I is black, and the maximum value is white.
If I is data type single or double, then the default display range is [0, 1].
In my project, my I is a double (20 x 10), and I would like to show the minimum value in I is white, and the maximum value is black instead. Is there a way to do it?
Thank you.

채택된 답변

Stephen23
Stephen23 2020년 7월 23일
Assuming that the image array A contains values in the range 0-1:
imshow(1-A)
  댓글 수: 3
Stephen23
Stephen23 2020년 7월 23일
"To inverse the value?"
Yes.
Milk
Milk 2020년 7월 23일
Thank you :)

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by