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