フィルターのクリア

imshow not working when going from unit8 to double

2 ビュー (過去 30 日間)
raheem mian
raheem mian 2020 年 1 月 9 日
コメント済み: raheem mian 2020 年 1 月 9 日
I converted an image from uint8 to double but when I use imshow on the matrix type double, it shows a white box. Why does that happen ?

採用された回答

Stephen23
Stephen23 2020 年 1 月 9 日
Most likely because you did not scale the image when you converted the type.
  • uint8 images are treated as having values from 0 to 255.
  • floating point images are treated as having values from 0 to 1.
So if you convert to double you will need to divide by 255:
Im_double = double(Im_uint8) / 255
or just use im2double, which does this conversion:
Im_double = im2double(Im_uint8)
  1 件のコメント
raheem mian
raheem mian 2020 年 1 月 9 日
Oh I see. Thanks so much.

サインインしてコメントする。

その他の回答 (1 件)

Steven Lord
Steven Lord 2020 年 1 月 9 日
How did you convert the image from uint8 to double? See this page in the Image Processing Toolbox documentation and this one in the MATLAB documentation for more information as to why that matters.

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by