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

2 ビュー (過去 30 日間)
How to randomly select n number of pixels from an image whose value is one and change those pixels value to zero?

採用された回答

Thorsten
Thorsten 2015 年 5 月 28 日
ind = find(I == 1);
r = randperm(numel(ind));
r = r(1:n);
I(ind) = 0;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by