MATLAB: Uint8 to double is converting pixel values into decimal

Image Processing Toolboxuint

when I convert my image which is in uint format to double the pixel matrix values are converting into decimal values
These are uint matrix of image
181 185 165 128 109 143 163 159 160 164 182 177 179 182 185 187 193 193
and these are double values of same image
0.709803921568628 0.725490196078431 0.647058823529412 0.501960784313726 0.427450980392157 0.560784313725490 0.639215686274510 0.623529411764706 0.627450980392157 0.643137254901961
why is this happening so? whats the solution

Best Answer

Basically it's dividing by 255 when you use im2double(). If you don't want that, then don't do it. If you want the floating point version but the values to be the same, use double() instead of im2double().