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

조회 수: 2 (최근 30일)
How to randomly select n number of pixels from an image whose value is one and change those pixels value to zero?

채택된 답변

Thorsten
Thorsten 2015년 5월 28일
ind = find(I == 1);
r = randperm(numel(ind));
r = r(1:n);
I(ind) = 0;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

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

Community Treasure Hunt

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

Start Hunting!

Translated by