sprintf in a loop with a file name
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Adam Danz
2020-10-1
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)
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Blue 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!