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

2 visualizzazioni (ultimi 30 giorni)
How to randomly select n number of pixels from an image whose value is one and change those pixels value to zero?

Risposta accettata

Thorsten
Thorsten il 28 Mag 2015
ind = find(I == 1);
r = randperm(numel(ind));
r = r(1:n);
I(ind) = 0;

Più risposte (0)

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by