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

1 Ansicht (letzte 30 Tage)
How to randomly select n number of pixels from an image whose value is one ?

Akzeptierte Antwort

Thorsten
Thorsten am 28 Mai 2015
ind = find(I == 1);
r = randperm(numel(ind));
r = r(1:n);
  1 Kommentar
Anushka
Anushka am 28 Mai 2015
Thank you sir.After selecting this pixels How to change the values of this pixels in the image to zero.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by