converting tiff to image
10 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
採用された回答
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 件のコメント
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 Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!