필터 지우기
필터 지우기

sprintf in a loop with a file name

조회 수: 2 (최근 30일)
Richard Catania
Richard Catania 2020년 10월 1일
댓글: Adam Danz 2020년 10월 1일
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
madhan ravi
madhan ravi 2020년 10월 1일
And the above doesn’t do it?
Adam Danz
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 CenterFile Exchange에서 Blue에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by