problems to open images after I have saved it in a folder
5 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Image Analyst
on 22 Jan 2015
Why is the save() function call in there??? Can you attach one of the files that it made?
3 Comments
Image Analyst
on 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);
More Answers (0)
See Also
Categories
Find more on Convert Image Type 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!