Adding high density salt and pepper noise to an image

1 回表示 (過去 30 日間)
Avinash Bhatt
Avinash Bhatt 2019 年 5 月 16 日
コメント済み: Roaa Mohammed 2019 年 12 月 3 日
I am taking 'cameraman.tif' as my input image.
How can I add high density salt and pepper noise to it so that if I place 3X3 window over it and scan for uncorrupted pixels in it the uncorrupted pixels will come out to be 3?
Please provide matlab code for this
  1 件のコメント
Roaa Mohammed
Roaa Mohammed 2019 年 12 月 3 日
clc; img = imread('cameraman.tif'); na = imnoise(img,'salt & pepper',0.02); black=3; white=253; nb = img; Rmatrix = randint(size(img,1),size(img,2),[0,255]); nb(Rmatrix <= black) = 0; nb(Rmatrix >= white) = 255; subplot 131;imshow(img),title('ORIGINAL IMAGE'); subplot 132;imshow(na),title('NOISE USING FUNCTION'); subplot 133;imshow(nb),title('NOISE WITHOUT USING FUNCTION');

サインインしてコメントする。

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by