MATLAB: The rang of unit 8 is 0-255 But im2double convert the range to [0, 1] instead of [0, 255]. please anyone explain it???

castclassim2doubleintegernormalizerange

the rang of unit 8 is 0-255 But im2double convert the range to [0, 1] instead of [0, 255]. please anyone explain it????

Best Answer

This is the expected (although not clearly explained) behavior of im2double: the function scales any integer image values to the range [0,1], as well as converting to class double.
If you want to simply convert an integer to the equivalent double value, then use double instead.
It is important to note that many MATLAB image processing functions use the normalized range of [0,1], and it would likely make your own life much easier if you stick with using the standard range of values.
Related Question