unit8 image processing

6 ビュー (過去 30 日間)
Jeremy Keppers
Jeremy Keppers 2020 年 5 月 6 日
コメント済み: Jeremy Keppers 2020 年 5 月 6 日
Hello people
I have 4 uint8 data types which are 5, 100, 169 and 201
I want to know what color each I would get with
imshow(img>50 & img<170)
and why
Also I want to make sure if a double data type is 0.3 , it means 77 or 76 as uint8
thank you

採用された回答

Walter Roberson
Walter Roberson 2020 年 5 月 6 日
logical() true is white, false is black for imshow
The conversion to uint8 is uint8(0.3*255) and that rounds upon conversion. 76.5 would round to 77. But remember that the calculation is double precision and 0.3 is not exactly 3/10 so for some values it is potentially possible that an expected mathematical outcome ending in 0.5 might be 1 bit short of 0.5 exactly, so there could potentially be a few values that uint8 differently than you would naively expect
  1 件のコメント
Jeremy Keppers
Jeremy Keppers 2020 年 5 月 6 日
Thank you Walter I appreciate it

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by