is it im2double() have the same result with double()?

1 回表示 (過去 30 日間)
budi agung
budi agung 2017 年 4 月 4 日
回答済み: Jan 2017 年 4 月 4 日
i read a image name it 'lena'
is it im2double(lena) == double(lena)?

回答 (2 件)

Jan
Jan 2017 年 4 月 4 日
While double() converts the type of the data only, im2double() cares for the values also:
img = uint8([255, 127])
double(img) % >> [255, 127] as double
im2double(img) % >> [1, 0.498] as double
The values are scaled to the range [0.0, 1.0] as wanted.

Spencer Chen
Spencer Chen 2017 年 4 月 4 日
Try it and tell us.
  3 件のコメント
Stephen23
Stephen23 2017 年 4 月 4 日
budi agung
budi agung 2017 年 4 月 4 日
ok thx

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by