How to imwrite an image with a different name than original, in specified directory?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mathijs Dijsselhof
el 8 de Mayo de 2018
Comentada: Mathijs Dijsselhof
el 8 de Mayo de 2018
I want to imread a previously selected image and then imwrite the same image with a variable name (depending on input user) to a specific file directory. Is this possible while using imwrite? I can't get it to work.
Patientnumber = num2str(1234567); %Input of user
[baseName, folder] = uigetfile('*.jpg', 'Select Thermal image'); % Select thermal image for analysis
thermalphoto_flap = fullfile(folder, baseName);
thermalphoto_flapI = imread(thermalphoto_flap); % Read thermal image
% create file directory for saving of files
mkdir('C:\Users\Mathijs\Desktop\Technical Medicine\M2 Stage 2\Eigen Matlab\TestOmgeving\PatiëntenMap',Patientnumber);
SD1 = 'C:\Users\Mathijs\Desktop\Technical Medicine\M2 Stage 2\Eigen Matlab\TestOmgeving\PatiëntenMap';
SD2 = Patientnumber; % Variable name, dependent on user input
SaveDirectory = strcat(SD1,SD2);
% save thermal image to file directory
Therm1 = Patientnumber;
Therm2 = 'Thermal.JPEG';
ThermalPhotoName = strcat(Therm1,Therm2);
imwrite(thermalphoto_flapI,SaveDirectory,ThermalPhotoName); %imwrite image to specified folder with input name
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!