Problem with imwrite when creating multiple Image Files
Show older comments
Hello
I am encountering a strange problem during a process of saving multiple image files in my hard disk.
More specifically the problem occurs while I am processing some photos and the saving them sequentially. As I have seen the problem occurs always when the sequence arrives in the 13th Image (strange!).
It seems strange to me as this work for the previous images and only on this step, that follows exact the same procedure (is done automatically) I have the error. Do you have any idea what could it be ?
The error I am taking is :
You may not have write permission.
Error in ==> Automatization at 479
imwrite(Seg_Out_1{2,Num_Seg},[ImageExpDir,sprintf(Exp_Name_2,Num_Seg,a,b,c,d,e,f,g,h,i,j,k)],'tif');
Thank you in advance
Accepted Answer
More Answers (2)
Image Analyst
on 12 May 2012
That does not look like a proper sprintf() statement. Where is your format string? And why not use fullfile() instead of [,]? Try creating the filename in advance and printing it out to the command line so you can see what it is. Something like
baseFileName = sprintf('%s%d%d%d%d%d%d%d%d%d%d%d%d.tif', ...
Exp_Name_2,Num_Seg,a,b,c,d,e,f,g,h,i,j,k)
fullFileName = fullfile(ImageExpDir, baseFileName)
imwrite(Seg_Out_1{2,Num_Seg}, fullFileName);
2 Comments
Dimitris M
on 12 May 2012
Image Analyst
on 12 May 2012
What was the filename when it bombed? I can't really debug much until you decide to share more code. I think there's something you're not telling us. Perhaps one of the a-k variables is not an integer or there's some other mismatch in the variables and the format specifier string. Or perhaps there's some character in filename that is not a valid character for files, such as : / \ ? * etc. or some non printable character such as hex 0 - 31 or something like that.
Dimitris M
on 12 May 2012
0 votes
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!