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

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

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Image Processing Toolbox 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