converting tiff to image

10 ビュー (過去 30 日間)
K.G
K.G 2017 年 12 月 22 日
コメント済み: Walter Roberson 2017 年 12 月 23 日
Hi all, I am trying to code a tiff format file into a matrix of 2 dimention using imread. then I want to convert back the matrix to my original tiff file using imwrite. but when I do this the new tiff image is not the same as the original one. it is just a black background. is there anyway I can solve this problem?

採用された回答

Image Analyst
Image Analyst 2017 年 12 月 22 日
Simply calling
tifImage = imread(inputFilename);
followed by
imwrite(tifImage, outputFilename);
Should not do that. The pixel values should be exactly the same (since no compression is being done). Chances are, you did something to the image, like converted it to a double or something. If you want any more help, attach your code (everything from imread to imwrite and all the lines of code in between) and your original input image that you say is not saving correctly.
  7 件のコメント
K.G
K.G 2017 年 12 月 23 日
so you mean if I can make a tiff image with double data type from the beginning it will work properly?
Walter Roberson
Walter Roberson 2017 年 12 月 23 日
"so you mean if I can make a tiff image with double data type from the beginning it will work properly?"
No.
"Hi all, I am trying to code a tiff format file into a matrix of 2 dimention using imread."
Your image is color, which requires 3 or more dimensions. You cannot retain color in 2 dimensions.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by