adding noise to images
1 回表示 (過去 30 日間)
古いコメントを表示
hi
i need to add x% noise ONLY to black areas of my image (image is grayscale) so x% of the black areas be replaced with white (changing 0 to 255)
0 件のコメント
回答 (1 件)
David Hill
2021 年 4 月 15 日
編集済み: David Hill
2021 年 4 月 15 日
black=find(image==0);
white=randperm(length(black),floor(x/100*length(black)));
image(white)=uint8(255);
2 件のコメント
David Hill
2021 年 4 月 15 日
編集済み: David Hill
2021 年 4 月 15 日
You could put in a range. My guess is that you think it is black but is not (==0).
black=find(image<10);%change range until you are satisfied.
参考
カテゴリ
Help Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!