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

1 view (last 30 days)
How to randomly select n number of pixels from an image whose value is one ?

Accepted Answer

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

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!