Effacer les filtres
Effacer les filtres

sprintf in a loop with a file name

2 vues (au cours des 30 derniers jours)
Richard Catania
Richard Catania le 1 Oct 2020
Commenté : Adam Danz le 1 Oct 2020
I lost on how to proceed. I need to save each iteration as its own png file:
Code:
for i=1:76
mask=pixel_labels==(i);
cluster=RGB.*uint8(mask(i));
imagename=sprintf('Cluster%d.png',i);
imwrite(cluster,imagename)
end
  2 commentaires
madhan ravi
madhan ravi le 1 Oct 2020
And the above doesn’t do it?
Adam Danz
Adam Danz le 1 Oct 2020
imwrite does not support writing of indexed PNG files that have insufficient colormap entries. If that's the case for your images, try using imwrite(A,map,filename)

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Blue dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by