reason for converting image into double
19 ビュー (過去 30 日間)
古いコメントを表示
while reading the, why have to convert an image into double format.
1 件のコメント
nabeel raza
2017 年 10 月 10 日
For Example:
I2 = im2double(I);
I2 = im2double(I,'indexed');
I2 = im2double(I) converts the intensity image I to double precision, rescaling the data if necessary. I can be a grayscale intensity image, a truecolor image, or a binary image. If the input image is of class double, then the output image is identical.
回答 (2 件)
Matz Johansson Bergström
2015 年 8 月 28 日
編集済み: Matz Johansson Bergström
2015 年 8 月 28 日
The reason is precision. Say you read an image using (write this in the Matlab prompt)
>>Im = imread('filename');
>>class(Im)
uint8
The format is integers from 0 to 255. Now if we want to manipulate the image, we can write
>>class(Im*0.5)
uint8
Notice that the format is still integer and not double. This means that we have lost precision. All subsequent manipulatins to the matrix Im will be in integer precision, unless we write something like
Im = im2double(Im)
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!