imwrite can't open file

2 vues (au cours des 30 derniers jours)
bruno
bruno le 18 Juil 2013

I have this code as testImage.m :

vectImage=char('AAAESO');
[mv,nv]=size(vectImage);
for k=1:mv
    X=imread(['../convert/' strtrim(vectImage(k,:)) '.png']);
    imwrite(X,['../segmentation/imagesPreditesDesequilibre3class/toto.tif'],'tif');
end

when i run it on my ubuntu 12.04, 64 bits using this :

nohup matlab -nosplash -nodisplay < testImage.m > output.txt &

i got this error written in output.txt :

Error using imwrite (line463) Can't open file "../segmentation/imagesPreditesDesequilibre3class/toto.tif" for writing. You may not have write permission.

I have write permission...

So I write only matlab, the prompt appears and i run testImage :

>> testImage
Error using imwrite (line 463)
Can't open file "../segmentation/imagesPreditesDesequilibre3class/toto.tif" for writing.
You may not have write permission.
Error in testImage (line 10)
      imwrite(X,['../segmentation/imagesPreditesDesequilibre3class/toto.tif'],'tif');

I copy paste my line 10

>>imwrite(X,['../segmentation/imagesPreditesDesequilibre3class/toto.tif'],'tif');
>>

and it works...

When i run the same code on my windows 7 it works properly. I don't know where this error comes from since i use a similar code to write images that is perfectly working on my ubuntu. I really need to run this code on my linux by using the first command. Do you have a solution ?

Réponses (0)

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by