problems to open images after I have saved it in a folder
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Maria
am 22 Jan. 2015
Kommentiert: Maria
am 23 Jan. 2015
Hello, I have a problem with my work. My program can read some images from a specific folder, process and study them (differents features of them). When I have processed these images, I would save them in a different folder than the original. I did it, but when I want to open these (with Paint or another), it's impossible. I have been searching, but I can't find a good solution and neither my fault. This is my code:
function mostrar2
%load my processed images (for the moment are matrix)
load archivoimagenesfinales
[stat,struc] = fileattrib;
PathCurrent = struc.Name;
FolderName = ['imagenes'];
PathFolder = [PathCurrent '/RESULTADOS DE ESTUDIOS DE IMAGENES/' FolderName];
mkdir([PathCurrent '/RESULTADOS DE ESTUDIOS DE IMAGENES/'], FolderName);
for k=1:length(grupoimage)
matriz=grupoimage(k).im;
imagennumero=sprintf('imagentratada%d.bmp',k);
%save as image in the usual folder
imwrite(matriz,imagennumero);
save([PathFolder imagennumero])
end
end
Thanks in advance
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 22 Jan. 2015
Why is the save() function call in there??? Can you attach one of the files that it made?
3 Kommentare
Image Analyst
am 23 Jan. 2015
Try this:
% Get the name of the file that the user wants to save.
% Note, if you're saving an image you can use imsave() instead of uiputfile().
startingFolder = userpath
defaultFileName = fullfile(startingFolder, '*.*');
[baseFileName, folder] = uiputfile(defaultFileName, 'Specify a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName)
imwrite(matriz, fullFileName);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!