is it im2double() have the same result with double()?
4 次查看(过去 30 天)
显示 更早的评论
i read a image name it 'lena'
is it im2double(lena) == double(lena)?
回答(2 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!