How to randomly select n number of pixels from an image whose value is one and change those pixels value to zero?

 채택된 답변

ind = find(I == 1);
r = randperm(numel(ind));
r = r(1:n);
I(ind) = 0;

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2015년 5월 28일

댓글:

2015년 5월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by