Problems writing a tiff file
显示 更早的评论
When I write an array as tiff, change the values.
if true
% code
end
I=round(rand(10,10,3)*10);
file='c:\temp';
for i=1:3
imwrite(I(:,:,i),'file','WriteMode','append');
end if true
if true
% code
end
thank you very much
1 个评论
Jan
2013-3-7
Please explain with more details, which values are changed.
回答(2 个)
imwrite(I(:,:,i), 'file', 'WriteMode', 'append');
This writes to the file called 'file' in the current directory. I guess you want:
file='c:\temp\Picture.tiff';
imwrite(I(:,:,i), file, 'WriteMode', 'append');
without quotes around the variable file.
Image Analyst
2013-3-7
0 个投票
Try the Tiff class. http://www.mathworks.com/help/matlab/ref/tiffclass.html I believe it has more and better functionality regarding tiff files. I've not used the WriteMode append option in imwrite(). But maybe Tiff is worth a try. I don't know what an "extamente" matrix is, but do you see the file size in bytes increase after each write? If so, that indicates that some data is being appended.
5 个评论
Sebastian G
2013-3-7
Image Analyst
2013-3-7
Jan has already asked you to provide details. Why are you not letting us help you by providing details? Are you saying that any values in the set 10, 20, 30, ... 240, 250 get changed to 12.3, pi, e, 42, a bazillion, ... cos(-999), a google, rand(1), and 42^(pi*e)?
Sebastian G
2013-3-7
Image Analyst
2013-3-7
Can you also show the code you are using to read it back in and verify what was written out?
Sebastian G
2013-3-8
类别
在 帮助中心 和 File Exchange 中查找有关 Image Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!