how to save the output image

3 visualizaciones (últimos 30 días)
Frisda Sianipar
Frisda Sianipar el 23 de Feb. de 2021
Comentada: Frisda Sianipar el 25 de Feb. de 2021
citra=imread('ISIC_0024336.jpg');
figure, fig1=imshow(citra);
load mri
V = squeeze(citra);
citra3=montage(reshape(V,size(citra)),map,'Indices',3);
saveas(citra3,'ISIC_0024336coba.jpg');
Would you help me please, How to save the output image in Matlab automatically?
  2 comentarios
Walter Roberson
Walter Roberson el 23 de Feb. de 2021
citra3=montage(reshape(V,size(citra)),map,'Indices',3);
since V is squeezed citra, reshape of it back to size of citra would just give you back citra... so why bother with the shape change and why not just pass citra into montage?
Frisda Sianipar
Frisda Sianipar el 23 de Feb. de 2021
actually I use this code to remove the background from the image only. And after that I want to save the output automatically, but I don't know what to use.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 23 de Feb. de 2021
infile = 'ISIC_0024336.jpg';
citra=imread(infile);
figure, fig1=imshow(citra);
load mri
V = squeeze(citra);
citra3=montage(reshape(V,size(citra)),map,'Indices',3);
[folder, basename, ext] = fileparts(infile);
outfile = fullfile(folder, [basename 'coba' ext]);
saveas(citra3, outfile);
  13 comentarios
Walter Roberson
Walter Roberson el 24 de Feb. de 2021
implemencoba.fig is not one of the output files. You need to look inside the Implemen directory of where you are now.
dir('F:\kuliah\semester6\TA2\Implemen')
Frisda Sianipar
Frisda Sianipar el 25 de Feb. de 2021
yes, it same. nothing is saved

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Medical Physics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by