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

 Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Images finden Sie in Hilfe-Center und File Exchange

Tags

Noch keine Tags eingegeben.

Gefragt:

am 28 Mai 2015

Kommentiert:

am 28 Mai 2015

Community Treasure Hunt

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

Start Hunting!

Translated by