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

1 vue (au cours des 30 derniers jours)
Anushka
Anushka le 28 Mai 2015
Commenté : Anushka le 28 Mai 2015
How to randomly select n number of pixels from an image whose value is one ?

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by